:root {
  --bg: #efe7db;
  --bg-deep: #e5d8c7;
  --paper: rgba(255, 250, 244, 0.92);
  --paper-strong: #fffaf3;
  --paper-muted: rgba(250, 243, 234, 0.78);
  --ink: #201914;
  --muted: #6c5f55;
  --line: rgba(68, 48, 31, 0.12);
  --line-strong: rgba(68, 48, 31, 0.22);
  --accent: #b34b31;
  --accent-deep: #8c351f;
  --gold: #aa8234;
  --pine: #415046;
  --pine-deep: #29342d;
  --danger: #8e3b2b;
  --shadow: 0 24px 52px rgba(47, 30, 16, 0.1);
  --shadow-soft: 0 14px 32px rgba(47, 30, 16, 0.06);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Source Han Serif SC", "Songti SC", "STSong", "Microsoft YaHei", serif;
  line-height: 1.7;
  background:
    radial-gradient(circle at top left, rgba(170, 130, 52, 0.16), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(179, 75, 49, 0.12), transparent 26%),
    linear-gradient(180deg, #f6efe6 0%, #f1e8dd 38%, #e8ddcf 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(28px);
  pointer-events: none;
  z-index: -1;
}

body::before {
  top: -7rem;
  left: -7rem;
  width: 20rem;
  height: 20rem;
  background: rgba(170, 130, 52, 0.14);
}

body::after {
  right: -8rem;
  bottom: -8rem;
  width: 24rem;
  height: 24rem;
  background: rgba(65, 80, 70, 0.12);
}

.page-shell {
  width: min(1500px, calc(100vw - 30px));
  margin: 18px auto 42px;
}

.topbar,
.hero,
.panel-card,
.overview-card,
.part-block,
.deck-section,
.question-board,
.mantra-block {
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: grid;
  gap: 18px;
  padding: 14px 18px;
  border-radius: 28px;
  background: rgba(255, 250, 243, 0.86);
  margin-bottom: 18px;
}

.topbar-mainrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand {
  display: grid;
  gap: 2px;
}

.topbar-brand strong {
  font-size: 1rem;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-link,
.part-chip,
.mini-link,
.bucket-link,
.subtle-button,
.menu-toggle,
.topbar-fold-toggle,
.group-jump-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.topbar-link,
.part-chip,
.mini-link,
.bucket-link,
.subtle-button,
.topbar-fold-toggle {
  padding: 10px 14px;
  font-size: 13px;
}

.topbar-link:hover,
.topbar-link:focus-visible,
.topbar-link.is-active,
.part-chip:hover,
.part-chip:focus-visible,
.mini-link:hover,
.mini-link:focus-visible,
.bucket-link:hover,
.bucket-link:focus-visible,
.subtle-button:hover,
.subtle-button:focus-visible,
.topbar-fold-toggle:hover,
.topbar-fold-toggle:focus-visible,
.menu-toggle:hover,
.menu-toggle:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(179, 75, 49, 0.3);
  background: rgba(179, 75, 49, 0.08);
}

.topbar-link.is-active {
  color: var(--accent-deep);
}

.part-chip {
  padding: 11px 16px;
  color: var(--accent-deep);
}

.part-chip-primary {
  border-color: rgba(179, 75, 49, 0.28);
  background: rgba(179, 75, 49, 0.12);
}

.part-chip-strong {
  border-color: rgba(65, 80, 70, 0.22);
  background: rgba(65, 80, 70, 0.1);
}

.part-chip-muted {
  border-color: rgba(142, 59, 43, 0.18);
  background: rgba(142, 59, 43, 0.08);
}

.is-hidden {
  display: none !important;
}

.menu-toggle {
  padding: 10px 16px;
  font: inherit;
  cursor: pointer;
  display: none;
}

.topbar-fold-toggle {
  display: none;
  font: inherit;
  cursor: pointer;
}

.eyebrow,
.kicker,
.panel-label,
.section-number,
.case-index {
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow,
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 12px;
}

.eyebrow::before,
.kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: 0 0 0 6px rgba(179, 75, 49, 0.08);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(140deg, rgba(255, 251, 245, 0.96), rgba(247, 240, 232, 0.92)),
    linear-gradient(140deg, rgba(179, 75, 49, 0.04), rgba(170, 130, 52, 0.04));
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -5rem;
  top: -5rem;
  width: 18rem;
  height: 18rem;
  border-radius: 38% 62% 60% 40% / 42% 37% 63% 58%;
  background: linear-gradient(135deg, rgba(179, 75, 49, 0.14), rgba(140, 53, 31, 0.06));
}

