:root {
  --bg: #130d16;
  --bg-deep: #231826;
  --paper: rgba(34, 24, 36, 0.82);
  --paper-strong: rgba(248, 241, 232, 0.96);
  --line: rgba(223, 210, 194, 0.16);
  --line-strong: rgba(240, 229, 212, 0.32);
  --ink: #f6efe5;
  --muted: #c9bfb5;
  --blue: #c1965a;
  --blue-deep: #f0d8ae;
  --blue-soft: rgba(240, 216, 174, 0.14);
  --cyan: #8ea0a1;
  --shadow: 0 38px 96px rgba(13, 7, 18, 0.42);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 18px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(218, 175, 120, 0.18), transparent 20%),
    radial-gradient(circle at 84% 14%, rgba(113, 164, 160, 0.16), transparent 22%),
    radial-gradient(circle at 72% 78%, rgba(133, 80, 113, 0.18), transparent 24%),
    radial-gradient(circle at 40% 45%, rgba(255, 244, 226, 0.06), transparent 18%),
    linear-gradient(180deg, #0d0811 0%, #17111b 34%, #1f1722 66%, #140f18 100%);
  font-family: "Segoe UI", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 240, 214, 0.08), transparent 18%),
    radial-gradient(circle at 78% 24%, rgba(165, 126, 205, 0.08), transparent 16%),
    radial-gradient(circle at 64% 76%, rgba(108, 169, 162, 0.08), transparent 18%);
  mix-blend-mode: screen;
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-shell {
  width: min(1860px, calc(100vw - 28px));
  max-width: none;
  margin: 0 auto;
  min-height: 100svh;
  padding: 16px 10px 18px;
  display: grid;
  grid-template-columns: clamp(270px, 17.5vw, 304px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

.sidebar-shell {
  position: sticky;
  top: 10px;
  height: calc(100svh - 28px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: start;
  gap: 12px;
  overflow: hidden;
}

.sidebar-shell::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: -12px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(210, 194, 158, 0.18), transparent);
}

.identity-card,
.hero-panel,
.module-panel,
.footer-note {
  position: relative;
  border: 1px solid var(--line);
  background: var(--paper);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.identity-card,
.hero-panel,
.module-panel {
  border-radius: var(--radius-xl);
}

.identity-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 20px 18px;
  overflow: hidden;
}

.identity-card::after,
.hero-panel::after,
.module-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.04), transparent 32%),
    radial-gradient(circle at top right, rgba(210, 194, 158, 0.08), transparent 30%);
}

.identity-card,
.footer-note {
  background:
    linear-gradient(180deg, rgba(36, 24, 34, 0.95), rgba(20, 15, 24, 0.94));
}

.profile-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 14px 30px rgba(87, 116, 165, 0.18);
}

.identity-copy {
  margin-top: 0;
  display: grid;
  gap: 8px;
}

.hero-tag,
.module-tag,
.core-kicker {
  margin: 0 0 10px;
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.identity-name,
.hero-copy h2,
.module-heading h2,
.output-surface h3,
.summary-box h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

.identity-name {
  font-size: 1.42rem;
  line-height: 1.15;
}

.identity-name span {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  font-family: "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--muted);
}

.identity-education,
.hero-text,
.footer-note p,
.empty-state p,
.triage-output p,
.summary-box p,
.compare-box p {
  color: var(--muted);
  line-height: 1.7;
}

.identity-education {
  margin: 8px 0 0;
  font-size: 0.92rem;
}

.identity-links {
  display: grid;
  gap: 8px;
  margin-top: 0;
}

.identity-links a {
  color: #f0e6d6;
  font-weight: 700;
  word-break: break-all;
}

.identity-links a:hover {
  text-decoration: underline;
}

label span,
.score-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.score-label {
  color: var(--muted);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notebook-nav {
  display: grid;
  gap: 8px;
  padding-right: 6px;
  align-content: start;
  overflow: auto;
}

.nav-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 18px 28px 28px 18px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(47, 33, 46, 0.96), rgba(22, 18, 28, 0.98)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 40%);
  color: #ece3d3;
  font-weight: 700;
  box-shadow: 0 18px 28px rgba(8, 4, 12, 0.22);
  transform-origin: left center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, border-color 0.22s ease, width 0.22s ease;
}

.nav-tab::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 12%;
  bottom: 12%;
  width: 18px;
  border-radius: 14px 0 0 14px;
  background: linear-gradient(180deg, rgba(240, 216, 174, 0.95), rgba(158, 117, 148, 0.72));
  opacity: 0.8;
}

