:root {
  --bg: #0a0f1d;
  --bg-2: #0e1528;
  --panel: #121a2f;
  --panel-2: #18223b;
  --border: #243150;
  --border-2: #2f3e63;
  --text: #e7ecf7;
  --muted: #8d99b8;
  --faint: #5d6a8a;
  --accent: #5b8cff;
  --accent-2: #7aa2ff;
  --ok: #2fd4a3;
  --warn: #ffb547;
  --bad: #ff5d7d;
  --paper: #ffffff;
  --ink: #1b2233;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);

  --c-identity: #8b5cf6;
  --c-contact: #0ea5e9;
  --c-financial: #f59e0b;
  --c-government: #ef4444;
  --c-credentials: #ec4899;
  --c-network: #14b8a6;
  --c-location: #22c55e;
  --c-custom: #64748b;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #1a2850 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 0%, #24164a 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14.5px/1.5 "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-2); }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 28px;
  background: rgba(10, 15, 29, .78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; letter-spacing: .2px; cursor: pointer; }
.brand svg { width: 28px; height: 28px; }
.brand .ver { font-size: 11px; font-weight: 600; color: var(--muted); border: 1px solid var(--border-2); border-radius: 99px; padding: 1px 8px; }
.topnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); background: var(--bg-2);
  padding: 4px 10px; border-radius: 99px; white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.chip.on .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.chip.off .dot { background: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border-2); background: var(--panel-2);
  padding: 8px 14px; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 13.5px; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #1f2b49; border-color: #3b4d7a; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #4f7dff, #7a5cff); border-color: transparent; color: white; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: linear-gradient(135deg, #18b88a, #2fd4a3); border-color: transparent; color: #04261c; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px 16px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

main { max-width: 1480px; margin: 0 auto; padding: 28px; }

