:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-muted: #f6f8fa;
  --surface-hover: #eef2f5;
  --ink: #11181c;
  --ink-2: #3f4a54;
  --muted: #64707a;
  --dim: #8895a0;
  --line: rgba(17, 24, 28, .085);
  --line-strong: rgba(17, 24, 28, .15);
  --g: #0f766e;
  --gd: #0b5d56;
  --g-soft: rgba(15, 118, 110, .09);
  --b: #2563eb;
  --b-soft: rgba(37, 99, 235, .09);
  --p: #7c3aed;
  --p-soft: rgba(124, 58, 237, .09);
  --a: #d97706;
  --a-soft: rgba(217, 119, 6, .10);
  --red: #dc2626;
  --red-soft: rgba(220, 38, 38, .09);
  --panel: var(--surface);
  --input-bg: #f8fafb;
  --overlay-bg: rgba(15, 23, 30, .42);
  --nav-active-bg: #11181c;
  --nav-active-ink: #ffffff;
  --shadow-sm: 0 0.01rem 0.02rem rgba(17, 24, 28, .04), 0 0.04rem 0.14rem rgba(17, 24, 28, .035);
  --shadow-md: 0 0.08rem 0.28rem rgba(17, 24, 28, .07);
  --sans: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0c0e10;
  --surface: #14181d;
  --surface-muted: #1b2128;
  --surface-hover: #212831;
  --ink: #f1f5f9;
  --ink-2: #cbd5e1;
  --muted: #94a3b8;
  --dim: #64748b;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --g: #10b981;
  --gd: #059669;
  --g-soft: rgba(16, 185, 129, .14);
  --b: #60a5fa;
  --b-soft: rgba(96, 165, 250, .14);
  --p: #a78bfa;
  --p-soft: rgba(167, 139, 250, .14);
  --a: #f59e0b;
  --a-soft: rgba(245, 158, 11, .14);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, .14);
  --panel: var(--surface);
  --input-bg: #0f1317;
  --overlay-bg: rgba(4, 7, 10, .74);
  --nav-active-bg: #f1f5f9;
  --nav-active-ink: #0c0e10;
  --shadow-sm: 0 0.01rem 0.02rem rgba(0, 0, 0, .28), 0 0.06rem 0.18rem rgba(0, 0, 0, .22);
  --shadow-md: 0 0.12rem 0.32rem rgba(0, 0, 0, .38);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { font-size: calc(100vw / 14.4); }
@media (min-width: 1920px) { html { font-size: 133.33px; } }
@media (max-width: 750px) { html { font-size: 50px; } }

html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 0.14rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 0.02rem solid var(--g);
  outline-offset: 0.02rem;
}

.orb { display: none; }

.app {
  position: relative;
  z-index: 1;
  max-width: 14.2rem;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0.18rem 0.24rem 0.42rem;
}

.glass {
  background: var(--surface);
  border: 0.01rem solid var(--line);
  box-shadow: var(--shadow-sm);
}

/* Top Capsule Header */
.header {
  display: grid;
  grid-template-columns: minmax(2.5rem, 1fr) auto minmax(2.5rem, 1fr);
  align-items: center;
  gap: 0.16rem;
  min-height: 0.62rem;
  padding: 0.08rem 0.16rem;
  border-radius: 0.16rem;
  margin-bottom: 0.16rem;
}

.brand { display: flex; align-items: center; gap: 0.11rem; min-width: 0; }
.avatar {
  position: relative;
  isolation: isolate;
  width: 0.36rem;
  height: 0.36rem;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 0.1rem;
  background: var(--g);
  font: 700 0.18rem Georgia, "Songti SC", serif;
  color: #ffffff;
  box-shadow: 0 0.04rem 0.12rem rgba(15, 118, 110, .25);
  overflow: hidden;
}
.helm-wheel {
  position: absolute;
  z-index: -1;
  inset: -0.1rem;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .2);
  font-size: 0.56rem;
  line-height: 1;
}
.brand strong { display: block; font-size: 0.155rem; font-weight: 700; letter-spacing: -.01em; color: var(--ink); line-height: 1.2; }
.brand small { display: block; margin-top: 0.015rem; color: var(--muted); font-size: 0.105rem; letter-spacing: .04em; white-space: nowrap; }

/* Navigation Capsule (Centered in Header on Desktop) */
.nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.04rem;
  padding: 0.04rem;
  border-radius: 9.99rem;
  background: var(--surface-muted);
  border: 0.01rem solid var(--line);
  box-shadow: none;
}
.nav button {
  min-width: 0.68rem;
  padding: 0.065rem 0.14rem;
  border: 0;
  border-radius: 9.99rem;
  background: transparent;
  color: var(--muted);
  font-size: 0.13rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nav button:hover { color: var(--ink); }
.nav button[aria-pressed="true"] {
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  font-weight: 600;
}

.head-actions { display: flex; align-items: center; justify-content: flex-end; gap: 0.08rem; flex-wrap: wrap; }
#date { color: var(--muted); font-size: 0.115rem; white-space: nowrap; }
.live { display: inline-flex; align-items: center; color: var(--g); font-size: 0.11rem; font-weight: 600; }
.live:before {
  content: "";
  display: inline-block;
  width: 0.065rem;
  height: 0.065rem;
  margin-right: 0.045rem;
  border-radius: 50%;
  background: var(--g);
}
#themeToggle {
  padding: 0.06rem 0.11rem;
  border-radius: 9.99rem;
  font-size: 0.115rem;
  white-space: nowrap;
}
#openSettings {
  width: 0.32rem;
  height: 0.32rem;
  padding: 0;
  border-radius: 9.99rem;
  display: grid;
  place-items: center;
  font-size: 0.15rem;
}

