/* =========================================================
   日课 Daybook — a quiet daily cockpit
   ========================================================= */

:root {
  color-scheme: light;
  --bg: #f2ede3;
  --bg-soft: #f8f4ec;
  --surface: #fffdf8;
  --surface-2: #f5f0e6;
  --surface-3: #ece5d7;
  --ink: #20251f;
  --ink-soft: #596055;
  --muted: #77786b;
  --faint: #9b9788;
  --line: #e4dccd;
  --line-strong: #d2c6b2;
  --accent: #2f5d50;
  --accent-strong: #234a3f;
  --accent-soft: #e4ede6;
  --accent-faint: #eef4ee;
  --accent-fill: #234a3f;
  --accent-fill-hover: #2f5d50;
  --on-accent: #f8f3e6;
  --clay: #bc6748;
  --clay-soft: #f6e7df;
  --gold: #b58d45;
  --gold-soft: #f6edda;
  --blue: #5c8990;
  --blue-soft: #e4eef0;
  --danger: #a84f42;
  --shadow: 0 30px 65px -42px rgba(48, 52, 38, .48);
  --shadow-soft: 0 12px 30px -24px rgba(48, 52, 38, .38);
  --shadow-lift: 0 18px 42px -26px rgba(35, 74, 63, .38);
  --radius: 24px;
  --radius-sm: 16px;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STZhongsong", "SimSun", Georgia, serif;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --glow-1: rgba(212, 191, 148, .22);
  --glow-2: rgba(127, 164, 146, .15);
  --quote-bg: linear-gradient(145deg, #2e564b 0%, #24453c 55%, #1d3a32 100%);
  --quote-ink: #f4eddc;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121713;
  --bg-soft: #171d18;
  --surface: #1c241e;
  --surface-2: #232c25;
  --surface-3: #2b352d;
  --ink: #ece7d9;
  --ink-soft: #b5b7a9;
  --muted: #9aa093;
  --faint: #7f887b;
  --line: #2e3a31;
  --line-strong: #3d4a3f;
  --accent: #96c2b0;
  --accent-strong: #b3d8c8;
  --accent-soft: #26382f;
  --accent-faint: #202e27;
  --accent-fill: #96c2b0;
  --accent-fill-hover: #b3d8c8;
  --on-accent: #102019;
  --clay: #d98b6c;
  --clay-soft: #38281f;
  --gold: #d3b06b;
  --gold-soft: #332b1d;
  --blue: #8db4ba;
  --blue-soft: #213134;
  --danger: #e09387;
  --shadow: 0 34px 70px -45px rgba(0, 0, 0, .9);
  --shadow-soft: 0 14px 34px -24px rgba(0, 0, 0, .75);
  --shadow-lift: 0 18px 46px -26px rgba(0, 0, 0, .8);
  --glow-1: rgba(197, 158, 90, .08);
  --glow-2: rgba(100, 155, 130, .08);
  --quote-bg: linear-gradient(145deg, #243c34 0%, #1b2f29 55%, #172923 100%);
  --quote-ink: #f0e8d6;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 26px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 88% -8%, var(--glow-1), transparent 62%),
    radial-gradient(900px 560px at 6% 108%, var(--glow-2), transparent 60%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

::selection { background: var(--accent); color: var(--surface); }

h1, h2, h3, p, figure, blockquote { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }
svg { display: block; }

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.paper-grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: .035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .paper-grain { opacity: .055; mix-blend-mode: screen; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ---------- Layout ---------- */

.app-shell {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 30px 22px 24px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  backdrop-filter: blur(18px);
  z-index: 20;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.main {
  width: 100%;
  max-width: 1392px;
  margin: 0 auto;
  padding: 36px 44px 0;
  overflow: hidden;
}

/* ---------- Brand & sidebar ---------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent-fill);
  color: var(--on-accent);
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .13), 0 8px 18px -12px rgba(24, 48, 40, .9);
}

.brand-word { display: flex; flex-direction: column; gap: 1px; }
.brand-word strong {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .18em;
  line-height: 1.1;
}
.brand-word small {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .28em;
  color: var(--muted);
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 46px;
}

.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  letter-spacing: .04em;
  transition: background .22s ease, color .22s ease, transform .22s ease;
}
.nav-link .icon { width: 17px; height: 17px; opacity: .72; }
.nav-link em {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: .08em;
  color: var(--faint);
  opacity: .8;
}
.nav-link:hover { background: var(--surface); color: var(--ink); transform: translateX(2px); }
.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -22px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  transform: translateY(-50%);
}
.nav-link.is-active .icon { opacity: 1; }
.nav-link.is-active em { color: var(--accent); opacity: 1; }

.side-spacer { flex: 1; }

.side-progress { padding: 0 4px; }
.side-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .06em;
}
.side-progress-head strong {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0;
}
.track {
  height: 4px;
  margin: 10px 0 9px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width .8s cubic-bezier(.2, .7, .2, 1);
}
.side-progress p {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: .03em;
}

.side-settings {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  transition: background .2s, border-color .2s, color .2s;
}
.side-settings:hover { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.side-settings .icon { width: 16px; height: 16px; opacity: .7; }

.side-foot {
  margin-top: 16px;
  padding-left: 4px;
  color: var(--faint);
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: .08em;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px;
}

.date-line {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.date-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold);
}
#dayOfYear { color: var(--gold); }

.topbar h1 {
  margin-top: 7px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 2.5vw, 35px);
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.25;
}
#greetName { color: var(--accent); }
.greet-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .04em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 3px;
}

.clock {
  display: flex;
  align-items: baseline;
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}
.clock #clockMain {
  font-family: var(--font-serif);
  font-size: 25px;
  letter-spacing: -.01em;
  line-height: 1;
}
.clock #clockSec {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.clock em {
  margin-left: 10px;
  color: var(--muted);
  font-size: 10.5px;
  font-style: normal;
  letter-spacing: .06em;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-soft);
  transition: transform .2s, border-color .2s, color .2s, background .2s;
}
.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  transform: translateY(-1px);
}
.icon-btn:active { transform: translateY(0); }
.icon-btn.ghost { background: transparent; }

.mobile-brand-row { display: none; }

/* ---------- Buttons & common ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .03em;
  white-space: nowrap;
  transition: transform .2s, box-shadow .2s, background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent-fill);
  color: var(--on-accent);
  box-shadow: 0 10px 22px -14px rgba(33, 70, 58, .8);
}
.btn-primary:hover { background: var(--accent-fill-hover); transform: translateY(-1px); box-shadow: 0 16px 26px -16px rgba(33, 70, 58, .8); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  border-color: var(--line);
  background: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink); }
.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 32%, transparent);
  background: transparent;
  color: var(--danger);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.btn-small { height: 36px; padding: 0 15px; font-size: 12px; }
.btn:disabled { opacity: .48; pointer-events: none; }
.btn-primary:disabled {
  opacity: 1;
  background: var(--surface-2);
  color: var(--muted);
  box-shadow: none;
}

.text-btn {
  padding: 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
}
.text-btn:hover { color: var(--accent); text-decoration-color: currentColor; }

.link-btn {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--clay); }

.card {
  position: relative;
  min-width: 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: card-in .6s cubic-bezier(.2, .7, .2, 1) both;
}
.card:nth-child(2) { animation-delay: .07s; }
.card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .17s; }

@keyframes card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.grid { display: grid; gap: 20px; }
.top-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.mid-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); margin-top: 20px; }
.lower-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 20px; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}
.card-head h2 {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 500;
  letter-spacing: .03em;
  line-height: 1.3;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  line-height: 1.4;
  text-transform: uppercase;
}
.eyebrow .icon { width: 13px; height: 13px; opacity: .8; }

.count-badge {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ---------- Metrics strip ---------- */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 8px 0 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.metric {
  position: relative;
  padding: 16px 22px 15px;
  border-right: 1px solid var(--line);
}
.metric:first-child { padding-left: 2px; }
.metric:last-child { border-right: 0; }
.metric-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .08em;
}
.metric-label .icon { width: 13px; height: 13px; opacity: .72; }
.metric strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.metric strong small {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: .02em;
}
.metric-note {
  display: block;
  margin-top: 1px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: .02em;
}

/* ---------- Work card ---------- */

.work-card { padding-bottom: 22px; }
.work-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.work-top h2 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .04em;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  padding: 5px 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-radius: 99px;
  background: var(--accent-faint);
  color: var(--accent-strong);
  font-size: 10.5px;
  letter-spacing: .08em;
}
.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease infinite;
}
.status-pill.is-rest { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.status-pill.is-rest i { background: var(--faint); animation: none; }
.status-pill.is-done { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 26%, var(--line)); }
.status-pill.is-done i { background: var(--gold); animation: none; }
.status-pill.is-over { background: var(--clay-soft); color: var(--clay); border-color: color-mix(in srgb, var(--clay) 24%, var(--line)); }
.status-pill.is-over i { background: var(--clay); animation: none; }

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 transparent; }
  50% { opacity: .65; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent); }
}

