/* Sign-in and account pages. Uses the tokens and components of engine.css; only what those pages add is here. */
.auth { max-width: 30rem; }
.auth h1 { font-size: var(--text-xl); }
.auth form { display: grid; gap: var(--space-sm); margin-top: var(--space-sm); }
.field { display: flex; flex-direction: column; gap: var(--space-2xs); font-size: var(--text-sm); color: var(--color-muted); min-width: 0; }
.field .inp { width: 100%; }
.field .hint { font-size: var(--text-xs); }
.msg { border-radius: var(--radius-ctl); padding: var(--space-xs) var(--space-sm); font-size: var(--text-sm); border: var(--rule-hair) solid var(--color-rule); }
.msg.bad { background: var(--color-wrong-soft); border-color: var(--color-wrong); color: var(--color-ink); }
.msg.good { background: var(--color-right-soft); border-color: var(--color-right); color: var(--color-ink); }
.msg:empty { display: none; }
.links { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); margin-top: var(--space-sm); font-size: var(--text-sm); }
.linkbtn { appearance: none; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; cursor: pointer; }
.linkbtn:hover { color: var(--color-accent-soft-ink); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2xs) var(--space-md); margin: 0; font-size: var(--text-sm); }
.kv dt { color: var(--color-muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.danger { color: var(--color-wrong); }
.cf-box:empty { display: none; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* The study pages' "Account" link in the top bar. On wide screens the section tabs sit in the top bar too,
   placed just left of the theme button, so they move left by the width of this link. */
#acct { width: 88px; justify-content: center; }
@media (min-width: 60rem) {
  .tabbar { inset-inline-end: calc(var(--edge) + 40px + 88px + 2 * var(--space-xs)); }
}

/* Choosing from a list (the pass, how you paid) */
.opts { display: grid; gap: var(--space-xs); margin-top: var(--space-2xs); }
.pick { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-ctl); cursor: pointer; color: var(--color-ink); }
.pick:has(input:checked) { border-color: var(--color-accent); background: var(--color-paper-3); }
.pick input { margin-top: 3px; }
.field legend { font-size: var(--text-sm); color: var(--color-muted); padding: 0; }
.how { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }

/* Admin pages */
.admin { max-width: 64rem; }
.admin h1 { font-size: var(--text-xl); }
.admin .card { margin-bottom: var(--space-md); }
.admin-nav { padding-top: var(--space-sm); padding-bottom: 0; margin-bottom: 0; }
.admin-nav .chip { text-decoration: none; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--space-sm); margin: 0 0 var(--space-md); }
.kpi-box { display: flex; flex-direction: column; gap: var(--space-2xs); padding: var(--space-sm); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-ctl); color: var(--color-ink); text-decoration: none; background: var(--color-paper); }
.kpi-box b { font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
a.kpi-box:hover { border-color: var(--color-muted); }
.line { display: flex; gap: var(--space-sm); align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 0 0 var(--space-sm); }
.acts { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: flex-end; margin-top: var(--space-sm); }
.acts > .inp { flex: 1 1 16rem; }
.acts > .msg { flex-basis: 100%; }
.tag { font-size: var(--text-xs); font-weight: 600; padding: 2px var(--space-xs); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-ctl); }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.tbl th, .tbl td { text-align: start; vertical-align: top; padding: var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule); }
.tbl th { color: var(--color-muted); font-weight: 600; white-space: nowrap; }
.tbl td { overflow-wrap: anywhere; }
.tbl a { color: var(--color-ink); }
.flags { margin: 0; padding-inline-start: 1.1em; }
.searchrow { display: flex; gap: var(--space-xs); margin: 0 0 var(--space-sm); }
.searchrow .inp { flex: 1; }
.passrow, .planform { padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--space-sm); }
.check { display: inline-flex; gap: var(--space-xs); align-items: center; font-size: var(--text-sm); margin-top: var(--space-xs); margin-inline-end: var(--space-md); }
.method { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-ctl); padding: var(--space-sm); margin-bottom: var(--space-xs); display: grid; gap: var(--space-xs); }
.method summary { cursor: pointer; }
.qr { background: #fff; display: inline-block; padding: var(--space-xs); border-radius: var(--radius-ctl); }
.secret { overflow-wrap: anywhere; font-size: var(--text-sm); }
.btn.danger { color: var(--color-wrong); border-color: var(--color-wrong); }
.narrow { max-width: 6rem; }

/* Admin: questions */
.editor { display: grid; gap: var(--space-md); }
@media (min-width: 60rem) { .editor { grid-template-columns: 3fr 2fr; align-items: start; } .editor > .card:last-child { position: sticky; top: var(--space-md); } }
.editor .card { margin-bottom: 0; display: grid; gap: var(--space-sm); }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--text-sm); resize: vertical; }
.optlist { display: grid; gap: var(--space-xs); }
.optrow { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-xs); align-items: start; }
.optrow .check { margin: var(--space-xs) 0 0; }
.preview-box { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-ctl); padding: var(--space-sm); margin-bottom: var(--space-sm); overflow-wrap: anywhere; }
.preview-box > :first-child { margin-top: 0; } .preview-box > :last-child { margin-bottom: 0; }
.prev-opts { list-style: upper-alpha; padding-inline-start: 1.6em; margin: 0 0 var(--space-sm); }
.prev-opts li { padding: 2px var(--space-xs); border-radius: var(--radius-ctl); }
.prev-opts li.right { background: var(--color-right-soft); outline: var(--rule-hair) solid var(--color-right); }
.prev-opts li > p { margin: 0; }
details.topics summary { cursor: pointer; }
.bars { display: grid; gap: 2px; }
.bar-row { display: grid; grid-template-columns: 4.5rem 1fr 9rem; gap: var(--space-xs); align-items: center; }
.bar-track { height: 10px; background: var(--color-paper-2); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--color-accent); }
.searchrow select.inp { flex: 0 1 12rem; }
@media (max-width: 40rem) { .searchrow { flex-wrap: wrap; } .bar-row { grid-template-columns: 3.5rem 1fr; } .bar-row > :last-child { grid-column: 2; } }

/* Terms and privacy pages, and their links at the foot of the account pages */
.policy { max-width: 46rem; }
.policy h1 { font-size: var(--text-xl); }
.policy h2 { font-size: var(--text-lg); margin-top: var(--space-lg); }
.policy li { margin-bottom: var(--space-2xs); }
.policy .tbl { margin: var(--space-sm) 0; }
.foot-links { text-align: center; margin-top: var(--space-md); }
.foot-links a, .policy a { color: var(--color-ink); }
