/* Pomodive design system: see design-system/deep/MASTER.md */
:root {
  color-scheme: dark;
  --bg: #07070b;
  --surface: #101017;
  --surface-2: #181821;
  --surface-3: #20202b;
  --tint-1: rgba(255,255,255,0.03);
  --tint-2: rgba(255,255,255,0.045);
  --tint-3: rgba(255,255,255,0.08);
  --border: rgba(255,255,255,0.07);
  --line: rgba(255,255,255,0.12);
  --line-strong: rgba(255,255,255,0.18);
  --line-stronger: rgba(255,255,255,0.3);
  --text: #ecebe8;
  --text-dim: #a5a4b4;    /* secondary text, ≥ 6:1 on every surface */
  --text-faint: #8b8a9b;  /* tertiary text, ≥ 4.5:1 on every surface */
  --ui-muted: #4a4958;    /* non-text strokes (ticks, empty dots) */
  --danger: #ff6b6b;
  --on-accent: #0b0b10;
  --focus: #ff6b4a;
  --focus-glow: rgba(255,107,74,0.16);
  --focus-ink: #c43d1f;
  --short: #4adfb5;
  --short-glow: rgba(74,223,181,0.14);
  --short-ink: #0f766e;
  --long: #6b8aff;
  --long-glow: rgba(107,138,255,0.16);
  --long-ink: #3451c7;
  --accent: var(--focus);
  --accent-glow: var(--focus-glow);
  --accent-ink: var(--focus-ink);
  --radius: 12px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f4ee;
  --surface: #fffdf9;
  --surface-2: #efebe3;
  --surface-3: #e6e1d7;
  --tint-1: rgba(0,0,0,0.02);
  --tint-2: rgba(0,0,0,0.035);
  --tint-3: rgba(0,0,0,0.06);
  --border: rgba(0,0,0,0.08);
  --line: rgba(0,0,0,0.12);
  --line-strong: rgba(0,0,0,0.18);
  --line-stronger: rgba(0,0,0,0.32);
  --text: #1a1a1f;
  --text-dim: #4d4c5c;
  --text-faint: #615f70;
  --ui-muted: #c9c4b8;
  --danger: #c62828;
  --focus-glow: rgba(255,107,74,0.16);
  --short-glow: rgba(15,118,110,0.12);
  --long-glow: rgba(52,81,199,0.12);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, select, input { font-family: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
kbd { font-family: 'JetBrains Mono', monospace; font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text-dim); }

/* ─── Frame ─── */
.app { position: relative; max-width: 600px; margin: 0 auto; padding: 0 20px; padding-top: env(safe-area-inset-top); overflow-x: clip; }
.header { position: relative; z-index: 2; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 26px; color: var(--text); }
.brand img { width: 30px; height: 30px; }
/* Small phones (< 380 px): the header keeps its four 44 px buttons by dropping the icon
   (it is still the tab and home-screen icon) and setting the name a little smaller (QA 15 Nov). */
@media (max-width: 379px) {
  .brand img { display: none; }
  .brand { font-size: 22px; }
}
/* Wordmark: bold lower-case "pomodive", the first "o" is a tomato (MASTER.md › Logo). */
.wordmark { font-family: 'DM Sans', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.03em; display: inline-flex; align-items: center; line-height: 1; }
.wordmark .tomato { width: 0.74em; height: 0.74em; margin: 0 0.01em; position: relative; top: 0.02em; flex: none; }
.wordmark .fruit { fill: var(--brand-tomato); }
.wordmark .leaf { fill: var(--brand-leaf); }
.nav { display: flex; gap: 4px; }
.nav-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, color 0.2s, border-color 0.2s; }
.nav-btn:hover { background: var(--tint-3); color: var(--text); border-color: var(--border); }
.nav-btn svg { width: 20px; height: 20px; fill: currentColor; }
.nav-btn.labeled, .nav-btn.short-label { width: auto; padding: 0 14px 0 12px; gap: 8px; font-size: 14px; font-weight: 600; }
/* The mini-timer and zen buttons show their word only where there is room. */
.nav-btn.short-label { width: 40px; padding: 0; } .nav-btn.short-label span { display: none; }
@media (min-width: 1200px) { .nav-btn.short-label { width: auto; padding: 0 14px 0 12px; } .nav-btn.short-label span { display: inline; } }
.nav-btn.labeled svg, .nav-btn.short-label svg { width: 18px; height: 18px; }
@media (max-width: 520px) { .nav-btn.labeled { width: 40px; padding: 0; } .nav-btn.labeled span { display: none; } }
.layout { display: block; width: 100%; }

