:root {
  color-scheme: light;
  --forest-950: #071914;
  --forest-900: #0d2a21;
  --forest-850: #12352a;
  --forest-800: #173f32;
  --forest-700: #245842;
  --forest-600: #327255;
  --moss-500: #6f875a;
  --gold-500: #b69248;
  --gold-400: #d2b36b;
  --gold-200: #e8d6a8;
  --parchment-50: #fcf8ec;
  --parchment-100: #f7f0dc;
  --parchment-200: #eee4cb;
  --ink-900: #1f2b26;
  --ink-700: #45564d;
  --ink-500: #6b786f;
  --line: rgba(36, 88, 66, .18);
  --page: #e8e2d0;
  --surface: rgba(252, 248, 236, .94);
  --surface-solid: #fcf8ec;
  --surface-muted: #f2ead6;
  --sidebar: #0d2a21;
  --sidebar-text: #f6edd8;
  --sidebar-muted: #a9b9af;
  --shadow: 0 18px 50px rgba(13, 36, 29, .11);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --font-serif: "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink-900: #f3ead4;
  --ink-700: #c7c2b2;
  --ink-500: #9ea79f;
  --line: rgba(210, 179, 107, .18);
  --page: #071914;
  --surface: rgba(18, 49, 39, .94);
  --surface-solid: #123127;
  --surface-muted: #173f32;
  --sidebar: #061611;
  --shadow: 0 22px 58px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(182, 146, 72, .12), transparent 32rem),
    linear-gradient(180deg, var(--page), color-mix(in srgb, var(--page) 88%, var(--forest-900)));
  color: var(--ink-900);
  font-family: var(--font-sans);
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .18;
  background-image:
    linear-gradient(90deg, transparent 49.7%, rgba(36, 88, 66, .06) 50%, transparent 50.3%),
    linear-gradient(transparent 49.7%, rgba(36, 88, 66, .04) 50%, transparent 50.3%);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 999;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--forest-800);
  color: white;
}
.skip-link:focus { top: 16px; }

.app-shell {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 40% -10%, rgba(210, 179, 107, .18), transparent 18rem),
    var(--sidebar);
  color: var(--sidebar-text);
  border-right: 1px solid rgba(210,179,107,.18);
}
.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 64px;
  padding: 5px 7px 19px;
  text-decoration: none;
  border-bottom: 1px solid rgba(232,214,168,.16);
}
.sidebar__brand img { flex: 0 0 auto; }
.sidebar__brand span { display: grid; line-height: 1.2; }
.sidebar__brand strong { font-family: var(--font-serif); letter-spacing: .04em; }
.sidebar__brand small { margin-top: 5px; color: var(--sidebar-muted); font-size: .74rem; }

.sidebar__nav { display: grid; gap: 4px; padding: 14px 0; }
.nav-label {
  margin: 14px 12px 5px;
  color: var(--sidebar-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .13em;
}
.nav-link, .sidebar-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--sidebar-text);
  text-decoration: none;
  cursor: pointer;
}
.nav-link span, .sidebar-action span {
  display: grid;
  place-items: center;
  width: 24px;
  color: var(--gold-400);
  font-size: 1.05rem;
}
.nav-link b, .sidebar-action b { font-size: .91rem; font-weight: 600; }
.nav-link:hover, .sidebar-action:hover {
  background: rgba(255,255,255,.06);
  border-color: rgba(210,179,107,.14);
}
.nav-link.is-active {
  background: linear-gradient(110deg, rgba(210,179,107,.2), rgba(255,255,255,.05));
  border-color: rgba(210,179,107,.34);
  color: #fff7e7;
}
.nav-link--sub { min-height: 38px; padding-left: 24px; }
.nav-link--sub b { font-size: .84rem; color: #d9ddda; }

.sidebar__footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid rgba(232,214,168,.16);
}
.sidebar__footer small { padding: 10px 12px 0; color: var(--sidebar-muted); font-size: .72rem; }