.work-count {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 18px 0 17px;
  font-family: var(--font-serif);
  font-size: clamp(58px, 6.4vw, 88px);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .92;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.work-count em {
  padding: 0 4px;
  color: var(--faint);
  font-size: .52em;
  font-style: normal;
  font-weight: 300;
  transform: translateY(-.18em);
}
.work-count.is-muted { color: var(--muted); letter-spacing: -.02em; }

.work-subline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .03em;
}
.work-subline span:last-child { font-family: var(--font-mono); font-size: 9.5px; color: var(--accent); }

.work-track {
  position: relative;
  height: 5px;
  margin: 9px 0 7px;
  border-radius: 99px;
  background: var(--surface-3);
}
.work-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 58%, var(--gold)));
  transition: width .7s cubic-bezier(.2, .7, .2, 1);
}
.work-track i {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 9px;
  height: 9px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  transform: translate(-50%, -50%);
  transition: left .7s cubic-bezier(.2, .7, .2, 1);
}
.work-times {
  display: flex;
  justify-content: space-between;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .04em;
}

.work-bottom {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px dashed var(--line);
}
.work-stat { display: flex; flex-direction: column; gap: 1px; min-width: 86px; }
.work-stat small { color: var(--muted); font-size: 9.5px; letter-spacing: .05em; }
.work-stat strong {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 500;
  letter-spacing: .01em;
  white-space: nowrap;
}
.work-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
}
.work-actions .btn { height: 36px; padding: 0 14px; font-size: 11.5px; }

.work-note {
  margin-top: 10px;
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: .02em;
}

/* ---------- Quote card ---------- */

.quote-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 28px;
  border-color: rgba(255, 255, 255, .08);
  background: var(--quote-bg);
  color: var(--quote-ink);
  box-shadow: 0 32px 60px -38px rgba(24, 46, 38, .85);
  overflow: hidden;
}
.quote-card::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 176, 107, .2), transparent 68%);
  pointer-events: none;
}
.quote-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .13) .6px, transparent .6px);
  background-size: 18px 18px;
  opacity: .1;
  pointer-events: none;
}
.quote-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quote-card .eyebrow { color: rgba(244, 237, 220, .52); }
.quote-date {
  color: rgba(244, 237, 220, .45);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
}
.quote-mark {
  position: relative;
  z-index: 1;
  height: 46px;
  margin-top: 18px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 84px;
  line-height: 1;
  opacity: .65;
}
.quote-card blockquote {
  position: relative;
  z-index: 1;
  flex: 1;
  margin: 2px 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(18px, 1.6vw, 24px);
  font-weight: 400;
  letter-spacing: .035em;
  line-height: 1.82;
  text-wrap: pretty;
}
.quote-source {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(244, 237, 220, .66);
}
.quote-source span {
  width: 24px;
  height: 1px;
  background: var(--gold);
  opacity: .7;
}
.quote-source cite {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .05em;
  line-height: 1.5;
}
.quote-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(244, 237, 220, .12);
}
.quote-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(244, 237, 220, .16);
  border-radius: 99px;
  background: transparent;
  color: rgba(244, 237, 220, .68);
  font-size: 10.5px;
  letter-spacing: .04em;
  transition: background .2s, color .2s, border-color .2s;
}
.quote-btn .icon { width: 13px; height: 13px; }
.quote-btn:hover { background: rgba(244, 237, 220, .09); color: var(--quote-ink); border-color: rgba(244, 237, 220, .3); }
.quote-watermark {
  position: absolute;
  right: -12px;
  bottom: -66px;
  z-index: 0;
  color: rgba(244, 237, 220, .04);
  font-family: var(--font-serif);
  font-size: 250px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

/* ---------- Focus ---------- */

.focus-card { display: flex; flex-direction: column; }
.focus-modes {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 99px;
  background: var(--surface-2);
  flex: none;
}
.focus-modes button {
  height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .04em;
  transition: background .2s, color .2s, box-shadow .2s;
}
.focus-modes button:hover { color: var(--ink); }
.focus-modes button.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 2px 8px -4px rgba(40, 45, 38, .4);
}