/* ---------------------------------------------------------------- home */
.hero { text-align: center; padding: 36px 0 22px; }
.hero h1 { font-size: 46px; line-height: 1.1; margin: 0 0 14px; letter-spacing: -1px; }
.hero h1 .grad { background: linear-gradient(90deg, #7aa2ff, #b18cff, #ff8fb1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 17px; max-width: 720px; margin: 0 auto; }

.dropzone {
  margin: 26px auto 0; max-width: 860px;
  border: 2px dashed var(--border-2); border-radius: 20px;
  background: linear-gradient(180deg, rgba(91, 140, 255, .06), rgba(91, 140, 255, .02));
  padding: 42px 24px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: rgba(91, 140, 255, .1); }
.dropzone.drag { transform: scale(1.01); }
.dropzone .icon { width: 56px; height: 56px; margin: 0 auto 10px; color: var(--accent-2); }
.dropzone h2 { margin: 0 0 6px; font-size: 21px; }
.dropzone p { margin: 0; color: var(--muted); }
.dropzone .formats { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dropzone .formats span { font-size: 11.5px; color: var(--muted); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; background: var(--bg-2); }

.paste { max-width: 860px; margin: 16px auto 0; }
.paste summary { cursor: pointer; color: var(--muted); text-align: center; list-style: none; }
.paste summary::-webkit-details-marker { display: none; }
.paste summary:hover { color: var(--text); }
.paste textarea {
  width: 100%; min-height: 150px; margin-top: 12px; resize: vertical;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-family: "JetBrains Mono", Consolas, monospace; font-size: 13px;
}
.paste .row { display: flex; justify-content: flex-end; margin-top: 8px; }

.section-title { margin: 42px 0 14px; font-size: 13px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); font-weight: 700; }
.samples { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sample {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.sample:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--panel-2); }
.sample .ext { flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .5px; }
.sample .meta b { display: block; font-size: 13.5px; margin-bottom: 2px; word-break: break-all; }
.sample .meta span { color: var(--muted); font-size: 12.5px; line-height: 1.35; display: block; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.feature .ficon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 10px; background: rgba(91, 140, 255, .14); color: var(--accent-2); }
.feature .ficon svg { width: 20px; height: 20px; }
.feature h4 { margin: 0 0 6px; font-size: 15px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------------------------------------------------------------- review */
.review { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
.doc-toolbar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0;
  padding: 12px 14px; border-bottom: none;
}
.doc-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.doc-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; background: var(--panel-2); border: 1px solid var(--border-2); color: var(--muted); }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-2); }
.doc-hint { font-size: 12.5px; color: var(--muted); background: var(--bg-2); border: 1px solid var(--border); border-top: none; border-bottom: none; padding: 8px 14px; display: flex; gap: 18px; flex-wrap: wrap; }
.doc-hint span::before { content: "•"; color: var(--accent); margin-right: 6px; }
.doc-body { background: #dfe4ee; border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 22px; max-height: calc(100vh - 210px); overflow: auto; }
.warning { background: rgba(255, 181, 71, .12); border: 1px solid rgba(255, 181, 71, .35); color: #ffd79a; padding: 10px 14px; border-radius: 10px; margin-bottom: 12px; font-size: 13px; }
.doc-body .warning { background: #fff4dc; border-color: #f0c36a; color: #6b4400; max-width: 900px; margin: 0 auto 12px; }

.paper {
  background: var(--paper); color: var(--ink);
  border-radius: 6px; box-shadow: 0 4px 18px rgba(20, 30, 60, .18);
  padding: 34px 40px; max-width: 900px; margin: 0 auto;
  font: 14px/1.75 "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap; word-break: break-word;
}
.paper .sec-label {
  display: block; user-select: none; margin: 22px 0 8px;
  font: 700 11px/1 "Inter", "Segoe UI", sans-serif; letter-spacing: 1.2px; text-transform: uppercase; color: #7a859e;
  border-bottom: 1px solid #e6e9f0; padding-bottom: 6px;
}
.paper .sec-label:first-child { margin-top: 0; }
:where(mark.ent) { --c: var(--c-custom); }
mark.ent {
  color: inherit; border-radius: 4px; padding: 1px 2px; margin: 0 -1px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  box-shadow: inset 0 -2px 0 var(--c);
  transition: background .12s, opacity .12s;
}
mark.ent:hover { background: color-mix(in srgb, var(--c) 38%, transparent); }
mark.ent.off { background: transparent; box-shadow: inset 0 -1.5px 0 color-mix(in srgb, var(--c) 55%, transparent); text-decoration: none; opacity: .85; }
mark.ent.off:hover { background: color-mix(in srgb, var(--c) 12%, transparent); }
mark.ent.flash { animation: flash 1s ease 2; }
@keyframes flash { 50% { background: color-mix(in srgb, var(--c) 60%, transparent); } }
.cat-identity { --c: var(--c-identity); } .cat-contact { --c: var(--c-contact); } .cat-financial { --c: var(--c-financial); }
.cat-government { --c: var(--c-government); } .cat-credentials { --c: var(--c-credentials); } .cat-network { --c: var(--c-network); }
.cat-location { --c: var(--c-location); } .cat-custom { --c: var(--c-custom); }

.pages { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.page-wrap { width: 100%; max-width: 900px; }
.page { position: relative; background: white; box-shadow: 0 4px 18px rgba(20, 30, 60, .2); border-radius: 4px; overflow: hidden; line-height: 0; }
.page img { width: 100%; display: block; }
.page .box { position: absolute; border-radius: 2px; cursor: pointer; background: color-mix(in srgb, var(--c) 28%, transparent); outline: 2px solid var(--c); }
.page .box.off { background: transparent; outline: 1.5px dashed var(--c); opacity: .75; }
.page .box:hover { background: color-mix(in srgb, var(--c) 45%, transparent); }
.page-no { text-align: center; color: #66708a; font-size: 12px; margin-top: 6px; }

.sel-pop { position: absolute; z-index: 40; }

/* preview: show selected items the way they will look in the output */
.pv-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.doc-body.preview mark.ent:not(.off) { box-shadow: none; }
.doc-body.pv-blur mark.ent:not(.off) { filter: blur(4px); background: transparent; }
.doc-body.pv-mask mark.ent:not(.off) { background: #11182b; color: transparent; }
.doc-body.pv-blur .page .box:not(.off) { backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: rgba(255, 255, 255, .15); outline: none; }
.doc-body.pv-mask .page .box:not(.off) { background: #000; outline: none; }
.blur-demo { filter: blur(3px); display: inline-block; }
.ex-note { margin-top: 6px; font-family: "Inter", "Segoe UI", sans-serif; font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- sidebar */
.side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow: auto; padding-right: 2px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.card h3 .links { text-transform: none; letter-spacing: 0; font-weight: 500; display: flex; gap: 8px; }
.card h3 .links a { color: var(--muted); text-decoration: none; font-size: 12px; cursor: pointer; }
.card h3 .links a:hover { color: var(--text); }

.risk { display: flex; gap: 16px; align-items: center; }
.gauge { width: 104px; height: 104px; flex: none; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .val b { font-size: 28px; line-height: 1; display: block; }
.gauge .val small { color: var(--muted); font-size: 11px; }
.risk-info .level { font-size: 18px; font-weight: 800; }
.risk-info .after { margin-top: 6px; font-size: 13px; color: var(--muted); }
.risk-info .after b { color: var(--ok); }
.cats { margin-top: 14px; display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--bg-2); }
.cats div { height: 100%; }
.cat-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.cat-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.groups { display: flex; flex-direction: column; gap: 4px; }
.group-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; user-select: none;
  background: var(--bg-2); border: 1px solid var(--border); }
.group-row:hover { border-color: var(--border-2); }
.group-row.off { opacity: .55; }
.group-row .gi { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--panel-2); flex: none; }
.group-row .nm { flex: 1; font-size: 13.5px; font-weight: 600; }
.group-row .ct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.group-row.empty-group { cursor: default; opacity: .4; }
.finetune { margin-top: 10px; }
.finetune summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.page-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow: auto; }
.page-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 10px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--border); cursor: pointer; }
.page-list li:hover { border-color: var(--accent); }
.page-list li b { font-variant-numeric: tabular-nums; }
.page-list li span { color: var(--muted); }
.verify-line { margin-top: 6px; font-weight: 800; letter-spacing: .3px; }
.verify-line.pass { color: var(--ok); }
.verify-line.fail { color: var(--bad); }
.types { display: flex; flex-direction: column; gap: 2px; }
.type-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; user-select: none; }
.type-row:hover { background: var(--panel-2); }
.type-row input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; }
.type-row .sw { width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: none; }
.type-row .nm { flex: 1; font-size: 13.5px; }
.type-row .ct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.type-row.dim .nm { color: var(--muted); }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label.lbl { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field label.lbl b { color: var(--text); font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: var(--accent); }
select, .input, textarea.input {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; outline: none;
}
select:focus, .input:focus { border-color: var(--accent); }
textarea.input { min-height: 64px; resize: vertical; font-size: 13px; font-family: "JetBrains Mono", Consolas, monospace; }
.example { margin-top: 8px; font: 12.5px/1.4 "JetBrains Mono", Consolas, monospace; color: var(--muted); background: var(--bg-2); border: 1px dashed var(--border); border-radius: 8px; padding: 7px 10px; }
.example b { color: var(--text); font-weight: 600; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; cursor: pointer; }
.toggle small { display: block; color: var(--muted); font-size: 12px; }
.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-2); border-radius: 99px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

.hidden-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hidden-list li { font-size: 12.5px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }
.hidden-list li b { display: block; font-size: 12px; color: var(--warn); font-weight: 600; }
.hidden-list li span { color: var(--muted); word-break: break-word; }
.empty { color: var(--muted); font-size: 13px; }

.cta { position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, var(--bg) 30%); padding-top: 10px; }
.cta .sub { text-align: center; color: var(--muted); font-size: 12px; margin-top: 6px; }

