/* ============================================================
   RESERVD APP STYLES — Phase 6 "Daylight"
   Base elements, buttons, inputs, sheets/drawers and the Settings page.
   Same DOM and class names as before; tokens in css/tokens.css.
   ============================================================ */
*{box-sizing:border-box}
html,body{margin:0; padding:0}
html{-webkit-text-size-adjust:100%; text-size-adjust:100%}
body{
  background:var(--bg); color:var(--ink);
  font-family:var(--font-sans);
  font-size:var(--fs-body); line-height:1.55;
  -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
}
:focus{outline:none}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
button, a, summary, [role=button]{-webkit-tap-highlight-color:transparent}
.tnum{font-variant-numeric:tabular-nums}
.mono{font-family:var(--font-mono); letter-spacing:.01em}
::selection{background:var(--accent-soft); color:var(--ink)}

/* motion: restrained everywhere, and none at all when asked */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{transition-duration:0s !important; animation-duration:0s !important; animation-iteration-count:1 !important; scroll-behavior:auto !important}
}

.wrap{max-width:520px; margin:0 auto; padding:calc(16px + env(safe-area-inset-top)) 16px 100px}
.topbar{display:flex; align-items:center; justify-content:space-between; padding:8px 2px 16px}
.brand{display:flex; flex-direction:column}
.brand b{font-size:17px; font-weight:600; letter-spacing:-.01em}
.brand span{font-size:var(--fs-xs); color:var(--ink-muted)}

.iconbtn{
  background:var(--surface); border:1px solid var(--line-strong); color:var(--ink-muted);
  width:40px; height:40px; border-radius:var(--r-sm);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
  transition:background-color var(--t-fast) ease, color var(--t-fast) ease, border-color var(--t-fast) ease;
}
.iconbtn:hover{color:var(--ink); background:var(--surface-2)}
.iconbtn:active{transform:translateY(1px)}

.card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:22px; margin-bottom:14px; box-shadow:var(--shadow-sm);
}

.hero{text-align:center; padding:26px 16px 18px}
.hero .label{font-size:var(--fs-sm); color:var(--ink-muted); font-weight:500}
.hero .amount{font-family:var(--font-sans); font-size:48px; font-weight:600; letter-spacing:-.03em; margin:6px 0 4px; line-height:1}
.hero .sub{font-size:var(--fs-sm); color:var(--ink-muted); max-width:340px; margin:0 auto}

.banner{margin-top:14px; border-radius:var(--r-md); padding:12px 16px; font-weight:600; font-size:var(--fs-sm); text-align:center}
.banner.danger{background:var(--danger-soft); color:var(--danger)}
.banner.warn{background:var(--warn-soft); color:var(--warn)}
.banner.good{background:var(--good-soft); color:var(--good)}

.row{display:flex; align-items:center; justify-content:space-between; padding:12px 0; gap:12px}
.row + .row{border-top:1px solid var(--line)}
.row .l{font-size:var(--fs-sm); color:var(--ink-muted); font-weight:500}
.row .l small{display:block; color:var(--ink-faint); font-size:var(--fs-xs); font-weight:400; margin-top:2px}
.row .v{font-size:var(--fs-body); font-weight:600; color:var(--ink); white-space:nowrap; font-variant-numeric:tabular-nums}

.section-title{display:flex; align-items:center; justify-content:space-between; margin-bottom:4px}
.section-title h3{font-size:var(--fs-h2); margin:0; color:var(--ink); font-weight:600; letter-spacing:-.01em}

.tag{display:inline-flex; align-items:center; gap:5px; font-size:var(--fs-label); font-weight:600; padding:3px 9px; border-radius:99px}
.tag.xero{background:var(--accent-soft); color:var(--accent)}
.tag.manual{background:var(--warn-soft); color:var(--warn)}
.tag.estimate{background:var(--warn-soft); color:var(--warn)}
.tag .dot{width:5px; height:5px; border-radius:50%; background:currentColor}

details{margin-top:6px}
summary{list-style:none; cursor:pointer; font-size:var(--fs-sm); color:var(--accent); font-weight:600; display:flex; align-items:center; gap:5px}
summary::-webkit-details-marker{display:none}
summary .chev{transition:transform .16s ease}
details[open] summary .chev{transform:rotate(180deg)}
.explain{font-size:var(--fs-sm); color:var(--ink-muted); line-height:1.6; padding:8px 0 2px}

.total-row .l{font-weight:600; color:var(--ink)}
.total-row{padding-top:12px; margin-top:6px; border-top:1px solid var(--line-strong)}

.action-item{display:flex; justify-content:space-between; align-items:center; padding:10px 0; font-size:var(--fs-sm)}
.action-item + .action-item{border-top:1px solid var(--line)}
.action-item .v{font-weight:600; font-variant-numeric:tabular-nums}

.fab-row{position:fixed; left:0; right:0; bottom:0; padding:14px 16px calc(14px + env(safe-area-inset-bottom)); background:linear-gradient(to top, var(--bg) 65%, transparent); display:flex; justify-content:center}
.fab{
  background:var(--accent-strong); color:var(--accent-ink); border:none; font-weight:600; font-size:var(--fs-body);
  padding:13px 22px; border-radius:var(--r-md); box-shadow:var(--shadow-md); cursor:pointer;
  max-width:520px; width:100%; display:flex; align-items:center; justify-content:center; gap:8px;
  font-family:var(--font-sans);
}
.fab:hover{background:var(--accent-hover)}

/* ============================================================
   DRAWERS / SHEETS — kept in the layout (never display:none) so they can
   transition; visibility flips at the end of the close transition so a
   hidden sheet is never focusable. Phone: native bottom sheet with a grab
   handle. Desktop: right-hand panel (css/moneyin.css .side).
   ============================================================ */
