/* components.css
   Component classes built from the planner-theme-palettes recipes (brief Section 10.4). Every color is a token.
   Layout utilities come from Tailwind (styles/tailwind.css); these classes cover what utilities can't express
   cleanly: the app shell, buttons, cards, chips, form controls, sheets, modals, toasts and banners. */

/* =============================== APP SHELL =============================== */
.app-shell { min-height: 100vh; min-height: 100dvh; }

.sidebar {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 70;
  width: min(86vw, 320px);
  background: var(--nav-bg); color: var(--nav-text);
  display: flex; flex-direction: column;
  transform: translateX(-105%);
  transition: transform 240ms var(--ease);
  overflow-y: auto; overscroll-behavior: contain;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-pop); }
.sidebar-stripe { height: 6px; flex: 0 0 6px; background: var(--brand-stripe); }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 18px 10px; }
.sidebar-tag { font-size: .8125rem; color: var(--nav-text); margin-top: 2px; }
.sidebar-close { display: inline-flex; }
.nav-list { list-style: none; margin: 0; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-divider { height: 1px; background: color-mix(in srgb, var(--nav-text) 14%, transparent); margin: 8px 16px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; min-height: 48px;
  padding: 8px 12px; border-radius: 12px;
  color: var(--nav-text); text-decoration: none; font-weight: 500;
  border: 0; background: transparent; width: 100%; text-align: left;
}
.nav-item .icon { color: var(--nav-icon); flex: 0 0 auto; }
@media (hover: hover) { .nav-item:hover { background: var(--nav-hover-bg); } }
.nav-item[aria-current="page"] {
  background: var(--nav-active-bg); color: var(--nav-active-text);
  box-shadow: inset 3px 0 0 var(--accent-1-deep);
}
.nav-item[aria-current="page"] .icon { color: var(--nav-active-text); }
.nav-text { display: flex; flex-direction: column; min-width: 0; }
.nav-label { font-size: .9375rem; line-height: 1.25; }
.nav-sub { font-size: .8125rem; line-height: 1.3; color: var(--nav-text); font-weight: 400; display: none; }
.sidebar-foot { margin-top: auto; padding: 14px 22px 18px; font-size: .8125rem; color: var(--nav-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+1) .nav-item .icon { color: var(--chip-1-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+2) .nav-item .icon { color: var(--chip-2-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+3) .nav-item .icon { color: var(--chip-3-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+4) .nav-item .icon { color: var(--chip-4-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+5) .nav-item .icon { color: var(--chip-5-text); }
[data-theme="rainbow-pastel"] .nav-list li:nth-child(6n+6) .nav-item .icon { color: var(--chip-6-text); }

.scrim { position: fixed; inset: 0; z-index: 65; background: rgba(20, 20, 30, .32); animation: gp-fade 200ms var(--ease) both; }

.wordmark { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; color: var(--nav-active-text); line-height: 1; letter-spacing: -0.01em; display: inline-flex; align-items: baseline; white-space: nowrap; }
.wordmark .wm-last { position: relative; display: inline-block; }
.wordmark .wm-spark { position: absolute; left: 50%; top: -0.55em; width: .5em; height: .5em; transform: translateX(-50%); color: var(--accent-1-deep); }
.wordmark-mini { display: none; }

.main-wrap { min-width: 0; padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 24px); }
.main { outline: none; max-width: var(--content-max); margin: 0 auto; padding: 16px 16px 32px; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--divider);
}
.topbar-title { font-family: var(--font-display); font-size: 1.125rem; font-weight: 500; color: var(--heading); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.offline-chip { display: none !important; }
.is-offline .offline-chip { display: inline-flex !important; }

.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--bottombar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--nav-bg); border-top: 1px solid var(--border); /* the theme's menu color, same as the desktop side menu */
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: .75rem; font-weight: 600; color: var(--nav-text); text-decoration: none; background: none; border: 0; min-height: 44px;
}
.tab .tab-pill { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 30px; border-radius: 999px; transition: background 150ms var(--ease); }
.tab[aria-current="page"] { color: var(--nav-active-text); }
.tab[aria-current="page"] .tab-pill { background: var(--nav-active-bg); }
.tab .icon { color: var(--nav-icon); }
.tab[aria-current="page"] .icon { color: var(--nav-active-text); }

.fab {
  position: fixed; right: 16px; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 16px); z-index: 45;
  width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--btn-primary-bg); color: var(--btn-primary-text); box-shadow: var(--shadow-lift);
  display: inline-flex; align-items: center; justify-content: center;
}
@media (hover: hover) { .fab:hover { background: var(--btn-primary-hover); } }

@media (min-width: 768px) {
  .main { padding: 24px 28px 48px; }
  .topbar { padding-left: 28px; padding-right: 20px; }
}
/* The side menu is only for computers: a wide screen with a mouse or trackpad. Phones and tablets (iPads included) keep the bottom
   bar and the slide-in menu. Every rule that makes room for the bottom bar switches at this same point (Joanne's call, 2026-11-17). */
@media (min-width: 1024px) and (hover: hover) and (pointer: fine) {
  .sidebar { transform: none; width: var(--sidebar-w); box-shadow: none; }
  .sidebar-head { flex-direction: row; align-items: flex-start; padding: 22px 22px 12px; }
  .sidebar .sidebar-close { display: none; }
  .sidebar-head .wordmark-full, .sidebar-tag, .sidebar-foot { display: block; }
  .wordmark-mini { display: none; }
  .nav-list { padding: 6px 12px; }
  .nav-item { flex-direction: row; text-align: left; justify-content: flex-start; min-height: 52px; padding: 8px 14px; gap: 14px; }
  .nav-item[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent-1-deep); }
  .nav-label { font-size: .9375rem; font-weight: 600; }
  .nav-sub { display: block; }
  .scrim { display: none; }
  .main-wrap { margin-left: var(--sidebar-w); padding-bottom: 104px; }
  .main { padding: 28px 40px 56px; }
  .bottom-bar { display: none; }
  .fab { bottom: 24px; right: 24px; }
  .topbar-title { visibility: hidden; }
  .toast-region { bottom: 24px; }
  .sticky-actions { bottom: 16px; }
}

/* =============================== PAGE HEADER =============================== */
.page-header { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-header .subtitle { color: var(--text-muted); font-size: 1rem; max-width: var(--reading-max); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subtabs-wrap { position: relative; margin: 10px -16px 0; }
.subtabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs-wrap::before, .subtabs-wrap::after { content: ''; position: absolute; top: 0; bottom: 0; width: 18px; pointer-events: none; z-index: 1; }
.subtabs-wrap::before { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.subtabs-wrap::after { right: 0; background: linear-gradient(-90deg, var(--bg), transparent); }
.subtab {
  flex: 0 0 auto; scroll-snap-align: start;
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  font-size: .875rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  color: var(--text-muted); background: var(--surface); border: 1px solid var(--border);
}
@media (hover: hover) { .subtab:hover { background: var(--surface-alt); color: var(--text); } }
.subtab[aria-current="page"] { background: var(--nav-bg); color: var(--nav-active-text); border-color: transparent; }
[data-theme="dark"] .subtab[aria-current="page"] { color: var(--text); background: var(--nav-active-bg); }
@media (min-width: 768px) { .subtabs-wrap { margin: 10px 0 0; } .subtabs { padding: 4px 0 6px; } .subtabs-wrap::before, .subtabs-wrap::after { display: none; } .subtabs { flex-wrap: wrap; } }

/* =============================== BUTTONS =============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--radius-btn);
  font-size: .9375rem; font-weight: 600; line-height: 1.2; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; background: transparent; color: inherit;
  transition: background 150ms var(--ease), transform 80ms var(--ease), border-color 150ms var(--ease);
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-text); }
@media (hover: hover) { .btn-primary:hover { background: var(--btn-primary-hover); } }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-text); }
@media (hover: hover) { .btn-secondary:hover { background: var(--btn-secondary-hover); } }
.btn-ghost { background: transparent; color: var(--btn-ghost-text); border-color: var(--btn-ghost-border); }
@media (hover: hover) { .btn-ghost:hover { background: var(--surface-alt); } }
.btn-danger { background: transparent; color: var(--danger-text); border-color: var(--danger-text); }
@media (hover: hover) { .btn-danger:hover { background: var(--danger-bg); } }
.btn-link { background: none; border: 0; padding: 0 4px; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn-text { background: none; border: 0; padding: 0 8px; color: var(--btn-ghost-text); }
@media (hover: hover) { .btn-text:hover { text-decoration: underline; } }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  background: transparent !important; color: var(--text-muted) !important; border-color: var(--btn-ghost-border) !important; cursor: not-allowed; transform: none;
}
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--text-muted);
}
@media (hover: hover) { .btn-icon:hover { background: var(--surface-alt); color: var(--text); } }
.sidebar .btn-icon { color: var(--nav-text); }
@media (hover: hover) { .sidebar .btn-icon:hover { background: var(--nav-hover-bg); } }
.btn .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: gp-spin .7s linear infinite; }
@keyframes gp-spin { to { transform: rotate(360deg); } }

/* =============================== CARDS =============================== */
.card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); padding: var(--pad);
  transition: transform 150ms var(--ease), box-shadow 150ms var(--ease);
}
.card-accent { border-color: var(--border-accent); border-width: 1.5px; }
.card-alt { background: var(--surface-alt); box-shadow: none; }
.card-dashed { background: transparent; border: 1.5px dashed var(--btn-ghost-border); box-shadow: none; }
.card-flat { box-shadow: none; }
a.card, .card-link { text-decoration: none; color: inherit; display: block; }
@media (hover: hover) { a.card:hover, .card-link:hover, .card.is-hoverable:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.card-head .card-title a { color: inherit; text-decoration: none; }
@media (hover: hover) { .card-head .card-title a:hover { text-decoration: underline; } }
.card-head-icon { color: var(--accent-2-deep); display: inline-flex; }
.card-body > * + * { margin-top: 12px; }

.hero-card { overflow: hidden; background: var(--surface); }
.hero-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--accent-1) 45%, transparent), transparent 60%);
}
.hero-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-card > * { position: relative; z-index: 1; }