.nav-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(210, 194, 158, 0.12);
  color: #f0e6d6;
  font-size: 0.8rem;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-tab:nth-child(1) {
  width: 98%;
}

.nav-tab:nth-child(2) {
  width: 92%;
}

.nav-tab:nth-child(3) {
  width: 96%;
}

.nav-tab:nth-child(4) {
  width: 90%;
}

.nav-tab:nth-child(5) {
  width: 95%;
}

.nav-tab:hover,
.nav-tab.active {
  width: 100%;
  transform: translateX(8px) scale(1.03);
  border-color: var(--line-strong);
  background:
    linear-gradient(135deg, rgba(65, 40, 58, 0.98), rgba(29, 20, 32, 0.98)),
    linear-gradient(90deg, rgba(255, 244, 223, 0.07), transparent 46%);
  box-shadow: 0 24px 42px rgba(12, 7, 18, 0.28);
}

.nav-tab:hover .nav-index,
.nav-tab.active .nav-index {
  transform: scale(1.08);
  background: rgba(210, 194, 158, 0.2);
}

.workspace-shell {
  display: grid;
  gap: 12px;
  position: relative;
  min-height: calc(100svh - 28px);
  padding-top: 50px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
}

.workspace-tools {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 16;
  display: flex;
  justify-content: flex-end;
}

.workspace-shell::before,
.workspace-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(24px);
}

.workspace-shell::before {
  top: 6px;
  right: 34px;
  width: 300px;
  height: 300px;
  background: rgba(244, 214, 175, 0.18);
}

.workspace-shell::after {
  top: 230px;
  right: -18px;
  width: 400px;
  height: 400px;
  background: rgba(130, 93, 145, 0.14);
}

.locale-dock {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 6px 7px;
  border-radius: 999px;
  border: 1px solid rgba(224, 217, 205, 0.1);
  background:
    linear-gradient(180deg, rgba(34, 24, 36, 0.76), rgba(17, 13, 22, 0.82)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 45%);
  backdrop-filter: blur(22px) saturate(138%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.28);
}

.upload-dock {
  position: relative;
  overflow: hidden;
  width: min(292px, calc(100% - 16px));
  padding: 8px 8px 8px;
  border-radius: 20px;
  border: 1px solid rgba(224, 217, 205, 0.1);
  background:
    linear-gradient(180deg, rgba(24, 28, 35, 0.78), rgba(11, 14, 20, 0.9)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 45%);
  backdrop-filter: blur(24px) saturate(144%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 22px 56px rgba(0, 0, 0, 0.34);
}

.upload-dock::before,
.upload-dock::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.upload-dock::before {
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 36%),
    radial-gradient(circle at top right, rgba(210, 194, 158, 0.08), transparent 28%);
}

.upload-dock::after {
  top: 44px;
  left: 12px;
  right: 12px;
  height: 1px;
  background: linear-gradient(90deg, rgba(232, 223, 210, 0.14), rgba(232, 223, 210, 0.03));
}

.upload-dock-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.utility-upload {
  min-width: 112px;
  min-height: 34px;
  padding-inline: 13px;
  border-color: rgba(222, 211, 193, 0.14);
  background:
    linear-gradient(180deg, rgba(243, 236, 225, 0.94), rgba(199, 183, 154, 0.9));
  color: #17130d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 12px 22px rgba(0, 0, 0, 0.16);
}

.upload-dock-hint,
.upload-dock-status {
  margin: 6px 0 0;
  line-height: 1.45;
  position: relative;
  z-index: 1;
}

.stage-toolbar {
  position: absolute;
  top: 14px;
  left: 18px;
  width: min(292px, calc(100% - 54px));
  z-index: 7;
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.stage-toolbar .upload-dock {
  pointer-events: auto;
}

.upload-dock-status {
  display: inline-flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 13px;
  border: 1px solid rgba(224, 217, 205, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: #efe7da;
  font-size: 0.72rem;
}

.upload-dock-status[data-state="success"] {
  border-color: rgba(152, 196, 144, 0.28);
  background: rgba(114, 162, 102, 0.12);
}

.upload-dock-status[data-state="error"] {
  border-color: rgba(210, 125, 109, 0.28);
  background: rgba(171, 82, 64, 0.14);
}

.locale-dock::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 38%);
}

