/* The gaimcontrol-demo look: dark indigo, violet primary. One sheet for the member, sponsor and ops pages. */
:root {
  color-scheme: dark;
  --bg: #0E0B26; --surface: #1E1948; --surface-2: #28225C; --raise: #322B6E; --line: #352E70; --line-2: #463D8C;
  --text: #F2F0FF; --muted: #B7B1DD; --faint: #8A83BB;
  --brand: #7B61FF; --brand-2: #A592FF; --ok: #3DDC97; --warn: #FFB454; --bad: #FF6B81; --gold: #FBC21B; --teal: #22D8B3;
  --font: Aptos, "Figtree", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box }
body { margin: 0; background: var(--bg); background-image: radial-gradient(900px 520px at 75% -12%, #2B1F7A 0%, rgba(14,11,38,0) 62%); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.45; min-height: 100vh }
a { color: var(--brand-2) }
button { font: inherit; color: inherit; cursor: pointer }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance }
p { margin: 0 }
.num { font-variant-numeric: tabular-nums }

header.masthead { border-bottom: 1px solid var(--line); background: rgba(14,11,38,.7) }
header.masthead .top { padding: 14px 20px }
.top { max-width: 1320px; margin: 0 auto; padding: 18px 20px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap }
.top .gc { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; text-decoration: none; color: var(--text) }
.top .gc-mark { display: block; width: 24px; height: auto }
.top .role { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 99px; padding: 3px 9px; color: var(--muted) }
.top .who { margin-left: auto; font-size: 12px; color: var(--faint); display: flex; gap: 8px; align-items: center }

/* The member site: one column, phone-first, wider on large screens. */
.site { max-width: 760px; margin: 0 auto; padding: 28px 20px 72px; display: flex; flex-direction: column; gap: 16px; font-size: 15.5px }
.site .btn { font-size: 14.5px; padding: 11px 18px }
.page-h { font-size: clamp(26px, 5vw, 34px); font-weight: 800; letter-spacing: -.015em }
.lead { color: var(--muted); max-width: 62ch }
.summary { margin-top: 4px }
.sec { font-size: 19px; margin-top: 18px }
.back { color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; width: fit-content }
.back:hover { color: var(--text); text-decoration: underline }
.notice { border-left: 4px solid var(--brand-2); background: var(--surface); padding: 12px 14px; border-radius: 0 12px 12px 0 }
.notice.ok { border-color: var(--ok) }
.notice.warn { border-color: var(--warn) }
.tasks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line) }
.tasks li { border-bottom: 1px solid var(--line) }
.tasks a, .tasks .row-static { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 15px 4px; text-decoration: none; color: var(--text) }
.tasks a .t { color: var(--brand-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px }
.tasks a:hover .t { text-decoration-thickness: 2px }
.tasks .row-static .t { font-weight: 700; color: var(--muted) }
.tasks .h { display: block; font-size: 13px; color: var(--faint); margin-top: 2px }
.tasks .pill { flex: none }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px }
.stats .big { font-size: 26px; font-weight: 800; margin-top: 4px; text-transform: capitalize }
.pcard h2 { font-size: 17px; margin-bottom: 4px }
fieldset { margin: 0; min-width: 0 }
fieldset.pcard legend { padding: 0 6px; margin-left: -6px }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* The debug drawer: requests, notes and local sign-in, beside the page on wide screens and over it on narrow ones. */
.debug { position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw); background: var(--bg); border-left: 1px solid var(--line-2); padding: 16px; overflow-y: auto; z-index: 50; display: grid; align-content: start; gap: 14px; box-shadow: -20px 0 50px rgba(0,0,0,.45) }
.debug[hidden] { display: none }
.debug-head { display: flex; align-items: center; gap: 10px }
.debug-head button { margin-left: auto }
.debug .log { max-height: none }
.debug .ncard { padding: 16px }
.debug .ncard h2 { font-size: 18px }
@media (min-width: 1240px) {
  body.debug-open { padding-right: 460px }
  .debug { box-shadow: none }
}