.stat-tile { display: flex; flex-direction: column; gap: 4px; }
.stat-tile .stat-label { font-size: .8125rem; font-weight: 600; color: var(--text-muted); }
.stat-tile .stat-caption { font-size: .8125rem; color: var(--text-muted); }

.callout {
  background: var(--callout-bg); border: 1.5px solid var(--callout-border); border-radius: var(--radius-card);
  padding: var(--pad); color: var(--text);
}
.alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 12px; padding: 12px 14px; font-size: .9375rem; }
.alert .icon { flex: 0 0 auto; margin-top: 2px; }
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); color: var(--warning-text); }
.alert-danger { background: var(--danger-bg); color: var(--danger-text); }
.alert-info { background: var(--info-bg); color: var(--info-text); }

.grid-cards { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .grid-cards.md-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-cards.lg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* =============================== CHIPS =============================== */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 3px 12px; border-radius: 999px;
  font-size: .8125rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  background: var(--chip-1-bg); color: var(--chip-1-text); border: 1px solid transparent;
}
.chip-1 { background: var(--chip-1-bg); color: var(--chip-1-text); }
.chip-2 { background: var(--chip-2-bg); color: var(--chip-2-text); }
.chip-3 { background: var(--chip-3-bg); color: var(--chip-3-text); }
.chip-4 { background: var(--chip-4-bg); color: var(--chip-4-text); }
.chip-5 { background: var(--chip-5-bg, var(--chip-1-bg)); color: var(--chip-5-text, var(--chip-1-text)); }
.chip-6 { background: var(--chip-6-bg, var(--chip-2-bg)); color: var(--chip-6-text, var(--chip-2-text)); }
.chip-neutral { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }
.chip-warning { background: var(--warning-bg); color: var(--warning-text); }
.chip-success { background: var(--success-bg); color: var(--success-text); }
.chip-info { background: var(--info-bg); color: var(--info-text); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

button.chip, .chip-toggle {
  min-height: 40px; padding: 6px 14px; cursor: pointer;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
@media (hover: hover) { button.chip:hover { background: var(--surface-alt); } }
button.chip[aria-pressed="true"], button.chip[aria-checked="true"] {
  background: var(--chip-2-bg); color: var(--chip-2-text); border-color: transparent;
}
button.chip[disabled] { color: var(--text-muted); border-style: dashed; cursor: not-allowed; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* =============================== FORMS =============================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-label { font-size: .9375rem; font-weight: 600; color: var(--heading); }
.field-helper { font-size: .875rem; color: var(--text-muted); }
.field-error { font-size: .875rem; color: var(--danger-text); }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.input, .textarea, .select {
  width: 100%; box-sizing: border-box;
  min-height: 46px; padding: 10px 14px; border-radius: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-accent);
  font-size: 1rem; line-height: 1.4;
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
@media (hover: hover) { .input:hover, .textarea:hover, .select:hover { border-color: var(--btn-ghost-border); } }
.input:focus-visible, .textarea:focus-visible, .select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.input[aria-invalid="true"] { border-color: var(--danger-text); }
.textarea { resize: vertical; min-height: 96px; line-height: var(--lh); }
.textarea.autogrow { resize: none; overflow: hidden; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
input[type="date"].input, input[type="time"].input { min-height: 46px; display: block; -webkit-appearance: none; appearance: none; max-width: 100%; }
input[type="date"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; }
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.85); }
.input-row { display: flex; gap: 8px; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }
.input-big { font-family: var(--font-display); font-size: 1.75rem; min-height: 60px; }

/* segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-alt); border: 1px solid var(--border); max-width: 100%; }
.seg button { min-height: 38px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--text-muted); font-size: .875rem; font-weight: 600; }
@media (hover: hover) { .seg button:hover { color: var(--text); } }
.seg button[aria-checked="true"] { background: var(--surface); color: var(--heading); box-shadow: 0 1px 3px rgba(20, 20, 30, .1); }
[data-theme="dark"] .seg button[aria-checked="true"] { background: var(--nav-active-bg); }

/* switch */
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.toggle-row + .toggle-row { border-top: 1px solid var(--divider); }
.toggle-text { display: flex; flex-direction: column; }
.switch { position: relative; flex: 0 0 52px; width: 52px; height: 32px; border-radius: 999px; border: 1px solid var(--btn-ghost-border); background: var(--surface-alt); padding: 0; transition: background 150ms var(--ease); }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(20, 20, 30, .25); transition: transform 180ms var(--ease); }
.switch[aria-checked="true"] { background: var(--accent-2); border-color: var(--accent-2); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--check-tick); }
[data-theme="neutral"] .switch[aria-checked="true"]::after { background: var(--surface); }

/* slider */
.range { width: 100%; height: 44px; background: transparent; -webkit-appearance: none; appearance: none; }
.range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--progress-track); }
.range::-moz-range-track { height: 8px; border-radius: 99px; background: var(--progress-track); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-2-deep); box-shadow: 0 1px 4px rgba(20, 20, 30, .2); }
.range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-2-deep); }

/* checkbox */
.check {
  position: relative; flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid var(--btn-ghost-border); background: var(--surface);
  display: inline-flex; align-items: center; justify-content: center; padding: 0; color: var(--check-tick);
}
.check-hit { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin: -9px; border: 0; background: none; padding: 0; }
.check .icon { opacity: 0; transform: scale(.6); transition: opacity 120ms, transform 180ms var(--ease); }
.check[aria-checked="true"], [aria-checked="true"] > .check { background: var(--accent-2); border-color: var(--accent-2); animation: gp-tick-pop 180ms var(--ease); }
.check[aria-checked="true"] .icon, [aria-checked="true"] > .check .icon { opacity: 1; transform: none; }
.done-text { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-accent); text-decoration-thickness: 2px; }

/* =============================== PROGRESS =============================== */
.progress { height: 10px; border-radius: 99px; background: var(--progress-track); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--progress-fill); transition: width 400ms var(--ease); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-edge) 35%, transparent); }
.progress-sm { height: 6px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: .875rem; color: var(--text-muted); margin-bottom: 6px; }
.ring-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; font-family: var(--font-display); color: var(--heading); font-variant-numeric: lining-nums tabular-nums; }

/* =============================== OVERLAYS =============================== */
.overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: rgba(20, 20, 30, .36); animation: gp-fade 200ms var(--ease) both; }
.dialog {
  position: relative; width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
  border-radius: 20px 20px 0 0; animation: gp-slide-up 240ms var(--ease) both;
  padding-bottom: env(safe-area-inset-bottom);
}
.dialog-full { height: 100dvh; max-height: 100dvh; border-radius: 0; animation: gp-pop 200ms var(--ease) both; padding-top: env(safe-area-inset-top); }
.dialog-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--border-accent); margin: 8px auto 0; flex: 0 0 auto; }
.dialog-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px 20px; flex: 0 0 auto; }
.dialog-title { flex: 1; font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--heading); }
.dialog-body { padding: 8px 20px 20px; overflow-y: auto; overscroll-behavior: contain; flex: 1 1 auto; }
.dialog-foot { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 20px 16px; border-top: 1px solid var(--divider); flex: 0 0 auto; }
.dialog-foot .btn { flex: 1 1 auto; }
@media (min-width: 768px) {
  .overlay { align-items: center; padding: 24px; }
  .dialog { max-width: 560px; border-radius: 20px; animation: gp-pop 200ms var(--ease) both; max-height: 86vh; }
  .dialog-wide { max-width: 760px; }
  .dialog-full { max-width: 760px; height: auto; max-height: 90vh; border-radius: 20px; padding-top: 0; }
  .dialog-grab { display: none; }
  .dialog-foot .btn { flex: 0 0 auto; }
}

/* toast */
.toast-region { position: fixed; left: 0; right: 0; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 12px); z-index: 300; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 520px;
  padding: 12px 14px 12px 18px; border-radius: 14px; box-shadow: var(--shadow-pop);
  background: var(--heading); color: var(--surface); font-size: .9375rem; font-weight: 500;
  animation: gp-toast 200ms var(--ease) both;
}
.toast .toast-action { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 9px; min-height: 36px; padding: 0 12px; font-weight: 600; }
.toast.is-error { background: var(--danger-bg); color: var(--danger-text); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: all 200ms var(--ease); }

/* save whisper */
.save-whisper { position: absolute; top: 10px; right: 14px; display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 600; color: var(--success-text); background: var(--success-bg); padding: 2px 10px; border-radius: 99px; opacity: 0; transition: opacity 150ms var(--ease); pointer-events: none; z-index: 2; }
.save-whisper.is-visible { opacity: 1; }

/* empty state */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 12px 8px; }
.empty img, .empty svg.empty-art { width: 160px; height: 120px; }
.empty .empty-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 500; color: var(--heading); }
.empty .empty-body { color: var(--text-muted); max-width: 420px; }
.empty .empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.empty-inline { color: var(--text-muted); font-size: .9375rem; }