.locale-label {
  position: relative;
  z-index: 1;
  color: rgba(236, 228, 214, 0.72);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.locale-switch {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(224, 217, 205, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

.locale-option {
  min-width: 34px;
  height: 29px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(240, 232, 218, 0.74);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.locale-option:hover {
  transform: translateY(-1px);
  color: #fbf6ed;
}

.locale-option.active {
  background:
    linear-gradient(180deg, rgba(241, 234, 221, 0.94), rgba(193, 177, 147, 0.88));
  color: #18140d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 10px 18px rgba(0, 0, 0, 0.2);
}

.prism-panel {
  overflow: hidden;
}

.hero-panel {
  padding: 30px 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 420px);
  gap: 26px;
  align-items: center;
}

.book-stage {
  --stage-tilt-x: 0deg;
  --stage-tilt-y: 0deg;
  position: relative;
  min-height: 0;
  height: 100%;
  perspective: 3400px;
  transform-style: preserve-3d;
  padding: 18px 16px 16px 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 232, 200, 0.14), transparent 16%),
    radial-gradient(circle at 88% 18%, rgba(151, 111, 164, 0.18), transparent 18%),
    radial-gradient(circle at 72% 84%, rgba(103, 151, 146, 0.14), transparent 18%),
    linear-gradient(135deg, rgba(37, 24, 39, 0.62), rgba(19, 14, 25, 0.82) 42%, rgba(10, 8, 14, 0.94));
  border: 1px solid rgba(240, 216, 174, 0.18);
  backdrop-filter: blur(30px) saturate(138%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -1px 0 rgba(255, 255, 255, 0.04),
    0 50px 128px rgba(0, 0, 0, 0.42);
  transform: rotateX(var(--stage-tilt-x)) rotateY(var(--stage-tilt-y));
  transition: transform 0.18s ease, box-shadow 0.22s ease;
  isolation: isolate;
}

.book-stage::before,
.book-stage::after {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 18px 10px 10px 14px;
  border-radius: 30px;
}

.book-stage::before {
  inset: 22px 22px 26px 26px;
  border: 1px solid rgba(230, 223, 210, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), transparent 34%),
    linear-gradient(180deg, rgba(229, 183, 120, 0.08), transparent 42%);
  transform: translate3d(74px, 42px, -240px) rotateY(-15deg) rotateX(1deg);
  box-shadow: -24px 34px 70px rgba(0, 0, 0, 0.12);
}

.book-stage::after {
  inset: 46px 36px 26px 44px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 24%),
    linear-gradient(90deg, rgba(255, 226, 178, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(88, 54, 90, 0.18), transparent 60%);
  filter: blur(18px);
  transform: translate3d(104px, 62px, -340px) rotateY(-18deg);
}

.book-stage:hover {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 62px 134px rgba(0, 0, 0, 0.48);
}

.hero-copy h2 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 1.03;
}

.hero-chip-row,
.action-row,
.form-row,
.readiness-chip-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-chip-row {
  margin-top: 22px;
}

.hero-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legend-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(69, 95, 137, 0.12);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 16px 32px rgba(87, 116, 165, 0.08);
}

.legend-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.legend-card strong {
  font-size: 0.98rem;
  line-height: 1.4;
}

.hero-chip,
.pill {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(95, 143, 216, 0.12);
  color: var(--blue-deep);
  font-weight: 700;
}

.hero-prism {
  position: relative;
  height: 320px;
}

.hero-prism::before,
.hero-prism::after {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border-radius: 36px;
  pointer-events: none;
}

.hero-prism::before {
  border: 1px dashed rgba(95, 143, 216, 0.22);
  transform: rotate(6deg);
}

.hero-prism::after {
  inset: 18% 15%;
  border: 1px solid rgba(255, 255, 255, 0.44);
  transform: rotate(-8deg);
}

.prism-layer,
.prism-core {
  position: absolute;
  border-radius: 28px;
}

.prism-layer {
  inset: 0;
  border: 1px solid rgba(95, 143, 216, 0.16);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(205, 225, 255, 0.54)),
    linear-gradient(180deg, rgba(95, 143, 216, 0.09), transparent);
  box-shadow: 0 30px 60px rgba(87, 116, 165, 0.12);
  animation: prismFloat 7.2s ease-in-out infinite;
}

.layer-a {
  transform: rotate(-10deg) translate(-22px, 8px);
  animation-delay: 0s;
}

.layer-b {
  transform: rotate(8deg) translate(18px, -8px);
  animation-delay: -2.2s;
}

.layer-c {
  transform: rotate(-2deg);
  animation-delay: -4.3s;
}

.prism-core {
  inset: 22% 18%;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px solid rgba(95, 143, 216, 0.18);
  background:
    radial-gradient(circle at top right, rgba(137, 196, 235, 0.34), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(219, 235, 255, 0.86));
  box-shadow: 0 18px 44px rgba(87, 116, 165, 0.18);
}

.prism-core strong {
  font-size: 4rem;
  line-height: 1;
  color: var(--blue-deep);
}