.hero-main,
.hero-panel,
.hero-support-grid {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 12px 0 12px;
  max-width: 13ch;
  font-size: clamp(2rem, 3vw, 3.45rem);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-summary,
.section-summary,
.question-card p,
.flow-step p,
.case-context,
.review-template-summary,
.review-template-answer,
.shortcut-card p,
.bucket-head p,
.overview-grid p,
.hero-support-card p {
  color: var(--muted);
}

.hero-summary {
  margin: 0;
  max-width: 52ch;
  font-size: 15px;
}

.premise-callout {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(179, 75, 49, 0.18);
  background: linear-gradient(180deg, rgba(255, 249, 244, 0.92), rgba(250, 240, 232, 0.88));
}

.premise-callout strong {
  color: var(--ink);
  font-size: 1.02rem;
  line-height: 1.45;
}

.premise-callout p {
  margin: 0;
  color: var(--muted);
}

.premise-callout-hero {
  max-width: 56ch;
}

.premise-label {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(179, 75, 49, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1.08;
  color: var(--accent);
}

.hero-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(65, 80, 70, 0.96), rgba(42, 52, 46, 0.98));
  color: #f7f0e7;
}

.hero-note-block {
  display: grid;
  gap: 10px;
}

.workbench-head {
  gap: 12px;
}

.hero-note-block h3 {
  margin: 0;
  font-size: 1.12rem;
}

.panel-label {
  margin: 0 0 14px;
  font-size: 12px;
  opacity: 0.72;
}

.hero-steps {
  margin: 0;
  padding-left: 20px;
}

.hero-steps li + li {
  margin-top: 10px;
}

.workspace-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.workspace-stats article {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace-stats strong,
.annotation-stat strong {
  display: block;
  font-size: 1.4rem;
  line-height: 1;
}

.workspace-stats span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(247, 240, 231, 0.74);
}

.theme-preset-row,
.workbench-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workbench-link-grid .mini-link,
.hero-panel .mini-link,
.hero-panel .subtle-button {
  white-space: normal;
  line-height: 1.35;
}

.workbench-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 240, 231, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

.theme-preset-chip {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: #f7f0e7;
  font: inherit;
  cursor: pointer;
}

.theme-preset-chip.is-active {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.16);
  color: #fffaf3;
}

.workspace-brief-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.workspace-brief-card,
.workspace-board-column {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
}

.workspace-brief-card strong,
.workspace-board-column strong {
  color: #fffaf3;
}

.workspace-brief-card p,
.workspace-board-column p {
  margin: 0;
  color: rgba(247, 240, 231, 0.74);
  font-size: 13px;
}

.workspace-brief-label {
  display: inline-flex;
  width: fit-content;
  color: rgba(247, 240, 231, 0.78);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.workspace-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.hero-support-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.hero-support-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow-soft);
}

.hero-support-card h3,
.overview-grid h3,
.question-card h3,
.shortcut-card h3,
.bucket-card h3,
.flow-step h3 {
  margin: 8px 0 0;
  font-size: 1.02rem;
  line-height: 1.35;
}

.manual-card {
  position: relative;
  background: rgba(255, 255, 255, 0.74);
}