/* skeleton */
.skeleton { border-radius: var(--radius-card); background: linear-gradient(90deg, var(--surface-alt) 25%, var(--divider) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: gp-shimmer 1.4s linear infinite; }

/* list rows */
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 4px; border-bottom: 1px solid var(--divider); }
.list-row:last-child { border-bottom: 0; }
@media (hover: hover) { .list-row.is-hoverable:hover { background: var(--surface-alt); } }

/* theme picker */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.theme-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); text-align: left; min-height: 44px; }
.theme-card[aria-checked="true"] { border-color: var(--focus-ring); }
.theme-card .swatches { display: flex; gap: 6px; }
.theme-card .swatch { width: 24px; height: 24px; border-radius: 50%; border: 1px solid rgba(20, 20, 30, .12); }
.theme-card .theme-name { font-size: .875rem; font-weight: 600; color: var(--text); }
.theme-card .theme-check { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--focus-ring); color: var(--surface); display: none; align-items: center; justify-content: center; }
.theme-card[aria-checked="true"] .theme-check { display: inline-flex; }

/* settings layout */
.settings-layout { display: grid; gap: var(--gap); }
.settings-nav { display: none; }
@media (min-width: 1024px) {
  .settings-layout { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
  .settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; }
  .settings-nav a { padding: 8px 12px; border-radius: 10px; color: var(--text-muted); text-decoration: none; font-weight: 600; font-size: .9375rem; }
  .settings-nav a:hover { background: var(--surface-alt); color: var(--text); }
  .jump-menu { display: none; }
}
.section-card { scroll-margin-top: 72px; }
.steps-list { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: 6px; }
.danger-zone { border-color: var(--danger-bg); }

/* =============================== BANNERS (update + offline helper error) =============================== */
#update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--btn-primary-bg); color: var(--btn-primary-text);
  padding: 12px; padding-top: calc(12px + env(safe-area-inset-top));
  text-align: center; font-weight: 600; font-size: .9375rem;
}
#update-banner button { margin-left: 10px; min-height: 36px; padding: 0 16px; border-radius: 99px; border: 0; background: var(--surface); color: var(--text); font-weight: 700; } /* readable in every theme, incl. Neutral and Dark */
#sw-error-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: var(--danger-bg); color: var(--danger-text); border: 0; width: 100%;
  padding: 12px; padding-top: calc(12px + env(safe-area-inset-top)); text-align: center; font-weight: 600; font-size: .9375rem;
}

/* =============================== MISC =============================== */
.wizard-steps { font-size: .875rem; color: var(--text-muted); font-weight: 600; }
.dots { display: flex; gap: 6px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--progress-track); }
.dots span.is-done { background: var(--accent-2-deep); }
.dots span.is-current { background: var(--accent-1-deep); }
.divider-text { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .8125rem; }
.kbd { font-family: ui-monospace, monospace; font-size: .8125rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-alt); border: 1px solid var(--border); }
.placeholder-page { min-height: 40vh; }
.tooltip-host { position: relative; }
.help-tabs { margin-bottom: 12px; }
.help-content h3 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; margin: 14px 0 4px; }
.help-content ol, .help-content ul { padding-left: 1.25rem; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; }
.install-steps { display: flex; flex-direction: column; gap: 12px; margin: 10px 0; padding: 0; list-style: none; counter-reset: step; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; }
.install-steps .step-num { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--chip-2-bg); color: var(--chip-2-text); font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-size: .875rem; }
.ios-share-icon { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; margin: 0 2px; }

/* lists inside content (Tailwind preflight removes markers) */
.help-content ol, .steps-list, .prose-list ol { list-style: decimal; }
.help-content ul, .prose-list ul { list-style: disc; }

/* =============================== ILLUSTRATIONS (hero scenes + spot art) ===============================
   SVGs in assets/images are inlined by utils/dom.js loadInlineSVG(), so these class rules color every shape from
   the active theme. --art-* tokens point at existing theme tokens, mapped per theme by eye so neighbors differ.
   Paper objects stay light in Dark; ink on paper uses --art-paper-ink. */
