/* Beaver design system. Look: Notion (flat page, warm greys, hairlines, small radii). Feel: iPhone (large titles,
   translucent bars, bottom sheets, 44pt targets, press feedback). Full spec: DESIGN-SYSTEM.md. Change tokens, not components. */

/* ============ 1. TOKENS ============ */
:root {
  /* colour: surfaces and text */
  --bg: #ffffff; --surface-2: #f7f6f3; --hover: rgba(55,53,47,.06); --press: rgba(55,53,47,.12);
  --text: #37352f; --muted: rgba(55,53,47,.65); --line: rgba(55,53,47,.12);
  --bar-bg: rgba(55,53,47,.09); --tag-bg: rgba(227,226,224,.6); --chrome: rgba(255,255,255,.82);
  /* colour: meaning. green = money in / good, red = money out / bad, amber = close to the limit */
  --primary: #37352f; --on-primary: #ffffff; --focus: #2383e2;
  --income: #2f8f5b; --expense: #d44c47; --warn: #cb912f; --warn-bg: #fbf3db;
  /* type scale (rem) */
  --fs-title: 2rem; --fs-h2: 1.125rem; --fs-body: 1rem; --fs-sub: .9375rem; --fs-meta: .8125rem; --fs-tab: .6875rem;
  --font: -apple-system, BlinkMacSystemFont, ui-sans-serif, "SF Pro Text", "Segoe UI", "Heebo", "Arimo", Helvetica, Arial, sans-serif;
  /* spacing scale: 4px grid */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --gap: 22px; --page-x: 20px; --page-max: 708px;
  /* shape */
  --radius: 6px; --radius-tag: 4px; --radius-sheet: 14px; --radius-pill: 99px;
  /* touch */
  --tap: 44px; --tabbar: 50px;
  /* motion */
  --ease: cubic-bezier(.32,.72,0,1); --t-fast: .12s; --t-med: .22s; --t-sheet: .36s;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #191919; --surface-2: #252525; --hover: rgba(255,255,255,.055); --press: rgba(255,255,255,.11); --text: rgba(255,255,255,.81); --muted: rgba(255,255,255,.5); --line: rgba(255,255,255,.13);
    --bar-bg: rgba(255,255,255,.1); --tag-bg: rgba(255,255,255,.1); --chrome: rgba(25,25,25,.8);
    --primary: #e9e9e7; --on-primary: #191919; --focus: #5aa7f0; --income: #4fb37f; --expense: #df5452; --warn: #ca984d; --warn-bg: #3a3221; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #191919; --surface-2: #252525; --hover: rgba(255,255,255,.055); --press: rgba(255,255,255,.11); --text: rgba(255,255,255,.81); --muted: rgba(255,255,255,.5); --line: rgba(255,255,255,.13);
  --bar-bg: rgba(255,255,255,.1); --tag-bg: rgba(255,255,255,.1); --chrome: rgba(25,25,25,.8);
  --primary: #e9e9e7; --on-primary: #191919; --focus: #5aa7f0; --income: #4fb37f; --expense: #df5452; --warn: #ca984d; --warn-bg: #3a3221; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

/* ============ 2. BASE ============ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior-y: none; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--fs-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-meta); color: var(--muted); font-weight: 500; }
button, input, select { font: inherit; color: inherit; }
button, .btn, .nav, .subnav, .top { -webkit-user-select: none; user-select: none; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.num { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); font-size: .875rem; }
.income { color: var(--income); } .expense { color: var(--expense); } .warn { color: var(--warn); }
.pct { font-size: var(--fs-meta); font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.ph { vertical-align: -0.12em; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--muted); padding: 28px var(--s2); }
.hello { font-size: var(--fs-h2); font-weight: 600; }

/* ============ 3. APP SHELL ============ */
/* navigation bar: translucent, compact title fades in once the large title scrolls away */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s1); min-height: var(--tap); padding: calc(var(--s1) + env(safe-area-inset-top)) var(--s2) var(--s1);
  background: var(--chrome); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color var(--t-med); font-size: .875rem; }
