/* QR Hub dashboard. Every color is a token; light on :root, dark under the media query and [data-theme="dark"]. */
:root {
  --paper: #f2f4f3; --surface: #ffffff; --sunk: #e8ecea; --ink: #1a2420; --mute: #55625d; --line: #d6ddda; --field-line: #84928d;
  --acc: #136f63; --acc-hover: #0f5c52; --acc-ink: #ffffff; --acc-soft: #dcefeb; --acc-text: #0f5c52;
  --live: #c99a06; --bad: #a8361f; --bad-soft: #f8e4df; --ok: #1f7a43; --ok-soft: #dff1e6;
  --warn-ink: #6e4f00; --warn-soft: #fbf0cc; --warn-line: #e3c867;
  --chart-a: #136f63; --chart-b: #a9d4cb; --qr-tile: #ffffff;
  --shadow: 0 1px 2px rgb(16 24 20 / .06);
  --radius: 10px; --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a18; --surface: #1d2421; --sunk: #262f2b; --ink: #e6ece9; --mute: #a1aea9; --line: #303a36; --field-line: #6f7d78;
    --acc: #5cc8b0; --acc-hover: #79d6c1; --acc-ink: #0d1412; --acc-soft: #1c3a33; --acc-text: #7fd8c3;
    --live: #f0c540; --bad: #f08a74; --bad-soft: #3d2520; --ok: #6fd39a; --ok-soft: #1c3426;
    --warn-ink: #f2d27a; --warn-soft: #3a3016; --warn-line: #7a6424;
    --chart-a: #5cc8b0; --chart-b: #2f5a51; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #151a18; --surface: #1d2421; --sunk: #262f2b; --ink: #e6ece9; --mute: #a1aea9; --line: #303a36; --field-line: #6f7d78;
  --acc: #5cc8b0; --acc-hover: #79d6c1; --acc-ink: #0d1412; --acc-soft: #1c3a33; --acc-text: #7fd8c3;
  --live: #f0c540; --bad: #f08a74; --bad-soft: #3d2520; --ok: #6fd39a; --ok-soft: #1c3426;
  --warn-ink: #f2d27a; --warn-soft: #3a3016; --warn-line: #7a6424;
  --chart-a: #5cc8b0; --chart-b: #2f5a51; --shadow: none; color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--sans); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
#root { flex: 1; display: flex; flex-direction: column; }
a { color: var(--acc-text); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; font-weight: 600; }
h3 { font-size: .95rem; margin: 0 0 .5rem; font-weight: 600; }
p { margin: 0 0 .75rem; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.mute { color: var(--mute); }
.small { font-size: .85rem; }
.noscript { padding: 20px; }
:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 18px; padding: 10px clamp(16px, 4vw, 40px); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; color: var(--ink); text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.nav a svg { width: 17px; height: 17px; opacity: .8; }
.nav a:hover { background: var(--sunk); }
.nav a.on { background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }
.top .tools { display: flex; align-items: center; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--mute); text-decoration: none; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; background: var(--acc-soft); color: var(--acc-text); display: grid; place-items: center; font-weight: 600; font-size: .8rem; overflow: hidden; flex: none; }
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.banner { background: var(--bad-soft); color: var(--bad); border-bottom: 1px solid var(--bad); padding: 8px clamp(16px, 4vw, 40px); text-align: center; font-weight: 500; font-size: .9rem; }
.banner.warn { background: var(--warn-soft); color: var(--warn-ink); border-color: var(--warn-line); }

.theme-switch { display: inline-flex; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; background: var(--surface); flex: none; }
.theme-switch button { border: 0; background: transparent; color: var(--mute); font: inherit; font-size: .95rem; width: 32px; height: 30px; cursor: pointer; line-height: 1; }
.theme-switch button + button { border-left: 1px solid var(--line); }
.theme-switch button:hover { color: var(--ink); }
.theme-switch button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc-text); }

main.view { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 40px) 40px; min-width: 0; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.head p { margin: 4px 0 0; color: var(--mute); }
.crumb { margin: 0 0 6px; font-size: .9rem; }

