/* Dashboard (/app signed in, /app/demo). Tokens come from site/styles.css :root; no hex values here.
   Desktop: left sidebar. Under 900px: a top bar with the organisation switcher and a Menu. Tables scroll in their own box. */
.appbody { background: var(--paper); }
.appbar { border-bottom: 1px solid var(--rule); background: var(--sheet); }
.appbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 60px; }
.ax-legal a { margin-left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.dash { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.dash[hidden] { display: none; }
.dside { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; background: var(--sheet); border-right: 1px solid var(--rule); padding: 20px 16px; display: flex; flex-direction: column; gap: 18px; }
.dside-top { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.dside .logo b { font-size: 17px; }
.badge-demo { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--flag); background: var(--flag-soft); border-radius: 4px; padding: 3px 8px; }
.org-pick { display: grid; gap: 4px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.org-pick select { font: 500 14px var(--body); text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: 8px; padding: 8px 10px; width: 100%; }
.side-menu summary { display: none; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { text-decoration: none; color: var(--ink-2); padding: 9px 12px; border-radius: 8px; font-size: 15px; }
.side-nav a:hover { background: var(--bar); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--ledger-soft); color: var(--ledger); font-weight: 600; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); font: 14px var(--body); text-align: left; text-decoration: underline; cursor: pointer; }

.dmain { padding: 28px clamp(16px, 3vw, 40px) 64px; display: grid; gap: 18px; align-content: start; min-width: 0; max-width: 1160px; outline: none; }
.dhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.dhead h1 { font-weight: 700; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.02em; margin: 0; }
.dsub { margin: 4px 0 0; color: var(--ink-2); font-size: 15px; }
.crumb { margin: 0; font-size: 14px; color: var(--ink-3); }
.dnotice { margin: 0; padding: 10px 14px; border-radius: 8px; background: var(--ledger-soft); font-size: 14px; }
.dnotice.demo { background: var(--flag-soft); }
.dcard { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; display: grid; gap: 12px; min-width: 0; }
.dcard h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; }
.dcard p { margin: 0; }
.dcard.danger { border-color: var(--flag-soft); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles .stat { background: var(--sheet); border-radius: 10px; padding: 14px 16px; display: grid; gap: 4px; align-content: start; }
.tiles .stat b { font-size: 22px; overflow-wrap: anywhere; }
.stat .hint { font-size: 12px; color: var(--ink-3); }
.stat-chip { padding-top: 4px; }
.next { background: var(--ledger-soft); border-color: transparent; justify-items: start; }
.next-t { font: 600 17px/1.45 var(--display); }

.mchart { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 168px; padding-top: 8px; }
.mbar { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 6px; min-width: 0; }
.mstack { display: flex; flex-direction: column-reverse; justify-content: flex-start; background: repeating-linear-gradient(to top, var(--bar) 0 1px, transparent 1px 25%); border-radius: 4px; overflow: hidden; }
.mstack i { display: block; width: 100%; }
.mlabel { font: 500 11px var(--mono); color: var(--ink-3); text-align: center; }
.seg-looks_right { background: var(--ok); }
.seg-review { background: var(--flag); }
.seg-depends { background: var(--ink-3); }
.seg-not_enough_data { background: var(--rule-2); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.chip.neutral { color: var(--ink-2); background: var(--bar); }
.tag-rev { font: 500 11px var(--mono); color: var(--ok); background: var(--ok-soft); border-radius: 4px; padding: 2px 6px; white-space: nowrap; }
.table-scroll { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; background: var(--sheet); max-width: 100%; }
.table-scroll:focus-visible { outline: 3px solid var(--ledger); outline-offset: 2px; }
.ledger { min-width: 640px; font-size: 14px; }
.ledger th { padding: 10px 14px; background: var(--sheet); position: sticky; top: 0; }
.ledger th button { all: unset; cursor: pointer; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; }
.ledger th button:focus-visible { outline: 2px solid var(--ledger); outline-offset: 2px; }
.ledger td { padding: 9px 14px; white-space: normal; vertical-align: top; }
.ledger td a { color: var(--ledger); font-weight: 500; }
.ledger .r { text-align: right; }
.ledger .empty { text-align: center; color: var(--ink-3); padding: 24px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 13px; }
.nowrap { white-space: nowrap !important; }
.neg { color: var(--flag); }
.muted { color: var(--ink-3); opacity: .7; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters label, .lbl { display: grid; gap: 4px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.filters select, .filters input, .dcard textarea, .rate, .ledger select { font: 14px var(--body); color: var(--ink); background: var(--sheet); border: 1px solid var(--rule-2); border-radius: 8px; padding: 8px 10px; min-height: 40px; max-width: 100%; }
.filters .btn { height: 40px; }
.dcard textarea { width: 100%; resize: vertical; }
.rate { width: 110px; }
.row-act { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.checks { display: grid; gap: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ledger); }
select:focus-visible, textarea:focus-visible, input:focus-visible, .linkish:focus-visible, button:focus-visible { outline: 3px solid var(--ledger); outline-offset: 2px; }
.btn[disabled], button[disabled], select[disabled], input[disabled], textarea[disabled] { opacity: .55; cursor: not-allowed; }

.explain { font-size: 15.5px; }
.formula { display: grid; gap: 6px; background: var(--paper); border: 1px solid var(--rule); border-radius: 8px; padding: 14px; }
.formula > div { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.formula span { color: var(--ink-3); }
.formula b { font-weight: 500; overflow-wrap: anywhere; }
.formula .eq { border-top: 1px dashed var(--rule-2); padding-top: 6px; }
.rv-note { background: var(--paper); border-left: 3px solid var(--ok); padding: 8px 12px; }
.plan-name { font: 700 28px var(--display); }

@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 899px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .dside { position: sticky; top: 0; z-index: 5; height: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .dside-top { flex-direction: row; align-items: center; flex: 1 1 auto; }
  .org-pick { order: 3; flex: 1 1 100%; }
  .org-pick span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .side-menu { order: 2; }
  .side-menu summary { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--rule-2); cursor: pointer; font-weight: 600; list-style: none; }
  .side-menu summary::-webkit-details-marker { display: none; }
  .side-menu[open] .side-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--sheet); border-bottom: 1px solid var(--rule); padding: 8px 16px 14px; box-shadow: var(--shadow); }
  .side-foot { display: none; }
  .dmain { padding-top: 20px; }
}
@media (max-width: 560px) {
  .tiles, .tiles-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .tiles .stat { padding: 12px; }
  .tiles .stat b { font-size: 18px; }
  .dside .logo b span { display: none; }
  .dcard { padding: 16px; }
  .mchart { gap: 3px; height: 140px; }
  .mlabel { font-size: 9.5px; }
  .filters label { flex: 1 1 130px; }
  .filters select, .filters input { width: 100%; }
}
/* Reset the FAQ details style from styles.css for the dashboard's menu and cards. */
.dside details, .dside details:first-of-type { border: 0; padding: 0; }
.dside summary::after { content: none; }
.dcard.ax-assume { padding: 16px 20px; }
.dcard.ax-assume summary { font-size: 16px; }
.dside details[open] summary::after, .dside details summary::after { content: none; }
/* /app in dashboard mode: hide the site chrome and the free-check panels. */
body.dash-on > .skip, body.dash-on > header.top, body.dash-on > footer, body.dash-on #main > .page-head, body.dash-on #main > .appx { display: none; }
/* /app sign-in: two options side by side, stacked on phones */
.ax-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ax-opt { border: 1px solid var(--rule); border-radius: 10px; padding: 18px; display: grid; gap: 10px; align-content: start; background: var(--paper); min-width: 0; }
.ax-opt[hidden] { display: none; }
.ax-opt h3 { margin: 0; font-size: 19px; }
.ax-opt p { margin: 0; color: var(--ink-2); font-size: 15px; }
.ax-error.ax-calm { color: var(--ink); background: var(--ledger-soft); }
.ax-error.ax-calm a { color: var(--ledger); font-weight: 600; }
@media (max-width: 720px) { .ax-options { grid-template-columns: minmax(0, 1fr); } }
