:root {
  --ink: #0B0E12; --ink-2: #14181F; --ink-3: #1C2128; --ink-4: #252B34;
  --line: rgba(212, 188, 138, 0.14); --line-strong: rgba(212, 188, 138, 0.30);
  --cream: #F1EADC; --paper: #FBF8F1; --paper-ink: #1A1815; --paper-mute: #6B665C;
  --gold: #C9A86A; --gold-bright: #E0BE7E; --gold-deep: #8A6F3F;
  --rust: #C57954; --green: #6FCF97; --bone: #D9D0BA; --mute: #7C8492; --mute-2: #A4ACBA;
  --c-identity: rgba(201, 168, 106, 0.38); --c-contact: rgba(92, 142, 204, 0.26);
  --c-gov: rgba(197, 121, 84, 0.34); --c-fin: rgba(197, 121, 84, 0.26); --c-health: rgba(150, 102, 196, 0.28);
  --c-legal: rgba(56, 150, 140, 0.28); --c-context: rgba(124, 132, 146, 0.24); --c-custom: rgba(111, 207, 151, 0.34);
  --r: 6px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif; background: var(--ink); color: var(--cream);
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--cream); }
a { color: var(--gold); text-decoration: none; }
code { font-family: 'JetBrains Mono', monospace; font-size: 0.9em; color: var(--gold-bright); }
.muted { color: var(--mute-2); font-size: 13px; }
.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
[hidden] { display: none !important; }

/* ---------- Top bar ---------- */
.bar {
  height: 58px; display: flex; align-items: center; gap: 20px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: rgba(11, 14, 18, 0.92); position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); }
.glyph { width: 30px; height: 30px; fill: none; stroke: var(--gold); stroke-width: 5; stroke-linecap: round; }
.glyph .faint { stroke-opacity: 0.4; }
.brand .word { font-family: 'Fraunces', serif; font-size: 23px; font-weight: 500; letter-spacing: -0.01em; font-variation-settings: "opsz" 48, "SOFT" 30, "WONK" 1; }
.brand .by { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); padding-left: 10px; border-left: 1px solid var(--line); }
.brand .dot { color: var(--gold); }
.trust {
  display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid rgba(111, 207, 151, 0.3);
  border-radius: 99px; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em; color: var(--green);
  background: rgba(111, 207, 151, 0.06);
}
.trust { cursor: pointer; font: inherit; font-family: 'JetBrains Mono', monospace; font-size: 11px; }
.trust:hover { border-color: rgba(111, 207, 151, 0.6); }
.trust.warn { color: var(--rust); border-color: rgba(197, 121, 84, 0.4); background: rgba(197, 121, 84, 0.06); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 currentColor; animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(111, 207, 151, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(111, 207, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 207, 151, 0); } }
.bar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.ghost { padding: 7px 12px; border-radius: var(--r); color: var(--bone); border: 1px solid transparent; font-size: 13px; }
.ghost:hover { border-color: var(--line-strong); color: var(--gold-bright); }
.plan { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border: 1px solid var(--line-strong); border-radius: 99px; font-weight: 600; font-size: 13px; }
.plan .meter { white-space: nowrap; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 400; padding: 3px 8px; border-radius: 99px; background: var(--gold); color: var(--ink); letter-spacing: 0.04em; }
.plan.pro .meter { background: var(--green); }

/* ---------- Workspace ---------- */
.workspace { display: grid; grid-template-columns: 268px minmax(0, 1fr) 360px; height: calc(100vh - 58px); }
.rail, .intel { overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 16px 40px; background: var(--ink); }
.intel { border-right: 0; border-left: 1px solid var(--line); padding: 14px 14px 60px; }
.rail::-webkit-scrollbar, .intel::-webkit-scrollbar, .paper-wrap::-webkit-scrollbar { width: 8px; }
.rail::-webkit-scrollbar-thumb, .intel::-webkit-scrollbar-thumb, .paper-wrap::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 8px; }

