/* Not Human account pages, styled with the shared design tokens (UI-PLAN §12; design/tokens.css).
   CSP allows only same-origin assets, so fonts fall back to the system stack when Inter is not installed. */
:root {
  --e0: #f5f5f2; --e1: #fafaf8; --e2: #ffffff; --e3: #ffffff;
  --b1: #eeefeb; --b2: #e4e6e2; --b3: #d6d9d3;
  --fg: #191c1e; --muted: #6b6f6c; --faint: #9a9e9a;
  --ink: #191c1e; --ink-fg: #ffffff;
  --accent: #bddb80; --accent-soft: #bddb8040; --link: #3762d7;
  --danger: #c62828; --danger-bg: #fbe3e1; --notice-bg: #bddb8033;
  --r-surface: 16px; --r-nested: 12px; --r-control: 10px;
  --shadow: 0 8px 24px rgb(0 0 0 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --e0: #0f0f0f; --e1: #171717; --e2: #202020; --e3: #292929;
    --b1: #1a1a1a; --b2: #262626; --b3: #333333;
    --fg: #f3f4f1; --muted: #9a9c99; --faint: #6c6e6b;
    --ink: #f3f4f1; --ink-fg: #141414;
    --accent-soft: #bddb802e; --link: #8ea8f0;
    --danger: #ef5350; --danger-bg: #3d1716; --notice-bg: #bddb801f;
    --shadow: 0 10px 28px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --e0: #0f0f0f; --e1: #171717; --e2: #202020; --e3: #292929;
  --b1: #1a1a1a; --b2: #262626; --b3: #333333;
  --fg: #f3f4f1; --muted: #9a9c99; --faint: #6c6e6b;
  --ink: #f3f4f1; --ink-fg: #141414;
  --accent-soft: #bddb802e; --link: #8ea8f0;
  --danger: #ef5350; --danger-bg: #3d1716; --notice-bg: #bddb801f;
  --shadow: 0 10px 28px rgb(0 0 0 / .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--e0); color: var(--fg); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
.shell { width: min(400px, 100%); margin: 0 auto; padding: 56px 16px 32px; display: grid; gap: 18px; }
.brand { display: flex; align-items: center; justify-content: center; gap: 9px; font-weight: 600; letter-spacing: .08em; font-size: 12.5px; color: var(--fg); text-decoration: none; }
.brand i { width: 20px; height: 20px; border-radius: 6px; background: var(--accent); display: inline-grid; place-items: center; }
.brand i b { width: 8px; height: 8px; border-radius: 2px; border: 2px solid #191c1e; }
main { background: var(--e2); border: 1px solid var(--b2); border-radius: var(--r-surface); padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.foot { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 12px; }
.foot a { color: var(--link); text-decoration: none; }

h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 0; text-align: center; }
.sub { margin: -6px 0 2px; text-align: center; color: var(--muted); }
h2 { font-size: 13.5px; font-weight: 600; margin: 0; }
p { margin: 0; }

form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 12px; font-weight: 500; color: var(--fg); }
.lrow { display: flex; align-items: baseline; }
.lrow a { margin-left: auto; font-weight: 400; color: var(--link); text-decoration: none; }
input { width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 13.5px; color: var(--fg); background: var(--e2); border: 1px solid var(--b3); border-radius: var(--r-control); }
input::placeholder { color: var(--faint); }
input.code { height: 54px; text-align: center; font: 500 24px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; letter-spacing: .4em; padding-left: .4em; }
input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

button { font: inherit; font-weight: 500; font-size: 13.5px; height: 40px; padding: 0 16px; border-radius: var(--r-control); border: 1px solid var(--ink); cursor: pointer; background: var(--ink); color: var(--ink-fg); width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button svg { width: 15px; height: 15px; }
button.secondary { background: var(--e2); color: var(--fg); border-color: var(--b3); }
button.secondary:hover { border-color: var(--faint); }
button.danger { background: var(--e2); color: var(--danger); border-color: var(--b3); }
button.link { background: none; border: 0; color: var(--muted); width: auto; height: auto; padding: 4px 0; text-decoration: underline; font-weight: 400; }
button.icon { width: 30px; height: 30px; padding: 0; background: var(--e2); color: var(--muted); border-color: var(--b3); border-radius: 8px; }
button:disabled { opacity: .55; cursor: progress; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

a { color: var(--link); }
.links { text-align: center; color: var(--muted); font-size: 12.5px; }
.links a { text-decoration: none; }
.muted { color: var(--muted); font-size: 12.5px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 11.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--b2); }
.notice { background: var(--notice-bg); border: 1px solid var(--accent); padding: 10px 12px; border-radius: var(--r-control); font-size: 13px; }
.error, .status.error { background: var(--danger-bg); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--b2)); padding: 10px 12px; border-radius: var(--r-control); font-size: 13px; }
.status { font-size: 13px; color: var(--muted); text-align: center; }
.status:empty { display: none; }
.hidden, [data-show-if] { display: none; }
[data-show-if].shown { display: block; }

ul { list-style: none; padding: 0; margin: 0; }
ul[data-list] { border: 1px solid var(--b2); border-radius: var(--r-nested); overflow: hidden; background: var(--e2); }
ul[data-list]:empty { display: none; }
li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--b1); font-size: 13px; }
li:first-child { border-top: 0; }
li button { width: auto; height: 28px; padding: 0 10px; font-size: 12px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; }
.codes li { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; border-top: 0; }
code { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; font-size: 12.5px; word-break: break-all; background: var(--e1); border: 1px solid var(--b2); border-radius: 8px; padding: 8px 10px; display: block; }
details { border-top: 1px solid var(--b1); padding-top: 12px; }
summary { cursor: pointer; color: var(--link); font-size: 12.5px; text-align: center; list-style: none; }
summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 12px; }