/* Shared Buttons & Controls */
.button, .edit {
  border: 0.01rem solid var(--line-strong);
  border-radius: 0.09rem;
  background: var(--surface);
  color: var(--ink-2);
  padding: 0.06rem 0.11rem;
  font-size: 0.12rem;
  font-weight: 500;
  transition: border-color .15s, background .15s, color .15s;
}
.button:hover, .edit:hover { border-color: var(--g); color: var(--g); background: var(--g-soft); }
.button:not(.secondary):not(.danger) {
  background: var(--g);
  border-color: var(--g);
  color: #ffffff;
}
.button:not(.secondary):not(.danger):hover { background: var(--gd); border-color: var(--gd); color: #ffffff; }
.secondary { border-color: var(--line); background: var(--surface-muted); color: var(--ink-2); }
.danger { color: var(--red); border-color: rgba(220, 38, 38, .28); background: var(--red-soft); }
.danger:hover { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.02rem 0.075rem;
  border-radius: 9.99rem;
  background: var(--g-soft);
  color: var(--g);
  font-size: 0.105rem;
  font-weight: 600;
  white-space: nowrap;
}
.empty { color: var(--dim); font-size: 0.12rem; }
.source { font-size: 0.115rem; color: var(--muted); }
.hide { display: none; }

/* Main Bento Layout: Top 4-Card Bento Strip (.side:first-child) + 2-Col Main Workspace */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(3.4rem, 1fr);
  gap: 0.14rem;
  align-items: start;
}
.layout.focus-view { grid-template-columns: minmax(0, 1fr); }
.layout.focus-view #stage { grid-column: 1; }
.layout.focus-view > .side { display: none !important; }

/* First .side becomes the Top 4-Card Bento Overview Row */
.layout > .side:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.55fr 1fr 1fr 1fr;
  gap: 0.14rem;
  align-items: stretch;
}
.side.right { display: grid; align-content: start; gap: 0.14rem; min-width: 0; }
#stage { min-width: 0; }

.summary, .panel { border-radius: 0.16rem; }

/* Bento Top Overview Cards */
.bento-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.15rem 0.18rem;
  border-radius: 0.16rem;
  background: linear-gradient(145deg, var(--surface) 58%, var(--g-soft));
  border: 0.01rem solid var(--line);
  box-shadow: var(--shadow-sm);
  min-height: 1.28rem;
}
.bento-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 0.08rem; }
.bento-hero h1 {
  margin: 0.07rem 0 0.04rem;
  font-size: 0.185rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
  color: var(--ink);
  text-wrap: pretty;
}
.bento-hero .poem {
  margin: 0;
  color: var(--muted);
  font-size: 0.115rem;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 1.28rem;
  padding: 0.14rem 0.17rem;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.summary.daily-click:hover {
  transform: translateY(-0.01rem);
  box-shadow: var(--shadow-md);
  border-color: var(--g);
}
.summary h3, .module h3 { margin: 0; font-size: 0.135rem; font-weight: 600; color: var(--muted); }
.summary strong {
  display: block;
  margin-top: 0.06rem;
  font: 650 0.24rem/1.15 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  color: var(--ink);
}
.summary p { margin: 0.02rem 0 0; color: var(--muted); font-size: 0.115rem; line-height: 1.35; }
.summary.health { background: var(--surface); }
.summary.finance { background: var(--surface); }
.summary.growth { background: var(--surface); }
.summary.growth[hidden] { display: none; }
.summary.growth.weekly-growth { min-height: 1.28rem; padding: 0.14rem 0.17rem; }
.summary.growth.weekly-growth strong { margin-top: 0.04rem; font-size: 0.22rem; line-height: 1.15; }

.side-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.06rem;
  margin-top: 0.06rem;
}
.side-stat {
  min-width: 0;
  padding: 0.05rem 0.06rem;
  border-radius: 0.08rem;
  background: var(--surface-muted);
  border: 0.01rem solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.04rem;
}
.side-stat b { font: 700 0.13rem/1 var(--mono); color: var(--g); }
.side-stat span { color: var(--muted); font-size: 0.095rem; white-space: nowrap; }

.summary-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.06rem;
  margin-top: 0.08rem;
}
.summary-actions .edit {
  min-width: 0;
  padding: 0.04rem 0.06rem;
  font-size: 0.11rem;
  border-radius: 0.07rem;
  background: var(--surface-muted);
  border-color: var(--line);
  color: var(--ink-2);
}
.summary-actions .edit:hover { background: var(--g-soft); border-color: var(--g); color: var(--g); }

/* Panels & Modules */
.panel-head, .module-head { display: flex; justify-content: space-between; gap: 0.1rem; align-items: center; }
.panel-head { padding: 0.14rem 0.18rem; border-bottom: 0.01rem solid var(--line); }
.panel-head h1, .panel-head h2 { margin: 0; font-size: 0.15rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.panel-head p, .module-head p, .finance-pane-head p, .focus-title p { display: none; }
.content { padding: 0.16rem 0.18rem; }

/* In Daily view, unwrap the outer panel feel so Bento cards breathe cleanly */
#stage .panel.no-view-head.daily-canvas {
  background: transparent;
  border: 0;
  box-shadow: none;
}
#stage .panel.no-view-head.daily-canvas .content { padding: 0; display: grid; gap: 0.14rem; }

.module {
  min-width: 0;
  padding: 0.16rem 0.18rem;
  border: 0.01rem solid var(--line);
  border-radius: 0.16rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.module h3 { color: var(--ink); font-size: 0.145rem; font-weight: 700; letter-spacing: -.01em; }
.module.blue { border-color: var(--line); }
.module.purple { border-color: var(--line); }
.module.amber { border-color: var(--line); }
.module-head .edit { padding: 0.035rem 0.09rem; font-size: 0.11rem; border-radius: 0.07rem; }

.daily-click { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.daily-click:hover { border-color: var(--g); }
.daily-click:focus-visible { outline: 0.02rem solid var(--g); outline-offset: 0.02rem; }

/* Daily View Bento Sections */
.daily-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 0.14rem; }
.daily-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 0.14rem; }
.three-list, .mini-list, .log-list { display: grid; gap: 0.08rem; margin-top: 0.12rem; }

.line-item {
  display: flex;
  gap: 0.09rem;
  align-items: center;
  min-height: 0.3rem;
  font-size: 0.13rem;
  color: var(--ink);
}
.line-item input { accent-color: var(--g); width: 0.16rem; height: 0.16rem; cursor: pointer; }