.focus-body {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  margin-top: 9px;
}
.focus-ring-wrap {
  position: relative;
  width: 208px;
  height: 208px;
  flex: none;
}
.focus-ring { width: 100%; height: 100%; }
.ring-track {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 7;
}
.ring-progress {
  fill: none;
  stroke: var(--accent);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-dasharray: 653.45;
  stroke-dashoffset: 653.45;
  transform: rotate(-90deg);
  transform-origin: 120px 120px;
  transition: stroke-dashoffset .3s linear, stroke .3s;
}
.focus-card.is-running .ring-progress {
  stroke: var(--clay);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--clay) 35%, transparent));
}
.focus-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.focus-mode-label {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
}
.focus-readout strong {
  font-family: var(--font-serif);
  font-size: 43px;
  font-weight: 400;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.focus-round { color: var(--faint); font-size: 9.5px; letter-spacing: .04em; }
.focus-card.is-running .focus-round { color: var(--clay); }

.focus-side {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}
.focus-today {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}
.focus-today-label { width: 100%; color: var(--muted); font-size: 9.5px; letter-spacing: .06em; }
.focus-today strong {
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.focus-today strong small {
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 9.5px;
  font-weight: 400;
}
.focus-today em {
  color: var(--faint);
  font-size: 9.5px;
  font-style: normal;
}
.preset-row { display: flex; align-items: center; gap: 9px; }
.preset-row > span { color: var(--muted); font-size: 10px; letter-spacing: .04em; }
.preset-chips { display: flex; gap: 4px; }
.preset-chips button {
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  transition: background .2s, color .2s, border-color .2s;
}
.preset-chips button:hover { border-color: var(--line); color: var(--ink); }
.preset-chips button.is-active { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; font-weight: 600; }
.focus-controls { display: flex; align-items: center; gap: 7px; }
.btn-focus { flex: 1; }
.focus-hint {
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.6;
  letter-spacing: .02em;
  min-height: 15px;
}

/* ---------- Water ---------- */

.water-card { display: flex; flex-direction: column; }
.water-total {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.water-total strong {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}
.water-main { margin-top: 14px; }
.water-amount {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.water-amount strong {
  font-family: var(--font-serif);
  font-size: 35px;
  font-weight: 500;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.water-amount > span { color: var(--muted); font-size: 10px; }
.water-amount em {
  margin-left: auto;
  color: var(--faint);
  font-size: 9.5px;
  font-style: normal;
}
.water-cups {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  max-width: none;
  margin: 13px 0 16px;
}
.water-cup {
  position: relative;
  height: 33px;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px 5px 11px 11px;
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.water-cup::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 0%;
  background: linear-gradient(180deg, #a9d3c7, #659f93);
  transition: height .4s cubic-bezier(.2, .7, .2, 1);
}
.water-cup::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 5px;
  width: 3px;
  height: 12px;
  border-radius: 99px;
  background: rgba(255, 255, 255, .35);
  opacity: 0;
  transition: opacity .3s;
}
.water-cup.is-filled { border-color: color-mix(in srgb, var(--accent) 48%, var(--line)); transform: translateY(-1px); }
.water-cup.is-filled::before { height: 100%; }
.water-cup.is-filled::after { opacity: 1; }
.water-actions { display: flex; align-items: center; gap: 7px; }
.water-actions .btn { height: 38px; font-size: 11.5px; }
.water-actions .btn small { margin-left: 1px; opacity: .62; font-size: 9px; font-weight: 400; }

.water-reminder {
  margin-top: auto;
  padding-top: 15px;
}
.water-reminder::before {
  content: "";
  display: block;
  margin-bottom: 13px;
  border-top: 1px dashed var(--line);
}
.reminder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.reminder-head > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.reminder-head .icon { width: 14px; height: 14px; color: var(--muted); }
.water-reminder p { margin-top: 4px; color: var(--faint); font-size: 9.5px; line-height: 1.6; }
.reminder-next {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .03em;
}
.reminder-next.is-on { background: var(--accent-faint); color: var(--accent-strong); }

/* ---------- Switch ---------- */

.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-track {
  position: relative;
  display: block;
  width: 40px;
  height: 23px;
  border-radius: 99px;
  background: var(--surface-3);
  transition: background .24s;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 5px rgba(30, 40, 30, .22);
  transition: transform .24s cubic-bezier(.2, .7, .2, 1);
}
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Plan ---------- */

.plan-card, .todo-card { display: flex; flex-direction: column; min-height: 494px; }
.head-tools { display: flex; align-items: center; gap: 10px; flex: none; }

.timeline {
  flex: 1;
  margin-top: 14px;
  max-height: 328px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.timeline::-webkit-scrollbar, .todo-list::-webkit-scrollbar, .work-log::-webkit-scrollbar { width: 4px; }
.timeline::-webkit-scrollbar-thumb, .todo-list::-webkit-scrollbar-thumb, .work-log::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: var(--line-strong);
}

.plan-item {
  display: grid;
  grid-template-columns: 47px 18px minmax(0, 1fr) 24px;
  align-items: stretch;
  gap: 0 10px;
  min-height: 59px;
  animation: soft-in .35s ease both;
}
@keyframes soft-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.plan-time {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.5;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.plan-time strong { color: var(--ink-soft); font-size: 11.5px; font-weight: 500; }
.plan-rail { position: relative; }
.plan-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
  transform: translateX(-50%);
}
.plan-item:first-child .plan-rail::before { top: 12px; }
.plan-item:last-child .plan-rail::before { bottom: calc(100% - 14px); }
.plan-rail i {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  transform: translateX(-50%);
  transition: background .2s, border-color .2s;
}
.plan-main {
  min-width: 0;
  padding: 2px 0 12px;
  border-bottom: 1px solid var(--line);
}
.plan-title {
  overflow: hidden;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .2s;
}
.plan-dur { color: var(--faint); font-size: 9px; letter-spacing: .03em; }
.plan-item.is-done .plan-title { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.plan-item.is-done .plan-rail i { border-color: var(--accent); background: var(--accent); }
.plan-item.is-done .plan-time strong { color: var(--faint); }
.plan-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
}
.plan-check {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: transparent;
  color: transparent;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.plan-check .icon { width: 12px; height: 12px; stroke-width: 2.2; }
.plan-check:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.06); }
.plan-item.is-done .plan-check { border-color: var(--accent); background: var(--accent); color: var(--surface); }
.plan-del {
  position: absolute;
  right: 1px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--faint);
  opacity: 0;
  transition: opacity .2s, color .2s, background .2s;
}
.plan-del .icon { width: 13px; height: 13px; }
.plan-item:hover .plan-del { opacity: 1; }
.plan-del:hover { color: var(--clay); background: var(--clay-soft); }

.plan-form {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 7px 8px 7px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
}
.plan-form:focus-within { border-color: var(--line-strong); background: var(--surface); }
.time-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--faint);
  font-size: 10px;
}
.time-inputs input {
  width: 58px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  outline: none;
}
.time-inputs input::-webkit-calendar-picker-indicator { opacity: .35; cursor: pointer; }
.plan-form > input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  outline: none;
}
.plan-form > input::placeholder, .todo-input-row input::placeholder { color: var(--faint); }
.add-btn {
  width: 30px;
  height: 30px;
  border: 0;
  background: var(--accent-fill);
  color: var(--on-accent);
  border-radius: 9px;
}
.add-btn:hover { background: var(--accent-fill-hover); transform: none; }
.add-btn .icon { width: 15px; height: 15px; }