.scrolled .top { border-bottom-color: var(--line); }
.crumb { flex: 1; padding-inline-start: 2px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--text); font-weight: 600; }
.bar-title { position: absolute; inset-inline: 110px; bottom: var(--s1); height: var(--tap); display: grid; place-items: center; font-weight: 600; font-size: var(--fs-body); opacity: 0; transform: translateY(4px); transition: opacity var(--t-med), transform var(--t-med) var(--ease); pointer-events: none; }
.scrolled .bar-title { opacity: 1; transform: none; }
.logo { width: 28px; height: 28px; flex: none; mix-blend-mode: multiply; margin-inline-start: 6px; }
.logo.big { width: 96px; height: 96px; margin: 0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo { filter: invert(1); mix-blend-mode: screen; } }
:root[data-theme="dark"] .logo { filter: invert(1); mix-blend-mode: screen; }
.month { display: flex; align-items: center; font-weight: 500; }
.icon-btn { min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; border-radius: var(--radius); font-size: 1.25rem; cursor: pointer; color: var(--muted); transition: background var(--t-fast), opacity var(--t-fast); }
.bell { position: relative; }
.badge { position: absolute; top: 5px; inset-inline-end: 3px; min-width: 17px; height: 17px; border-radius: var(--radius-pill); background: var(--expense); color: #fff; font: 700 .6875rem/17px var(--font); text-align: center; padding: 0 4px; }

main { padding: var(--s2) var(--page-x) calc(var(--tabbar) + 46px + env(safe-area-inset-bottom)); max-width: var(--page-max); margin: 0 auto; display: grid; gap: var(--gap); }
/* large title */
.page-title { display: grid; gap: 6px; padding-top: var(--s2); }
.page-title .page-icon { font-size: 2.75rem; line-height: 1; color: var(--muted); }
.page-title h1 { font-size: var(--fs-title); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.subnav { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-top: -8px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { border: 0; background: transparent; min-height: var(--tap); padding: 0 10px; color: var(--muted); font-size: var(--fs-sub); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; transition: color var(--t-fast); }
.subnav button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--text); }

/* tab bar */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 5; display: flex; padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--line);
  background: var(--chrome); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