/* ---------- footer ---------- */
.site-foot { width: 100%; max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  padding: 16px clamp(16px, 4vw, 40px) 24px; color: var(--mute); font-size: .82rem; border-top: 1px solid var(--line); }
.site-foot a { color: var(--mute); }
.site-foot a:hover { color: var(--acc-text); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--field-line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; padding: 8px 14px; border-radius: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
.btn.big { padding: 13px 20px; font-size: 1.02rem; font-weight: 600; width: 100%; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.sm { padding: 4px 10px; font-size: .85rem; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 18px; }
label.f { display: block; margin-bottom: 14px; }
label.f > span { display: block; font-size: .87rem; font-weight: 500; margin-bottom: 5px; }
label.f > small, .hint { display: block; color: var(--mute); font-size: .82rem; margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--field-line); border-radius: 8px; padding: 9px 11px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
input:disabled, select:disabled, textarea:disabled { background: var(--sunk); color: var(--mute); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--acc); margin: 0; }
input[type=color] { padding: 2px; height: 38px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; cursor: pointer; }
.check input { margin-top: 4px; }
.code-input { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.search { max-width: 320px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.panel + .panel { margin-top: 18px; }
.panel.feature { border-color: var(--acc); box-shadow: inset 4px 0 0 var(--acc); }
.err { background: var(--bad-soft); color: var(--bad); padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; font-size: .9rem; border: 1px solid var(--bad); }
.note { background: var(--sunk); padding: 10px 12px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
.warn { background: var(--warn-soft); color: var(--warn-ink); border: 1px solid var(--warn-line); padding: 10px 12px; border-radius: 8px; font-size: .88rem; margin-bottom: 14px; }
.okbox { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); padding: 10px 12px; border-radius: 8px; font-size: .9rem; margin-bottom: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--sunk); color: var(--mute); white-space: nowrap; }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--live); }
.pill.off, .pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.acc { background: var(--acc-soft); color: var(--acc-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn-ink); }
.tag { font-size: .75rem; padding: 1px 7px; border-radius: 4px; border: 1px solid var(--line); color: var(--mute); }