.sheet-backdrop{
  position:fixed; inset:0; background:transparent;
  display:flex; align-items:flex-end; justify-content:center; z-index:50;
  opacity:0; visibility:hidden; pointer-events:none;
  transition:opacity var(--t-med) ease, background-color var(--t-med) ease, visibility 0s linear var(--t-med);
}
.sheet-backdrop.open{
  background:var(--scrim); opacity:1; visibility:visible; pointer-events:auto;
  transition:opacity var(--t-med) ease, background-color var(--t-med) ease, visibility 0s linear 0s;
}
.sheet{
  position:relative;
  background:var(--surface); width:100%; max-width:560px; border-radius:var(--r-xl) var(--r-xl) 0 0;
  padding:0 22px calc(24px + env(safe-area-inset-bottom)); max-height:92vh; overflow-y:auto; overscroll-behavior:contain;
  box-shadow:var(--shadow-lg);
  transform:translateY(28px); transition:transform .26s var(--ease);
}
.sheet-backdrop.open .sheet{transform:translateY(0)}
.sheet h2{margin:0 48px 0 0; font-size:20px; font-weight:600; letter-spacing:-.02em; line-height:1.3}
.sheet .close{
  float:right; background:var(--surface-2); border:none; border-radius:50%;
  width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  color:var(--ink-muted); cursor:pointer; font-size:14px;
  transition:background-color var(--t-fast) ease, color var(--t-fast) ease;
}
.sheet .close:hover{background:var(--surface-3); color:var(--ink)}
.sheet .close:focus-visible{outline:none; box-shadow:var(--focus-ring)}

/* Sticky drawer header — .sheet-head groups the existing .close + h2 pair
   so they pin to the top of a long scrolling sheet. */
.sheet > .close:first-child, .sheet > h2:first-child{margin-top:22px}
.sheet-head{
  position:sticky; top:0; z-index:3; background:var(--surface);
  margin:0 -22px; padding:22px 22px 14px; border-bottom:1px solid var(--line);
}
.sheet-head .close{margin-top:-4px}
.sheet-head h2{margin-bottom:0}
.sheet-head + *{margin-top:18px}
@media (max-width:899px){
  /* grab handle — a phone bottom sheet affordance */
  .sheet-head::before{content:""; position:absolute; top:8px; left:50%; width:40px; height:4px; margin-left:-20px; border-radius:2px; background:var(--line-strong)}
  .sheet-head{padding-top:26px}
}

/* legacy settings sheet eyebrows (kept for any remaining use) */
.settings-h{
  display:flex; align-items:center; gap:8px;
  font-size:var(--fs-body); color:var(--ink); font-weight:600;
  margin:28px 0 2px; padding-top:20px; border-top:1px solid var(--line);
}
.settings-h:first-of-type{margin-top:18px; padding-top:0; border-top:none}
.settings-desc{font-size:var(--fs-xs); color:var(--ink-faint); line-height:1.5; margin:2px 0 14px}

/* ============================================================
   FORMS
   ============================================================ */
label{display:block; font-size:var(--fs-sm); font-weight:500; color:var(--ink); margin:16px 0 7px}
input[type=number], input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea{
  width:100%; min-height:var(--touch); padding:11px 14px; border-radius:var(--r-sm); border:1px solid var(--line-strong);
  background:var(--surface); color:var(--ink); font-size:var(--fs-body); font-family:var(--font-sans);
  box-shadow:0 1px 1px rgba(15,23,42,.02);
  transition:border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}