.nav button { flex: 1; min-height: var(--tabbar); border: 0; background: transparent; display: grid; place-items: center; align-content: center; gap: 1px; font-size: var(--fs-tab); color: var(--muted); cursor: pointer; transition: color var(--t-fast), transform var(--t-fast) var(--ease); }
.nav button span { font-size: 1.5rem; line-height: 1.1; }
.nav button[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav button:active { transform: scale(.92); }

/* ============ 4. COMPONENTS ============ */
/* block: flat section, hairline under its heading */
.card { display: grid; gap: 10px; }
.card > h2:first-child, .card > .row:first-child { padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow, .item .grow { flex: 1; min-width: 0; }
.big { font-size: 1.75rem; font-weight: 700; letter-spacing: -.01em; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: var(--s3); min-width: 0; }
.stat b { display: block; font-size: 1.05rem; font-weight: 600; }
.stat small.pct { display: block; margin-top: 2px; }

/* list rows */
.list { display: grid; gap: 0; }
.list > h2 { margin-bottom: var(--s1); }
.item { display: flex; align-items: center; gap: 10px; padding: var(--s2) 6px; margin-inline: -6px; border: 0; border-radius: var(--radius); background: transparent; width: calc(100% + 12px); text-align: start; min-height: var(--tap); transition: background var(--t-fast); }
button.item { cursor: pointer; }
.item > .ph:last-child { color: var(--muted); }
.emoji { width: 28px; font-size: 1.35rem; display: grid; place-items: center; flex: none; color: var(--muted); }
.ttl { display: block; }
b.ttl { font-weight: 600; }
.day { padding: 14px 0 var(--s1); font-size: var(--fs-meta); color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.tag { display: inline-block; background: var(--tag-bg); border-radius: var(--radius-tag); padding: 0 6px; font-size: var(--fs-meta); line-height: 1.55; color: var(--text); }
.tag.none { background: var(--warn-bg); }

/* tasks and shopping rows */
.task { cursor: default; }
button.check { border: 0; background: transparent; min-width: var(--tap); min-height: var(--tap); font-size: 1.5rem; color: var(--muted); cursor: pointer; margin: -6px 0; margin-inline-start: -10px; border-radius: var(--radius); transition: transform var(--t-fast) var(--ease), color var(--t-fast); }
button.check:active { transform: scale(.82); }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.task.done button.check { color: var(--income); }
.rowbtn { border: 0; background: transparent; text-align: start; display: grid; gap: 2px; cursor: pointer; padding: 0; min-height: var(--tap); align-content: center; }

/* progress */
.bar { height: 6px; background: var(--bar-bg); border-radius: var(--radius-pill); overflow: hidden; margin-top: var(--s1); }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: var(--radius-pill); }
.bar.over i { background: var(--expense); }

/* callout */
.alert { background: var(--warn-bg); color: var(--text); border-radius: var(--radius); padding: 14px; border: 0; width: 100%; text-align: start; cursor: pointer; min-height: var(--tap); display: flex; gap: 10px; transition: opacity var(--t-fast); }
.alert .ph { font-size: 1.25rem; color: var(--warn); flex: none; margin-top: 2px; }

/* charts */
.trend { display: flex; align-items: flex-end; gap: var(--s2); height: 110px; }
.trend div { flex: 1; display: grid; gap: var(--s1); justify-items: center; align-content: end; height: 100%; }
.trend .bars { display: flex; align-items: flex-end; gap: 3px; height: 84px; width: 100%; justify-content: center; }
.trend .bars i { width: 38%; max-width: 14px; border-radius: 3px 3px 0 0; min-height: 2px; }
.trend small { font-size: .7rem; color: var(--muted); }
.bg-income { background: var(--income); } .bg-expense { background: var(--expense); }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; }
svg.chart { width: 100%; height: auto; display: block; }

/* buttons */
.btn { min-height: var(--tap); padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; cursor: pointer; font-weight: 500; font-size: var(--fs-sub); transition: background var(--t-fast), opacity var(--t-fast), transform var(--t-fast) var(--ease); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; font-weight: 600; }
.btn.danger { color: var(--expense); }
.btn.small { min-height: 36px; padding: 0 10px; font-size: .875rem; }
.btn.ghost { border: 0; color: var(--muted); justify-self: start; padding-inline: 6px; margin-inline-start: -6px; }
.btn[aria-pressed="true"] { background: var(--hover); border-color: var(--text); }
.btn:disabled { opacity: .5; }
a.btn { display: inline-grid; place-items: center; text-decoration: none; color: inherit; }
.btn.big { min-height: 48px; font-size: var(--fs-body); }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.fab { position: fixed; inset-inline-end: var(--s4); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); font-size: 1.5rem; display: grid; place-items: center; box-shadow: 0 2px 10px rgba(15,15,15,.22); cursor: pointer; z-index: 6; transition: transform var(--t-fast) var(--ease); }

/* press and hover feedback (hover only where a real pointer exists) */
@media (hover: hover) { button.item:hover, .icon-btn:hover, .btn:hover, button.check:hover { background: var(--hover); } .btn.primary:hover { background: var(--primary); filter: brightness(.93); } }
button.item:active, .icon-btn:active { background: var(--press); }
.btn:active, .alert:active { opacity: .6; }
.fab:active { transform: scale(.92); }

