/* Brand colors, fonts and radii come from notekura-tokens.css (loaded first).
   Only the status colors of the report are page variables. */
:root {
  --ok-bg: var(--success-bg);
  --warn: var(--caution-text);
  --bad: #a2332b;
  --bad-bg: #f9e4e1;
  --fix: #3b5aa8;
  --fix-bg: #e5ebf8;
  --unk: #5f6368;
  --unk-bg: #eceded;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bad: #f0958c;
    --bad-bg: #3d211e;
    --fix: #9db4ef;
    --fix-bg: #232c45;
    --unk: #b3b8bd;
    --unk-bg: #2a2e31;
  }
}
:root[data-theme="dark"] {
  --bad: #f0958c; --bad-bg: #3d211e; --fix: #9db4ef; --fix-bg: #232c45; --unk: #b3b8bd; --unk-bg: #2a2e31;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font-sans);
  overflow-x: hidden;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 4.5vw, 2.3rem); letter-spacing: -.01em; }
h2 { font-size: 1.25rem; display: flex; align-items: center; gap: .6rem; }
h3 { font-size: 1rem; margin-top: 1.4rem; }
p { margin: 0 0 .8rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
[hidden] { display: none !important; }

.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; color: var(--text); text-decoration: none; }
.brand svg { height: 28px; width: auto; }
.brand svg > path[mask] { color: var(--brand); }
.header-tag { font-size: .85rem; color: var(--muted); }

.hero { padding: 2.2rem 0 1.2rem; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 40em; }
.privacy {
  display: flex; gap: .8rem; align-items: flex-start;
  background: var(--sidebar); border: 1px solid var(--line);
  border-radius: var(--radius); padding: .9rem 1rem; margin-top: 1rem;
}
.privacy-icon { width: 26px; height: 26px; color: var(--accent); flex: none; margin-top: 2px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.step-no {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--text); color: var(--bg); font-size: .9rem; font-weight: 700; flex: none;
}

.drop {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 1.6rem 1rem; text-align: center;
  background: var(--surface-2); transition: border-color .15s, background .15s; outline: none;
}
.drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 34px; height: 34px; color: var(--text-2); }
.drop-title { font-weight: 650; font-size: 1.05rem; margin: .3rem 0 .2rem; }
.drop-help { color: var(--muted); font-size: .9rem; }
.drop-buttons { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; margin-top: .6rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: .55rem 1.05rem; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--hover); }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-lg { min-height: 50px; padding: .7rem 1.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; cursor: default; }

.help { margin-top: .9rem; }
.help summary { cursor: pointer; color: var(--accent); font-weight: 600; }
.help ol { margin: .5rem 0 0; padding-left: 1.3rem; }

.progress-block { margin-top: 1.1rem; }
.progress-head { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; font-size: .95rem; }
.bar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: .4rem 0; border: 1px solid var(--border); }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.file-list { list-style: none; padding: 0; margin: .5rem 0 0; font-size: .875rem; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border-top: 1px solid var(--border); }
.file-list .fname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.file-list .fstate { color: var(--muted); flex: none; }
.error { color: var(--bad); background: var(--bad-bg); padding: .6rem .8rem; border-radius: 10px; margin-top: .8rem; }

form fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
form legend, .field > label { font-weight: 600; margin-bottom: .45rem; display: block; padding: 0; }
.field { margin-bottom: 1.1rem; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
select, input[type="email"] {
  width: 100%; min-height: 44px; padding: .5rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chips span {
  display: inline-flex; align-items: center; min-height: 40px; padding: .35rem .85rem; border: 1px solid var(--line-strong);
  border-radius: 99px; background: var(--surface); cursor: pointer; font-size: .95rem;
}
.chips input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--text); font-weight: 600; }
.chips input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.checks { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin-top: .6rem; }
.checks label, .telemetry-opt { display: inline-flex; gap: .5rem; align-items: flex-start; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 18px; height: 18px; margin: 3px 0 0; flex: none; }
.telemetry { border-top: 1px solid var(--border); padding-top: 1rem; margin-top: .4rem; }
.telemetry-opt { font-weight: 600; }
.json-preview { margin-top: .5rem; }
.json-preview summary { cursor: pointer; font-size: .9rem; color: var(--accent); font-weight: 600; }
.json-preview pre {
  margin: .4rem 0 0; max-height: 280px; overflow: auto; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: .7rem .8rem; font-size: .78rem; line-height: 1.45;
}
code, pre { font-family: var(--font-mono); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .8rem; }
.stat { background: var(--surface-2); border-radius: 12px; padding: .7rem .8rem; min-width: 0; }
.stat .v { font-size: 1.45rem; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.stat .k { color: var(--muted); font-size: .85rem; }
.stat .s { color: var(--muted); font-size: .78rem; margin-top: .15rem; }

.types { display: grid; gap: .45rem; }
.type-row { display: grid; grid-template-columns: 6.5rem 1fr auto; align-items: center; gap: .7rem; font-size: .9rem; }
.type-row .tb { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.type-row .tb span { display: block; height: 100%; background: var(--accent); border-radius: 99px; min-width: 2px; }
.type-row .tv { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.note-box { margin-top: 1.1rem; background: var(--surface-2); border-radius: 10px; padding: .7rem .9rem; font-size: .92rem; }

.legend { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin: .4rem 0 .8rem; font-size: .85rem; }
.matrix-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
.matrix { border-collapse: collapse; width: 100%; min-width: 680px; font-size: .82rem; }
.matrix th, .matrix td { padding: .5rem .35rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.matrix thead th { background: var(--surface-2); font-weight: 600; font-size: .78rem; color: var(--muted); }
.matrix thead th .cnt { display: block; color: var(--text); font-size: .85rem; font-variant-numeric: tabular-nums; }
.matrix tbody th { position: sticky; left: 0; background: var(--surface); font-weight: 650; z-index: 1; }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.pill { display: inline-block; padding: .12rem .45rem; border-radius: 99px; font-weight: 600; font-size: .74rem; line-height: 1.3; }
.legend .pill { white-space: nowrap; }
.s-kept { color: var(--ok); background: var(--ok-bg); }
.s-partial { color: var(--warn); background: var(--warn-bg); }
.s-manual { color: var(--fix); background: var(--fix-bg); }
.s-lost { color: var(--bad); background: var(--bad-bg); }
.s-unclear { color: var(--unk); background: var(--unk-bg); }
.s-none { color: var(--muted); background: transparent; border: 1px dashed var(--border); }

.statements { display: grid; gap: .8rem; }
.app-block { border: 1px solid var(--border); border-radius: 12px; padding: .8rem .95rem; }
.app-block h3 { margin: 0 0 .4rem; display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.app-block h3 .score { font-weight: 500; font-size: .85rem; color: var(--muted); }
.app-block ul { margin: 0; padding-left: 1.1rem; }
.app-block li { margin: .25rem 0; }
.app-block li.l-lost::marker { color: var(--bad); }
.app-block li.l-manual::marker { color: var(--fix); }
.app-block li.l-partial::marker { color: var(--warn); }
details.unclear { margin-top: .4rem; font-size: .92rem; }
details.unclear summary { cursor: pointer; color: var(--muted); }
.app-block li.l-unclear::marker { color: var(--unk); }

.send-status p { margin: .2rem 0; }
.actions-end { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1.2rem 0 2rem; }
.site-footer { border-top: 1px solid var(--border); padding: 1.2rem 0 2rem; margin-top: 1rem; }

@media (max-width: 600px) {
  .card { padding: 1rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .stats { grid-template-columns: 1fr 1fr; }
  .type-row { grid-template-columns: 5rem 1fr auto; }
  .btn-lg { width: 100%; }
  .header-tag { display: none; }
}