.prism-core span {
  color: var(--muted);
}

.module-panel {
  padding: 22px 24px;
  transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.32s ease, border-color 0.32s ease, opacity 0.28s ease;
  position: absolute;
  inset: 82px 12px 8px 8px;
  overflow: hidden auto;
  pointer-events: none;
  transform-origin: left center;
  will-change: transform, opacity;
  z-index: 1;
  background:
    linear-gradient(158deg, rgba(253, 248, 241, 0.97) 0%, rgba(244, 236, 226, 0.95) 48%, rgba(226, 213, 202, 0.94) 100%),
    radial-gradient(circle at top right, rgba(181, 111, 150, 0.08), transparent 28%),
    radial-gradient(circle at 14% 24%, rgba(237, 198, 138, 0.08), transparent 26%);
  box-shadow:
    0 52px 108px rgba(13, 7, 18, 0.34),
    -18px 0 42px rgba(26, 14, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  border-color: rgba(90, 72, 67, 0.16);
  color: #201b14;
}

.module-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(120deg, transparent 8%, rgba(255, 255, 255, 0.42) 28%, transparent 46%),
    radial-gradient(circle at top right, rgba(214, 170, 109, 0.18), transparent 30%);
  transform: translateX(-38%);
  transition: opacity 0.22s ease, transform 0.5s ease;
}

.module-panel::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: -15px;
  width: 22px;
  border-radius: 0 18px 18px 0;
  background:
    linear-gradient(180deg, rgba(245, 235, 219, 0.98), rgba(181, 152, 129, 0.94)),
    linear-gradient(90deg, rgba(86, 58, 61, 0.18), transparent 55%);
  box-shadow:
    inset 1px 0 0 rgba(255, 255, 255, 0.6),
    16px 0 28px rgba(0, 0, 0, 0.16);
}

.module-panel:hover,
.module-panel.is-emphasis {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow:
    0 64px 118px rgba(15, 8, 20, 0.38),
    -24px 0 52px rgba(43, 18, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.module-panel:hover::before,
.module-panel.is-emphasis::before {
  opacity: 1;
  transform: translateX(12%);
}

.module-panel.book-active {
  pointer-events: auto;
}

.module-panel.book-active .module-heading {
  transform: translateX(0);
  opacity: 1;
}

.module-heading {
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform: translateX(6px);
  opacity: 0.94;
}

.module-panel .module-tag,
.module-panel .heatmap-label,
.module-panel .risk-title,
.module-panel h2,
.module-panel h3,
.module-panel label span {
  color: #241f17;
}

.module-panel .score-label,
.module-panel .risk-detail,
.module-panel .summary-box p,
.module-panel .empty-state p,
.module-panel .triage-output p,
.module-panel .compare-box p {
  color: #655948;
}

.module-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 16px;
}

.module-heading h2 {
  font-size: clamp(1.72rem, 2vw, 2.02rem);
  line-height: 1.08;
}

.module-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
}

.review-grid {
  align-items: start;
}

.input-stack,
.output-stack {
  display: grid;
  gap: 14px;
}

.file-intake {
  display: grid;
  gap: 12px;
}

