:root {
  color-scheme: dark;
  --ink: #faf7ff;
  --ink-soft: #e8e0f4;
  --muted: #c9bedc;
  --line: #62577d;
  --line-strong: #8d81aa;
  --surface: #352e59;
  --surface-soft: #211b40;
  --surface-blue: #473c69;
  --surface-raised: #4b3f71;
  --citrus: #efddff;
  --citrus-deep: #c7a9ec;
  --urgent-surface: #42366d;
  --urgent-ink: #faf7ff;
  --urgent-muted: #e8def6;
  --urgent-action: #f0defe;
  --urgent-action-text: #302344;
  --focus: #f1d3ff;
  --danger: #ffd0d9;
  --danger-soft: #59344b;
  --shadow: 0 24px 55px rgba(0, 0, 0, .3);
  --radius-control: 13px;
  --radius-surface: 16px;
  --radius-dialog: 18px;
  --primary-bg: #f0defe;
  --primary-text: #302344;
  --primary-hover: #ffffff;
  --privacy-cover-bg: #17122f;
  --privacy-card-bg: #38305c;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 0; min-height: 100%; background: #19172c; scrollbar-color: #746189 #211b40; }
body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse 64% 32% at 92% -8%, rgba(142, 116, 199, .37), transparent 74%),
    radial-gradient(ellipse 75% 38% at -28% 72%, rgba(104, 76, 161, .17), transparent 78%),
    linear-gradient(170deg, #292249 0%, #211b40 50%, #19172c 100%);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { color: #251936; background: #ddc3fa; }
button, input, textarea { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible,
.check-card:has(input:focus-visible), .radio-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
input, textarea { caret-color: #7a4ab2; }
[hidden] { display: none !important; }
.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;
}
.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-control);
  color: var(--primary-text);
  background: var(--citrus);
  transform: translateY(-170%);
}
.skip-link:focus { transform: translateY(0); }
.ui-icon { display: block; width: 23px; height: 23px; flex: 0 0 auto; }