/* Consent */
.apps { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--faint); }
.apps i { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-style: normal; font-weight: 600; font-size: 13px; background: var(--e1); border: 1px solid var(--b2); color: var(--fg); }
.apps i.nh { background: var(--accent); border-color: var(--accent); color: #191c1e; }
ul[data-list="scopes"] li { justify-content: flex-start; }
ul[data-list="scopes"] li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--fg); flex: none; }

/* Account: the Console's shell (64 px icon rail, 60 px top bar, logo cell), then section cards. */
body[data-page="account"] { background: var(--e0); }
.ac { min-height: 100vh; display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 60px minmax(0, 1fr); }
.ac-logo { position: sticky; top: 0; z-index: 6; display: grid; place-items: center; background: var(--e1); border-right: 1px solid var(--b2); border-bottom: 1px solid var(--b2); }
.ac-logo i { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; }
.ac-logo i b { width: 12px; height: 12px; border-radius: 3px; border: 2.5px solid #191c1e; }
.ac-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--e1); border-bottom: 1px solid var(--b2); }
.ac-top h1 { margin: 0; font-size: 17px; font-weight: 500; text-align: left; }
.ac-back { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 6px; border-radius: var(--r-control); border: 1px solid var(--b2); background: var(--e2); color: var(--fg); text-decoration: none; font-size: 12.5px; margin-left: 6px; }
.ac-back svg { width: 15px; height: 15px; }
.ac-back:hover { border-color: var(--b3); }
.ac-sp { flex: 1; }
.ac-ib { width: 34px; height: 34px; border: 0; border-radius: 9px; background: none; color: var(--muted); display: grid; place-items: center; padding: 0; }
.ac-ib:hover { background: var(--e2); color: var(--fg); }
.ac-ib svg { width: 17px; height: 17px; }
.ac-me { display: flex; align-items: center; gap: 10px; }
.ac-av { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #191c1e; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.ac-who { display: grid; line-height: 1.25; text-align: right; }
.ac-who b { font-size: 12.5px; font-weight: 500; }
.ac-who small { font-size: 11px; color: var(--muted); }
.ac-rail { position: sticky; top: 60px; height: calc(100vh - 60px); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0; background: var(--e1); border-right: 1px solid var(--b2); }
.ac-rail a, .ac-rail-btn { position: relative; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: var(--faint); border: 0; background: none; padding: 0; }
.ac-rail svg { width: 18px; height: 18px; }
.ac-rail a:hover, .ac-rail-btn:hover { color: var(--fg); background: var(--e2); }
.ac-rail a.on { color: var(--fg); background: var(--e3); box-shadow: inset 0 0 0 1px var(--b3); }
.ac-rail a.on svg { color: var(--accent); }
.ac-rail [data-tip]::after { content: attr(data-tip); position: absolute; left: 50px; top: 50%; transform: translateY(-50%); background: var(--e3); border: 1px solid var(--b3); color: var(--fg); font-size: 12px; padding: 4px 9px; border-radius: var(--r-control); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 20; }
.ac-rail [data-tip]:hover::after { opacity: 1; }
.ac-grow { flex: 1; }
.ac-main { min-width: 0; padding: 28px 24px 64px; }
.ac-col { width: min(760px, 100%); margin: 0 auto; display: grid; gap: 14px; }
.card { scroll-margin-top: 80px; background: var(--e1); border: 1px solid var(--b2); border-radius: var(--r-surface); padding: 18px 20px; display: grid; gap: 12px; }
.card-h { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: start; }
.card-h h2 { font-size: 14px; }
.card-h p { grid-column: 1; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.card-h > button { grid-column: 2; grid-row: 1 / span 2; width: auto; }
.row-form { display: grid; grid-template-columns: minmax(0, 360px) auto; gap: 10px; align-items: end; }
.row-form.two { grid-template-columns: minmax(0, 220px) minmax(0, 220px) auto; }
.row-form button { width: auto; }
.item { display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--b1); }
.card-h + .item { padding-top: 0; border-top: 0; }
.item-t { flex: 1; display: grid; gap: 2px; }
.item-t b { font-weight: 500; font-size: 13px; }
.item-t small { color: var(--muted); font-size: 12px; }
.item > button { width: auto; }
.sub-panel { display: grid; gap: 10px; padding: 14px; border-radius: var(--r-nested); background: var(--e2); border: 1px solid var(--b1); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions button { width: auto; }
.ac .status.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ink-fg); padding: 9px 14px; border-radius: var(--r-control); box-shadow: var(--shadow); z-index: 10; }
.ac .status.toast.error { background: var(--danger-bg); color: var(--danger); }
@media (max-width: 820px) {
  .ac { grid-template-columns: 1fr; grid-template-rows: 60px auto 1fr; }
  .ac-logo { display: none; }
  .ac-rail { position: static; height: auto; flex-direction: row; justify-content: center; border-right: 0; border-bottom: 1px solid var(--b2); padding: 8px; }
  .ac-rail [data-tip]::after { display: none; }
  .ac-who { display: none; }
  .ac-main { padding: 18px 16px 48px; }
  .row-form, .row-form.two { grid-template-columns: 1fr; }
}
/* Layout rules above set display on these blocks; hidden must still win. */
.ac .hidden { display: none; }
.row-form { justify-content: start; }