/* ---------- code list ---------- */
.codes { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.code-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.code-row:first-child { border-top: 0; }
.code-row:hover { background: var(--sunk); }
.thumb { width: 64px; height: 64px; background: var(--qr-tile); border-radius: 6px; padding: 4px; border: 1px solid var(--line); flex: none; }
.thumb img { width: 100%; height: 100%; display: block; }
.code-row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-row .d { color: var(--mute); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-row .meta { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.code-row .n { text-align: right; min-width: 70px; }
.code-row .n b { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.code-row .n span, .code-row .act { font-size: .78rem; color: var(--mute); }
.code-row .act { text-align: right; min-width: 90px; }
.empty { text-align: center; padding: 48px 20px; }
.empty p { color: var(--mute); max-width: 440px; margin: 8px auto 18px; }

/* ---------- stats ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.kpi { background: var(--surface); padding: 16px 18px; min-width: 0; }
.kpi span { font-size: .85rem; color: var(--mute); }
.kpi b { display: block; font-size: 1.65rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 2px; }
.kpi b.sm { font-size: 1.05rem; margin-top: 8px; }
.kpi.bad b { color: var(--bad); }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--chart-a); }
.chart .bar2 { fill: var(--chart-b); }
.chart .axis { fill: var(--mute); font-size: 11px; font-family: var(--sans); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 16px; font-size: .82rem; color: var(--mute); margin-bottom: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend i.a { background: var(--chart-a); }
.legend i.b { background: var(--chart-b); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px; font-size: .88rem; margin-bottom: 9px; }
.hbar > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--chart-a); border-radius: 3px; }
.hbar b { font-variant-numeric: tabular-nums; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--field-line); border-radius: 8px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button, .seg a { border: 0; background: transparent; font: inherit; font-size: .87rem; padding: 6px 12px; color: var(--mute); cursor: pointer; text-decoration: none; }
.seg button + button, .seg a + a { border-left: 1px solid var(--line); }
.seg .on { background: var(--acc-soft); color: var(--acc-text); font-weight: 600; }

/* ---------- detail ---------- */
.detail { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 22px; align-items: start; }
.detail > *, .editor > * { min-width: 0; }
.proof { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }
.proof .sheet { position: relative; background: var(--qr-tile); padding: 14px; }
.proof .sheet img { width: 100%; display: block; image-rendering: pixelated; }
.proof .sheet::before, .proof .sheet::after, .proof .crop::before, .proof .crop::after { content: ""; position: absolute; width: 16px; height: 16px; border-color: var(--mute); border-style: solid; }
.proof .sheet::before { top: -12px; left: -12px; border-width: 0 1px 1px 0; }
.proof .sheet::after { top: -12px; right: -12px; border-width: 0 0 1px 1px; }
.proof .crop::before { bottom: -12px; left: -12px; border-width: 1px 1px 0 0; }
.proof .crop::after { bottom: -12px; right: -12px; border-width: 1px 0 0 1px; }
.urlbox { margin-top: 22px; display: flex; gap: 6px; align-items: center; }
.urlbox code { flex: 1; font-family: var(--mono); font-size: .85rem; background: var(--sunk); padding: 7px 9px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fixed { font-size: .82rem; color: var(--mute); margin: 8px 0 0; }
.dest { display: flex; gap: 14px; align-items: flex-start; }
.dest .ico { width: 40px; height: 40px; border-radius: 8px; background: var(--acc-soft); color: var(--acc-text); display: grid; place-items: center; flex: none; }
.dest .ico svg { width: 20px; height: 20px; }
.dest .v { font-weight: 500; word-break: break-word; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th { text-align: left; font-weight: 500; color: var(--mute); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.alert td { background: var(--bad-soft); }
.tbl select { width: auto; padding: 4px 8px; }
.tbl .wrap { word-break: break-word; max-width: 420px; }
.scroll { overflow-x: auto; }
.hist { list-style: none; padding: 0; margin: 0; }
.hist li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.hist li:first-child { border-top: 0; }
.hist li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--acc); margin-top: 6px; }
.hist li:first-child::before { background: var(--acc); }
.hist .s { word-break: break-word; }
.hist small { color: var(--mute); display: block; }

/* ---------- editor ---------- */
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-bottom: 20px; }
.types button { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; border: 1px solid var(--field-line); background: var(--surface); border-radius: 8px; padding: 12px; font: inherit; font-size: .88rem; color: var(--ink); cursor: pointer; text-align: left; }
.types button svg { width: 20px; height: 20px; color: var(--mute); }
.types button[aria-checked="true"] { border-color: var(--acc); box-shadow: inset 0 0 0 1px var(--acc); background: var(--acc-soft); }
.types button[aria-checked="true"] svg { color: var(--acc-text); }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; align-items: start; }
.editor aside { position: sticky; top: 76px; }
details.more summary { cursor: pointer; font-weight: 500; padding: 4px 0; }
details.more[open] summary { margin-bottom: 14px; }

/* ---------- auth + marketing ---------- */
.center { flex: 1; display: grid; place-items: center; padding: 32px 16px; }
.narrow { width: 100%; max-width: 440px; }
.auth h1 { font-size: 1.4rem; margin-bottom: 6px; }
.auth .brand { margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: .85rem; margin: 22px 0 18px; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.sso-btn .tooly { width: 22px; height: 22px; border-radius: 6px; background: var(--acc-ink); color: var(--acc); display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.benefit { text-align: center; color: var(--mute); font-size: .85rem; margin: 8px 0 0; }
.qrbox { background: #ffffff; border-radius: 10px; padding: 10px; width: 220px; margin: 0 auto 12px; border: 1px solid var(--line); }
.qrbox svg { display: block; width: 100%; height: auto; }
.codes-list { columns: 2; font-family: var(--mono); font-size: 1rem; background: var(--sunk); border-radius: 8px; padding: 14px 18px; margin: 0 0 14px; list-style: none; }
.codes-list li { padding: 2px 0; }
.hero { max-width: 1180px; margin: 0 auto; padding: 56px clamp(16px, 4vw, 40px) 20px; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 48px; align-items: center; width: 100%; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 16px; }
.hero .lede { font-size: 1.12rem; color: var(--mute); max-width: 34em; }
.hero .cta { display: flex; flex-direction: column; gap: 10px; max-width: 360px; margin-top: 26px; }
.hero .cta .alt { font-size: .92rem; color: var(--mute); }
.flip { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; }
.flip .qr { width: 150px; height: 150px; background: var(--qr-tile); border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 18px; }
.flip .qr img { width: 100%; height: 100%; }
.flip ol { margin: 0; padding: 0; list-style: none; }
.flip li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 9px 0; border-top: 1px dashed var(--line); font-size: .93rem; }
.flip li s { color: var(--mute); }
.flip li .when { font-family: var(--mono); font-size: .78rem; color: var(--mute); }
.faq { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px) 48px; width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.faq h3 { font-size: 1rem; }
.faq p { color: var(--mute); margin: 0; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--mute); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.on { color: var(--acc-text); border-color: var(--acc); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-bottom: 18px; }
.cards .panel + .panel { margin-top: 0; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; margin: 0; }
.dl dt { color: var(--mute); }
.dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.badge { font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 4px; border: 1px solid currentColor; white-space: nowrap; }
.badge.sso { color: var(--acc-text); }
.badge.local { color: var(--mute); }
.badge.linked { color: var(--ok); }
.badge.breakglass { color: var(--bad); }
.filters { display: grid; grid-template-columns: 140px 1fr 1fr 1fr auto; gap: 10px; margin-bottom: 14px; align-items: end; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 8px; font-size: .9rem; z-index: 50; max-width: calc(100vw - 32px); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 22px; width: min(460px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .45); }

/* ---------- legal + changelog ---------- */
.doc { max-width: 760px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 32px) 48px; width: 100%; flex: 1; }
.doc h1 { font-size: 2rem; margin: 18px 0 4px; }
.doc h2 { margin-top: 28px; font-size: 1.15rem; }
.doc h3 { margin-top: 16px; }
.doc p, .doc li { line-height: 1.65; }
.doc ul { padding-left: 20px; }

@media (max-width: 860px) {
  .top-in { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .chip .nm { display: none; }
  .detail, .editor, .hero { grid-template-columns: 1fr; }
  .editor aside { position: static; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .code-row { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 12px; }
  .thumb { width: 52px; height: 52px; }
  .code-row .act { display: none; }
  .grid2, .grid3, .filters { grid-template-columns: 1fr; }
  .codes-list { columns: 1; }
  .hero { padding-top: 32px; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- account menu ---------- */
details.acct { position: relative; }
details.acct > summary { list-style: none; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
details.acct > summary::-webkit-details-marker { display: none; }
details.acct > summary:hover, details.acct[open] > summary { background: var(--sunk); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgb(0 0 0 / .14); padding: 6px; z-index: 40; }
.menu-who { display: flex; gap: 10px; align-items: center; padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-who b { display: block; font-weight: 600; }
.menu-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; font: inherit; color: var(--ink); padding: 8px 10px; border-radius: 6px; cursor: pointer; text-decoration: none; }
.menu-item:hover, .menu-item:focus-visible { background: var(--sunk); }

/* ---------- Tooly SSO problem pages ---------- */
.who-line { display: flex; align-items: center; gap: 10px; background: var(--sunk); border-radius: 8px; padding: 10px 12px; margin-bottom: 16px; font-size: .92rem; }
.who-photo { width: 36px; height: 36px; border-radius: 50%; flex: none; object-fit: cover; background: var(--acc-soft); color: var(--acc-text); display: inline-grid; place-items: center; font-weight: 600; }
.refcode { font-size: .88rem; color: var(--mute); }
.auth form { margin: 0; }

/* ---- 2.2: Email settings, Messages inbox, Contact us page ---- */
.seg.big button { padding: 9px 16px; font-size: .92rem; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.msg { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: var(--surface); }
.msg.new { border-color: var(--acc); box-shadow: inset 3px 0 0 var(--acc); }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0 12px; }
.btn.on { background: var(--acc-soft); color: var(--acc-text); border-color: var(--acc); }
.panel.contact { width: 100%; max-width: 620px; }
.panel.contact form { margin-top: 8px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.mail-actions { align-items: center; }
.test-to { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; flex-wrap: nowrap; }
.test-to input { width: 260px; }
@media (max-width: 640px) { .test-to { margin-left: 0; width: 100%; } .test-to input { width: auto; flex: 1; } }