.input-brief {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  background:
    linear-gradient(180deg, rgba(248, 244, 238, 0.82), rgba(233, 227, 217, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 20px 34px rgba(39, 31, 19, 0.08);
}

.file-intake-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.input-brief-head,
.draft-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.file-intake-head strong {
  display: block;
  color: #2c2418;
  font-size: 1rem;
  line-height: 1.3;
}

.input-brief-head strong {
  display: block;
  color: #2c2418;
  font-size: 0.98rem;
  line-height: 1.3;
}

.file-intake-note,
.file-status {
  margin: 0;
  line-height: 1.65;
}

.file-intake-note {
  color: #6d614f;
  font-size: 0.92rem;
}

.file-status {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(122, 110, 91, 0.12);
  background: rgba(255, 255, 255, 0.34);
  color: #564938;
  font-size: 0.92rem;
  font-weight: 600;
}

.file-status[data-state="success"] {
  border-color: rgba(96, 115, 103, 0.24);
  background: rgba(231, 238, 234, 0.92);
  color: #44564d;
}

.file-status[data-state="error"] {
  border-color: rgba(141, 85, 81, 0.24);
  background: rgba(241, 228, 225, 0.92);
  color: #754741;
}

.file-status[data-state="loading"] {
  border-color: rgba(184, 148, 89, 0.26);
  background: rgba(247, 240, 226, 0.94);
  color: #7d6130;
}

.file-status.compact {
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.88rem;
}

.source-chip,
.draft-file-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(99, 89, 74, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(229, 222, 211, 0.74));
  color: #594b3b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(52, 42, 28, 0.08);
}

.source-chip[data-state="success"],
.draft-file-chip[data-state="success"] {
  border-color: rgba(88, 116, 96, 0.18);
  background:
    linear-gradient(180deg, rgba(238, 244, 239, 0.96), rgba(221, 232, 224, 0.92));
  color: #3f584b;
}

.source-chip[data-state="active"],
.draft-file-chip[data-state="active"] {
  border-color: rgba(140, 116, 69, 0.18);
  background:
    linear-gradient(180deg, rgba(247, 241, 228, 0.98), rgba(234, 223, 196, 0.92));
  color: #68512a;
}

.draft-stacked {
  gap: 10px;
}

.draft-label-row {
  width: 100%;
}

.draft-label-row > span:first-child {
  min-width: 0;
}

.upload-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.preview-meta {
  margin: 6px 0 0;
  color: #6d614f;
  font-size: 0.9rem;
  line-height: 1.5;
}

.source-preview {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.source-paragraph {
  margin: 0;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(122, 110, 91, 0.12);
  background: rgba(255, 255, 255, 0.34);
  color: #3a2f23;
  line-height: 1.72;
  white-space: pre-wrap;
}

.source-paragraph.hit-medium {
  border-color: rgba(184, 148, 89, 0.26);
  background: rgba(247, 240, 226, 0.94);
}

.source-paragraph.hit-high {
  border-color: rgba(141, 85, 81, 0.24);
  background: rgba(241, 228, 225, 0.92);
}

.source-paragraph mark {
  padding: 0 0.18em;
  border-radius: 0.22em;
  background: rgba(184, 148, 89, 0.32);
  color: inherit;
}

.annotation-list {
  display: grid;
  gap: 12px;
}

.annotation-card {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(122, 110, 91, 0.12);
  background: rgba(255, 255, 255, 0.34);
}

.annotation-card[data-level="high"] {
  border-color: rgba(141, 85, 81, 0.24);
  background: rgba(241, 228, 225, 0.9);
}

.annotation-card[data-level="medium"] {
  border-color: rgba(184, 148, 89, 0.24);
  background: rgba(247, 240, 226, 0.92);
}

.annotation-card[data-level="low"] {
  border-color: rgba(96, 115, 103, 0.24);
  background: rgba(231, 238, 234, 0.92);
}

.annotation-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.annotation-title {
  display: block;
  color: #2d2418;
  font-weight: 800;
  line-height: 1.4;
}

.annotation-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 29, 22, 0.08);
  color: #5a4a35;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.annotation-detail,
.annotation-excerpt {
  margin: 0;
  color: #5f523f;
  line-height: 1.66;
}

.annotation-excerpt {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px dashed rgba(122, 110, 91, 0.18);
  font-size: 0.93rem;
}

.two-col,
.three-col,
.score-banner,
.result-columns,
.output-grid,
.compare-grid {
  display: grid;
  gap: 14px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stacked {
  display: grid;
  gap: 8px;
}

textarea,
select,
input,
.output-surface {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(113, 90, 85, 0.14);
  background:
    linear-gradient(180deg, rgba(251, 246, 240, 0.9), rgba(242, 234, 225, 0.84));
  color: #231f18;
  font: inherit;
  backdrop-filter: blur(20px) saturate(118%);
}

textarea,
select,
input {
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

textarea:focus,
select:focus,
input:focus {
  border-color: rgba(155, 135, 96, 0.42);
  box-shadow: 0 0 0 4px rgba(155, 135, 96, 0.1);
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.64;
}

.output-surface,
.summary-box,
.empty-state,
.triage-output {
  padding: 16px;
  border: 1px solid rgba(96, 74, 71, 0.12);
  background:
    linear-gradient(180deg, rgba(250, 244, 237, 0.86), rgba(241, 233, 224, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 14px 26px rgba(38, 24, 29, 0.05);
}

.heatmap-embedded {
  display: grid;
  gap: 14px;
}

.score-banner {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.score-banner > div {
  padding: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(96, 76, 74, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.92), rgba(242, 233, 222, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.score-banner strong {
  font-size: 1.48rem;
  color: #473c2c;
}

.review-view-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid rgba(109, 84, 79, 0.12);
  background:
    linear-gradient(180deg, rgba(254, 248, 240, 0.84), rgba(243, 234, 224, 0.8));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.68),
    0 14px 26px rgba(45, 27, 36, 0.06);
}

.review-view-btn {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.review-view-btn.active {
  color: #1f1412;
  background:
    linear-gradient(135deg, rgba(249, 227, 197, 0.98), rgba(205, 158, 104, 0.92) 58%, rgba(182, 121, 133, 0.9));
  border-color: rgba(160, 114, 94, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 28px rgba(52, 24, 31, 0.12);
}

.review-view-panel {
  display: grid;
  gap: 18px;
}

.review-view-panel.is-active {
  animation: reviewPanelIn 0.22s ease;
}

.table-surface {
  display: grid;
  gap: 16px;
}

.panel-head,
.panel-head-spread {
  display: flex;
  align-items: center;
  gap: 14px;
}

.panel-head-spread {
  justify-content: space-between;
}

.inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
}

.luxe-surface {
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.92), rgba(243, 235, 226, 0.88)),
    radial-gradient(circle at top right, rgba(193, 129, 147, 0.07), transparent 32%);
}

.redline-list {
  display: grid;
  gap: 16px;
}

.redline-summary {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.redline-summary-hero {
  display: grid;
  gap: 10px;
  padding: 20px 22px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(245, 228, 201, 0.96), rgba(212, 169, 121, 0.88) 56%, rgba(160, 118, 134, 0.84));
  color: #241713;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 18px 36px rgba(45, 24, 32, 0.12);
}

.redline-summary-kicker,
.redline-summary-card > span {
  margin: 0;
  color: rgba(53, 34, 25, 0.74);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.redline-summary-hero h4,
.redline-summary-card strong {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

.redline-summary-hero h4 {
  font-size: 1.34rem;
  line-height: 1.3;
}

.redline-summary-hero p:last-child,
.redline-summary-card p {
  margin: 0;
  color: #4f4336;
  line-height: 1.7;
}

.redline-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.redline-summary-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(112, 89, 84, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.94), rgba(245, 237, 228, 0.9));
}

.redline-metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.redline-metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.redline-metric-pill[data-action="add"] {
  background: rgba(222, 236, 224, 0.9);
  color: #42614f;
}

.redline-metric-pill[data-action="tighten"] {
  background: rgba(247, 236, 214, 0.94);
  color: #6b5229;
}

.redline-metric-pill[data-action="replace"] {
  background: rgba(243, 225, 224, 0.92);
  color: #7b4545;
}

.redline-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(112, 89, 84, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.96), rgba(244, 236, 227, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 16px 28px rgba(49, 28, 34, 0.06);
}

.redline-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.redline-title,
.memo-hero h4,
.memo-strip h4 {
  margin: 0;
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
}

.redline-title {
  display: block;
  font-size: 1.08rem;
}

.redline-category,
.memo-kicker,
.memo-meta-row,
.memo-card > span,
.redline-block > span {
  margin: 0;
  color: #7a6551;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.redline-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.redline-action[data-action="add"] {
  background: rgba(222, 236, 224, 0.92);
  color: #42614f;
}

.redline-action[data-action="tighten"] {
  background: rgba(247, 236, 214, 0.96);
  color: #6b5229;
}

.redline-action[data-action="replace"] {
  background: rgba(243, 225, 224, 0.94);
  color: #7b4545;
}

.redline-concern,
.memo-card p,
.memo-strip li {
  margin: 0;
  color: #514332;
  line-height: 1.72;
}

.redline-block {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(116, 92, 83, 0.1);
}

.redline-block p {
  margin: 0;
  color: #4f4336;
  line-height: 1.7;
}

.redline-excerpt {
  background: rgba(255, 248, 239, 0.78);
}

.redline-suggestion {
  background:
    linear-gradient(180deg, rgba(255, 244, 226, 0.88), rgba(243, 230, 217, 0.86));
}

.memo-layout {
  display: grid;
  gap: 18px;
}

.memo-hero {
  display: grid;
  gap: 12px;
  padding: 20px 22px;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(250, 230, 196, 0.95), rgba(204, 154, 102, 0.88) 55%, rgba(183, 119, 129, 0.86));
  color: #251713;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 22px 40px rgba(49, 22, 30, 0.14);
}

.memo-kicker,
.memo-meta-row {
  color: rgba(43, 26, 20, 0.74);
}

.memo-hero h4 {
  font-size: 1.38rem;
  line-height: 1.35;
}

.memo-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  letter-spacing: 0.03em;
}

.memo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.memo-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(112, 89, 84, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.92), rgba(245, 237, 228, 0.9));
}

.memo-strip {
  padding: 20px;
}

.memo-strip h4 {
  margin-bottom: 12px;
}

.memo-strip .result-list {
  gap: 12px;
}

.jurisdiction-lens-output,
.output-block,
.triage-block {
  display: grid;
  gap: 14px;
}

.lens-hero {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(249, 229, 197, 0.94), rgba(212, 164, 112, 0.86) 54%, rgba(183, 125, 136, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.56),
    0 18px 34px rgba(45, 24, 32, 0.12);
  color: #261713;
}

.lens-hero strong {
  font-family: Georgia, "Times New Roman", "Songti SC", serif;
  font-size: 1.14rem;
}

.lens-hero p,
.lens-card p,
.matrix-card p,
.market-gauge-card p,
.market-read {
  margin: 0;
  line-height: 1.65;
  color: #544534;
}

.lens-kicker,
.lens-card > span {
  color: rgba(53, 34, 25, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.lens-grid,
.matrix-grid,
.market-gauge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lens-card,
.matrix-card,
.market-gauge-card,
.output-card,
.compare-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(133, 118, 91, 0.16);
  background: rgba(245, 240, 233, 0.84);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 14px 28px rgba(38, 24, 29, 0.06);
}

.matrix-card-head,
.market-gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.matrix-card strong,
.market-gauge-head strong {
  color: #322519;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: 0.04em;
}

.status-pill[data-status="ready"],
.status-pill[data-status="market"] {
  background: rgba(221, 236, 225, 0.92);
  color: #466250;
}

.status-pill[data-status="watch"],
.status-pill[data-status="firm"] {
  background: rgba(247, 238, 218, 0.94);
  color: #715631;
}

.status-pill[data-status="workstream"],
.status-pill[data-status="aggressive"],
.status-pill[data-status="onesided"] {
  background: rgba(243, 226, 224, 0.94);
  color: #7a4545;
}

.status-pill[data-status="concession"] {
  background: rgba(229, 235, 243, 0.92);
  color: #4a5f78;
}

.market-track {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 8px;
  height: 14px;
  margin: 8px 0 12px;
}

.market-track-band {
  border-radius: 999px;
}

.band-market {
  background: linear-gradient(90deg, rgba(118, 147, 124, 0.72), rgba(186, 209, 176, 0.88));
}

.band-firm {
  background: linear-gradient(90deg, rgba(220, 196, 132, 0.82), rgba(230, 166, 96, 0.92));
}

.band-aggressive {
  background: linear-gradient(90deg, rgba(196, 132, 120, 0.86), rgba(166, 87, 103, 0.92));
}

.market-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #221713;
  border: 3px solid rgba(255, 247, 236, 0.98);
  box-shadow: 0 8px 16px rgba(33, 20, 20, 0.2);
  transform: translate(-50%, -50%);
}

.market-score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #735d48;
}

