/* TTOS Vault web view (S10) - the navy look from TTOS_Design_Tokens_v3.md and the Session
   report / Page states boards (branch design/reference).
   Rules this file keeps: colour describes behaviour, never money (every value is plain light
   text; no class here depends on a number's sign); ONE problem marker, the solid white flag
   (.flag, .error); no red, no green, no amber; normal things quiet; backlight is light, not
   meaning; no graphics; motion only here, and none under prefers-reduced-motion.
   No inline styles anywhere (the CSP allows only this file and Google Fonts' stylesheet). */
:root {
  --page: #070A13;
  --t1: #EDEFF3;          /* primary */
  --t2: #D2D7E0;          /* secondary */
  --t3: #B8C0CE;          /* muted */
  --t4: #8C96AA;          /* quiet: labels, counts */
  --ink: #0A0E19;         /* text on the white flag and primary buttons */
  --line: rgba(255,255,255,.07);
  --input: #0F1424;
  --tag-edge: #3A4458;
  --ease: cubic-bezier(.16,1,.3,1);
  --gutter: 32px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px; line-height: 1.5; color: var(--t1);
  background:
    url("grain.svg"),
    radial-gradient(1100px 700px at 75% -12%, #1A2445 0%, rgba(10,14,26,0) 60%),
    radial-gradient(900px 600px at 0% 40%, rgba(40,52,100,.35) 0%, rgba(10,14,26,0) 60%),
    var(--page);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--t1); outline-offset: 3px; }
h1, h2, p, dl, dd { margin: 0; }

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.top, main, .disclaimer { width: 100%; max-width: 1240px; margin: 0 auto;
                          padding-left: var(--gutter); padding-right: var(--gutter); }
.top { min-height: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -.02em; text-decoration: none; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; font-size: 15px; font-weight: 500; }
.nav a { text-decoration: none; padding: 8px 13px; border-radius: 999px; color: var(--t4);
         transition: color 200ms var(--ease), background-color 200ms var(--ease); }
.nav a:hover { color: var(--t1); }
.nav a[aria-current="page"] { color: var(--t1); background: rgba(255,255,255,.07); }
.top .inline { margin-left: auto; }
/* S11: "Your plan" sits in the pill nav on wide screens; on phones (no nav, and the tab bar
   holds only Sessions and Your PCs) it is a small ghost link beside Sign out. */
