/* WurthWise. One layout, three themes that differ only in tokens:
   classic = board Option 1 (dark navy + gold, the default), light = Option 2, bold = Option 3 (indigo/purple, glow).
   No inline styles anywhere (the page's CSP forbids them): everything is a class; widths are set through the CSSOM. */
:root, [data-theme="classic"] {
  color-scheme: dark;
  --bg: #0B1220; --bg2: #0B1220; --card: #111B2E; --card2: #16233B; --line: rgba(255,255,255,.08);
  --text: #F4F6FA; --muted: #9AA7BC; --accent: #C9A34E; --accent-ink: #0B1220; --accent-soft: rgba(201,163,78,.14);
  --good: #4FC38A; --warn: #E0A93B; --bad: #F0707A; --bad-ink: #fff; --tile-ico: #C9A34E;
  --hero: #111B2E; --shadow: 0 8px 24px rgba(0,0,0,.35); --glow: none; --track: rgba(255,255,255,.1);
  --logo1: #F1D98F; --logo2: #B98B34; --field: #0E1626; --tabbar: #0E1626; --scrim: rgba(3,7,15,.6);
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #F3F6FB; --bg2: #F3F6FB; --card: #FFFFFF; --card2: #F6F8FC; --line: #E1E7F0;
  --text: #0F1B33; --muted: #566783; --accent: #1B3FA8; --accent-ink: #fff; --accent-soft: rgba(27,63,168,.09);
  --good: #23885A; --warn: #A5680C; --bad: #C23640; --bad-ink: #fff; --tile-ico: #1B3FA8;
  --hero: linear-gradient(135deg, #E8F6EE 0%, #F6FBF8 100%); --shadow: 0 6px 20px rgba(20,40,90,.08); --glow: none; --track: #E1E7F0;
  --logo1: #D9B35A; --logo2: #9C7421; --field: #FFFFFF; --tabbar: #FFFFFF; --scrim: rgba(15,27,51,.45);
}
[data-theme="bold"] {
  color-scheme: dark;
  --bg: #110A2C; --bg2: linear-gradient(170deg, #1E1160 0%, #120B33 45%, #0C0922 100%); --card: #1C1650; --card2: #2A1F78; --line: rgba(130,150,255,.28);
  --text: #F6F5FF; --muted: #B3B0DD; --accent: #6FD6F5; --accent-ink: #0C0922; --accent-soft: rgba(111,214,245,.14);
  --good: #52D98A; --warn: #F2A64B; --bad: #FF7B86; --bad-ink: #fff; --tile-ico: #8FB4FF;
  --hero: linear-gradient(135deg, #2B2BA8 0%, #5A2FB5 100%); --shadow: 0 10px 30px rgba(10,6,40,.55); --glow: 0 0 22px rgba(111,140,255,.35); --track: rgba(255,255,255,.14);
  --logo1: #E4DAFF; --logo2: #8E6BFF; --field: #160F44; --tabbar: #150E3C; --scrim: rgba(6,3,24,.65);
}
@media (prefers-color-scheme: light) { html:not([data-theme]) { color-scheme: light; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; min-height: 100dvh; color: var(--text); background: var(--bg2); background-attachment: fixed;
  font: 16px/1.45 Inter, ui-sans-serif, -apple-system, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* the phone-width column (centered on a wide screen) */
.shell { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; padding-bottom: 96px; }
@media (min-width: 700px) { body { background-image: var(--bg2); } .shell { border-left: 1px solid var(--line); border-right: 1px solid var(--line); background: transparent; } }
.hdr { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 6px; min-height: 60px; }
.hdr .scope { flex: 1; }   /* room for a future Personal | Business switch (Evolution 5); not shown */
.brand { display: flex; align-items: center; gap: 10px; }
.wordmark { font-weight: 800; letter-spacing: .14em; font-size: 17px; color: var(--accent); }
[data-theme="light"] .wordmark { color: #8A6A22; }
[data-theme="bold"] .wordmark { color: #fff; }
.iconbtn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; display: grid; place-items: center; position: relative; color: var(--text); }
.iconbtn svg { width: 24px; height: 24px; }
.badge { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--bad); color: var(--bad-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; padding: 0 4px; }
.sub-hdr { display: flex; align-items: center; gap: 4px; padding: 10px 10px 4px; min-height: 60px; }
.sub-hdr h1 { margin: 0; font-size: 20px; font-weight: 800; }
main { padding: 0 16px; }
h2 { font-size: 18px; margin: 22px 2px 10px; }
.hello { margin: 8px 2px 14px; }
.hello b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.01em; }
.hello span { color: var(--muted); font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 14px; }
[data-theme="bold"] .card { background: linear-gradient(145deg, #231A66 0%, #2D1F86 100%); box-shadow: var(--shadow), var(--glow); }
.card.hero { background: var(--hero); }
[data-theme="bold"] .card.hero { border-color: rgba(143,180,255,.6); box-shadow: var(--shadow), 0 0 28px rgba(120,140,255,.45); }
.card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.big { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mid { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pos { color: var(--good); } .neg { color: var(--bad); } .warn { color: var(--warn); }
.chg { font-size: 14px; font-weight: 600; margin-top: 4px; }
.spark { width: 46%; max-width: 170px; height: 64px; flex: none; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.spark .fill { fill: var(--accent-soft); stroke: none; }

/* health panel (board Option 3) */
.health { display: grid; grid-template-columns: 112px 1fr; gap: 14px; align-items: center; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .trk { fill: none; stroke: var(--track); stroke-width: 11; }
.ring .val { fill: none; stroke-width: 11; stroke-linecap: round; }
.ring .val.good { stroke: var(--good); } .ring .val.warn { stroke: var(--warn); } .ring .val.bad { stroke: var(--bad); } .ring .val.none { stroke: var(--muted); }
.ring .mid-t { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid-t b { font-size: 25px; font-weight: 800; line-height: 1; }
.ring .mid-t span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.health h3 { margin: 0; font-size: 14px; color: var(--muted); }
.health .word { font-size: 26px; font-weight: 800; line-height: 1.1; }
.hrows { margin-top: 12px; border-top: 1px solid var(--line); }
.hrow { display: flex; align-items: center; gap: 10px; padding: 11px 2px; min-height: 48px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; }
.hrow:last-child { border-bottom: 0; }
.hrow .ic { width: 28px; height: 28px; border-radius: 9px; background: var(--accent-soft); display: grid; place-items: center; color: var(--tile-ico); flex: none; }
.hrow .ic svg { width: 17px; height: 17px; }
.hrow .lb { flex: 1; font-weight: 600; }
.hrow .st { font-weight: 700; font-size: 14px; text-align: right; }
.linkbtn { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 10px 2px; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
[data-theme="light"] .linkbtn { color: var(--accent); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; min-height: 104px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; position: relative; color: var(--text); font-weight: 600; font-size: 14px; box-shadow: var(--shadow); }
[data-theme="bold"] .tile { background: linear-gradient(145deg, #231A66, #34248F); box-shadow: var(--shadow), var(--glow); }
.tile .ti { color: var(--tile-ico); width: 34px; height: 34px; }
.tile .ti svg { width: 34px; height: 34px; }
.tile[aria-disabled="true"] { opacity: .55; cursor: default; }
.tile small { font-weight: 600; font-size: 11px; color: var(--muted); }
.tile .ringmini { width: 52px; height: 52px; position: relative; }
.tile .ringmini svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.tile .ringmini .trk { fill: none; stroke: var(--track); stroke-width: 6; } .tile .ringmini .val { fill: none; stroke-width: 6; stroke-linecap: round; }
.tile .ringmini .val.good { stroke: var(--good); } .tile .ringmini .val.warn { stroke: var(--warn); } .tile .ringmini .val.bad { stroke: var(--bad); } .tile .ringmini .val.none { stroke: var(--muted); }
.tile .ringmini b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; }

.insight { display: flex; gap: 12px; align-items: flex-start; }
.insight .ic { width: 36px; height: 36px; border-radius: 12px; background: var(--accent-soft); color: var(--tile-ico); display: grid; place-items: center; flex: none; }
.insight .ic svg { width: 20px; height: 20px; }
.insight.bad { border-color: var(--bad); } .insight.warn { border-color: var(--warn); }
.insight p { margin: 0; font-size: 16px; font-weight: 600; }
.pill { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
[data-theme="bold"] .pill { color: var(--accent); }
.up .mid { color: var(--text); }

/* lists */
.list { margin: 0; padding: 0; list-style: none; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; min-height: 56px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { color: var(--muted); font-size: 13px; display: block; }
.li .amt { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.li[aria-disabled="true"] { opacity: .55; cursor: default; }
.tag { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: 1px; letter-spacing: .03em; }
.tag.bad { background: var(--bad); color: var(--bad-ink); } .tag.soon { background: var(--track); color: var(--muted); }
.bar { height: 10px; border-radius: 6px; background: var(--track); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.bar i.good { background: var(--good); } .bar i.warn { background: var(--warn); } .bar i.bad { background: var(--bad); }

/* buttons + forms */
.btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border: 0; border-radius: 16px; font-weight: 800; font-size: 16px; background: var(--accent); color: var(--accent-ink); }
[data-theme="bold"] .btn { background: linear-gradient(135deg, #7B6BFF, #4FC3F7); color: #0C0922; box-shadow: var(--glow); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); color: var(--bad-ink); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.small { width: auto; min-height: 44px; padding: 8px 16px; font-size: 14px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.in { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--field); color: var(--text); font-size: 16px; }
.in::placeholder { color: var(--muted); opacity: .8; }
.pwwrap { position: relative; } .pwwrap .in { padding-right: 64px; }
.pwwrap .show { position: absolute; right: 4px; top: 3px; min-height: 44px; min-width: 56px; background: none; border: 0; color: var(--accent); font-weight: 700; }
.meter { height: 8px; border-radius: 6px; background: var(--track); overflow: hidden; margin-top: 8px; } .meter i { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--bad); }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; min-height: 18px; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; margin: 8px 0; } .okmsg { color: var(--good); font-weight: 600; margin: 8px 0; }
.chk { display: flex; align-items: center; gap: 12px; min-height: 48px; font-weight: 600; }
.chk input { width: 24px; height: 24px; accent-color: var(--accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--field); border: 1px solid var(--line); border-radius: 14px; padding: 4px; }
.seg button { min-height: 44px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; font-size: 14px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
[data-theme="bold"] .seg button[aria-pressed="true"] { background: linear-gradient(135deg, #7B6BFF, #4FC3F7); color: #0C0922; }

/* auth */
.auth { max-width: 420px; margin: 0 auto; padding: 36px 20px 40px; }
.auth .logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; text-align: center; }
.auth .logo .wordmark { font-size: 24px; } .auth .tag1 { color: var(--muted); font-size: 14px; max-width: 300px; }
.auth h1 { font-size: 24px; margin: 0 0 6px; } .auth p { color: var(--muted); margin: 0 0 16px; }
.auth .links { display: flex; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }

/* tab bar */
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--tabbar); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 20; }
.tabs button { background: none; border: 0; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 700; color: var(--muted); }
.tabs svg { width: 24px; height: 24px; }
.tabs button[aria-current="page"] { color: var(--accent); }

/* sheet */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 92vh; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 24px 24px 0 0; padding: 18px 18px calc(24px + env(safe-area-inset-bottom)); }
[data-theme="bold"] .sheet { background: linear-gradient(160deg, #241A70, #17104A); }
.sheet h2 { margin: 0 0 12px; font-size: 20px; }
.sheet .grab { width: 44px; height: 5px; border-radius: 3px; background: var(--track); margin: -6px auto 12px; }
.sheet .acts { display: grid; gap: 10px; margin-top: 8px; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 700; z-index: 60; max-width: 90%; }
.empty { text-align: center; padding: 22px 12px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.steps { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; min-height: 52px; padding: 6px 0; }
.steps li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--track); stroke-width: 1; } .chart .zero { stroke: var(--bad); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .ln { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; } .chart .neg { fill: none; stroke: var(--bad); stroke-width: 3; }
.chart .pd { fill: var(--accent); } .chart text { fill: var(--muted); font-size: 11px; }
.dayrow { padding: 10px 4px; border-bottom: 1px solid var(--line); } .dayrow:last-child { border-bottom: 0; }
.dayrow .dh { display: flex; justify-content: space-between; font-weight: 700; } .dayrow .dl { color: var(--muted); font-size: 13px; }
.example { opacity: .8; border-style: dashed; }
.note { font-size: 13px; color: var(--muted); margin: 10px 2px; }
.spin { text-align: center; padding: 60px 0; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) { .toast, .sheet { animation: up .18s ease-out; } @keyframes up { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } } .toast { animation-name: fade; } @keyframes fade { from { opacity: 0; } to { opacity: 1; } } }
.lg1 { stop-color: var(--logo1); } .lg2 { stop-color: var(--logo2); }

.pickcard { display: block; width: 100%; text-align: left; color: var(--text); padding: 18px; }
.pickcard b { display: block; font-size: 20px; margin: 12px 0 4px; }
.mini { display: grid; gap: 6px; padding: 10px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.mini i { display: block; height: 10px; border-radius: 5px; background: var(--track); }
.mini .m-hero { height: 30px; background: var(--accent-soft); border: 1px solid var(--accent); } .mini .m-ring { height: 30px; width: 30px; border-radius: 50%; border: 4px solid var(--accent); background: none; }
.mini .m-grid { height: 24px; background: repeating-linear-gradient(90deg, var(--track) 0 28%, transparent 28% 36%); } .mini .s { width: 60%; }
.iconbtn[disabled] { opacity: .3; cursor: default; }
button.card { display: block; width: 100%; text-align: left; color: inherit; font: inherit; }
button.card.row { display: flex; }
button.card.insight { display: flex; }
.tile .ringmini { margin: -9px 0 -5px; }