/* ─── Stage ─── */
.stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0 4px; }
.stage::before { content: ''; position: absolute; z-index: -1; width: 640px; height: 420px; left: 50%; top: -40px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 68%); transition: background 1s ease; pointer-events: none; }
.timer-card { --water: color-mix(in srgb, var(--accent-glow) 55%, transparent); position: relative; overflow: hidden; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 20px 20px; isolation: isolate; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
/* Waterline: sinks through the card as a focus session passes, rises on breaks. Sits behind the content. */
.depth { position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 0; pointer-events: none; opacity: 0; background: linear-gradient(to bottom, transparent, var(--water)); border-bottom: 1px solid var(--lit); transition: height 0.5s ease, opacity 0.4s ease; }
.depth.on { opacity: 1; }
.depth span { position: absolute; bottom: 7px; padding: 3px 7px; border-radius: 999px; background: var(--surface); font-size: 12px; line-height: 1; white-space: nowrap; }
.depth.shallow span { bottom: auto; top: calc(100% + 8px); }
.depth.deep span { visibility: hidden; } /* the water has reached the Today line: the clock says it already */
.depth-word { left: 12px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--text-dim); }
.depth-value { right: 12px; font-family: 'JetBrains Mono', monospace; font-weight: 500; color: var(--lit); }
@media (max-width: 480px) { .depth-word { display: none; } }
.value-line { font-size: 14px; color: var(--text-dim); text-align: center; max-width: 560px; text-wrap: balance; }
.modes { display: flex; gap: 22px; margin-top: -4px; }
.mode-btn { position: relative; min-height: 40px; padding: 8px 2px; border: none; background: none; color: var(--text-dim); font-size: 14px; font-weight: 500; letter-spacing: 0.2px; cursor: pointer; transition: color 0.2s; }
.mode-btn::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px; border-radius: 1px; background: var(--accent); transform: scaleX(0); transition: transform 0.25s ease; }
.mode-btn:hover { color: var(--text); }
.mode-btn.active { color: var(--text); }
.mode-btn.active::after { transform: scaleX(1); }

.timer-display { font-family: 'JetBrains Mono', monospace; font-weight: 400; font-size: clamp(76px, 22vw, 124px); letter-spacing: -0.03em; line-height: 1; margin-top: 10px; font-variant-numeric: tabular-nums; color: var(--text); }
.session-msg { max-width: 100%; font-size: 15px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-line { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.session-count { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text-faint); }
.cycle-dots { display: flex; gap: 6px; }
.cycle-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--text-faint); transition: all 0.3s; }
.cycle-dot.done { background: var(--focus); border-color: var(--focus); }
.cycle-dot.current { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-glow); }