.pcard, .card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px }
.card h2 { font-size: 17px; margin-bottom: 10px }
.lbl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); font-weight: 700 }
.btn { border: 1px solid var(--line-2); background: var(--surface-2); padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 13px }
.btn:hover { background: var(--raise) }
.btn:disabled { opacity: .45; cursor: not-allowed }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff }
.btn.primary:hover { background: #6A4FF5 }
.btn.block { width: 100%; padding: 13px; border-radius: 14px; font-size: 14px }
.btn.sm { padding: 5px 9px; font-size: 12px }
.btn.bad { border-color: rgba(255,107,129,.5); color: var(--bad) }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.stack { display: grid; gap: 10px }

.field { display: grid; gap: 5px }
.field label { font-size: 12px; color: var(--muted); font-weight: 600 }
input, select, textarea { background: #15113A; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; color: var(--text); font: inherit; width: 100% }
input[type=checkbox] { width: auto; accent-color: var(--brand) }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 6px 0 }
label.check input { margin-top: 3px }

input[type=radio] { width: auto; accent-color: var(--brand) }

/* Repeatable rows: accounts and debts */
.items { display: grid; gap: 10px; margin: 8px 0 10px }
.item-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto; gap: 10px; align-items: end; padding-bottom: 10px; border-bottom: 1px solid var(--line) }
.item-row[data-row=account] { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto }
.item-row label.field > span { font-size: 12px; color: var(--muted); font-weight: 600 }
.item-row label.check { padding: 0 0 10px; white-space: nowrap }
.item-row .field .faint { font-size: 12px }
.item-row input[readonly] { opacity: .75 }
.item-row[data-row=account] { align-items: start }
.item-row[data-row=account] label.check { padding: 34px 0 0 }
.item-row[data-row=account] .btn.sm { margin: 28px 0 0 }
.item-row .btn.sm { margin-bottom: 6px }

/* Tick-all-that-apply and pick-one choices as a grid of tiles */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px }
label.choice { display: flex; gap: 8px; align-items: center; font-size: 13px; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); cursor: pointer }
label.choice:has(input:checked) { border-color: var(--brand); background: var(--raise) }

/* Question grid: one row per question, one column per answer */
.qgrid { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface) }
.qrow { display: grid; grid-template-columns: minmax(0, 2.4fr) repeat(4, minmax(0, 1fr)); align-items: center; border: 0; border-top: 1px solid var(--line); padding: 0 }
.qrow.qhead { border-top: 0; font-size: 11px; font-weight: 700; color: var(--muted); text-align: center }
.qrow > span { padding: 10px 12px }
.qrow .q { font-size: 13px; text-align: left }
.qcell { display: flex; justify-content: center; padding: 12px 6px; cursor: pointer }
.qcell span { display: none }
.qcell:has(input:checked) { background: var(--raise) }

/* Numeric scales, e.g. mood 1–5 */
.scale { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px }
.scale label { position: relative }
.scale input { position: absolute; opacity: 0; inset: 0; cursor: pointer }
.scale span { display: grid; place-items: center; min-width: 38px; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font-weight: 700 }
.scale input:checked + span { border-color: var(--brand); background: var(--brand); color: #fff }
.scale input:focus-visible + span { outline: 2px solid var(--brand-2); outline-offset: 2px }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent }
.p-ok { background: rgba(61,220,151,.14); color: var(--ok); border-color: rgba(61,220,151,.3) }
.p-warn { background: rgba(255,180,84,.14); color: var(--warn); border-color: rgba(255,180,84,.3) }
.p-bad { background: rgba(255,107,129,.14); color: var(--bad); border-color: rgba(255,107,129,.3) }
.p-brand { background: rgba(123,97,255,.18); color: var(--brand-2); border-color: rgba(123,97,255,.4) }
.p-muted { background: var(--surface-2); color: var(--muted); border-color: var(--line-2) }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px }
.kv dt { color: var(--faint) }
.kv dd { margin: 0 }
.list { display: grid }
.list > div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; align-items: center }
.list > div:first-child { border-top: 0 }
.muted { color: var(--muted) }
.faint { color: var(--faint); font-size: 12px }
.bar { height: 7px; border-radius: 99px; background: #15113A; overflow: hidden }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand-2) }
.bars { display: flex; gap: 6px; align-items: flex-end; height: 90px }
.bars div { flex: 1; display: grid; gap: 4px; justify-items: center; font-size: 10.5px; color: var(--faint) }
.bars i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: var(--brand) }