.three-list .line-item {
  align-items: flex-start;
  padding: 0.11rem 0.12rem;
  border-radius: 0.11rem;
  background: var(--surface-muted);
  border: 0.01rem solid transparent;
  transition: border-color .15s;
}
.three-list .line-item:hover { border-color: var(--line-strong); }
.three-list .line-item > span { flex: 1; min-width: 0; }
.three-list .line-item b { display: block; font-size: 0.135rem; font-weight: 600; color: var(--ink); }
.three-list .line-item small { display: block; margin-top: 0.03rem; color: var(--muted); font-size: 0.11rem; }
.three-list .line-item.done b,
.line-item.done span,
.todo-row.done .todo-text {
  color: var(--dim);
  text-decoration: line-through;
  text-decoration-color: var(--dim);
}
.todo-row.done small { color: var(--dim); }

/* Bento Habit Cards with 7-Day Micro-Streak Bar */
.habit-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(1.45rem, 1fr));
  gap: 0.1rem;
  margin-top: 0.12rem;
}
.habit-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.08rem;
  align-items: start;
  min-height: 0.78rem;
  padding: 0.12rem 0.13rem;
  border: 0.01rem solid var(--line);
  border-radius: 0.12rem;
  background: var(--surface-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.habit-card:has(input:checked) {
  border-color: var(--g);
  background: var(--g);
  color: #ffffff;
}
html[data-theme="dark"] .habit-card:has(input:checked) {
  background: #0f766e;
  border-color: var(--g);
}
.habit-card input { accent-color: var(--g); width: 0.15rem; height: 0.15rem; margin-top: 0.02rem; }
.habit-card b { display: block; font-size: 0.13rem; font-weight: 600; color: var(--ink); }
.habit-card small { display: block; margin-top: 0.02rem; color: var(--muted); font-size: 0.105rem; }
.habit-card:has(input:checked) b,
.habit-card:has(input:checked) small { color: #ffffff; }
.habit-card:has(input:checked) small { opacity: .88; }
.habit-mini-bar { grid-column: 1 / -1; display: flex; gap: 0.03rem; margin-top: 0.05rem; }
.habit-mini-bar i { flex: 1; height: 0.03rem; border-radius: 9.99rem; background: rgba(128, 138, 148, .25); }
.habit-card:not(:has(input:checked)) .habit-mini-bar i.on { background: var(--g); }
.habit-card:has(input:checked) .habit-mini-bar i.on { background: rgba(255, 255, 255, .92); }
.habit-card:has(input:checked) .habit-mini-bar i:not(.on) { background: rgba(255, 255, 255, .28); }

/* Todo Card + Zero-Modal Inline Add Bar */
.todo-full { margin-top: 0; }
.inline-add-bar {
  display: flex;
  gap: 0.08rem;
  margin-top: 0.12rem;
}
.inline-add-bar input {
  flex: 1;
  min-width: 0;
  padding: 0.08rem 0.11rem;
  border: 0.01rem solid var(--line);
  border-radius: 0.1rem;
  background: var(--surface-muted);
  color: var(--ink);
  font-size: 0.125rem;
}
.inline-add-bar input:focus { border-color: var(--g); background: var(--surface); outline: none; }
.inline-add-bar .button { border-radius: 0.1rem; padding: 0.07rem 0.14rem; white-space: nowrap; }

.todo-full .todo-list {
  display: grid;
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  grid-auto-columns: minmax(2.1rem, 1fr);
  column-gap: 0.14rem;
  row-gap: 0.06rem;
  margin-top: 0.1rem;
  max-height: none;
  overflow-x: auto;
  overflow-y: visible;
}
.todo-row {
  display: grid;
  grid-template-columns: 0.22rem 1fr auto;
  gap: 0.08rem;
  align-items: center;
  padding: 0.075rem 0.1rem;
  border-radius: 0.09rem;
  background: var(--surface-muted);
  font-size: 0.125rem;
  color: var(--ink);
}
.todo-check { accent-color: var(--g); width: 0.15rem; height: 0.15rem; cursor: pointer; }
.todo-row small { color: var(--muted); font-size: 0.105rem; }
.todo-row-actions { display: inline-flex; align-items: center; gap: 0.06rem; }
.todo-delete { padding: 0.01rem 0.055rem; font-size: 0.105rem; line-height: 1.2; opacity: .7; border-radius: 0.06rem; }
.todo-delete:hover { opacity: 1; }

.daily-review-list { max-height: 1.15rem; overflow: hidden; }
.daily-review-item { align-items: flex-start; background: var(--surface-muted); padding: 0.09rem 0.1rem; border-radius: 0.1rem; }
.daily-review-text { display: block; max-height: 0.86rem; overflow: hidden; white-space: pre-line; line-height: 1.55; min-width: 0; color: var(--ink-2); font-size: 0.12rem; }

/* Right Rail: Advice, Goal Route, Weekly Review, Quick Record */
.right .panel { padding: 0.16rem 0.18rem; }
.right .panel .panel-head { margin: 0 0 0.1rem; padding: 0; border-bottom: 0; }
.advice-panel, .weekly-review { padding: 0.16rem 0.18rem; }
.advice-carousel, .weekly-carousel { position: relative; overflow: hidden; }
.advice-item, .weekly-page { display: none; min-height: 0; }
.advice-item.active, .weekly-page.active { display: block; }
.advice-card-inner {
  padding: 0.12rem 0.14rem;
  border-radius: 0.12rem;
  background: var(--surface-muted);
}
.advice-item small { display: block; color: var(--g); font-size: 0.105rem; font-weight: 600; }
.advice-item b { display: block; font-size: 0.145rem; font-weight: 700; margin-top: 0.03rem; line-height: 1.4; color: var(--ink); }
.advice-lines { display: grid; gap: 0.06rem; margin-top: 0.09rem; }
.advice-line { display: grid; grid-template-columns: 0.42rem 1fr; gap: 0.08rem; align-items: start; color: var(--ink-2); font-size: 0.12rem; line-height: 1.5; }
.advice-label { color: var(--muted); font-size: 0.11rem; }
.advice-value { white-space: pre-line; }
.advice-line[data-line="next"] .advice-value { color: var(--g); font-weight: 500; }

.advice-carousel-controls, .weekly-carousel-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.1rem;
  margin-top: 0.1rem;
}
.advice-nav, .weekly-nav {
  width: 0.28rem;
  height: 0.28rem;
  border: 0.01rem solid var(--line);
  border-radius: 0.08rem;
  background: var(--surface-muted);
  color: var(--ink-2);
  font-size: 0.15rem;
  line-height: 1;
}
.advice-nav:hover, .weekly-nav:hover { border-color: var(--g); color: var(--g); background: var(--g-soft); }
.advice-dots, .weekly-dots { display: flex; justify-content: center; gap: 0.06rem; flex: 1; }
.advice-dot, .weekly-dot { width: 0.065rem; height: 0.065rem; padding: 0; border: 0; border-radius: 9.99rem; background: var(--line-strong); }
.advice-dot.active, .weekly-dot.active { width: 0.2rem; background: var(--g); }

.weekly-kpis { display: grid; gap: 0.07rem; }
.weekly-kpi {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.08rem;
  align-items: center;
  padding: 0.09rem 0.11rem;
  border-radius: 0.1rem;
  background: var(--surface-muted);
  font-size: 0.12rem;
}
.weekly-kpi span { color: var(--muted); }
.weekly-kpi b { color: var(--ink); font: 700 0.135rem var(--mono); }
.weekly-alerts { display: grid; gap: 0.06rem; padding: 0.1rem 0.12rem; border-radius: 0.1rem; background: var(--surface-muted); color: var(--ink-2); font-size: 0.12rem; line-height: 1.5; }
.weekly-alerts b { color: var(--g); font-weight: 600; }

/* Goal Route 2x2 Bento Grid */
.route-workspace, .quick-record { display: grid; gap: 0.08rem; }
.route-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.08rem; }
.route-list > div {
  padding: 0.09rem 0.11rem;
  border-radius: 0.1rem;
  background: var(--surface-muted);
  border: 0.01rem solid transparent;
}
.route-list > div:last-child {
  grid-column: 1 / -1;
  border-color: var(--g);
  background: var(--g-soft);
}
.route-list small { display: block; color: var(--g); font-size: 0.1rem; font-weight: 600; }
.route-list b { display: block; margin-top: 0.03rem; color: var(--ink); font-size: 0.12rem; font-weight: 600; line-height: 1.4; }