.controls { display: flex; align-items: center; gap: 20px; margin-top: 10px; }
.ctrl-round { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.ctrl-round:hover { color: var(--text); border-color: var(--line-stronger); }
.ctrl-round svg { width: 20px; height: 20px; fill: currentColor; }
.controls .ctrl-round[hidden] { display: inline-flex !important; visibility: hidden; }
.btn-primary { min-width: 168px; height: 56px; padding: 0 28px; border: 1.5px solid transparent; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 17px; font-weight: 700; letter-spacing: 0.4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 10px 30px var(--accent-glow); transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s, transform 0.15s; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 36px var(--accent-glow); }
.btn-primary:active { transform: translateY(1px) scale(0.98); }
.btn-primary svg { width: 18px; height: 18px; fill: currentColor; }
.btn-primary .icon-pause, .app.running .btn-primary .icon-play { display: none; }
.app.running .btn-primary .icon-pause { display: inline; }
.app.running .btn-primary { background: transparent; color: var(--text); border-color: var(--text-faint); box-shadow: none; }
.app.running .btn-primary:hover { background: var(--tint-3); box-shadow: none; }
.btn-primary .icon-surface, .app.over .btn-primary .icon-pause { display: none; }
.app.over .btn-primary .icon-surface { display: inline; }
.app.running .timer-display { text-shadow: 0 0 40px var(--accent-glow); }
.shortcut-hint { font-size: 14px; color: var(--text-faint); }
/* Focus state: while the timer runs the plan recedes; it returns on hover, keyboard focus or pause. */
.plan, .shortcut-hint { transition: opacity 0.5s ease; }
.app.running .plan, .app.running .shortcut-hint { opacity: 0.5; }
.app.running .plan:hover, .app.running .plan:focus-within { opacity: 1; transition-duration: 0.15s; }
@media (prefers-contrast: more) { .app.running .plan, .app.running .shortcut-hint { opacity: 1; } }
@media (hover: none) { .shortcut-hint { display: none; } }

@media (min-width: 1200px) {
  .app { max-width: 760px; }
  .timer-display { font-size: clamp(124px, 11vw, 200px); }
}
/* ─── Parking lot: park a stray thought, get back to work ─── */
.park { width: 100%; margin-top: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.park-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.park-title svg { width: 18px; height: 18px; fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.park-hint { font-size: 14px; line-height: 1.5; color: var(--text-dim); }
.park-form { display: flex; gap: 6px; }
.park-form .modal-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 15px; }
.park-add, .park-del { flex-shrink: 0; min-width: 40px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.park-del { border-color: transparent; }
.park-add:hover, .park-del:hover { background: var(--tint-3); color: var(--text); }
.park-add svg, .park-del svg { width: 16px; height: 16px; }
.park-add svg { fill: currentColor; }
.park-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.park-list:empty { display: none; }
.park-item { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 2px 0 2px 4px; border-radius: 8px; }
.park-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.park-item:hover { background: var(--tint-3); }
.park-text { flex: 1 1 150px; min-width: 0; padding: 6px 0; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.park-task { min-height: 32px; padding: 0 10px; }

/* ─── Break card and stay down ─── */
.break-card { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 420px; text-align: center; }
.break-text { display: flex; flex-direction: column; gap: 2px; }
.break-label { font-size: 14px; color: var(--text-dim); }
.break-idea { font-size: 16px; line-height: 1.45; color: var(--text); text-wrap: balance; }
.break-card .btn-text svg, .stay-down svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stay-down { min-height: 40px; margin-top: -4px; border-color: var(--lit); }

/* From 1280px the parking lot sits in its own column left of the clock (after the base styles above). */
@media (min-width: 1280px) {
  .app { max-width: 1320px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) 720px minmax(0, 1fr); column-gap: 32px; }
  .stage { grid-column: 2; grid-row: 1; }
  .plan { grid-column: 2; grid-row: 2; }
  .park { grid-column: 1; grid-row: 1 / span 2; align-self: start; justify-self: end; width: min(300px, 100%); margin-top: 8px; position: sticky; top: 16px; }
}

/* ─── Plan column ─── */
.plan { display: flex; flex-direction: column; gap: 22px; padding: 24px 0 48px; width: 100%; }
.summary { width: 100%; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 18px; margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-dim); }
.sum-head { display: flex; align-items: baseline; gap: 6px; }
.sum-head b, .sum-finish b { font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 14px; color: var(--text); }
.sum-finish b { margin: 0 5px; }
.plan-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; } /* owner's pick 1A */
.plan-title { font-weight: 700; font-size: 20px; letter-spacing: -0.2px; }
.project-list { display: flex; flex-direction: column; gap: 12px; }
.project-empty { font-size: 14px; color: var(--text-dim); padding: 16px; border: 1px dashed var(--line); border-radius: var(--radius); }
.project-card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color 0.2s, background 0.2s; }
.project-card:hover { border-color: var(--line); }
.project-card.active { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 16%, transparent); }
.project-head { display: flex; align-items: center; gap: 6px; padding: 10px 8px 10px 10px; }
.project-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 4px; background: none; border: none; color: inherit; text-align: left; cursor: pointer; border-radius: 8px; }
.project-color { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.project-info { flex: 1; min-width: 0; display: block; }
.project-name { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-done .project-name { text-decoration: line-through; color: var(--text-dim); }
.project-progress-text { display: block; font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text-faint); margin-top: 2px; }
.project-pomo-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 7px; }
.pomo-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--ui-muted); flex-shrink: 0; }
.pomo-dot.filled { border-color: transparent; }
.pomo-dot-overflow { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text-faint); padding-left: 2px; }
.project-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.project-card:hover .project-actions, .project-card:focus-within .project-actions, .project-card.active .project-actions { opacity: 1; }
@media (hover: none) { .project-actions { opacity: 1; } }
.project-action-btn { width: 40px; height: 40px; border-radius: 8px; border: none; background: transparent; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.project-action-btn svg { width: 15px; height: 15px; fill: currentColor; }
.project-action-btn:hover { background: var(--tint-3); color: var(--text); }
.project-action-btn.delete:hover { color: var(--danger); }

.task-panel { border-top: 1px solid var(--border); padding: 10px 12px 12px; }
.task-list { list-style: none; display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.task-row { display: flex; align-items: center; gap: 4px; border-radius: 8px; padding: 0 2px; }
.task-row.active { background: var(--tint-3); }
.task-row button { background: none; border: none; color: var(--text-dim); cursor: pointer; border-radius: 8px; min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
.task-row button svg { width: 16px; height: 16px; }
.task-check { position: relative; }
.task-check::before { content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text-faint); }
.task-check svg { position: relative; opacity: 0; width: 12px !important; height: 12px !important; }
.task-row.completed .task-check::before { background: var(--focus); border-color: var(--focus); }
.task-row.completed .task-check { color: var(--on-accent); }
.task-row.completed .task-check svg { opacity: 1; }
.task-select { flex: 1; min-width: 0; justify-content: space-between !important; gap: 8px; padding: 0 6px; color: var(--text) !important; font-size: 15px; text-align: left; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.completed .task-title { text-decoration: line-through; color: var(--text-faint); }
.task-count { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--text-faint); flex-shrink: 0; }
.task-today[aria-pressed="true"] { color: var(--accent) !important; }
.task-empty { font-size: 14px; color: var(--text-dim); margin-bottom: 8px; line-height: 1.5; }
.task-add { display: flex; flex-wrap: wrap; gap: 6px; }
/* The task box keeps room for its whole hint ("Adicionar uma tarefa"); on a narrow phone
   the estimate and Add move to a second row (QA 15 Nov). */
.task-add #taskInput { flex: 1 1 12.5em; min-width: 0; }
.task-add > :last-child { margin-left: auto; }
.task-add .modal-input { padding: 8px 10px; font-size: 14px; }
.task-add .task-est { width: 64px; flex-shrink: 0; }

.footer { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.privacy-badge { font-size: 14px; color: var(--text-dim); line-height: 1.6; }
.privacy-badge a { color: var(--text); }

/* ─── Buttons ─── */
.btn-text { white-space: nowrap; font-size: 14px; font-weight: 600; min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); cursor: pointer; transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn-text:hover { background: var(--tint-3); border-color: var(--line-strong); }
.btn-text svg { width: 14px; height: 14px; fill: currentColor; }
.btn-text.danger:hover { color: var(--danger); border-color: var(--danger); }

/* ─── Dialogs and sheets ─── */
.modal-overlay { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal-overlay.open { display: flex; }
.modal-panel { width: min(440px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,0.45); animation: dialogIn 0.22s ease; }
@keyframes dialogIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-overlay.sheet { justify-content: flex-end; align-items: stretch; padding: 0; }
.sheet .modal-panel { width: min(460px, 100%); height: 100%; max-height: none; border-radius: 0; border: none; border-left: 1px solid var(--line); animation: sheetIn 0.22s ease; }
@keyframes sheetIn { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; font-weight: 700; font-size: 22px; letter-spacing: -0.2px; }
.close-btn { width: 40px; height: 40px; border-radius: 10px; border: none; background: none; color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.close-btn:hover { background: var(--tint-3); color: var(--text); }
.modal-field { margin-bottom: 18px; }
.modal-label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.modal-input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 15px; outline: none; transition: border-color 0.2s; }
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--text-faint); }
.modal-input.narrow { width: 100px; }
.modal-panel.wide { width: min(480px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }
.modal-btn { min-height: 40px; padding: 0 20px; border-radius: 999px; border: none; font-size: 14px; font-weight: 700; cursor: pointer; }
.modal-btn-cancel { background: transparent; color: var(--text-dim); }
.modal-btn-cancel:hover { color: var(--text); }
.modal-btn-save { background: var(--text); color: var(--bg); }
.color-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.color-swatch { width: 36px; height: 36px; padding: 3px; border-radius: 50%; border: 2px solid transparent; background-clip: content-box !important; cursor: pointer; transition: transform 0.2s; }
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--text); }

/* Settings */
.setting-section { margin: 26px 0 4px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); }
.modal-title + .setting-section { margin-top: 0; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-label { font-size: 15px; color: var(--text); }
.setting-label small { display: block; margin-top: 2px; font-size: 12px; color: var(--text-faint); }
.setting-note { font-size: 13px; color: var(--text-dim); }
.setting-note small { margin-top: 6px; }
.setting-control { display: flex; align-items: center; gap: 8px; }
.setting-control button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.setting-control button:hover { border-color: var(--accent); }
.setting-val { min-width: 40px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 15px; }
.setting-select { height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 14px; cursor: pointer; }
.setting-range { width: 130px; height: 28px; accent-color: var(--accent); cursor: pointer; }
.setting-range:disabled { opacity: 0.4; cursor: not-allowed; }
.toggle { position: relative; flex-shrink: 0; width: 52px; height: 32px; padding: 0; border: none; border-radius: 16px; background: transparent; cursor: pointer; }
.toggle::before { content: ''; position: absolute; inset: 3px; border-radius: 13px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: all 0.25s; }
.toggle[aria-checked="true"]::before { background: var(--focus); border-color: var(--focus); }
.toggle::after { content: ''; position: absolute; top: 7px; left: 7px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.25s ease; }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }
.toggle:focus-visible { outline: none; }
.toggle:focus-visible::before { outline: 2px solid var(--accent); outline-offset: 2px; }
.setting-row.flush { border-bottom: none; padding-bottom: 0; }
.setting-block { padding: 12px 0; border-bottom: 1px solid var(--border); }
.setting-block .setting-label { display: block; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-top: 8px; }
.pal-tile { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-dim); font-size: 11.5px; line-height: 1.25; text-align: center; cursor: pointer; }
.pal-tile:hover { background: var(--tint-3); }
.pal-tile[aria-checked="true"] { border-color: var(--accent); color: var(--text); background: var(--tint-2); font-weight: 600; }
.pal-prev { position: relative; display: block; height: 44px; border-radius: 7px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); overflow: hidden; }
.pp-card { position: absolute; left: 5px; right: 5px; top: 5px; height: 20px; border-radius: 5px; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.pp-a, .pp-b, .pp-c { position: absolute; bottom: 6px; width: 16px; height: 7px; border-radius: 4px; }
.pp-a { left: 6px; background: var(--focus); } .pp-b { left: 26px; background: var(--short); } .pp-c { left: 46px; background: var(--long); }
.data-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
/* "What's next" (owner's pick 2B, 15 Nov): planned items with a local vote. */
.next-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.next-tag { font-size: 12px; font-weight: 600; line-height: 1; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--text-dim); white-space: nowrap; }
.next-tag.up { color: var(--focus); border-color: currentColor; }
:root[data-theme="light"] .next-tag.up { color: var(--focus-ink); }
.next-vote { flex-shrink: 0; white-space: normal; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 46%; text-align: left; line-height: 1.2; }
.next-vote svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.next-vote[aria-pressed="true"] { border-color: var(--focus); }
:root[data-theme="light"] .next-vote[aria-pressed="true"] { border-color: var(--focus-ink); }
.next-note { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--text-dim); }