.workspace-shell { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 74px;
  padding: 11px clamp(20px, 3vw, 44px);
  background: color-mix(in srgb, var(--surface-solid) 87%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.menu-button { display: none; }
.menu-button, .icon-button {
  flex: 0 0 auto;
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.menu-button:hover, .icon-button:hover { border-color: var(--gold-500); }
.topbar__title { display: grid; min-width: 0; line-height: 1.25; }
.topbar__title small { color: var(--ink-500); font-size: .72rem; }
.topbar__title strong {
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 1.17rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar__actions { display: flex; gap: 8px; margin-left: auto; }
.topbar__actions .icon-button { font-size: 1.1rem; }

.workspace {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(24px, 3.5vw, 54px);
}
.site-footer {
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px clamp(24px, 3.5vw, 54px) 48px;
  color: var(--ink-500);
  font-size: .82rem;
}
.site-footer p { margin: 0; border-top: 1px solid var(--line); padding-top: 24px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-head__copy { max-width: 840px; }
.eyebrow {
  margin: 0 0 7px;
  color: var(--forest-600);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
}
html[data-theme="dark"] .eyebrow { color: var(--gold-400); }
.page-head h1, .hero-panel h1, .section-title, .detail-title {
  margin: 0;
  font-family: var(--font-serif);
  line-height: 1.25;
  letter-spacing: .025em;
}
.page-head h1 { font-size: clamp(1.85rem, 3vw, 3rem); }
.page-head p { margin: 12px 0 0; color: var(--ink-700); }
.page-meta { color: var(--ink-500); font-size: .82rem; white-space: nowrap; }

.hero-panel, .panel, .detail-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border-radius: var(--radius-xl);
}
.hero-panel::after {
  content: "✦";
  position: absolute;
  right: 4%;
  top: -28px;
  color: color-mix(in srgb, var(--gold-500) 28%, transparent);
  font-size: clamp(8rem, 17vw, 17rem);
  line-height: 1;
  pointer-events: none;
}
.hero-panel h1 { max-width: 900px; font-size: clamp(2rem, 4vw, 4.3rem); }
.hero-panel__lead { max-width: 800px; margin: 18px 0 0; color: var(--ink-700); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.primary-button, .secondary-button, .text-button {
  min-height: 44px;
  padding: 10px 17px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
}
.primary-button {
  border: 1px solid var(--forest-700);
  background: var(--forest-700);
  color: #fff;
}
.primary-button:hover { background: var(--forest-600); }
.secondary-button { border: 1px solid var(--line); background: var(--surface-solid); }
.secondary-button:hover { border-color: var(--gold-500); }
.text-button { border: 0; background: transparent; color: var(--ink-500); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
  margin-top: 18px;
}
.metric {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.metric strong { display: block; color: var(--forest-600); font-family: var(--font-serif); font-size: 1.8rem; }
html[data-theme="dark"] .metric strong { color: var(--gold-400); }
.metric span { color: var(--ink-500); font-size: .8rem; }

.section-block { margin-top: 34px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.section-title { font-size: clamp(1.4rem, 2vw, 2rem); }
.section-note { color: var(--ink-500); font-size: .82rem; }

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}
.portal-card {
  display: grid;
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}
.portal-card:hover { transform: translateY(-3px); border-color: var(--gold-500); }
.portal-card__icon { color: var(--gold-500); font-size: 1.6rem; }
.portal-card strong { align-self: end; font-family: var(--font-serif); font-size: 1.22rem; }
.portal-card small { margin-top: 4px; color: var(--ink-500); }

.update-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.update-strip + .update-strip { margin-top: 9px; }
.update-strip time { color: var(--ink-500); font-size: .77rem; }
.update-strip p { margin: 0; }
.update-strip a { color: var(--forest-600); font-size: .82rem; }
html[data-theme="dark"] .update-strip a { color: var(--gold-400); }

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
}
.search-input:focus-within { border-color: var(--gold-500); box-shadow: 0 0 0 4px rgba(182,146,72,.12); }
.search-input input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink-900); }
.search-panel select {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--ink-900);
}
.search-results { margin-top: 18px; }
.result-group + .result-group { margin-top: 24px; }
.result-group h2 { margin: 0 0 10px; font-family: var(--font-serif); font-size: 1.2rem; }
.result-list { display: grid; gap: 9px; }
.result-row {
  display: grid;
  grid-template-columns: minmax(160px,.7fr) 1.5fr auto;
  gap: 15px;
  align-items: center;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
}
.result-row strong { font-family: var(--font-serif); }
.result-row p { margin: 0; color: var(--ink-700); font-size: .9rem; }
.result-row a { color: var(--forest-600); font-weight: 700; text-decoration: none; }
html[data-theme="dark"] .result-row a { color: var(--gold-400); }

.status-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}
.status-confirmed { color: #1f664a; background: #e3f2e9; border-color: #abd1bd; }
.status-tested { color: #765414; background: #f7eac5; border-color: #dbc177; }
.status-testing { color: #84531d; background: #f9e3c8; border-color: #e3b37d; }
.status-reference { color: #405b78; background: #e5edf5; border-color: #b8c9dc; }
.status-unknown { color: #5c6260; background: #eceeed; border-color: #c9cecc; }
html[data-theme="dark"] .status-badge { filter: saturate(.75) brightness(.82); color: #fff; }

.master-detail {
  display: grid;
  grid-template-columns: minmax(420px, .9fr) minmax(440px, 1.1fr);
  gap: 20px;
  align-items: start;
}
.panel { border-radius: var(--radius-lg); padding: 20px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  min-height: 37px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  cursor: pointer;
}
.chip.is-active { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-200) 38%, var(--surface-solid)); }

.skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.skill-tile {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-solid);
  cursor: pointer;
  text-align: left;
}
.skill-tile:hover, .skill-tile.is-active { border-color: var(--gold-500); }
.skill-tile.is-active { background: color-mix(in srgb, var(--gold-200) 30%, var(--surface-solid)); }
.skill-tile__icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--forest-700) 12%, var(--surface-muted));
  color: var(--forest-600);
}
html[data-theme="dark"] .skill-tile__icon { color: var(--gold-400); }
.skill-tile strong { display: block; font-size: .9rem; }
.skill-tile small { color: var(--ink-500); font-size: .7rem; }

.detail-panel {
  position: sticky;
  top: 94px;
  min-height: 420px;
  padding: clamp(21px, 2.5vw, 32px);
  border-radius: var(--radius-xl);
}
.detail-kicker { margin: 0 0 5px; color: var(--forest-600); font-weight: 800; font-size: .75rem; letter-spacing: .1em; }
html[data-theme="dark"] .detail-kicker { color: var(--gold-400); }
.detail-title { font-size: 1.75rem; }
.detail-intro { color: var(--ink-700); }
.attribution {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  color: var(--ink-500);
  font-size: .78rem;
}
.guide-stack { display: grid; gap: 10px; margin-top: 22px; }
.guide-entry {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-solid);
}
.guide-entry__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.guide-entry h3 { margin: 0; font-size: 1rem; }
.guide-entry p { margin: 9px 0 0; color: var(--ink-700); font-size: .9rem; }
.guide-entry dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  margin: 12px 0 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
}
.guide-entry dt { color: var(--ink-500); }
.guide-entry dd { margin: 0; }

