/* Roster Dashboard — web account-area design system.
   Hifi redesign (handoff: design_handoff_roster_dashboard). Server-rendered:
   these classes replace the per-page inline styles of the .dc.html prototypes.
   Quiet Column layout (single centred column). */

:root {
  --bg: #faf9f6;
  --card: #fff;
  --card-alt: #fbfaf7;
  --inset: #f0efe9;
  --ink: #131b20;
  --ink-2: #697076;
  --ink-3: #5a6066;
  --muted: #8a8f93;
  --muted-2: #9a9f9c;
  --label: #7a8086;
  --eyebrow: #a3a8a4;
  --border: #e4e3df;
  --border-hd: #ecebe6;
  --divider: #efeee9;
  --input: #d4d4cf;
  --outline: #cfd0cd;
  --dark: #111b22;
  --danger: #a40000;
  --sel: #dbe2e8;
  --ok-text: #5a7d63; --ok-bg: #eef3ee; --ok-border: #dde7de;
}

* { box-sizing: border-box; }
::selection { background: var(--sel); }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink); background: var(--bg); min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--dark); outline-offset: 2px;
}
input[type=number]::-webkit-inner-spin-button { opacity: .5; }

/* ---- sticky top bar ---- */
.topbar { position: sticky; top: 0; z-index: 30;
  background: rgba(250,249,246,.82); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-hd); }
.topbar-inner { max-width: 680px; margin: 0 auto; display: flex; align-items: center;
  gap: 14px; padding: 14px 22px; }
.topbar-inner.wide { max-width: 740px; }
.topbar .spacer { flex: 1; }
.topbar .email { font-size: 12.5px; color: var(--muted-2); }
.back-link { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2);
  font-size: 13.5px; text-decoration: none; }
.back-link svg { width: 18px; height: 18px; }
.topbar a.act { color: var(--ink-2); font-size: 13.5px; text-decoration: none; }
.topbar a.act:hover { color: var(--ink); }