/* First use takes place in the same violet world as the app. */
.age-gate {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 72% 24%, rgba(187, 151, 229, .19), transparent 36%),
    linear-gradient(155deg, #2f2752, #1b1637);
}
.age-gate-card {
  width: min(100%, 510px);
  padding: clamp(28px, 6vw, 46px);
  border-radius: var(--radius-dialog);
  background: #3a315f;
  box-shadow: var(--shadow);
}
.age-gate-card > .brand-mark { margin-bottom: 30px; }
.age-gate-card > .brand-mark, .privacy-cover-card .brand-mark { width: 50px; height: 50px; border-radius: 0; color: #ead0ff; background: transparent; }
.age-gate-card > .brand-mark .ui-icon, .privacy-cover-card .brand-mark .ui-icon { width: 42px; height: 42px; }
.age-gate h1 { max-width: 17ch; margin-bottom: 15px; }
.age-gate-copy { max-width: 52ch; margin-bottom: 0; color: var(--ink-soft); }
.age-gate-actions { display: grid; gap: 10px; margin-top: 29px; }
.age-gate-actions .button { width: 100%; }
.age-gate-message { min-height: 1.5em; margin: 17px 0 0; color: var(--muted); font-size: .88rem; }
.age-gate-message:empty { display: none; }
.age-gate-message.is-blocked { color: var(--danger); }

.page-shell { width: min(100% - 44px, 1060px); min-height: 100dvh; margin: 0 auto; padding-bottom: 36px; }
.site-header {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(213, 196, 240, .14);
}
.brand {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.015em;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px;
  color: var(--primary-text);
  background: var(--citrus);
  font-size: 1.3rem;
  line-height: 1;
}
.brand-mark .ui-icon { width: 24px; height: 24px; }
.header-actions { display: flex; min-width: 0; align-items: center; justify-content: flex-end; gap: 6px; }
.header-button {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: .84rem;
  font-weight: 650;
  white-space: nowrap;
}
.header-support { padding-inline: 14px; border-color: #75648f; color: var(--ink); background: #554773; }
#settingsButton.has-update { position: relative; }
#settingsButton.has-update::after { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: #f0defe; box-shadow: 0 0 0 2px #292249; content: ""; }
.offline-status { color: var(--muted); font-size: .85rem; line-height: 1.35; }
.alert {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-size: .9rem;
}
.alert-error { border-color: #a86880; color: #ffe1e6; background: var(--danger-soft); }
.toast {
  position: fixed;
  z-index: 40;
  right: 18px;
  bottom: 20px;
  max-width: min(360px, calc(100% - 36px));
  padding: 13px 17px;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: #51436f;
  box-shadow: var(--shadow);
  font-size: .9rem;
}

.app-shell { padding-top: 13px; }
.view-nav { display: flex; gap: 5px; width: fit-content; max-width: 100%; padding: 4px; border-radius: 14px; background: #322a51; }
.nav-tab {
  min-height: 44px;
  padding: 8px 19px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 650;
}
.nav-tab.is-active { color: var(--ink); background: var(--surface-blue); }
.view-panel { min-width: 0; padding-top: 34px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; margin-bottom: 26px; }
.section-heading > :first-child { min-width: 0; }
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: .82rem; font-weight: 650; line-height: 1.3; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: var(--ink); letter-spacing: -.027em; text-wrap: balance; }
h1 { max-width: 19ch; margin-bottom: 12px; font-size: clamp(2.15rem, 3.7vw, 2.9rem); font-weight: 720; line-height: 1.09; }
h2 { margin-bottom: 8px; font-size: 1.25rem; font-weight: 680; line-height: 1.21; }
.hero-copy { max-width: 58ch; margin-bottom: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.46; }
.quiet-badge, .count-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-blue);
  font-size: .78rem;
  font-weight: 650;
  white-space: nowrap;
}
.count-pill { min-width: 30px; color: var(--primary-text); background: var(--citrus); }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(230px, .7fr); gap: 28px; align-items: start; }
.today-main, .today-side { display: grid; min-width: 0; gap: 19px; }
.card { min-width: 0; border-radius: var(--radius-surface); background: var(--surface); }
.current-card, .plan-preview-card, .history-card, .progress-card, .form-card { padding: 23px 24px; }
.support-card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px 26px;
  align-items: center;
  overflow: hidden;
  padding: 23px 27px;
  border-radius: var(--radius-surface);
  background:
    radial-gradient(circle at 72% 5%, rgba(182, 147, 225, .24), transparent 39%),
    linear-gradient(145deg, #514277, #3c3165 69%, #352b5b);
  box-shadow: 0 20px 42px rgba(0, 0, 0, .22);
}
.today-main .support-card { order: -1; }
.support-orbit { position: absolute; z-index: 0; top: -65px; right: -20px; width: 185px; height: 185px; color: rgba(239, 221, 255, .24); pointer-events: none; }
.support-orbit svg { display: block; width: 100%; height: 100%; transform: rotate(-12deg); }
.support-card-copy { min-width: 0; }
.support-card h2 { max-width: 21ch; margin-bottom: 9px; font-size: clamp(1.5rem, 2.5vw, 1.9rem); line-height: 1.14; }
.support-card .card-copy { max-width: 39ch; margin-bottom: 0; color: var(--urgent-muted); }
.support-card .button-primary { align-self: center; border-color: var(--urgent-action); color: var(--urgent-action-text); background: var(--urgent-action); }
.support-card .button-large { min-width: 170px; }
.card-heading-row { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-heading-row > * { min-width: 0; }
.card-heading-row h2 { margin-bottom: 0; }
.card-icon { display: grid; width: 37px; height: 37px; flex: 0 0 37px; place-items: center; border-radius: 11px; color: var(--citrus); background: var(--surface-blue); }
.timer-label { margin: 18px 0 4px; color: var(--muted); font-size: .88rem; }
.timer-display {
  overflow-wrap: anywhere;
  margin-bottom: 11px;
  color: var(--ink);
  font-size: clamp(1.55rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}
.timer-display.is-quiet { margin-top: 9px; color: var(--ink-soft); font-size: 1.08rem; font-weight: 600; letter-spacing: 0; font-variant-numeric: normal; }
.card-copy { margin-bottom: 16px; color: var(--ink-soft); font-size: .94rem; line-height: 1.5; }
.button-row, .button-actions, .form-actions, .settings-actions, .dialog-actions { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 17px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 700;
  line-height: 1.24;
  text-align: center;
  transition: transform 110ms ease-out, background-color 110ms ease-out, border-color 110ms ease-out;
}
.button:disabled { border-color: #514969; color: #b6abc7; background: #302a49; cursor: not-allowed; opacity: 1; }
.button-primary { border-color: var(--primary-bg); color: var(--primary-text); background: var(--primary-bg); }
.button-secondary { border-color: var(--line-strong); color: var(--ink); background: #443a67; }
.button-quiet, .text-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 650;
  line-height: 1.25;
}
.button-danger { border-color: #a36b82; color: #ffe6eb; background: var(--danger-soft); }
.button-large { min-height: 54px; font-size: 1rem; }
.secondary-actions { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 7px; }
.plan-preview-card .card-copy { margin-top: 15px; margin-bottom: 9px; }
.plan-preview-card .card-heading-row > .text-button { flex: 0 0 auto; white-space: nowrap; }
.compact-list, .metric-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.compact-list li, .metric-list li { display: flex; min-height: 34px; align-items: center; gap: 9px; color: var(--ink-soft); font-size: .91rem; }
.compact-list li::before { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--citrus-deep); content: ""; }
.history-card .card-heading-row { margin-bottom: 14px; }
.today-side { gap: 18px; }
.record-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.record-item { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 13px 0; border-top: 1px solid var(--line); }
.record-dot { width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--citrus-deep); }
.record-title { margin: 0; color: var(--ink); font-size: .91rem; font-weight: 650; }
.record-detail, .record-time { color: var(--muted); font-size: .83rem; }
.record-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-actions { display: flex; flex-wrap: wrap; gap: 1px; grid-column: 2 / -1; }
.record-actions .text-button { min-width: 44px; padding-inline: 5px; font-size: .83rem; }
.empty-state { display: grid; justify-items: start; padding: 14px 0 0; color: var(--muted); text-align: left; }
.empty-state p { margin: 0 0 4px; color: var(--ink); font-size: .92rem; font-weight: 650; }
.empty-state span { font-size: .85rem; }
.compact-empty { padding: 12px 0 0; }
.privacy-note { margin: 0 2px; color: var(--muted); font-size: .85rem; line-height: 1.48; }
.site-footer { display: flex; gap: 7px; margin-top: 30px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }

/* Progress is for interpreting saved records, so its surfaces stay quiet. */
.range-toggle { display: flex; flex: 0 0 auto; gap: 3px; padding: 3px; border-radius: var(--radius-control); background: #342d58; }
.range-button { min-height: 44px; padding: 8px 13px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; cursor: pointer; font-size: .88rem; font-weight: 650; }
.range-button.is-active { color: var(--primary-text); background: var(--citrus); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 19px; }
.stat-card { display: flex; min-height: 112px; flex-direction: column; justify-content: space-between; padding: 17px; background: var(--surface); }
.stat-value { display: block; overflow-wrap: anywhere; color: var(--ink); font-size: clamp(1.3rem, 2.7vw, 1.85rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.12; font-variant-numeric: tabular-nums; }
.stat-label { display: block; margin-top: 9px; color: var(--muted); font-size: .84rem; line-height: 1.3; }
.progress-card, .history-card { margin-bottom: 18px; }
.progress-card > .card-copy { margin: 13px 0 18px; }
#weeklyReviewPlanButton { margin-top: 17px; }
.days-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; min-height: 134px; align-items: end; margin-top: 18px; padding: 8px 0; border-bottom: 1px solid var(--line-strong); }
.day-bar { display: grid; min-width: 0; height: 112px; grid-template-rows: 1fr auto; align-items: end; gap: 7px; }
.day-bar-track { display: flex; height: 96px; align-items: flex-end; justify-content: center; }
.day-bar-fill { display: block; width: 64%; min-height: 4px; border-radius: 5px 5px 2px 2px; background: var(--citrus-deep); }
.day-bar-fill.is-empty { height: 4px; background: #9e8bb9; }
.day-bar.is-partial .day-bar-fill, .day-bar.is-current .day-bar-fill { background: #a99bbb; }
.day-bar.is-untracked .day-bar-fill { background: transparent; border: 1px dashed #ab9cbd; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px 15px; margin: 9px 0 0; color: var(--muted); font-size: .81rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-mark { display: inline-block; width: 14px; height: 7px; border-radius: 3px; background: var(--citrus-deep); }
.legend-mark.is-empty { background: #9e8bb9; }
.legend-mark.is-partial { background: #a99bbb; }
.legend-mark.is-untracked { background: transparent; border: 1px dashed #ab9cbd; }
.bar-level-1 { height: 17%; }.bar-level-2 { height: 34%; }.bar-level-3 { height: 51%; }.bar-level-4 { height: 68%; }.bar-level-5 { height: 85%; }.bar-level-6 { height: 100%; }
.day-bar-label { overflow: hidden; color: var(--muted); font-size: .75rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.days-accessible-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 18px; margin: 14px 0 0; padding: 0; list-style: none; }
.days-accessible-list li { color: var(--ink-soft); font-size: .85rem; }
.metric-note { margin: 14px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.48; }
.metric-list { margin-top: 13px; }
.metric-list:empty { display: none; }
.metric-list li { justify-content: space-between; border-top: 1px solid var(--line); }
.metric-list li strong { color: var(--ink); font-weight: 650; }
.metric-list li span { color: var(--muted); }

/* Plan fields and choices retain clear touch surfaces. */
.plan-form { display: grid; gap: 15px; max-width: 760px; }
.form-card { margin: 0; }
.field-label, legend { display: block; margin-bottom: 10px; color: var(--ink); font-size: .96rem; font-weight: 650; }
.field-optional { color: var(--muted); font-size: .82rem; font-weight: 500; }
.field-hint { margin: 7px 0 0; color: var(--muted); font-size: .82rem; }
textarea, .text-input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: #2d2441;
  background: #eee5f8;
  font-size: 16px;
  line-height: 1.4;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #625573; opacity: 1; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.check-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
.check-card, .radio-card { display: flex; min-width: 0; min-height: 61px; gap: 10px; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: var(--radius-control); background: #413662; cursor: pointer; }
.check-card:has(input:checked), .radio-card:has(input:checked) { border-color: #d9bdf5; background: #5b497f; }
.check-card:has(input:checked) small, .radio-card:has(input:checked) small { color: #e2d7ef; }
.check-card input, .radio-card input, .check-line input { flex: 0 0 auto; width: 21px; height: 21px; margin: 1px 0 0; accent-color: #d9bdf5; }
.check-card span, .radio-card span { min-width: 0; }
.check-card strong, .check-card small, .radio-card strong, .radio-card small { display: block; }
.check-card strong, .radio-card strong { font-size: .92rem; font-weight: 650; line-height: 1.3; }
.check-card small, .radio-card small { margin-top: 4px; color: var(--muted); font-size: .82rem; line-height: 1.4; }
.form-heading { margin: 0; font-size: 1.17rem; }
.if-then-rows { display: grid; gap: 13px; margin-top: 16px; }
.if-then-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.if-then-row label { min-width: 0; }
.if-then-row .text-input { font-size: 16px; }
.remove-line { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; border-radius: 12px; color: var(--danger); background: #51344b; cursor: pointer; }
.form-actions { margin-top: 4px; }
.save-status { color: var(--muted); font-size: .86rem; }

/* Dialogs use a compact sheet, while urgent support takes the entire phone. */
.app-dialog { width: min(calc(100% - 24px), 540px); max-width: 540px; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; border-radius: var(--radius-dialog); color: var(--ink); background: transparent; box-shadow: var(--shadow); }
.app-dialog::backdrop { background: rgba(8, 5, 23, .76); }
.dialog-card { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; padding: 25px; border-radius: var(--radius-dialog); background: #382f5b; }
.dialog-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dialog-topline > :first-child { min-width: 0; }
.dialog-topline h2 { margin: 2px 0 0; font-size: clamp(1.35rem, 4vw, 1.7rem); }
.dialog-top-actions { display: flex; flex: 0 0 auto; align-items: flex-start; gap: 4px; }
.icon-button { display: grid; width: 44px; height: 44px; flex: 0 0 44px; place-items: center; padding: 0; border: 0; border-radius: 12px; color: var(--ink); background: #4a3c70; cursor: pointer; font-size: 1.6rem; line-height: 1; }
.icon-button .ui-icon { width: 22px; height: 22px; }
.dialog-copy { margin: 16px 0 21px; color: var(--ink-soft); font-size: .96rem; line-height: 1.51; }
.dialog-actions { margin-top: 22px; justify-content: flex-end; }
.dialog-actions .button { flex: 1 1 140px; }
.form-error { margin: 11px 0 0; color: var(--danger); font-size: .88rem; }
.radio-stack { display: grid; gap: 9px; margin-bottom: 19px; }
.radio-card { align-items: center; }
.setting-line { margin: 20px 0; }
.settings-group { margin-top: 4px; padding: 16px 0; border-top: 1px solid var(--line); }
.settings-group summary { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 14px; color: var(--ink); cursor: pointer; font-size: 1rem; font-weight: 700; list-style: none; }
.settings-group summary::-webkit-details-marker { display: none; }
.settings-group summary::after { width: 9px; height: 9px; flex: 0 0 9px; margin-right: 5px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform 110ms ease-out; content: ""; }
.settings-group[open] summary::after { transform: rotate(225deg); }
.settings-group summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 5px; }
.settings-group > .metric-note:first-of-type { margin-top: 8px; }
.settings-group .settings-actions { margin-top: 17px; }
.settings-group .import-section { margin-top: 0; padding-top: 0; border-top: 0; }
.settings-group .import-section h3 { margin: 19px 0 0; color: var(--ink); font-size: .94rem; font-weight: 700; line-height: 1.35; }
.settings-group > .button { margin-top: 14px; }
.file-choice { position: relative; display: grid; width: 100%; min-height: 48px; place-items: center; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); background: var(--surface-blue); font-weight: 650; text-align: center; }
.file-choice .import-file { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.file-choice:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.file-choice:has(input:disabled) { color: var(--muted); background: var(--surface); border-color: var(--line); }
.file-choice:has(input:disabled) input { cursor: not-allowed; }
.file-name { margin: 7px 0 0; color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.settings-danger summary { color: var(--danger); }
.settings-device { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px; padding: 14px; border-radius: var(--radius-control); background: #473b6c; }
.settings-device .offline-status { flex: 1 1 120px; }
.settings-device .button { min-height: 44px; }
.settings-note { padding: 13px 15px; border-radius: var(--radius-control); color: var(--ink-soft); background: #493e69; font-size: .87rem; line-height: 1.46; }
.settings-actions { margin-top: 21px; }
.settings-actions .button { flex: 1 1 165px; }
.import-section { margin-top: 27px; padding-top: 23px; border-top: 1px solid var(--line); }
.import-section h3 { margin: 0; font-size: 1.12rem; }
.import-file-label { display: block; margin-top: 17px; font-size: .9rem; font-weight: 650; }
.import-file { display: block; width: 100%; max-width: 100%; min-height: 44px; margin-top: 8px; font-size: 16px; }
.import-file::file-selector-button { min-height: 40px; margin-right: 9px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: var(--surface-blue); font: inherit; cursor: pointer; }
.import-section .button { margin-top: 13px; }

.support-dialog { width: min(calc(100% - 24px), 620px); max-width: 620px; }
.support-dialog-card { display: flex; min-height: min(580px, calc(100dvh - 24px)); flex-direction: column; }
.support-dialog .dialog-topline { align-items: flex-start; }
.support-dialog .quiet-badge { margin-top: 5px; }
.support-step { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 29px 0 5px; }
.support-step h2 { max-width: 22ch; margin-bottom: 12px; font-size: clamp(1.75rem, 4.7vw, 2.3rem); line-height: 1.13; }
.support-step-number { margin: 0 0 11px; color: var(--citrus); font-size: .87rem; font-weight: 700; }
.support-actions { justify-content: flex-start; }
.support-actions .button { flex: 1 1 190px; }
.support-step > .support-actions { margin-top: auto; padding-top: 19px; }
.support-actions .button-quiet { flex-basis: 100%; justify-content: flex-start; text-align: left; }
.option-stack { display: grid; gap: 9px; }
.option-button { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; min-height: 65px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-control); color: var(--ink); background: #493d70; cursor: pointer; text-align: left; }
.option-icon { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; color: var(--primary-text); background: var(--citrus); }
.option-button strong, .option-button small { display: block; }
.option-button strong { font-size: .95rem; line-height: 1.25; }
.option-button small { margin-top: 4px; color: var(--ink-soft); font-size: .83rem; line-height: 1.32; }
.option-arrow { color: var(--citrus); font-size: 1.2rem; }
.urge-timer-block { display: grid; width: min(100%, 260px); gap: 4px; margin: 19px 0 6px; padding: 17px 19px; border-radius: var(--radius-control); background: #4e4174; }
.urge-timer-block strong { color: var(--ink); font-size: 2.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.feeling-grid { display: grid; gap: 9px; }
.feeling-button { min-height: 52px; padding: 12px 15px; border: 1px solid var(--line-strong); border-radius: var(--radius-control); color: var(--ink); background: #493d70; cursor: pointer; font-weight: 650; text-align: left; }
.feeling-button.is-selected { border-color: #e8c9ff; color: var(--primary-text); background: var(--citrus); }
.check-stack { display: grid; gap: 10px; margin-top: 22px; }
.check-line { display: flex; min-height: 48px; align-items: flex-start; gap: 10px; color: var(--ink-soft); font-size: .93rem; cursor: pointer; }
.danger-button { align-self: start; margin-top: 16px; color: var(--danger); }
.temporary-note { margin-top: auto; padding-top: 19px; color: var(--muted); font-size: .82rem; }

.privacy-cover { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--privacy-cover-bg); }
.privacy-cover-card { width: min(100%, 360px); padding: 34px 27px; border-radius: var(--radius-surface); color: var(--ink); background: var(--privacy-card-bg); text-align: center; box-shadow: var(--shadow); }
.privacy-cover-card h2 { color: var(--ink); }
.privacy-cover-card p:not(.eyebrow) { color: var(--ink-soft); }
.privacy-cover-card .brand-mark { margin: 0 auto 21px; }
.privacy-cover-card .button { width: 100%; margin-top: 12px; }
.mobile-bottom-nav { display: none; }
.noscript-note { position: fixed; z-index: 100; inset: auto 12px 12px; padding: 14px; border: 1px solid #a86880; border-radius: 11px; color: #ffe1e6; background: var(--danger-soft); }

@media (hover: hover) {
  .header-button:hover, .icon-button:hover, .nav-tab:hover, .text-button:hover, .button-quiet:hover, .remove-line:hover { background: #5b4d7e; color: var(--ink); }
  .header-support:hover { background: #68568c; }
  .button-primary:hover:not(:disabled), .support-card .button-primary:hover:not(:disabled) { border-color: var(--primary-hover); background: var(--primary-hover); }
  .button-secondary:hover:not(:disabled), .option-button:hover, .feeling-button:hover:not(.is-selected), .check-card:hover, .radio-card:hover { border-color: #c0a9dd; background: #574978; }
  .button-danger:hover:not(:disabled) { border-color: #f2aabe; background: #694052; }
  .range-button:hover:not(.is-active), .mobile-bottom-nav button:hover:not([aria-current="page"]) { color: var(--ink); background: #51446f; }
}
:is(.button, .header-button, .icon-button, .nav-tab, .range-button, .text-button, .button-quiet, .option-button, .feeling-button, .remove-line, .mobile-bottom-nav button, .check-card, .radio-card):active:not(:disabled) { transform: scale(.985); filter: brightness(1.13); }

@media (max-width: 1023px) {
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .today-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-side .record-item { grid-template-columns: 9px minmax(0, 1fr); }
  .today-side .record-time { grid-column: 2; grid-row: 2; }
  .today-side .record-actions { grid-column: 2; grid-row: 3; }
}

@media (max-width: 760px) {
  body:has(#appRoot:not([hidden])) { padding-bottom: calc(77px + env(safe-area-inset-bottom)); }
  .page-shell { width: min(100% - 36px, 620px); padding-bottom: 15px; }
  .site-header { min-height: calc(65px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); gap: 4px; flex-wrap: wrap; }
  .brand { gap: 7px; font-size: .97rem; }
  .brand-mark { width: 32px; height: 32px; }
  .header-actions { gap: 3px; flex-shrink: 0; margin-left: auto; }
  .header-button { min-width: 44px; min-height: 44px; padding: 9px; }
  .header-support { min-width: 79px; padding-inline: 10px; font-size: .81rem; }
  .toast { bottom: calc(83px + env(safe-area-inset-bottom)); }
  .view-nav { display: none; }
  .view-panel { padding-top: 19px; }
  .section-heading { display: block; margin-bottom: 19px; }
  .section-heading > .quiet-badge { margin-top: 14px; }
  h1 { font-size: clamp(2rem, 7.8vw, 2.65rem); }
  .today-grid, .today-side { grid-template-columns: 1fr; }
  .today-main { gap: 16px; }
  .today-side { order: 2; gap: 16px; }
  .support-card { grid-template-columns: 1fr; gap: 21px; padding: 18px 0 27px; border-radius: 0; background: transparent; box-shadow: none; }
  .support-card h1 { margin-bottom: 17px; }
  .support-card::before { content: ""; position: absolute; z-index: 0; top: 0; right: -45px; width: 210px; height: 190px; border-radius: 48% 42% 58% 62%; background: radial-gradient(ellipse at 62% 42%, rgba(174, 145, 211, .15), rgba(174, 145, 211, .055) 44%, transparent 70%); pointer-events: none; }
  .support-orbit { top: 0; right: 2px; width: 70px; height: 70px; color: rgba(239, 221, 255, .3); opacity: 1; }
  .support-orbit svg { transform: none; }
  .support-card-copy, .support-card > .button { position: relative; z-index: 1; }
  .support-card h2 { max-width: 24ch; margin-bottom: 7px; font-size: 1.5rem; }
  .support-card .card-copy { max-width: 30ch; margin: 0; font-size: 1rem; line-height: 1.5; }
  .support-card .button-large { width: 100%; min-width: 0; margin-top: 5px; }
  .current-card, .plan-preview-card, .history-card, .progress-card, .form-card { padding: 19px 0 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 21px; margin-bottom: 16px; }
  .stat-card { min-height: 77px; padding: 9px 0 12px; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
  .stat-value { font-size: 1.42rem; }
  .stat-label { margin-top: 3px; }
  .range-toggle { width: fit-content; margin-top: 14px; }
  .check-grid { grid-template-columns: 1fr; }
  .mobile-bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 4px;
    padding: 6px max(12px, env(safe-area-inset-left)) max(6px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
    border-top: 1px solid #5e527b;
    background: #2d254c;
    box-shadow: 0 -12px 28px rgba(0, 0, 0, .16);
  }
  .mobile-bottom-nav button { display: flex; min-height: 57px; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 5px; border: 0; border-radius: 12px; color: var(--muted); background: transparent; cursor: pointer; font-size: .75rem; font-weight: 650; line-height: 1.2; }
  .mobile-bottom-nav .ui-icon { width: 22px; height: 22px; }
  .mobile-bottom-nav button[aria-current="page"] { color: var(--ink); background: #52446f; }
  .app-dialog { width: min(calc(100% - 16px), 540px); max-height: calc(100dvh - 16px); }
  .dialog-card { max-height: calc(100dvh - 16px); padding: 23px 20px; }
  .support-dialog { inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; box-shadow: none; }
  .support-dialog-card { width: 100%; min-height: 100dvh; max-height: 100dvh; padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); border-radius: 0; background: radial-gradient(circle at 88% 28%, rgba(120, 93, 178, .35), transparent 35%), linear-gradient(165deg, #342a58, #241d46 70%); }
  .support-dialog .dialog-topline { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: start; gap: 8px; }
  .support-dialog .dialog-topline > :first-child { flex: 1 1 120px; }
  .support-dialog .dialog-top-actions { margin-left: auto; }
  .support-dialog .quiet-badge { display: block; max-width: 100%; min-height: 0; margin: 11px 0 0; padding: 0; border-radius: 0; color: var(--muted); background: transparent; font-size: .81rem; line-height: 1.25; text-align: left; white-space: normal; }
  .support-step { padding-top: clamp(42px, 8dvh, 80px); padding-bottom: 0; }
  #supportChoicesStep, #supportCheckinStep { padding-top: clamp(25px, 4dvh, 38px); }
  .support-step h2 { font-size: clamp(2rem, 6.4vw, 2.6rem); }
  .support-step .dialog-copy { margin-top: 15px; font-size: 1rem; }
  .support-step > .support-actions { padding-top: 30px; }
  #supportStartStep > .support-actions { margin-bottom: auto; }
  #supportActiveStep > .danger-button { margin-bottom: auto; }
  #supportCheckinStep > .support-actions { margin-top: 20px; padding-top: 0; }
  .support-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 10px; width: 100%; }
  .support-actions .button { width: 100%; }
  .support-actions .button-quiet { justify-content: center; }
  .support-step .option-stack { margin-top: 1px; }
  .support-step > .button-quiet { align-self: start; margin-top: 20px; }
}

@media (max-width: 430px) {
  .days-chart.is-month .day-bar { height: 62px; }
  .days-chart.is-month .day-bar-track { height: 46px; }
  .age-gate { padding-inline: 14px; }
  .age-gate-card { padding: 28px 22px; }
  .page-shell { width: min(100% - 32px, 620px); }
  h1 { font-size: clamp(1.94rem, 8.4vw, 2.25rem); }
  .current-card, .plan-preview-card, .history-card, .progress-card, .form-card { padding: 19px 0 0; }
  .button-row .button { flex: 1 1 100%; }
  .if-then-row { grid-template-columns: 1fr auto; }
  .if-then-row label:first-child { grid-column: 1 / -1; }
  .record-item { grid-template-columns: 9px minmax(0, 1fr); }
  .record-time { grid-column: 2; grid-row: 2; }
  .days-accessible-list { grid-template-columns: 1fr; }
  .dialog-card { padding: 22px 18px; }
  .support-dialog-card { padding: max(21px, env(safe-area-inset-top)) 21px max(21px, env(safe-area-inset-bottom)); }
  .support-dialog .dialog-topline .quiet-badge { font-size: .76rem; }
  .support-dialog .header-button { min-width: 44px; padding-inline: 8px; font-size: .78rem; }
}

@media (max-height: 700px) and (max-width: 760px) {
  .support-step { padding-top: 25px; }
  .support-step > .support-actions { padding-top: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  :is(.button, .header-button, .icon-button, .nav-tab, .range-button, .text-button, .button-quiet, .option-button, .feeling-button, .remove-line, .mobile-bottom-nav button, .check-card, .radio-card):active:not(:disabled) { transform: none; }
}