:root, [data-theme="blush-sage"] {
  --art-glow: var(--callout-bg); --art-sun: var(--chart-1); --art-cloud: var(--surface); --art-spark: var(--chart-3); --art-star: var(--surface);
  --art-moon: var(--chip-4-bg); --art-frame: var(--surface); --art-sill: var(--chip-3-bg);
  --art-night1: color-mix(in srgb, var(--heading) 78%, var(--chart-2)); --art-night2: color-mix(in srgb, var(--heading) 40%, var(--chart-3));
  --art-snow: var(--surface); --art-snow2: var(--chip-2-bg); --art-candle: var(--chip-4-bg); --art-flame: var(--chart-6); --art-mug: var(--chart-3);
  --art-book1: var(--chart-2); --art-book2: var(--chart-5);
  --art-dawn1: var(--chip-1-bg); --art-dawn2: var(--surface-alt); --art-day1: var(--chip-2-bg); --art-day2: var(--surface);
  --art-hill1: var(--chart-4); --art-hill2: var(--chart-2); --art-hill3: var(--chip-2-bg); --art-path: var(--chip-4-bg);
  --art-pole: var(--text-muted); --art-flag1: var(--chart-3); --art-flag2: var(--chart-6); --art-flag3: var(--chart-5);
  --art-tree: var(--chart-4); --art-trunk: var(--chart-edge);
  --art-jar: var(--accent-2); --art-lid: var(--chart-4); --art-note1: var(--chart-1); --art-note2: var(--chart-6); --art-note3: var(--chart-5);
  --art-bulb1: var(--chart-6); --art-bulb2: var(--chart-1); --art-bulb3: var(--chart-2); --art-wire: var(--text-muted);
  --art-paper: var(--surface); --art-paper-ink: var(--heading); --art-ink: var(--heading); --art-shadow: var(--heading); --art-highlight: var(--surface);
  --art-es-bg: var(--chip-1-bg); --art-soft: var(--surface-alt);
}
[data-theme="rainbow-pastel"] {
  --art-sun: var(--chart-1); --art-spark: var(--chart-6); --art-flame: var(--chart-2); --art-mug: var(--chart-5); --art-book1: var(--chart-4); --art-book2: var(--chart-1);
  --art-snow2: var(--chip-5-bg); --art-dawn1: var(--chip-1-bg); --art-day1: var(--chip-5-bg);
  --art-hill1: var(--chart-4); --art-hill2: var(--chip-4-bg); --art-hill3: var(--chip-5-bg); --art-path: var(--chip-3-bg);
  --art-flag1: var(--chart-1); --art-flag2: var(--chart-6); --art-flag3: var(--chart-3); --art-tree: var(--chart-4);
  --art-jar: var(--chart-5); --art-lid: var(--chart-6); --art-note1: var(--chart-1); --art-note2: var(--chart-3); --art-note3: var(--chart-4);
  --art-bulb1: var(--chart-2); --art-bulb2: var(--chart-1); --art-bulb3: var(--chart-6); --art-es-bg: var(--chip-6-bg);
  --art-night1: color-mix(in srgb, var(--heading) 75%, var(--chart-6)); --art-night2: color-mix(in srgb, var(--heading) 40%, var(--chart-5));
}
[data-theme="neutral"] {
  --art-sun: var(--chart-5); --art-spark: var(--chart-2); --art-flame: var(--chart-5); --art-mug: var(--chart-2); --art-book1: var(--chart-1); --art-book2: var(--chart-4);
  --art-dawn1: var(--chip-3-bg); --art-day1: var(--chip-1-bg);
  --art-hill1: var(--chart-6); --art-hill2: var(--chart-1); --art-hill3: var(--chart-3); --art-path: var(--chip-3-bg);
  --art-flag1: var(--chart-2); --art-flag2: var(--chart-5); --art-flag3: var(--chart-4); --art-tree: var(--chart-6);
  --art-jar: var(--accent-1); --art-lid: var(--chart-6); --art-note1: var(--chart-5); --art-note2: var(--chart-4); --art-note3: var(--chart-3);
  --art-bulb1: var(--chart-5); --art-bulb2: var(--chart-4); --art-bulb3: var(--chart-3); --art-es-bg: var(--chip-1-bg);
  --art-night1: color-mix(in srgb, var(--heading) 78%, var(--chart-2)); --art-night2: color-mix(in srgb, var(--heading) 45%, var(--chart-1));
}
[data-theme="champagne"] {
  --art-sun: var(--chart-1); --art-spark: var(--chart-1); --art-flame: var(--chart-1); --art-mug: var(--chart-3); --art-book1: var(--chart-2); --art-book2: var(--chart-3);
  --art-dawn1: var(--chip-1-bg); --art-day1: var(--chip-2-bg); --art-snow2: var(--chip-2-bg);
  --art-hill1: var(--chart-6); --art-hill2: var(--chart-2); --art-hill3: var(--chip-2-bg); --art-path: var(--chip-1-bg);
  --art-flag1: var(--chart-3); --art-flag2: var(--chart-1); --art-flag3: var(--chart-5); --art-tree: var(--chart-4);
  --art-jar: var(--accent-2); --art-lid: var(--chart-1); --art-note1: var(--chart-1); --art-note2: var(--chart-3); --art-note3: var(--chart-5);
  --art-bulb1: var(--chart-1); --art-bulb2: var(--chart-3); --art-bulb3: var(--chart-2); --art-es-bg: var(--chip-1-bg);
  --art-night1: color-mix(in srgb, var(--heading) 70%, var(--chart-6)); --art-night2: color-mix(in srgb, var(--heading) 35%, var(--chart-2));
}
[data-theme="dark"] {
  --art-glow: var(--callout-bg); --art-sun: var(--chart-5); --art-cloud: var(--border-accent); --art-spark: var(--chart-5); --art-star: var(--text);
  --art-moon: var(--chart-5); --art-frame: var(--surface-alt); --art-sill: var(--border-accent);
  --art-night1: color-mix(in srgb, var(--bg) 85%, var(--chart-1)); --art-night2: color-mix(in srgb, var(--bg) 55%, var(--chart-1));
  --art-snow: var(--text-muted); --art-snow2: color-mix(in srgb, var(--chart-4) 40%, var(--surface)); --art-candle: var(--text); --art-flame: var(--chart-5);
  --art-mug: var(--chart-3); --art-book1: var(--chart-2); --art-book2: var(--chart-6);
  --art-dawn1: color-mix(in srgb, var(--chart-6) 25%, var(--surface)); --art-dawn2: var(--surface); --art-day1: color-mix(in srgb, var(--chart-4) 22%, var(--surface)); --art-day2: var(--surface);
  --art-hill1: color-mix(in srgb, var(--chart-2) 55%, var(--surface)); --art-hill2: color-mix(in srgb, var(--chart-1) 45%, var(--surface)); --art-hill3: color-mix(in srgb, var(--chart-4) 28%, var(--surface));
  --art-path: color-mix(in srgb, var(--chart-5) 45%, var(--surface)); --art-pole: var(--text-muted);
  --art-flag1: var(--chart-3); --art-flag2: var(--chart-5); --art-flag3: var(--chart-6); --art-tree: color-mix(in srgb, var(--chart-2) 70%, var(--surface)); --art-trunk: var(--text-muted);
  --art-jar: var(--chart-1); --art-lid: var(--chart-1); --art-note1: var(--chart-5); --art-note2: var(--chart-3); --art-note3: var(--chart-6);
  --art-bulb1: var(--chart-5); --art-bulb2: var(--chart-3); --art-bulb3: var(--chart-2); --art-wire: var(--text-muted);
  --art-paper: var(--text); --art-paper-ink: #25272E; --art-ink: var(--text); --art-shadow: #000; --art-highlight: var(--text);
  --art-es-bg: var(--surface-alt); --art-soft: var(--border-accent);
}
.gh-glow { fill: var(--art-glow); } .gh-sun { fill: var(--art-sun); } .gh-cloud { fill: var(--art-cloud); } .gh-spark { fill: var(--art-spark); }
.gh-star { fill: var(--art-star); } .gh-moon { fill: var(--art-moon); } .gh-frame { fill: var(--art-frame); } .gh-sill { fill: var(--art-sill); }
.gh-night1 { stop-color: var(--art-night1); } .gh-night2 { stop-color: var(--art-night2); }
.gh-dawn1 { stop-color: var(--art-dawn1); } .gh-dawn2 { stop-color: var(--art-dawn2); } .gh-day1 { stop-color: var(--art-day1); } .gh-day2 { stop-color: var(--art-day2); }
.gh-snow { fill: var(--art-snow); } .gh-snow2 { fill: var(--art-snow2); } .gh-candle { fill: var(--art-candle); }
.gh-flame, .gh-flameglow, .gh-glownote { fill: var(--art-flame); } .gh-mug { fill: var(--art-mug); } .gh-handle { stroke: var(--art-mug); fill: none; }
.gh-book1 { fill: var(--art-book1); } .gh-book2 { fill: var(--art-book2); }
.gh-hill1 { fill: var(--art-hill1); } .gh-hill2 { fill: var(--art-hill2); } .gh-hill3 { fill: var(--art-hill3); } .gh-path { fill: var(--art-path); } .gh-trail { stroke: var(--art-path); fill: none; }
.gh-pole { fill: var(--art-pole); } .gh-flag1 { fill: var(--art-flag1); } .gh-flag2 { fill: var(--art-flag2); } .gh-flag3 { fill: var(--art-flag3); }
.gh-tree { fill: var(--art-tree); } .gh-trunk { fill: var(--art-trunk); }
.gh-jar { fill: var(--art-jar); } .gh-lid { fill: var(--art-lid); } .gh-note1 { fill: var(--art-note1); } .gh-note2 { fill: var(--art-note2); } .gh-note3 { fill: var(--art-note3); }
.gh-bulb1 { fill: var(--art-bulb1); } .gh-bulb2 { fill: var(--art-bulb2); } .gh-bulb3 { fill: var(--art-bulb3); } .gh-wire, .gh-steam, .gh-bird { stroke: var(--art-wire); fill: none; }
.gh-paper { fill: var(--art-paper); } .gh-ink { fill: var(--art-ink); } .gh-shadow { fill: var(--art-shadow); } .gh-highlight { stroke: var(--art-highlight); fill: none; }
.es-bg { fill: var(--art-es-bg); } .es-soft { fill: var(--art-soft); } .es-paper { fill: var(--art-paper); } .es-ink { fill: var(--art-paper-ink); } .es-spark { fill: var(--art-spark); }
.es-1 { fill: var(--chart-1); } .es-2 { fill: var(--chart-2); } .es-3 { fill: var(--chart-3); } .es-4 { fill: var(--chart-4); } .es-5 { fill: var(--chart-5); } .es-6 { fill: var(--chart-6); }
.es-line { stroke: var(--art-paper-ink); fill: none; } .es-trail, .es-handle { stroke: var(--chart-3); fill: none; }
[data-theme="dark"] .es-line { stroke: var(--text-muted); }

@keyframes ga-flicker { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(.94, 1.06); } }
@keyframes ga-drift { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(10px); } }
@keyframes ga-twinkle { 0%, 100% { opacity: .28; } 50% { opacity: .6; } }
.ga-flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: ga-flicker 3.2s ease-in-out infinite; }
.ga-drift { animation: ga-drift 22s ease-in-out infinite; }
.ga-twinkle { animation: ga-twinkle 4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ga-flicker, .ga-drift, .ga-twinkle { animation: none !important; } }
[data-reduce-motion="true"] .ga-flicker, [data-reduce-motion="true"] .ga-drift, [data-reduce-motion="true"] .ga-twinkle { animation: none !important; }

.art-inline { display: block; }
.art-inline svg { width: 100%; height: 100%; display: block; }
.empty .art-inline { width: 160px; height: 120px; }

/* ---------- Home season hero (container query layout, pwa-dashboard-illustration skill) ---------- */
.season-hero { container-type: inline-size; padding: 0; overflow: hidden;
  background: linear-gradient(118deg, var(--callout-bg) 0%, var(--surface) 55%, var(--chip-2-bg) 100%); border-color: var(--callout-border); }
.season-hero::before { display: none; }
.season-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.season-hero-art { width: 100%; aspect-ratio: 16 / 7; overflow: hidden; }
.season-hero-art svg { width: 100%; height: 100%; }
.season-hero-text { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.season-hero .eyebrow { align-self: flex-start; }
.word-display { font-family: var(--font-display); font-weight: 400; font-size: 2.5rem; line-height: 1.1; color: var(--heading); font-variation-settings: "SOFT" 50, "WONK" 0; overflow-wrap: anywhere; }
@container (min-width: 600px) {
  .season-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); align-items: center; }
  .season-hero-art { order: 2; aspect-ratio: 16 / 10; padding: 16px 16px 16px 0; }
  .season-hero-text { padding: 24px; }
}
@container (min-width: 880px) {
  .season-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
  .word-display { font-size: 3.25rem; }
}
@media print { .season-hero-art { display: none; } .season-hero { background: #fff; } }
.step-dots { display: flex; align-items: center; }
.step-dots .sd { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 2px solid var(--btn-ghost-border); transition: background 400ms var(--ease); }
.step-dots .sd.is-done { background: var(--accent-2); border-color: var(--accent-2-deep); }
.step-dots .sl { width: 18px; height: 2px; background: var(--btn-ghost-border); }
.step-dots .sl.is-done { background: var(--accent-2-deep); }

/* =============================== SESSION 2 COMPONENTS =============================== */
/* Home layout: phones = one column ordered by CSS order; md+ = top row full width then two columns */
.home-layout { display: flex; flex-direction: column; gap: var(--gap); }
.home-top, .home-cols, .home-col { display: contents; }
.home-slot:empty { display: none; }
.home-days-slot { display: none; }
.home-quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.home-quick .btn { padding: 0 8px; white-space: normal; text-align: center; line-height: 1.15; font-size: .875rem; flex-direction: column; gap: 4px; min-height: 64px; }
@media (min-width: 640px) { .home-quick { display: flex; flex-wrap: wrap; } .home-quick .btn { flex-direction: row; min-height: 44px; padding: 0 16px; font-size: .9375rem; } }
@media (min-width: 768px) {
  .home-top { display: flex; flex-direction: column; gap: var(--gap); }
  .home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
  .home-col { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
  .home-slot { order: 0 !important; }
}
@media (min-width: 1024px) {
  .home-cols { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .home-days-slot { display: block; }
}
.home-footer { text-align: center; padding: 8px 0 4px; }
.home-days .stat-num { font-size: 2.5rem; }

.focus-goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.focus-goal { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; text-decoration: none; color: inherit; padding: 6px 2px; border-radius: 12px; min-width: 0; }
@media (hover: hover) { .focus-goal:hover { background: var(--surface-alt); } }
.focus-goal .card-title { font-size: .875rem; }
.focus-goal .helper { font-size: .8125rem; }
@media (min-width: 1024px) {
  .focus-goal { flex-direction: row; text-align: left; align-items: center; padding: 10px; border: 1px solid var(--border); }
  .focus-goals { grid-template-columns: minmax(0, 1fr); }
  .focus-goal .card-title { font-size: 1rem; }
}
@media (min-width: 1280px) { .focus-goals { grid-template-columns: repeat(3, minmax(0, 1fr)); } .focus-goal { flex-direction: column; text-align: center; } }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.habit-chip { min-height: 44px; gap: 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); position: relative; overflow: hidden; }
.habit-chip .habit-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--hc, var(--accent-2)); display: inline-flex; align-items: center; justify-content: center; color: var(--check-tick); flex: 0 0 20px; }
.habit-chip[aria-pressed="true"] { background: var(--chip-2-bg); color: var(--chip-2-text); border-color: transparent; }
.habit-chip[aria-pressed="true"] .habit-dot { background: var(--hc, var(--accent-2)); border-color: var(--hc, var(--accent-2)); }
.habit-chip.is-popping .habit-dot { animation: gp-tick-pop 220ms var(--ease); }
.week-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; height: 56px; align-items: end; }
.week-bars .wb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.week-bars .wb span { width: 100%; max-width: 22px; border-radius: 5px; background: var(--chart-2); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chart-edge) 35%, transparent); min-height: 4px; }
.week-bars .wb.is-future span { background: var(--chart-track); box-shadow: none; }
.week-bars .wb em { font-style: normal; font-size: .75rem; color: var(--text-muted); font-weight: 600; }

