/* ===== WorkBoost styles =====
   Always dark. Purple is the main accent; each motivation type has its own bright color.
   All colors live in variables so the future iOS app can share one palette. */
:root {
  --bg: #0b0a10;
  --surface: #17161e;
  --surface-2: #211f2a;
  --surface-3: #2b2836;
  --border: #2c2a36;
  --text: #f6f5fa;
  --muted: #9a97a8;
  --faint: #6c6979;

  --accent: #8f6cff;          /* main purple */
  --accent-2: #b8a2ff;        /* light lavender */
  --accent-soft: rgba(143, 108, 255, .16);
  --on-accent: #ffffff;
  --banner: linear-gradient(135deg, #8a63ff 0%, #a98bff 55%, #c3adff 100%);

  --success: #32d27a;
  --danger: #ff5a5f;
  --warning: #ffb020;

  /* One bright color per motivation type */
  --t-positive: #ff9f0a;
  --t-negative: #ff4d5e;
  --t-interest: #2fd27a;
  --t-routine: #3b8cff;
  --t-timing: #b46bff;

  --radius: 22px;
  --radius-sm: 14px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); }

body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* soft purple glow at the top, like light behind the screen */
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(143, 108, 255, .18), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}

[hidden] { display: none !important; }
a { color: inherit; }

/* ===== Layout ===== */
.screen {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(18px + var(--safe-t)) 16px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: screen-in .35s cubic-bezier(.2, .8, .2, 1);
}
.screen.center { justify-content: center; }
.screen.has-tabbar { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); }
@keyframes screen-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack.tight { gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }

/* ===== Text ===== */
h1 { font-size: 30px; line-height: 1.15; margin: 0; letter-spacing: -.02em; font-weight: 800; }
h2 { font-size: 19px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 16px; margin: 0; font-weight: 700; }
p { margin: 0; }
.muted { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.note { font-size: 13px; color: var(--muted); text-align: center; }
.error { color: var(--danger); font-size: 14px; }
.center-text { text-align: center; }

/* ===== Top bar ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.topbar .title { font-weight: 700; font-size: 17px; }
.icon-btn {
  appearance: none; border: none; background: var(--surface-2); color: var(--text);
  width: 44px; height: 44px; border-radius: 14px; font-size: 18px; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  transition: transform .12s ease, background .15s ease;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }
.spacer-44 { width: 44px; flex: none; }

/* Greeting header on Home */
.hello { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; flex: none;
  background: var(--banner); color: #fff; font-weight: 800; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(184, 162, 255, .45);
}
.hello .eyebrow { margin-bottom: 1px; }
.hello .name { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

/* ===== Brand (login) ===== */
.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.logo {
  width: 76px; height: 76px; border-radius: 24px; background: var(--banner); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900;
  box-shadow: 0 12px 40px rgba(143, 108, 255, .45);
}

/* ===== Cards ===== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px;
}
.card-head { display: flex; align-items: center; gap: 10px; }
.card-head .chev { margin-left: auto; color: var(--muted); text-decoration: none; font-size: 20px; }
.card-icon {
  width: 32px; height: 32px; border-radius: 10px; background: var(--surface-3); flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; color: var(--accent-2);
}
.card-icon svg { width: 18px; height: 18px; }

/* Purple banner with a progress ring */
.banner {
  background: var(--banner); color: #fff; border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden;
  box-shadow: 0 14px 40px rgba(143, 108, 255, .28);
}
.banner::after { /* soft diagonal shine */
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(120deg, rgba(255,255,255,.07) 0 18px, transparent 18px 40px);
  pointer-events: none;
}
.banner > * { position: relative; z-index: 1; }
.banner h2 { font-size: 18px; }
.banner p { font-size: 14px; opacity: .92; }
.ring { width: 64px; height: 64px; flex: none; position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; }

/* "How well WorkBoost knows you" ring card */
.know-ring .ring circle:first-child { stroke: var(--surface-3); }
.know-ring .ring circle:last-child { stroke: var(--accent-2); }
.know-ring .ring { width: 70px; height: 70px; }
.know-step { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: var(--text); font-size: 14px; font-weight: 600; }
.know-step .go { color: var(--faint); font-size: 18px; }
.know-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--faint); flex: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; color: #fff; }
.know-dot.ok { background: var(--success); border-color: var(--success); }

/* Big numbers */
.big-num { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.big-num small { font-size: 18px; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.trend { font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }
.trend.flat { color: var(--muted); }

/* 7-day bar chart */
.chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 120px; }
.chart .col { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; }
.chart .bar-wrap { flex: 1; width: 100%; max-width: 26px; display: flex; flex-direction: column-reverse; border-radius: 8px; overflow: hidden; background: var(--surface-2); }
.chart .seg { width: 100%; }
.chart .day { font-size: 11px; color: var(--muted); font-weight: 600; }
.chart .col.today .day { color: var(--text); }
.legend-line { height: 4px; border-radius: 99px; display: flex; overflow: hidden; gap: 2px; }
.legend-line span { flex: 1; }

/* Mini stats row (3 across) */
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-stat { display: flex; flex-direction: column; gap: 2px; }
.mini-stat .k { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.mini-stat .v { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }

/* ===== Colored circle icons (one per motivation type) ===== */
.circle {
  width: 52px; height: 52px; border-radius: 50%; background: var(--c, var(--accent)); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 24px; flex: none;
  box-shadow: 0 6px 18px color-mix(in srgb, var(--c, var(--accent)) 40%, transparent);
}
.circle svg { width: 26px; height: 26px; }
.circle.sm svg { width: 18px; height: 18px; }
.circle.sm { width: 36px; height: 36px; font-size: 17px; box-shadow: none; }
.circle.xs { width: 28px; height: 28px; font-size: 14px; box-shadow: none; }
.circles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.circle-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-size: 12px; font-weight: 600; text-align: center; }
.circle-item:active .circle { transform: scale(.92); }
.circle { transition: transform .12s ease; }

/* ===== Buttons ===== */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 16px; padding: 15px 18px;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; text-align: center; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, opacity .15s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 24px rgba(143, 108, 255, .35); }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: rgba(255, 90, 95, .12); color: var(--danger); }
.btn.block { width: 100%; }