.quick-record { cursor: pointer; transition: border-color .15s; }
.quick-record:hover { border-color: var(--g); }
.quick-record p { margin: 0; color: var(--muted); font-size: 0.12rem; white-space: pre-line; }

.view[hidden] { display: none; }

/* Life View */
.life-manifesto {
  position: relative;
  padding: 0.18rem 0.2rem;
  margin-bottom: 0.14rem;
  border-radius: 0.14rem;
  background: linear-gradient(145deg, var(--surface-muted) 60%, var(--g-soft));
  border: 0.01rem solid var(--line);
}
.life-manifesto.life-inline { display: grid; grid-template-columns: 1.25fr minmax(0, 1fr) minmax(0, 1.15fr); gap: 0.2rem; }
.life-vision small, .life-copy small { display: block; color: var(--g); font-size: 0.105rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.life-manifesto.life-inline .life-vision p { margin: 0.07rem 0 0; color: var(--ink); font-size: 0.18rem; font-weight: 700; line-height: 1.5; }
.life-copy p { margin: 0.07rem 0 0; color: var(--ink-2); font-size: 0.135rem; line-height: 1.7; }
.life-principles { display: flex; gap: 0.07rem; flex-wrap: wrap; margin-top: 0.08rem; }
.life-principles span { padding: 0.04rem 0.09rem; border-radius: 9.99rem; background: var(--g-soft); color: var(--g); font-size: 0.115rem; font-weight: 600; }
.life-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 0.14rem; margin-top: 0.14rem; }
.life-goal-list { display: grid; gap: 0.07rem; margin-top: 0.11rem; }
.life-goal.done span { color: var(--dim); text-decoration: line-through; }
.life-goal input { accent-color: var(--g); }
.habit-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 0.14rem; margin: 0.12rem 0; }
.habit-tabs { display: flex; gap: 0.06rem; flex-wrap: wrap; }
.habit-tabs button { padding: 0.06rem 0.12rem; border: 0.01rem solid var(--line); border-radius: 9.99rem; background: var(--surface-muted); color: var(--muted); font-size: 0.12rem; }
.habit-tabs button.active { background: var(--g); border-color: var(--g); color: #ffffff; font-weight: 600; }
.habit-overview { display: grid; grid-template-columns: auto; justify-content: end; align-items: center; }
.habit-stat { color: var(--muted); font-size: 0.11rem; }
.habit-stat strong { display: block; color: var(--g); font: 700 0.2rem var(--mono); }
.habit-month-wrap { padding: 0.14rem; border: 0.01rem solid var(--line); border-radius: 0.12rem; background: var(--surface-muted); }
.habit-month-title { margin-bottom: 0.1rem; color: var(--ink); font-weight: 700; font-size: 0.15rem; }
.habit-month-weekdays, .habit-month-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.05rem; }
.habit-month-weekdays b { text-align: center; color: var(--muted); font-size: 0.115rem; font-weight: 600; }
.habit-month-board { margin-top: 0.06rem; }
.habit-month-cell { min-height: 0.52rem; display: grid; place-items: center; padding: 0.04rem; border-radius: 0.09rem; background: var(--surface); border: 0.01rem solid var(--line); color: var(--muted); font-size: 0.1rem; }
.habit-month-cell span { font: 600 0.14rem/1 var(--mono); }
.habit-month-cell small { font-size: 0.085rem; color: var(--dim); }
.habit-month-cell.on { background: var(--g-soft); border-color: var(--g); color: var(--g); }
.habit-month-cell.on small { color: var(--g); font-weight: 600; }
.habit-month-cell.today { box-shadow: inset 0 0 0 0.015rem var(--b); }
.habit-month-cell.adjacent-month { opacity: .42; }