.vision-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.vision-tile { flex: 0 0 120px; height: 120px; border-radius: 14px; overflow: hidden; background: var(--surface-alt); border: 1px solid var(--border); scroll-snap-align: start; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.vision-tile img { width: 100%; height: 100%; object-fit: cover; }
.vision-tile-text { font-family: var(--font-display); font-size: .9375rem; color: var(--heading); padding: 10px; text-align: center; }
.question-card .font-display { font-variation-settings: "SOFT" 50, "WONK" 0; }
.quick-row { width: 100%; border: 0; border-bottom: 1px solid var(--divider); background: none; text-align: left; min-height: 64px; }
.quick-icon { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }

/* list editor */
.list-editor-wrap { display: flex; flex-direction: column; gap: 8px; }
.le-row { align-items: flex-start; padding: 4px 0; }
.le-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 10px; }
.le-text { background: none; border: 0; padding: 0; text-align: left; color: var(--text); font-size: 1rem; line-height: 1.45; cursor: text; overflow-wrap: anywhere; }
.le-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.le-new { animation: gp-slide-in-top 160ms var(--ease) both; }
.le-row.is-floating { animation: gp-float-away 700ms var(--ease) forwards; }
.le-row .check-hit { margin: 0; }
.list-editor .input { min-height: 40px; }

/* reflection form */
.reflection-card .card-title { font-size: 1.0625rem; }
.words-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.words-grid .field + .field { margin-top: 0; }
@media (max-width: 420px) { .words-grid { grid-template-columns: minmax(0, 1fr); } }

/* photos */
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; background: var(--surface-alt); }
.photo-chip { position: relative; }
.photo-remove { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: 50%; }
.lightbox-stage { display: flex; justify-content: center; }
.lightbox-img { max-width: 100%; max-height: 70vh; border-radius: 12px; object-fit: contain; }
label.btn[aria-busy="true"] { opacity: .7; }

/* vertical timeline */
.vtimeline { position: relative; }
.vt-group + .vt-group { margin-top: 18px; }
.vt-label { font-family: var(--font-body); font-size: .875rem; font-weight: 600; color: var(--text-muted); margin: 0 0 10px 28px; }
.vt-list { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; display: flex; flex-direction: column; gap: 12px; }
.vt-list::before { content: ''; position: absolute; left: 8px; top: 4px; bottom: 4px; width: 2px; background: var(--border-accent); }
.vt-item { position: relative; }
.vt-dot { position: absolute; left: -26px; top: 18px; width: 14px; height: 14px; border-radius: 50%; background: var(--accent-1-deep); border: 3px solid var(--surface); }
.vt-card { display: flex; gap: 12px; text-align: left; width: 100%; padding: 12px; color: inherit; font: inherit; }
.vt-card .photo-thumb { width: 84px; height: 84px; flex: 0 0 84px; }
.vt-text { min-width: 0; }
@media (min-width: 1024px) {
  .vtimeline-alt .vt-list { padding-left: 0; }
  .vtimeline-alt .vt-list::before { left: 50%; }
  .vtimeline-alt .vt-item { width: calc(50% - 22px); }
  .vtimeline-alt .vt-item:nth-child(odd) { align-self: flex-start; }
  .vtimeline-alt .vt-item:nth-child(even) { align-self: flex-end; }
  .vtimeline-alt .vt-item:nth-child(odd) .vt-dot { left: auto; right: -29px; }
  .vtimeline-alt .vt-item:nth-child(even) .vt-dot { left: -29px; }
  .vtimeline-alt .vt-label { margin-left: 0; text-align: center; }
}

/* envelope */
.envelope-card { display: flex; align-items: center; gap: 16px; }
.envelope-art { width: 120px; height: 90px; flex: 0 0 120px; }
.envelope-card.is-sealing .envelope-art { animation: gp-seal 900ms var(--ease); }
.envelope-card.is-opening .envelope-art { animation: gp-open 900ms var(--ease); }
@keyframes gp-seal { 0% { transform: translateY(-14px) scale(.9); opacity: .4; } 60% { transform: none; opacity: 1; } 80% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes gp-open { 0% { transform: none; } 40% { transform: rotate(-4deg) scale(1.05); } 100% { transform: translateY(-6px); } }

/* charts */
.chart-box canvas { width: 100% !important; }
.chart-summary { margin-top: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.data-table th, .data-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--divider); }
.data-table thead th { color: var(--text-muted); font-size: .8125rem; font-weight: 600; }
.data-table td { font-variant-numeric: lining-nums tabular-nums; }

/* wizard */
.wizard .dialog-body { display: flex; flex-direction: column; gap: 16px; }
.wizard-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wizard-body { max-width: 640px; width: 100%; margin: 0 auto; }
.wizard-content { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.wizard .dialog-foot { justify-content: space-between; }

/* step footer, misc */
.step-footer { margin-top: var(--gap); }
.text-accent { color: var(--accent-1-deep); }
.goal-pick { min-height: 44px; max-width: 100%; }
.goal-pick span { overflow-wrap: anywhere; }
.goal-row { width: 100%; border: 0; border-bottom: 1px solid var(--divider); background: none; text-align: left; }
.released-chip { opacity: .9; }

/* ---------- New Year Reset pages ---------- */
.reset-step .card-body { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.reset-step { display: flex; flex-direction: column; }
.reset-step.is-done { background: var(--surface-alt); }
.step-num-badge { width: 30px; height: 30px; border-radius: 50%; background: var(--chip-1-bg); color: var(--chip-1-text); font-weight: 700; font-size: .875rem; display: inline-flex; align-items: center; justify-content: center; }

.fs-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .fs-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fs-layout > .fs-dump, .fs-layout > #fs-ssc { grid-column: 1 / -1; } }
.fs-section > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 32px; }
.fs-section > summary::-webkit-details-marker { display: none; }
.fs-section > summary .card-title { flex: 1; }
.fs-section[open] .fs-chev { transform: rotate(180deg); }
.fs-chev { transition: transform 200ms var(--ease); color: var(--text-muted); }
.fs-three { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .fs-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fs-dump .chip-group { margin-top: 12px; }
.sticky-actions { position: sticky; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 8px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; margin-top: 10px;
  background: var(--surface); border: 1px solid var(--border-accent); border-radius: 14px; box-shadow: var(--shadow-lift); }
.sorter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sorter-grid .btn { min-height: 64px; }
.fs-item { gap: 10px; }

.audit-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .audit-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } .audit-side { position: sticky; top: 72px; } .see-chart { display: none; } }
.see-chart { position: sticky; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 10px); display: flex; justify-content: center; margin-top: 12px; z-index: 20; }
.audit-card .toggle-row { border-top: 1px solid var(--divider); }