/* ---------- Todo ---------- */

.todo-form {
  margin-top: 15px;
  padding: 9px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  transition: border-color .2s, background .2s;
}
.todo-form:focus-within { border-color: var(--line-strong); background: var(--surface); }
.todo-input-row { display: flex; align-items: center; gap: 8px; }
.todo-input-row input {
  flex: 1;
  min-width: 0;
  padding: 5px 2px;
  border: 0;
  background: transparent;
  font-size: 13px;
  outline: none;
}
.todo-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.segmented { display: flex; gap: 2px; }
.segmented button,
.tag-picker button {
  height: 23px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: .03em;
  transition: background .18s, color .18s;
}
.segmented button:hover, .tag-picker button:hover { color: var(--ink); background: var(--surface-3); }
.segmented button.is-active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px -2px rgba(40, 45, 38, .3); }
.priority-picker button[data-priority="high"].is-active { color: var(--clay); }
.tag-picker { display: flex; gap: 1px; }
.tag-picker button.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

.todo-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 1px 4px;
}
.filter-tabs { display: flex; gap: 2px; }
.filter-tabs button {
  height: 25px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: color .2s, background .2s;
}
.filter-tabs button:hover { color: var(--ink); }
.filter-tabs button.is-active { color: var(--ink); background: var(--surface-2); font-weight: 600; }
.mini-track {
  flex: 1;
  height: 3px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}
.mini-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width .45s cubic-bezier(.2, .7, .2, 1);
}

.todo-list {
  flex: 1;
  max-height: 275px;
  margin: 2px -4px 0;
  padding: 0 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.todo-list.is-scrollable { mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent); }
.todo-list.is-scrollable.is-at-bottom { mask-image: none; }
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
  animation: soft-in .28s ease both;
}
.todo-item:last-child { border-bottom: 0; }
.todo-check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: transparent;
  flex: none;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.todo-check .icon { width: 11px; height: 11px; stroke-width: 2.4; }
.todo-check:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.06); }
.todo-item.is-done .todo-check { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.todo-body { flex: 1; min-width: 0; }
.todo-text {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.55;
  transition: color .2s;
}
.todo-meta { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.todo-priority {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: .04em;
}
.todo-priority::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.todo-priority[data-priority="high"] { color: var(--clay); }
.todo-priority[data-priority="mid"] { color: var(--gold); }
.todo-priority[data-priority="low"] { color: var(--blue); }
.todo-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 8.5px;
  letter-spacing: .03em;
}
.todo-tag[data-tag="work"] { background: var(--accent-faint); color: var(--accent); }
.todo-tag[data-tag="study"] { background: var(--gold-soft); color: var(--gold); }
.todo-tag[data-tag="life"] { background: var(--clay-soft); color: var(--clay); }
.todo-tag[data-tag="health"] { background: var(--blue-soft); color: var(--blue); }
.todo-time { color: var(--faint); font-family: var(--font-mono); font-size: 8px; }
.todo-del {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: -1px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  opacity: 0;
  transition: opacity .2s, color .2s, background .2s;
}
.todo-del .icon { width: 13px; height: 13px; }
.todo-item:hover .todo-del, .todo-del:focus-visible { opacity: 1; }
.todo-del:hover { color: var(--clay); background: var(--clay-soft); }
.todo-item.is-done .todo-text { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.todo-item.is-done .todo-meta { opacity: .6; }

.todo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.todo-footer > span { color: var(--faint); font-size: 9.5px; letter-spacing: .02em; }
.todo-footer .text-btn { font-size: 9.5px; }

/* ---------- Empty states ---------- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 158px;
  padding: 18px;
  color: var(--faint);
  text-align: center;
}
.empty-illustration {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 3px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--line-strong);
}
.empty-illustration .icon { width: 20px; height: 20px; stroke-width: 1.3; }
.empty-state strong { color: var(--ink-soft); font-family: var(--font-serif); font-size: 13.5px; font-weight: 500; letter-spacing: .03em; }
.empty-state p { max-width: 250px; font-size: 9.5px; line-height: 1.7; }
.empty-state .btn { margin-top: 4px; height: 30px; padding: 0 12px; font-size: 10px; }

/* ---------- Stats ---------- */

.stats-section { margin-top: 52px; scroll-margin-top: 20px; }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
  padding: 0 2px;
}
.section-heading h2 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 29px;
  font-weight: 500;
  letter-spacing: .03em;
}
.range-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  flex: none;
}
.range-switch button {
  height: 27px;
  padding: 0 12px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  transition: background .2s, color .2s;
}
.range-switch button.is-active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