/* Health View */
.health-workspace.no-view-head {
  height: calc(100vh - 1.72rem);
  display: grid;
  grid-template-rows: auto minmax(0, .92fr) minmax(0, .92fr) minmax(0, .92fr) minmax(0, 1.38fr);
  padding: 0.06rem 0 0.1rem;
  overflow: hidden;
}
.health-workspace.no-view-head .health-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 0.14rem;
  align-items: center;
  border-bottom: 0;
  padding: 0.04rem 0.18rem;
}
.health-alert-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.06rem;
  padding: 0.03rem 0.1rem;
  border-radius: 9.99rem;
  background: var(--g-soft);
  color: var(--g);
  font-size: 0.11rem;
  font-weight: 600;
  white-space: nowrap;
}
.health-alert-badge.warn { background: var(--red-soft); color: var(--red); }
.diet-month-nav { display: inline-flex; align-items: center; gap: 0.05rem; margin-left: 0.08rem; }
.diet-month-nav button { width: 0.2rem; height: 0.2rem; padding: 0; border: 0.01rem solid var(--line); border-radius: 0.05rem; background: var(--surface); color: var(--muted); font-size: 0.11rem; line-height: 1; }
.diet-month-nav button:hover { border-color: var(--g); color: var(--g); }
.period-switch { display: flex; gap: 0.04rem; padding: 0.02rem; border-radius: 0.08rem; background: var(--surface-muted); border: 0.01rem solid var(--line); }
.period-switch button { padding: 0.04rem 0.09rem; border: 0; border-radius: 0.06rem; background: transparent; color: var(--muted); font-size: 0.115rem; }
.period-switch button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.health-workspace.no-view-head .health-wide {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0.06rem 0.14rem 0.17rem;
  margin: 0.06rem 0.18rem 0;
  border: 0.01rem solid var(--line);
  border-radius: 0.12rem;
  background: var(--surface-muted);
  min-height: 0;
  overflow: hidden;
}
.health-workspace.no-view-head .health-wide h2 { margin: 0; font-size: 0.13rem; color: var(--ink); font-weight: 700; }
.health-workspace.no-view-head .health-wide .module-head { align-items: center; }
.health-head-title { display: flex; align-items: center; gap: 0.08rem; min-width: 1.8rem; }
.health-head-stats { display: flex; justify-content: flex-start; align-items: center; gap: 0.12rem; flex: 1; min-width: 0; }
.health-head-stats .health-kpis, .health-head-stats .diet-summary { display: flex; align-items: center; gap: 0.12rem; margin: 0; font-size: 0.105rem; line-height: 1.2; color: var(--muted); }
.health-kpis b { color: var(--ink); font-family: var(--mono); }
.diet-summary i { width: 0.07rem; height: 0.07rem; border-radius: 50%; background: var(--g); }
.diet-summary .bad { background: var(--red); }
.line-chart {
  position: relative;
  height: 100%;
  min-height: 0.44rem;
  max-height: 1.05rem;
  margin: 0.03rem 0.16rem 0;
  border-bottom: 0.01rem solid var(--line-strong);
  background: repeating-linear-gradient(0deg, transparent 0, transparent 0.23rem, var(--line) 0.24rem);
}
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-point { position: absolute; width: 0.06rem; height: 0.06rem; border-radius: 50%; background: var(--g); border: 0.015rem solid var(--surface); transform: translate(-50%, -50%); z-index: 2; }
.chart-value-label { position: absolute; z-index: 3; transform: translate(-50%, -50%); padding: 0.015rem 0.045rem; border: 0.01rem solid var(--line); border-radius: 0.05rem; background: var(--surface); color: var(--ink); font: 600 0.08rem/1.25 var(--mono); white-space: nowrap; pointer-events: none; box-shadow: var(--shadow-sm); }
.chart-axis { position: absolute; display: flex; justify-content: space-between; left: 0; right: 0; bottom: -0.14rem; color: var(--muted); font: 0.08rem var(--mono); gap: 0.03rem; }
.chart-axis span { white-space: nowrap; }
.health-workspace.no-view-head .health-wide:last-child {
  padding-bottom: 0.06rem;
  gap: 0.04rem;
}
.diet-calendar-wrap { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0.03rem; min-height: 0; height: 100%; }
.diet-weekdays, .diet-board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.03rem; }
.diet-board { grid-template-rows: repeat(6, minmax(0, 1fr)); min-height: 0; }
.diet-weekdays b { text-align: center; color: var(--muted); font-size: 0.09rem; }
.diet-day { display: flex; align-items: center; justify-content: space-between; gap: 0.03rem; min-height: 0; padding: 0.015rem 0.055rem; border: 0.01rem solid var(--line); border-radius: 0.06rem; background: var(--surface); color: var(--muted); font-size: 0.085rem; }
.diet-day b { color: var(--ink); font-weight: 600; white-space: nowrap; }
.diet-day small { white-space: nowrap; }
.diet-day.on { background: var(--g-soft); border-color: var(--g); }
.diet-day.bad { background: var(--red-soft); border-color: var(--red); }
.diet-day.adjacent-month { opacity: .42; }
.diet-dot { display: inline-block; width: 0.055rem; height: 0.055rem; border-radius: 50%; background: var(--g); flex-shrink: 0; }
.diet-dot.bad { background: var(--red); }