.top .planlink { display: none; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.refer a { word-break: break-all; }

/* ── Buttons and form ────────────────────────────────────────────────────── */
.inline { display: inline; margin: 0; }
button, .btn {
  font: inherit; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--t1); color: var(--ink); text-decoration: none;
  transition: transform 200ms var(--ease), background-color 200ms var(--ease);
}
button:active, .btn:active { transform: scale(.97); }
button.ghost, .btn.ghost {
  background: rgba(255,255,255,.06); color: var(--t1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
button.ghost:hover, .btn.ghost:hover { background: rgba(255,255,255,.1); }
button.small { min-height: 36px; padding: 0 14px; font-size: 14px; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 600; }
input[type=email], input[type=text] {
  font: inherit; font-size: 16px; color: var(--t1); background: var(--input); border: 0;
  border-radius: 12px; min-height: 48px; padding: 0 14px; width: 100%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
input[type=email]:focus, input[type=text]:focus { outline: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35), 0 0 0 3px rgba(132,156,255,.22); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ── Page ────────────────────────────────────────────────────────────────── */
main { flex: 1; padding-top: 28px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 18px; }
main.narrow { max-width: calc(600px + 2 * var(--gutter)); }
.head { display: flex; flex-direction: column; gap: 12px; padding: 6px 0; }
h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; line-height: 1.02; letter-spacing: -.045em;
     overflow-wrap: anywhere;
     background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 55%, #B9C4E4 100%);
     -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.meta { font-size: 14px; color: var(--t4); }
.m { color: var(--t3); }
.back { align-self: flex-start; color: var(--t4); font-weight: 500; text-decoration: none; }
.back:hover { color: var(--t1); }
.sec { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--t2); line-height: 1.55; }

/* Tiles: the navy gradient fill with a faint inner edge. .lit = backlight (light only). */
.tile {
  position: relative; isolation: isolate; border-radius: 22px; padding: 22px 24px;
  display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, rgba(30,39,66,.92) 0%, rgba(17,23,40,.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px rgba(255,255,255,.05),
              0 2px 20px rgba(0,0,0,.4);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
  animation: rise 900ms var(--ease) backwards;
}
.tile.flush { padding: 8px 0; gap: 0; }
.lit {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), inset 0 0 0 1px rgba(255,255,255,.05),
              0 2px 20px rgba(0,0,0,.4), 0 0 90px -6px rgba(132,156,255,.42);
}
.lit::before { content: ""; position: absolute; inset: -6% -4% -10% -4%; z-index: -1; border-radius: inherit;
  background: radial-gradient(60% 60% at 50% 45%, rgba(132,156,255,.5), rgba(132,156,255,0) 70%);
  filter: blur(42px); opacity: .6; pointer-events: none; }
.lit::after { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(180deg, rgba(190,205,255,.55), rgba(190,205,255,.06) 45%, rgba(255,255,255,.04));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (hover: hover) and (pointer: fine) {
  .tile:hover { transform: translateY(-4px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px rgba(255,255,255,.10),
                0 8px 40px rgba(0,0,0,.5), 0 0 90px -6px rgba(132,156,255,.38); }
  .lit:hover::before { opacity: 1; }
  .tile.flush:hover { transform: none; }
}

/* Notices are quiet (an inner panel); the one problem marker is the white flag. */
.notice { border-radius: 14px; padding: 12px 16px; color: var(--t2);
          background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.flag, .error { display: inline-flex; align-items: center; align-self: flex-start; min-height: 24px;
  padding: 2px 9px; border-radius: 6px; background: var(--t1); color: var(--ink);
  font-size: 14px; font-weight: 700; }

/* ── Facts (summary and section items): label quiet, value plain light text ── */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 18px 24px; }
.facts > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.facts dt { font-size: 14px; color: var(--t4); }
.facts dd { font-size: 20px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2;
            overflow-wrap: anywhere; }
.summary { padding: 26px 28px; }
.summary .facts dd { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05;
                     font-variant-numeric: tabular-nums; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 14px 16px; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
th { font-size: 13.5px; font-weight: 500; color: var(--t4); white-space: nowrap; }
td { border-top: 1px solid var(--line); }
tbody tr { transition: background-color 160ms; }
tbody tr:hover { background: rgba(255,255,255,.035); }
.data td { overflow-wrap: break-word; }
.data td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data th.n { text-align: right; }
.list td a { font-weight: 600; text-decoration: none; }
.list td a:hover { text-decoration: underline; text-underline-offset: 4px; }
.list td.t { color: var(--t2); }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; margin: 0 6px 6px 0;
        border-radius: 6px; box-shadow: inset 0 0 0 1px var(--tag-edge); color: var(--t3);
        font-size: 13.5px; font-weight: 500; }
.pager { display: flex; gap: 10px; }
.pager a { text-decoration: none; }

/* ── Journal ─────────────────────────────────────────────────────────────── */
.journal { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; border-top: 1px solid var(--line); }
.journal:first-child { border-top: 0; padding-top: 0; }
.journal:last-child { padding-bottom: 0; }

/* ── Disclaimer (bottom of every page) ───────────────────────────────────── */
.disclaimer { padding-top: 20px; padding-bottom: 40px; font-size: 13.5px; color: var(--t4); }
.disclaimer p { max-width: 75ch; padding-top: 16px; border-top: 1px solid var(--line); }

/* ── Phone tab bar: only the pages that exist (Sessions, Your PCs) ───────── */
.tabbar { display: none; }
@media (max-width: 700px) {
  :root { --gutter: 16px; }
  main { padding-top: 16px; gap: 14px; }
  .nav { display: none; }
  .top .planlink { display: inline-flex; margin-left: auto; }
  .top .planlink + .inline { margin-left: 0; }
  .planlink[aria-current="page"] { color: var(--t1); }
  .tile { padding: 18px 18px; border-radius: 20px; }
  .tile.flush { padding: 4px 0; }
  .summary { padding: 22px 20px; }
  .summary .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .summary .facts dd { font-size: 26px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  /* Lists stack: each row becomes a small card; the column names move out of sight. */
  .list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .list tr { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-top: 1px solid var(--line); }
  .list tbody tr:first-child { border-top: 0; }
  .list td { display: block; padding: 0 !important; border: 0; }
  .list td:empty { display: none; }
  /* Session tables keep their columns and scroll sideways inside their tile. */
  .data { width: max-content; min-width: 100%; }
  .data td { max-width: 16rem; }
  .data td.n { max-width: none; }
  .list td[data-label]::before { content: attr(data-label) "  "; color: var(--t4); font-size: 13.5px; }
  .list td form { display: block; padding-top: 8px; }
  .disclaimer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tabbar.on { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 30; padding: 8px 6px calc(10px + env(safe-area-inset-bottom));
    background: rgba(9,12,22,.78); -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    min-height: 48px; text-decoration: none; color: var(--t4); font-size: 11.5px; font-weight: 600;
    border-radius: 12px; transition: transform 160ms var(--ease); }
  .tabbar a:active { transform: scale(.94); }
  .tabbar a[aria-current="page"] { color: var(--t1); }
  .tabbar a[aria-current="page"] svg { filter: drop-shadow(0 0 8px rgba(132,156,255,.7)); }
}

/* Motion off when the computer is set to reduce motion. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tile:hover, button:active, .btn:active, .tabbar a:active { transform: none !important; }
}

/* S13: the optional reason on the cancel confirm page. */
.reason { margin-top: 24px; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; }
.reason fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.reason legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.reason label { font-weight: 500; color: var(--t2); }
.reason input[type=radio] { accent-color: var(--t1); margin-right: 8px; }

/* ── S20 (C266): sign in with a code - the SignIn board in the web's look (no script, so the
   six boxes are one 6-digit field drawn as six boxes; tangerine is not yet on the web) ── */
.signin { padding: 28px 30px; gap: 16px; }
h1.ttl { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.04; letter-spacing: -.035em; }
h1.ttl.mid { font-size: clamp(28px, 3.6vw, 38px); }
h1.ttl.small { font-size: clamp(26px, 3.2vw, 34px); }
.lead { font-size: 17px; line-height: 1.55; color: var(--t3); }
.lead b { color: var(--t1); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.codeform { margin: 0; }
input.codein {
  width: 398px; max-width: 100%; height: 68px; min-height: 68px; padding: 0 0 0 19px; border-radius: 14px;
  font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 51px;
  font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace;
  background: repeating-linear-gradient(90deg, var(--input) 0 58px, transparent 58px 68px);
  box-shadow: none; caret-color: var(--t1); overflow: hidden;
}
input.codein:focus { box-shadow: none; outline: 2px solid rgba(255,255,255,.35); outline-offset: 3px; }
input.codein.e { background: repeating-linear-gradient(90deg, #2A3350 0 2px, var(--input) 2px 56px, #2A3350 56px 58px, transparent 58px 68px); }
.msg { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 15px; color: var(--t2); }
.note2 { padding: 14px 16px; border-radius: 14px; font-size: 15px; color: var(--t2); line-height: 1.5;
         background: rgba(237,239,243,.05); box-shadow: inset 0 0 0 1px rgba(237,239,243,.14); }
.acts { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.tl, button.tl { font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; color: var(--t4);
                 background: none; min-height: 0; padding: 0; border-radius: 0; }
.tl:hover, button.tl:hover { color: var(--t1); }
.tl.off { color: #5E687D; }
@media (max-width: 700px) {
  .signin { padding: 22px 18px; }
  input.codein { width: 100%; height: 58px; min-height: 58px; font-size: 26px;
    letter-spacing: calc((100vw - 2 * var(--gutter) - 36px) / 6 - 16px);
    padding-left: calc(((100vw - 2 * var(--gutter) - 36px) / 6 - 7px - 16px) / 2);
    background: repeating-linear-gradient(90deg, var(--input) 0 calc(100% / 6 - 7px), transparent calc(100% / 6 - 7px) calc(100% / 6)); }
  input.codein.e { background: repeating-linear-gradient(90deg, #2A3350 0 2px, var(--input) 2px calc(100% / 6 - 9px), #2A3350 calc(100% / 6 - 9px) calc(100% / 6 - 7px), transparent calc(100% / 6 - 7px) calc(100% / 6)); }
}