/* Home action tiles */
.action {
  display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text);
  transition: transform .12s ease;
}
.action:active { transform: scale(.98); }
.action .label { font-size: 17px; font-weight: 800; }
.action .sub { font-size: 13px; color: var(--muted); }
.action .go { margin-left: auto; color: var(--muted); font-size: 22px; }
.action.hero { background: linear-gradient(135deg, #5b35e0 0%, #7a52ff 100%); border: none; color: #fff; box-shadow: 0 14px 40px rgba(143, 108, 255, .28); }
.action.hero .sub, .action.hero .go { color: rgba(255,255,255,.85); }
.action.hero .circle { background: rgba(255,255,255,.22); box-shadow: none; }

/* ===== Forms ===== */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, textarea, select {
  font: inherit; font-weight: 500; color: var(--text); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 14px; padding: 15px 16px; width: 100%;
  transition: border-color .15s ease, background .15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 120px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface-3); }

/* ===== Segmented tabs (login) ===== */
.tabs { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px; }
.tab {
  flex: 1; appearance: none; border: none; background: transparent; color: var(--muted);
  font: inherit; font-weight: 700; padding: 11px; border-radius: 12px; cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.tab.active { background: var(--surface-3); color: var(--text); }

/* ===== Progress ===== */
.progress { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .3s ease; }

/* ===== Chips (feelings, options) ===== */
.chip-group { display: flex; flex-direction: column; gap: 10px; }
.chip-group-title { font-size: 13px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.chip-group-title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--dot, var(--muted)); box-shadow: 0 0 10px var(--dot, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none; border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; padding: 11px 15px; border-radius: 99px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { border-color: var(--chip-c, var(--accent)); background: color-mix(in srgb, var(--chip-c, var(--accent)) 18%, transparent); }

/* ===== Selectable option cards (modes, wellbeing) ===== */
.option-card {
  appearance: none; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 18px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.option-card:active { transform: scale(.98); }
.option-card.selected { border-color: var(--accent); background: var(--accent-soft); }
.option-card.savage.selected { border-color: var(--danger); background: rgba(255, 90, 95, .12); }
.option-card.locked { opacity: .45; cursor: not-allowed; }
.option-card .oc-emoji { font-size: 26px; width: 34px; text-align: center; flex: none; }
.option-card .oc-title { display: block; font-weight: 800; font-size: 16px; }
.option-card .oc-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.option-card .oc-check { width: 26px; height: 26px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff; }
.option-card.selected .oc-check { background: var(--accent); }
.option-card.savage.selected .oc-check { background: var(--danger); }

.warning { background: rgba(255, 90, 95, .1); border: 1.5px solid rgba(255, 90, 95, .45); border-radius: 18px; padding: 16px; font-size: 14px; animation: rise .3s ease; }
.warning h3 { color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 700; cursor: pointer; margin-top: 4px; }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--danger); padding: 0; margin: 1px 0 0; }

.support { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.section-tag { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13px; font-weight: 800; color: var(--accent-2); background: var(--accent-soft); padding: 6px 12px; border-radius: 99px; }

/* Ranked picks ("what's pulling you away") */
.chip .rank { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.chip-sub { font-size: 12px; font-weight: 700; color: var(--muted); }
.write-row { display: flex; gap: 8px; }
.write-row input { flex: 1; }
.write-row .btn { padding: 12px 16px; }

/* ===== Badges ===== */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700;
  padding: 6px 11px; border-radius: 99px; background: var(--surface-2); color: var(--text);
}

/* ===== Motivation message ===== */
.message-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--type-color, var(--accent)) 22%, var(--surface)) 0%, var(--surface) 60%);
  border-color: color-mix(in srgb, var(--type-color, var(--accent)) 35%, var(--border));
}
.message-text { font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -.01em; animation: rise .4s cubic-bezier(.2, .8, .2, 1); }
.task-line { font-size: 14px; }
.loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 12px 0; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--surface-3); border-top-color: var(--accent-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Bottom sheet ("Did this motivate you?") */
.sheet {
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px; padding: 20px 18px 18px;
  animation: rise .35s cubic-bezier(.2, .8, .2, 1);
}
.sheet::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: -8px auto 14px; }

