/* 7QSO v0.1 — design tokens (light first, dark via prefers-color-scheme). All text/background pairs meet WCAG AA. */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eaeff7;
  --text: #0f172a;
  --muted: #4b5563;
  --line: #d6dde9;
  --brand: #0b3d91;
  --brand-2: #1e6fd9;
  --brand-ink: #ffffff;
  --accent: #b45309;
  --accent-bg: #fef3c7;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn-bg: #fef3c7;
  --err: #b91c1c;
  --err-bg: #fee2e2;
  --w-bg: #fef3c7;
  --w-ink: #92400e;
  --c-bg: #dcfce7;
  --c-ink: #166534;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(11, 61, 145, .14);
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #121b2d;
    --surface-2: #1a2539;
    --text: #e6edf7;
    --muted: #a7b4c8;
    --line: #28344b;
    --brand: #6aa6ff;
    --brand-2: #3b82f6;
    --brand-ink: #06112a;
    --accent: #fbbf24;
    --accent-bg: #3b2a0c;
    --ok: #4ade80;
    --ok-bg: #0f2e1d;
    --warn-bg: #3b2a0c;
    --err: #fca5a5;
    --err-bg: #3f1414;
    --w-bg: #3b2a0c;
    --w-ink: #fcd34d;
    --c-bg: #0f2e1d;
    --c-ink: #86efac;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 15.5px/1.5 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }
h1, h2, h3 { margin: 0 0 .6em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; }
.h2 { font-size: 1.25rem; }
.h3 { font-size: 1.02rem; }
.mono { font-family: var(--mono); }
.upper { text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.inline { display: inline; }
.center { text-align: center; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 3000; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 1000; display: flex; align-items: center; gap: 14px; padding: 8px 22px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; font-size: 1.1rem; }
.brand-logo { display: block; height: 54px; width: auto; }
.brand picture { display: block; line-height: 0; }
.mainnav { display: flex; gap: 2px; flex-wrap: wrap; }
.mainnav a { padding: 7px 11px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a[aria-current="page"] { background: var(--surface-2); color: var(--brand); box-shadow: inset 0 -2px 0 var(--brand); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.whoami { font-family: var(--mono); font-weight: 700; }
.nav-toggle { display: none; }
.langsel { position: relative; }
.langsel summary { list-style: none; cursor: pointer; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: .82rem; background: var(--surface); }
.langsel summary::-webkit-details-marker { display: none; }
.langsel-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; min-width: 150px; z-index: 10; }
.langsel-menu a { display: block; padding: 7px 10px; border-radius: 6px; text-decoration: none; color: var(--text); }
.langsel-menu a:hover, .langsel-menu a[aria-current] { background: var(--surface-2); }

.wrap { width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px; flex: 1; }
.footer { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .86rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 18px 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.footer-brand { font-weight: 700; color: var(--text); }
.footer-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--brand); text-decoration: underline; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h1, .card-head h2 { margin: 0; }
.log-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.side .card { margin-bottom: 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.stats-grid .card { margin-bottom: 0; }
.stats-grid + .card { margin-top: 18px; }

/* ---------- forms ---------- */
label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); min-width: 0; }
input, select, textarea { font: inherit; font-size: .95rem; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 11px; min-width: 0; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--brand-2) 50%, var(--line)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 22%, transparent); }
input:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.check input { width: auto; accent-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.form { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.span2 { grid-column: span 2; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 110px; }
.row > label.grow { flex: 3 1 180px; }
.row > label.check { flex: 0 0 auto; padding-bottom: 8px; }
/* validation (App.initValidation) */
label.invalid input, label.invalid select, label.invalid textarea { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 18%, transparent); }
.field-error { font-size: .78rem; font-weight: 600; color: var(--err); }
.cf-turnstile { min-height: 65px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 700; font-size: .92rem; padding: 9px 15px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--line)); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border-color: transparent; color: var(--brand-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--brand-2) 35%, transparent); }
.btn-primary:hover { color: var(--brand-ink); filter: brightness(1.06); box-shadow: 0 4px 14px color-mix(in srgb, var(--brand-2) 40%, transparent); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; color: var(--err); border-color: color-mix(in srgb, var(--err) 45%, transparent); }
.btn-danger:hover { background: var(--err-bg); color: var(--err); }
.btn-sm { padding: 5px 10px; font-size: .85rem; }
.btn-xs { padding: 2px 8px; font-size: .78rem; }
.btn-lg { padding: 13px 24px; font-size: 1.05rem; border-radius: 12px; }