/* Report */
.report-section { display: flex; justify-content: space-between; margin: 24px 0 10px; font-size: 12px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--text-faint); }
.report-section:first-child { margin-top: 0; }
.report-section span { font-family: 'JetBrains Mono', monospace; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile { padding: 14px 8px; border-radius: 10px; background: var(--surface-2); text-align: center; }
.tile b { display: block; font-family: 'JetBrains Mono', monospace; font-weight: 500; font-size: 19px; }
.tile b small { font-size: 12px; color: var(--text-dim); }
/* Durations ("1 ч 15 мин"): units in the UI font, a tight gap, never wrapping (QA 15 Nov). */
.tile b { white-space: nowrap; }
.tile b .unit { font-family: 'DM Sans', system-ui, sans-serif; font-size: 12px; margin-left: 1px; }
.tile b .dur-gap { display: inline-block; width: 0.3em; }
@media (max-width: 359px) {
  .tile { padding: 14px 4px; }
  .tile b { font-size: 17px; letter-spacing: -0.02em; }
}
.tile span { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.week-chart { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 150px; padding: 18px 12px 10px; border-radius: 10px; background: var(--surface-2); }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.week-track { position: relative; flex: 1; width: 100%; max-width: 30px; display: flex; flex-direction: column; justify-content: flex-end; }
.week-bar { width: 100%; min-height: 3px; border-radius: 6px 6px 2px 2px; background: color-mix(in srgb, var(--focus) 55%, transparent); }
.week-bar.empty { background: var(--tint-3); }
.week-bar.met { background: var(--focus); }
.week-count { position: absolute; left: 0; right: 0; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-dim); }
.week-day { font-size: 11px; text-transform: uppercase; color: var(--text-faint); }
.week-col.today .week-day { color: var(--text); font-weight: 700; }
.week-goal { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-strong); pointer-events: none; }
.report-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.history-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.history-day-label { padding-bottom: 4px; text-align: center; font-size: 10px; text-transform: uppercase; color: var(--text-faint); }
.history-cell { position: relative; height: 22px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--border); }
/* Heatmap levels follow the palette accent. Every day with a session has a solid accent
   edge (≥ 3:1, WCAG 1.4.11) so even a 1-session day is visible; the fill shows how much. */