/* ============ 5. SHEETS AND FORMS ============ */
dialog { border: 0; padding: 0; width: 100%; max-width: var(--page-max); margin: auto auto 0; border-radius: var(--radius-sheet) var(--radius-sheet) 0 0; background: var(--bg); color: var(--text); max-height: 92dvh; box-shadow: 0 0 0 1px var(--line); overscroll-behavior: contain; }
dialog::backdrop { background: rgba(15,15,15,.45); }
.grabber { width: 36px; height: 5px; border-radius: var(--radius-pill); background: var(--bar-bg); margin: var(--s2) auto 0; }
.sheet { padding: var(--s3) var(--page-x) calc(var(--s5) + env(safe-area-inset-bottom)); display: grid; gap: 14px; }
.sheet > h2 { font-size: 1.375rem; font-weight: 700; }
form { display: grid; gap: var(--s3); }
/* the save / cancel row stays reachable while a long form scrolls */
.sheet form > .actions:last-child { position: sticky; bottom: 0; background: var(--bg); padding: var(--s3) 0 calc(var(--s3) + env(safe-area-inset-bottom)); margin-bottom: calc(-1 * (var(--s5) + env(safe-area-inset-bottom))); border-top: 1px solid var(--line); }
.sheet .actions .btn.primary { flex: 1; }
label { display: grid; gap: var(--s1); font-size: var(--fs-meta); color: var(--muted); }
input:not([type=radio]):not([type=checkbox]), select { min-height: var(--tap); padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--text); width: 100%; font-size: 1rem; }
input::placeholder { color: var(--muted); opacity: .7; }
input:not([type=radio]):not([type=checkbox]):focus, select:focus { outline: 2px solid var(--focus); outline-offset: -1px; background: var(--bg); }
input.amount:not([type=radio]):not([type=checkbox]) { font-size: 2rem; font-weight: 700; text-align: center; direction: ltr; min-height: 60px; background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
input.amount:not([type=radio]):not([type=checkbox]):focus { outline: 0; border-bottom-color: var(--text); background: transparent; }
/* segmented control */
.seg { border: 0; padding: 3px; margin: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; background: var(--surface-2); border-radius: var(--radius); }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: grid; place-items: center; min-height: 38px; border-radius: var(--radius-tag); color: var(--muted); font-weight: 500; font-size: var(--fs-sub); cursor: pointer; transition: background var(--t-med), color var(--t-med); }
.seg input:checked + span { background: var(--bg); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15,15,15,.08); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
/* choice chips: pick one by tapping, no dropdown */
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips legend { font-size: var(--fs-meta); color: var(--muted); padding: 0 0 var(--s1); }
.chips label { display: block; }
.chips input { position: absolute; opacity: 0; }
.chips label > span { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--text); font-size: var(--fs-sub); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.chips input:checked + span { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.chips input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
label.check { display: flex; align-items: center; gap: var(--s2); color: var(--text); font-size: var(--fs-sub); min-height: var(--tap); }
label.check input { width: 18px; height: 18px; accent-color: var(--primary); }
/* icon picker */
.icons { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: var(--s1); }
.icons legend { font-size: var(--fs-meta); color: var(--muted); padding: 0 0 var(--s1); }
.icons label { display: block; }
.icons input { position: absolute; opacity: 0; }
.icons label > span { display: grid; place-items: center; height: var(--tap); border-radius: var(--radius); font-size: 1.35rem; color: var(--muted); cursor: pointer; }
.icons input:checked + span { background: var(--hover); color: var(--text); box-shadow: 0 0 0 1.5px var(--text) inset; }
.icons input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
/* inline add row */
.addrow { display: flex; gap: var(--s2); }
.addrow input { flex: 1; min-width: 0; }
.addrow input.qty { flex: 0 0 84px; }
.addrow .btn { flex: none; min-width: var(--tap); padding: 0; font-size: 1.2rem; }

/* auth screens */
.auth { max-width: 420px; margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) var(--page-x) 48px; display: grid; gap: var(--s5); }
.auth h1 { font-size: 1.75rem; font-weight: 700; }
.auth .card { background: var(--surface-2); padding: var(--s4); border-radius: var(--radius); }
.auth .card > h2:first-child { border: 0; padding: 0; }
.auth .card input { background: var(--bg) !important; }

/* toast */
#toast { position: fixed; inset-inline: var(--s4); bottom: calc(var(--tabbar) + 84px + env(safe-area-inset-bottom)); z-index: 20; display: none; background: #0f0f0f; color: #fff; padding: 10px 14px; border-radius: var(--radius-pill); text-align: center; max-width: 480px; margin: 0 auto; font-size: var(--fs-sub); }
#toast.show { display: block; }