.stats-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.chart-card { grid-column: span 7; }
.breakdown-card { grid-column: span 5; }
.log-card { grid-column: span 7; }
.review-card { grid-column: span 5; }

.chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.chart-head h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: .03em;
}
.chart-head p { margin-top: 2px; color: var(--faint); font-size: 9.5px; letter-spacing: .02em; }
.chart-total { display: flex; align-items: baseline; gap: 4px; flex: none; }
.chart-total strong {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.chart-total span { color: var(--muted); font-size: 9px; }
.chart-wrap {
  position: relative;
  height: 232px;
  margin: 16px -4px 0;
}
#focusChart { width: 100%; height: 100%; }
.chart-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}
.chart-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; }
.legend-focus { background: var(--accent); }
.legend-tasks { width: 6px !important; height: 6px !important; border-radius: 50% !important; background: var(--clay); }
.chart-caption { margin-left: auto; color: var(--faint); font-family: var(--font-mono); font-size: 8.5px; }

.breakdown { margin-top: 17px; display: flex; flex-direction: column; gap: 15px; }
.breakdown-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 32px; align-items: center; gap: 10px; }
.breakdown-label { display: flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 10.5px; }
.breakdown-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.breakdown-label[data-tag="work"] i { background: var(--accent); }
.breakdown-label[data-tag="study"] i { background: var(--gold); }
.breakdown-label[data-tag="life"] i { background: var(--clay); }
.breakdown-label[data-tag="health"] i { background: var(--blue); }
.breakdown-track { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.breakdown-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--muted);
  transition: width .6s cubic-bezier(.2, .7, .2, 1);
}
.breakdown-row[data-tag="work"] .breakdown-track span { background: var(--accent); }
.breakdown-row[data-tag="study"] .breakdown-track span { background: var(--gold); }
.breakdown-row[data-tag="life"] .breakdown-track span { background: var(--clay); }
.breakdown-row[data-tag="health"] .breakdown-track span { background: var(--blue); }
.breakdown-value { color: var(--muted); font-family: var(--font-mono); font-size: 9px; text-align: right; }
.breakdown-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.7;
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--accent-faint);
  color: var(--accent);
  font-size: 8.5px;
  white-space: nowrap;
}
.live-dot i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.work-log {
  max-height: 254px;
  margin-top: 13px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.log-item {
  display: grid;
  grid-template-columns: 42px 14px minmax(0, 1fr);
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  animation: soft-in .3s ease both;
}
.log-item:last-child { border-bottom: 0; }
.log-time { padding-top: 1px; color: var(--faint); font-family: var(--font-mono); font-size: 8.5px; }
.log-dot { position: relative; padding-top: 6px; }
.log-dot::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.log-item[data-kind="task"] .log-dot::before { background: var(--clay); }
.log-item[data-kind="focus"] .log-dot::before { background: var(--gold); }
.log-item[data-kind="out"] .log-dot::before,
.log-item[data-kind="in"] .log-dot::before { background: var(--blue); }
.log-text {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10.5px;
  line-height: 1.55;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-meta { margin-top: 1px; color: var(--faint); font-size: 8.5px; }

.review-icon { color: var(--faint); }
.review-card { display: flex; flex-direction: column; }
#reviewInput {
  flex: 1;
  width: 100%;
  min-height: 132px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: .02em;
  line-height: 1.85;
  resize: none;
  outline: none;
  transition: border-color .2s, background .2s;
}
#reviewInput:focus { border-color: var(--line-strong); background: var(--surface); }
#reviewInput::placeholder { color: var(--faint); }
.review-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  color: var(--faint);
  font-size: 8.5px;
  letter-spacing: .02em;
}
#reviewStatus.is-saved { color: var(--accent); }

/* ---------- Footer ---------- */

.page-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 54px;
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
}
.footer-seal {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 11px;
}
.page-footer p { color: var(--muted); font-family: var(--font-serif); font-size: 10.5px; letter-spacing: .08em; }
.footer-note { margin-left: auto; font-size: 9px; letter-spacing: .03em; }

/* ---------- Mobile nav ---------- */