.history-cell { --heat-edge: var(--focus); }
:root[data-theme="light"] .history-cell { --heat-edge: var(--focus-ink); }
.history-cell.level-1 { background: color-mix(in srgb, var(--focus) 18%, transparent); border-color: var(--heat-edge); }
.history-cell.level-2 { background: color-mix(in srgb, var(--focus) 38%, transparent); border-color: var(--heat-edge); }
.history-cell.level-3 { background: color-mix(in srgb, var(--focus) 62%, transparent); border-color: var(--heat-edge); }
.history-cell.level-4 { background: var(--focus); border-color: var(--heat-edge); }
.history-cell.today { box-shadow: inset 0 0 0 1.5px var(--text-dim); }
.history-tooltip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 5; padding: 5px 8px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--line); font-size: 11px; color: var(--text); white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.history-cell:hover .history-tooltip { opacity: 1; }
.history-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 10px; }
.history-legend-label { font-size: 10px; color: var(--text-faint); }
.legend-cell { width: 12px; height: 12px; border-radius: 3px; }

/* ─── Floating notices ─── */
.nudge { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; width: min(480px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 50px rgba(0,0,0,0.4); }
.nudge p { font-size: 14px; line-height: 1.5; }
.nudge-actions { display: flex; justify-content: flex-end; gap: 8px; }
.nudge-primary { min-height: 36px; padding: 0 18px; border-radius: 999px; border: none; background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; cursor: pointer; }
.survey fieldset { border: none; margin-bottom: 10px; }
.survey legend { margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.survey label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin: 0 12px 4px 0; font-size: 14px; color: var(--text-dim); }
.notification { pointer-events: none; position: fixed; top: max(16px, env(safe-area-inset-top)); left: 50%; z-index: 200; max-width: 90vw; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0,0,0,0.4); font-size: 14px; transform: translateX(-50%) translateY(-200%); transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1); }
.notification:not(.show) { visibility: hidden; transition: transform 0.4s ease, visibility 0s 0.4s; }
.notification.show { transform: translateX(-50%) translateY(0); }
.msg-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }

/* ─── Zen mode, celebration ─── */
.zen-exit { display: none; }
.zen .header, .zen .plan, .zen .park, .zen .value-line, .zen .shortcut-hint, .zen .nudge { display: none !important; }
.zen .layout { display: block; }
.zen .app { max-width: 720px; }
.zen .stage { min-height: 100vh; justify-content: center; }
.zen .zen-exit { position: fixed; top: 16px; right: 16px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-dim); font-size: 13px; cursor: pointer; }
@keyframes celebrate { 0% { transform: scale(1); } 35% { transform: scale(1.035); } 100% { transform: scale(1); } }
.celebrate .timer-card { animation: celebrate 1.2s ease; }

/* ─── I'm tired: fun break ─── */
.tired-btn { min-height: 40px; border-color: transparent; color: var(--text-dim); }
.tired-btn:hover { color: var(--text); }
.tired-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app.fun .modes, .app.fun .controls, .app.fun .session-line, .app.fun .break-card, .app.fun .stay-down, .app.fun .tired-btn { display: none !important; }
.fun-card { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fun-back { min-width: 200px; }
.fun-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fun-intro, .fun-note { font-size: 14px; line-height: 1.5; color: var(--text-dim); margin-bottom: 18px; }
.fun-note { margin: 18px 0 0; }
.fun-lengths { display: flex; gap: 8px; margin-bottom: 20px; }
.fun-min { min-width: 72px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.fun-min:hover { background: var(--tint-3); }
.fun-min[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.fun-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }
.fun-tabs [role=tab] { position: relative; flex: 1; min-height: 44px; padding: 0 6px; border: none; background: none; color: var(--text-dim); font-size: 14px; font-weight: 600; cursor: pointer; }
.fun-tabs [role=tab]:hover { color: var(--text); }
.fun-tabs [role=tab][aria-selected="true"] { color: var(--text); }
.fun-tabs [role=tab][aria-selected="true"]::after { content: ''; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 1px; background: var(--accent); }
.fun-items { display: flex; flex-direction: column; gap: 6px; }
.fun-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.fun-item:hover { border-color: var(--line-strong); }
.fun-icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--text-dim); }
.fun-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fun-name { font-size: 15px; font-weight: 600; }
.fun-line { font-size: 13px; color: var(--text-dim); }
.fun-ads { flex-shrink: 0; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; color: var(--text-dim); }
.breath { display: none; height: 140px; align-items: center; justify-content: center; margin-top: 12px; }
.breath.on { display: flex; }
.breath-circle { width: 120px; height: 120px; border-radius: 50%; background: var(--accent-glow); border: 2px solid var(--accent); transform: scale(0.55); }
.breath.on .breath-circle { animation: breathe 10s ease-in-out infinite; }
@keyframes breathe { 0% { transform: scale(0.55); } 40% { transform: scale(1); } 100% { transform: scale(0.55); } }
.breath-word { min-height: 24px; text-align: center; font-size: 18px; font-weight: 600; }
.fun-idea { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ─── Responsive ─── */
@media (max-width: 640px) {
  .app { padding: 0 16px; padding-top: env(safe-area-inset-top); }
  .modes { gap: 18px; }
  .nav { gap: 0; }
  .modal-overlay.sheet { align-items: flex-end; }
  .sheet .modal-panel { height: auto; max-height: 88vh; border-left: none; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; animation: sheetUp 0.22s ease; }
  @keyframes sheetUp { from { transform: translateY(32px); opacity: 0; } to { transform: none; opacity: 1; } }
  .modal-panel { padding: 20px; }
}
/* Touch screens: 44px minimum targets (UI/UX Pro Max touch-target-size). */
@media (pointer: coarse), (hover: none) {
  .nav-btn, .close-btn, .project-action-btn, .setting-control button, .task-row button, .park-add, .park-del { min-width: 44px; min-height: 44px; }
  .park-task, .stay-down, .tired-btn, .fun-min { min-height: 44px; }
  .mode-btn, .btn-text, .modal-btn, .setting-select, .modal-input, .nudge-primary { min-height: 44px; }
  .modal-input { font-size: 16px; }
  .toggle { width: 56px; height: 44px; }
  .toggle::before { top: 9px; bottom: 9px; }
  .toggle::after { top: 13px; }
  .toggle[aria-checked="true"]::after { transform: translateX(24px); }
  .color-swatch { width: 44px; height: 44px; padding: 7px; }
  .setting-range { height: 44px; }
  .survey label { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ─── Backup (js/backup.js) ─────────────────────────────────── */