.drop {
  display: block; text-align: center; padding: 26px 14px; border: 1.5px dashed var(--line-strong); border-radius: 10px;
  cursor: pointer; transition: all 0.2s; background: linear-gradient(180deg, rgba(201, 168, 106, 0.05), transparent);
}
.drop:hover, body.dragging .drop { border-color: var(--gold); background: rgba(201, 168, 106, 0.09); }
.drop-icon { font-size: 26px; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.drop-title { font-family: 'Fraunces', serif; font-size: 19px; }
.drop-sub { font-size: 11.5px; color: var(--mute-2); margin-top: 4px; }
.paste { width: 100%; margin-top: 8px; padding: 8px; font-size: 12.5px; color: var(--mute-2); border-radius: var(--r); }
.paste:hover { color: var(--gold-bright); background: var(--ink-2); }
.rail-h { display: flex; justify-content: space-between; align-items: center; margin: 22px 0 8px; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--mute); }
.tiny { font-size: 10.5px; padding: 2px 8px; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--bone); letter-spacing: 0.1em; }
.tiny:hover { color: var(--gold-bright); border-color: var(--gold); }
.queue { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.queue-empty { color: var(--mute); font-size: 12.5px; padding: 6px 2px; }
.qi { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; background: var(--ink-2); }
.qi:hover { border-color: var(--line); }
.qi.on { border-color: var(--gold); background: var(--ink-3); }
.qi > span:nth-child(2) { min-width: 0; }
.qi > span:last-child { display: flex; align-items: center; gap: 2px; }
.qi .ext { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; text-transform: uppercase; text-align: center; padding: 6px 0; border-radius: 4px; background: var(--ink-4); color: var(--gold-bright); }
.qi .nm { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qi .st { font-size: 11px; color: var(--mute-2); }
.qi .badge { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; padding: 2px 7px; border-radius: 99px; }
.lvl-Critical { background: rgba(197, 84, 84, 0.2); color: #F09A8A; }
.lvl-High { background: rgba(197, 121, 84, 0.2); color: var(--rust); }
.lvl-Moderate { background: rgba(201, 168, 106, 0.18); color: var(--gold-bright); }
.lvl-Low, .lvl-Clear { background: rgba(111, 207, 151, 0.14); color: var(--green); }
.qi .rm { color: var(--mute); font-size: 15px; padding: 0 4px; }
.qi .rm:hover { color: var(--rust); }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--gold); border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }
.samples { display: flex; flex-direction: column; gap: 6px; }
.samples button { text-align: left; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.samples button:hover { border-color: var(--gold); background: var(--ink-2); }
.samples b { font-weight: 600; font-size: 13px; color: var(--gold-bright); }
.samples span { font-size: 11.5px; color: var(--mute-2); }

/* ---------- Stage ---------- */
.stage { position: relative; display: flex; flex-direction: column; min-width: 0; background: radial-gradient(ellipse at 50% 0%, rgba(201, 168, 106, 0.06), transparent 60%), var(--ink-2); }
.stage-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.seg button { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; color: var(--mute-2); }
.seg button.on { background: var(--ink-4); color: var(--gold-bright); box-shadow: inset 0 0 0 1px var(--line-strong); }
.seg button:hover:not(.on) { color: var(--cream); }
.doc-title { margin-left: auto; font-size: 12.5px; color: var(--mute-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; font-family: 'JetBrains Mono', monospace; }

.empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px; overflow-y: auto; }
.empty-inner { max-width: 600px; }
.empty h1 { font-family: 'Fraunces', serif; font-weight: 400; font-size: clamp(38px, 4.6vw, 64px); line-height: 1.02; letter-spacing: -0.02em; margin: 14px 0 18px; font-variation-settings: "opsz" 144, "SOFT" 30, "WONK" 1; }
.empty h1 em { color: var(--gold); font-style: italic; }
.empty p { color: var(--bone); font-size: 16px; max-width: 540px; }
.proof { list-style: none; margin: 22px 0 28px; display: grid; gap: 8px; }
.proof li { padding-left: 18px; position: relative; color: var(--mute-2); }
.proof li::before { content: ""; position: absolute; left: 0; top: 9px; width: 8px; height: 1px; background: var(--gold); }
.proof b { color: var(--cream); font-weight: 600; }
.empty-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.cta { display: inline-block; background: var(--gold); color: var(--ink); padding: 11px 20px; border-radius: 3px; font-weight: 600; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid var(--gold); cursor: pointer; }
.cta:hover { background: var(--gold-bright); }
.cta.ghost { background: transparent; color: var(--gold); }
.cta.ghost:hover { background: rgba(201, 168, 106, 0.1); }

.paper-wrap { flex: 1; overflow-y: auto; padding: 26px 26px 80px; }
.notice { max-width: 860px; margin: 0 auto 14px; padding: 10px 14px; border-radius: 8px; border: 1px solid rgba(197, 121, 84, 0.4); background: rgba(197, 121, 84, 0.08); color: #F0C2AA; font-size: 13px; }
.papers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; max-width: 880px; margin: 0 auto; }
.papers > .paper { min-width: 0; }
.papers.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); max-width: 1400px; }
.paper {
  background: var(--paper); color: var(--paper-ink); border-radius: 3px; padding: 56px 60px 64px; min-height: 60vh;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 0, 0, 0.2); font-size: 14.5px; line-height: 1.68;
  font-family: 'Plus Jakarta Sans', sans-serif; position: relative; overflow-wrap: anywhere;
}
.papers.split .paper { padding: 40px 36px; font-size: 13.5px; }
.paper-tag { position: absolute; top: 16px; right: 18px; font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-mute); }
.paper-tag.clean { color: #3E8E63; }
.paper h1 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 27px; line-height: 1.2; margin: 0 0 14px; letter-spacing: -0.01em; }
.paper h2 { font-family: 'Fraunces', serif; font-weight: 500; font-size: 20px; margin: 22px 0 8px; }
.paper h3 { font-size: 15px; font-weight: 700; margin: 18px 0 6px; letter-spacing: 0.01em; }
.paper p { margin: 0 0 10px; white-space: pre-wrap; }
.paper li { margin: 0 0 5px 22px; white-space: pre-wrap; }
.paper blockquote { border-left: 3px solid #D8CFBB; padding-left: 14px; color: #4A463F; margin: 0 0 10px; }
.paper .tbl-wrap { overflow-x: auto; margin: 6px 0 18px; border: 1px solid #E2DACA; border-radius: 3px; }
.paper table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.paper th, .paper td { border-bottom: 1px solid #ECE5D6; padding: 6px 9px; text-align: left; vertical-align: top; white-space: nowrap; }
.paper th { background: #F2ECDF; font-weight: 700; position: sticky; top: 0; }
.paper .sheet-h { display: flex; gap: 10px; align-items: baseline; }
.paper .hid-banner { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; background: #3A2A20; color: #F0C2AA; padding: 2px 8px; border-radius: 3px; }
.paper .clean-band { margin: -24px 0 26px; padding: 10px 0; border-bottom: 1px solid #E2DACA; display: flex; justify-content: space-between; gap: 12px; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-mute); flex-wrap: wrap; }

mark.ent { background: var(--c-context); color: inherit; border-radius: 3px; padding: 0 2px; cursor: pointer; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: outline 0.1s; }
mark.ent:hover, mark.ent.hl { outline: 2px solid var(--gold-deep); }
mark.ent.off { background: transparent; border-bottom: 1.5px dashed #B3AA97; border-radius: 0; }
mark.ent.low { box-shadow: inset 0 -2px 0 #C57954; }
.g-Identity { background: var(--c-identity) !important; } .g-Contact { background: var(--c-contact) !important; }
.g-Government.ID, .g-GovernmentID { background: var(--c-gov) !important; } .g-Financial { background: var(--c-fin) !important; }
.g-Health { background: var(--c-health) !important; } .g-Legal { background: var(--c-legal) !important; }
.g-Context, .g-Digital { background: var(--c-context) !important; } .g-Custom { background: var(--c-custom) !important; }
mark.ent.off[class*="g-"] { background: transparent !important; }
.rep-token { font-family: 'JetBrains Mono', monospace; font-size: 0.86em; font-weight: 500; color: #7A5E2E; background: #F1E6CC; padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.rep-synth { background: linear-gradient(transparent 62%, rgba(111, 207, 151, 0.35) 62%); }
.rep-redact { background: #111; color: #111; border-radius: 1px; padding: 0 2px; user-select: none; letter-spacing: -1px; }
.paper.plain .rep-synth { background: none; }

.selpop { position: fixed; z-index: 30; }
.selpop button { background: var(--ink); color: var(--gold-bright); border: 1px solid var(--gold); padding: 6px 10px; border-radius: 6px; font-size: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.tip { position: fixed; z-index: 40; pointer-events: none; background: var(--ink); color: var(--cream); border: 1px solid var(--line-strong); border-radius: 6px; padding: 7px 10px; font-size: 12px; max-width: 280px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
.tip b { color: var(--gold-bright); }
.tip .r { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--mute-2); }

/* ---------- Intel cards ---------- */
.card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.card-h { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; display: flex; justify-content: space-between; }
.card-h .count { color: var(--mute-2); letter-spacing: 0.06em; }
.gauge-row { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; text-align: center; }
.gauge { position: relative; }
.gauge svg { width: 100%; max-width: 130px; display: block; margin: 0 auto; }
.gauge path { fill: none; stroke-width: 9; stroke-linecap: round; }
.gauge .track { stroke: var(--ink-4); }
.gauge .val { stroke: var(--rust); stroke-dasharray: 157; stroke-dashoffset: 157; transition: stroke-dashoffset 0.9s cubic-bezier(.2, .8, .2, 1), stroke 0.4s; }
.gauge.after .val { stroke: var(--green); }
.g-num { font-family: 'Fraunces', serif; font-size: 30px; margin-top: -34px; line-height: 1; }
.g-lbl { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--mute-2); margin-top: 6px; }
.arrow { color: var(--mute); font-size: 18px; }
.exp-sum { font-size: 12.5px; color: var(--bone); margin-top: 12px; text-align: center; }
.exp-sum b { color: var(--gold-bright); }
.verify { margin-top: 10px; padding: 7px 10px; border-radius: 6px; font-size: 12px; text-align: left; }
.verify.ok { background: rgba(111, 207, 151, 0.08); color: var(--green); border: 1px solid rgba(111, 207, 151, 0.25); }
.verify.bad { background: rgba(197, 121, 84, 0.08); color: #F0C2AA; border: 1px solid rgba(197, 121, 84, 0.35); }

.add-term { display: flex; gap: 6px; margin-bottom: 10px; }
.add-term input { flex: 1; min-width: 0; background: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 12.5px; }
.add-term input:focus { outline: none; border-color: var(--gold); }
.add-term button { padding: 0 12px; border-radius: 6px; border: 1px solid var(--line-strong); color: var(--gold-bright); font-size: 12.5px; }
.findings { display: flex; flex-direction: column; gap: 4px; }
.fcat { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 4px; }
.fcat:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.fcat-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.fcat-h .sw { width: 9px; height: 9px; border-radius: 2px; }
.fcat-h .n { margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--mute-2); font-weight: 400; }
.toggle { position: relative; width: 28px; height: 16px; border-radius: 99px; background: var(--ink-4); flex: none; transition: background 0.2s; }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--mute-2); transition: all 0.2s; }
.toggle.on { background: rgba(201, 168, 106, 0.5); }
.toggle.on::after { left: 14px; background: var(--gold-bright); }
.fv { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 5px; font-size: 12.5px; cursor: pointer; }
.fv:hover { background: var(--ink-3); }
.fv .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv.off .v { text-decoration: line-through; color: var(--mute); }
.fv .c { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; color: var(--mute-2); }
.fv .conf { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; color: var(--rust); }
.fv .al { opacity: 0; font-size: 10.5px; color: var(--mute-2); padding: 0 4px; border-radius: 3px; }
.fv:hover .al { opacity: 1; }
.fv .al:hover { color: var(--gold-bright); }
.fcat.disabled .fv { opacity: 0.45; }
.more { font-size: 11.5px; color: var(--gold); padding: 2px 6px; }

.hidden-list { display: flex; flex-direction: column; gap: 8px; }
.hx { display: grid; grid-template-columns: 18px 1fr; gap: 8px; font-size: 12.5px; }
.hx .i { color: var(--rust); }
.hx.ok .i { color: var(--green); }
.hx .t { font-weight: 600; }
.hx .d { color: var(--mute-2); font-size: 12px; word-break: break-word; }
.hx .d q { color: #F0C2AA; font-style: italic; }
.lens { display: flex; flex-direction: column; gap: 8px; }
.lz { padding: 8px 10px; border-left: 2px solid var(--gold); background: var(--ink-3); border-radius: 0 6px 6px 0; }
.lz b { font-size: 12.5px; display: block; }
.lz span { font-size: 11.5px; color: var(--mute-2); }

.exp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.exp-btn { padding: 9px 6px; border: 1px solid var(--line); border-radius: 7px; display: flex; flex-direction: column; align-items: center; background: var(--ink); }
.exp-btn:hover:not(:disabled) { border-color: var(--gold); }
.exp-btn b { font-size: 12.5px; font-weight: 600; }
.exp-btn span { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--mute-2); }
.exp-btn:disabled, .secondary:disabled, .primary:disabled { opacity: 0.35; cursor: not-allowed; }
.primary { display: block; width: 100%; text-align: center; padding: 10px 14px; border-radius: 7px; background: var(--gold); color: var(--ink); font-weight: 700; font-size: 13px; }
.primary:hover:not(:disabled) { background: var(--gold-bright); }
.secondary { display: block; text-align: center; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--line-strong); color: var(--bone); font-size: 12.5px; }
.secondary:hover:not(:disabled) { border-color: var(--gold); color: var(--gold-bright); }
.exp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.fine { font-size: 11.5px; color: var(--mute); margin-top: 10px; line-height: 1.45; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(5, 7, 10, 0.72); backdrop-filter: blur(6px); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sheet { position: relative; background: var(--ink-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 28px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; }
.sheet.wide { width: min(940px, 100%); }
.sheet h2 { font-family: 'Fraunces', serif; font-weight: 400; font-size: 30px; margin: 6px 0 10px; letter-spacing: -0.01em; }
.sheet .x { position: absolute; top: 12px; right: 14px; font-size: 22px; color: var(--mute-2); }
.sheet .x:hover { color: var(--gold-bright); }
.fld { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; font-size: 13px; font-weight: 600; }
.fld .hint { font-weight: 400; color: var(--mute-2); font-size: 12px; }
.fld input:not([type=range]):not([type=checkbox]), .fld select, .fld textarea, .sheet textarea, .restore-src input[type=password] {
  background: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 9px 11px; font-weight: 400; font-size: 13.5px; width: 100%;
}
.fld input:focus, .fld select:focus, .sheet textarea:focus { outline: none; border-color: var(--gold); }
.fld input[type=range] { accent-color: var(--gold); }
.range-lbl { display: flex; justify-content: space-between; font-weight: 400; font-size: 11.5px; color: var(--mute-2); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chk { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--bone); }
.chk input { margin-top: 3px; accent-color: var(--gold); }
.row-end { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; }
.row-end .primary, .row-end .secondary { width: auto; display: inline-block; padding: 10px 20px; }
.row-end .muted { margin-right: auto; }
.restore-src { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin: 14px 0; font-size: 13px; }
.restore-src label { display: flex; align-items: center; gap: 8px; }
.restore-src input[type=password] { width: 240px; }
.restore-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.restore-grid textarea { height: 300px; resize: vertical; font-size: 13px; line-height: 1.55; }
#restoreOut { background: #10141A; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.plans.four { grid-template-columns: repeat(4, 1fr); }
.plan-card .range { font-size: 12px; color: var(--mute-2); margin-top: -6px; }
.plan-card.current { border-color: var(--green); }
.plan-card.rec { box-shadow: 0 0 0 1px var(--gold) inset; }
.plan-card .tag { font-family: 'JetBrains Mono', monospace; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--green); }
.usage { margin: 6px 0 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--bone); display: grid; gap: 6px; }
.usage .overdue { color: #F0C2AA; background: rgba(197, 121, 84, 0.1); border: 1px solid rgba(197, 121, 84, 0.35); border-radius: 6px; padding: 6px 10px; }
.usage .bar { height: 6px; background: var(--ink-4); border-radius: 6px; overflow: hidden; }
.usage .bar i { display: block; height: 100%; background: var(--gold); }
.usage .bar i.hot { background: var(--rust); }
.dtype { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; padding: 3px 8px; border-radius: 99px; background: rgba(111, 207, 151, 0.12); color: var(--green); margin-right: 10px; }
.notice.tip-ok { border-color: rgba(111, 207, 151, 0.35); background: rgba(111, 207, 151, 0.07); color: var(--bone); display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.notice.tip-ok button { white-space: nowrap; padding: 6px 12px; border-radius: 6px; background: var(--green); color: var(--ink); font-weight: 700; font-size: 12px; }
.plan-card { border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.plan-card.hot { border-color: var(--gold); background: linear-gradient(180deg, rgba(201, 168, 106, 0.08), transparent); }
.plan-card .pn { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }
.plan-card .pp { font-family: 'Fraunces', serif; font-size: 34px; }
.plan-card .pp small { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; color: var(--mute-2); margin-left: 4px; }
.plan-card ul { list-style: none; display: grid; gap: 5px; font-size: 12.5px; color: var(--bone); flex: 1; }
.plan-card li::before { content: "✓  "; color: var(--gold); }
.lic-row { display: flex; gap: 8px; }
.lic-row .primary { width: auto; padding: 0 18px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--ink); border: 1px solid var(--gold); color: var(--cream); padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5); max-width: 90vw; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .plans.four { grid-template-columns: repeat(2, 1fr); }
  .workspace { grid-template-columns: 230px minmax(0, 1fr) 320px; }
  .papers.split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 920px) {
  body { overflow: auto; }
  .workspace { display: flex; flex-direction: column; height: auto; }
  .rail, .intel { border: 0; border-bottom: 1px solid var(--line); overflow: visible; padding: 16px; }
  .stage { min-height: 70vh; }
  .paper-wrap { padding: 16px; overflow: visible; }
  .paper { padding: 36px 22px; }
  .trust { display: none; }
  .brand .by { display: none; }
  .plan .meter { display: none; }
  .ghost { padding: 7px 8px; }
  .bar { padding: 0 16px; gap: 10px; }
  .plans, .plans.four, .restore-grid, .fld-row { grid-template-columns: 1fr; }
  .doc-title { display: none; }
}
@media print {
  body { background: #fff; overflow: visible; }
  .bar, .rail, .intel, .stage-bar { display: none !important; }
  .workspace { display: block; height: auto; }
  .paper { box-shadow: none; padding: 0; }
}

.sends table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 12px; }
.sends th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); padding: 6px 8px; border-bottom: 1px solid var(--line-strong); font-weight: 400; }
.sends td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--bone); }
.sends pre { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--cream); white-space: pre-wrap; word-break: break-all; margin: 0; }
.sends .empty-sends { margin: 18px 0; color: var(--green); }
.never { margin-top: 16px; padding: 12px 14px; border-left: 2px solid var(--green); background: rgba(111, 207, 151, 0.06); border-radius: 0 6px 6px 0; font-size: 13px; color: var(--bone); }

.limit-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.lopt { border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: var(--ink); }
.lopt:first-child { border-color: var(--gold); }
.lopt b { font-family: 'Fraunces', serif; font-weight: 400; font-size: 19px; }
.lopt span { font-size: 12.5px; color: var(--mute-2); flex: 1; }
.lopt .primary, .lopt .secondary { text-align: center; }
.usage .pace { color: var(--gold-bright); }
@media (max-width: 920px) { .limit-options { grid-template-columns: minmax(0, 1fr); } }