/* phones: iOS zooms the page into any field under 16px — keep text fields at 16px on touch screens */
@media (pointer:coarse){ input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]):not([type=file]), select, textarea{font-size:16px !important} }
input::placeholder, textarea::placeholder{color:#6B7788}
input[type=number]:hover, input[type=text]:hover, input[type=email]:hover, input[type=password]:hover, input[type=date]:hover, input[type=search]:hover, select:hover, textarea:hover{border-color:#B9C5D3}
input:focus-visible, select:focus-visible, textarea:focus-visible{outline:none; border-color:var(--accent); box-shadow:0 0 0 3px rgba(54,102,142,.18)}
input[readonly]{color:var(--ink-muted); background:var(--surface-2)}
select{appearance:none; -webkit-appearance:none; padding-right:40px; cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 14px center}
input[type=checkbox]{accent-color:var(--accent-strong); width:18px; height:18px; cursor:pointer; flex-shrink:0; margin:0}
.inline{display:flex; gap:12px; align-items:flex-end}   /* paired inputs share a baseline even when one label wraps */
.inline > *{flex:1; min-width:0}
@media (max-width:480px){
  /* narrow phones: paired fields stack so a wrapping label never leaves its input floating */
  .inline{flex-direction:column; gap:0}
}
.checkline{display:flex; align-items:flex-start; gap:10px; margin-top:14px; font-size:var(--fs-sm); color:var(--ink-muted); line-height:1.45}
.checkline input{margin-top:1px}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn{
  font-family:var(--font-sans); background:var(--accent-strong); color:var(--accent-ink); border:1px solid transparent; min-height:var(--touch);
  font-weight:600; padding:11px 20px; border-radius:var(--r-sm); width:100%; margin-top:18px; cursor:pointer;
  font-size:var(--fs-body); letter-spacing:-.005em; line-height:1.25;
  box-shadow:0 1px 2px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.08);
  transition:transform .1s ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease, border-color var(--t-fast) ease, opacity var(--t-fast) ease;
}
.btn:hover{background:var(--accent-hover)}
.btn:active{transform:translateY(1px)}
.btn:focus-visible{outline:none; box-shadow:var(--focus-ring)}
.btn:disabled{opacity:.45; cursor:default; box-shadow:none; transform:none}
.btn.secondary{background:var(--surface); border:1px solid var(--line-strong); color:var(--ink); box-shadow:0 1px 2px rgba(15,23,42,.04)}
.btn.secondary:hover{background:var(--surface-2); border-color:#B9C5D3}
.btn.secondary:disabled:hover{background:var(--surface)}
.btn-text{background:none; border:none; color:var(--accent); font:inherit; font-size:var(--fs-sm); font-weight:600; cursor:pointer; padding:10px 4px; min-height:var(--touch); border-radius:var(--r-xs)}
.btn-text:hover{color:var(--accent-hover); text-decoration:underline; text-underline-offset:3px}
.btn-text:focus-visible{outline:none; box-shadow:var(--focus-ring)}

.commit-row{display:flex; gap:8px; align-items:center; margin-top:10px}
.commit-row input{flex:1}
.commit-del{background:none; border:none; color:var(--danger); cursor:pointer; padding:0; width:var(--touch); height:var(--touch); display:flex; align-items:center; justify-content:center; border-radius:var(--r-sm); flex-shrink:0}
.commit-del:hover{background:var(--danger-soft)}

.moneyin-breakdown .row .v.pos{color:var(--good)}
.footnote{font-size:var(--fs-xs); color:var(--ink-muted); text-align:center; margin-top:6px; line-height:1.55}
.inline-error{font-size:var(--fs-sm); color:var(--danger); margin-top:10px; display:none}
.inline-error.show{display:block}

/* ============================================================
   SETTINGS — practical, calm. Desktop: section nav + one section on a
   single white surface. Phones: an accordion (one row open).
   ============================================================ */
.settings-page{max-width:var(--content-max)}
.st-header{padding-bottom:22px}
.st-header h2{margin:0; font-size:var(--fs-h1); font-weight:600; letter-spacing:-.025em; line-height:1.2}
.st-header p{margin:6px 0 0; font-size:var(--fs-sm); color:var(--ink-muted)}
.st-layout{display:grid; grid-template-columns:220px minmax(0, 760px); gap:32px; align-items:start}
.st-nav{position:sticky; top:24px; display:flex; flex-direction:column; gap:2px}
.st-nav button{display:flex; align-items:center; gap:8px; width:100%; min-height:40px; padding:9px 12px; background:none; border:none; border-radius:var(--r-sm);
  font:inherit; font-size:var(--fs-sm); font-weight:500; color:var(--ink-muted); text-align:left; cursor:pointer; transition:background-color var(--t-fast) ease, color var(--t-fast) ease}
.st-nav button:hover{background:var(--surface-3); color:var(--ink)}
.st-nav button.on{background:var(--surface); color:var(--ink); font-weight:600; box-shadow:var(--shadow-sm), inset 0 0 0 1px var(--line)}
.st-nav button:focus-visible, .st-sec-h button:focus-visible{outline:none; box-shadow:var(--focus-ring)}
.st-nav button small{font-size:var(--fs-label); font-weight:500; color:var(--ink-faint)}
.st-nav-sep{height:1px; background:var(--line); margin:10px 4px}
.st-nav-adv{color:var(--ink-faint)}
.st-nav-adv > span:first-child small{display:block; margin-top:1px}
/* unsaved-changes dot */
.st-dirty{display:none; width:7px; height:7px; border-radius:50%; background:var(--attention); margin-left:auto; flex-shrink:0}
.is-dirty > .st-dirty{display:inline-block}

.st-sec{background:var(--surface); border-radius:var(--r-lg); border:1px solid var(--line); box-shadow:var(--shadow-sm)}
.st-sec-h{margin:0}
.st-sec-h button{display:flex; align-items:center; gap:10px; width:100%; background:none; border:none; font:inherit; color:var(--ink); text-align:left; cursor:pointer;
  font-size:20px; font-weight:600; letter-spacing:-.02em; padding:26px 32px 0; border-radius:var(--r-lg)}
.st-sec-h small{font-size:var(--fs-label); font-weight:500; color:var(--ink-faint); margin-left:6px; letter-spacing:0}
.st-sec-body{padding:4px 32px 28px}
.st-lead{margin:6px 0 10px; font-size:var(--fs-sm); color:var(--ink-muted); line-height:1.55; max-width:62ch}
.st-field{min-width:0}
.st-field > label, .st-label-row label{margin:18px 0 7px}
.st-label-row{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap}
.st-label-row label{flex:1 1 auto; min-width:0}
.st-help{font-size:var(--fs-xs); color:var(--ink-faint); line-height:1.5; margin-top:7px}
.st-why{margin-top:12px}
/* Settings → What work you want (js/work-prefs.js): simple first, "More options" on demand; every part says whether it's set */
.wp-opt{font-weight:400; font-size:var(--fs-xs); color:var(--ink-faint); margin-left:4px}
.wp-overview{list-style:none; margin:16px 0 4px; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:8px}
.wp-overview a{display:flex; flex-direction:column; gap:2px; height:100%; padding:10px 12px 10px 28px; position:relative; border-radius:var(--r-sm); border:1px solid var(--line); background:var(--surface); color:inherit; text-decoration:none; transition:border-color .15s}
.wp-overview a:hover{border-color:var(--line-strong, var(--line))}
.wp-overview a::before{content:''; position:absolute; left:11px; top:15px; width:8px; height:8px; border-radius:50%; box-shadow:inset 0 0 0 1.5px var(--ink-faint)}
.wp-overview li.is-set a::before{background:var(--safe, #1D7A4E); box-shadow:none}
.wp-overview b{font-size:var(--fs-xs); font-weight:600; color:var(--ink)}
.wp-overview span{font-size:var(--fs-xs); color:var(--ink-muted); line-height:1.4}
.wp-h{margin:26px 0 2px; font-size:var(--fs-xs); font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint)}
.wp-part{margin-top:12px; padding:18px 18px 16px; border:1px solid var(--line); border-radius:var(--r-md, 14px); background:var(--surface); scroll-margin-top:90px}
.wp-part-h{display:flex; align-items:center; justify-content:space-between; gap:10px}
.wp-part-h h4{margin:0; font-size:var(--fs-body); font-weight:600; color:var(--ink); letter-spacing:-.01em}
.wp-status{flex:none; padding:2px 9px; border-radius:999px; font-size:11.5px; font-weight:600; color:var(--ink-muted); background:var(--surface-2)}
.wp-status.is-set{color:var(--safe, #11683b); background:var(--safe-soft, #EAF6EF)}
.wp-lead{margin:6px 0 12px; font-size:var(--fs-xs); color:var(--ink-muted); line-height:1.55; max-width:68ch}
.wp-part .st-field + .st-field{margin-top:14px}
.wp-chips{display:flex; flex-wrap:wrap; gap:6px; list-style:none; margin:0 0 10px; padding:0}
.wp-chips li{padding:5px 11px; border-radius:999px; background:var(--surface-2); border:1px solid var(--line); font-size:var(--fs-xs); color:var(--ink)}
.wp-disc > summary, .wp-req-more > summary{cursor:pointer; font-size:var(--fs-xs); font-weight:600; color:var(--accent-strong); min-height:32px; display:inline-flex; align-items:center}
.wp-disc[open] > summary{margin-bottom:6px}
.wp-inline{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.wp-inline input{max-width:120px} .wp-inline select{flex:1 1 220px; max-width:340px}
.wp-empty{margin:0; padding:12px; border-radius:var(--r-sm); background:var(--surface-2); font-size:var(--fs-xs); color:var(--ink-muted)}
.wp-group + .wp-group{margin-top:14px}
.wp-group h5{margin:0 0 6px; font-size:var(--fs-xs); font-weight:600; color:var(--ink-muted)}
.wp-reqs{display:flex; flex-direction:column; gap:8px}
.wp-req{padding:12px; border:1px solid var(--line); border-radius:var(--r-sm); background:var(--surface-2); display:flex; flex-direction:column; gap:6px}
.wp-req-top{display:flex; flex-wrap:wrap; gap:8px; align-items:center}
.wp-req-top select, .wp-req-top input[type=text]{flex:1 1 170px; min-width:0}
.wp-check{display:flex; align-items:center; gap:6px; font-size:var(--fs-xs); color:var(--ink-muted); white-space:nowrap; min-height:32px}
.wp-preview{font-size:var(--fs-xs); color:var(--ink-muted)} .wp-preview q{color:var(--ink)}
.wp-req-more-b{display:grid; gap:4px; padding:4px 0 2px}
.wp-req-more-b label:not(.wp-check){font-size:var(--fs-xs); font-weight:600; color:var(--ink); margin-top:6px}
.wp-del{margin-left:auto; min-height:32px; font-size:var(--fs-xs)}
.wp-sub{margin:16px 0 6px; font-size:var(--fs-xs); color:var(--ink-muted)}
.wp-sugg{display:flex; flex-wrap:wrap; gap:6px}
.wp-sugg-btn{display:inline-flex; align-items:baseline; gap:6px; min-height:34px; padding:6px 12px; border-radius:999px; border:1px dashed var(--line-strong, var(--line)); background:transparent; color:var(--ink); font:inherit; font-size:var(--fs-xs); cursor:pointer; text-align:left}
.wp-sugg-btn:hover{border-style:solid; background:var(--accent-soft)}
.wp-sugg-btn > span{color:var(--accent-strong); font-weight:700} .wp-sugg-btn small{color:var(--ink-faint)}
.wp-actions{margin-top:12px}
.wp-actions .btn{width:auto}
.wp-more{margin-top:22px}
.wp-more > summary{cursor:pointer; list-style:none; display:flex; align-items:center; gap:12px; padding:14px 18px; border-radius:var(--r-md, 14px); border:1px solid var(--line); background:var(--surface)}
.wp-more > summary::-webkit-details-marker{display:none}
.wp-more > summary::after{content:'+'; margin-left:auto; font-size:20px; line-height:1; color:var(--accent-strong)}
.wp-more[open] > summary::after{content:'−'}
.wp-more > summary span{display:flex; flex-direction:column; gap:2px}
.wp-more > summary b{font-size:var(--fs-body); font-weight:600; color:var(--ink)} .wp-more > summary small{font-size:var(--fs-xs); color:var(--ink-muted)}
.wp-example{margin-top:16px; padding:14px; border-radius:var(--r-sm); background:var(--surface-2); border:1px solid var(--line)}
.wp-example > span{display:block; font-size:11px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint)}
.wp-example p{margin:8px 0; padding:10px 13px; max-width:520px; border-radius:16px 16px 16px 5px; background:var(--surface); border:1px solid var(--line); font-size:var(--fs-xs); line-height:1.55; color:var(--ink)}
.wp-example small{font-size:11.5px; color:var(--ink-faint)}
.wp-save .st-save-msg:empty{display:none}
@media (max-width:899px){
  .wp-overview{grid-template-columns:1fr 1fr}
  .wp-part{padding:14px 14px 12px}
  .wp-more > summary{padding:12px 14px}
}
@media (max-width:420px){ .wp-overview{grid-template-columns:1fr} }
.st-group-h{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; margin:28px 0 0; padding-top:20px; border-top:1px solid var(--line);
  font-size:var(--fs-body); font-weight:600; color:var(--ink); letter-spacing:-.01em}
.st-group-h:first-of-type{border-top:none; padding-top:0; margin-top:16px}
.st-total{display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin-top:16px; padding:14px 16px; background:var(--surface-2); border-radius:var(--r-sm); font-size:var(--fs-sm); color:var(--ink-muted)}
.st-total b{font-size:18px; color:var(--ink); font-weight:600}
.st-kv{display:flex; justify-content:space-between; align-items:baseline; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); font-size:var(--fs-sm); color:var(--ink-muted)}
.st-kv span small{display:block; font-size:var(--fs-xs); color:var(--ink-faint)}
.st-kv b{color:var(--ink); font-weight:600; text-align:right; min-width:0}
.st-kv b.st-wrap{overflow-wrap:anywhere}
.st-derived input[readonly]{font-weight:600; color:var(--ink); background:var(--surface-2); border-style:dashed}
.st-sub{margin-top:18px; border-top:1px solid var(--line); padding-top:4px}
.st-sub > summary{display:flex; align-items:center; gap:8px; min-height:var(--touch); font-size:var(--fs-sm); font-weight:600; color:var(--ink-muted); cursor:pointer; list-style:none; border-radius:var(--r-xs)}
.st-sub > summary::-webkit-details-marker{display:none}
.st-sub > summary::after{content:""; width:7px; height:7px; border-right:1.5px solid currentColor; border-bottom:1.5px solid currentColor; transform:rotate(45deg); margin-left:auto; margin-right:4px; transition:transform .15s ease}
.st-sub[open] > summary::after{transform:rotate(225deg)}
.st-sub > summary:focus-visible{outline:none; box-shadow:var(--focus-ring)}
.st-sub > summary:hover{color:var(--ink)}
.st-adv-note{margin:8px 0 4px; padding:14px 16px; border-radius:var(--r-sm); background:var(--info-soft); font-size:var(--fs-sm); color:var(--ink-muted); line-height:1.55}
.st-save{display:flex; align-items:center; justify-content:flex-end; gap:14px; flex-wrap:wrap; margin-top:28px; padding-top:18px; border-top:1px solid var(--line)}
.st-save .btn{width:auto; margin:0; min-width:150px}
.st-save-msg{font-size:var(--fs-sm); color:var(--attention); font-weight:500; display:inline-flex; align-items:center; gap:7px}
.st-save-msg:not(:empty)::before{content:""; width:7px; height:7px; border-radius:50%; background:currentColor}
.st-save-msg.is-safe{color:var(--safe)}
.st-save-msg.is-error{color:var(--risk); flex-basis:100%; justify-content:flex-end; text-align:right; order:-1; line-height:1.45}
.st-add{width:auto; margin-top:14px}
.st-signout{width:auto; margin-top:22px}
.st-acct{margin-top:26px; padding-top:6px; border-top:1px solid var(--line)}
.st-acct .st-kv:last-child{border-bottom:none}
.commit-amt{max-width:140px}
#settingsAdvanced:empty{display:none}
.st-sec-adv .settings-h{margin-top:22px}

@media (min-width:900px) and (max-width:1199px){
  .st-layout{grid-template-columns:184px minmax(0, 1fr); gap:24px}
  .st-sec-h button{padding:24px 26px 0}
  .st-sec-body{padding:4px 26px 26px}
}
@media (min-width:900px){
  .st-sec{display:none}
  .st-sec.is-open{display:block}
  .st-sec-h button{cursor:default; pointer-events:none}
}
@media (max-width:899px){
  .st-layout{display:block}
  .st-nav{display:none}
  .st-sections{display:flex; flex-direction:column; gap:10px}
  .st-sec-h button{padding:0 18px; min-height:60px; font-size:16px; letter-spacing:-.01em}
  .st-sec-h button::after{content:""; width:8px; height:8px; border-right:1.5px solid var(--ink-faint); border-bottom:1.5px solid var(--ink-faint); transform:rotate(45deg) translateY(-2px); margin-left:auto; flex-shrink:0; transition:transform .15s ease}
  .st-sec-h button .st-dirty{margin-left:0}
  .st-sec.is-open .st-sec-h button::after{transform:rotate(225deg) translateY(-1px)}
  .st-sec-body{display:none; padding:0 18px 20px}
  .st-sec.is-open .st-sec-body{display:block}
  .st-sec-adv{margin-top:10px}
  .st-save{position:sticky; bottom:calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); background:var(--surface); margin:20px -18px -20px; padding:12px 18px; border-radius:0 0 var(--r-lg) var(--r-lg); z-index:2; box-shadow:0 -1px 0 var(--line)}
  .st-save .btn{flex:1}
}

/* ============================================================
   SIGN-IN / LOADING
   ============================================================ */
.center-screen{min-height:100vh; min-height:100dvh; display:flex; align-items:center; justify-content:center; padding:calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background:radial-gradient(1200px 600px at 50% -10%, #EAF1F7 0%, var(--bg) 60%)}
.login-card{width:100%; max-width:400px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-xl); padding:36px 32px 32px; box-shadow:var(--shadow-lg)}
.login-card label{margin-top:18px}
.login-card .btn{margin-top:24px}
.loading-screen{min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; padding:24px; background:var(--bg); color:var(--ink-muted); text-align:center}
.loading-screen .r-skel{width:min(260px, 70vw)}
.loading-text{text-align:center; color:var(--ink-muted); font-size:var(--fs-sm)}
.login-brand{display:flex; align-items:center; gap:14px; margin:0 0 22px}
.login-brand .brand-emblem{width:44px; height:44px}
.login-brand .brand-word{font-size:17px}
.login-tag{font-size:var(--fs-sm); color:var(--ink-muted); margin-top:7px}
@media (max-width:480px){ .login-card{padding:28px 22px 24px} }

/* ============================================================
   SIGN-IN SCREENS — Phase 7 (js/auth-ui.js)
   ============================================================ */
.auth-wrap{width:100%; max-width:420px; display:flex; flex-direction:column; align-items:center; gap:22px}
.auth-brand{display:flex; align-items:center; gap:10px; text-decoration:none; color:var(--ink)}
.auth-brand .brand-emblem{width:36px; height:36px}
.auth-brand .brand-word{font-size:15px}
.auth-card{width:100%; max-width:none}
.auth-form h1{margin:0; font-size:26px; font-weight:600; letter-spacing:-.025em; line-height:1.2}
.auth-form h1:focus{outline:none}
.auth-sub{margin:8px 0 6px; font-size:var(--fs-sm); color:var(--ink-muted); line-height:1.55}
.auth-form label{margin-top:18px}
.auth-label-row{display:flex; align-items:baseline; justify-content:space-between; gap:12px}
.auth-label-row label{margin-bottom:7px}
.auth-label-row a, .auth-switch a, .auth-foot a{color:var(--accent); font-weight:600; text-decoration:none; font-size:var(--fs-sm)}
.auth-label-row a:hover, .auth-switch a:hover, .auth-foot a:hover{text-decoration:underline; text-underline-offset:3px}
/* Phase 9.3: "Forgot password?" gets a 44 × 44 tap area from padding, cancelled by equal negative margins so the visible
   text keeps its size and place. Taller above than below (the label row has room above, the password field sits just
   below), so the hit area never reaches the field. */
.auth-label-row a[data-auth="forgot"]{display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; box-sizing:border-box;
  padding:14px 10px 4px; margin:-14px -10px -4px}
.auth-help{margin:7px 0 0; font-size:var(--fs-xs); color:var(--ink-faint)}
.auth-check{display:flex !important; align-items:flex-start; gap:10px; margin-top:18px !important; font-weight:400 !important; color:var(--ink-muted) !important; font-size:var(--fs-sm) !important; line-height:1.5; cursor:pointer}
.auth-check input{margin-top:2px}
.auth-check a{color:var(--accent); font-weight:600}
.auth-form .btn{margin-top:24px}
.auth-switch{margin:20px 0 0; text-align:center; font-size:var(--fs-sm); color:var(--ink-muted)}
.auth-error{display:none; margin-top:14px; padding:11px 13px; border-radius:var(--r-sm); background:var(--risk-soft); color:var(--ink); font-size:var(--fs-sm); line-height:1.5}
.auth-error.show{display:block}
.auth-notice{display:none; margin:0 0 18px; padding:12px 14px; border-radius:var(--r-sm); font-size:var(--fs-sm); line-height:1.5; color:var(--ink)}
.auth-notice.show{display:block}
.auth-notice.is-safe{background:var(--safe-soft)}
.auth-notice.is-attention{background:var(--attention-soft)}
.auth-notice.is-info{background:var(--info-soft)}
.auth-resend{display:block; margin-top:6px; padding-left:0}
.auth-sent-ic{width:48px; height:48px; border-radius:14px; background:var(--accent-soft); color:var(--accent-strong); display:flex; align-items:center; justify-content:center; margin-bottom:18px}
.auth-foot{margin:0; font-size:var(--fs-sm); color:var(--ink-faint); text-align:center}
.auth-foot a{font-weight:500}
#loginScreen [hidden]{display:none !important}

/* ------------------------------------------------------------
   Phase 9.3 — sign-in screens inside the iOS / Android apps (html.is-native, set by js/native.js).
   A purpose-built dark mobile screen instead of a website card: one seamless black background behind the
   safe areas, centred RESERVD branding above the form, white text, restrained field borders, a high-contrast
   primary button. Scrolls when the keyboard is up. The website presentation above is unchanged.
   ------------------------------------------------------------ */
.is-native.auth-open, .is-native.auth-open body{background:#000}
.is-native #loginScreen{color-scheme:dark}
.is-native #loginScreen.center-screen{
  align-items:flex-start; justify-content:center; min-height:100dvh; box-sizing:border-box; background:#000; color:#F5F7FA;
  padding:calc(env(safe-area-inset-top) + clamp(24px, 6vh, 56px)) calc(24px + env(safe-area-inset-right)) calc(env(safe-area-inset-bottom) + 16px) calc(24px + env(safe-area-inset-left));
}
.is-native #loginScreen .auth-wrap{max-width:420px; align-items:stretch; gap:0;
  min-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - clamp(24px, 6vh, 56px) - 16px)}
/* brand: centred, clearly the most prominent element */
/* the R is the focal point (~58px of visible artwork; the image has ~15% transparent padding each side);
   RESERVD sits beneath it as a quiet signature */
.is-native #loginScreen .auth-brand{align-self:center; flex-direction:column; gap:6px; margin:0 0 clamp(26px, 5.5vh, 44px); pointer-events:none; color:#FFFFFF}
.is-native #loginScreen .auth-brand .brand-emblem{width:82px; height:82px}
.is-native #loginScreen .auth-brand .brand-word{font-size:clamp(16.5px, 4.8vw, 20px); font-weight:500; letter-spacing:.2em; margin-right:-.2em; color:#E9EDF2}
.is-native #loginScreen .auth-card{background:none; border:0; border-radius:0; box-shadow:none; padding:0; max-width:none; color:#F5F7FA}
.is-native #loginScreen .auth-form h1{font-size:22px; font-weight:600; letter-spacing:-.015em; color:#FFFFFF}
.is-native #loginScreen .auth-sub{margin:6px 0 2px; font-size:15px; color:#A3ACB9}
.is-native #loginScreen .auth-form label, .is-native #loginScreen .auth-label-row label{margin-top:20px; font-size:13.5px; font-weight:500; color:#C7CED8}
.is-native #loginScreen input[type=email], .is-native #loginScreen input[type=password], .is-native #loginScreen input[type=text]{
  min-height:54px; border-radius:14px; border:1px solid #2E333B; background:#0D0F12; color:#FFFFFF; box-shadow:none; padding:14px 16px; caret-color:#FFFFFF}
.is-native #loginScreen input::placeholder{color:#6B7380}
.is-native #loginScreen input:focus{border-color:#9DB8DA; box-shadow:0 0 0 3px rgba(157,184,218,.22)}
.is-native #loginScreen input:-webkit-autofill{-webkit-text-fill-color:#FFFFFF; -webkit-box-shadow:0 0 0 1000px #0D0F12 inset; caret-color:#FFFFFF}
/* primary: white on black — the one high-contrast action */
.is-native #loginScreen .auth-form .btn, .is-native #loginScreen .auth-signedin .btn{width:100%; min-height:54px; border-radius:14px; margin-top:28px; font-size:16px; font-weight:600;
  background:#FFFFFF; color:#0A0B0D; border:0; box-shadow:none}
.is-native #loginScreen .auth-form .btn:active{background:#E3E7EC}
.is-native #loginScreen .auth-form .btn:disabled{opacity:.6}
.is-native #loginScreen .auth-signedin .btn.secondary{margin-top:12px; background:transparent; color:#FFFFFF; border:1px solid #3A404A}
.is-native #loginScreen .auth-label-row a{display:inline-flex; align-items:center; min-height:44px; font-size:14px; color:#9DB8DA}
.is-native #loginScreen .auth-switch{margin:16px 0 0; font-size:15px; color:#A3ACB9}
.is-native #loginScreen .auth-switch a{display:inline-flex; align-items:center; min-height:44px; font-size:15px; color:#FFFFFF; font-weight:600}
.is-native #loginScreen .btn-text, .is-native #loginScreen .auth-resend{color:#9DB8DA}
.is-native #loginScreen a:hover{text-decoration:none}   /* touch: no sticky hover underline after a tap */
/* inline status — readable on black */
.is-native #loginScreen .auth-notice{border-radius:12px; color:#E8EDF3; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.08)}
.is-native #loginScreen .auth-notice.is-safe{background:rgba(52,168,108,.14); border-color:rgba(52,168,108,.28)}
.is-native #loginScreen .auth-notice.is-attention{background:rgba(214,158,46,.14); border-color:rgba(214,158,46,.3)}
.is-native #loginScreen .auth-error{border-radius:12px; color:#FFE1DE; background:rgba(226,82,65,.16); border:1px solid rgba(226,82,65,.32)}
/* signup details */
.is-native #loginScreen .auth-plan{background:rgba(157,184,218,.12); color:#E8EDF3}
.is-native #loginScreen .auth-pw-toggle{color:#9DB8DA}
.is-native #loginScreen .auth-pw-toggle:hover{background:rgba(255,255,255,.06)}
.is-native #loginScreen .auth-rules{color:#8C95A3}
.is-native #loginScreen .auth-rules li::before{border-color:#4A515C}
.is-native #loginScreen .auth-check{color:#A3ACB9 !important}
.is-native #loginScreen .auth-check a{color:#FFFFFF}
.is-native #loginScreen .auth-signedin{padding:0; border:0; background:none; border-radius:0; color:#E8EDF3}
.is-native #loginScreen .auth-signedin-sub{color:#A3ACB9}
.is-native #loginScreen .auth-sent-ic{background:rgba(157,184,218,.14); color:#FFFFFF}
.is-native #loginScreen .auth-help{color:#8C95A3}
/* understated legal links */
.is-native #loginScreen .auth-foot{margin-top:auto; padding-top:28px; font-size:12.5px; color:#5E6672}
.is-native #loginScreen .auth-foot a{display:inline-flex; align-items:center; min-height:44px; padding:0 6px; color:#8C95A3; font-weight:500}
.is-native #loginScreen .auth-foot-home{display:none}
/* black behind the status bar / Dynamic Island so scrolled content never runs under the clock */
.is-native #loginScreen::before{content:""; position:fixed; top:0; left:0; right:0; height:env(safe-area-inset-top); background:#000; z-index:5; pointer-events:none}
/* website: no back control and no welcome screen (the welcome section is never shown there) */
.auth-back{display:none}
.auth-forgot-below{display:none}
/* native Log in: one centred "Forgot password?" below the button; account creation lives on the welcome screen */
.is-native #auth-login .auth-label-row a[data-auth="forgot"]{display:none}
.is-native #auth-login .auth-switch{display:none}
.is-native #auth-login .auth-forgot-below{display:block; margin:14px 0 0; text-align:center}
.is-native #auth-login .auth-forgot-below a{display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:0 14px; font-size:15px; font-weight:500; color:#9DB8DA; text-decoration:none}
.auth-vh{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap}
/* native boot: black from the first paint until the app shell or onboarding shows (no light flash) */
.is-native:not(.app-open):not(.onboard-open), .is-native:not(.app-open):not(.onboard-open) body{background:#000}
.is-native:not(.app-open) .loading-screen{background:#000}
.is-native:not(.app-open) .loading-screen .loading-text{color:#8C95A3}

/* ---- Phase 9.3 native WELCOME: spacious, brand-led, one clear path ---- */
.is-native #loginScreen[data-mode="welcome"]{
  background:radial-gradient(ellipse 90% 52% at 50% 30%, rgba(46,86,150,.34) 0%, rgba(26,48,92,.14) 42%, rgba(0,0,0,0) 72%), #000}
.is-native #loginScreen[data-mode="welcome"] .auth-brand{margin:clamp(56px, 13vh, 120px) 0 0; gap:8px}
.is-native #loginScreen[data-mode="welcome"] .auth-brand .brand-emblem{width:112px; height:112px}
.is-native #loginScreen[data-mode="welcome"] .auth-card{flex:1; display:flex; flex-direction:column}
.is-native #loginScreen[data-mode="welcome"] .auth-notice{display:none}
.is-native .auth-welcome:not([hidden]){flex:1; display:flex; flex-direction:column; align-items:stretch}
.is-native .auth-welcome-line{margin:16px 0 0; text-align:center; font-size:16px; line-height:1.5; color:#A3ACB9}
.is-native .auth-welcome-actions{margin-top:auto; padding-top:40px; display:flex; flex-direction:column; gap:12px}
.is-native #loginScreen .auth-welcome-actions .btn{display:flex; align-items:center; justify-content:center; width:100%; min-height:56px; margin:0; border-radius:16px; font-size:16.5px; font-weight:600; text-decoration:none; box-sizing:border-box}
.is-native #loginScreen .auth-welcome-actions .btn:not(.secondary){background:#FFFFFF; color:#0A0B0D; border:0}
.is-native #loginScreen .auth-welcome-actions .btn.secondary{background:#111317; color:#FFFFFF; border:1px solid #2A2F37}
.is-native #loginScreen[data-mode="welcome"] .auth-foot{padding-top:18px}
.is-native #loginScreen[data-mode="welcome"]::before{display:none}   /* the welcome screen does not scroll; keeps the glow seamless under the status bar */
/* welcome background art (js/welcome-art.js): one canvas behind the content */
.welcome-art{position:fixed; inset:0; width:100%; height:100%; z-index:0; pointer-events:none; display:block}
.welcome-art[hidden]{display:none}
.is-native #loginScreen .auth-wrap{position:relative; z-index:1}

/* ---- compact brand header on the forms (keeps the form usable with the keyboard up) ---- */
.is-native #loginScreen:not([data-mode="welcome"]) .auth-brand{gap:8px; margin:0 0 clamp(24px, 4.6vh, 40px)}
.is-native #loginScreen:not([data-mode="welcome"]) .auth-brand .brand-emblem{width:64px; height:64px}
/* the dedicated Log in screen: R at 1.5x (92px box ≈ 65px of visible artwork — the image has ~15% transparent padding
   on each side, which also gives a deliberate gap above the wordmark). Signup / reset / forgot keep 64px. */
.is-native #loginScreen[data-mode="login"] .auth-brand{gap:2px; margin:0 0 clamp(20px, 3.8vh, 34px)}
.is-native #loginScreen[data-mode="login"] .auth-brand .brand-emblem{width:92px; height:92px}
.is-native #loginScreen[data-mode="login"].center-screen{padding-top:calc(env(safe-area-inset-top) + clamp(48px, 7vh, 84px))}
@media (max-height:700px){
  .is-native #loginScreen[data-mode="login"] .auth-brand .brand-emblem{width:78px; height:78px}
  .is-native #loginScreen[data-mode="login"].center-screen{padding-top:calc(env(safe-area-inset-top) + 44px)}
}
@media (max-height:520px){   /* keyboard up: keep the fields close to the top */
  .is-native #loginScreen[data-mode="login"] .auth-brand{margin-bottom:14px}
  .is-native #loginScreen[data-mode="login"] .auth-brand .brand-emblem{width:60px; height:60px}
  .is-native #loginScreen[data-mode="login"].center-screen{padding-top:calc(env(safe-area-inset-top) + 34px)}
}
.is-native #loginScreen:not([data-mode="welcome"]) .auth-brand .brand-word{font-size:15px; letter-spacing:.2em; margin-right:-.2em}
.is-native #loginScreen:not([data-mode="welcome"]).center-screen{padding-top:calc(env(safe-area-inset-top) + clamp(56px, 8.5vh, 100px))}   /* a little lower on tall screens; the keyboard resize shrinks it */

/* ---- back control (native, form screens) ---- */
.is-native #loginScreen:not([data-mode="welcome"]):not([data-mode="reset"]) .auth-back{display:flex}
.is-native #loginScreen:has(#auth-signup.is-choice:not([hidden])) .auth-back{display:none}
.is-native .auth-back{position:fixed; z-index:6; top:calc(env(safe-area-inset-top) + 4px); left:calc(8px + env(safe-area-inset-left)); width:44px; height:44px;
  align-items:center; justify-content:center; border:0; border-radius:22px; background:rgba(255,255,255,.06); color:#FFFFFF; cursor:pointer; -webkit-tap-highlight-color:transparent}
.is-native .auth-back:active{background:rgba(255,255,255,.14)}
.is-native .auth-back:focus-visible{outline:2px solid #9DB8DA; outline-offset:2px}


/* Phase 7.6 — suspended / banned account notice (server already withholds all data) */
.blocked-card{max-width:440px; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-xl); padding:32px 28px; box-shadow:var(--shadow-md); color:var(--ink-muted)}
.blocked-card h1{font-size:22px; letter-spacing:-.02em; color:var(--ink); margin:0 0 10px}
.blocked-card p{margin:0 0 6px}
.blocked-card .blocked-actions{display:grid; gap:0; margin-top:8px}
.blocked-card .blocked-actions .btn{display:flex; align-items:center; justify-content:center; text-decoration:none; margin-top:10px}

/* ---------- Phase 7.7A: Settings → Bank accounts ---------- */
.st-banks{display:grid; gap:10px; margin:6px 0 4px}
.st-bank{border:1px solid var(--line); border-radius:var(--r-md); padding:12px 14px; background:var(--surface)}
.st-bank-top{display:flex; justify-content:space-between; align-items:flex-start; gap:10px; flex-wrap:wrap}
.st-bank-top b{display:block; color:var(--ink); font-size:var(--fs-sm)}
.st-bank-top small{display:block; color:var(--ink-faint); font-size:var(--fs-xs); margin-top:2px}
.st-bank-row{display:flex; gap:10px; margin-top:10px; align-items:center; flex-wrap:wrap}
.st-bank-row select{flex:1 1 200px; min-width:0}
.st-bank-manual{display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap; padding:10px 0; border-bottom:1px solid var(--line)}
.st-bank-manual small{display:block; color:var(--ink-faint); font-size:var(--fs-xs); margin-top:3px}
.st-sr{position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0}
