/* The account page's stylesheet (2026-10-10, branch account). The page's policy allows styles
   from this file only: no style block, no style attribute. Colours follow the portal's. */
:root {
  --bg: #f4f5f2; --panel: #ffffff; --ink: #1b2420; --muted: #5c6862; --line: #d8ddd8;
  --accent: #1d6b5a; --accent-ink: #ffffff; --ok: #1d7a46; --bad: #b42318; --soft: #eef1ec;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111614; --panel: #19201d; --ink: #e3e9e5; --muted: #98a59e; --line: #2c3631;
    --accent: #4fbf9f; --accent-ink: #08130f; --ok: #4cc38a; --bad: #ff6b5e; --soft: #1f2824;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111614; --panel: #19201d; --ink: #e3e9e5; --muted: #98a59e; --line: #2c3631;
  --accent: #4fbf9f; --accent-ink: #08130f; --ok: #4cc38a; --bad: #ff6b5e; --soft: #1f2824;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
[hidden] { display: none !important; }
header { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 10px 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 650; font-size: 17px; }
.brand .sub { color: var(--muted); font-weight: 400; font-size: 13px; }
.back { font-size: 14px; }
.who { margin-left: auto; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
a { color: var(--accent); }
main { padding: 16px; max-width: 1100px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px;
  margin-bottom: 14px; }
.narrow { max-width: 460px; margin: 40px auto; }
h1 { font-size: 20px; margin: 0 0 6px; } h2 { font-size: 15px; margin: 0 0 8px; }
p { margin: 4px 0 8px; } .muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted);
  margin-bottom: 8px; }
input, button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 9px; min-width: 0; }
button { cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 4px; }
.msg { font-size: 13px; margin-top: 6px; min-height: 0; }
.msg.err { color: var(--bad); } .msg.ok { color: var(--ok); }
.banner { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--soft);
  border: 1px solid var(--line); }
.banner.err { color: var(--bad); }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 16px; margin: 6px 0 0; }
.facts dt { color: var(--muted); font-size: 13px; } .facts dd { margin: 0; overflow-wrap: anywhere; }
ul.plain { list-style: none; padding: 0; margin: 4px 0 8px; } ul.plain li { margin: 2px 0; }
details summary { cursor: pointer; color: var(--accent); font-size: 14px; margin: 6px 0; }
.scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
tfoot td { font-weight: 600; border-bottom: 0; }
tr.dim td { color: var(--muted); }
/* API keys (2026-10-11, branch apikeys): the new key, shown once. */
.keybox { border: 1px solid var(--accent); background: var(--soft); border-radius: 8px; padding: 10px 12px;
  margin: 8px 0 10px; }
input.wide { flex: 1 1 22em; }
#key-form label { flex: 1 1 18em; max-width: 28em; }
button.danger { border-color: var(--bad); color: var(--bad); }
/* A phone: each row becomes a block of labelled cells, so nothing scrolls sideways. */
@media (max-width: 640px) {
  main { padding: 12px 16px; }
  .narrow { margin: 16px auto; }
  thead { display: none; }
  table, tbody, tfoot, tr, td { display: block; width: 100%; }
  tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  td { border: 0; padding: 2px 0; text-align: left; white-space: normal; display: flex;
    justify-content: space-between; gap: 12px; }
  td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 13px; }
  td:empty { display: none; }
  .who { margin-left: 0; width: 100%; }
}
