:root {
  --bg: #0e1013;
  --surface: #171a20;
  --surface-2: #1e222a;
  --line: #272b34;
  --tick: rgba(255, 255, 255, 0.14);
  --heat-1: rgba(124, 156, 255, 0.24);
  --heat-2: rgba(124, 156, 255, 0.52);
  --heat-3: #7c9cff;
  --text: #e9ebf0;
  --muted: #8a91a1;
  --accent: #7c9cff;
  --accent-ink: #0b1020;
  --accent-soft: rgba(124, 156, 255, 0.14);
  --away: #e0a45e;
  --success: #5fcf9a;
  --danger: #ff7a7a;
  --hl: rgba(255, 255, 255, 0.04);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 12px 34px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 58px;
}

:root[data-theme="light"] {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e6e8ee;
  --tick: rgba(0, 0, 0, 0.13);
  --heat-1: rgba(79, 110, 247, 0.16);
  --heat-2: rgba(79, 110, 247, 0.42);
  --heat-3: #4f6ef7;
  --text: #1b1e26;
  --muted: #6e7583;
  --accent: #4f6ef7;
  --accent-ink: #ffffff;
  --accent-soft: rgba(79, 110, 247, 0.09);
  --away: #c07a24;
  --success: #1f9d63;
  --danger: #d64545;
  --hl: rgba(255, 255, 255, 0.8);
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-2: 0 14px 36px rgba(16, 24, 40, 0.1);
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #f1f3f6;
    --line: #e6e8ee;
    --text: #1b1e26;
    --muted: #6e7583;
    --accent: #4f6ef7;
    --accent-ink: #ffffff;
    --accent-soft: rgba(79, 110, 247, 0.09);
    --away: #c07a24;
    --success: #1f9d63;
    --danger: #d64545;
    --hl: rgba(255, 255, 255, 0.8);
    --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-2: 0 14px 36px rgba(16, 24, 40, 0.1);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none; }

@font-face {
  font-family: 'Orbitron';
  src: url('../fonts/orbitron-latin.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}

@font-face {
  font-family: 'DM Mono';
  src: url('../fonts/dm-mono-latin-500.woff2') format('woff2');
  font-weight: 500;
  font-display: swap;
}

html, body {
  margin: 0;
  background: var(--bg);
  background-image: radial-gradient(1100px 520px at 50% -220px, var(--accent-soft), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }

button {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 15px;
  cursor: pointer;
  min-height: 42px;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.1s ease;
}
button:active { transform: scale(0.975); }
button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 6px 16px var(--accent-soft);
}
button.ghost { background: transparent; }
button.danger-text { color: var(--danger); }

input, select {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 13px;
  width: 100%;
  min-height: 44px;
  transition: border-color 0.16s ease, background 0.16s ease;
}
input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--surface); }
input[type="checkbox"] { width: auto; min-height: 0; accent-color: var(--accent); }

.topwrap { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }

.appbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: var(--surface);
}
.appbar-title { flex: 1; min-width: 0; font-weight: 700; font-size: 17px; letter-spacing: 0.2px; }
.appbar-meta {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15;
}
.appbar-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.appbar-clock {
  font-family: 'DM Mono', 'Bahnschrift', 'Roboto Condensed', ui-monospace, monospace;
  font-size: 18px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
  color: var(--text);
}

.icon-btn {
  width: 42px; height: 42px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; flex: none; background: transparent; border-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }

.content { padding: 6px 16px 24px; }
.tabpane { animation: fadeIn 0.22s ease; }

.banner {
  margin: 8px 16px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  font-size: 14px;
  box-shadow: var(--shadow-1);
  animation: fadeIn 0.25s ease;
}
.banner.danger { border-color: var(--danger); }
.banner-actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.toasts {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  z-index: 80;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 0 16px;
  pointer-events: none;
}
.toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 15px;
  font-size: 14px;
  box-shadow: var(--shadow-2);
  max-width: 100%;
  animation: toastIn 0.22s ease;
}
.toast.info { border-color: var(--accent); }
.toast.danger { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-title { font-weight: 650; margin: 18px 0 10px; font-size: 15px; }
.section-title small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }

.focus-card, .empty-card, .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: inset 0 1px 0 var(--hl), var(--shadow-1);
}
.focus-card.is-running { box-shadow: inset 0 1px 0 var(--hl), var(--shadow-2); }

.fc-top { display: flex; align-items: center; justify-content: space-between; }
.state-tag {
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); font-weight: 500;
}
.focus-card.is-running .state-tag { background: var(--accent); color: var(--accent-ink); }
.focus-card.is-paused .state-tag { background: var(--away); color: #2a1c06; }
.focus-card.is-break .state-tag { background: var(--success); color: #04231a; }
.fc-hint { font-size: 12px; color: var(--muted); cursor: pointer; }

.focus-main {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 172px; margin: 4px 0 2px;
  cursor: pointer;
  color: var(--accent);
}
.focus-card.is-paused .focus-main { color: var(--away); }
.focus-card.is-break .focus-main { color: var(--success); }
.fc-clock {
  position: absolute;
  font-family: 'Orbitron', 'Bahnschrift', ui-monospace, monospace;
  font-size: 42px; font-weight: 650; font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px; color: var(--text);
}
.empty-card .fc-clock { position: static; font-size: 46px; text-align: center; margin-bottom: 4px; }
.fc-label { text-align: center; color: var(--muted); margin: 2px 0 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.fc-actions button { min-height: 37px; padding: 7px 13px; font-size: 14px; border-radius: 10px; }
.empty-text { color: var(--muted); margin: 6px 0; }
.empty-text.small { font-size: 13px; margin: 6px 0; }

.ring { display: block; overflow: visible; }
.ring-bg { stroke: var(--line); opacity: 0.45; }
.ring-ticks line { stroke: currentColor; opacity: 0.28; }
.ring-ticks line.major { opacity: 0.55; stroke-width: 1.4; }
.ring-elapsed { stroke: currentColor; opacity: 0.26; }
.ring-fg { stroke: currentColor; }
.focus-card.is-running .ring-fg, .immersive.is-running .ring-fg {
  filter: drop-shadow(0 0 5px var(--accent-soft));
}
.fc-name { }
.fc-ring-hint { color: var(--accent); font-size: 12px; margin-left: 8px; }
.focus-card.is-paused .fc-ring-hint { color: var(--away); }

.pomo-hint { color: var(--muted); font-size: 12px; text-align: center; margin: 10px 4px 0; line-height: 2.1; }
.pomo-hint b { color: var(--text); margin: 0 2px; font-variant-numeric: tabular-nums; }
.step {
  width: 30px; height: 30px; min-height: 0; padding: 0; margin: 0 3px;
  border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 16px; line-height: 1; vertical-align: middle;
}

.mini-stats { color: var(--muted); font-size: 13px; text-align: center; margin: 14px 0 0; font-variant-numeric: tabular-nums; }

.rows { list-style: none; margin: 0; padding: 0; }
.rows li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.rows li:first-child { border-top: none; }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row-live {
  font-family: 'DM Mono', 'Bahnschrift', ui-monospace, monospace;
  color: var(--accent); font-weight: 500; letter-spacing: 0.4px;
}
.row-live.is-paused { color: var(--away); }
.row-live .rl-used { margin-left: 5px; }
.rows.compact li.current .row-live { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; }
.dig { display: inline-block; width: 1ch; text-align: center; }
.dig.dig-colon { width: 0.6ch; }
.rows li.current .row-title { color: var(--accent); }
.rows li.done .row-title { text-decoration: line-through; color: var(--muted); }
.rows.compact li { padding: 5px 0; }
.rows.compact .row-main { flex-direction: row; align-items: center; gap: 8px; }
.rows.compact .row-main .row-title { flex: 1; min-width: 0; }
.rows.compact .row-main .row-sub { flex: none; }
.rows.compact .icon-btn { width: 32px; height: 32px; }
.rows.compact .icon-btn svg { width: 18px; height: 18px; }

.check {
  width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--success); background: transparent;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.check:active { transform: scale(0.88); }

.capture { display: flex; gap: 8px; margin-top: 6px; margin-bottom: 8px; }
.capture input { flex: 1; }
.capture.small { margin-top: 0; margin-bottom: 10px; }
.capture button { flex: none; }

.seg { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: transparent; border-radius: 999px; min-height: 38px; padding: 6px; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .seg button.active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.theme-seg { margin-bottom: 4px; }

.card.project { padding: 0; overflow: hidden; margin-bottom: 10px; }
.card.project header { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; cursor: pointer; }
.card.project header .row-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 650; }
.card.project header .icon-btn { width: 32px; height: 32px; margin: 0 -2px; }
.card.project header .icon-btn svg { width: 18px; height: 18px; }
.caret { color: var(--muted); font-size: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.p-body { padding: 0 15px 14px; border-top: 1px solid var(--line); }
.add-row { display: flex; gap: 8px; margin: 12px 0 10px; }
.add-row input { flex: 1; }
.add-row button { flex: none; }
.icon-cta {
  width: 40px; flex: none; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-cta svg { width: 20px; height: 20px; }

.archived { margin-top: 18px; }
.archived .row-title { color: var(--muted); }
.archived-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: none; color: var(--muted);
  padding: 10px 15px; font-size: 13px; min-height: 42px;
}
.swipe-list { max-height: 42vh; overflow-y: auto; border-top: 1px solid var(--line); border-radius: 12px; }
.swipe-row { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.swipe-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; align-items: center; padding-right: 6px; }
.swipe-actions .danger-text { background: transparent; border-color: transparent; }
.swipe-content {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 11px 15px; background: var(--surface);
  transition: transform 0.2s ease; touch-action: pan-y; will-change: transform;
}
.swipe-content .row-title { flex: 1; }

.review-datenav { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; }
.review-date { flex: 1; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.date-arrow { flex: none; width: 34px; min-height: 34px; padding: 0; font-size: 18px; line-height: 1; }
.date-today { flex: none; min-height: 34px; padding: 0 10px; font-size: 13px; }
.review-counters { display: flex; gap: 10px; margin: 16px 0 4px; }
.review-counters > div {
  flex: 1; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 6px; text-align: center;
  box-shadow: inset 0 1px 0 var(--hl), var(--shadow-1);
}
.review-counters b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.review-counters span { font-size: 12px; color: var(--muted); }

.wf { margin: 8px 0 4px; }
.wf-row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.wf-hour { flex: none; width: 40px; text-align: right; color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.wf-bar {
  position: relative; flex: 1; height: 18px; border-radius: 4px; overflow: hidden;
  background-color: var(--surface-2);
  background-image: repeating-linear-gradient(
    to right, var(--tick) 0, var(--tick) 1px, transparent 1px, transparent 25%
  );
}
.wf-bar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to right, rgba(0, 0, 0, 0.16) 0, rgba(0, 0, 0, 0.16) 1px, transparent 1px, transparent 25%
  );
}
.wf-seg { position: absolute; top: 2px; bottom: 2px; border-radius: 3px; min-width: 3px; overflow: hidden; }
.wf-seg.brk { background: var(--line); }
.wf-seg-label {
  display: block; padding: 0 4px; line-height: 14px; color: #08111f; font-size: 10px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tl-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 12px; }
.tl-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.tl-legend i.brk { background: var(--line); }

.cal-toggle { display: block; margin: 4px auto 0; }
.cal { margin: 8px 0 4px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-size: 13px; font-weight: 600; color: var(--text); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal-wd { text-align: center; font-size: 10px; color: var(--muted); padding: 2px 0; }
.cal-day {
  border: none; background: transparent; border-radius: 6px; min-height: 32px; padding: 4px 0;
  font-size: 12px; color: var(--text);
}
.cal-day.out { color: var(--muted); opacity: 0.4; }
.cal-day.lv1 { background: var(--heat-1); }
.cal-day.lv2 { background: var(--heat-2); }
.cal-day.lv3 { background: var(--heat-3); color: var(--accent-ink); font-weight: 600; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--muted); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }

.trend-title { display: flex; align-items: center; justify-content: space-between; }
.trend-title small { color: var(--muted); font-weight: 400; margin-left: 6px; font-size: 12px; }
.trend { display: flex; align-items: flex-end; gap: 3px; height: 60px; margin: 8px 0 18px; }
.trend.wide { gap: 1px; }
.trend-col { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.trend-bar { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }
.trend-lab {
  position: absolute; left: 50%; bottom: -15px; -webkit-transform: translateX(-50%); transform: translateX(-50%);
  font-size: 9px; color: var(--muted); white-space: nowrap;
}
.streak-line { font-size: 12px; color: var(--muted); margin: 10px 0 2px; }

.away-line { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 4px; }
.away-total { display: block; color: var(--text); font-weight: 600; font-size: 15px; }

.dist { list-style: none; margin: 0; padding: 0; }
.dist li { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.dist-label { flex: 0 0 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.dist-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.dist-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--success)); transition: width 0.4s ease; }
.dist-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
  height: calc(var(--tabbar-h) + var(--safe-b));
}
.tabbar button {
  flex: 1; border: none; background: transparent; border-radius: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--muted); font-size: 11px; min-height: 0;
  transition: color 0.16s ease;
}
.tabbar .ti { width: 22px; height: 22px; }
.tabbar button.active { color: var(--accent); }

.tabbar .tab-status { flex: none; width: 88px; color: var(--muted); }
.tabbar .tab-status .ti { width: 20px; height: 20px; }
.tabbar .tab-status.is-running { color: var(--accent); }
.tabbar .tab-status.is-paused { color: var(--away); }
.tabbar .tab-status.is-break { color: var(--success); }
.tabbar .tab-status.is-remind { color: var(--away); }
.tabbar .tab-status.has-notice { color: var(--away); box-shadow: inset 0 0 0 1px var(--away); }
.tab-status-text {
  font-family: 'DM Mono', 'Bahnschrift', ui-monospace, monospace;
  font-variant-numeric: tabular-nums; font-weight: 500; font-size: 12px;
  letter-spacing: 0.3px; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.sheet-mask { position: fixed; inset: 0; background: rgba(8, 10, 14, 0.42); z-index: 70; animation: fadeIn 0.2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 12px 14px calc(10px + var(--safe-b));
  display: flex; flex-direction: column; gap: 6px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: var(--shadow-2);
  animation: slideUp 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-title { font-weight: 650; text-align: center; margin: 0; font-size: 15.5px; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet button {
  width: 100%; min-height: 38px; padding: 6px 12px; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-head { position: relative; display: flex; align-items: center; justify-content: center; min-height: 36px; }
.sheet .sheet-x {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  width: 36px; min-height: 36px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.sheet .sheet-x svg { width: 20px; height: 20px; }
.sheet .sheet-x:hover { background: var(--surface-2); color: var(--text); }
.sheet-rename { display: flex; gap: 8px; }
.sheet-rename input { flex: 1; min-width: 0; width: auto; }
.sheet-rename button { width: auto; flex: none; white-space: nowrap; }
.sheet-move { margin: 2px 0; }
.sheet-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-tags button { flex: 1 1 auto; width: auto; min-width: 0; padding: 6px 8px; }
.remind-row { display: flex; align-items: center; gap: 8px; }
.remind-row input { flex: 1; min-width: 0; width: auto; text-align: center; min-height: 38px; padding: 6px 8px; -moz-appearance: textfield; }
.remind-row input::-webkit-outer-spin-button, .remind-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.remind-unit { color: var(--muted); font-size: 14px; white-space: nowrap; }
.remind-row button { width: auto; flex: none; white-space: nowrap; }

.page {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  background-image: radial-gradient(1100px 520px at 50% -220px, var(--accent-soft), transparent 70%);
  overflow-y: auto;
  padding-bottom: var(--safe-b);
  animation: fadeIn 0.2s ease;
}
.page .appbar { position: sticky; }
.page-body { padding: 6px 16px 34px; }
.set-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.set-row input { flex: none; }
.set-grid { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.set-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.set-note.warn { color: var(--away); }
.perm-help { flex: 1 0 100%; padding-top: 6px; color: var(--muted); }
.perm-help div { margin-bottom: 4px; }
.perm-help ol { margin: 4px 0 8px; padding-left: 20px; line-height: 1.7; }
.perm-help strong { color: var(--text); }
.set-grid label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.num { width: 70px; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-label {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 9px 15px; border: 1px solid var(--line); border-radius: 12px;
  cursor: pointer; font-size: 15px; min-height: 42px; background: var(--surface);
}
.file-label input { display: none; }
.set-grid input[type="text"] { width: 150px; }
.set-grid input[type="password"] { width: 190px; }
.set-grid textarea {
  width: 100%;
  min-height: 54px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  resize: vertical;
}
.pair-code { gap: 6px; }
.pair-code-text {
  font-family: 'DM Mono', 'Bahnschrift', ui-monospace, monospace;
  font-size: 20px;
  letter-spacing: 3px;
  color: var(--text);
}
.pair-code-hint { color: var(--muted); }
.set-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 8px; }
.set-details summary { cursor: pointer; color: var(--muted); font-size: 13.5px; padding: 4px 0; }
.set-details[open] summary { color: var(--text); }
.sync-actions { align-items: center; }
.sync-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); min-height: 42px; }
.about { color: var(--muted); font-size: 12px; margin-top: 18px; }

.onboarding {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 10, 14, 0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.ob-card {
  background: var(--surface);
  border-radius: 22px;
  padding: 26px 22px;
  width: 100%; max-width: 350px;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: pop 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ob-step { font-size: 12px; color: var(--muted); }
.ob-emoji { font-size: 48px; margin: 12px 0; }
.ob-card h2 { margin: 4px 0 8px; font-size: 20px; }
.ob-card p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.ob-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 18px; }
.ob-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background 0.2s, transform 0.2s; }
.ob-dots i.active { background: var(--accent); transform: scale(1.2); }
.ob-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.immersive {
  position: fixed; inset: 0; z-index: 55;
  background: var(--bg);
  display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(22px + var(--safe-b));
}
.immersive.is-running { background: radial-gradient(circle at 50% 34%, var(--accent-soft), transparent 62%), var(--bg); }
.imm-top { display: flex; align-items: center; gap: 6px; }
.imm-back {
  flex: none;
  width: 40px; height: 40px; padding: 0; border-radius: 50%;
  background: transparent; border: none; color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.16s ease, color 0.16s ease, transform 0.1s ease;
}
.imm-back svg { width: 22px; height: 22px; }
.imm-back:hover { background: var(--surface-2); color: var(--text); }
.imm-back:active { background: var(--surface-2); transform: scale(0.94); }
.imm-title {
  flex: 1; min-width: 0; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.imm-title span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imm-proj { font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: 0.4px; }
.imm-main { font-size: 15px; font-weight: 600; color: var(--text); }
.imm-top-spacer { flex: none; width: 40px; height: 40px; }
.imm-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.imm-ring { position: relative; display: flex; align-items: center; justify-content: center; margin: 8px 0; color: var(--accent); }
.immersive.is-paused .imm-ring { color: var(--away); }
.immersive.remind-page .imm-ring { color: var(--away); }
.immersive.is-break .imm-ring { color: var(--success); }
.imm-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; pointer-events: none;
}
.imm-status { font-family: 'DM Mono', 'Bahnschrift', ui-monospace, monospace; font-size: 13px; letter-spacing: 0.6px; color: currentColor; opacity: 0.92; }
.imm-clock { font-family: 'Orbitron', 'Bahnschrift', ui-monospace, monospace; font-size: 50px; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: 2px; color: var(--text); line-height: 1.04; }
.imm-rule { width: 46px; height: 1px; background: currentColor; opacity: 0.28; margin: 5px 0 4px; }
.imm-hint { color: var(--muted); opacity: 0.75; font-size: 12.5px; }
.imm-extend { align-self: center; margin-top: 2px; }
.imm-tools { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.tool {
  width: 44px; height: 44px; min-height: 0; padding: 0;
  border-radius: 50%; background: transparent; border: 1px solid var(--line);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.14s ease, color 0.14s ease, transform 0.1s ease;
}
.tool svg { width: 20px; height: 20px; }
.tool:hover { background: var(--surface-2); color: var(--text); }
.tool:active { transform: scale(0.92); background: var(--surface-2); }
.tool.labeled {
  width: auto; min-width: 44px; height: 44px;
  padding: 0 15px; border-radius: 22px; gap: 7px;
  color: var(--text); font-size: 14px; white-space: nowrap;
}
.tool.labeled svg { width: 16px; height: 16px; }
.imm-stats { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); opacity: 0.7; font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.25; font-family: 'DM Mono', 'Bahnschrift', ui-monospace, monospace; }
.imm-stat { white-space: nowrap; }

.fade-enter-active, .fade-leave-active { transition: opacity 0.18s ease, transform 0.18s ease; }
.fade-enter-from { opacity: 0; transform: translateY(4px); }
.fade-leave-to { opacity: 0; transform: translateY(-4px); }

@keyframes slideUp { from { transform: translateY(18px); opacity: 0.5; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 480px) and (orientation: portrait) {
  .content { padding: 2px 14px 20px; }
  .banner { margin: 6px 14px 0; padding: 9px 12px; }
  .card, .focus-card, .empty-card { padding: 14px; }
  .section-title { margin: 14px 0 8px; }
  .seg { margin-bottom: 12px; }
  .seg button { min-height: 34px; }
  .rows li { padding: 7px 0; }
  .rows.compact li { padding: 5px 0; }
  .card.project { margin-bottom: 8px; }
  .card.project header { padding: 6px 10px; }
  .p-body { padding: 0 14px 12px; }
  .capture { margin-bottom: 6px; }
  .archived { margin-top: 14px; }
  .about { margin-top: 14px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .immersive {
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 0 6px;
    padding: calc(4px + env(safe-area-inset-top, 0px)) 12px calc(8px + var(--safe-b));
  }
  .imm-top { width: 100%; order: 0; }
  .imm-back, .imm-top-spacer { width: 34px; height: 34px; }
  .imm-body { order: 1; flex: 1 0 100%; min-width: 0; gap: 2px; position: relative; }
  .imm-ring { margin: 6px 0; }
  .imm-extend {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    margin-top: 0; z-index: 2;
  }
  .imm-extend:active { transform: translateY(-50%) scale(0.92); }
  .imm-tools {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    flex-direction: column; gap: 8px; z-index: 2;
  }
}

@media (orientation: landscape) and (max-height: 400px) {
  .imm-ring .ring { width: 224px; height: 224px; }
  .imm-clock { font-size: 44px; }
  .imm-rule { width: 40px; }
  .imm-stats { font-size: 11.5px; }
  .imm-hint { font-size: 11.5px; }
}

@media (orientation: landscape) and (max-height: 400px) and (max-width: 460px) {
  .imm-ring .ring { width: 180px; height: 180px; }
  .imm-clock { font-size: 38px; }
  .imm-rule { width: 34px; }
  .imm-stats { font-size: 11px; }
}

@media (max-width: 360px) {
  .onboarding { padding: 12px; }
  .ob-card {
    padding: 18px 14px;
    border-radius: 18px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }
  .ob-emoji { font-size: 36px; margin: 8px 0; }
  .ob-card h2 { font-size: 18px; }
  .ob-card p { font-size: 13px; margin-bottom: 12px; }
  .ob-dots { margin-bottom: 12px; }
  .ob-actions { flex-wrap: nowrap; gap: 6px; }
  .ob-actions button {
    flex: 1 1 0;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
    white-space: nowrap;
  }
}

@media (max-width: 340px) {
  .fc-clock { font-size: 36px; }
  .imm-clock { font-size: 44px; }
  .dist-label { flex-basis: 34%; }
  .review-counters b { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .ring-fg { transition: none; }
}
