/* Simply Magical base styles: the Goal Mate! look. Source of truth: Shared/brand/sm-base.css (copied from Goal Mate!). */
/* Colour and font tokens are set at runtime by themes.js (ten accessible presets). These are the fallbacks. */
:root {
  --bg: #f5f2ea; --surface: #fffdf8; --surface-2: #f0ece2; --ink: #1c2925; --muted: #5f6b66; --line: #e2dccf;
  --primary: #007B38; --primary-2: #006a31; --primary-soft: #e0f1e5; --on-primary: #fff;
  --gold: #FFCD00; --gold-soft: #fff4c2; --on-gold: #14241b; --gold-ink: #755800; --danger: #b4432e; --danger-soft: #f8e4df; --info: #3a6bc4;
  --radius: 14px; --radius-sm: 9px; --shadow: 0 1px 2px rgba(28,41,37,.06), 0 4px 16px rgba(28,41,37,.06);
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Public Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --lh: 1.5; --text-scale: 1;
  /* task outcome colours: done = tick, partial = circle, missed = cross, planned = square */
  --st-done: #1e8e3e; --st-partial: #e09b00; --st-missed: #d93025; --st-planned: #1a66d6; --st-partial-ink: #8a5a00;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body { background: var(--bg); color: var(--ink); font: 15px/var(--lh) var(--sans); -webkit-font-smoothing: antialiased; zoom: var(--text-scale); overflow-wrap: break-word; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.01em; margin: 0 0 .4em; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 21px; } h3 { font-size: 17px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); } .small { font-size: 13px; } .tiny { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
/* Nothing in a row may push past the screen: pieces can shrink, and a row of buttons wraps onto more lines. */
.row > div, .row > p, .row > form, .row > label { min-width: 0; } .row:has(> .btn ~ .btn), .row:has(> button ~ button), .row:has(> .pill) { flex-wrap: wrap; }
.row.wrap > .grow { flex-basis: 140px; } /* the words keep a readable width; what follows drops to the next line */
.between { justify-content: space-between; } .stack > * + * { margin-top: 12px; }
.hidden { display: none !important; }

/* ---------- shell (web) ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh / var(--text-scale)); background: linear-gradient(to right, var(--surface) 235px, var(--line) 235px, var(--line) 236px, transparent 236px); }
.sidebar { position: sticky; top: 0; height: calc(100vh / var(--text-scale)); padding: 22px 14px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 20px; font-weight: 650; padding: 0 10px 18px; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); display: grid; place-items: center; color: var(--on-primary); box-shadow: inset 0 -3px 0 var(--on-primary); }
[data-theme="evergreen"] .brand-mark { color: var(--gold); box-shadow: inset 0 -3px 0 var(--gold); } /* green and gold, the brand look */
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav a.active { background: var(--primary-soft); color: var(--primary-2); }
.nav svg { width: 19px; height: 19px; }
.sidebar .me { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.main { padding: 30px 36px 60px; max-width: 1200px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 0; }

/* ---------- shell (mobile app mode) ---------- */
body.app-mode .shell { display: block; }
body.app-mode .sidebar { display: none; }
body.app-mode .main { padding: 0 16px calc(84px + var(--banner-h, 0px)); }
.appbar { display: none; }
body.app-mode .appbar { display: flex; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; padding: 14px 16px 10px; margin: 0 -16px 10px; background: var(--bg); border-bottom: 1px solid transparent; }
body.app-mode .appbar .brand { padding: 0; font-size: 18px; }
body.app-mode h1 { font-size: 24px; }
body.app-mode .page-head { margin-bottom: 14px; }
.tabbar { display: none; }
body.app-mode .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; font-size: min(11px, 2.65vw); font-weight: 600; color: var(--muted); padding: 4px 0; }
.tabbar a.active { color: var(--primary); } .tabbar a:hover { text-decoration: none; }
.tabbar svg { width: 22px; height: 22px; }
/* At bigger text sizes the tab bar grows with the text and splits into two even rows, so every tab still fits. */
html.big-text .tabbar { grid-auto-flow: row !important; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 2px; }
html.big-text .tabbar:not(:has(a:nth-child(5))) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.big-text .tabbar:has(a:nth-child(7)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.big-text .tabbar:has(a:nth-child(9)) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html.big-text .tabbar a { font-size: 11px; }
html.big-text body.app-mode .main { padding-bottom: calc(140px + var(--banner-h, 0px)); }
@media (max-width: 760px) { html.big-text .main { padding-bottom: calc(140px + var(--banner-h, 0px)); } }

/* ---------- components ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-title > * { min-width: 0; }
.card-title h2, .card-title h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
/* Two, three or four columns when each can be a readable width; fewer when the box is narrow (a phone, or big text beside the sidebar). */
.g2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(190px, calc(50% - 16px))), 1fr)); }
.g3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(200px, calc(33.33% - 16px))), 1fr)); }
.g4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, max(150px, calc(25% - 16px))), 1fr)); }
/* Main column beside a side column (about 2 to 1) when there is room for both; otherwise one under the other, at any text size. */
.dash { display: flex; flex-wrap: wrap; align-items: flex-start; }
.dash > * { flex: 1 1 280px; } .dash > :first-child { flex: 2 1 400px; }
@media (max-width: 1000px) { .dash, .g3 { grid-template-columns: minmax(0, 1fr); } .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 760px) {
  .shell { display: block; background: none; } .sidebar { display: none; } .main { padding: 18px 16px calc(90px + var(--banner-h, 0px)); }
  .g2 { grid-template-columns: minmax(0, 1fr); } .appbar { display: flex !important; position: sticky; top: 0; z-index: 20; justify-content: space-between; align-items: center; padding: 12px 16px; margin: -18px -16px 12px; background: var(--bg); }
  .tabbar { display: grid !important; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px 10px; }
}
body.app-mode .g2, body.app-mode .g3, body.app-mode .dash { grid-template-columns: minmax(0, 1fr); }
body.app-mode .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
body.app-mode .shell { background: none; }
body.app-mode .kpi { padding: 12px 14px; }
body.app-mode .kpi .value { font-size: 22px; overflow-wrap: anywhere; }
body.app-mode .kpi .label { font-size: 10.5px; }
body.app-mode .kpi .sub { font-size: 12px; }
body.app-mode .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
body.app-mode .chip { flex: none; }
body.app-mode .page-head p { font-size: 14px; }
body.app-mode .measure-row { grid-template-columns: 1fr 1fr !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 15px; font: 600 14px var(--sans); cursor: pointer; background: var(--primary); color: var(--on-primary); transition: background .15s, transform .05s; max-width: 100%; text-align: center; } /* button words wrap when the button can't fit on one line (big text on a phone) */
.btn:hover { background: var(--primary-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.gold { background: var(--gold); color: var(--on-gold); }
.btn.gold:hover { background: var(--gold); filter: brightness(.92); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.icon-btn { background: none; border: 0; padding: 6px; border-radius: 8px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
input, select, textarea { width: 100%; max-width: 100%; min-width: 0; font: 15px var(--sans); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: transparent; }
input[type=checkbox] { width: auto; accent-color: var(--primary); }
input[type=color] { padding: 3px; height: 40px; }
textarea { min-height: 80px; resize: vertical; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill.green { background: var(--primary-soft); color: var(--primary-2); }
.pill.gold { background: var(--gold-soft); color: var(--ink); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { border: 0; width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--on-primary); font-weight: 700; font-size: 13px; flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.kpi .value { font-family: var(--display); font-size: 30px; font-weight: 650; line-height: 1.1; margin-top: 4px; overflow-wrap: anywhere; }
.kpi .sub { font-size: 13px; color: var(--muted); }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 99px; background: var(--primary); transition: width .6s; }
.bar.gold > span { background: var(--gold); box-shadow: inset 0 0 0 1px var(--gold-ink); }

.goal-card { display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform .12s, box-shadow .12s; border-top: 4px solid var(--goal, var(--primary)); }
.goal-card:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(28,41,37,.1); }
.goal-card h3 { margin: 0; }
.goal-meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--line); display: grid; place-items: center; cursor: pointer; flex: none; background: var(--surface); color: transparent; }
.check:hover { border-color: var(--primary); }
/* A tick box or radio with its words (label.check) is a normal line of text, not the 22px square above. */
label.check { width: auto; height: auto; border: 0; border-radius: 0; background: none; color: inherit; display: flex; align-items: flex-start; gap: 10px; place-items: initial; font-weight: 600; }
label.check input { width: auto; flex: none; margin-top: 3px; accent-color: var(--primary); }
.check.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.done-text { text-decoration: line-through; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font: 600 14px var(--sans); color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--primary-2); border-color: var(--primary); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: 600 13px var(--sans); color: var(--muted); cursor: pointer; }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font: 600 13px var(--sans); color: var(--muted); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font: 11px var(--sans); fill: var(--muted); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .target { stroke: var(--gold-ink); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .pt { fill: var(--surface); stroke-width: 2; }
.chart .pt:hover { r: 5; }
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); gap: 3px; }
.heat span { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); }
.heat span[data-l="1"] { background: color-mix(in srgb, var(--primary) 30%, var(--surface-2)); } .heat span[data-l="2"] { background: color-mix(in srgb, var(--primary) 55%, var(--surface-2)); } .heat span[data-l="3"] { background: color-mix(in srgb, var(--primary) 80%, var(--surface-2)); } .heat span[data-l="4"] { background: var(--primary-2); }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal .dow { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: 8px 3px; text-align: center; min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal .day { min-height: 98px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal .day:hover { background: var(--primary-soft); }
.cal .day.other { background: var(--bg); color: var(--muted); }
.cal .day.sel { outline: 2px solid var(--primary); outline-offset: -2px; }
.cal .num { font-size: 12px; font-weight: 700; }
.cal .day.today .num { background: var(--primary); color: var(--on-primary); border-radius: 99px; width: 22px; height: 22px; display: grid; place-items: center; }
.cal .ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; background: var(--surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid var(--c, var(--primary)); }
.cal .ev.done { opacity: .5; text-decoration: line-through; }
.cal.compact .day { min-height: 52px; }
.cal.compact .ev { font-size: 0; padding: 0; height: 5px; border-left-width: 0; background: var(--c, var(--primary)); }
body.app-mode .cal .day { min-height: 54px; }
body.app-mode .cal .ev { font-size: 0; padding: 0; height: 5px; border: 0; background: var(--c, var(--primary)); }
body.app-mode .cal .dow { padding: 6px 2px; text-align: center; font-size: 10px; }

/* ads (free plan, web + app) */
.ad-native { border: 1px dashed var(--line); background: var(--surface); border-radius: var(--radius); padding: 14px 16px; position: relative; }
.ad-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-footer { position: fixed; left: 0; right: 0; bottom: 64px; z-index: 25; height: 52px; background: var(--surface-2); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px; font-size: 13px; }
.ad-footer .ad-text { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* modal + toast */
/* Body is zoomed by --text-scale (Large text 1.25, Easy reading 1.1), which also zooms vh, so heights divide by it to stay on the screen. */
.modal-bg { position: fixed; inset: 0; background: rgba(15,22,20,.45); z-index: 100; display: grid; place-items: center; padding: 16px; overflow: auto; overscroll-behavior: contain; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; padding: 22px; width: min(520px, 100%); min-width: 0; max-height: calc(100vh / var(--text-scale, 1) - 32px); max-height: calc(100dvh / var(--text-scale, 1) - 32px); overflow: auto; overflow-x: hidden; overscroll-behavior: contain; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal h2 { margin-bottom: 14px; }
.toasts { position: fixed; top: 18px; right: 18px; left: 18px; pointer-events: none; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
body.app-mode .toasts { left: 12px; right: 12px; align-items: stretch; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: pop .25s; max-width: min(380px, 100%); pointer-events: auto; }
.toast.points { background: var(--gold); color: var(--on-gold); }
.toast.error { background: var(--danger); color: var(--surface); }
@keyframes pop { from { transform: translateY(-8px) scale(.96); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.badge-burst { text-align: center; } .badge-burst .big { font-size: 64px; animation: pop .5s; }

.badge-tile { text-align: center; padding: 12px 6px; border-radius: 12px; background: var(--surface-2); }
.badge-tile .ico { font-size: 28px; }
/* Badges not earned yet: the picture is greyed out, but the name and how to earn it stay readable */
.badge-tile.locked { background: transparent; border: 1px dashed var(--line); } .badge-tile.locked .ico { opacity: .4; filter: grayscale(1); } .badge-tile.locked .nm { color: var(--muted); }
.badge-tile .nm { font-weight: 700; font-size: 12.5px; margin-top: 4px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.rank { width: 24px; font-family: var(--display); font-weight: 650; color: var(--muted); text-align: center; }
.rank.r1 { color: var(--gold-ink); }
.cheer-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
.cheer-btn.on { background: var(--gold-soft); border-color: var(--gold); }
.comment { display: flex; gap: 10px; padding: 10px 0; }
.comment .bubble { background: var(--surface-2); border-radius: 4px 14px 14px 14px; padding: 9px 13px; flex: 1; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }

/* login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: var(--primary); color: var(--on-primary); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art h1 { font-size: 44px; color: var(--on-primary); max-width: 15ch; }
[data-theme="evergreen"] .login-art h1 { color: var(--gold); } /* gold on green passes for this large heading only in the default theme */
.login-art p { max-width: 40ch; font-size: 17px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form .inner { width: min(380px, 100%); }
.sso { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); font: 600 15px var(--sans); color: var(--ink); cursor: pointer; margin-bottom: 10px; }
.sso:hover { background: var(--surface-2); }
.sso .mark { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 13px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.otp { letter-spacing: .5em; font-size: 22px; text-align: center; font-weight: 700; }
.devnote { background: var(--gold-soft); border: 1px solid var(--gold); color: var(--ink); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { padding: 28px 22px; } .login-art h1 { font-size: 30px; } .login-art .art-foot { display: none; } }
body.app-mode .login { grid-template-columns: 1fr; } body.app-mode .login-art { padding: 36px 22px 26px; } body.app-mode .login-art h1 { font-size: 30px; } body.app-mode .login-art .art-foot { display: none; }

.premium-box { background: linear-gradient(135deg, var(--primary-soft), var(--gold-soft)); border-radius: var(--radius); padding: 18px; border: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
/* Table text wraps so nothing is cut off with dots. Short values (dates, amounts, counts, buttons) stay on one line: class "n" or "nw". A table wider than its box scrolls inside .tbl / .scroll. */
table.data th, table.data td.n, table.data td.nw, table.data td .btn, table.data td .pill { white-space: nowrap; }
table.data td.wrap { min-width: 180px; overflow-wrap: anywhere; }
:has(> table.data) { overflow-x: auto; } /* a table wider than its box scrolls inside the box, never the whole page */
.nw { white-space: nowrap; }
table.data th {font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
table.data tr:hover td { background: var(--primary-soft); cursor: pointer; }
body.app-mode .chart text { font-size: 18px; }

/* ---------- accessibility theme modifiers (toggled by themes.js) ---------- */
.u-links a:not(.btn):not(.chip):not(.sso):not(.me):not(.cheer-btn):not(.lb-row):not([data-nav]):not([data-display]) { text-decoration: underline; text-underline-offset: 2px; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.t-grayscale { filter: grayscale(1); }
.t-pill .btn, .t-pill .chip, .t-pill .seg, .t-pill .seg button, .t-pill input, .t-pill select { border-radius: 999px; }
.t-pill textarea { border-radius: 16px; }
.t-spacing body { letter-spacing: .035em; word-spacing: .14em; }
.t-spacing h1, .t-spacing h2, .t-spacing h3 { letter-spacing: .01em; line-height: 1.3; }
.t-outlined .btn { border: 2px solid var(--primary-2); }
.t-outlined .btn.secondary, .t-outlined .btn.ghost { border-color: var(--muted); }
.t-outlined input, .t-outlined select, .t-outlined textarea { border-width: 2px; }
.t-thick :focus-visible { outline: 4px solid var(--primary); outline-offset: 3px; }
.t-thick .card, .t-thick input, .t-thick select, .t-thick textarea, .t-thick .chip { border-width: 2px; }
.t-thick .nav a.active { outline: 2px solid var(--primary); }
html[data-theme="contrast"] .card, html[data-theme="contrast"] .modal { box-shadow: none; border: 2px solid var(--line); }
html[data-theme="contrast"] .chip.active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
html[data-theme="contrast"] .heat span { outline: 1px solid #555; }
html[data-theme="night"] .card { box-shadow: none; }
html[data-theme="calm"] .card { box-shadow: 0 2px 20px rgba(60,50,110,.06); }
html[data-theme="vibrant"] h1 { letter-spacing: -.03em; }
html[data-theme="vibrant"] .goal-card { border-top-width: 6px; }

/* ---------- display & accessibility picker ---------- */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 12px; }
body.app-mode .theme-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 8px; }
.modal .row.between > h2 { min-width: 0; overflow-wrap: anywhere; }
.modal .row.between > [data-close] { flex-shrink: 0; }
.modal .btn { white-space: normal; max-width: 100%; height: auto; min-height: fit-content; }
.theme-tile { text-align: left; cursor: pointer; border: 2px solid var(--t-line); background: var(--t-bg); color: var(--t-ink); border-radius: 14px; padding: 12px; font-family: var(--t-sans); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.theme-tile:hover { border-color: var(--t-primary); }
.theme-tile[aria-pressed="true"] { border-color: var(--t-primary); box-shadow: 0 0 0 3px var(--t-primary); }
.theme-tile .tt-aa { font-family: var(--t-display); font-size: 26px; font-weight: 700; line-height: 1; }
.theme-tile .tt-sw { display: flex; gap: 4px; }
.theme-tile .tt-sw i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--t-line); }
.theme-tile .tt-name { font-weight: 700; font-size: 14px; }
.theme-tile .tt-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--t-muted); }
.theme-tile .tt-desc { font-size: 12px; color: var(--t-muted); line-height: 1.4; }
.theme-tile .tt-btn { align-self: flex-start; background: var(--t-primary); color: var(--t-on-primary); border-radius: 8px; padding: 3px 9px; font-size: 12px; font-weight: 700; }
.modal.wide { width: min(900px, 100%); }

/* ---------- web sidebar ad (free plan only) ---------- */
.ad-side { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); font-size: 13px; }
#ad-side-slot:not(:empty) { margin-top: auto; margin-bottom: 10px; }
#ad-side-slot:not(:empty) + .me { margin-top: 0; }

/* ---------- task outcomes ---------- */
html[data-theme="night"] { --st-done: #4cc06a; --st-partial: #f0b43c; --st-missed: #ff7a6e; --st-planned: #6ea8ff; --st-partial-ink: #f0b43c; }
html[data-theme="contrast"] { --st-done: #3dff6e; --st-partial: #ffb000; --st-missed: #ff5c5c; --st-planned: #5cb3ff; --st-partial-ink: #ffb000; }
html[data-theme="colourblind"] { --st-done: #009E73; --st-partial: #E69F00; --st-missed: #D55E00; --st-planned: #0072B2; --st-partial-ink: #935c00; }
.st-icon { flex: none; vertical-align: middle; }
.st-select { width: auto; max-width: 100%; font-size: 13px; padding: 6px 8px; border-width: 2px; font-weight: 600; flex: none; }
.st-select.st-planned { border-color: var(--st-planned); }
.st-select.st-done { border-color: var(--st-done); }
.st-select.st-partial { border-color: var(--st-partial); }
.st-select.st-missed { border-color: var(--st-missed); }
.st-attn { box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-partial) 35%, transparent); animation: attn 1.6s ease-in-out infinite; }
@keyframes attn { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--st-partial) 15%, transparent); } }
.list > li[data-task] { align-items: flex-start; }
.list > li[data-task] > .st-icon { margin-top: 2px; }
.list > li.needs-update { background: color-mix(in srgb, var(--st-partial) 10%, transparent); border-radius: 10px; padding-left: 8px; padding-right: 8px; }
.attn-card { border: 2px solid var(--st-partial); }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; margin-top: 8px; }
.st-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.st-count { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.st-count b { font-size: 18px; }
.cal .ev svg { vertical-align: -2px; margin-right: 3px; }
.cal .ev.st-ev-missed { opacity: .75; }
.cal .ev.st-attn { outline: 2px dashed var(--st-partial); animation: none; box-shadow: none; }
.cal.compact .ev, body.app-mode .cal .ev { font-size: 0; height: auto; padding: 0; background: none; border: 0; display: inline-block; outline: none; }
.cal.compact .ev svg, body.app-mode .cal .ev svg { width: 13px; height: 13px; margin: 0 1px 0 0; }
.cal.compact .day, body.app-mode .cal .day { flex-direction: row; flex-wrap: wrap; align-content: flex-start; }
.cal.compact .day .num, body.app-mode .cal .day .num { width: 100%; }
.cal.compact .day.today .num, body.app-mode .cal .day.today .num { width: 22px; margin-right: calc(100% - 22px); }
.dash > *, .grid > * { min-width: 0; }
body.app-mode .cal .day { padding: 4px 3px; min-width: 0; }

/* combined goals chart */
.goal-chip { display: inline-flex; align-items: center; gap: 6px; }
.goal-chip[aria-pressed="true"] { border-color: var(--gc); background: color-mix(in srgb, var(--gc) 12%, var(--surface)); color: var(--ink); }
.goal-chip[aria-pressed="false"] { opacity: .55; text-decoration: line-through; }
.gold-star { filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }

/* greeting fact + reminders */
.fact { margin: 8px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--gold-soft); border-left: 4px solid var(--gold); font-size: 14px; max-width: 760px; }
.fact-tag { font-weight: 700; color: var(--gold-ink); margin-right: 4px; }
.linkish { background: none; border: 0; padding: 0; margin-left: 4px; color: var(--primary); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.reminders { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 210; display: flex; flex-direction: column; gap: 8px; width: min(460px, calc(100vw / var(--text-scale, 1) - 24px)); }
body.app-mode .reminders { bottom: auto; top: 12px; }
.reminder-pop { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--gold); border-left: 8px solid var(--primary); border-radius: 14px; padding: 12px 14px; box-shadow: 0 12px 34px rgba(0,0,0,.22); animation: pop .3s; }
.bell { font-size: 15px; padding: 4px 6px; }

/* Placeholder text: the browser default grey fails on dark and tinted themes */
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Goal Mate! AI coach chat (paid plans) */
.coach-card { max-width: 760px; }
.coach-log { display: flex; flex-direction: column; gap: 10px; max-height: min(60vh, 560px); overflow-y: auto; padding: 4px 2px; }
.coach-msg { display: flex; flex-direction: column; max-width: 85%; gap: 2px; }
.coach-msg.me { align-self: flex-end; align-items: flex-end; }
.coach-msg.coach { align-self: flex-start; }
.coach-bubble { padding: 10px 14px; border-radius: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.coach-msg.me .coach-bubble { background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.coach-msg.coach .coach-bubble { background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 4px; }
#coach-in { width: 100%; resize: vertical; }