.mobile-nav { display: none; }

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(92vw, 460px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 17px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 99px;
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--bg-soft);
  box-shadow: 0 18px 38px -20px rgba(20, 25, 18, .7);
  font-size: 11.5px;
  letter-spacing: .02em;
  line-height: 1.4;
  animation: toast-in .32s cubic-bezier(.2, .7, .2, 1) both;
}
.toast.is-leaving { animation: toast-out .25s ease both; }
.toast .icon { width: 14px; height: 14px; color: var(--gold); }
.toast[data-type="success"] .icon { color: #a9d3b8; }
.toast[data-type="water"] .icon { color: #92c9d0; }
.toast[data-type="warn"] .icon { color: #e3b184; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px) scale(.98); }
}

/* ---------- Modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .24s ease, visibility .24s;
}
.modal.is-open { visibility: visible; opacity: 1; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 23, 18, .46);
  backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: min(92vh, 900px);
  overflow: hidden;
  padding: 26px 28px 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 40px 100px -40px rgba(10, 18, 12, .55);
  transform: translateY(12px) scale(.985);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}
.modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-card::-webkit-scrollbar { width: 5px; }
.modal-card::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.modal-head {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: .04em;
}
.settings-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 22px;
  padding: 20px 7px 8px 0;
  margin-right: -7px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.settings-body::-webkit-scrollbar { width: 5px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; }
.settings-group { display: flex; flex-direction: column; gap: 11px; }
.settings-group h3 {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { color: var(--ink-soft); font-size: 10.5px; letter-spacing: .02em; }
.field input {
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12px;
  outline: none;
  transition: border-color .2s, background .2s;
}
.field input:focus { border-color: var(--accent); background: var(--surface); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.settings-row:last-child { border-bottom: 0; padding-bottom: 0; }
.settings-row strong { display: block; font-size: 11.5px; font-weight: 600; }
.settings-row p { margin-top: 2px; color: var(--faint); font-size: 9.5px; line-height: 1.5; }
.settings-copy { color: var(--faint); font-size: 9.5px; line-height: 1.6; }
.data-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.data-actions .btn { height: 34px; }
.modal-foot {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.modal-foot > div { display: flex; gap: 8px; }
.modal-note { color: var(--faint); font-size: 9px; }

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .main { padding: 32px 32px 0; }
  .work-bottom { gap: 16px; }
  .work-stat { min-width: 74px; }
  .focus-body { gap: 20px; }
  .focus-ring-wrap { width: 190px; height: 190px; }
  .focus-readout strong { font-size: 39px; }
  .work-count { font-size: clamp(54px, 6.2vw, 76px); }
}

@media (max-width: 1099px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { max-width: 1000px; padding: 22px 30px 0; }
  .mobile-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 22px;
  }
  .mobile-brand-actions { display: flex; gap: 8px; }
  .topbar { padding-bottom: 20px; }
  .topbar-right .icon-btn { display: none; }
  .mobile-nav {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 50;
    display: flex;
    align-items: stretch;
    gap: 2px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    box-shadow: 0 18px 45px -22px rgba(28, 36, 28, .5);
    backdrop-filter: blur(18px);
    transform: translateX(-50%);
  }
  .mobile-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 55px;
    padding: 6px 4px;
    border-radius: 13px;
    color: var(--muted);
    font-size: 8px;
    letter-spacing: .02em;
    transition: background .2s, color .2s;
  }
  .mobile-nav a .icon { width: 17px; height: 17px; }
  .mobile-nav a.is-active { background: var(--accent-soft); color: var(--accent-strong); }
  .page-footer { padding-bottom: 94px; }
  .toast-stack { bottom: 88px; }
}

@media (max-width: 980px) {
  .top-grid, .mid-grid, .lower-grid { grid-template-columns: minmax(0, 1fr); }
  .top-grid .quote-card { min-height: 320px; }
  .mid-grid { margin-top: 20px; }
  .focus-body { gap: 32px; }
  .focus-ring-wrap { width: 220px; height: 220px; }
  .focus-readout strong { font-size: 46px; }
  .water-card { min-height: 0; }
  .water-main { max-width: none; }
  .water-cups { max-width: none; }
  .plan-card, .todo-card { min-height: 0; }
  .timeline { max-height: 360px; }
  .todo-list { max-height: 340px; }
  .chart-card, .breakdown-card, .log-card, .review-card { grid-column: span 12; }
  .breakdown { max-width: 560px; }
  .work-count { font-size: clamp(66px, 11vw, 92px); }
}

@media (max-width: 720px) {
  body { font-size: 13px; }
  .main { padding: 16px 16px 0; }
  .mobile-brand-row { padding-bottom: 16px; }
  .brand-seal { width: 34px; height: 34px; font-size: 19px; }
  .brand-word strong { font-size: 18px; }
  .topbar { align-items: center; padding-bottom: 14px; }
  .date-line { font-size: 9px; gap: 6px; letter-spacing: .06em; }
  .topbar h1 { margin-top: 4px; font-size: 25px; }
  .greet-sub { display: none; }
  .topbar-right { padding-top: 0; }
  .clock { flex-direction: column; align-items: flex-end; gap: 0; margin-right: 0; }
  .clock #clockMain { font-size: 20px; }
  .clock #clockSec { display: none; }
  .clock em { margin-left: 0; margin-top: 2px; font-size: 8.5px; }
  .topbar-right .icon-btn { display: none; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 4px 0 18px; }
  .metric { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(3) { padding-left: 2px; border-bottom: 0; }
  .metric:nth-child(4) { border-bottom: 0; }
  .metric strong { font-size: 25px; }
  .card { padding: 20px; border-radius: 20px; }
  .card-head h2 { font-size: 20px; }
  .grid { gap: 14px; }
  .top-grid, .mid-grid, .lower-grid { margin-top: 14px; }
  .work-count { margin: 14px 0 13px; font-size: clamp(48px, 15.5vw, 68px); }
  .work-bottom { flex-wrap: wrap; gap: 12px; margin-top: 15px; padding-top: 14px; }
  .work-stat { min-width: 70px; }
  .work-actions { width: 100%; margin-left: 0; }
  .work-actions .btn { flex: 1; }
  .quote-card { min-height: 300px; padding: 23px; }
  .quote-card blockquote { font-size: 19px; margin-bottom: 20px; }
  .quote-mark { margin-top: 12px; height: 38px; font-size: 72px; }
  .focus-body { flex-direction: column; gap: 18px; align-items: stretch; }
  .focus-ring-wrap { align-self: center; width: 206px; height: 206px; }
  .focus-ring { width: 206px; height: 206px; }
  .focus-side { gap: 11px; }
  .focus-modes button { padding: 0 9px; }
  .water-cups { grid-template-columns: repeat(8, minmax(0, 1fr)); max-width: none; }
  .water-cup { height: 36px; }
  .plan-item { grid-template-columns: 42px 14px minmax(0, 1fr) 22px; gap: 0 7px; }
  .plan-del { display: none; }
  .plan-form { flex-wrap: wrap; }
  .plan-form .time-inputs { width: 100%; padding-left: 2px; }
  .plan-form > input[type="text"] { flex: 1; }
  .todo-options { flex-direction: column; align-items: flex-start; gap: 5px; }
  .todo-options .tag-picker { padding-top: 2px; border-top: 1px dashed var(--line); width: 100%; }
  .todo-filters { margin-top: 12px; }
  .todo-list { max-height: none; }
  .todo-del { opacity: 1; }
  .todo-footer > span { display: none; }
  .stats-section { margin-top: 36px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .section-heading h2 { font-size: 25px; }
  .chart-wrap { height: 200px; }
  .chart-card, .breakdown-card, .log-card, .review-card { padding: 20px; }
  .modal { padding: 12px; align-items: flex-end; }
  .modal-card { max-height: 92vh; padding: 22px 20px 18px; border-radius: 22px; }
  .field-grid { grid-template-columns: 1fr; }
  .modal-foot { flex-direction: column; align-items: stretch; gap: 10px; }
  .modal-foot > div { justify-content: flex-end; }
  .modal-note { display: none; }
  .page-footer { flex-wrap: wrap; gap: 7px; }
  .footer-note { width: 100%; margin-left: 30px; }
  .mobile-nav a { width: 52px; }
}

@media (max-width: 380px) {
  .main { padding-left: 12px; padding-right: 12px; }
  .work-count { font-size: 45px; }
  .clock #clockMain { font-size: 18px; }
  .focus-ring-wrap { width: 180px; height: 180px; }
  .focus-ring { width: 180px; height: 180px; }
  .focus-readout strong { font-size: 38px; }
  .mobile-nav a { width: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* =========================================================
   v2 · 无打卡工作钟、计划操作重做、日历、学习与小游戏
   ========================================================= */

.work-bottom .work-note {
  max-width: 250px;
  margin: 0 0 0 auto;
  text-align: right;
  font-family: var(--font-serif);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}

/* Plan: one node toggles, one trash deletes. */
.plan-item {
  grid-template-columns: 47px 24px minmax(0, 1fr) 22px;
  gap: 0 9px;
  cursor: pointer;
}
.plan-rail { display: flex; justify-content: center; }
.plan-rail::before {
  left: 50%;
  top: 10px;
  bottom: -4px;
}
.plan-item:first-child .plan-rail::before { top: 12px; }
.plan-item:last-child .plan-rail::before { bottom: calc(100% - 18px); }
.plan-node {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  transition: background .2s, border-color .2s, color .2s, transform .2s;
}
.plan-node .icon { width: 10px; height: 10px; stroke-width: 2.4; }
.plan-node:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.plan-item.is-done .plan-node { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.plan-main { cursor: pointer; }
.plan-actions {
  align-items: flex-start;
  justify-content: flex-end;
  padding-top: 3px;
  padding-bottom: 0;
}
.plan-del {
  position: static;
  width: 22px;
  height: 22px;
  opacity: 0;
  color: var(--faint);
  pointer-events: none;
}
.plan-del .icon { width: 14px; height: 14px; }
.plan-item:hover .plan-del, .plan-del:focus-visible { opacity: 1; pointer-events: auto; }
.plan-del:hover { color: var(--clay); background: var(--clay-soft); }

/* Todo date and schedule */
.todo-head-tools { flex-wrap: wrap; justify-content: flex-end; }
.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: .02em;
  transition: border-color .2s, background .2s, color .2s;
}
.date-chip .icon { width: 13px; height: 13px; color: var(--accent); }
.date-chip:hover { border-color: var(--line-strong); background: var(--surface); color: var(--ink); }
.date-chip.is-today { background: var(--accent-faint); color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }
.todo-schedule {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.schedule-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}
.schedule-field .icon { width: 12px; height: 12px; opacity: .7; }
.schedule-field > span { color: var(--muted); font-size: 8px; letter-spacing: .02em; }
.schedule-field input {
  width: 84px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  outline: none;
}
.schedule-field input[type="time"] { width: 54px; }
.schedule-field input::-webkit-calendar-picker-indicator { opacity: .35; cursor: pointer; }
.schedule-hint { color: var(--faint); font-size: 8.5px; letter-spacing: .02em; }
.todo-task-date {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8px;
}
.todo-task-date.is-overdue { color: var(--clay); }
.todo-item.is-overdue .todo-text { color: var(--clay); }

/* Learn & break */
.learn-section { margin-top: 52px; scroll-margin-top: 20px; }
.section-side { color: var(--faint); font-size: 10px; letter-spacing: .03em; text-align: right; }
.learn-grid { grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr); }
.vocab-card { display: flex; flex-direction: column; min-height: 335px; }
.vocab-card .card-head { align-items: flex-start; }
.vocab-stage { display: flex; flex: 1; flex-direction: column; justify-content: center; padding-top: 13px; }
.vocab-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .08em;
}
.vocab-word-line { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.vocab-word-line h3 {
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: clamp(31px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: .015em;
  line-height: 1.12;
}
.vocab-word-line .icon-btn { width: 30px; height: 30px; }
.vocab-word-line .icon-btn .icon { width: 14px; height: 14px; }
.vocab-phonetic { margin-top: 1px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em; }
.vocab-meaning-wrap { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.vocab-cover { display: none; padding: 5px 0; color: var(--faint); font-size: 10px; line-height: 1.6; }
.vocab-meaning-wrap:not(.is-revealed) .vocab-meaning,
.vocab-meaning-wrap:not(.is-revealed) .vocab-example {
  display: none;
}
.vocab-meaning-wrap:not(.is-revealed) .vocab-cover { display: block; }
.vocab-meaning { color: var(--ink); font-size: 12.5px; line-height: 1.65; }
.vocab-example {
  margin-top: 4px;
  color: var(--faint);
  font-family: var(--font-serif);
  font-size: 11px;
  line-height: 1.6;
}
.vocab-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.vocab-actions .btn { height: 31px; padding: 0 12px; font-size: 10px; }
.vocab-actions #vocabKnown { margin-left: auto; }
.vocab-progress { display: flex; gap: 5px; margin-top: 14px; }
.vocab-dot { width: 18px; height: 3px; border-radius: 99px; background: var(--surface-3); }
.vocab-dot.is-done { background: var(--accent); }
.vocab-dot.is-current { background: var(--gold); }

.reading-card, .game-card { display: flex; flex-direction: column; min-height: 335px; overflow: hidden; }
.reading-card { background: linear-gradient(155deg, var(--surface) 0%, var(--gold-soft) 135%); }
.reading-card h2, .game-card h2 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 500;
  letter-spacing: .04em;
}
.reading-desc, .game-desc { margin-top: 9px; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.reading-art {
  position: absolute;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 54px;
  border: 1px solid color-mix(in srgb, var(--clay) 42%, transparent);
  border-radius: 2px;
  color: var(--clay);
  font-family: var(--font-serif);
  font-size: 20px;
}
.reading-art::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid color-mix(in srgb, var(--clay) 22%, transparent);
}
.reading-link { width: fit-content; margin-top: auto; height: 35px; font-size: 10.5px; }
.reading-note { margin-top: 9px; color: var(--faint); font-size: 8.5px; }
.game-card { background: linear-gradient(160deg, var(--surface) 0%, var(--accent-faint) 140%); }
.game-orbit {
  position: absolute;
  right: -32px;
  top: -38px;
  width: 150px;
  height: 150px;
  border: 1px solid color-mix(in srgb, var(--accent) 13%, transparent);
  border-radius: 50%;
}
.game-orbit::before {
  content: "";
  position: absolute;
  inset: 24px;
  border: 1px solid color-mix(in srgb, var(--accent) 11%, transparent);
  border-radius: 50%;
}
.game-orbit span, .game-orbit i {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
}
.game-orbit span { top: 18px; left: 27px; }
.game-orbit i { right: 24px; bottom: 32px; background: var(--clay); }
.game-best { display: flex; gap: 18px; margin: 14px 0; padding-top: 10px; border-top: 1px dashed var(--line); }
.game-best span { display: flex; flex-direction: column; gap: 1px; color: var(--faint); font-size: 8.5px; }
.game-best strong { color: var(--ink-soft); font-family: var(--font-serif); font-size: 18px; font-weight: 500; }
.game-card > .btn { width: fit-content; margin-top: auto; height: 35px; font-size: 10.5px; }

/* Calendar modal */
.calendar-modal-card { width: min(460px, 100%); }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0 12px; }
.calendar-toolbar strong { font-family: var(--font-serif); font-size: 19px; font-weight: 500; letter-spacing: .05em; }
.calendar-toolbar .icon-btn { width: 32px; height: 32px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.calendar-weekdays { padding-bottom: 5px; color: var(--faint); font-size: 9px; text-align: center; }
.calendar-grid { gap: 3px; }
.calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 48px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  transition: background .18s, color .18s, border-color .18s;
}
.calendar-day:hover { background: var(--surface-2); }
.calendar-day.is-other { color: var(--faint); opacity: .45; }
.calendar-day.is-today { border-color: var(--gold); color: var(--gold); }
.calendar-day.is-selected { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.calendar-day.is-selected.is-today { border-color: var(--accent); color: var(--surface); }
.calendar-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--clay); }
.calendar-day.is-selected .calendar-dot { background: var(--surface); }
.calendar-day .calendar-count {
  position: absolute;
  top: 3px;
  right: 4px;
  color: var(--faint);
  font-size: 7px;
}
.calendar-day.is-selected .calendar-count { color: var(--surface); opacity: .7; }
.calendar-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.calendar-foot > span { color: var(--faint); font-size: 8.5px; }
.calendar-foot .btn { height: 30px; }