/* Finance View */
.finance-view-grid { display: grid; gap: 0.14rem; }
.finance-kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.12rem; }
.finance-kpi {
  min-height: 1.24rem;
  padding: 0.15rem 0.17rem;
  border: 0.01rem solid var(--line);
  border-radius: 0.14rem;
  background: var(--surface-muted);
}
.finance-kpi h3 { margin: 0; color: var(--muted); font-size: 0.13rem; font-weight: 600; }
.finance-kpi strong { display: block; margin-top: 0.1rem; font: 700 0.24rem/1.15 var(--mono); color: var(--ink); }
.finance-kpi p { margin: 0.05rem 0 0; color: var(--muted); font-size: 0.11rem; line-height: 1.45; }
.finance-debt-summary { display: grid; gap: 0.05rem; margin-top: 0.08rem; }
.finance-mini-line { display: flex; justify-content: space-between; gap: 0.08rem; color: var(--ink-2); font-size: 0.115rem; }
.finance-mini-line b { color: var(--g); font: 600 0.115rem var(--mono); }
.finance-debt-module { grid-column: 1 / -1; min-height: 0; }
.finance-debt-chart { display: block; width: 100%; height: 3.1rem; border-bottom: 0.01rem solid var(--line); }
.finance-debt-chart text { font-family: inherit; letter-spacing: 0; }
.finance-segment { display: flex; gap: 0.04rem; flex-wrap: wrap; align-items: center; }
.finance-segment button { padding: 0.045rem 0.09rem; border: 0.01rem solid var(--line); border-radius: 0.08rem; background: var(--surface-muted); color: var(--muted); font-size: 0.11rem; }
.finance-segment button.active { border-color: var(--g); background: var(--g-soft); color: var(--g); font-weight: 600; }
.finance-month-select { padding: 0.04rem 0.07rem; border: 0.01rem solid var(--line); border-radius: 0.08rem; background: var(--surface); color: var(--ink); font-size: 0.11rem; }
.finance-accounting-grid { display: grid; grid-template-columns: 7fr 3fr; gap: 0.12rem; }
.finance-pane { min-width: 0; padding: 0.14rem 0.16rem; border: 0.01rem solid var(--line); border-radius: 0.14rem; background: var(--surface-muted); }
.finance-pane [hidden] { display: none !important; }
.finance-pane-head { display: flex; justify-content: space-between; gap: 0.1rem; align-items: center; }
.finance-ledger-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.ledger { display: flex; justify-content: space-between; gap: 0.08rem; padding: 0.085rem 0.1rem; border-radius: 0.09rem; background: var(--surface); border: 0.01rem solid var(--line); font-size: 0.12rem; color: var(--ink); }
.ledger small { display: block; color: var(--muted); margin-top: 0.02rem; font-size: 0.105rem; }
.ledger-actions { display: flex; align-items: center; gap: 0.06rem; }
.ledger-delete { padding: 0.025rem 0.07rem; font-size: 0.105rem; border-radius: 0.06rem; }
.finance-pager { display: flex; align-items: center; justify-content: flex-end; gap: 0.07rem; margin-top: 0.1rem; color: var(--muted); font-size: 0.11rem; }
.finance-pager button { width: 0.28rem; height: 0.28rem; border: 0.01rem solid var(--line); border-radius: 0.08rem; background: var(--surface); color: var(--ink-2); }
.finance-pager button:hover { border-color: var(--g); color: var(--g); }
.finance-bill-chart { position: relative; display: flex; align-items: flex-end; gap: 0.04rem; height: 1.9rem; margin-top: 0.14rem; padding: 0.22rem 0.04rem 0.28rem 0.52rem; border-bottom: 0.01rem solid var(--line-strong); background: repeating-linear-gradient(0deg, transparent 0, transparent 0.42rem, var(--line) 0.43rem); }
.finance-bill-axis { position: absolute; left: 0.04rem; top: 0.14rem; bottom: 0.28rem; width: 0.42rem; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font: 0.09rem/1 var(--mono); pointer-events: none; }
.finance-bill-axis span { text-align: right; }
.finance-bill-bar { position: relative; flex: 1; min-width: 0.08rem; border: 0; border-radius: 0.06rem 0.06rem 0.02rem 0.02rem; background: var(--g); color: var(--ink); opacity: .82; }
.finance-bill-bar:hover { opacity: 1; }
.finance-bill-bar.zero { background: var(--line-strong); opacity: .45; }
.finance-bill-bar.active { opacity: 1; box-shadow: 0 0 0 0.02rem var(--g-soft); }
.finance-bill-bar span { position: absolute; left: 50%; bottom: -0.22rem; transform: translateX(-50%); color: var(--muted); font: 0.09rem var(--mono); }
.finance-bill-bar b { position: absolute; left: 50%; bottom: calc(100% + 0.04rem); transform: translateX(-50%); font: 600 0.09rem var(--mono); color: var(--ink); white-space: nowrap; }
.finance-category-pie { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.12rem; align-items: center; margin-top: 0.12rem; }
.finance-pie-ring { position: relative; width: 1.44rem; height: 1.44rem; border-radius: 50%; overflow: hidden; }
.finance-pie-ring span { position: absolute; inset: 0.4rem; border-radius: 50%; background: var(--surface-muted); }
.finance-pie-list { display: grid; gap: 0.06rem; color: var(--ink-2); font-size: 0.115rem; }
.finance-pie-list i { display: inline-block; width: 0.08rem; height: 0.08rem; margin-right: 0.05rem; border-radius: 50%; }