.market-score-row strong {
  color: #3b2a1b;
  font-size: 1.18rem;
}

.market-read {
  padding: 0 2px;
}

.result-columns,
.output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bullet-list,
.result-list,
.risk-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.risk-list li {
  list-style: none;
  margin-left: 0;
  padding: 14px 14px 14px 16px;
  border-left: 4px solid #b89459;
  border-radius: 0 16px 16px 0;
  background: rgba(247, 240, 226, 0.9);
}

.risk-list li.high {
  border-left-color: #8d5551;
  background: rgba(241, 228, 225, 0.9);
}

.risk-list li.low {
  border-left-color: #607367;
  background: rgba(231, 238, 234, 0.92);
}

.risk-title {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.risk-detail {
  display: block;
  color: var(--muted);
  line-height: 1.66;
}

.button,
.text-button {
  appearance: none;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

.button:hover,
.text-button:hover {
  transform: translateY(-1px);
}

.button {
  border-radius: 999px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.primary {
  color: #1c1210;
  background:
    linear-gradient(135deg, #f7e2c0 0%, #d4a56b 52%, #b97d88 100%);
  box-shadow: 0 20px 34px rgba(39, 18, 28, 0.18);
}

.secondary,
.tertiary,
.text-button {
  color: #f5ede2;
  background:
    linear-gradient(180deg, rgba(50, 34, 47, 0.94), rgba(25, 19, 28, 0.94));
  border: 1px solid rgba(240, 216, 174, 0.12);
  box-shadow: 0 12px 22px rgba(21, 12, 20, 0.14);
}

.compare-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compare-box strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 4px;
  color: #5a4a35;
}

.pill.warning {
  color: #7d6130;
  background: rgba(191, 164, 111, 0.2);
}

.pill.danger {
  color: #824f49;
  background: rgba(165, 103, 97, 0.16);
}

.pill.success {
  color: #526659;
  background: rgba(110, 134, 119, 0.18);
}

.heatmap-grid {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) minmax(58px, 70px);
  gap: 12px;
  align-items: center;
}

.heatmap-label {
  font-weight: 700;
}

.heatmap-track {
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(111, 100, 84, 0.1);
}

.heatmap-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f7b6e 0%, #ae8d59 54%, #8d5551 100%);
}

.heatmap-score {
  text-align: right;
  font-weight: 800;
  color: #5a4a35;
}

.hidden {
  display: none;
}

.footer-note {
  padding: 12px 16px;
  border-radius: 20px;
  align-self: end;
}

.footer-note p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

@keyframes prismFloat {
  0%,
  100% {
    filter: saturate(1) brightness(1);
  }
  50% {
    filter: saturate(1.04) brightness(1.03);
  }
}

@media (max-width: 1240px) {
  body {
    overflow-y: auto;
  }

  .site-shell {
    width: auto;
    min-height: auto;
    grid-template-columns: 1fr;
  }

  .sidebar-shell {
    position: static;
    height: auto;
    overflow: visible;
  }

  .workspace-shell {
    min-height: auto;
    overflow: visible;
    padding-top: 84px;
  }

  .notebook-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 4px 2px 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .notebook-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-tab {
    flex: 0 0 242px;
    width: auto !important;
    scroll-snap-align: start;
  }

  .nav-tab:hover,
  .nav-tab.active {
    transform: translateY(-2px) scale(1.03);
    width: 100%;
  }
}

@media (max-width: 1100px) {
  .hero-panel,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .workspace-shell {
    grid-template-rows: none;
    padding-top: 80px;
  }

  .workspace-tools {
    left: 0;
    right: 0;
    justify-content: flex-end;
  }

  .locale-dock {
    width: fit-content;
    max-width: 100%;
    justify-self: end;
  }

  .stage-toolbar {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    margin-bottom: 8px;
    padding: 0 2px;
  }

  .stage-toolbar .upload-dock {
    width: 100%;
  }

  .book-stage {
    min-height: auto !important;
    height: auto !important;
    display: block;
    perspective: none;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .book-stage::before,
  .book-stage::after {
    display: none;
  }

  .module-panel {
    position: relative;
    inset: auto;
    overflow: visible;
    display: none;
    pointer-events: none;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    margin-top: 0;
    animation: mobilePanelIn 0.22s ease;
  }

  .module-panel.book-active {
    display: block;
    pointer-events: auto;
  }
}

@media (max-width: 860px) {
  .two-col,
  .three-col,
  .score-banner,
  .result-columns,
  .output-grid,
  .redline-summary-grid,
  .memo-grid,
  .lens-grid,
  .matrix-grid,
  .market-gauge-grid,
  .compare-grid,
  .hero-legend {
    grid-template-columns: 1fr;
  }

  .heatmap-row {
    grid-template-columns: 1fr;
  }

  .heatmap-score {
    text-align: left;
  }

  .sidebar-shell {
    gap: 12px;
  }

  .notebook-nav {
    position: sticky;
    top: 10px;
    z-index: 16;
    margin: 0 -2px;
    padding: 6px 0 12px;
    background: linear-gradient(180deg, rgba(9, 11, 15, 0.92), rgba(9, 11, 15, 0.62), transparent);
    backdrop-filter: blur(14px);
  }

  .nav-tab {
    flex-basis: 218px;
    padding: 14px 16px;
    min-height: 70px;
  }

  .panel-head-spread {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .site-shell {
    padding: 14px 12px 26px;
    gap: 16px;
  }

  .identity-card,
  .hero-panel,
  .module-panel {
    border-radius: 24px;
  }

  .sidebar-shell::after {
    display: none;
  }

  .hero-panel,
  .module-panel {
    padding: 20px;
  }

  .workspace-shell {
    padding-top: 72px;
  }

  .locale-dock {
    right: 2px;
    padding: 6px 7px;
    gap: 0;
  }

  .workspace-tools {
    top: 2px;
  }

  .upload-dock {
    width: 100%;
    padding: 12px;
  }

  .upload-dock-head {
    flex-direction: row;
    align-items: center;
  }

  .utility-upload {
    width: auto;
  }

  .input-brief-head,
  .draft-label-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .source-chip,
  .draft-file-chip {
    max-width: 100%;
  }

  .locale-label {
    display: none;
  }

  .locale-option {
    min-width: 34px;
    height: 32px;
    padding: 0 10px;
  }

  .hero-copy h2 {
    font-size: 2.3rem;
  }

  .profile-avatar {
    width: 96px;
    height: 96px;
  }
}

@keyframes mobilePanelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes reviewPanelIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