.flash { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid transparent; font-weight: 500; }
.flash-ok { background: var(--ok-bg); color: var(--c-ink); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.flash-err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err) 30%, transparent); }
.note { background: var(--warn-bg); color: var(--w-ink); padding: 10px 12px; border-radius: 10px; }

/* ---------- auth ---------- */
.page-login .wrap, .page-forgot .wrap, .page-reset .wrap { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 32px; align-items: start; max-width: 1000px; }
.page-register .wrap, .page-contact .wrap, .page-notfound .wrap, .page-closed .wrap, .page-forbidden .wrap { display: grid; grid-template-columns: minmax(0, 680px); justify-content: center; }
.page-login .wrap > .flash, .page-register .wrap > .flash, .page-forgot .wrap > .flash, .page-reset .wrap > .flash, .page-contact .wrap > .flash { grid-column: 1 / -1; margin: 0; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.auth-links { margin: 16px 0 0; font-size: .9rem; }
.pitch { padding: 26px 8px; }
.pitch h2 { font-size: 1.5rem; }
.pitch-list { padding-left: 1.1em; line-height: 1.9; }
.notfound { text-align: center; }
.code-404 { font: 800 5rem/1 var(--mono); margin: 0 0 8px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound .row { justify-content: center; margin-top: 18px; }

/* ---------- home (landing) ---------- */
.page-home .wrap { max-width: 1120px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: center; padding: 28px 0 36px; }
.eyebrow { margin: 0 0 10px; font-weight: 700; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-2); }
.hero h1 { font-size: clamp(1.9rem, 4vw, 2.9rem); margin-bottom: 14px; letter-spacing: -.02em; }
.lead { font-size: 1.12rem; color: var(--muted); margin: 0 0 22px; max-width: 54ch; }
.hero-cta { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; margin: 0; }
.hero-visual img { width: 100%; height: auto; max-width: 560px; border-radius: 16px; box-shadow: var(--shadow-lg); display: block; margin: 0 auto; }
.features { padding: 10px 0 24px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.feature h3 { font-size: 1.02rem; margin: 10px 0 6px; }
.feature p { margin: 0; color: var(--muted); font-size: .93rem; }
.feature-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.3rem; }
.how { padding: 24px; }
.how-steps { list-style: none; counter-reset: hs; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.how-steps li { counter-increment: hs; display: flex; flex-direction: column; gap: 4px; padding-left: 46px; position: relative; color: var(--muted); }
.how-steps li strong { color: var(--text); }
.how-steps li::before { content: counter(hs); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; }
.trust { padding: 10px 0 30px; }
.trust-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--muted); font-size: .92rem; }
.trust-list li::before { content: '✓'; color: var(--ok); font-weight: 800; margin-right: 6px; }