/* Growth View */
.growth-media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.14rem; }
.growth-list-module { position: relative; overflow: hidden; }
.growth-list-head { align-items: center; }
.growth-list-head h3 { white-space: nowrap; }
.reading-tabs { display: flex; flex-wrap: wrap; gap: 0.05rem; justify-content: flex-end; flex: 1; }
.reading-tabs button { border: 0.01rem solid var(--line); border-radius: 9.99rem; background: var(--surface-muted); padding: 0.04rem 0.09rem; color: var(--muted); font-size: 0.11rem; }
.reading-tabs button.active { border-color: var(--g); background: var(--g-soft); color: var(--g); font-weight: 600; }
.growth-list-body { position: relative; min-height: 1.74rem; padding: 0 0.28rem; }
.book-list.reading-grid, .film-list.film-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.09rem; margin-top: 0.1rem; }
.carousel-nav { position: absolute; z-index: 4; top: 50%; width: 0.22rem; height: 0.28rem; display: grid; place-items: center; border: 0.01rem solid var(--line-strong); border-radius: 0.08rem; background: var(--surface); color: var(--ink); font-size: 0.15rem; line-height: 1; transform: translateY(-50%); box-shadow: var(--shadow-sm); }
.carousel-nav:hover { border-color: var(--g); color: var(--g); }
.carousel-prev { left: 0.02rem; }
.carousel-next { right: 0.02rem; }
.book-item, .film-item { min-width: 0; border: 0.01rem solid var(--line); border-radius: 0.11rem; background: var(--surface-muted); }
.book-item { display: grid; grid-template-columns: 0.42rem 1fr; gap: 0.1rem; padding: 0.09rem; align-items: center; }
.cover, .book-cover { width: 0.42rem; height: 0.56rem; border-radius: 0.06rem; border: 0.01rem solid var(--line); object-fit: cover; background: linear-gradient(145deg, var(--g-soft), var(--b-soft)); }
.cover.violet { background: linear-gradient(145deg, var(--p-soft), var(--a-soft)); }
.cover.amber { background: linear-gradient(145deg, var(--a-soft), var(--g-soft)); }
.book-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.08rem; }
.book-title-row b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 0.125rem; }
.book-title-row .row-action { padding: 0.03rem 0.07rem; font-size: 0.1rem; white-space: nowrap; }
.book-meta { display: flex; flex-wrap: wrap; gap: 0.06rem; margin-top: 0.04rem; color: var(--muted); font-size: 0.1rem; }
.book-date-meta { display: flex; flex-wrap: wrap; gap: 0.08rem; margin-top: 0.05rem; color: var(--muted); font-size: 0.1rem; }
.track { height: 0.04rem; margin-top: 0.06rem; border-radius: 9.99rem; background: var(--line); overflow: hidden; }
.track span { display: block; height: 100%; background: var(--g); }
.item-title { display: flex; justify-content: space-between; gap: 0.08rem; align-items: baseline; min-width: 0; color: var(--ink); font-weight: 700; font-size: 0.13rem; }
.item-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-title small { color: var(--muted); font-size: 0.11rem; font-weight: 400; white-space: nowrap; }
.film-item > div { min-width: 0; }
.film-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.11rem; font-weight: 400; margin-top: 0.02rem; }
.row-action { justify-self: end; min-width: 0.6rem; padding: 0.04rem 0.08rem; border: 0.01rem solid var(--line-strong); border-radius: 0.07rem; background: var(--surface); color: var(--g); font-size: 0.11rem; font-weight: 600; }
.row-action:hover { border-color: var(--g); background: var(--g-soft); }
.film-list.film-grid .film-item { display: grid; grid-template-columns: 0.6rem minmax(0, 1fr); gap: 0.08rem; align-items: center; min-height: 0.82rem; padding: 0.09rem; }
.poster { position: relative; overflow: hidden; width: 0.6rem; height: 0.46rem; border-radius: 0.07rem; border: 0.01rem solid var(--line); background: linear-gradient(145deg, var(--b-soft), var(--p-soft)); }
.film-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.08rem; margin-top: 0.07rem; }
.status { justify-self: end; padding: 0.025rem 0.075rem; border-radius: 9.99rem; background: var(--surface); border: 0.01rem solid var(--line); color: var(--muted); font-size: 0.105rem; white-space: nowrap; }
.status.done { border-color: var(--g); background: var(--g-soft); color: var(--g); font-weight: 600; }
.growth-pipeline { margin-top: 0.14rem; }
.progress-rail { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.08rem; align-items: start; margin-top: 0.14rem; }
.progress-rail:before { content: ""; position: absolute; left: 8%; right: 8%; top: 0.09rem; height: 0.02rem; background: var(--line); }
.progress-step { position: relative; display: grid; justify-items: stretch; text-align: left; gap: 0.07rem; min-width: 0; color: var(--muted); font-size: 0.11rem; }
.progress-dot { z-index: 1; justify-self: center; width: 0.18rem; height: 0.18rem; display: grid; place-items: center; border: 0.015rem solid var(--g); border-radius: 50%; background: var(--surface); }
.progress-step.active .progress-dot:after { content: ""; width: 0.07rem; height: 0.07rem; border-radius: 50%; background: var(--g); }
.progress-step > b { text-align: center; color: var(--ink); font-size: 0.12rem; }
.progress-task-list { display: grid; gap: 0.06rem; min-width: 0; }
.task-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.07rem; align-items: center; min-height: 0.34rem; padding: 0.06rem 0.08rem; border: 0.01rem solid var(--line); border-radius: 0.08rem; background: var(--surface-muted); color: var(--ink-2); font-size: 0.115rem; }
.task-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .row-action { min-width: auto; padding: 0.03rem 0.07rem; font-size: 0.1rem; }
.empty-task { color: var(--dim); }
.growth-bottom { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.14rem; margin-top: 0.14rem; }
.note { padding: 0.08rem 0.1rem; border-radius: 0.09rem; background: var(--surface-muted); font-size: 0.12rem; color: var(--ink); }
.asset { display: block; color: var(--g); word-break: break-all; text-decoration: none; font-size: 0.115rem; }
.asset-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.08rem; align-items: center; padding: 0.09rem 0.1rem; border: 0.01rem solid var(--line); border-radius: 0.09rem; background: var(--surface-muted); }
.asset-card-main { min-width: 0; display: grid; gap: 0.03rem; }
.asset-card-head { display: flex; align-items: center; gap: 0.06rem; min-width: 0; }
.asset-card-head b { font-size: 0.12rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-card a { color: var(--g); font-size: 0.11rem; word-break: break-all; text-decoration: none; }
.review-row { display: flex; align-items: center; justify-content: space-between; gap: 0.1rem; padding: 0.08rem 0.1rem; border-radius: 0.09rem; background: var(--surface-muted); font-size: 0.12rem; }
.review-row b { margin-left: 0.07rem; font-weight: 500; color: var(--ink); }
.review-detail { display: grid; gap: 0.1rem; margin-top: 0.14rem; }
.review-detail small { color: var(--muted); }
.review-detail p { white-space: pre-line; color: var(--ink); line-height: 1.7; }
.note-history { display: grid; gap: 0.08rem; margin-top: 0.12rem; }
.note-history h3 { margin: 0; font-size: 0.13rem; color: var(--ink); }
.note-history-item { padding: 0.09rem 0.1rem; border: 0.01rem solid var(--line); border-radius: 0.09rem; background: var(--surface-muted); font-size: 0.12rem; color: var(--ink-2); }
.note-history-item small { display: block; margin-bottom: 0.03rem; color: var(--muted); }
.inbox-item { display: grid; gap: 0.06rem; padding: 0.09rem 0.1rem; border: 0.01rem solid var(--line); border-radius: 0.09rem; background: var(--surface-muted); font-size: 0.12rem; }
.inbox-item small { color: var(--muted); font-size: 0.1rem; }
.inbox-item p { margin: 0; white-space: pre-line; color: var(--ink); font-size: 0.115rem; line-height: 1.45; }
.inbox-actions { display: flex; flex-wrap: wrap; gap: 0.06rem; }
.inbox-actions .edit { padding: 0.03rem 0.08rem; font-size: 0.105rem; }
.carryover-bar { display: flex; justify-content: space-between; align-items: center; gap: 0.08rem; margin-top: 0.08rem; padding: 0.08rem 0.1rem; border: 0.01rem dashed var(--g); border-radius: 0.09rem; background: var(--g-soft); font-size: 0.115rem; color: var(--g); }

/* Dialogs & Settings */
.overlay { position: fixed; z-index: 30; inset: 0; display: none; align-items: center; justify-content: center; padding: 0.18rem; background: var(--overlay-bg); backdrop-filter: blur(0.06rem); }
.overlay.open { display: flex; }
.dialog { width: min(8.8rem, 100%); max-height: calc(100vh - 0.36rem); overflow: auto; padding: 0.22rem; border-radius: 0.18rem; background: var(--surface); border: 0.01rem solid var(--line); box-shadow: var(--shadow-md); }
.dialog.small { width: min(5rem, 100%); }
.dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.12rem; }
.dialog h2 { margin: 0; font-size: 0.18rem; font-weight: 700; color: var(--ink); }
.dialog p { margin: 0.04rem 0; color: var(--muted); font-size: 0.12rem; }
.tabs { display: flex; gap: 0.06rem; flex-wrap: wrap; margin: 0.14rem 0 0.12rem; }
.tabs button { border: 0.01rem solid var(--line); border-radius: 9.99rem; background: var(--surface-muted); padding: 0.06rem 0.12rem; color: var(--muted); font-size: 0.12rem; }
.tabs button.active { color: #ffffff; border-color: var(--g); background: var(--g); font-weight: 600; }
.setting-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.12rem; }
.setting-card { padding: 0.14rem; border: 0.01rem solid var(--line); border-radius: 0.12rem; background: var(--surface-muted); }
.setting-card h3 { margin: 0; font-size: 0.14rem; color: var(--ink); }
.setting-card label, .field-label { display: block; margin-top: 0.09rem; color: var(--muted); font-size: 0.115rem; font-weight: 500; }
.field {
  width: 100%;
  margin-top: 0.04rem;
  padding: 0.08rem 0.1rem;
  border: 0.01rem solid var(--line-strong);
  border-radius: 0.08rem;
  background: var(--input-bg);
  color: var(--ink);
  font-family: var(--sans);
}
.field:focus { border-color: var(--g); outline: none; }
select.field { color-scheme: dark; }
.row { display: flex; gap: 0.08rem; align-items: end; }
.row > * { flex: 1; }
.setting-line { display: flex; justify-content: space-between; gap: 0.08rem; align-items: center; padding: 0.07rem 0; border-bottom: 0.01rem solid var(--line); font-size: 0.12rem; color: var(--ink); }
.radio-row { display: flex; gap: 0.14rem; margin-top: 0.08rem; font-size: 0.125rem; color: var(--ink); }
.priority-editor { margin-top: 0.12rem; padding: 0.12rem; border: 0.01rem solid var(--line); border-radius: 0.11rem; background: var(--surface-muted); }
.priority-editor h3 { margin: 0; color: var(--g); font-size: 0.13rem; }
.priority-editor .row { align-items: start; }
.finance-settings-table { display: grid; gap: 0.08rem; margin-top: 0.1rem; }
.finance-settings-row { display: grid; grid-template-columns: 1.1fr repeat(3, 1fr) auto; gap: 0.08rem; align-items: end; }
.finance-settings-row.snapshot { grid-template-columns: 1fr repeat(2, 1fr) auto; }
.finance-settings-row label { margin-top: 0; }
.setting-card-head { display: flex; justify-content: space-between; align-items: center; gap: 0.08rem; }
.backup-actions { display: flex; flex-wrap: wrap; gap: 0.08rem; margin-top: 0.12rem; }