.tcard { border-radius: 18px; padding: 18px; background: linear-gradient(135deg,#7B61FF 0%,#4B33C9 55%,#2A1E86 100%); display: grid; gap: 18px; aspect-ratio: 1.6/1 }
.tcard.frozen { filter: grayscale(.8) }
.tcard .no { font-size: 15px; letter-spacing: .12em }

.ncard { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px }
.ncard .eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--brand-2) }
.ncard h2 { font-size: 22px; margin-top: 6px }
.ncard p { color: var(--muted); margin-top: 8px; max-width: 64ch }
.ncard ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 5px }

.log { display: grid; gap: 6px; max-height: 420px; overflow: auto }
.log details { background: #15113A; border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; font-size: 12px }
.log summary { cursor: pointer; display: flex; gap: 8px; align-items: center; list-style: none }
.log summary::-webkit-details-marker { display: none }
.log code { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px }
.log pre { margin: 6px 0 0; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; color: var(--muted); max-height: 260px; overflow: auto }

.portal { max-width: 1320px; margin: 0 auto; padding: 20px }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px }
.tabs button { border: 1px solid var(--line-2); background: transparent; border-radius: 99px; padding: 6px 14px; font-weight: 600; color: var(--muted) }
.tabs button[aria-current="true"] { background: var(--brand); border-color: var(--brand); color: #fff }
.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px }
.error { color: var(--bad); font-size: 12.5px }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--raise); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 12px; z-index: 60; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); max-width: calc(100vw - 32px) }

.home { max-width: 1080px; margin: 0 auto; padding: 48px 20px 40px }
.home h1 { font-size: clamp(28px,4.5vw,42px); letter-spacing: -.02em; margin: 24px 0 12px; max-width: 22ch }
.home .lead { color: var(--muted); max-width: 64ch }
.home .grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; margin-top: 32px }
a.tile { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px }
a.tile:hover { border-color: var(--c) }
a.tile .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--c) }
a.tile h2 { font-size: 21px }
a.tile p { color: var(--muted) }
a.tile .go { margin-top: auto; font-weight: 700; color: var(--c) }

@media (max-width: 820px) {
  .home .grid { grid-template-columns: 1fr }
}
@media (max-width: 560px) {
  .site { padding: 20px 16px 56px }
  .grid2 { grid-template-columns: 1fr }
  .stats { grid-template-columns: 1fr 1fr }
  .stats .pcard:last-child { grid-column: 1 / -1 }
  .tasks a, .tasks .row-static { align-items: flex-start }
  .item-row, .item-row[data-row=account] { grid-template-columns: 1fr 1fr }
  .item-row[data-row=account] .field:first-child { grid-column: 1 / -1 }
  .item-row label.check { padding: 0 }
  .item-row .btn.sm { justify-self: start }
  .qrow.qhead { display: none }
  .qrow { grid-template-columns: 1fr 1fr; padding: 10px 12px; gap: 6px }
  .qrow .q { grid-column: 1 / -1; padding: 0 0 4px }
  .qcell { justify-content: flex-start; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 10px; font-size: 13px }
  .qcell span { display: inline }
}
.q-legend { font-weight: 600; font-size: 14px; margin-bottom: 2px }
[hidden] { display: none !important }
.pcard fieldset, form > fieldset:not(.pcard) { border: 0; padding: 0; margin: 0; min-width: 0 }

/* A date of birth as Day, Month and Year boxes */
.dob-label { font-size: inherit; }
.dob { display: grid; grid-template-columns: 5rem 5rem 7rem; gap: 12px; margin-top: 6px; }
.find-row { display: flex; gap: 8px; align-items: end }
.find-row .field { flex: 1; max-width: 220px }
.tasks li.has-check { display: flex; align-items: center; gap: 8px }
.tasks li.has-check > a { flex: 1; min-width: 0 }
.tasks li.has-check > .btn { flex: none; margin-right: 8px }