/* ===== Lists ===== */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); font-size: 15px; }
.list-item:first-child { border-top: none; padding-top: 2px; }
.list-item .time { margin-left: auto; color: var(--faint); font-size: 12px; white-space: nowrap; font-weight: 600; }

/* Grouped settings-style list */
.group { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.group-row {
  appearance: none; width: 100%; border: none; background: transparent; color: var(--text); font: inherit; font-weight: 600;
  display: flex; align-items: center; gap: 12px; padding: 15px 16px; text-align: left; text-decoration: none; cursor: pointer;
}
.group-row + .group-row { border-top: 1px solid var(--border); }
.group-row:active { background: var(--surface-2); }
.group-row .go { margin-left: auto; color: var(--faint); font-size: 20px; }
.group-row.danger { color: var(--danger); }

/* ===== Profile ranking bars ===== */
.rank-row { display: grid; grid-template-columns: 36px 1fr 44px; gap: 12px; align-items: center; font-size: 15px; font-weight: 600; }
.bar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar > span { display: block; height: 100%; border-radius: 99px; }
.pct { text-align: right; color: var(--muted); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat b { display: block; font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.stat span { font-size: 13px; color: var(--muted); font-weight: 600; }

.success-emoji { font-size: 64px; text-align: center; animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.actions.two { flex-direction: row; }
.actions.two .btn { flex: 1; }

/* ===== Bottom tab bar ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 8px 12px calc(8px + var(--safe-b));
  background: rgba(16, 15, 22, .78);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.tabbar nav { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0;
  color: var(--faint); text-decoration: none; font-size: 11px; font-weight: 600;
  transition: color .15s ease, transform .12s ease;
}
.tabbar a:active { transform: scale(.92); }
.tabbar a svg { width: 26px; height: 26px; }
.tabbar a.active { color: var(--accent-2); }
.tabbar a.active .tab-ic { background: var(--accent-soft); }
.tab-ic { padding: 3px 12px; border-radius: 99px; display: inline-flex; transition: background .2s ease; }

/* ===== Planner ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h2 { font-size: 18px; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav .icon-btn { width: 36px; height: 36px; border-radius: 12px; }
.cal-nav .icon-btn svg { width: 18px; height: 18px; }
.cal-nav .icon-btn.fwd svg { transform: rotate(180deg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal-wd { font-size: 11px; font-weight: 700; color: var(--faint); padding: 4px 0; }
.cal-day {
  appearance: none; border: none; background: transparent; color: var(--text); font: inherit; font-weight: 700; font-size: 15px;
  aspect-ratio: 1; border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  transition: background .15s ease, transform .1s ease;
}
.cal-day:active { transform: scale(.92); }
.cal-day.past { color: var(--muted); }
.cal-day.today { color: var(--accent-2); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day.selected { background: var(--accent); color: #fff; box-shadow: none; }
.cal-day .dots { display: flex; gap: 2px; height: 5px; }
.cal-day .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }
.cal-day .dots i.missed { background: var(--danger); }
.cal-day .dots i.done { background: var(--success); }
.cal-day.selected .dots i { background: #fff; }

.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.task-row:first-child { border-top: none; padding-top: 4px; }
.task-check {
  appearance: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--faint); background: transparent; color: #fff;
  flex: none; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; transition: transform .12s ease, background .15s ease;
}
.task-check:active { transform: scale(.88); }
.task-check svg { width: 18px; height: 18px; opacity: 0; }
.task-check.done { background: var(--success); border-color: var(--success); }
.task-check.done svg { opacity: 1; }
.task-check.missed { border-color: var(--danger); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.task-meta .rep { display: inline-flex; align-items: center; gap: 3px; }
.task-meta .rep svg { width: 13px; height: 13px; }
.pill { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 99px; text-transform: uppercase; letter-spacing: .03em; }
.pill.missed { background: rgba(255, 90, 95, .15); color: var(--danger); }
.pill.late { background: rgba(255, 176, 32, .15); color: var(--warning); }
.pill.done { background: rgba(50, 210, 122, .14); color: var(--success); }
.task-time { font-weight: 800; font-size: 14px; white-space: nowrap; color: var(--accent-2); }

.fab {
  position: fixed; right: max(16px, calc(50% - 224px)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; border: none; background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(143, 108, 255, .5);
  transition: transform .12s ease;
}
.fab:active { transform: scale(.9); }
.fab svg { width: 28px; height: 28px; }

/* Bottom-sheet modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
}
.modal {
  width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: 28px 28px 0 0; border: 1px solid var(--border); border-bottom: none;
  padding: 10px 18px calc(22px + var(--safe-b)); animation: sheet-up .3s cubic-bezier(.2, .8, .2, 1);
}
.modal::before { content: ""; display: block; width: 38px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 0 auto 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { transform: translateY(100%); } }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.day-chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day-chips .chip { padding: 10px 0; justify-content: center; font-size: 13px; }
input[type="date"], input[type="time"] { min-height: 52px; color-scheme: dark; }

/* ===== Voice + rating ===== */
.btn.small { padding: 8px 12px; font-size: 14px; min-height: 0; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.speaker {
  appearance: none; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: transform .12s ease, opacity .15s ease;
}
.speaker:active { transform: scale(.9); }
.speaker.off { opacity: .4; }
.speaker:disabled { cursor: progress; }
.rating { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rate {
  appearance: none; border: 1.5px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer;
  border-radius: 16px; padding: 10px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.rate:active { transform: scale(.93); }
.rate[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.rate-emoji { font-size: 24px; line-height: 1.1; }
.rate b { font-size: 14px; }
.rate-label { font-size: 10.5px; font-weight: 700; color: var(--muted); text-align: center; line-height: 1.15; }
.saved-text { font-size: 16px; line-height: 1.45; font-weight: 600; }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); display: inline-block; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.script-box { background: var(--surface-2); border-radius: 16px; padding: 14px 16px; font-size: 15px; line-height: 1.55; }
audio { width: 100%; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