/* Toast Notice */
#captainNotice {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 0.32rem;
  transform: translate(-50%, 0.1rem);
  opacity: 0;
  pointer-events: none;
  padding: 0.09rem 0.16rem;
  border-radius: 9.99rem;
  background: var(--nav-active-bg);
  color: var(--nav-active-ink);
  box-shadow: var(--shadow-md);
  font-size: 0.125rem;
  transition: opacity .18s, transform .18s;
}
#captainNotice.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive Breakpoints */
@media (max-width: 1150px) {
  .layout > .side:first-child { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side.right { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .finance-kpi-grid { grid-template-columns: 1fr 1fr; }
  .growth-bottom { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .app { max-width: 100%; padding: 0.12rem 0.12rem 0.84rem; }
  .header { display: flex; flex-direction: column; gap: 0.08rem; align-items: stretch; padding: 0.12rem; }
  .head-actions { justify-content: flex-start; }
  .layout, .layout.focus-view, .layout > .side:first-child, .side.right { grid-template-columns: minmax(0, 1fr); gap: 0.12rem; }
  .daily-top, .daily-bottom, .life-manifesto.life-inline, .life-goals, .growth-media-grid, .growth-bottom, .finance-kpi-grid, .finance-accounting-grid, .finance-category-pie, .setting-grid { grid-template-columns: minmax(0, 1fr); }
  .todo-full .todo-list { grid-template-rows: none; grid-auto-flow: row; grid-auto-columns: auto; column-gap: 0; overflow: visible; }
  .habit-card-grid { grid-template-columns: repeat(auto-fit, minmax(1.45rem, 1fr)); }
  .diet-board { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .finance-settings-row, .finance-settings-row.snapshot { grid-template-columns: minmax(0, 1fr); }
  .finance-bill-chart { overflow-x: auto; }
  .finance-bill-bar { min-width: 0.18rem; }
  .book-list.reading-grid, .film-list.film-grid { grid-template-columns: minmax(0, 1fr); }
  .overlay { padding: 0.12rem; }
  .dialog { width: 100%; max-width: calc(100vw - 0.24rem); padding: 0.16rem; }
  .row { display: grid; grid-template-columns: minmax(0, 1fr); }
  .health-workspace.no-view-head { height: auto; overflow: visible; }
}

@media (max-width: 760px) {
  .nav {
    position: fixed;
    z-index: 15;
    left: 0.12rem;
    right: 0.12rem;
    bottom: 0.12rem;
    justify-content: space-around;
    background: var(--surface);
    box-shadow: var(--shadow-md);
  }
  .nav button { min-width: 0.56rem; padding: 0.08rem 0.1rem; }
  .health-kpis { display: none; }
  .finance-debt-chart { height: 2.8rem; }
  .progress-rail { grid-template-columns: 1fr; gap: 0.06rem; }
  .progress-rail:before { display: none; }
  .progress-step { grid-template-columns: 0.34rem 1fr; justify-items: start; text-align: left; }
  .priority-editor .row { grid-template-columns: minmax(0, 1fr); }
}