/* ============ 6. MOTION ============ */
@media (prefers-reduced-motion: no-preference) {
  .bar i { transition: width .3s var(--ease); }
  main { animation: view-in var(--t-med) var(--ease); }
  dialog[open] { animation: sheet-up var(--t-sheet) var(--ease); }
  dialog[open]::backdrop { animation: fade-in var(--t-med) ease-out; }
  #toast.show { animation: view-in var(--t-med) var(--ease); }
}
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ============ 7. DESKTOP (900px and up) ============ */
.nav-extra, .nav-gap { display: none; }
.btn.wide { width: 100%; }
@media (min-width: 900px) {
  :root { --side: 240px; --page-x: 48px; }
  #app { padding-inline-start: var(--side); }
  /* the tab bar becomes a Notion-style sidebar */
  .nav { inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0; width: var(--side); flex-direction: column; align-items: stretch; gap: 2px; padding: 60px var(--s2) var(--s3);
    border-top: 0; border-inline-end: 1px solid var(--line); background: var(--surface-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .nav button, .nav .nav-extra { flex: none; display: flex; flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: var(--radius); font-size: var(--fs-sub); text-align: start; }
  .nav button span { font-size: 1.2rem; line-height: 1; display: grid; }
  .nav button[aria-current="page"] { background: var(--hover); }
  .nav button:hover { background: var(--hover); }
  .nav button:active { transform: none; background: var(--press); }
  .nav .nav-gap { display: block; flex: 1; }
  /* brand sits at the top of the sidebar; the bar keeps the month switcher and the actions */
  .top { padding-inline: var(--s4); min-height: 52px; }
  .top .logo { position: fixed; top: 14px; inset-inline-start: 18px; margin: 0; z-index: 6; }
  .top .crumb { position: fixed; top: 16px; inset-inline-start: 54px; z-index: 6; font-size: var(--fs-body); flex: none; }
  .top .month { margin-inline-start: auto; }
  .top .bell { margin-inline-start: auto; }
  .top .month + .bell { margin-inline-start: 0; }
  .bar-title { inset-inline: 160px; }
  main { padding-top: var(--s5); padding-bottom: 64px; }
  .page-title h1 { font-size: 2.5rem; }
  .stats { gap: var(--s3); }
  .stat { padding: var(--s4); }
  .stat b { font-size: 1.35rem; }
  .fab { inset-inline-end: 32px; bottom: 32px; }
  #toast { bottom: 32px; inset-inline-start: calc(var(--side) + var(--s4)); }
  /* sheets become centred dialogs */
  dialog { margin: auto; max-width: 520px; max-height: 86dvh; border-radius: 12px; box-shadow: 0 0 0 1px var(--line), 0 16px 48px rgba(15,15,15,.2); }
  .grabber { display: none; }
  .sheet { padding: var(--s6); }
  .sheet form > .actions:last-child { margin-bottom: calc(-1 * var(--s6)); padding-bottom: var(--s4); }
  .auth { padding-top: 96px; }
}
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: dialog-in var(--t-med) var(--ease); }
}
@keyframes dialog-in { from { opacity: 0; transform: scale(.97); } }
@media (min-width: 900px) { #app:has(.auth) { padding-inline-start: 0; } }

/* ============ 8. LOGIN (Notion-style: logo, two-line headline, one field, one button, providers below) ============ */
.auth:not(:has(.card)) { max-width: 380px; padding-top: calc(72px + env(safe-area-inset-top)); gap: var(--s6); }
.auth:not(:has(.card)) .logo.big { width: 72px; height: 72px; justify-self: center; }
.auth:not(:has(.card)) h1 { text-align: center; font-size: 1.5rem; line-height: 1.3; font-weight: 700; }
.auth h1 span { display: block; color: var(--muted); }
.auth form { gap: var(--s4); }
.auth:not(:has(.card)) input:not([type=hidden]) { min-height: 48px; background: var(--bg); }
.or { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: var(--fs-sub); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tile { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 500; transition: background var(--t-fast); }
.tile svg { width: 20px; height: 20px; flex: none; }
.tile:active { background: var(--press); }
@media (hover: hover) { .tile:hover { background: var(--hover); } }
.fine { text-align: center; font-size: var(--fs-meta); }
.actions.center { justify-content: center; gap: var(--s4); }
.linkbtn { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: var(--tap); font-size: var(--fs-sub); }
input.code:not([type=radio]):not([type=checkbox]) { text-align: center; letter-spacing: .4em; font-size: 1.5rem; font-weight: 600; direction: ltr; }
