/* Treble client portal. Mobile first; light and dark follow the device. Tokens as in the approved design. */
:root {
    --ground: #F5F6F8; --surface: #FFFFFF; --ink: #121A26; --soft: #4A5565; --line: #DDE2EA;
    --accent: #1F4FD1; --accent-soft: #E8EEFC; --on-accent: #FFFFFF;
    --ok: #13612E; --ok-bg: #DDF3E4; --warn: #8A4300; --warn-bg: #FDEFD9; --bad: #9F1D1D; --bad-bg: #FCE4E4;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --ground: #0D1420; --surface: #152031; --ink: #E8EDF5; --soft: #A7B3C6; --line: #27354B;
        --accent: #8DB0FF; --accent-soft: #1D2C4A; --on-accent: #0D1420;
        --ok: #7EE0A1; --ok-bg: #123323; --warn: #FFC27A; --warn-bg: #3A2610; --bad: #FF9B9B; --bad-bg: #3D1717;
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    min-height: 100vh; display: flex; flex-direction: column; background: var(--ground); color: var(--ink);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px; }
.mark { width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.who { color: var(--soft); font-size: 14px; text-align: right; overflow-wrap: anywhere; }
main { flex: 1; width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; display: flex; flex-direction: column; gap: 14px; outline: none; }
h1 { margin: 4px 0 0; font-size: 22px; font-weight: 700; }
h2 { margin: 0; font-size: 17px; font-weight: 650; }
p { margin: 0; }
.soft { color: var(--soft); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; justify-content: space-between; gap: 12px; }
.row > :first-child { color: var(--soft); }
.row > :last-child { text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.strong > :last-child { font-weight: 650; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.count { font-size: 26px; font-weight: 700; display: block; }
.pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.info { background: var(--accent-soft); color: var(--accent); }
.banner { border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.banner.warn { background: var(--warn-bg); }
.banner.bad { background: var(--bad-bg); }
.banner.info { background: var(--accent-soft); }
.banner.ok { background: var(--ok-bg); }
.banner strong { font-size: 16px; }
.banner.warn strong { color: var(--warn); }
.banner.bad strong { color: var(--bad); }
.banner.info strong { color: var(--accent); }
.banner.ok strong { color: var(--ok); }
form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.hint { font-size: 13px; font-weight: 400; color: var(--soft); }
input { min-height: 46px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; width: 100%; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button, .button { min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button.secondary, .button.secondary { background: var(--surface); color: var(--accent); border-color: var(--line); }
button.link { min-height: 44px; border: 0; background: none; color: var(--accent); padding: 0 4px; }
button:disabled { opacity: 0.6; cursor: default; }
.message { font-size: 15px; }
.message.bad { color: var(--bad); }
.message.ok { color: var(--ok); }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.codes { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 17px; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 58px; text-decoration: none; color: var(--soft); font-size: 12px; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 650; }
.tabs svg { width: 22px; height: 22px; }
@media (min-width: 900px) {
    main { padding-bottom: 32px; }
    .tabs { position: static; max-width: 640px; margin: 0 auto 24px; width: 100%; border: 1px solid var(--line); border-radius: 14px; }
}

.tabs-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tabs-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.pill.soft { background: var(--ground); color: var(--soft); border: 1px solid var(--line); }
a.card.linked { text-decoration: none; color: inherit; }
a.card.linked:hover { border-color: var(--accent); }
.back { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-weight: 600; }
.card.flush { padding: 0 16px; gap: 0; }
.item { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.item:last-child { border-bottom: 0; }
.item .row > :first-child { color: var(--ink); }
.switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.switch button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--soft); font-weight: 500; }
.switch button.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.line { display: flex; flex-direction: column; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .row > :first-child { color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.amount { white-space: nowrap; }
.row > .amount { flex: none; }