.cooking-layout { display: grid; grid-template-columns: 220px minmax(0,1fr); gap: 20px; }
.level-nav { position: sticky; top: 94px; display: grid; gap: 8px; }
.level-nav button {
  display: flex;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  cursor: pointer;
}
.level-nav button.is-active { border-color: var(--gold-500); background: color-mix(in srgb, var(--gold-200) 30%, var(--surface)); }
.cooking-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.cooking-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.cooking-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cooking-card h2 { margin: 0; font-family: var(--font-serif); font-size: 1.18rem; }
.cooking-card p { margin: 10px 0 0; color: var(--ink-700); font-size: .9rem; }
.cooking-card dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 11px; margin: 14px 0 0; font-size: .83rem; }
.cooking-card dt { color: var(--ink-500); }
.cooking-card dd { margin: 0; }

.afk-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.afk-card {
  padding: 21px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.afk-card__mark { color: var(--gold-500); font-size: 1.6rem; }
.afk-card h2 { margin: 12px 0 3px; font-family: var(--font-serif); font-size: 1.25rem; }
.afk-card p { margin: 10px 0; color: var(--ink-700); }
.afk-card dl { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; font-size: .84rem; }
.afk-card dt { color: var(--ink-500); }
.afk-card dd { margin: 0; }

.profession-grid {
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 12px;
}
.profession-card {
  display: grid;
  min-height: 142px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
}
.profession-card:hover { border-color: var(--gold-500); }
.profession-card__icon { color: var(--gold-500); font-size: 1.35rem; }
.profession-card strong { align-self: end; font-family: var(--font-serif); }
.profession-card small { color: var(--ink-500); }
.profession-card.is-documented { background: linear-gradient(145deg, color-mix(in srgb, var(--gold-200) 22%, var(--surface)), var(--surface)); }

.profession-hero {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(260px,.7fr);
  gap: 22px;
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.profession-hero h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2rem,3vw,3.3rem); }
.profession-hero p { color: var(--ink-700); white-space: pre-line; }
.profession-summary {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border-radius: 18px;
  background: var(--surface-muted);
}
.profession-summary span { color: var(--ink-500); font-size: .78rem; }
.profession-summary strong { font-size: 1.3rem; }
.skill-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 24px; }
.skill-column {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}
.skill-column h2 { margin: 0 0 14px; font-family: var(--font-serif); }
.combat-skill-list { display: grid; gap: 9px; }
.combat-skill {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
}
.combat-skill__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--forest-700) 14%, var(--surface-muted));
  color: var(--gold-500);
  font-weight: 800;
}
.combat-skill strong { display: block; }
.combat-skill small { color: #c53c34; }
.combat-skill__type { color: var(--ink-500); font-size: .75rem; }
.combat-skill.is-locked { opacity: .58; }

.timeline { display: grid; gap: 10px; }
.timeline-entry {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.timeline-entry time { color: var(--ink-500); font-size: .8rem; }
.timeline-entry h2 { margin: 0; font-family: var(--font-serif); font-size: 1.05rem; }
.timeline-entry p { margin: 5px 0 0; color: var(--ink-700); }

.contribute-panel {
  max-width: 900px;
  padding: clamp(28px,5vw,58px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.contribute-panel h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2rem,4vw,3.5rem); }
.contribute-panel p { color: var(--ink-700); }
.rule-list { display: grid; gap: 10px; padding: 0; list-style: none; }
.rule-list li { padding: 13px 15px; border-left: 3px solid var(--gold-500); background: var(--surface-muted); border-radius: 0 12px 12px 0; }

.empty-state {
  padding: 44px 20px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--ink-500);
  text-align: center;
}

.drawer-backdrop { display: none; }
.tour {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: end center;
  padding: 24px;
}
.tour__backdrop { position: absolute; inset: 0; background: rgba(5,18,14,.72); }
.tour__card {
  position: relative;
  z-index: 1;
  width: min(570px,100%);
  padding: 27px;
  border: 1px solid rgba(210,179,107,.42);
  border-radius: 24px;
  background: var(--surface-solid);
  box-shadow: 0 30px 90px rgba(0,0,0,.36);
}
.tour__card h2 { margin: 0; font-family: var(--font-serif); }
.tour__step { color: var(--ink-500); font-size: .8rem; }
.tour__actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.tour__actions > div { display: flex; gap: 8px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 220;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--forest-900);
  color: #fff;
  box-shadow: var(--shadow);
}