/* ---------- Vision board ---------- */
.vb-toolbar { position: sticky; top: 56px; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 8px 0 4px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.vb-toolbar .subtabs-wrap { margin-top: 0; }
.vb-toolbar .subtab[aria-pressed="true"] { background: var(--nav-bg); color: var(--nav-active-text); border-color: transparent; }
.vb-board { border-radius: 18px; border: 1px solid var(--border); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.vb-canvas { aspect-ratio: 16 / 10; width: 100%; touch-action: none; }
.vb-grid { columns: 2 160px; column-gap: 12px; padding: 12px; }
@media (min-width: 768px) { .vb-grid { columns: 3 180px; } }
.vb-item-grid { display: block; width: 100%; margin: 0 0 12px; break-inside: avoid; position: relative; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; }
.vb-item { position: absolute; touch-action: none; transition: box-shadow 150ms var(--ease); }
.vb-item-hit { display: block; width: 100%; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.is-editing .vb-item-hit { cursor: grab; }
.vb-photo { margin: 0; background: var(--surface); padding: 6px 6px 8px; border-radius: 10px; box-shadow: 0 2px 10px rgba(20, 20, 30, .12); }
.vb-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; display: block; background: var(--surface-alt); }
.vb-photo figcaption { font-size: .8125rem; color: var(--text-muted); padding: 6px 2px 0; text-align: center; }
.vb-text { padding: 14% 10%; border-radius: 10px; text-align: center; color: var(--heading); font-family: var(--font-display); font-size: clamp(.875rem, 1.6vw, 1.25rem); line-height: 1.3; box-shadow: 0 2px 10px rgba(20, 20, 30, .08); overflow-wrap: anywhere; }
.card-style-paper { background: var(--surface); }
.card-style-soft { background: var(--chip-1-bg); color: var(--chip-1-text); }
.card-style-outline { background: transparent; border: 2px solid var(--border-accent); box-shadow: none; }
.card-style-handwritten { background: var(--surface-alt); font-family: var(--font-hand); font-weight: 500; font-size: clamp(1.25rem, 2.2vw, 1.75rem); }
.vb-text.is-quote span::before { content: '“'; } .vb-text.is-quote span::after { content: '”'; }
.vb-word { display: flex; flex-direction: column; gap: 4px; }
.vb-word-label { font-family: var(--font-body); font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.vb-word-text { font-size: clamp(1.5rem, 3vw, 2.5rem); }
.vb-badge { position: absolute; top: 8px; right: 8px; z-index: 2; background: var(--surface); border-radius: 50%; box-shadow: 0 1px 4px rgba(20, 20, 30, .2); display: inline-flex; align-items: center; justify-content: center; }
.vb-link { width: 26px; height: 26px; color: var(--text-muted); top: auto; bottom: 14px; right: 12px; }
.vb-ring { padding: 1px; }
.vb-resize { position: absolute; right: -8px; bottom: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent-1-deep); cursor: nwse-resize; z-index: 3; }
.vb-move-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.vb-bg-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .vb-bg-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.vb-bg-swatch { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 12px; border: 2px solid var(--border); background: var(--surface); font-weight: 600; font-size: .875rem; color: var(--text); }
.vb-bg-swatch[aria-checked="true"] { border-color: var(--focus-ring); }
.vb-swatch-fill { display: block; height: 56px; border-radius: 8px; border: 1px solid var(--border); }
.vb-bg-clean { background: var(--surface); }
.vb-bg-linen { background-color: var(--surface-alt); background-image: repeating-linear-gradient(0deg, color-mix(in srgb, var(--chart-edge) 6%, transparent) 0 1px, transparent 1px 5px), repeating-linear-gradient(90deg, color-mix(in srgb, var(--chart-edge) 6%, transparent) 0 1px, transparent 1px 5px); }
.vb-bg-paper { background-color: var(--surface-alt); background-image: radial-gradient(color-mix(in srgb, var(--chart-edge) 10%, transparent) 0.6px, transparent 0.8px); background-size: 7px 7px; }
.vb-bg-soft-wash { background: linear-gradient(135deg, var(--chip-1-bg), var(--chip-2-bg)); }
.vb-bg-glow { background: radial-gradient(90% 80% at 75% 15%, var(--accent-1), var(--surface) 70%); }
.vb-bg-dots { background-color: var(--surface-alt); background-image: radial-gradient(var(--border-accent) 1.6px, transparent 1.8px); background-size: 22px 22px; }
.vb-bg-grid { background-color: var(--surface-alt); background-image: linear-gradient(color-mix(in srgb, var(--border-accent) 60%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--border-accent) 60%, transparent) 1px, transparent 1px); background-size: 28px 28px; }
.vb-bg-starry { background-color: var(--chip-2-bg); background-image: radial-gradient(var(--accent-1) 1.5px, transparent 2px), radial-gradient(var(--accent-2) 1px, transparent 1.5px); background-size: 90px 70px, 53px 61px; background-position: 0 0, 25px 30px; }

/* ---------- Word of the Year ---------- */
.word-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
.word-preview-col { order: -1; }
@media (min-width: 1024px) { .word-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .word-preview-col { order: 0; } .word-preview-sticky { position: sticky; top: 72px; } }
.word-card-preview { --wc-bg: var(--surface-alt); position: relative; overflow: hidden; aspect-ratio: 9 / 16; max-height: 70vh; margin: 0 auto; border-radius: 18px; background: var(--wc-bg); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 14px; box-shadow: var(--shadow-card); }
@media (max-width: 1023px) { .word-card-preview { aspect-ratio: 4 / 3; max-height: none; } }
.wc-year { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }
.wc-word { font-family: var(--font-display); font-size: clamp(2.5rem, 7vw, 3.75rem); color: var(--heading); line-height: 1.05; overflow-wrap: anywhere; font-variation-settings: "SOFT" 50, "WONK" 0; }
.wc-word.is-empty { font-size: 1.125rem; color: var(--text-muted); font-family: var(--font-body); }
.wc-font-sans .wc-word { font-family: var(--font-body); font-weight: 500; }
.wc-font-hand .wc-word, .wc-style-handwritten .wc-word { font-family: var(--font-hand); font-weight: 500; font-size: clamp(3rem, 9vw, 4.5rem); }
.wc-motto { color: var(--text-muted); max-width: 26ch; }
.wc-style-soft-gradient { background: linear-gradient(160deg, var(--wc-bg), var(--chip-2-bg)); }
.wc-style-framed::after { content: ''; position: absolute; inset: 14px; border: 2px solid var(--accent-1-deep); border-radius: 12px; pointer-events: none; }
.wc-spark { position: absolute; width: 22px; height: 22px; color: var(--accent-1-deep); }
.wc-spark.s1 { top: 14%; left: 16%; } .wc-spark.s2 { top: 22%; right: 14%; width: 16px; color: var(--accent-2-deep); } .wc-spark.s3 { bottom: 18%; right: 20%; width: 26px; }
.wc-letter { display: inline-block; animation: gp-fade 200ms var(--ease) both; }
.swatch-btn { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.swatch-btn[aria-checked="true"] { border-color: var(--focus-ring); box-shadow: 0 0 0 2px var(--surface) inset; }
@media (min-width: 1024px) { .see-chart { display: none; } }
.field-head output { white-space: nowrap; color: var(--heading); }
.field-head .field-label { min-width: 0; }
.vb-toolbar .subtabs { flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 4px; }
.vb-toolbar .subtab { min-height: 36px; padding: 0 12px; font-size: .8125rem; }
.vb-toolbar .subtabs-wrap::before, .vb-toolbar .subtabs-wrap::after { display: block; }
@media (min-width: 768px), (hover: hover) and (pointer: fine) {
  .vb-toolbar .subtabs { flex-wrap: wrap; overflow-x: visible; padding: 2px 0 4px; }
  .vb-toolbar .subtabs-wrap { margin-left: 0; margin-right: 0; }
  .vb-toolbar .subtabs-wrap::before, .vb-toolbar .subtabs-wrap::after { display: none; }
}
.vb-toolbar .btn, .vb-toolbar .seg button { min-height: 40px; }
@media (max-width: 767px) { .vb-toolbar { position: static; } }

/* =============================== SESSION 3: MY GOALS =============================== */
.tiles-4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
@media (min-width: 1024px) { .tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.section-head { margin-bottom: 10px; }
.add-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 180px; color: var(--btn-ghost-text); font-weight: 600; text-decoration: none; }
@media (hover: hover) { .add-slot:hover { background: var(--surface-alt); } }
.goal-card { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }
.goal-card-main { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
@media (hover: hover) { .goal-card-main:hover .card-title { text-decoration: underline; } }
.goal-cover { margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 0; height: 110px; overflow: hidden; }
.goal-cover img { width: 100%; height: 100%; object-fit: cover; }
.btn-wrap { white-space: normal; text-align: center; line-height: 1.25; padding-top: 8px; padding-bottom: 8px; }
.goal-card .btn { margin-top: auto; }

.gd-head-grid { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.gd-head-grid > .stack-sm { width: 100%; }
@media (min-width: 640px) { .gd-head-grid { flex-direction: row; align-items: flex-start; gap: 24px; } }
.gd-cover { position: relative; margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 16px; height: 180px; overflow: hidden; border-radius: 13px 13px 0 0; }
.gd-cover img { width: 100%; height: 100%; object-fit: cover; }
.gd-cover-btn { position: absolute; right: 10px; bottom: 10px; background: var(--surface) !important; }
.gd-tabs { display: none; margin: 16px 0; }
@media (max-width: 767px) { .gd-section + .gd-section, .stack > .gd-section { margin-top: 0; } .page .stack > .gd-section { display: block; } }
@media (min-width: 768px) { .gd-tabs { display: flex; } .gd-section { display: none; } .gd-section.is-active { display: block; } }
@media (max-width: 767px) { .gd-head { margin-bottom: var(--gap); } }
.roadmap-q + .roadmap-q { margin-top: 12px; }
.obstacle { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-alt); }
.obstacle .field + .field { margin-top: 0; }

.choice-card { display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--text); min-height: 44px; }
@media (hover: hover) { .choice-card:hover { background: var(--surface-alt); } }
.choice-card[aria-checked="true"] { border-color: var(--focus-ring); background: var(--surface-alt); }
.ms-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 6px; align-items: center; }
.ms-row .ms-date { grid-column: 1; grid-row: 2; }
.ms-row .btn-icon { grid-column: 2; grid-row: 1 / span 2; }
@media (min-width: 640px) { .ms-row { grid-template-columns: minmax(0, 1fr) 170px 44px; } .ms-row .ms-date { grid-column: 2; grid-row: 1; } .ms-row .btn-icon { grid-column: 3; grid-row: 1; } }

.reality-card { display: flex; flex-direction: column; gap: 8px; }
.reality-meter { margin: 4px 0; }
.rm-track { position: relative; display: flex; height: 14px; border-radius: 99px; overflow: visible; }
.rm-track span:not(.rm-marker) { display: block; height: 100%; }
.rm-track span:first-child { border-radius: 99px 0 0 99px; } .rm-track span:nth-child(4) { border-radius: 0 99px 99px 0; }
.rz-1 { background: var(--success-bg); } .rz-2 { background: var(--chip-3-bg); } .rz-3 { background: var(--warning-bg); } .rz-4 { background: var(--chip-1-bg); }
.rm-marker { position: absolute; top: -4px; width: 6px; height: 22px; margin-left: -3px; border-radius: 4px; background: var(--heading); border: 1px solid var(--surface); transition: left 300ms var(--ease); }
.rm-status { font-size: .875rem; font-weight: 600; margin-top: 6px; color: var(--heading); }
.lighter-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); }