/* ---------- cookie banner ---------- */
.cookie-banner { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2500; width: min(720px, calc(100vw - 24px)); background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 14px 16px; }
.cookie-form { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cookie-form p { margin: 0; flex: 1 1 320px; font-size: .9rem; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- legal pages ---------- */
.legal h2 { font-size: 1.08rem; margin-top: 26px; }
.legal p, .legal li { color: var(--text); }

/* ---------- entry ---------- */
.qso-form { display: flex; flex-direction: column; gap: 12px; }
.row-call { align-items: flex-end; }
.call-input { font-size: 1.6rem !important; font-weight: 700; letter-spacing: .04em; padding: 10px 12px !important; }
.kbd-hint { font-size: .78rem; color: var(--muted); }
.more summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 4px 0; }
.more[open] { display: flex; flex-direction: column; gap: 10px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn-danger { margin-left: auto; }

.cat-readout { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.cat-freq { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cat-mode { font-weight: 700; color: var(--brand); }
.cat-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }
.cat-journal { max-height: 220px; overflow: auto; font-size: .72rem; line-height: 1.35; background: var(--surface-2); border-radius: 6px; padding: 8px; margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; }
.cat-led { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.cat-led.on { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.cat-settings { margin-top: 10px; }
.cat-settings summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.cat-settings .row { margin-top: 8px; }

.info-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.info-head img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.info-call { font-size: 1.3rem; font-weight: 700; }
.info-country { font-weight: 600; }
.info-meta { font-size: .85rem; }
.info-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 6px 0; font-size: .9rem; }
.info-dl dt { color: var(--muted); }
.info-dl dd { margin: 0; overflow-wrap: anywhere; }
.info-path { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.new { display: inline-block; font-weight: 700; font-size: .8rem; padding: 3px 8px; border-radius: 999px; margin-bottom: 6px; }
.new-dxcc { background: var(--err); color: #fff; }
.new-band { background: var(--accent); color: #fff; }
.new-slot { background: var(--w-bg); color: var(--w-ink); }

table { border-collapse: collapse; width: 100%; }
.wb { font-size: .74rem; margin-top: 6px; table-layout: fixed; }
.wb th, .wb td { border: 1px solid var(--line); padding: 3px 2px; text-align: center; }
.wb thead th { font-weight: 600; color: var(--muted); }
.wb tbody th { text-align: left; padding-left: 5px; font-weight: 600; color: var(--muted); }
.wb thead th:first-child { width: 64px; text-align: left; padding-left: 5px; }
.wb th.cur { color: var(--text); background: var(--surface-2); }
td.w { background: var(--w-bg); color: var(--w-ink); font-weight: 700; }
td.c { background: var(--c-bg); color: var(--c-ink); font-weight: 700; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.qso-table { font-size: .88rem; }
.qso-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
.qso-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.qso-table tbody tr[data-id] { cursor: pointer; }
.qso-table tbody tr:hover { background: var(--surface-2); }
.qso-table .cb { width: 30px; }
.qso-table .cb input { width: auto; }
.qsl { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: .7rem; font-weight: 700; background: var(--surface-2); color: var(--muted); margin-right: 2px; }
.qsl.q-ok { background: var(--c-bg); color: var(--c-ink); }
.qsl.q-req { background: var(--w-bg); color: var(--w-ink); }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-active { background: var(--ok-bg); color: var(--c-ink); }
.tag-pending, .tag-warn { background: var(--warn-bg); color: var(--w-ink); }
.tag-disabled { background: var(--err-bg); color: var(--err); }
.actions-cell form { display: flex; gap: 4px; flex-wrap: wrap; }
.msg-body { white-space: normal !important; max-width: 420px; font-size: .85rem; }
.msg-new td { font-weight: 600; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.filters > label { flex: 1 1 120px; max-width: 200px; }
.filters-inline { margin: 0; }
.filters-inline > label { flex: 0 1 150px; }
.filter-actions { display: flex; gap: 6px; }
.bulkbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); margin-bottom: 10px; font-size: .9rem; }
.bulkbar select { width: auto; }
.bulkbar .spacer { flex: 1; }
.bulkbar.has-sel { outline: 2px solid var(--brand-2); }
.pager { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 12px; }

.result { margin-top: 16px; padding: 12px; border-radius: 10px; background: var(--ok-bg); color: var(--c-ink); }
.result-err { background: var(--err-bg); color: var(--err); }
.kv { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.kv li { display: flex; flex-direction: column; }
.kv span { font-size: .8rem; color: var(--muted); }
.kv b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }

/* ---------- stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.tile-label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.tile-value { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile-sub { font-size: .78rem; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; }
.bars .bar { fill: var(--brand-2); }
.bars .bl { font: 11px var(--mono); fill: var(--muted); }
.bars .bv { font: 11px var(--sans); fill: var(--text); }
.legend .cell { display: inline-grid; place-items: center; width: 20px; height: 18px; border-radius: 4px; font-weight: 700; font-size: .75rem; margin-left: 8px; }
.legend .w { background: var(--w-bg); color: var(--w-ink); }
.legend .c { background: var(--c-bg); color: var(--c-ink); }
.matrix { font-size: .78rem; }
.matrix th, .matrix td { border: 1px solid var(--line); padding: 3px 5px; text-align: center; white-space: nowrap; }
.matrix tbody th { text-align: left; font-weight: 600; }
.matrix thead th { position: sticky; top: 0; background: var(--surface); }
.matrix tr.deleted th { color: var(--muted); font-style: italic; }
.zone-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.zone { width: 38px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: .85rem; }
.zone.w { background: var(--w-bg); color: var(--w-ink); }
.zone.c { background: var(--c-bg); color: var(--c-ink); }
.zone-sep { flex-basis: 100%; height: 4px; }

/* ---------- map ---------- */
.map { height: 68vh; min-height: 420px; border-radius: 10px; border: 1px solid var(--line); }
.map-pop ul { padding-left: 1.1em; margin: 6px 0 0; font-size: .82rem; }

/* ---------- misc ---------- */
.prose { max-width: 760px; }
.danger-zone { border-color: color-mix(in srgb, var(--err) 35%, var(--line)); }
.kv-inline { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 2000; max-width: min(420px, calc(100vw - 36px)); padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; }
.toast-ok { background: var(--brand); color: var(--brand-ink); }
.toast-err { background: var(--err); color: #fff; }

@media (max-width: 1100px) {
  .log-grid { grid-template-columns: minmax(0, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 20px; padding-top: 10px; }
  .hero-visual { order: 2; }
  .feature-grid, .how-steps { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .topbar { flex-wrap: wrap; padding: 8px 14px; gap: 10px; }
  .nav-toggle { display: inline-flex; font: inherit; font-weight: 700; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--text); }
  .mainnav { display: none; order: 10; flex-basis: 100%; flex-direction: column; }
  body.nav-open .mainnav { display: flex; }
  .wrap { padding: 14px; }
  .two-col, .stats-grid, .grid2 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .page-login .wrap, .page-register .wrap, .page-forgot .wrap, .page-reset .wrap, .page-contact .wrap { grid-template-columns: minmax(0, 1fr); }
  .whoami { display: none; }
  .topbar-right .btn-ghost.btn-sm { display: none; }
  .auth-card { padding: 20px; }
  .cookie-banner { bottom: 8px; }
  .brand-logo { height: 38px; }
}

/* ===== contests, tickers, wizards ===== */
.flash-info { background: var(--surface-2); color: var(--text); border-color: var(--line); }
.flash-info a { font-weight: 600; }
.chip { display: inline-block; font-size: .75rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--c-bg); color: var(--c-ink); margin: 1px 2px; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips .chip { font-family: var(--mono); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tab { font: inherit; font-size: .85rem; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--surface-2); color: var(--text); border-color: var(--brand-2); }
.matrix th.cur { background: var(--surface-2); color: var(--text); }

.cx-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cx-head.has-dx { grid-template-columns: minmax(0, 1fr) 210px; }
.cx-dx { border-left: 1px solid var(--line); padding-left: 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cx-dx img { width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.cx-dx-call { font-weight: 700; font-size: 1.15rem; }
.cx-dx div { overflow-wrap: anywhere; }
@media (max-width: 760px) { .cx-head.has-dx { grid-template-columns: 1fr; } .cx-dx { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; flex-direction: row; flex-wrap: wrap; align-items: center; } .cx-dx img { width: 96px; height: 96px; } }
.cx-head .cx-title { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 12px; }
.cx-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-tiles .tile-value .score { color: var(--brand); }
.queue-warn { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--warn-bg); color: var(--w-ink); font-weight: 600; }
.cx-form { display: flex; flex-direction: column; gap: 12px; }
.cx-entry { display: grid; grid-template-columns: minmax(160px, 2fr) minmax(64px, .6fr) minmax(64px, .6fr) minmax(120px, 1.4fr); gap: 10px; align-items: end; }
.cx-entry + .cx-entry { grid-template-columns: minmax(100px, 1fr) minmax(90px, .8fr) minmax(90px, .8fr) minmax(120px, 1.4fr); }
.cx-exch input { font-size: 1.3rem; font-weight: 700; padding: 10px 12px; }
.cx-sent { align-self: center; padding-top: 18px; }
.cx-info { min-height: 30px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--muted); }
.badge-dupe { background: var(--err); color: #fff; }
.badge-err { background: var(--err-bg); color: var(--err); }
.badge-pts { background: var(--surface-2); color: var(--text); font-family: var(--mono); }
.badge-mult { background: var(--accent); color: #fff; }
.qso-table tr.pending td { opacity: .6; font-style: italic; }
.cx-log-wrap { max-height: 520px; overflow: auto; }

.ticker-wrap { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.ticker-wrap > p { grid-column: 1 / -1; margin: 0; }
.ticker-label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ticker { overflow: hidden; background: var(--surface-2); border-radius: 10px; height: 40px; position: relative; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 97%, transparent); }
.ticker-track { display: inline-flex; gap: 8px; white-space: nowrap; padding: 6px 0; will-change: transform; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused !important; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .ticker { overflow-x: auto; } .ticker-track { animation: none !important; } }
.tk-item { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; cursor: pointer; }
.tk-item:hover { border-color: var(--brand-2); }
.tk-item.tk-new { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tk-pts { font-family: var(--mono); color: var(--muted); }
.tk-mult { font-family: var(--mono); font-weight: 700; color: var(--accent); }
.tk-mult.unk { color: var(--muted); font-weight: 500; }
.tk-f { font-size: .75rem; color: var(--muted); font-family: var(--mono); }

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 16px; counter-reset: st; }
.steps li { counter-increment: st; font-size: .82rem; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.steps li::before { content: counter(st); display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; margin-right: 6px; background: var(--line); color: var(--text); font-weight: 700; font-size: .75rem; }
.steps li.on { color: var(--text); font-weight: 600; }
.steps li.on::before { background: var(--brand); color: var(--brand-ink); }
.steps li.done::before { content: '✓'; background: var(--c-bg); color: var(--c-ink); }
.cw-step { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pick { flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 400; position: relative; }
.pick input { position: absolute; opacity: 0; }
.pick:has(input:checked) { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); background: var(--surface-2); }
.pick:has(input:focus-visible) { outline: 2px solid var(--brand-2); }
.pick.disabled { opacity: .55; cursor: not-allowed; }
.pick-name { font-weight: 700; font-size: .95rem; }
.pick-when { font-size: .8rem; color: var(--muted); }
.pick-modes { font-size: .75rem; color: var(--muted); font-family: var(--mono); }
.cw-assist { font-weight: 600; }
.checklist { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.checklist li::before { content: '○'; display: inline-block; width: 1.4em; color: var(--muted); }
.checklist li.ok::before { content: '✓'; color: var(--ok); font-weight: 700; }
.wiz-howto { line-height: 1.7; }
.wiz-cat { max-width: 460px; }
.transcript { max-height: 260px; overflow: auto; background: var(--surface-2); padding: 8px; border-radius: 6px; white-space: pre-wrap; }
.qtc-table input { padding: 4px 6px; font-size: .85rem; }
.qtc-row { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }

@media (max-width: 800px) {
  .cx-entry, .cx-entry + .cx-entry { grid-template-columns: 1fr 1fr; }
  .cx-entry .cx-call, .cx-entry .cx-exch { grid-column: 1 / -1; }
  .ticker-wrap { grid-template-columns: minmax(0, 1fr); }
}
.ticker-label .nocase { text-transform: none; }

/* import progress */
.progress { position: relative; height: 26px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.progress-bar { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--brand-2); opacity: .35; transition: width .3s; }
.progress-text { position: relative; display: block; line-height: 26px; padding: 0 10px; font-weight: 600; }

/* contest QSO correction */
.cx-form.editing { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 8px; }
.cx-edit-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 10px 12px; border-radius: 10px; background: var(--w-bg); color: var(--w-ink); }
.cx-edit-bar .cx-edit-title { flex: 1 1 200px; align-self: center; font-weight: 600; }
.cx-edit-bar label { color: var(--w-ink); flex: 0 1 170px; }
#cx-table tbody tr[data-id] { cursor: pointer; }
#cx-table tbody tr.sel td { background: var(--w-bg); }

#stats-filters select[name=log] { min-width: 260px; max-width: 100%; }
@media (max-width: 600px) { #stats-filters select[name=log] { min-width: 0; width: 100%; } }

.kv b.ok { color: var(--ok); }
.kv b.warn { color: var(--accent); }
.cat-wsjtx { color: var(--brand); margin: -4px 0 8px; min-height: 0; }
.cat-wsjtx:empty { display: none; }

/* "i" explanations next to field labels (App.initTips) */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; margin-left: 5px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font: italic 700 .66rem/1 Georgia, serif; cursor: help; vertical-align: 1px; user-select: none; }
.tip:hover, .tip:focus-visible { color: var(--brand); border-color: var(--brand); outline: none; }
.tip-pop { position: absolute; z-index: 1000; max-width: min(300px, calc(100vw - 16px)); padding: 8px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-size: .8rem; line-height: 1.4; font-weight: 400; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); pointer-events: none; }

.rules-box { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 10px 14px; margin: 0 0 16px; }
.rules-box > summary { cursor: pointer; font-weight: 600; }
.rules-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 8px; }
.rules-list dt { color: var(--muted); font-size: .85rem; }
.rules-list dd { margin: 0; font-size: .9rem; }
@media (max-width: 600px) { .rules-list { grid-template-columns: 1fr; } .rules-list dd { margin-bottom: 6px; } }
.lbl { display: inline-flex; align-items: center; gap: 0; }
.wb td a { color: inherit; text-decoration: none; display: block; }
.wb td a:hover { text-decoration: underline; }

/* ---------- help / manual ---------- */
.help-link { padding: 5px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; }
.help-link:hover, .help-link[aria-current] { color: var(--brand); }
.help-toc { margin: 16px 0 24px; }
.help-toc ol { margin: 8px 0 0; padding-left: 1.4em; columns: 2 240px; }
.help-toc li { margin: 2px 0; }
.help-sec { scroll-margin-top: 70px; }
.help-sec h2 { margin-top: 32px; padding-top: 8px; border-top: 1px solid var(--line); }
.help-sec li { margin: 5px 0; }
.help-top { font-size: .8rem; text-align: right; }
.help kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; font: .85em ui-monospace, monospace; }
.help .tip-demo { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--muted); color: var(--muted); font-size: 10px; font-weight: 700; font-style: italic; }
.faq dt { font-weight: 600; margin-top: 14px; }
.faq dd { margin: 4px 0 0; }

/* ---------- DXCC hunting, LoTW / QRZ.com ---------- */
.hunt-card .card-head { gap: 8px; flex-wrap: wrap; }
.hunt-opts { margin: 4px 0; }
.hunt-opts .check { margin: 2px 0; }
.hunt-list { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; max-height: 360px; overflow-y: auto; }
.hunt-item { width: 100%; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "call ent why" "qrg qrg ago"; gap: 0 8px;
  align-items: baseline; text-align: left; padding: 6px 8px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .82rem; cursor: pointer; }
.hunt-item:hover, .hunt-item:focus-visible { border-color: var(--brand-2); outline: none; }
.hunt-call { grid-area: call; font-weight: 700; }
.hunt-ent { grid-area: ent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.hunt-why { grid-area: why; font-size: .72rem; font-weight: 600; }
.hunt-qrg { grid-area: qrg; font-size: .76rem; }
.hunt-ago { grid-area: ago; font-size: .72rem; text-align: right; }
.why-dxcc { border-left-color: var(--err); } .why-dxcc .hunt-why { color: var(--err); }
.why-band { border-left-color: var(--accent); } .why-band .hunt-why { color: var(--accent); }
.why-slot { border-left-color: var(--brand); } .why-slot .hunt-why { color: var(--brand); }
.why-cfm { border-left-color: var(--muted); }
.dxg { table-layout: auto; font-size: .78rem; }
.dxg tbody th { white-space: nowrap; color: var(--text); font-weight: 500; }
.dxg thead th:first-child { width: auto; }
.dxg td { min-width: 30px; }
.online-grid > div { min-width: 0; }
.online-grid .kv b { font-weight: 500; }
.onl-state { list-style: none; margin: 0 0 12px; padding: 0; }
.onl-state li { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.onl-state li span { color: var(--muted); }
.onl-state li b { font-weight: 500; overflow-wrap: anywhere; }
.onl-state b.ok { color: var(--ok); } .onl-state b.warn, .onl-state .warn { color: var(--err); }
.dxg thead th:nth-child(2) { width: 36px; }

.main-col { min-width: 0; }
.main-col .info-card { margin-top: 18px; }
@media (min-width: 760px) {
  .main-col .info-card:not([hidden]) { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 1.5fr); gap: 8px 24px; align-items: start; }
  .main-col .info-card .info-head img { width: 88px; height: 88px; }
}
.onl-journal { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.onl-journal summary { cursor: pointer; font-weight: 600; }
.journal { max-height: 340px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
p.warn { color: var(--err); }