/* Word matching game */
.game-modal-card { width: min(700px, 100%); }
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--faint);
  font-size: 9px;
}
.game-hud strong { margin-left: 3px; color: var(--ink); font-family: var(--font-mono); font-weight: 500; font-size: 10px; }
.game-message { margin: 11px 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.game-message.is-won { color: var(--accent); }
.game-board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.game-tile {
  position: relative;
  height: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 700px;
}
.game-tile-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .35s cubic-bezier(.2, .7, .2, 1);
}
.game-tile.is-flipped .game-tile-inner,
.game-tile.is-matched .game-tile-inner { transform: rotateY(180deg); }
.game-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 11px;
  backface-visibility: hidden;
  overflow-wrap: anywhere;
  text-align: center;
}
.game-face-front {
  background: linear-gradient(145deg, var(--accent-soft), var(--surface));
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 19px;
}
.game-face-front::after {
  content: "日";
  position: absolute;
  right: 7px;
  bottom: 3px;
  color: var(--accent);
  font-family: var(--font-serif);
  font-size: 22px;
  opacity: .08;
}
.game-face-back {
  transform: rotateY(180deg);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.45;
}
.game-tile.is-word .game-face-back { font-family: var(--font-serif); font-size: 15px; color: var(--accent-strong); }
.game-tile.is-matched .game-face-back { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-faint); }
.game-tile.is-matched { cursor: default; }
.game-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Sync settings */
.sync-badge {
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font-sans);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .02em;
  vertical-align: 1px;
}
.sync-badge.is-on { background: var(--accent-faint); color: var(--accent); }
.sync-badge.is-error { background: var(--clay-soft); color: var(--clay); }
.sync-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.sync-actions .btn { height: 32px; padding: 0 10px; font-size: 9.5px; }
.sync-status {
  margin-top: 1px;
  color: var(--faint);
  font-size: 9px;
  line-height: 1.55;
}
.sync-status.is-error { color: var(--clay); }
.sync-status.is-ok { color: var(--accent); }
#setSyncPassword { font-family: var(--font-mono); letter-spacing: .05em; }