@media (max-width: 1279px) {
  .app-shell { grid-template-columns: 92px minmax(0,1fr); }
  .sidebar { padding-inline: 10px; }
  .sidebar__brand { justify-content: center; }
  .sidebar__brand span, .nav-label, .nav-link b, .sidebar-action b, .sidebar__footer small { display: none; }
  .nav-link, .sidebar-action { justify-content: center; padding-inline: 8px; }
  .nav-link span, .sidebar-action span { width: 28px; font-size: 1.18rem; }
  .nav-link--sub { padding-left: 8px; }
  .portal-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profession-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .master-detail { grid-template-columns: minmax(360px,.85fr) minmax(390px,1.15fr); }
}

@media (max-width: 959px) {
  .app-shell { display: block; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(310px, 86vw);
    height: 100dvh;
    padding: 22px 16px 18px;
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: 18px 0 50px rgba(0,0,0,.28);
  }
  body.drawer-open { overflow: hidden; }
  body.drawer-open .sidebar { transform: translateX(0); }
  .sidebar__brand { justify-content: flex-start; }
  .sidebar__brand span, .nav-label, .nav-link b, .sidebar-action b, .sidebar__footer small { display: initial; }
  .nav-link, .sidebar-action { justify-content: flex-start; padding-inline: 12px; }
  .nav-link--sub { padding-left: 24px; }
  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: block;
    background: rgba(4,14,11,.58);
  }
  .menu-button { display: inline-grid; place-items: center; }
  .topbar { min-height: 66px; padding-inline: 16px; }
  .workspace { padding: 24px 18px 36px; }
  .site-footer { padding: 18px 18px 38px; }
  .master-detail, .cooking-layout { grid-template-columns: 1fr; }
  .detail-panel, .level-nav { position: static; }
  .level-nav { display: flex; overflow-x: auto; }
  .level-nav button { flex: 0 0 auto; min-width: 130px; }
  .skill-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .profession-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .afk-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 680px) {
  .topbar__actions #top-theme-toggle { display: none; }
  .workspace { padding-inline: 14px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-meta { white-space: normal; }
  .hero-panel { padding: 25px 20px; }
  .hero-panel::after { font-size: 8rem; opacity: .5; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .portal-grid, .cooking-grid, .afk-grid, .skill-columns { grid-template-columns: 1fr; }
  .portal-card { min-height: 125px; }
  .search-panel { grid-template-columns: 1fr; }
  .result-row { grid-template-columns: 1fr; gap: 7px; }
  .result-row a { justify-self: start; }
  .skill-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profession-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .profession-card { min-height: 120px; }
  .profession-hero { grid-template-columns: 1fr; }
  .timeline-entry { grid-template-columns: 1fr; gap: 5px; }
  .update-strip { grid-template-columns: 1fr; gap: 5px; }
  .tour { padding: 14px; }
  .tour__card { padding: 22px 18px; }
  .tour__actions { align-items: stretch; flex-direction: column-reverse; }
  .tour__actions > div { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .skill-grid, .profession-grid { grid-template-columns: 1fr 1fr; }
  .skill-tile { grid-template-columns: 32px 1fr; padding: 10px; }
  .skill-tile__icon { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