.res-add { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 640px) { .res-add { grid-template-columns: minmax(0, 1fr) 200px auto; } }
.star-btn { color: var(--text-muted); }
.star-btn.is-on { color: var(--accent-1-deep); }
.star-btn.is-on svg { fill: var(--accent-1); }

.bucket-gallery { columns: 2 150px; column-gap: 10px; }
@media (min-width: 768px) { .bucket-gallery { columns: 3 180px; } }
.bucket-tile { display: block; width: 100%; break-inside: avoid; margin-bottom: 10px; padding: 0; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); text-align: left; color: inherit; font: inherit; }
.bucket-tile img { width: 100%; display: block; }
.bucket-tile-art { display: flex; align-items: center; justify-content: center; height: 90px; background: var(--chip-1-bg); color: var(--chip-1-text); }
.bucket-tile-text { display: flex; flex-direction: column; padding: 10px; }
.bucket-photo-btn { padding: 0; border: 0; background: none; width: 100%; }
.bucket-photo-btn img { width: 100%; border-radius: 12px; }
.toast .toast-action { white-space: nowrap; flex: 0 0 auto; }
.goal-card { container-type: inline-size; }
@container (max-width: 300px) { .goal-card-main { flex-direction: column; text-align: center; } .goal-card-main .clamp-2 { -webkit-line-clamp: 3; } }

/* =============================== SESSION 4: MY PLANS =============================== */
.today-layout { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .today-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.timer-ring.is-ending { animation: gp-pulse 1s ease-in-out infinite; }
.focus-timer .stack-sm { display: flex; }
.priority-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.priority-row:last-child { border-bottom: 0; }
.priority-row .check-hit { margin-top: 2px; }
.wk-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
/* Each day is at least 15rem wide so task names read normally: 3 across on a laptop, 2 on an iPad, then the rest of the week below. */
@media (min-width: 768px) { .wk-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); } }
.wk-col { display: flex; flex-direction: column; gap: 4px; padding: 8px; border-radius: 12px; background: var(--surface-alt); min-height: 120px; }
.wk-col.is-today { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.wk-col.is-over, .wk-any.is-over { background: var(--chip-2-bg); }
.wk-col-head { display: flex; justify-content: space-between; align-items: baseline; }
.wk-col .list-row { flex-wrap: nowrap; align-items: flex-start; padding: 4px 0; gap: 6px; font-size: .9375rem; }
.wk-col .list-row > div, .wk-any .list-row > div { overflow-wrap: break-word; hyphens: auto; }
.wk-col .list-row .chip, .wk-any .list-row .chip { padding: 2px 8px; overflow-wrap: break-word; hyphens: auto; }
@media (hover: hover) and (pointer: fine) and (min-width: 1025px) { .wk-col .list-row .btn-icon { width: 32px; height: 32px; min-width: 32px; min-height: 32px; margin: -2px -4px 0 0; } }
.is-dragging { opacity: .5; }
.wk-any { padding: 10px; border-radius: 12px; border: 1px dashed var(--btn-ghost-border); margin-top: 10px; }
.wk-day { border-bottom: 1px solid var(--divider); padding: 6px 0; }
.wk-day > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.wk-day > summary::-webkit-details-marker { display: none; }
.wk-day > summary .card-title { flex: 1; }
.wk-day[open] .fs-chev { transform: rotate(180deg); }
.goal-group + .goal-group { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); }
.tiles-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
.kick-card { position: relative; overflow: hidden; }
.card-stripe { position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--brand-stripe); }
[data-theme="blush-sage"] .card-stripe, [data-theme="neutral"] .card-stripe, [data-theme="dark"] .card-stripe { background: linear-gradient(90deg, var(--chart-1), var(--chart-2), var(--chart-3), var(--chart-4)); }

/* calendar */
.cal-year { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .cal-year { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1024px) { .cal-year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cal-mini { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 12px; color: inherit; font: inherit; cursor: pointer; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.cal-mini-day { display: flex; flex-direction: column; align-items: center; font-size: .75rem; color: var(--text-muted); min-height: 24px; }
.cal-mini-day.is-today .nums { color: var(--heading); font-weight: 700; text-decoration: underline; }
.cal-dots { display: inline-flex; gap: 2px; align-items: center; min-height: 6px; }
.cal-dots .dot { width: 5px; height: 5px; border-radius: 50%; }
.cal-plus { font-size: .625rem; line-height: 1; color: var(--text-muted); }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.cal-head { text-align: center; font-size: .8125rem; font-weight: 600; color: var(--text-muted); padding: 4px 0; }
.cal-day { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; padding: 6px 2px; border-radius: 10px; border: 1px solid var(--divider); background: var(--surface); color: var(--text); font: inherit; }
@media (hover: hover) { .cal-day:hover { background: var(--surface-alt); } }
.cal-day.is-today { outline: 2px solid var(--focus-ring); outline-offset: -1px; }
.has-chips .cal-day { min-height: 104px; align-items: stretch; text-align: left; padding: 6px; }
.cal-chips { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-chip { display: block; font-size: .75rem; line-height: 1.3; padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--c) 35%, var(--surface)); color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.qstrip { display: grid; grid-template-columns: repeat(13, minmax(44px, 1fr)); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.qstrip-week { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; border-radius: 10px; background: var(--surface-alt); min-height: 64px; }
.qstrip-week.is-today { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.qstrip-num { font-size: .75rem; color: var(--text-muted); font-weight: 600; }
.qstrip-markers { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }

/* heatmap */
.hm-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; max-width: 320px; }
.hm-month.is-compact { max-width: 180px; }
.hm-cell { display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border-radius: 6px; background: var(--chart-track); border: 0; padding: 0; font-size: .75rem; color: var(--text); min-width: 0; }
.hm-month button.hm-cell { min-height: 36px; }
.hm-cell.is-rest { background: transparent; border: 1.5px dotted var(--btn-ghost-border); }
.hm-cell.is-today { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.hm-cell.is-restart { box-shadow: inset 0 -3px 0 var(--accent-1-deep); }
.hm-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.hm-scroll { overflow-x: auto; padding-bottom: 4px; }
.hm-year { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); grid-auto-columns: 11px; gap: 2px; width: max-content; }
.hm-year .hm-cell { aspect-ratio: auto; border-radius: 2px; }

/* =============================== SESSION 5: PROGRESS AND JOURNEY =============================== */
.ins-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .ins-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ins-wide { grid-column: 1 / -1; } }
@media (min-width: 1280px) { .ins-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ins-ring { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
@media (min-width: 640px) { .ins-ring { flex-direction: row; text-align: left; gap: 28px; } }
.hline { display: flex; gap: 14px; overflow-x: auto; padding: 18px 2px 8px; } /* room above for the flag circles, which sit 13 px above each item */
.hline-item { flex: 0 0 150px; display: flex; flex-direction: column; gap: 4px; border-top: 2px solid var(--border-accent); padding-top: 8px; position: relative; }
.hline-dot { position: absolute; top: -13px; left: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--chip-2-bg); color: var(--chip-2-text); display: inline-flex; align-items: center; justify-content: center; }
.hline-title { font-size: .9375rem; font-weight: 500; margin-top: 8px; }
.hline-item .helper { margin-top: 10px; }
.routine { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider); }
.routine:last-child { border-bottom: 0; }
.ch-mini { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; margin-top: 8px; }
.ch-mini-cell { aspect-ratio: 1; border-radius: 3px; background: var(--chart-track); }
.ch-mini-cell.is-done { background: var(--chart-2); }
.ch-mini-cell.is-today { outline: 1.5px solid var(--focus-ring); }
.ch-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.ch-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 56px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .875rem; }
.ch-cell.is-done { border-color: transparent; color: var(--check-tick); font-weight: 600; }
.ch-cell.is-future { background: var(--surface-alt); color: var(--text-muted); cursor: default; }
.ch-cell.is-missed, .ch-cell.is-rest { background: transparent; border: 1.5px dotted var(--btn-ghost-border); }
.ch-cell.is-now { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.ch-today { font-size: .75rem; color: var(--text-muted); }
.jar-hero { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; justify-content: center; text-align: center; }
@media (min-width: 640px) { .jar-hero { justify-content: flex-start; text-align: left; } }
.jar-visual { position: relative; width: 150px; height: 180px; flex: 0 0 150px; }
.jar-visual .art-inline { position: absolute; inset: 0; }
.jar-stars { position: absolute; inset: 0; width: 100%; height: 100%; }
.jar-visual.is-glowing { filter: drop-shadow(0 0 16px var(--accent-1)); }
.win-thumb { width: 44px; height: 44px; }
.hl-photo { width: 100%; max-height: 160px; object-fit: cover; border-radius: 10px; }
.shake-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; }
.badge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 768px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .badge-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 8px; border-radius: 14px; border: 1.5px dashed var(--btn-ghost-border); }
.badge.is-earned { border: 1px solid var(--border-accent); background: var(--surface-alt); }
.badge-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.badge:not(.is-earned) .badge-icon { background: transparent !important; color: var(--text-muted) !important; }
.fresh-landing { text-align: center; }
.fresh-landing .card-body { display: flex; flex-direction: column; align-items: center; }
.fresh-art { width: 160px; height: 120px; }
.mt-gap { margin-top: var(--gap); }

/* sync card */
.sync-code { font-family: var(--font-display); font-size: 2.5rem; text-align: center; letter-spacing: .08em; color: var(--heading); font-variant-numeric: lining-nums tabular-nums; margin: 10px 0; }
.sync-code-input { text-align: center; font-size: 1.5rem; letter-spacing: .1em; margin-top: 6px; }
.sync-pics { display: flex; gap: 18px; justify-content: center; margin: 12px 0; }
.sync-pics > span { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sync-pic { font-size: 2.25rem; line-height: 1; }
.sync-key { display: block; width: 100%; font-family: ui-monospace, monospace; font-size: .9375rem; padding: 12px; border-radius: 10px; background: var(--surface-alt); border: 1px solid var(--border); color: var(--text); overflow-wrap: anywhere; text-align: left; margin-top: 10px; }
.sync-key-hidden { color: transparent; text-shadow: 0 0 8px var(--text-muted); }

/* ---------- Session 7: long text and touch targets ---------- */
/* A pasted link with no spaces must never push a card past the screen edge. */
main { overflow-wrap: break-word; }
.card, .ins-grid > *, .stack > *, .home-slot { min-width: 0; }
.chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
.list-row > span, .list-row > a, .list-row > div { min-width: 0; overflow-wrap: break-word; }
.word-layout > *, .grid-cards > * { min-width: 0; }
.list-row > .chip { flex: 0 1 auto; max-width: 55%; }

/* Fingers need 44 px (brief 15.x). Applied to touch screens and anything tablet width or narrower. */
@media (max-width: 1024px), (pointer: coarse) {
  .btn-sm, button.chip, a.chip, .subtab, .vb-toolbar .subtab, .vb-toolbar .btn, .seg button, .vb-toolbar .seg button,
  .toast .toast-action, #update-banner button, .list-editor .input, .fs-section > summary { min-height: 44px; }
  .quick-icon { width: 44px; height: 44px; }
  .photo-remove { width: 44px; height: 44px; top: -14px; right: -14px; }
  .hm-month button.hm-cell { min-height: 44px; aspect-ratio: auto; }
  /* These keep their look and their place in the layout; only the tappable area grows. */
  .le-text { display: block; padding-block: 9px; margin-block: -9px; }
  main a:not([class]), main a.card-title, main a.btn-link, main button.btn-link { padding-block: 10px; margin-block: -10px; }
  .switch::before { content: ''; position: absolute; inset: -6px 0; }
}

.q-goal-row { flex-wrap: wrap; }
.q-goal-row > a { flex: 1 1 calc(100% - 64px) !important; }

/* ---------- Session 8: Section 25 details ---------- */
.done-text { transition: color 250ms var(--ease); }
.strike-in { position: relative; display: inline-block; text-decoration: none; }
.strike-in::after { content: ''; position: absolute; left: 0; right: 0; top: 54%; height: 2px; background: var(--border-accent); transform-origin: left center; animation: gp-draw-x 250ms var(--ease) both; }
.step-dots .sl.is-new { transform-origin: left center; animation: gp-draw-x 400ms var(--ease) both; }
.step-dots .sd.is-new { animation: gp-tick-pop 400ms var(--ease) both; }
@keyframes gp-draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* Quiet buttons sit on a tinted card here, where the ghost text color falls just short of 4.5:1. */
.card-alt .btn-ghost, .card-alt .btn-text, .callout .btn-ghost, .callout .btn-text, .wk-col .btn-text { color: var(--text); }

/* Free demo only (html.is-demo is set by the demo build). */
html.is-demo #settings-install, html.is-demo #settings-sync, html.is-demo #settings-backup, html.is-demo #settings-version, html.is-demo [data-install] { display: none !important; }
.demo-bar { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 6px 16px; background: var(--chip-2-bg); color: var(--chip-2-text); font-size: .875rem; font-weight: 600; }
@media print { .demo-bar { display: none; } }

/* The floating Add button (56 px) must never cover the last control on a page. */
.main-wrap { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom) + 96px); }
.hm-cell:disabled { opacity: .45; cursor: default; }