/* ---------------------------------------------------------------- result */
.result-head { display: flex; gap: 18px; align-items: center; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.result-head .big { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; flex: none; }
.result-head .big svg { width: 30px; height: 30px; }
.result-head.pass .big { background: rgba(47, 212, 163, .15); color: var(--ok); }
.result-head.fail .big { background: rgba(255, 93, 125, .15); color: var(--bad); }
.result-head h2 { margin: 0 0 4px; font-size: 21px; }
.result-head p { margin: 0; color: var(--muted); }
.result-head .actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.stat b { display: block; font-size: 24px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat b .arrow { color: var(--muted); font-weight: 400; margin: 0 6px; }
.stat b .good { color: var(--ok); }
.stat span { color: var(--muted); font-size: 12.5px; }

.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.compare h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); }
.compare .paper { padding: 24px 26px; font-size: 12.5px; max-height: 70vh; overflow: auto; }
.rep { background: #11182b; color: #fff; border-radius: 3px; padding: 0 3px; }
.rep.light { background: #e8f7f1; color: #0d5c45; box-shadow: inset 0 -2px 0 #2fd4a3; }
.rep.shade { background: #e7eaf0; color: #9aa4b8; }
.panel-box { background: #dfe4ee; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }

table.audit { width: 100%; border-collapse: collapse; font-size: 13px; }
table.audit th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
table.audit td { padding: 7px 10px; border-bottom: 1px solid #1c2640; vertical-align: top; }
table.audit td code { font-family: "JetBrains Mono", Consolas, monospace; font-size: 12px; color: #c9d4ef; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; }
.tag i { width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.scroll { max-height: 420px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }

/* ---------------------------------------------------------------- overlays */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; max-width: 320px;
  background: #0b1122; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px;
  box-shadow: var(--shadow); font-size: 12.5px;
}
.tooltip .tt-type { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tooltip .tt-type i { width: 9px; height: 9px; border-radius: 2px; background: var(--c); }
.tooltip .tt-row { color: var(--muted); margin-top: 3px; }
.tooltip .tt-row b { color: var(--text); font-weight: 600; }
.tooltip .tt-act { margin-top: 6px; color: var(--accent-2); }
.bar { height: 5px; border-radius: 99px; background: var(--border); overflow: hidden; margin-top: 6px; }
.bar div { height: 100%; background: var(--c); }

.loading { position: fixed; inset: 0; z-index: 80; background: rgba(6, 10, 22, .72); backdrop-filter: blur(3px); display: grid; place-items: center; }
.loading .box { background: var(--panel); border: 1px solid var(--border-2); border-radius: 16px; padding: 26px 30px; text-align: center; box-shadow: var(--shadow); min-width: 300px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--border-2); border-top-color: var(--accent); margin: 0 auto 14px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { margin: 0; color: var(--muted); }
.loading b { display: block; margin-bottom: 4px; font-size: 15px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast div { background: #0b1122; border: 1px solid var(--border-2); border-left: 4px solid var(--accent); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; animation: up .25s ease; }
.toast div.err { border-left-color: var(--bad); }
.toast div.ok { border-left-color: var(--ok); }
@keyframes up { from { transform: translateY(10px); opacity: 0; } }

.modal { position: fixed; inset: 0; z-index: 70; background: rgba(6, 10, 22, .7); display: grid; place-items: center; padding: 24px; }
.modal .dialog { background: var(--panel); border: 1px solid var(--border-2); border-radius: 18px; width: min(980px, 100%); max-height: 90vh; overflow: auto; padding: 22px 24px; box-shadow: var(--shadow); }
.modal .dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal .dialog h2 { margin: 0; font-size: 20px; }
.modal .muted { color: var(--muted); font-size: 13px; }
.f1 { display: inline-block; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.meter { display: inline-block; width: 90px; height: 6px; border-radius: 99px; background: var(--border); vertical-align: middle; margin-left: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, #5b8cff, #2fd4a3); }

footer.foot { text-align: center; color: var(--faint); font-size: 12px; padding: 30px 0 20px; }

@media (max-width: 1100px) {
  .review { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  .compare { grid-template-columns: 1fr; }
  .doc-body { max-height: none; }
}
@media (max-width: 640px) {
  main { padding: 16px; }
  .topbar { padding: 10px 16px; }
  .topnav .chip:not(:first-child), .brand .ver { display: none; }
  .topnav .chip { font-size: 11px; padding: 3px 8px; }
  .hero h1 { font-size: 32px; }
  .paper { padding: 20px 18px; font-size: 13px; }
  .result-head { flex-wrap: wrap; }
  .result-head .actions { margin-left: 0; }
}
