:root {
  --ink: #16211f;
  --ink-soft: #344541;
  --muted: #6e7b77;
  --paper: #f5f2ea;
  --paper-2: #ece7dc;
  --card: #fffdf8;
  --line: #ddd6c8;
  --line-strong: #c8bfae;
  --teal: #0f5a53;
  --teal-dark: #0b3d38;
  --teal-soft: #dcebe6;
  --accent: #c76b3d;
  --accent-soft: #f6e2d4;
  --gold: #a67c2e;
  --gold-soft: #f3e9cd;
  --danger: #9c3b34;
  --danger-soft: #f4deda;
  --blue: #345e7d;
  --blue-soft: #dde8f0;
  --shadow: 0 1px 2px rgba(22, 33, 31, .05), 0 12px 32px rgba(22, 33, 31, .06);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 258px;
  --sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.ok { color: var(--teal); }
.warn { color: var(--gold); }
.dot { color: var(--line-strong); margin: 0 3px; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px 16px; background: var(--teal-dark); color: #eef5f1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: var(--paper); color: var(--teal-dark); font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: -.5px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.5); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15.5px; letter-spacing: -.2px; }
.brand-text small { color: #a8c3ba; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
.privacy-pill { display: flex; gap: 9px; align-items: flex-start; padding: 10px 11px; border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.06); border-radius: 12px; color: #c8dbd3; font-size: 10.5px; line-height: 1.45; }
.privacy-pill .icon { width: 16px; height: 16px; color: #9fd0bd; margin-top: 1px; }
.privacy-pill strong { color: #fff; font-size: 11px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 10px; color: #bcd1c9; font-size: 13.5px; transition: .16s ease; }
.side-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-nav a.active { background: #f4efe4; color: var(--teal-dark); font-weight: 600; box-shadow: 0 8px 18px rgba(0,0,0,.14); }
.side-nav .icon { width: 17px; height: 17px; opacity: .9; }
.side-nav .nav-count { margin-left: auto; font-size: 10px; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.13); color: #fff; }
.side-nav a.active .nav-count { background: var(--teal); color: #fff; }
.side-nav .nav-count.accent { background: var(--accent); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid rgba(255,255,255,.1); padding-top: 14px; }
.profile-mini { display: flex; gap: 9px; align-items: center; padding: 0 4px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.profile-mini span:last-child { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.profile-mini strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-mini small { color: #8fafa3; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-wrap { min-width: 0; }
.mobile-head { display: none; }
.stand-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 9px 30px; background: var(--paper-2); border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 11.5px; }
.stand-banner .icon { width: 14px; height: 14px; color: var(--teal); }
.banner-code { color: var(--muted); letter-spacing: .1em; font-size: 10px; }
.content { max-width: 1380px; margin: 0 auto; padding: 30px 32px 80px; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.025em; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(30px, 3.2vw, 42px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
.page-head { margin-bottom: 24px; max-width: 860px; }
.page-head .eyebrow { display: block; margin-bottom: 8px; }
.page-head p { margin: 10px 0 0; color: var(--muted); font-size: 14.5px; max-width: 760px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .13em; }
.eyebrow.light { color: #a7cdbf; }
.text-link { color: var(--teal); font-size: 12.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.text-link:hover { color: var(--accent); }
.text-link .icon { width: 14px; height: 14px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.badge-priority { background: var(--teal-soft); color: var(--teal); border-color: #c4ded4; }
.badge-review { background: var(--gold-soft); color: #7c5c1f; border-color: #e8d8ab; }
.badge-hold { background: var(--accent-soft); color: #8d4523; border-color: #edc7b2; }
.badge-blocked, .badge-blocked-source { background: var(--danger-soft); color: var(--danger); border-color: #e6bbb5; }
.badge-historical { background: #e8e5dd; color: #666; border-color: #d5d0c4; }
.badge-low { background: #e9e7e0; color: #5d655f; border-color: #d6d2c6; }
.badge-review-exception { background: var(--blue-soft); color: var(--blue); border-color: #c1d5e3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: #f0ece2; border: 1px solid #e2dccf; color: #4c5a55; font-size: 10.5px; white-space: nowrap; }
.chip-c1 { background: var(--teal-soft); color: var(--teal); border-color: #c2ddd2; }
.chip-c2 { background: var(--gold-soft); color: #7a5b1e; border-color: #e5d29e; }
.chip-c3 { background: var(--blue-soft); color: var(--blue); border-color: #c4d6e2; }
.chip-c4 { background: #ebe4f2; color: #624a7d; border-color: #d8cbe6; }
.chip-c5 { background: var(--accent-soft); color: #8b4522; border-color: #ebc6b1; }
.chip-unknown { background: #f3efe6; color: #8a7b63; border-style: dashed; }
.chip-skill { background: #fff; border-color: var(--line); }
.chip-commercial { background: var(--teal-soft); color: var(--teal); }
.chip-personal { background: var(--blue-soft); color: var(--blue); }
.chip-study { background: var(--gold-soft); color: #7a5b1e; }
.chip.active { background: var(--teal); color: #fff; border-color: var(--teal); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; font-size: 13px; font-weight: 600; line-height: 1.2; transition: .16s ease; white-space: nowrap; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 8px 18px rgba(15,90,83,.18); }
.btn-primary:hover:not(:disabled) { background: #0c4943; transform: translateY(-1px); }
.btn-secondary { background: var(--accent-soft); color: #8a4422; border-color: #edc7b1; }
.btn-secondary:hover:not(:disabled) { background: #f0d2bf; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-soft); }
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); background: #fbf8f0; }
.btn-danger-ghost { background: #fff; border-color: #e3bbb5; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-soft); }
.btn-small { padding: 6px 10px; font-size: 11.5px; border-radius: 8px; }
.btn-large { padding: 13px 18px; font-size: 14px; border-radius: 12px; }
.full { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; background: transparent; border-radius: 8px; color: var(--muted); }
.icon-btn:hover { background: #f3efe5; color: var(--ink); }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel.compact { padding: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h2 { margin-top: 2px; }
.panel-head .eyebrow { display: block; margin-bottom: 4px; }
.section-note { color: var(--muted); font-size: 12.5px; margin: -4px 0 14px; max-width: 860px; }
.hint { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 8px 0 0; }
.subhead { margin: 20px 0 10px; font-size: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 15px 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 15px; display: flex; align-items: flex-start; gap: 11px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; inset: auto 0 0 0; height: 3px; background: var(--line); }
.stat-card.accent::after { background: var(--teal); }
.stat-card.warn::after { background: var(--accent); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--paper); color: var(--teal); flex: none; }
.stat-card > div { display: flex; flex-direction: column; line-height: 1.2; }
.stat-card strong { font-family: var(--serif); font-size: 27px; font-weight: 500; letter-spacing: -.03em; }
.stat-card span { font-size: 11.5px; color: var(--ink-soft); }
.stat-card small { margin-left: auto; font-size: 9.5px; color: var(--muted); text-align: right; align-self: flex-end; }

.flow-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 9px; margin-bottom: 22px; }
.flow-tile { background: var(--card); border: 1px solid var(--line); border-radius: 13px; padding: 11px 13px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; transition: .16s; }
.flow-tile:hover { border-color: var(--teal); transform: translateY(-1px); }
.flow-code { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--teal); background: var(--teal-soft); padding: 3px 6px; border-radius: 6px; }
.flow-name { font-size: 11px; color: var(--muted); }
.flow-tile strong { font-family: var(--serif); font-size: 20px; font-weight: 500; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .9fr); gap: 18px; margin-bottom: 20px; align-items: start; }
.side-stack { display: flex; flex-direction: column; gap: 14px; }
.wide { margin-top: 0; }
.panel .opp-grid, .panel .card-stack { margin-top: 4px; }
.opp-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.card-stack { display: flex; flex-direction: column; gap: 11px; }
.opp-card { background: #fff; border: 1px solid var(--line); border-radius: 15px; padding: 15px; display: flex; flex-direction: column; gap: 7px; transition: .16s; }
.opp-card:hover { border-color: #b9c9c1; box-shadow: 0 10px 24px rgba(22,33,31,.07); }
.opp-card.state-priority { border-left: 3px solid var(--teal); }
.opp-card.state-hold { border-left: 3px solid var(--accent); }
.opp-card.state-blocked, .opp-card.state-blocked-source { border-left: 3px solid var(--danger); opacity: .82; }
.opp-card.state-historical { border-left: 3px solid #a8a393; opacity: .75; }
.opp-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opp-title { font-size: 16px; line-height: 1.3; letter-spacing: -.015em; }
.opp-title a:hover { color: var(--teal); }
.opp-org { margin: 0; color: var(--muted); font-size: 11.5px; }
.opp-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--ink-soft); font-size: 11.5px; }
.opp-meta span { display: inline-flex; align-items: center; gap: 4px; }
.opp-meta .icon { width: 13px; height: 13px; color: var(--muted); }
.opp-meta small { color: var(--muted); }
.score-row { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.score-box strong { font-family: var(--serif); font-size: 21px; font-weight: 500; color: var(--teal); }
.score-box span { font-size: 9px; color: var(--muted); }
.score-track { flex: 1; height: 5px; background: #eae5da; border-radius: 99px; overflow: hidden; }
.score-fill { height: 100%; background: linear-gradient(90deg, #78a99b, var(--teal)); border-radius: 99px; }
.score-note { font-size: 9.5px; color: var(--muted); min-width: 60px; text-align: right; }
.policy-line { margin: 0; color: #8b4522; font-size: 10.5px; display: flex; gap: 5px; align-items: center; }
.policy-line .icon { width: 12px; height: 12px; }
.unknown-line { margin: 0; font-size: 9.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 5px; }
.opp-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 3px; }

.question-list { display: flex; flex-direction: column; gap: 6px; }
.question-row { display: flex; gap: 10px; padding: 10px 9px; border-radius: 10px; border: 1px solid transparent; }
.question-row:hover { background: #faf7ef; border-color: var(--line); }
.q-mark { width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 800; display: grid; place-items: center; flex: none; font-size: 12px; }
.question-row span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.question-row strong { font-size: 11.5px; font-weight: 600; line-height: 1.35; }
.question-row small { color: var(--muted); font-size: 9.5px; }
.doc-list { display: flex; flex-direction: column; gap: 4px; }
.doc-row { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 9px; }
.doc-row:hover { background: #faf7ef; }
.doc-row > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; }
.doc-row strong { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-row small { font-size: 9.5px; color: var(--muted); }
.doc-row > .icon:last-child { margin-left: auto; width: 14px; height: 14px; color: var(--muted); }
.doc-icon { width: 29px; height: 29px; border-radius: 8px; background: var(--paper); color: var(--teal); display: grid; place-items: center; flex: none; }
.doc-icon .icon { width: 15px; height: 15px; }
.security-panel .panel-head > .icon { color: var(--teal); width: 22px; height: 22px; }
.check-list { list-style: none; padding: 0; margin: 6px 0 12px; display: flex; flex-direction: column; gap: 6px; }
.check-list li { display: flex; gap: 7px; align-items: flex-start; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.check-list .icon { width: 13px; height: 13px; color: var(--teal); margin-top: 1px; }
.empty { text-align: center; padding: 28px 18px; border: 1px dashed var(--line-strong); border-radius: 14px; background: #fbf8f0; }
.empty-icon { width: 42px; height: 42px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; margin: 0 auto 9px; color: var(--teal); }
.empty h3 { font-size: 14px; }
.empty p { font-size: 11.5px; color: var(--muted); max-width: 360px; margin: 5px auto 0; }

.view-tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 15px; scrollbar-width: none; }
.view-tabs::-webkit-scrollbar { display: none; }
.view-tabs a, .view-tabs button { padding: 8px 12px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); border: 0; border-bottom: 2px solid transparent; background: transparent; white-space: nowrap; }
.view-tabs a.active, .view-tabs button.active { color: var(--teal); border-bottom-color: var(--teal); }
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-chips .chip { cursor: pointer; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-field { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 0 9px; height: 34px; }
.search-field .icon { width: 14px; height: 14px; color: var(--muted); }
.search-field input { border: 0; outline: 0; background: transparent; font-size: 12px; width: 190px; }
.list-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--muted); margin-bottom: 12px; }
.list-meta strong { color: var(--ink); }

.breadcrumb { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10.5px; margin-bottom: 14px; text-transform: uppercase; letter-spacing: .05em; }
.breadcrumb .icon { width: 11px; height: 11px; }
.detail-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.detail-head h1 { margin: 8px 0 7px; max-width: 800px; }
.detail-org { color: var(--muted); font-size: 12.5px; margin: 0 0 10px; }
.verified, .unverified { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; font-size: 10px; padding: 3px 6px; border-radius: 6px; }
.verified { color: var(--teal); background: var(--teal-soft); }
.unverified { color: #8b4522; background: var(--accent-soft); }
.verified .icon, .unverified .icon { width: 11px; height: 11px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--ink-soft); font-size: 11.5px; }
.detail-meta span { display: inline-flex; gap: 4px; align-items: center; }
.detail-meta .icon { width: 13px; height: 13px; color: var(--muted); }
.detail-state { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.big-score { font-family: var(--serif); font-size: 38px; font-weight: 500; color: var(--teal); line-height: 1; letter-spacing: -.04em; }
.big-score span { font-size: 11px; color: var(--muted); letter-spacing: 0; }
.detail-state small { color: var(--muted); font-size: 10px; }
.alert { display: flex; gap: 11px; padding: 13px 15px; border-radius: 12px; margin-bottom: 16px; border: 1px solid; font-size: 11.5px; line-height: 1.45; align-items: flex-start; }
.alert .icon { width: 17px; height: 17px; margin-top: 1px; flex: none; }
.alert strong { display: block; margin-bottom: 2px; }
.alert p { margin: 0; }
.alert-hold { background: #fdf1e7; border-color: #ebc9b3; color: #754027; }
.alert-blocked, .alert-blocked-source { background: var(--danger-soft); border-color: #e3b4ae; color: #6e2f2b; }
.alert-soft { background: #f9f6ed; border-color: var(--line); color: var(--ink-soft); }
.alert-soft .icon { color: var(--teal); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.detail-grid > *, .doc-layout > *, .dialogue-grid > *, .two-col > *, .profile-top > * { min-width: 0; }
.sticky { position: sticky; top: 18px; }
.prose { white-space: pre-line; font-size: 13.5px; line-height: 1.65; color: var(--ink-soft); }
.source-line { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-top: 1px solid var(--line); margin-top: 14px; padding-top: 10px; color: var(--muted); font-size: 10.5px; }
.source-line code { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 2px 6px; font-size: 9.5px; overflow-wrap: anywhere; }
.requirement-list { display: flex; flex-direction: column; gap: 6px; }
.requirement { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.requirement.gap { border-style: dashed; }
.req-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.requirement.gap .req-icon { background: var(--accent-soft); color: var(--accent); }
.req-icon .icon { width: 13px; height: 13px; }
.requirement > div { min-width: 0; display: flex; flex-direction: column; }
.requirement strong { font-size: 12px; }
.requirement small { color: var(--muted); font-size: 9.5px; }
.requirement > .badge { margin-left: auto; }
.rating-list { display: flex; flex-direction: column; gap: 10px; }
.rating-row { display: grid; grid-template-columns: 120px 1fr 42px; gap: 8px; align-items: center; }
.rating-label { display: flex; flex-direction: column; }
.rating-label strong { font-size: 11.5px; }
.rating-label span { font-size: 9px; color: var(--muted); }
.rating-track { height: 6px; border-radius: 99px; background: #ede8dd; overflow: hidden; }
.rating-fill { height: 100%; background: linear-gradient(90deg, #9bc2b5, var(--teal)); }
.rating-value { text-align: right; font-size: 11px; font-weight: 700; color: var(--teal); }
.rating-basis { grid-column: 1 / -1; margin: -3px 0 0; font-size: 10px; color: var(--muted); }
.decision-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.decision-grid .btn { justify-content: flex-start; }
.form-row { display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 9px; flex: 1; min-width: 0; }
.field span { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 9px; font-size: 12px; outline: 0; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,90,83,.08); }
.field textarea { resize: vertical; }
.stack-form { display: flex; flex-direction: column; }
.stack-form .btn { margin-top: 8px; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 11.5px; color: var(--ink-soft); margin: 8px 0; cursor: pointer; }
.checkline input { margin-top: 3px; accent-color: var(--teal); }
.notice { background: var(--paper); border-left: 3px solid var(--accent); padding: 9px 11px; font-size: 11px; color: var(--muted); margin: 10px 0 0; }

.dialogue-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.question-cards { display: flex; flex-direction: column; gap: 9px; }
.question-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.question-card.resolved { opacity: .66; background: #fbf8f0; }
.q-head { display: flex; gap: 9px; align-items: center; margin-bottom: 7px; }
.q-head > div { display: flex; flex-direction: column; }
.q-head strong { font-size: 12px; }
.q-head small { font-size: 9.5px; color: var(--muted); }
.q-head .badge { margin-left: auto; }
.question-card p { font-size: 12px; margin: 0 0 9px; line-height: 1.5; }
.answer-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.answer-result { font-size: 11px; background: var(--paper); border-radius: 7px; padding: 7px 9px; }
.chat-panel { display: flex; flex-direction: column; min-height: 540px; position: sticky; top: 18px; }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 9px; max-height: 430px; overflow-y: auto; padding: 5px 2px 12px; }
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble { max-width: 88%; padding: 9px 11px; border-radius: 12px 12px 12px 3px; background: var(--paper); font-size: 12px; line-height: 1.5; white-space: pre-line; }
.chat-msg.user .chat-bubble { background: var(--teal); color: #fff; border-radius: 12px 12px 3px 12px; }
.chat-refs { display: flex; flex-direction: column; gap: 3px; margin-top: 5px; font-size: 10px; }
.chat-refs a { text-decoration: underline; opacity: .8; }
.chat-empty { text-align: center; color: var(--muted); font-size: 11.5px; padding: 40px 20px; }
.chat-empty .empty-icon { margin-bottom: 8px; }
.chat-form { display: flex; gap: 7px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-form textarea { flex: 1; border: 1px solid var(--line); border-radius: 9px; padding: 8px 9px; resize: none; outline: 0; font-size: 12px; }
.chat-form .btn { width: 40px; height: 38px; padding: 0; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-row { display: flex; gap: 11px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-row:last-child { border-bottom: 0; }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); margin-top: 5px; flex: none; }
.timeline-dot.type-response, .timeline-dot.type-interview { background: var(--gold); }
.timeline-dot.type-offer, .timeline-dot.type-payment_received { background: var(--accent); }
.timeline-dot.type-rejected_by_employer, .timeline-dot.type-rejected_by_me { background: var(--danger); }
.timeline-head { display: flex; justify-content: space-between; gap: 8px; }
.timeline-head strong { font-size: 12px; }
.timeline-head time { font-size: 9.5px; color: var(--muted); }
.timeline-row p { margin: 4px 0; font-size: 11.5px; }

.profile-top { grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); }
.profile-summary h2 { margin-top: 4px; }
.availability-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.availability-cell { background: var(--paper); border-radius: 10px; padding: 9px; display: flex; flex-direction: column; gap: 1px; }
.availability-cell span { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.availability-cell strong { font-size: 12px; }
.availability-cell small { font-size: 9.5px; color: var(--muted); }
.fact-list { display: flex; flex-direction: column; }
.fact-row { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.fact-row:last-child { border-bottom: 0; }
.fact-period { display: flex; flex-direction: column; border-right: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.fact-period strong { color: var(--ink); font-size: 12px; }
.fact-period small { font-size: 9px; margin-top: 2px; }
.fact-body h3 { font-size: 14px; margin-bottom: 3px; }
.fact-role { color: var(--muted); font-size: 10.5px; margin: 0 0 5px; }
.fact-body p { font-size: 12px; margin: 4px 0; }
.fact-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.skill-groups { display: flex; flex-direction: column; gap: 12px; }
.skill-group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.skill-group h3 span { background: var(--paper); padding: 1px 6px; border-radius: 99px; font-size: 9.5px; }
.doc-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.doc-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 4px; transition: .16s; }
.doc-card:hover { border-color: var(--teal); transform: translateY(-1px); }
.doc-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.doc-card strong { font-size: 11.5px; line-height: 1.35; }

.doc-head { align-items: flex-start; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.export-group { display: flex; gap: 4px; }
.doc-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .8fr); gap: 18px; align-items: start; }
.paper-wrap { background: #e9e3d6; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.paper { background: #fff; padding: 44px 46px; min-height: 720px; box-shadow: 0 10px 30px rgba(22,33,31,.12); border: 1px solid #eee7d8; max-width: 780px; margin: 0 auto; }
.paper h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 16px; color: var(--ink); }
.paper h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .09em; border-bottom: 1px solid #d8d1c3; padding-bottom: 4px; margin: 20px 0 8px; color: var(--teal-dark); }
.paper h3 { font-size: 13px; margin: 9px 0 2px; }
.paper p { font-size: 11.5px; line-height: 1.6; margin: 4px 0; color: #293430; }
.paper .paper-meta { color: #6e7b77; font-size: 10px; }
.paper-skills { margin: 4px 0; padding-left: 17px; columns: 2; font-size: 11.5px; }
.paper-note { margin-top: 26px !important; padding-top: 9px; border-top: 1px dashed #d8d1c3; color: #8b8578 !important; font-size: 9.5px !important; }
.paper-item { margin-bottom: 7px; }
.doc-side { display: flex; flex-direction: column; gap: 12px; }
.gap-box { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.gap-box strong { font-size: 10px; text-transform: uppercase; color: var(--muted); }
.change-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.change-list li { font-size: 10.5px; padding-left: 15px; position: relative; color: var(--ink-soft); }
.change-list li::before { content: "+"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.change-list li.omitted::before { content: "−"; color: var(--danger); }
.change-list li.gap::before { content: "!"; color: var(--accent); }
.evidence-list { display: flex; flex-direction: column; gap: 7px; max-height: 320px; overflow-y: auto; }
.evidence-row { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.evidence-row p { margin: 3px 0; font-size: 10.5px; line-height: 1.4; }
.evidence-row small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.version-list { display: flex; flex-direction: column; gap: 4px; }
.version-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; padding: 4px 0; }
.version-row span:nth-child(2) { color: var(--muted); }

.funnel { display: flex; flex-direction: column; gap: 9px; }
.funnel-row { display: flex; flex-direction: column; gap: 3px; }
.funnel-label { display: flex; align-items: baseline; gap: 7px; font-size: 11px; }
.funnel-label strong { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.funnel-label small { color: var(--muted); margin-left: auto; font-size: 9px; }
.funnel-track { height: 6px; background: #ede8dd; border-radius: 99px; overflow: hidden; }
.funnel-fill { height: 100%; background: linear-gradient(90deg, #a2c9bb, var(--teal)); }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: flex; flex-direction: column; gap: 4px; }
.bar-label { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.bar-label strong { margin-left: auto; }
.bar-track { height: 7px; border-radius: 99px; background: #ede8dd; overflow: hidden; }
.bar-fill { height: 100%; background: var(--teal); }
.fill-c1 { background: var(--teal); } .fill-c2 { background: var(--gold); } .fill-c3 { background: var(--blue); } .fill-c4 { background: #7d67a3; } .fill-c5 { background: var(--accent); } .fill-warn { background: var(--accent); }
.bar-row small { font-size: 9.5px; color: var(--muted); }
.skill-demand { display: flex; flex-direction: column; gap: 6px; }
.demand-row { display: grid; grid-template-columns: minmax(100px, 1fr) 1.2fr 25px auto; align-items: center; gap: 7px; font-size: 10.5px; }
.demand-track { height: 5px; border-radius: 99px; background: #ede8dd; overflow: hidden; }
.demand-track div { height: 100%; background: var(--teal); }
.econ-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 9px; }
.econ-card { background: var(--paper); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.econ-card span { font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.econ-card strong { font-family: var(--serif); font-size: 19px; font-weight: 500; }
.econ-card small { font-size: 9px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { text-align: left; font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 1px solid var(--line); padding: 6px 7px; }
.data-table td { padding: 7px; border-bottom: 1px solid #eee9df; vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.metric-list { list-style: none; padding: 0; margin: 0; }
.metric-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.metric-list li:last-child { border-bottom: 0; }
.period-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.period-card { background: var(--paper); border-radius: 11px; padding: 12px; }
.period-card h3 { font-size: 12px; margin-bottom: 7px; }
.period-card > div { display: flex; justify-content: space-between; font-size: 10.5px; padding: 3px 0; }
.period-card strong { font-family: var(--serif); font-size: 15px; font-weight: 500; }

.section-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title { display: flex; gap: 11px; align-items: flex-start; margin: 22px 0 12px; }
.section-title h2 { font-size: 20px; }
.section-title p { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }
.hyp-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.hyp-card { background: var(--card); border: 1px solid var(--line); border-radius: 15px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.hyp-card.approved { border-top: 3px solid var(--teal); }
.hyp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.hyp-card h3 { font-size: 16px; }
.hyp-card p { font-size: 11.5px; margin: 0; line-height: 1.5; }
.hyp-criteria { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 3px; }
.hyp-criteria > div { background: var(--paper); border-radius: 8px; padding: 8px; }
.hyp-criteria span { font-size: 8.5px; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; }
.hyp-criteria p { font-size: 10px; }
.hyp-evidence { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.panel-subhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 10.5px; }
.evidence-line { display: flex; align-items: flex-start; gap: 6px; padding: 4px 0; font-size: 10px; color: var(--ink-soft); }
.evidence-line > span:nth-child(2) { flex: 1; }
.evidence-line small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.hyp-exp { border-top: 1px solid var(--line); padding-top: 8px; font-size: 10.5px; }
.hyp-exp p { font-size: 10px; }
.hyp-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 9px; margin-top: auto; gap: 8px; }

.source-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.source-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; display: flex; flex-direction: column; gap: 7px; }
.source-card.is-off { background: #fbf8f0; }
.source-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.source-kind { font-size: 8.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.source-head h3 { font-size: 13px; }
.status-pill { font-size: 8.5px; font-weight: 700; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; }
.status-pill.on { background: var(--teal-soft); color: var(--teal); }
.status-pill.off { background: #eae5da; color: #746d60; }
.source-meta { margin: 0; display: flex; flex-direction: column; gap: 3px; font-size: 9.5px; }
.source-meta div { display: flex; gap: 5px; }
.source-meta dt { color: var(--muted); min-width: 82px; }
.source-meta dd { margin: 0; overflow-wrap: anywhere; }
.button-row { display: flex; gap: 5px; flex-wrap: wrap; }
.passkey-list { display: flex; flex-direction: column; gap: 6px; }
.passkey-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.passkey-row:last-child { border-bottom: 0; }
.passkey-icon { width: 28px; height: 28px; border-radius: 8px; background: var(--paper); color: var(--teal); display: grid; place-items: center; }
.passkey-row span:nth-child(2) { display: flex; flex-direction: column; }
.passkey-row strong { font-size: 11.5px; }
.passkey-row small { font-size: 9.5px; color: var(--muted); }
.setting-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.switch input { display: none; }
.switch span { display: block; width: 38px; height: 22px; border-radius: 99px; background: #d7d1c4; position: relative; transition: .16s; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 3px; left: 3px; transition: .16s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--teal); }
.switch input:checked + span::after { transform: translateX(16px); }
.event-list { display: flex; flex-direction: column; }
.event-row { display: grid; grid-template-columns: 1fr 130px 70px; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.event-row:last-child { border-bottom: 0; }
.event-type { font-weight: 600; color: var(--ink-soft); }
.event-row span:nth-child(2) { color: var(--muted); }

.auth-body { background: var(--teal-dark); min-height: 100vh; }
.auth-shell { display: grid; grid-template-columns: 1.15fr .85fr; min-height: 100vh; }
.auth-hero { padding: 38px 52px; color: #eef5f1; display: flex; flex-direction: column; position: relative; overflow: hidden; background: radial-gradient(circle at 78% 28%, rgba(199,107,61,.19), transparent 28%), radial-gradient(circle at 18% 92%, rgba(117,172,154,.18), transparent 32%), var(--teal-dark); }
.auth-hero::after { content: ""; position: absolute; width: 420px; height: 420px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; right: -160px; top: 26%; }
.auth-hero::before { content: ""; position: absolute; width: 220px; height: 220px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; right: -60px; top: 37%; }
.auth-brand { display: flex; align-items: center; gap: 11px; position: relative; z-index: 1; }
.auth-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.auth-brand strong { font-size: 15px; }
.auth-brand small { font-size: 10px; color: #9dbfb3; text-transform: uppercase; letter-spacing: .09em; margin-top: 3px; }
.auth-hero-copy { max-width: 560px; margin-top: clamp(60px, 14vh, 150px); position: relative; z-index: 1; }
.auth-hero-copy h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 4.7vw, 66px); line-height: .98; letter-spacing: -.04em; margin: 14px 0 18px; }
.auth-hero-copy p { color: #b9cec6; font-size: 14px; max-width: 470px; line-height: 1.6; }
.auth-points { list-style: none; padding: 0; margin: 34px 0 0; display: flex; flex-direction: column; gap: 16px; max-width: 500px; position: relative; z-index: 1; }
.auth-points li { display: flex; gap: 12px; align-items: flex-start; }
.point-icon { width: 29px; height: 29px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); color: #d8e6e0; display: grid; place-items: center; font-size: 9px; font-weight: 700; flex: none; }
.auth-points strong { font-size: 12px; color: #f4f8f6; }
.auth-points span:last-child { color: #9fbbb1; font-size: 10.5px; line-height: 1.5; }
.auth-hero-foot { margin-top: auto; padding-top: 30px; color: #89a99d; font-size: 10px; display: flex; gap: 7px; align-items: center; position: relative; z-index: 1; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #7fbf9f; box-shadow: 0 0 0 3px rgba(127,191,159,.15); display: inline-block; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 34px 28px; background: var(--paper); }
.auth-card { width: min(410px, 100%); }
.auth-card-head h2 { font-family: var(--serif); font-size: 31px; font-weight: 500; margin: 8px 0 3px; }
.auth-card-head p { margin: 0 0 18px; font-size: 11.5px; }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 18px; gap: 2px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 8px 4px 10px; font-size: 10.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; }
.auth-tab.active { color: var(--teal); border-bottom-color: var(--teal); }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 9px; }
.auth-details summary { cursor: pointer; font-size: 10.5px; color: var(--muted); }
.auth-details .field { margin-top: 9px; }
.auth-message { margin-top: 12px; padding: 9px 11px; border-radius: 8px; background: var(--accent-soft); color: #7b3e20; font-size: 11px; border: 1px solid #ecc7b2; }
.auth-message.error { background: var(--danger-soft); color: var(--danger); border-color: #e4b8b2; }
.auth-warning { display: flex; gap: 7px; align-items: flex-start; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 9.5px; line-height: 1.5; }
.auth-warning .icon { width: 14px; height: 14px; color: var(--teal); }
.auth-foot { margin-top: 30px; font-size: 9.5px; color: var(--muted); }
.auth-foot a { text-decoration: underline; }
.recovery-modal { width: min(520px, 92vw); }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.recovery-code { font-family: ui-monospace, Consolas, monospace; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 7px; font-size: 11px; text-align: center; letter-spacing: .03em; }

.markdown-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; line-height: 1.65; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px; color: var(--ink-soft); }
.file-input { width: 100%; border: 1px dashed var(--line-strong); border-radius: 9px; padding: 10px; font-size: 11px; background: #fbf8f0; margin-bottom: 8px; }
.knowledge-list { display: flex; flex-direction: column; gap: 8px; }
.knowledge-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 11px; background: #fff; }
.knowledge-row:hover { border-color: var(--teal); }
.knowledge-row > div { min-width: 0; flex: 1; }
.knowledge-row h3 { font-size: 14px; margin: 5px 0 2px; }
.knowledge-row p { margin: 0 0 3px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.knowledge-row small { font-size: 9.5px; color: var(--muted); }
.knowledge-row > .icon { color: var(--muted); width: 15px; height: 15px; }
.kb-preview-list { display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.kb-preview-item { display: flex; align-items: flex-start; gap: 7px; border-bottom: 1px solid var(--line); padding: 7px 0; font-size: 10.5px; }
.kb-preview-item input[type=checkbox] { margin-top: 3px; }
.kb-preview-item span { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.kb-preview-item small { color: var(--muted); font-size: 9.5px; }
.kb-preview-item select { border: 1px solid var(--line); border-radius: 6px; font-size: 9.5px; padding: 3px; max-width: 120px; }
.inline-select { border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: #fff; font-size: 11px; }
.knowledge-layout { grid-template-columns: minmax(0, 1.9fr) minmax(300px, .85fr); }
@media (max-width: 900px) {
  .knowledge-layout .filter-bar { width: 100%; }
  .knowledge-layout .search-field { flex: 1 1 100%; }
}

.bottom-nav { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: .2s; z-index: 300; max-width: min(520px, 90vw); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(12,24,21,.48); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: center; padding: 20px; }
.modal-backdrop[hidden] { display: none; }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: 18px; width: min(590px, 94vw); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 500; }
.modal-body { padding: 15px 18px; overflow-y: auto; }
.modal-foot { padding: 10px 18px 16px; display: flex; gap: 8px; }
.modal-body p { font-size: 12px; }
.recovery-modal [disabled] { opacity: .4; }

@media (max-width: 1120px) {
  :root { --sidebar: 228px; }
  .content { padding: 24px 22px 70px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .flow-grid { grid-template-columns: repeat(3, 1fr); }
  .source-grid { grid-template-columns: repeat(2, 1fr); }
  .doc-grid { grid-template-columns: repeat(2, 1fr); }
  .econ-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .mobile-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 15px; background: var(--teal-dark); color: #fff; }
  .brand.compact { padding: 0; color: #fff; gap: 8px; }
  .brand.compact .brand-mark { width: 31px; height: 31px; border-radius: 9px; font-size: 13px; }
  .brand.compact strong { font-size: 13.5px; }
  .mobile-head-right { display: flex; align-items: center; gap: 11px; }
  .mobile-head .avatar { width: 29px; height: 29px; background: rgba(255,255,255,.12); color: #fff; }
  .stand-banner { padding: 7px 14px; font-size: 9.5px; gap: 8px; }
  .stand-banner .banner-code { display: none; }
  .content { padding: 18px 14px 94px; }
  h1 { font-size: 31px; }
  .two-col, .detail-grid, .doc-layout, .dialogue-grid, .profile-top { grid-template-columns: 1fr; }
  .chat-panel { position: static; min-height: 480px; }
  .sticky { position: static; }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fffdf8; border-top: 1px solid var(--line); z-index: 100; padding: 5px 5px calc(5px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 24px rgba(22,33,31,.08); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 2px; font-size: 8.5px; color: var(--muted); position: relative; border-radius: 8px; }
  .bottom-nav a.active { color: var(--teal); background: var(--teal-soft); font-weight: 700; }
  .bottom-nav .icon { width: 19px; height: 19px; }
  .dot-badge { position: absolute; top: 2px; right: 22%; background: var(--accent); color: #fff; font-style: normal; font-size: 8px; min-width: 14px; height: 14px; border-radius: 99px; display: grid; place-items: center; }
  .detail-head { flex-direction: column; gap: 11px; }
  .detail-state { align-items: flex-start; text-align: left; flex-direction: row; align-items: center; gap: 9px; }
  .big-score { font-size: 29px; }
  .doc-actions { justify-content: flex-start; }
  .paper { padding: 30px 24px; }
  .paper-wrap { padding: 10px; }
  .hyp-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .fact-row { grid-template-columns: 88px 1fr; gap: 9px; }
  .view-tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .filter-bar { align-items: flex-start; }
  .search-form { width: 100%; }
  .search-field { flex: 1; }
  .search-field input { width: 100%; }
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { min-height: auto; padding: 28px 24px 26px; }
  .auth-hero-copy { margin-top: 38px; }
  .auth-hero-copy h1 { font-size: 40px; }
  .auth-points { display: none; }
  .auth-hero-foot { display: none; }
  .auth-panel { padding: 26px 20px 40px; }
  .auth-card-head h2 { font-size: 28px; }
}
@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px; gap: 8px; }
  .stat-card strong { font-size: 23px; }
  .stat-card small { display: none; }
  .flow-grid { grid-template-columns: 1fr 1fr; gap: 7px; }
  .flow-tile { padding: 9px; }
  .flow-name { font-size: 9.5px; }
  .opp-grid { grid-template-columns: 1fr; }
  .decision-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; gap: 0; }
  .availability-row { grid-template-columns: 1fr; }
  .fact-head { flex-direction: column; }
  .fact-row { grid-template-columns: 1fr; }
  .fact-period { flex-direction: row; gap: 7px; border-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
  .paper { padding: 24px 18px; min-height: 500px; }
  .paper h1 { font-size: 23px; }
  .paper-skills { columns: 1; }
  .econ-grid, .period-grid { grid-template-columns: 1fr 1fr; }
  .event-row { grid-template-columns: 1fr 80px; }
  .event-row span:last-child { display: none; }
  .rating-row { grid-template-columns: 95px 1fr 36px; }
  .modal-backdrop { padding: 8px; }
  .modal { width: 100%; max-height: 94vh; }
  .auth-hero-copy h1 { font-size: 34px; }
  .recovery-grid { grid-template-columns: 1fr; }
  .doc-grid { grid-template-columns: 1fr; }
}