/* ---- page container + intro ---- */
.container { max-width: 680px; margin: 0 auto; padding: 0 22px 90px; }
.container.col { max-width: 740px; }
.page-intro { padding: 40px 4px 30px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--eyebrow); }
.page-intro h1 { font-size: 30px; font-weight: 430; letter-spacing: -.035em; margin: 6px 0 0; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--eyebrow); margin: 0 0 13px 4px; }
.section-label.danger { color: #bd8a8a; }

/* ---- cards ---- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  margin: 0 0 38px; box-shadow: 0 1px 2px rgba(20,27,32,.03); }
.card.clip { overflow: hidden; }
.card.danger { border-color: #e9d4d4; }
.card-pad { padding: 22px; }
.card-pad.tight { padding: 20px 22px; }
.card-foot { display: flex; justify-content: flex-end; padding: 14px 22px;
  background: var(--card-alt); border-top: 1px solid var(--divider); }
.card-row { display: flex; align-items: flex-start; gap: 16px; padding: 20px 22px; }
.card-row .grow { flex: 1; }

.card-title { font-size: 15px; font-weight: 540; }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 5px 0 0; }
.help.lg { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.note { font-size: 12px; color: var(--muted-2); line-height: 1.55; margin: 10px 0 0; }

/* ---- form fields ---- */
.field-label { display: block; font-size: 12.5px; color: var(--label);
  margin: 0 0 7px; font-weight: 500; }
.field-label .sub { color: var(--muted-2); font-weight: 400; }
.field-label.mt { margin-top: 20px; }
.field { width: 100%; padding: 11px 12px; border: 1px solid var(--input);
  border-radius: 9px; font-size: 14px; background: #fff; color: var(--ink); }
.field.danger { border-color: #e3c6c6; }

/* number input with a "min" suffix */
.num { display: flex; align-items: center; border: 1px solid var(--input);
  border-radius: 9px; overflow: hidden; background: #fff; }
.num input { flex: 1; min-width: 0; padding: 11px 12px; border: 0; font-size: 14px;
  background: transparent; color: var(--ink); }
.num .suffix { padding: 0 12px; font-size: 12.5px; color: var(--muted-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.subhead { font-size: 12px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: var(--eyebrow); }

/* ---- segmented control (seat / fleet / panel size / layout) ---- */
.seg { display: grid; gap: 7px; background: var(--inset); border: 1px solid var(--border);
  border-radius: 11px; padding: 4px; }
.seg.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.seg.cols-2 { grid-template-columns: 1fr 1fr; }
.seg-btn { border: 0; border-radius: 8px; padding: 9px 6px; font: inherit; font-size: 13.5px;
  font-weight: 540; cursor: pointer; transition: background .15s ease;
  background: transparent; color: var(--ink-3); text-align: center; }
/* a submit-radio segmented control: the checked radio styles its label */
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label.seg-btn { display: block; }
.seg input:checked + label.seg-btn,
.seg-btn.active { background: var(--dark); color: #fff; }

/* ---- toggle switch (checkbox-driven: label is the track; auto-submits) ---- */
.toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle { position: relative; display: inline-block; width: 44px; height: 26px; border: 0;
  border-radius: 999px; cursor: pointer; flex: none; margin-top: 2px;
  transition: background .18s ease; background: #d7d6d1; padding: 0; }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform .18s ease; }
.toggle.on, .toggle-input:checked + .toggle { background: var(--dark); }
.toggle.on .toggle-knob, .toggle-input:checked + .toggle .toggle-knob { transform: translateX(18px); }

/* ---- buttons ---- */
.btn { border: 0; border-radius: 9px; font-size: 14px; font-weight: 600; cursor: pointer;
  font-family: inherit; }
.btn-dark { background: var(--dark); color: #fff; padding: 10px 20px; }
.btn-outline { border: 1px solid var(--outline); background: #fff; color: #182027;
  padding: 10px 18px; font-size: 13.5px; font-weight: 560; white-space: nowrap; }
.btn-danger { width: 100%; padding: 12px; background: var(--danger); color: #fff; }
.btn-danger[disabled] { background: #efe4e4; color: #c08a8a; cursor: not-allowed; }

/* ---- misc ---- */
.icon-tile { width: 38px; height: 38px; border-radius: 10px; background: var(--inset);
  border: 1px solid var(--border); display: grid; place-items: center; color: var(--ink-3);
  flex: none; }
.icon-tile svg { width: 20px; height: 20px; }
code, .chip { font-family: ui-monospace, Menlo, monospace; background: #f3f2ee;
  padding: 1px 5px; border-radius: 4px; }
.center-link { margin: 34px 0 0; text-align: center; }
.center-link a { color: var(--muted-2); font-size: 13px; text-decoration: underline; }
.err { color: var(--danger); font-size: .9rem; margin: .75rem 0 0; }

/* battery pill + progress bar (Dashboard) */
.pill-ok { color: var(--ok-text); background: var(--ok-bg); border: 1px solid var(--ok-border);
  border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.bar { height: 8px; background: #eeede9; border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--dark); border-radius: 999px; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.muted { color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ---- legacy simple pages (login / signup / confirm / setup_roster / privacy):
   centred narrow column. Same markup as before, restyled to the new tokens.
   Scoped under .wrap so none of it reaches the full-bleed redesigned pages
   (which override the whole body block and sit outside .wrap). ---- */
.wrap { max-width: 26rem; margin: 9vh auto 0; padding: 0 1.25rem 3rem; }
.wrap.wide { max-width: 68rem; margin-top: 3.5vh; }
.brand { font-weight: 700; letter-spacing: .02em; margin: 0 0 1rem; color: var(--ink); }
.wrap h1 { font-size: 1.3rem; font-weight: 540; margin: 0 0 1rem; }
.wrap p { line-height: 1.5; }
.wrap label { display: block; font-size: 12.5px; color: var(--label);
  margin: 1rem 0 .4rem; font-weight: 500; }
.wrap input[type=text], .wrap input[type=email] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--input); border-radius: 9px;
  font-size: 14px; background: #fff; color: var(--ink); }
.wrap > button, .wrap form button:not(.seg-btn) {
  margin-top: 1.1rem; width: 100%; padding: 11px; font-size: 14px; font-weight: 600;
  border: 0; border-radius: 9px; background: var(--dark); color: #fff; cursor: pointer; }
.wrap button.quiet { background: none; color: var(--ink-2); width: auto; padding: 0;
  margin: 0; font-size: .85rem; text-decoration: underline; }

/* ---- Dashboard (home, Quiet Column) ---- */
.page-head { display: flex; align-items: center; gap: 15px; padding: 42px 4px 32px; flex-wrap: wrap; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--inset);
  border: 1px solid var(--border); display: grid; place-items: center; color: #444b50; flex: none; }
.avatar svg { width: 22px; height: 22px; }
.page-head .who { flex: 1; min-width: 140px; }
.page-head .who .name { font-size: 26px; font-weight: 430; letter-spacing: -.03em; margin-top: 3px; }
.page-head .acts { display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--ink-2); }
.page-head .acts form { margin: 0; }
.page-head .acts a { text-decoration: none; }
.page-head .acts a.strong { color: var(--ink); font-weight: 540; }
.page-head .acts .act { color: var(--ink-2); text-decoration: underline; background: none;
  border: 0; font: inherit; font-size: 13px; cursor: pointer; padding: 0; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.card-head .ct { display: flex; align-items: center; gap: 12px; }
.card-head .title { font-size: 16px; font-weight: 560; letter-spacing: -.01em; }
.card-head .cap { font-size: 12.5px; color: var(--muted); }

.panel-box { background: #f1f0ec; border: 1px solid #c8c8c3; border-radius: 10px; padding: 10px; margin-top: 16px; }
.panel-box img { width: 100%; display: block; border-radius: 5px; }
.resync { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin: 16px 2px 0;
  color: #6b7176; font-size: 13px; line-height: 1.5; }
.resync img { border-radius: 6px; border: 1px solid #e2e1dc; flex: none; object-fit: cover; }
.resync .grow { flex: 1; min-width: 220px; }

.subhead-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 20px; border-bottom: 1px solid var(--divider); font-size: 13px; font-weight: 600; color: #454b50; }
.subhead-row a { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px;
  color: var(--ink); font-weight: 540; text-decoration: none; white-space: nowrap; }

.row { display: flex; align-items: flex-start; gap: 13px; padding: 16px 20px; border-bottom: 1px solid var(--divider); }
.row.center { align-items: center; }
.row .grow { flex: 1; min-width: 0; }
.row .nm { font-size: 15px; font-weight: 540; }
.row .nm .meta { font-weight: 400; color: var(--muted-2); font-size: 13px; }
.row .sub { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.row .sub svg { width: 13px; height: 13px; }
.row .mono-sm { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--eyebrow); margin-top: 4px; }
.row .tzrow { display: flex; align-items: center; gap: 8px; margin-top: 11px; }
.row .tzrow svg { width: 16px; height: 16px; flex: none; color: var(--muted-2); }
.link-btn { background: none; border: 0; color: var(--muted-2); font: inherit; font-size: 13px;
  cursor: pointer; text-decoration: underline; padding: 0; flex: none; }
.row-actions { display: flex; align-items: center; gap: 12px; flex: none; }

.footer-form { padding: 18px 20px; background: var(--card-alt); }
.footer-form .lbl { font-size: 12.5px; color: var(--label); font-weight: 500; margin: 0 0 10px; }
.footer-form .inline { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.footer-form .inline .field, .footer-form .inline select.select { flex: 1; min-width: 170px; width: auto; }
.footer-form .stack { display: grid; gap: 9px; }
.footer-form .field.mono { font-family: ui-monospace, Menlo, monospace; }

select.select { -webkit-appearance: none; appearance: none; padding: 11px 30px 11px 12px;
  border: 1px solid var(--input); border-radius: 9px; font-size: 14px; background-color: #fff; color: var(--ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'><path d='m6 9 6 6 6-6' stroke='%23999' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; }
select.tz { -webkit-appearance: none; appearance: none; font-size: 13px; border: 1px solid #e0dfda;
  border-radius: 8px; padding: 6px 30px 6px 10px; background-color: var(--card-alt); color: #454b50; max-width: 100%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none'><path d='m6 9 6 6 6-6' stroke='%23999' stroke-width='1.6'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; }

.once { background: #f6f5f1; border: 1px solid #e2e1dc; border-radius: 10px; padding: 13px 15px;
  margin: 0 0 16px; font-size: 13px; color: #454b50; line-height: 1.55; }
.once.warn { background: #fff8e6; border-color: #f0e0a8; }
.once code, .once a { word-break: break-all; }
.once .tok { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; margin-top: 6px;
  background: #fff; border: 1px solid #e2e1dc; border-radius: 8px; padding: 10px 12px; }
.empty { padding: 18px 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.group-label { padding: 14px 20px 2px; font-size: 11.5px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--eyebrow); }

/* ---- onboarding step (centred single card) ---- */
.onboard { max-width: 460px; margin: 8vh auto 0; padding: 0 22px 60px; }
.onboard .eyebrow { margin-bottom: 6px; }
.onboard h1 { font-size: 26px; font-weight: 430; letter-spacing: -.03em; margin: 0 0 10px; }
.onboard .sub { font-size: 14px; color: var(--ink-2); line-height: 1.6; margin: 0 0 22px; }

/* accordion (native <details>) */
.acc { border-top: 1px solid var(--divider); }
.acc > summary { list-style: none; display: flex; align-items: center; gap: 13px; padding: 17px 20px;
  cursor: pointer; font-size: 14.5px; font-weight: 540; color: var(--ink); }
.acc > summary::-webkit-details-marker { display: none; }
.acc-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--inset); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--ink-3); flex: none; }
.acc-ico svg { width: 18px; height: 18px; }
.acc .acc-t { flex: 1; }
.acc .caret { display: inline-flex; color: var(--muted-2); transition: transform .2s ease; }
.acc .caret svg { width: 18px; height: 18px; }
.acc[open] .caret { transform: rotate(90deg); }
.acc-body { padding: 2px 20px 20px; color: var(--ink-3); font-size: 13.5px; line-height: 1.65; }
.acc-body ol { margin: 4px 0 14px 18px; padding: 0; }
.acc-body p.sub { margin: 8px 0 4px; font-weight: 560; color: #454b50; font-size: 13.5px; }
.acc-body esp-web-install-button { display: block; margin: 4px 0 14px; }
.budget-row { display: flex; justify-content: space-between; font-size: 13px; margin: 0 0 6px; }
.budget-row .lab { color: #454b50; }
.budget-row .val { color: var(--muted-2); }