@media (max-width: 1099px) {
  .learn-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vocab-card { grid-column: span 2; }
  .work-bottom .work-note { max-width: none; }
}

@media (max-width: 720px) {
  .work-bottom { align-items: flex-start; }
  .work-bottom .work-note { width: 100%; margin: 2px 0 0; text-align: left; }
  .plan-item { grid-template-columns: 42px 20px minmax(0, 1fr) 22px; gap: 0 7px; }
  .plan-del { display: grid; opacity: .55; pointer-events: auto; }
  .plan-del .icon { width: 13px; height: 13px; }
  .todo-head-tools { width: 100%; justify-content: flex-start; padding-top: 0; }
  .todo-card .card-head { flex-wrap: wrap; row-gap: 8px; }
  .todo-schedule { gap: 6px; }
  .schedule-field { flex: 1; min-width: 130px; }
  .schedule-field input { flex: 1; width: auto; }
  .schedule-hint { width: 100%; }
  .learn-section { margin-top: 36px; }
  .section-side { display: none; }
  .learn-grid { grid-template-columns: minmax(0, 1fr); }
  .vocab-card { grid-column: auto; min-height: 330px; }
  .reading-card, .game-card { min-height: 280px; }
  .vocab-word-line h3 { font-size: 36px; }
  .game-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .game-tile { height: 86px; }
  .game-face-back { font-size: 10.5px; }
  .calendar-modal-card { width: 100%; }
  .calendar-day { height: 44px; }
  .game-modal-card { width: 100%; }
}

@media (max-width: 380px) {
  .game-board { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .game-tile { height: 76px; }
  .game-face-back { font-size: 9.5px; padding: 5px; }
  .vocab-actions .btn { padding: 0 9px; }
  .vocab-actions #vocabKnown { margin-left: 0; }
}