/* Extra large text: button labels wrap instead of pushing past the screen edge, and grid children may shrink. */
.btn { white-space: normal; max-width: 100%; min-width: 0; text-align: center; padding-block: 6px; }
.settings-layout > *, .cal-month > * { min-width: 0; }
.has-chips .cal-day { padding: 6px 3px; }
.card-head { flex-wrap: wrap; }
.card-head > .row { flex-wrap: wrap; min-width: 0; }
.cal-mini-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-mini { padding: 10px 8px; }
/* Large text on a narrow phone: one month per row in the year view. */
@media (max-width: 420px) { html[style*="112.5%"] .cal-year, html[style*="125%"] .cal-year { grid-template-columns: minmax(0, 1fr); } }

/* iPhone: date boxes must be allowed to shrink; pop-ups must fit above Safari's address bar. */
input[type="date"].input, input[type="time"].input { min-width: 0; }
@media (min-width: 768px) { .dialog { max-height: 86dvh; } .dialog-full { max-height: 90dvh; } }

/* Links on tinted cards: the link color is 4.44:1 there, so use body text with an underline. */
.card-alt a:not(.btn):not(.chip), .callout a:not(.btn):not(.chip) { color: var(--text); text-decoration: underline; }
.dialog, .dialog-body { min-width: 0; }
/* List rows with extra actions: the text keeps at least 160 px; the actions move to their own line when there isn't room. */
.le-row { flex-wrap: wrap; }
.le-main { flex: 1 1 160px; min-width: 0; }
.le-actions { flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
@media (max-width: 1024px), (pointer: coarse) { .le-text { padding-block: 11px; margin-block: -11px; } main a:not([class]), main a.card-title, main a.btn-link, main button.btn-link { padding-block: 11px; margin-block: -11px; } }
.print-text { display: none; }
@media print { .print-text { display: block; } }
#update-banner button.is-later { background: transparent; color: inherit; border: 1px solid currentColor; }
#update-banner button:disabled { opacity: .75; }

/* Milestone checklist on goal cards (My Goals) */
.ms-mini { margin-top: 2px; }
.ms-mini .label { margin-bottom: 2px; }
.ms-mini .list-row { padding: 4px 0; gap: 10px; align-items: center; border-bottom: 1px solid var(--divider); }
.ms-mini .list-row:last-child { border-bottom: 0; }
.ms-mini .list-row .helper { font-size: .8125rem; }
.ms-mini .btn-link { display: inline-block; margin-top: 4px; font-size: .875rem; }

/* Fields placed side by side in a row don't get the stacked-field gap (it pushed the Vision Board's Editing/Viewing toggle down). */
.row-wrap > .field + .field, .row > .field + .field { margin-top: 0; }
/* Vision Board toolbar: toggles the same height as the buttons beside them. */
.vb-toolbar .seg { padding: 0; gap: 0; }
.vb-toolbar .row-wrap { align-items: center; }

/* An example that was too long to fit inside a one-line box (utils/placeholder-fit.js) */
.field-hint { margin: 0 0 6px; font-size: .875rem; line-height: 1.35; color: var(--text-muted); }
.field > .field-hint { margin-bottom: 0; }
/* Today's top priority: the checkbox lines up with the text box, even when an example hint sits above the box. */
.tp-row { align-items: flex-end; }
.tp-row > .check-hit { margin-bottom: 1px; }

/* While a pop-up is open: no bottom bar or floating button over its buttons, no pull-to-refresh behind it (Luna PWA rules). */
html.overlay-open, body.overlay-open { overscroll-behavior: none; }
body.overlay-open .bottom-bar, body.overlay-open .fab { display: none !important; }

/* The "More" pop-up menu (phones and tablets) */
.more-menu { display: flex; flex-direction: column; gap: 14px; padding-bottom: 4px; }
.more-group-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-family: var(--font-body); font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.more-group-title .icon { color: var(--nav-icon); }
.more-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .more-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.more-item { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: .9375rem; font-weight: 500; text-align: left; text-decoration: none; cursor: pointer; overflow-wrap: anywhere; }
.more-item .icon { color: var(--nav-icon); flex: 0 0 auto; }
.more-item[aria-current="page"] { background: var(--nav-bg); color: var(--nav-text); border-color: transparent; font-weight: 600; }
@media (hover: hover) { .more-item:hover { background: var(--surface-alt); } }
.more-foot { margin: 4px 0 0; font-size: .8125rem; color: var(--text-muted); text-align: center; }
/* Narrow dashboard column: a list row's text keeps at least 9rem; the date chip drops to its own line instead of squeezing the words. */
.home-side .list-row { flex-wrap: wrap; }
.home-side .list-row > span:not(.chip), .home-side .list-row > a, .home-side .list-row > div:not(.row-wrap) { flex: 1 1 9rem; }
.lr-text { flex: 1 1 9rem; min-width: 0; }
