@font-face { font-family: Jakarta; src: url("fonts/plus-jakarta-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: Jakarta; src: url("fonts/plus-jakarta-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: Jakarta; src: url("fonts/plus-jakarta-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: Jakarta; src: url("fonts/plus-jakarta-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --night: #0F172A; --night-2: #1C2538; --night-line: #2E384D; --night-text: #F1F4F9; --night-muted: #AEB8C9;
  --flame: #E2862E; --flame-ink: #9D5816; --ember: #FCEEDF;
  --bg: #F6F8FB; --surface: #FFFFFF; --line: #E3E8EF; --line-strong: #CDD5E0;
  --muted: #556072; --control: #8A94A6; --good: #136447; --good-tint: #E3F3EA; --error: #A3313B; --warn: #7A5410;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--night); font: 400 16px/1.5 Jakarta, system-ui, sans-serif; }
h1, h2, p, ul, dl, dd, fieldset { margin: 0; }
h1, h2 { line-height: 1.12; letter-spacing: -.045em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 16px; font-weight: 800; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { cursor: wait; }
strong, b, input, dd, .rows, .shelf span { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--flame-ink); outline-offset: 2px; }
h1:focus, h2:focus { outline: 0; }
[hidden], .only-desk { display: none !important; }
.icon { display: block; width: 20px; height: 20px; flex: none; }
.skip { position: absolute; z-index: 6; top: 8px; left: 8px; padding: 12px; background: white; transform: translateY(-150%); }
.skip:focus { transform: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Cornice */
.top {
  position: sticky; top: 0; z-index: 3; height: 56px; padding: 0 16px; background: var(--night); color: var(--night-text);
  display: flex; align-items: center; justify-content: space-between;
}
.brand, .attribution { display: inline-flex; align-items: center; gap: 8px; }
.brand strong { font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.brand img { width: 22px; height: 28px; }
.brand small, .attribution { color: var(--night-muted); font-size: 12px; font-weight: 600; }
.side { display: none; }
.avatar {
  width: 34px; height: 34px; border: 1px solid var(--night-line); background: var(--night-2); color: var(--night-text);
  border-radius: 50%; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; flex: none;
}
.page { min-width: 0; padding: 16px 16px calc(92px + env(safe-area-inset-bottom)); }
.page.no-nav { padding-bottom: 24px; }
.heading { position: relative; margin: 4px 0 16px; }
.heading p { color: var(--muted); font-size: 14px; margin-top: 2px; }
.connection { color: var(--warn); background: var(--ember); border-radius: 999px; padding: 4px 8px; font-size: 12px; font-weight: 700; }
.heading .connection { position: absolute; top: 0; right: 0; }
.bottom {
  position: fixed; z-index: 3; inset: auto 0 0; min-height: calc(68px + env(safe-area-inset-bottom));
  background: var(--night); color: white; padding: 0 3px env(safe-area-inset-bottom);
  display: grid; align-items: center; grid-template-columns: repeat(2, minmax(0, 1fr)) 76px repeat(2, minmax(0, 1fr));
}
.nav-link {
  display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 3px;
  min-height: 48px; background: none; border: 0; border-radius: 12px; color: var(--night-muted);
  font-size: 11px; font-weight: 700; padding: 4px 1px; white-space: nowrap;
}
.nav-link[aria-current] { color: var(--flame); }
.plus {
  width: 58px; height: 58px; border: 0; border-radius: 50%; justify-self: center;
  display: grid; place-items: center; background: var(--flame); color: var(--night); margin-top: -26px;
  box-shadow: 0 0 0 5px var(--bg), 0 8px 20px #0f172a33;
}
.plus .icon { width: 26px; height: 26px; stroke-width: 2.4; }
:is(.top, .side, .bottom, .hero) :focus-visible { outline-color: var(--flame); }

/* Superfici, righe e scelte */
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; min-width: 0; }
.block + .block { margin-top: 24px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 24px; }
.quiet { border: 0; background: transparent; color: var(--flame-ink); font-size: 14px; font-weight: 700; min-height: 28px; padding: 0; }
.glyph {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; background: var(--bg); color: var(--night);
}
.glyph .icon { width: 19px; height: 19px; }
.glyph-flame { background: var(--ember); color: var(--flame-ink); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--bg); border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--muted); }
.chip .icon { width: 13px; height: 13px; }
.chip.good { color: var(--good); background: var(--good-tint); }
.chip.warning { background: var(--ember); }
.warning { color: var(--warn); font-weight: 700; }
.muted, .rows small { color: var(--muted); }
.rows { list-style: none; padding: 0 16px; }
.rows li {
  min-height: 60px; padding: 8px 0; display: flex; gap: 12px; align-items: center;
  overflow-wrap: anywhere; border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: 0; }
.rows small { display: block; font-size: 14px; }
.row-name { flex: 1; min-width: 0; line-height: 1.35; }
.row-value { text-align: right; max-width: 53%; overflow-wrap: anywhere; margin-left: auto; }
.row-value small { font-size: 12px; }
.total-line { display: flex; justify-content: space-between; gap: 8px; padding: 8px 16px 12px; font-size: 14px; font-weight: 700; }
.btn {
  min-height: 48px; border: 1px solid var(--line-strong); border-radius: 12px; padding: 8px 16px;
  background: var(--surface); color: var(--night); font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
}
.btn.primary { background: var(--flame); border-color: var(--flame); }
.fields { display: grid; gap: 16px; min-width: 0; }
.fields.compact { padding: 0 16px 16px; }
label, legend { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
input:not([type=radio]), select {
  min-width: 0; width: 100%; max-width: 100%; border: 1px solid var(--line-strong); border-radius: 12px;
  padding: 10px 14px; min-height: 48px; background: white; color: var(--night); font-size: 16px; font-weight: 400;
}
fieldset { padding: 0; border: 0; min-inline-size: 0; }
.error { color: var(--error); font-size: 14px; font-weight: 700; }
[aria-invalid=true] { border-color: var(--error) !important; }
.option summary { padding: 16px; cursor: pointer; font-size: 14px; font-weight: 700; }
summary > span { min-width: 0; }
.more { margin-top: 8px; }
.facts { margin: 0; }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 5px 0; }
.facts > div + div { border-top: 1px solid var(--line); }
.facts dd { font-weight: 700; text-align: right; }
.summary, .empty, .preview { padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; }
.summary > strong { font-size: 34px; line-height: 1.05; }
.content-grid, .access-grid { display: grid; gap: 24px; align-items: start; }
.content-grid > *, .access-grid > *, .task-grid > *, .home-grid > * { min-width: 0; }
.content-grid h2 { margin-bottom: 8px; }
.phone-attribution { margin-top: 20px; }
.phone-attribution .attribution, .welcome-sign .attribution { color: var(--muted); }

/* Barattoli di vetro e cruscotto */
.jar, .dot { --glass: #FDF1E4; --liquid: #E9954A; --edge: #9D5816; }
[data-color="savings"] { --glass: #E8F5F3; --liquid: #63B5AB; --edge: #2F6E67; }
:is([data-color="learning"], [data-color="business"]) { --glass: #ECF0FA; --liquid: #8498D8; --edge: #3F54A0; }
:is([data-color="freedom"], [data-color="health"]) { --glass: #E7F4EC; --liquid: #63B08A; --edge: #2A6B4B; }
[data-color="fun"] { --glass: #FCEDF1; --liquid: #E696AC; --edge: #A04462; }
[data-color="giving"] { --glass: #F2EDFA; --liquid: #AC91D8; --edge: #6747A0; }
.jar { display: block; flex: none; overflow: visible; }
.jar--s { width: 30px; height: 38px; }
.jar--m { width: 46px; height: 58px; }
.jar--l { width: 72px; height: 91px; }
.glass { fill: var(--glass); }
.glass-edge { fill: none; stroke: var(--edge); stroke-width: 2; }
.lid { fill: var(--edge); }
.shine { fill: none; stroke: #fff9; stroke-width: 3; stroke-linecap: round; }
.liquid { transform: translateY(56px); transition: transform 900ms var(--ease); }
.wave { fill: var(--liquid); animation: wave 5.5s linear infinite; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--liquid); flex: none; }
.home-grid, .home-primary, .home-side { display: grid; gap: 24px; min-width: 0; }
.hero { position: relative; overflow: hidden; background: var(--night); color: var(--night-text); border-radius: 24px; padding: 24px; min-width: 0; }
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -90px; width: 240px; height: 240px;
  background: radial-gradient(closest-side, #e2862e38, #e2862e00); pointer-events: none;
}
.hero-main { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 16px; }
.hero-main > div { min-width: 0; }
.hero-label, .hero-sub { display: block; color: var(--night-muted); font-size: 14px; }
.hero-label { font-weight: 600; }
.hero-value { display: block; margin: 4px 0; font-size: clamp(26px, 10.4vw, 44px); font-weight: 800; line-height: 1.02; letter-spacing: -.055em; overflow-wrap: anywhere; }
.hero-sub b { color: var(--night-text); }
.hero-total { margin-top: 8px; }
.hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1;
  width: 100%; margin-top: 16px; padding: 12px 0 0; border: 0; border-top: 1px solid var(--night-line);
  background: none; color: var(--night-text); text-align: left; font-size: 14px;
}
.hero-foot small { display: block; color: var(--night-muted); font-size: 12px; }
.hero-foot > b { color: var(--flame); }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 16px 8px 10px; }
.shelf .jar-cell {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 4px;
  border: 0; background: transparent; text-align: center; min-width: 0;
}
.shelf .jar { position: relative; z-index: 1; }
.ledge { align-self: stretch; height: 5px; margin: -5px -4px 2px; background: linear-gradient(#e7ebf1, #d5dbe5); border-radius: 1px; }
.shelf b { min-height: 2.5em; color: var(--muted); font-size: 12px; line-height: 1.25; overflow-wrap: anywhere; }
.shelf span { font-size: 14px; font-weight: 800; margin-top: -4px; }
.accounts summary, .move-options summary { display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: 60px; cursor: pointer; list-style: none; }
:is(.accounts, .move-options) summary::-webkit-details-marker { display: none; }
:is(.accounts, .move-options) summary > .icon { color: var(--control); width: 16px; height: 16px; margin-left: auto; }
:is(.accounts, .move-options)[open] summary > .icon { transform: rotate(90deg); }
.accounts summary small, .move-options summary small { display: block; font-weight: 400; font-size: 14px; color: var(--muted); }
.accounts summary small.warning { color: var(--warn); }
.jar-list > li { padding: 0; }
.jar-row { width: 100%; border: 0; background: transparent; text-align: left; display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.jar-row > div { flex: 1; min-width: 0; }
.jar-detail-card { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 24px; }
.jar-detail-card > strong { font-size: 36px; line-height: 1.1; }
:is(.jar-list, .jar-detail-card) progress { display: block; width: 100%; accent-color: var(--flame-ink); height: 6px; margin-top: 4px; }

/* Benvenuto, accesso e compiti */
.welcome { display: flex; flex-direction: column; align-items: flex-start; min-height: calc(100dvh - 96px); padding-top: 32px; }
.flame { width: 64px; height: 82px; animation: flicker 3.2s ease-in-out infinite; transform-origin: 50% 90%; }
.welcome h1 { margin-top: 32px; font-size: 36px; line-height: 1.08; max-width: 12ch; }
.welcome p { color: var(--muted); margin-top: 12px; max-width: 37ch; }
.welcome-actions { display: grid; gap: 8px; width: 100%; padding-top: 32px; margin-top: auto; }
.welcome-sign { justify-self: center; margin-top: 8px; }
.access-form, .info-row { padding: 16px; }
.access-form .option { border: 1px solid var(--line); border-radius: 12px; }
.access-info h2 { margin-bottom: 8px; }
.access-info .quiet { margin-top: 8px; }
.info-row { display: flex; align-items: center; gap: 12px; }
.info-row p { color: var(--muted); font-size: 14px; }
.task-grid { display: grid; gap: 16px; align-items: start; min-width: 0; }
.task-head { display: flex; align-items: center; gap: 12px; margin-bottom: -4px; }
.task-head .connection { margin-left: auto; flex: none; }
.close { display: grid; place-items: center; min-width: 34px; height: 44px; margin-left: -4px; border: 0; background: transparent; }
.task-switch { display: flex; gap: 4px; padding: 4px; margin-top: -12px; border-radius: 12px; background: #E9EDF3; }
.task-switch button { flex: 1; min-height: 38px; padding: 0 6px; border-radius: 9px; color: var(--muted); }
.task-switch button[aria-pressed="true"] { color: var(--night); background: var(--surface); box-shadow: 0 1px 3px #0f172a1a; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 16px 0 8px; border-bottom: 2px solid var(--line); }
.amount:focus-within { border-color: var(--flame); }
.amount input:not([type=radio]) {
  width: auto; field-sizing: content; min-width: 1.5ch; max-width: 78%; min-height: 0; border: 0; border-radius: 0; background: transparent;
  text-align: center; font-size: 52px; font-weight: 800; letter-spacing: -.05em; line-height: 1.05; padding: 0; caret-color: var(--flame);
}
.amount input:focus { outline: 0; }
.amount input::placeholder { color: #C3CAD6; }
.amount b { font-size: 20px; font-weight: 800; color: var(--muted); }
@supports not (field-sizing: content) { .amount input:not([type=radio]) { width: 6ch; } }
.after-line { min-height: 21px; margin-top: -10px; color: var(--muted); font-size: 14px; text-align: center; }
.after-line b { color: var(--night); }
.pick { position: relative; font-size: 14px; }
.pick-help { position: absolute; top: -24px; right: 0; font-size: 12px; color: var(--muted); font-weight: 600; }
.picks { position: relative; display: flex; gap: 8px; padding: 2px 0; overflow-x: auto; scrollbar-width: none; }
.picks.wrap { flex-wrap: wrap; }
.picks label { position: relative; flex: none; }
.picks input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.picks span, .mode-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 14px; border: 1px solid var(--line-strong);
  border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 700; white-space: nowrap;
}
.picks input:checked + span, .mode-chip { background: var(--night); color: var(--night-text); border-color: var(--night); }
.picks input:focus-visible + span { outline: 3px solid var(--flame-ink); outline-offset: -1px; }
.mode-chip { display: table; margin-top: 6px; }
.move-options summary { display: flex; }
.move-options summary small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 32ch; }
.task-form > .btn { margin-top: 8px; }
.preview { border-radius: 24px; }
.preview h2 { font-weight: 600; color: var(--muted); font-size: 14px; letter-spacing: -.02em; }
.preview [data-preview] { display: grid; gap: 8px; }
.expense-preview { text-align: center; }
.expense-preview .jar { justify-self: center; margin: 10px 0; }
.expense-preview strong, .income-value { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -.05em; overflow-wrap: anywhere; }
.expense-preview p { font-size: 14px; color: var(--muted); }
.preview-account { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left; padding-top: 12px; margin-top: 8px; border-top: 1px solid var(--line); }
.preview-account small { display: block; color: var(--muted); font-size: 12px; }
.preview-account b { font-size: 14px; }
.income-facts, .income-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.income-facts > div { padding: 10px 8px; border-top: 1px solid var(--line); }
.income-facts > div:nth-child(even) { border-left: 1px solid var(--line); }
.income-facts dt { font-size: 12px; color: var(--muted); font-weight: 600; }
.income-facts dd { font-weight: 800; }
.income-legend { list-style: none; padding: 0; gap: 4px 12px; }
.income-legend li { display: flex; align-items: baseline; gap: 6px; min-width: 0; font-size: 14px; }
.income-legend li span, .income-legend li b { overflow-wrap: anywhere; }
.income-legend li b { margin-left: auto; text-align: right; }
.done { display: flex; flex-direction: column; align-items: center; padding: 48px 16px 24px; text-align: center; }
.done-mark {
  width: 76px; height: 76px; border-radius: 50%; background: var(--good-tint); color: var(--good);
  display: grid; place-items: center; animation: pop 420ms var(--ease);
}
.done-mark .icon { width: 38px; height: 38px; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 420ms 160ms var(--ease) forwards; }
.done h1 { margin-top: 20px; }
.done p { color: var(--muted); margin-top: 6px; }
.done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.status:not(:empty) {
  position: fixed; z-index: 4; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  max-width: calc(100% - 24px); padding: 8px 12px; border-radius: 999px; color: white; background: var(--night); font-size: 14px;
}
.status:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 767px) {
  .task-grid .preview { background: transparent; border: 0; padding: 0; }
  .access-grid { gap: 4px; }
  .jar-grid:not(.has-jar) .jar-detail, .jar-grid.has-jar .jar-menu { display: none; }
}
@media (min-width: 768px) {
  .top, .bottom, .only-phone, .phone-attribution, .welcome-sign { display: none !important; }
  .only-desk:not([hidden]) { display: block !important; }
  #app:has(.side) { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; }
  .side {
    position: sticky; top: 0; min-height: 100dvh; display: flex; flex-direction: column;
    background: var(--night); color: white; padding: 24px 12px 16px;
  }
  .side > .brand { margin: 0 8px 24px; }
  .side .brand img { width: 26px; height: 33px; }
  .side .new { margin: 16px 0; font-size: 14px; }
  .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 4px 12px; width: 100%; min-height: 46px; font-size: 14px; }
  .nav-link[aria-current] { background: var(--night-2); }
  .side-foot { margin-top: auto; }
  .side-foot .attribution { padding: 12px 8px 0; }
  .who { display: flex; align-items: center; gap: 12px; padding: 12px 8px; border-top: 1px solid var(--night-line); font-size: 14px; }
  .who small { display: block; font-size: 12px; color: var(--night-muted); }
  .page, .page.no-nav { padding: 32px 32px 48px; }
  .heading { margin: 0 0 24px; }
  h1 { font-size: 34px; }
  .welcome { padding-top: 24px; max-width: 560px; min-height: auto; }
  .home-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .hero { padding: 32px; }
  .hero::after { width: 420px; height: 420px; right: -80px; bottom: -200px; }
  .hero-value { font-size: clamp(34px, 4.15vw, 56px); }
  .jar--l { width: 112px; height: 140px; }
  .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 24px 12px 12px; }
  .shelf .jar-cell.only-desk { display: flex !important; }
  .shelf .jar--m { width: 62px; height: 78px; }
  .shelf b { font-size: 14px; }
  .shelf span { font-size: 16px; }
  .home-side .block + .block { margin-top: 0; }
  .content-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .access-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .task-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 24px; max-width: 1040px; }
  .task-grid > .preview { padding: 32px; }
  .task-grid > .preview.only-desk { display: grid !important; }
  .picks { flex-wrap: wrap; }
  .amount input:not([type=radio]) { font-size: 64px; }
  .confirmation .done { grid-column: 1; }
  .status:not(:empty) { bottom: 24px; left: calc(50% + 120px); }
}
@media (min-width: 768px) and (max-width: 1099px) {
  .home-grid, .task-grid, .content-grid, .access-grid { grid-template-columns: minmax(0, 1fr); }
  .page, .page.no-nav { padding: 24px; }
}
@media (max-width: 370px) {
  .bottom { grid-template-columns: repeat(2, minmax(0, 1fr)) 62px repeat(2, minmax(0, 1fr)); }
  .nav-link { font-size: 10px; }
  .hero { padding: 18px; }
  .hero-main { gap: 10px; }
  .hero .jar--l { width: 61px; height: 77px; }
  .pick-help { font-size: 11px; }
}
@keyframes wave { to { transform: translateX(-60px); } }
@keyframes pop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes flicker { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.03,.98) rotate(-1deg); } 70% { transform: scale(.99,1.02) rotate(1deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; transition-delay: 0ms !important; }
  .jar .wave, .flame { animation: none; }
}

/* Scelte V02 e selettore di periodo */
.choice-field { display: grid; gap: 6px; min-width: 0; font-size: 14px; font-weight: 700; }
.choice summary {
  min-height: 48px; color: var(--night); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 12px; list-style: none; cursor: pointer;
}
.choice summary { display: flex; padding: 0 14px; align-items: center; justify-content: space-between; gap: 12px; }
.choice summary::-webkit-details-marker { display: none; }
.choice summary .icon { color: var(--muted); }
.choice[open] summary .icon { transform: rotate(180deg); }
.choice-options { display: grid; gap: 6px; padding: 8px 0 0; }
.choice-options button {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; text-align: left;
}
.choice-options button .icon { margin-left: auto; visibility: hidden; }
.choice-options button[aria-pressed="true"] { color: var(--flame-ink); background: var(--ember); }
.choice-options button[aria-pressed="true"] .icon { visibility: visible; }
:is(.choice summary, .choice-options button):focus-visible,
.picks input:focus-visible + span { outline: 0; border-color: var(--flame-ink); }
.picks input:checked:focus-visible + span { border-color: var(--flame); }
.recovery-panel { max-width: 590px; }
.recovery-help { display: grid; gap: 4px; }
.recovery-help p:not(:first-child) { color: var(--muted); }
.recovery-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.recovery-code { display: block; overflow-wrap: anywhere; padding: 12px; border-radius: 12px; background: var(--bg); user-select: all; }
.confirm-key { display: flex; align-items: center; gap: 8px; }
.confirm-key input[type=checkbox] { width: 20px; height: 20px; min-height: auto; flex: none; accent-color: var(--flame-ink); }

.portal-top { background: var(--night); color: var(--night-text); padding: 14px clamp(16px, 5vw, 72px); }
.portal { display: grid; gap: 24px; max-width: 1100px; padding: 32px 16px; margin-inline: auto; }
.portal-intro { display: flex; align-items: center; gap: 16px; }
.portal-intro h1 { font-size: clamp(34px, 5vw, 56px); }
.portal-grid { display: grid; gap: 16px; }
.portal-card { display: grid; align-content: start; justify-items: start; gap: 12px; padding: 24px; }
.portal-card h2 { font-size: 24px; }
.portal-card p { color: var(--muted); }
.portal-card a { text-decoration: none; }
.portal .attribution { color: var(--muted); }
@media (min-width: 768px) {
  .portal { padding: 48px 32px; }
  .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .portal-card { grid-template-rows: 24px auto 1fr auto; padding: 32px; }
  .portal-card h2 { grid-row: 2; }
  .portal-card p { grid-row: 3; }
  .portal-card a { grid-row: 4; }
}