.manual-index {
  display: inline-flex;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(179, 75, 49, 0.08);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.support-list,
.support-list.ordered {
  margin: 14px 0 0;
  padding-left: 18px;
}

.support-list li + li,
.question-card li + li,
.case-points li + li,
.mantra-card li + li {
  margin-top: 7px;
}

.support-chips,
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.content-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 104px);
  overflow: hidden;
}

.sidebar-inner {
  display: grid;
  gap: 14px;
  max-height: inherit;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.sidebar .panel-card {
  padding: 18px;
}

.sidebar-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-backdrop {
  display: none;
}

.panel-card,
.overview-card,
.part-block,
.deck-section,
.question-board,
.mantra-block {
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--paper);
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.panel-head.compact {
  margin-bottom: 10px;
}

.panel-head h2,
.section-heading h2,
.deck-section h2 {
  margin: 0;
  font-size: clamp(1.42rem, 2vw, 2rem);
  line-height: 1.18;
}

.panel-head h3,
.section-heading.compact h2 {
  margin: 0;
  font-size: clamp(1.18rem, 1.8vw, 1.6rem);
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.search-card input,
.search-card select,
.note-input,
.note-area {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

.search-card input,
.search-card select,
.note-input {
  padding: 12px 14px;
}

.search-card select {
  appearance: none;
}

.note-area {
  min-height: 110px;
  padding: 12px 14px;
  resize: vertical;
}

.note-area.compact {
  min-height: 84px;
}

.search-card input:focus,
.search-card select:focus,
.note-input:focus,
.note-area:focus {
  outline: 2px solid rgba(179, 75, 49, 0.18);
  border-color: rgba(179, 75, 49, 0.3);
}

.filter-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.result-count {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.filter-group-stack {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.filter-block {
  display: grid;
  gap: 8px;
}

.chip-row,
.topic-cloud,
.section-tags,
.card-tags,
.state-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip,
.topic-chip,
.tag,
.state-chip,
.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font-size: 12px;
}

.filter-chip,
.topic-chip,
.tag,
.state-chip,
.preset-chip {
  padding: 8px 12px;
}

.filter-chip,
.topic-chip,
.preset-chip {
  cursor: pointer;
  font: inherit;
}

.filter-chip.is-active,
.preset-chip.is-active {
  background: rgba(179, 75, 49, 0.12);
  border-color: rgba(179, 75, 49, 0.3);
  color: var(--accent-deep);
}

.filter-chip:hover,
.topic-chip:hover,
.preset-chip:hover,
.filter-chip:focus-visible,
.topic-chip:focus-visible,
.preset-chip:focus-visible {
  outline: none;
  border-color: rgba(179, 75, 49, 0.28);
  background: rgba(179, 75, 49, 0.08);
}

.annotation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.annotation-stat {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.annotation-stat span {
  color: var(--muted);
}

.annotation-stat strong {
  color: var(--accent-deep);
}

.toc {
  max-height: 42vh;
  overflow-y: auto;
}

#basics-toc {
  max-height: 30vh;
}

.toc h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.toc-link:hover,
.toc-link:focus-visible,
.toc-link.is-active {
  outline: none;
  transform: translateX(3px);
  border-color: rgba(179, 75, 49, 0.28);
  background: rgba(179, 75, 49, 0.08);
}

.toc-link > span:last-child {
  color: var(--muted);
  font-size: 12px;
  flex-shrink: 0;
}

.toc-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.main-content {
  display: grid;
  gap: 18px;
}

.section-heading p,
.execution-copy p {
  color: var(--muted);
}

.overview-grid,
.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.overview-grid article,
.question-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.overview-grid article {
  background: rgba(255, 255, 255, 0.78);
}

.quick-entry-card {
  min-height: 0;
}

.quick-entry-card p {
  margin-bottom: 0;
}

.part-header,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.section-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.part-inner + .part-inner,
.part-inner + .content-sections,
.content-sections > * + * {
  margin-top: 18px;
}

.content-sections {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.section-stat {
  min-width: 112px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(179, 75, 49, 0.95), rgba(140, 53, 31, 1));
  color: #fff8f2;
  text-align: right;
}

.section-stat strong {
  display: block;
  font-size: 1.7rem;
  line-height: 1.08;
}

.section-stat span {
  font-size: 12px;
  opacity: 0.82;
}

.mantra-grid,
.card-grid,
.shortcut-grid,
.outline-grid,
.bucket-grid,
.flow-grid {
  display: grid;
  gap: 16px;
}

.mantra-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-top: 18px;
}

.mantra-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
}

.mantra-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.mantra-card ul,
.question-card ul,
.case-points {
  margin: 12px 0 0;
  padding-left: 18px;
}

.question-card strong,
.mantra-card strong,
.flow-step strong,
.case-points strong,
.hero-panel strong,
.support-list strong {
  color: var(--ink);
}

.execution-board {
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(320px, 1.12fr);
  gap: 18px;
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, rgba(65, 80, 70, 0.98), rgba(40, 49, 43, 1));
  color: #faf3ea;
}

.execution-copy h3 {
  margin: 10px 0 0;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.execution-copy p {
  color: rgba(250, 243, 234, 0.72);
}

.execution-list {
  margin: 0;
  padding-left: 20px;
}

.mode-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cases-toolbar {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.view-toggle {
  padding: 10px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.view-toggle:hover,
.view-toggle:focus-visible {
  outline: none;
  color: var(--accent-deep);
}

.view-toggle.is-active {
  background: linear-gradient(135deg, rgba(179, 75, 49, 0.14), rgba(170, 130, 52, 0.14));
  color: var(--accent-deep);
  box-shadow: inset 0 0 0 1px rgba(179, 75, 49, 0.14);
}

.view-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.shortcut-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.bucket-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 16px;
}

.shortcut-card,
.bucket-card {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.shortcut-stats,
.outline-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.shortcut-links,
.bucket-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.cases-group-bar {
  position: sticky;
  top: 92px;
  z-index: 8;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(65, 80, 70, 0.12);
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.96), rgba(248, 240, 231, 0.92));
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}

.desk-jump-head {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: fit-content;
  padding: 0 2px 0 0;
}

.desk-jump-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.desk-jump-head strong {
  color: var(--accent-deep);
}

.group-jump-chip {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  cursor: pointer;
  text-align: left;
  justify-content: flex-start;
}

.group-hotkey {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: rgba(65, 80, 70, 0.08);
  color: var(--pine);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.group-copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.group-jump-chip.is-live {
  border-color: rgba(179, 75, 49, 0.34);
  background: rgba(179, 75, 49, 0.1);
  box-shadow: 0 12px 28px rgba(179, 75, 49, 0.14);
}

.group-jump-chip.is-current {
  border-color: rgba(179, 75, 49, 0.34);
  background: rgba(179, 75, 49, 0.1);
  color: var(--accent-deep);
}

.cases-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-top: 16px;
}

.cases-overview-panel {
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.cases-overview-head {
  display: grid;
  gap: 6px;
}

.cases-overview-head h3 {
  margin: 0;
  font-size: 1.08rem;
}

#cases-outline {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 16px;
}

.outline-card,
.section-cluster {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
}

.outline-card {
  display: grid;
  gap: 12px;
}

.outline-card h3 {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.42;
}

.outline-card p {
  margin: 0;
  color: var(--muted);
}

.outline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-stack {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.section-cluster .cases-grid {
  margin-top: 16px;
  grid-template-columns: 1fr;
}

.bucket-must {
  background: linear-gradient(180deg, rgba(255, 248, 241, 0.94), rgba(250, 238, 227, 0.9));
}

.bucket-best {
  background: linear-gradient(180deg, rgba(255, 250, 241, 0.94), rgba(248, 240, 221, 0.92));
}

.bucket-can {
  background: linear-gradient(180deg, rgba(247, 251, 246, 0.94), rgba(237, 245, 235, 0.92));
}

.bucket-caution {
  background: linear-gradient(180deg, rgba(252, 247, 239, 0.94), rgba(246, 236, 220, 0.92));
}

.bucket-avoid {
  background: linear-gradient(180deg, rgba(254, 244, 240, 0.94), rgba(249, 232, 228, 0.92));
}

.tag {
  padding: 7px 12px;
}

.tag-must {
  border-color: rgba(179, 75, 49, 0.22);
  background: rgba(179, 75, 49, 0.12);
  color: var(--accent-deep);
}

.tag-best {
  border-color: rgba(170, 130, 52, 0.22);
  background: rgba(170, 130, 52, 0.14);
  color: #7b5b1a;
}

.tag-can {
  border-color: rgba(65, 80, 70, 0.22);
  background: rgba(65, 80, 70, 0.12);
  color: #31473d;
}

.tag-caution {
  border-color: rgba(136, 99, 46, 0.22);
  background: rgba(170, 130, 52, 0.12);
  color: #6d521c;
}

.tag-avoid {
  border-color: rgba(142, 59, 43, 0.22);
  background: rgba(142, 59, 43, 0.12);
  color: #7b2f23;
}

.deck-section {
  scroll-margin-top: 92px;
}

.basics-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin-top: 18px;
}

.cases-grid {
  grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
  margin-top: 18px;
}

.study-card {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.study-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(179, 75, 49, 0.24);
}

.thumb-button {
  padding: 0;
  border: 0;
  cursor: zoom-in;
  background: #e9ded1;
}

.thumb-button img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.case-study-card .thumb-button img {
  object-fit: contain;
  background: #eee3d6;
  padding: 10px;
  aspect-ratio: 16 / 10;
}

.case-study-card {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.95fr);
  align-items: stretch;
}

.case-study-card .thumb-button {
  height: 100%;
  background: #f0e5d8;
}

.case-study-card .thumb-button img {
  height: 100%;
  min-height: 380px;
  padding: 18px;
  aspect-ratio: auto;
}

.section-cluster .case-study-card {
  grid-template-columns: 1fr;
}

.section-cluster .case-study-card .thumb-button img {
  height: auto;
  min-height: 0;
  padding: 12px;
  aspect-ratio: 16 / 9;
}

.section-cluster .case-study-card .thumb-button {
  height: auto;
}

.section-cluster .case-study-card .card-body {
  gap: 12px;
  padding: 18px;
}

.section-cluster .case-study-card .case-title {
  font-size: 1.2rem;
  line-height: 1.32;
}

.section-cluster .case-study-card .case-context {
  -webkit-line-clamp: 4;
}

.section-cluster .case-study-card .case-points {
  font-size: 15px;
}

.card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.case-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.case-index {
  color: var(--accent);
  font-size: 12px;
}

.case-stock {
  font-size: 12px;
  color: var(--pine);
}

.case-title {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.34;
}

.case-context {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.case-points {
  font-size: 14px;
}

.state-chip {
  background: rgba(255, 255, 255, 0.72);
}

.state-chip-reviewed {
  border-color: rgba(65, 80, 70, 0.24);
  background: rgba(65, 80, 70, 0.12);
  color: #2f463b;
}

.annotation-box {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(65, 80, 70, 0.12);
  background: linear-gradient(180deg, rgba(248, 244, 237, 0.96), rgba(244, 237, 229, 0.9));
}

.annotation-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.review-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.review-toggle input {
  accent-color: var(--pine);
}

.annotation-tip {
  color: var(--muted);
  font-size: 12px;
}

.preset-row,
.custom-tag-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.annotation-workflow,
.workflow-columns {
  display: grid;
  gap: 10px;
}

.workflow-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workflow-block {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(65, 80, 70, 0.1);
  background: rgba(255, 255, 255, 0.46);
}

.workflow-block-primary {
  background: rgba(255, 255, 255, 0.68);
}

.workflow-stephead {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.workflow-stephead p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.workflow-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: rgba(179, 75, 49, 0.1);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.decision-bar {
  display: grid;
  gap: 8px;
}

.decision-label {
  margin-bottom: 0;
}

.decision-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.decision-chip {
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.decision-chip.is-active {
  border-color: rgba(179, 75, 49, 0.28);
  background: rgba(179, 75, 49, 0.08);
  color: var(--accent-deep);
}

.workflow-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.workflow-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(65, 80, 70, 0.12);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.workflow-chip.is-active {
  border-color: rgba(65, 80, 70, 0.26);
  background: rgba(65, 80, 70, 0.1);
  color: #31473d;
}

.note-input-compact {
  padding: 10px 12px;
}

.state-chip-do {
  border-color: rgba(65, 80, 70, 0.24);
  background: rgba(65, 80, 70, 0.12);
  color: #31473d;
}

.state-chip-watch {
  border-color: rgba(170, 130, 52, 0.24);
  background: rgba(170, 130, 52, 0.12);
  color: #6d521c;
}

.state-chip-skip {
  border-color: rgba(142, 59, 43, 0.24);
  background: rgba(142, 59, 43, 0.12);
  color: #7b2f23;
}

.review-template-card .card-body {
  gap: 14px;
}

.review-template-intro {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(179, 75, 49, 0.14);
  background:
    linear-gradient(135deg, rgba(179, 75, 49, 0.08), rgba(170, 130, 52, 0.06)),
    rgba(255, 250, 243, 0.94);
}

.review-template-kicker,
.review-template-lead,
.review-template-summary,
.review-template-question,
.review-template-answer,
.review-template-note {
  margin: 0;
}

.review-template-kicker {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.review-template-lead {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.54;
}

.review-template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.review-template-item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.review-template-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(179, 75, 49, 0.12);
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

.review-template-question {
  font-size: 15px;
  line-height: 1.62;
}

.review-template-answer {
  font-size: 14px;
  line-height: 1.72;
}

.review-template-note {
  padding: 15px 18px;
  border-radius: 18px;
  border: 1px dashed rgba(65, 80, 70, 0.18);
  background: rgba(65, 80, 70, 0.06);
  line-height: 1.72;
}

.mobile-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 32;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 250, 243, 0.9);
  box-shadow: 0 16px 36px rgba(32, 25, 20, 0.14);
  backdrop-filter: blur(14px);
}

.mobile-dock-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  flex: 1 1 0;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.mobile-dock-button:hover,
.mobile-dock-button:focus-visible {
  outline: none;
  border-color: rgba(179, 75, 49, 0.3);
  background: rgba(179, 75, 49, 0.08);
}

.hidden {
  display: none !important;
}

.jump-target {
  outline: 2px solid rgba(179, 75, 49, 0.4);
  box-shadow: 0 0 0 8px rgba(179, 75, 49, 0.08);
}

.lightbox {
  width: min(1180px, calc(100vw - 24px));
  max-width: 1180px;
  padding: 18px;
  border: 0;
  border-radius: 24px;
  background: rgba(34, 28, 24, 0.96);
  color: #f8f1e9;
}

.lightbox::backdrop {
  background: rgba(21, 16, 13, 0.72);
}

.lightbox-close {
  margin-left: auto;
  display: block;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.lightbox-meta {
  margin: 14px 0;
}

.lightbox-meta p {
  margin: 0;
}

.lightbox-meta p + p {
  margin-top: 6px;
  color: rgba(248, 241, 233, 0.74);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 16px;
}

@media (max-width: 1320px) {
  .hero-support-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .hero,
  .content-layout,
  .execution-board,
  .part-header,
  .section-head {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .case-study-card {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(420px, 88vw);
    max-height: none;
    padding: 18px 18px 24px;
    transform: translateX(-104%);
    transition: transform 180ms ease;
    z-index: 40;
    background: rgba(247, 241, 233, 0.98);
    border-right: 1px solid var(--line);
    box-shadow: 0 22px 44px rgba(25, 19, 15, 0.16);
  }

  .sidebar-inner {
    max-height: 100%;
    overflow-y: auto;
    padding-right: 0;
  }

  .sidebar-mobile-head {
    display: flex;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(21, 16, 13, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
    z-index: 35;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100vw - 16px, 1500px);
    margin: 10px auto 110px;
  }

  .topbar {
    border-radius: 22px;
    gap: 12px;
    padding: 12px 14px;
  }

  .topbar-mainrow {
    width: 100%;
  }

  .topbar-nav {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  .topbar-fold-toggle {
    display: inline-flex;
  }

  body.topbar-collapsed .topbar {
    gap: 0;
  }

  body.topbar-collapsed .topbar-nav {
    display: none;
  }

  .hero,
  .panel-card,
  .overview-card,
  .part-block,
  .deck-section,
  .question-board,
  .mantra-block {
    padding: 16px;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.58rem, 6.6vw, 2.15rem);
  }

  .hero-summary {
    max-width: none;
    font-size: 13px;
    line-height: 1.6;
  }

  .hero-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-top: 14px;
  }

  .part-chip {
    white-space: nowrap;
    padding: 10px 13px;
  }

  .hero-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
  }

  .metric {
    padding: 10px 12px;
  }

  .hero-panel {
    padding: 16px;
  }

  .workspace-stats {
    margin-top: 12px;
    gap: 8px;
  }

  .workspace-brief-grid,
  .workspace-board {
    grid-template-columns: 1fr;
  }

  .hero-support-grid {
    grid-auto-flow: column;
    grid-auto-columns: minmax(260px, 78vw);
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .hero-support-card {
    scroll-snap-align: start;
  }

  .outline-grid,
  .shortcut-grid,
  .bucket-grid {
    grid-template-columns: 1fr;
  }

  .cases-overview-grid {
    grid-template-columns: 1fr;
  }

  .cases-grid {
    grid-template-columns: 1fr;
  }

  .case-study-card .thumb-button img {
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .cases-group-bar {
    top: 82px;
    padding: 10px;
  }

  .mobile-dock {
    display: flex;
  }
}

@media (max-width: 620px) {
  .overview-grid,
  .question-grid,
  .mantra-grid,
  .shortcut-grid,
  .bucket-grid,
  .cases-overview-grid,
  .workspace-stats,
  .annotation-summary,
  .review-template-grid,
  .basics-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }

  .case-topline,
  .annotation-head,
  .part-header,
  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-stat {
    width: 100%;
    text-align: left;
  }

  .topbar-brand strong {
    font-size: 0.95rem;
  }

  .topbar .eyebrow {
    font-size: 11px;
  }

  .hero {
    padding: 16px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-support-grid {
    grid-auto-columns: minmax(240px, 84vw);
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .overview-grid article {
    padding: 12px;
  }

  .quick-entry-card p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .quick-links {
    margin-top: 10px;
    gap: 6px;
  }

  .cases-group-bar {
    padding-bottom: 4px;
    top: 70px;
  }

  .desk-jump-head {
    min-width: max-content;
  }

  .group-jump-chip {
    flex: 0 0 auto;
    min-width: 128px;
  }

  .cases-overview-panel {
    padding: 14px;
  }

  .case-study-card .thumb-button img {
    aspect-ratio: 16 / 11;
    min-height: 0;
  }

  .search-card input,
  .search-card select,
  .note-input,
  .note-area,
  .mobile-dock-button {
    font-size: 16px;
  }

  .annotation-box {
    padding: 14px;
  }

  .workflow-columns {
    grid-template-columns: 1fr;
  }

  .view-switch {
    width: 100%;
    justify-content: space-between;
  }

  .view-toggle {
    flex: 1 1 0;
  }

  .decision-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