/* Team, staff and activity tables (account page, admins only) */
.tbl-wrap { border: 1px solid var(--b2); border-radius: var(--r-nested); overflow: auto; background: var(--e2); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--b2); }
.tbl td { padding: 9px 12px; border-top: 1px solid var(--b1); vertical-align: middle; }
.tbl tr:first-child td { border-top: 0; }
.tbl td b { display: block; font-weight: 500; }
.tbl td small { display: block; color: var(--muted); font-size: 11.5px; }
.tbl td select { width: auto; min-width: 140px; }
.tbl td .muted, .tbl td.muted { color: var(--muted); }
.tbl td.nowrap { white-space: nowrap; }
.tbl tr.warn td, .tbl td.warn { color: var(--danger); }
.tbl td:last-child { text-align: right; }
.tbl td:last-child button { width: auto; }
.chk { display: inline-flex; align-items: center; gap: 6px; margin: 2px 12px 2px 0; font-size: 12px; white-space: nowrap; }
.chk input { width: auto; margin: 0; }
.row-form.three { grid-template-columns: minmax(0, 280px) minmax(0, 180px) auto; }
.row-form.four { grid-template-columns: minmax(0, 240px) minmax(0, 170px) minmax(0, 220px) auto; }
details.sub { border-top: 1px solid var(--b1); padding-top: 10px; }
details.sub summary { cursor: pointer; font-size: 12.5px; color: var(--muted); }
details.sub .hint { color: var(--muted); font-size: 12px; margin: 8px 0; }
@media (max-width: 720px) { .row-form.three, .row-form.four { grid-template-columns: 1fr; } }
