:root {
  color-scheme: dark;
  --bg: #0b0d0e;
  --bg-elevated: #111416;
  --surface: #15191b;
  --surface-strong: #1b2023;
  --surface-soft: #242a2d;
  --ink: #f2f5f3;
  --muted: #8c9792;
  --line: #293033;
  --line-strong: #414b4e;
  --gold: #c9ff63;
  --gold-soft: #27351b;
  --emerald: #42d6a4;
  --emerald-soft: #143a2f;
  --red: #ff6b63;
  --red-soft: #472321;
  --blue: #59b7ff;
  --violet: #a88cff;
  --orange: #ff9a5c;
  --shadow: 0 18px 50px rgba(0, 0, 0, .18);
  --nav-height: 76px;
}

html[data-mode="light"] {
  color-scheme: light;
  --bg: #f2f5f3;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-strong: #edf1ef;
  --surface-soft: #e1e7e4;
  --ink: #141817;
  --muted: #68716e;
  --line: #d7dfdb;
  --line-strong: #9da8a3;
  --gold-soft: #e2f4c5;
  --emerald-soft: #dcefe8;
  --red-soft: #f7dedd;
  --shadow: 0 14px 34px rgba(47, 43, 33, .09);
}

html[data-theme="moss"] { --gold: #98f58a; --emerald: #4bd5a0; --blue: #6bbbc4; }
html[data-theme="voyage"] { --gold: #6fe7ff; --emerald: #4bd7c6; --blue: #61a9ff; --violet: #a695ff; }
html[data-theme="crimson"] { --gold: #ffad5c; --emerald: #55d39e; --red: #ff6b63; --orange: #ff8a58; }
html[data-theme="aurora"] { --gold: #ddff6b; --emerald: #4ce6be; --blue: #70c8ff; --violet: #c59bff; }

* { box-sizing: border-box; }
html { min-height: 100%; max-width: 100%; overflow-x: hidden; background: var(--bg); }
html, body { -webkit-text-size-adjust: 100%; }
body {
  max-width: 100%;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  transition: background-color .2s ease, color .2s ease;
}
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
svg { display: block; }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.small { width: 16px; height: 16px; }

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--ink);
  opacity: 1;
  visibility: visible;
  transition: opacity .24s ease, visibility 0s linear .24s;
}
.startup-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.startup-content {
  display: grid;
  justify-items: center;
  text-align: center;
}
.startup-icon {
  width: 112px;
  height: 112px;
  display: block;
  border-radius: 25%;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14);
}
.startup-wordmark {
  margin-top: 18px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}
.startup-name {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
}
@media (prefers-reduced-motion: reduce) {
  .startup-screen { transition: none; }
}

#app-shell { min-height: 100vh; padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom)); }
.topbar {
  height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 13, 14, .92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
html[data-mode="light"] .topbar { background: rgba(242, 245, 243, .92); }
.brand {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  padding: 4px 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.brand-glyph {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  font: 750 9px/1 ui-monospace, monospace;
}
.brand strong, .brand small { display: block; line-height: 1.1; }
.brand strong { font-size: 12px; color: var(--gold); }
.brand small { max-width: 160px; margin-top: 3px; color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-button {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: var(--surface); color: var(--ink); }
.back-button[hidden] { display: block; visibility: hidden; pointer-events: none; }

.view { width: min(760px, 100%); min-height: calc(100vh - 60px); margin: 0 auto; padding: 22px 16px 36px; }
.route-map .view { width: min(900px, 100%); background-image: url("assets/map-contours.svg"); background-position: center top; background-size: 640px auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 2px 0 24px; }
.page-head h1 { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 760; }
.page-head p { margin: 7px 0 0; color: var(--muted); font-size: 13px; }
.section { margin: 30px 0; }
.section:first-child { margin-top: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 730; }
.section-head .meta { color: var(--muted); font-size: 12px; }
.eyebrow { margin: 0 0 5px; color: var(--gold); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.muted { color: var(--muted); }
.danger-text { color: var(--red); }
.success-text { color: var(--emerald); }
.empty { padding: 36px 12px; color: var(--muted); text-align: center; font-size: 13px; }
.empty .icon { width: 28px; height: 28px; margin: 0 auto 10px; color: var(--line-strong); }

.primary-button, .secondary-button, .danger-button, .text-button {
  min-height: 40px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 720;
}
.primary-button { border: 1px solid var(--gold); background: var(--gold); color: #17140d; }
.primary-button:hover { filter: brightness(1.06); }
.secondary-button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.secondary-button:hover { border-color: var(--line-strong); background: var(--surface-strong); }
.danger-button { border: 1px solid var(--red); background: transparent; color: var(--red); }
.text-button { min-height: 32px; padding: 5px 2px; border: 0; background: transparent; color: var(--gold); }
.small-button { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.button-row > * { flex: 1; }
.button-row > .data-refresh-button { flex-basis: 100%; }
.readable-export-row { margin-top: 9px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.role-banner {
  position: relative;
  min-height: 166px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 20, 22, .94);
  box-shadow: none;
  overflow: hidden;
}
html[data-mode="light"] .role-banner { background: rgba(255, 255, 255, .94); }
.role-banner::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 1px;
  right: 18px;
  top: 17px;
  border: 0;
  background: var(--line);
  pointer-events: none;
}
.role-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.role-line h1 { margin: 2px 0 0; font-size: 26px; }
.title-chip { color: var(--gold); font-size: 12px; font-weight: 720; }
.level-seal {
  width: 70px;
  height: 42px;
  border: 0;
  border-radius: 5px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--gold);
  color: #10150c;
}
.level-seal span { font: 780 14px/1 ui-monospace, monospace; }
.xp-track { height: 8px; margin-top: 22px; background: var(--surface-soft); overflow: hidden; }
.xp-track > i { display: block; width: 0; height: 100%; background: var(--gold); transition: width .5s ease; }
.xp-meta { display: flex; justify-content: space-between; margin-top: 7px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.hero-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 14px; background: var(--line); border: 1px solid var(--line); }
.hero-metrics > div { min-width: 0; padding: 12px; background: var(--bg-elevated); }
.hero-metrics strong { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.hero-metrics span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }

.map-intro { margin-bottom: 22px; }
.map-intro h2 { margin: 0; font-size: 17px; }
.map-intro p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.map-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; position: relative; }
.map-node {
  --system: var(--gold);
  min-height: 144px;
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--system) 46%, var(--line));
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: rgba(17, 20, 22, .94);
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}
html[data-mode="light"] .map-node { background: rgba(255, 255, 255, .93); }
.map-node::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--system); }
.map-node:hover { border-color: var(--system); transform: translateY(-2px); }
.map-node:active { transform: translateY(0); }
.map-node .node-top { display: flex; justify-content: space-between; align-items: flex-start; }
.map-node .node-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 6px; background: color-mix(in srgb, var(--system) 14%, transparent); color: var(--system); }
.map-node .node-index { color: var(--muted); font: 11px ui-monospace, monospace; }
.map-node h3 { margin: 20px 0 3px; font-size: 17px; }
.map-node p { max-width: 100%; margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-node[data-system="goal"] { --system: var(--blue); }
.map-node[data-system="time"] { --system: var(--emerald); }
.map-node[data-system="notes"] { --system: var(--orange); }
.map-node[data-system="action"] { --system: var(--violet); }
.map-node[data-system="habits"] { --system: #45d4c5; }
.map-node[data-system="energy"] { --system: var(--red); }
.map-node[data-system="journal"] { --system: #6c96d1; }
.map-node[data-system="assets"] { --system: var(--gold); }

.list { display: grid; gap: 9px; }
.item-row {
  min-height: 62px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: var(--surface);
}
.item-row.clickable { width: 100%; color: var(--ink); text-align: left; }
.item-row.clickable:hover { border-color: var(--line-strong); }
.item-main { min-width: 0; flex: 1; }
.item-main strong { display: block; overflow-wrap: anywhere; }
.item-main small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.item-actions { display: flex; align-items: center; gap: 3px; }
.item-actions .icon-button { width: 34px; height: 34px; }
.status-mark {
  width: 25px;
  height: 25px;
  flex: none;
  border: 1px solid currentColor;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--red);
}
.todo-row { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.todo-row .item-main strong { color: var(--orange); }
.todo-row.is-future .item-main strong { color: var(--blue); }
.todo-row.is-overdue .item-main strong { color: var(--red); }
.todo-row.done { border-color: color-mix(in srgb, var(--emerald) 45%, var(--line)); opacity: .83; }
.todo-row.done .status-mark { background: var(--emerald); border-color: var(--emerald); color: #081d17; }
.todo-row.done .item-main strong { color: var(--emerald); text-decoration: line-through; }
.todo-row.overdue { border-left: 3px solid var(--red); }
.todo-row.archived { opacity: .55; }
.todo-row .danger-icon { color: var(--red); }
.habit-row { border-left: 3px solid color-mix(in srgb, var(--red) 65%, var(--line)); }
.habit-row .item-main strong { color: var(--red); }
.habit-row.done { border-left-color: var(--emerald); background: var(--emerald-soft); }
.habit-row.done .status-mark { background: var(--emerald); border-color: var(--emerald); color: #081d17; }
.habit-row.done .item-main strong { color: var(--emerald); }
.habit-row.done .habit-streak { color: var(--emerald); }
.habit-row:not(.done) .habit-streak { color: var(--red); }
.todo-row .item-actions .icon-button.todo-delete-button { width: auto; min-width: 52px; padding: 0 8px; gap: 4px; border-color: color-mix(in srgb, var(--red) 24%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--surface)); font-size: 11px; }
.todo-delete-button .icon { width: 16px; height: 16px; }
.source-badge, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
}
.tag.active { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.tag-row { display: flex; flex-wrap: wrap; gap: 7px; }

.goal-item { padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); background: var(--surface); }
.goal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.goal-top h3 { margin: 0; font-size: 16px; }
.goal-top p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.progress-track { height: 6px; margin-top: 13px; background: var(--surface-soft); overflow: hidden; }
.progress-track i { display: block; height: 100%; background: var(--blue); }
.stage-list { display: grid; gap: 11px; }
.stage-card { overflow: hidden; border-left: 2px solid var(--blue); background: var(--surface); }
.stage-row { min-height: 76px; padding: 12px 13px; display: flex; align-items: center; gap: 10px; }
.stage-main { min-width: 0; padding: 0; flex: 1; border: 0; background: transparent; color: var(--ink); text-align: left; }
.stage-main strong, .stage-main small { display: block; }
.stage-main strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.stage-main small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.stage-chevron { transition: transform .2s ease; }
.stage-card.expanded .stage-chevron { transform: rotate(90deg); }
.stage-progress { height: 3px; margin: 0 14px; overflow: hidden; background: var(--surface-soft); }
.stage-progress i { display: block; height: 100%; background: var(--emerald); }
.stage-expanded { padding: 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.stage-criterion { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.stage-criterion span, .stage-criterion strong { display: block; }
.stage-criterion span { color: var(--muted); font-size: 10px; }
.stage-criterion strong { margin-top: 2px; font-size: 13px; }
.stage-records { display: flex; flex-wrap: wrap; gap: 6px; margin: -3px 0 12px; }
.stage-records span { padding: 5px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 9px; }
.stage-todo-list { display: grid; gap: 7px; }
.stage-todo-row { min-height: 62px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; border-radius: 14px; background: var(--surface); }
.stage-todo-row.done { opacity: .7; }
.stage-todo-row.done .item-main strong { color: var(--emerald); text-decoration: line-through; }
.stage-todo-row .item-actions { gap: 2px; }
.stage-todo-row .icon-button { width: 30px; height: 30px; }
.stage-add-action { width: 100%; margin-top: 10px; }
.stage-standard-fields[hidden] { display: none; }

.calendar-shell { border: 1px solid var(--line); background: var(--surface); }
.calendar-toolbar { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 9px; border-bottom: 1px solid var(--line); }
.calendar-toolbar strong { text-align: center; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: 8px 0; color: var(--muted); font-size: 10px; text-align: center; }
.calendar-day {
  min-width: 0;
  aspect-ratio: 1 / 1;
  border: 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: transparent;
  color: var(--ink);
  font-size: 12px;
}
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { color: var(--line-strong); }
.calendar-day.selected { background: var(--gold-soft); color: var(--gold); font-weight: 750; }
.calendar-day.today span:first-child { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; }
.day-dots { height: 5px; display: flex; gap: 2px; }
.day-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--emerald); }
.day-dots i.mood { background: var(--violet); }
.timeline { display: grid; gap: 0; }
.timeline-item { min-height: 70px; display: grid; grid-template-columns: 62px 1fr 34px; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.timeline-item:last-child { border-bottom: 0; }
.timeline-time { color: var(--gold); font-size: 11px; font-variant-numeric: tabular-nums; }

.habit-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 11px; }
.habit-day { min-height: 30px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--muted); font-size: 10px; }
.habit-day.on { border-color: var(--emerald); background: var(--emerald-soft); color: var(--emerald); }
.habit-streak { color: var(--gold); font-size: 12px; font-variant-numeric: tabular-nums; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.metric {
  min-height: 94px;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
button.metric { color: var(--ink); text-align: left; }
.metric .icon { color: var(--gold); }
.metric strong { display: block; margin-top: 11px; font-size: 21px; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.energy-bars { height: 120px; display: flex; align-items: end; gap: 7px; border-bottom: 1px solid var(--line); }
.energy-bar { min-width: 0; flex: 1; height: calc(var(--score, 0) * 1%); min-height: 2px; position: relative; background: var(--emerald); }
.energy-chart { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; align-items: stretch; }
.energy-y-axis { height: 120px; padding: 0 0 21px; display: flex; flex-direction: column; justify-content: space-between; color: var(--muted); font-size: 9px; line-height: 1; text-align: right; }
.energy-plot { min-width: 0; position: relative; }
.energy-grid-lines { position: absolute; inset: 0 0 21px; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.energy-grid-lines i { height: 1px; background: var(--line); }
.energy-value { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1; }
.energy-chart-unit { grid-column: 2; margin: 7px 0 0; color: var(--muted); font-size: 10px; text-align: right; }
.energy-bar small { position: absolute; top: calc(100% + 5px); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: 9px; }
.energy-bar small:empty { display: none; }
.energy-trend-summary { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.energy-range-control { max-width: 210px; margin: 0 0 10px auto; }
.energy-bars.range-month { gap: 3px; padding-right: 12px; padding-left: 12px; }
.energy-bars.range-month .energy-bar small { font-size: 8px; }
.energy-bars.range-month .energy-value { display: none; }
.timer-display { padding: 22px 0; color: var(--gold); font: 600 46px/1 ui-monospace, monospace; text-align: center; font-variant-numeric: tabular-nums; }
.timer-picker { display: grid; gap: 14px; margin-top: 14px; }
.timer-range { display: grid; grid-template-columns: 52px minmax(0, 1fr) 38px; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.timer-range input[type="range"] { width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; box-shadow: none; accent-color: var(--gold); }
.timer-range output { color: var(--ink); font-variant-numeric: tabular-nums; text-align: right; }
.timer-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.exercise-start-button { width: 100%; }
.exercise-record-list { margin-top: 10px; }
.exercise-timer-card { padding: 18px; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.exercise-timer-head { display: flex; align-items: center; gap: 11px; }
.exercise-timer-head > span { width: 42px; height: 42px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.exercise-timer-head strong, .exercise-timer-head small { display: block; }
.exercise-timer-head small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.exercise-timer-value { display: block; margin-top: 24px; font: 650 46px/1 ui-monospace, monospace; font-variant-numeric: tabular-nums; text-align: center; }
.exercise-timer-label { display: block; margin-top: 7px; color: var(--muted); font-size: 11px; text-align: center; }
.exercise-timer-actions { margin-top: 22px; }
.exercise-mode-grid { margin-top: 2px; }

.segmented { display: flex; gap: 3px; padding: 3px; background: var(--surface-strong); }
.segmented button { min-height: 35px; flex: 1; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.segmented button.active { background: var(--surface); color: var(--gold); box-shadow: 0 2px 7px rgba(0, 0, 0, .12); }
.search-box { position: relative; }
.search-box .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 40px; }
.note-item { padding: 15px; border-left: 2px solid var(--orange); background: var(--surface); }
.note-item p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 11px; }
.journal-preview { color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mood-row { display: flex; flex-wrap: wrap; gap: 7px; }
.mood-slider { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; touch-action: pan-x; }
.mood-slider::-webkit-scrollbar { display: none; }
.mood-slider .mood { flex: 0 0 auto; }
.mood { border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; background: transparent; color: var(--muted); font-size: 12px; }
.mood.selected { border-color: var(--violet); color: var(--ink); background: color-mix(in srgb, var(--violet) 20%, transparent); }

.asset-section { border-top: 1px solid var(--line); padding-top: 18px; }
.asset-section:first-of-type { border-top: 0; padding-top: 0; }
.anniversary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.anniversary-card { min-height: 132px; padding: 15px; border: 1px solid var(--gold-soft); background: var(--surface); position: relative; }
.anniversary-card strong { display: block; padding-right: 70px; overflow-wrap: anywhere; }
.anniversary-card .days { margin: 17px 0 2px; color: var(--gold); font-size: 27px; font-weight: 780; font-variant-numeric: tabular-nums; }
.anniversary-card small { color: var(--muted); font-size: 10px; }
.anniversary-card > .item-actions { position: absolute; top: 7px; right: 7px; }
.anniversary-card .icon-button { width: 32px; height: 32px; }

.achievement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.achievement { min-height: 105px; padding: 12px 8px; border: 1px solid var(--line); text-align: center; background: var(--surface); }
.achievement .badge-icon { width: 36px; height: 36px; margin: 0 auto 9px; display: grid; place-items: center; border: 1px solid var(--line-strong); transform: rotate(45deg); color: var(--muted); }
.achievement .badge-icon .icon { transform: rotate(-45deg); }
.achievement strong { display: block; font-size: 11px; }
.achievement small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.achievement.unlocked { border-color: var(--gold-soft); }
.achievement.unlocked .badge-icon { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.theme-choice { min-height: 70px; padding: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: left; }
.theme-choice.active { border-color: var(--gold); }
.theme-choice[disabled] { cursor: not-allowed; opacity: .48; }
.swatches { display: flex; gap: 4px; margin-top: 9px; }
.swatches i { width: 18px; height: 6px; background: var(--swatch); }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { color: var(--muted); font-size: 11px; font-weight: 650; }
input, textarea, select {
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}
textarea { min-height: 112px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; accent-color: var(--gold); }
input[type="range"] { padding: 0; accent-color: var(--gold); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.check-option { min-height: 40px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 11px; }
.check-option:has(input:checked) { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.form-actions { display: flex; gap: 8px; padding-top: 4px; }
.form-actions > * { flex: 1; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; background: rgba(4, 6, 7, .68); }
.sheet {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  margin: 0 auto;
  padding: 17px 17px calc(24px + env(safe-area-inset-bottom));
  overflow: auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg-elevated);
  box-shadow: var(--shadow);
}
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 16px; border-radius: 99px; background: var(--line-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.sheet-head .icon-button { background: var(--surface); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 18px + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.level-up {
  position: fixed;
  left: 50%;
  top: 22%;
  z-index: 90;
  width: min(330px, calc(100vw - 36px));
  padding: 24px;
  border: 1px solid var(--gold);
  background: var(--bg-elevated);
  color: var(--ink);
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px) scale(.96);
  transition: opacity .25s ease, transform .25s ease;
}
.level-up.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.level-up strong { display: block; color: var(--gold); font-size: 24px; }
.level-up span { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }

.tabbar {
  height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  padding: 7px 16px env(safe-area-inset-bottom);
  position: fixed;
  inset: auto 0 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  background: rgba(11, 13, 14, .95);
  backdrop-filter: blur(18px);
}
html[data-mode="light"] .tabbar { background: rgba(250, 248, 242, .95); }
.tab { min-width: 0; border: 0; border-radius: 0; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; color: var(--muted); }
.tab small { font-size: 10px; }
.tab.active { color: var(--gold); background: transparent; }
.tab.active::before { content: ""; position: absolute; top: 0; left: 34%; right: 34%; height: 2px; background: var(--gold); }

@media (min-width: 860px) {
  #app-shell { padding-bottom: 0; padding-left: 92px; }
  .topbar { grid-template-columns: 40px 1fr 40px; padding-left: max(20px, calc((100vw - 980px) / 2)); padding-right: max(20px, calc((100vw - 980px) / 2)); }
  .tabbar { width: 92px; height: 100vh; padding: calc(76px + env(safe-area-inset-top)) 10px 20px; inset: 0 auto 0 0; grid-template-columns: 1fr; grid-template-rows: repeat(5, 68px); align-content: start; border-top: 0; border-right: 1px solid var(--line); }
  .toast { bottom: 26px; }
  .view { padding-top: 34px; }
  .map-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .map-node { min-height: 185px; }
  .metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .anniversary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .achievement-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 390px) {
  .view { padding-left: 13px; padding-right: 13px; }
  .map-grid { gap: 9px; }
  .map-node { min-height: 138px; padding: 14px; }
  .map-node h3 { margin-top: 18px; font-size: 16px; }
  .hero-metrics > div { padding: 10px 7px; }
  .hero-metrics strong { font-size: 17px; }
  .form-grid { grid-template-columns: 1fr; }
  .anniversary-grid { grid-template-columns: 1fr; }
  .achievement-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-day { font-size: 11px; }
}

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

/* iOS-style modern surface language */
html[data-mode="light"] {
  --bg: #f2f2f2;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-strong: #f3f3f3;
  --surface-soft: #e9e9e9;
  --ink: #111111;
  --muted: #8a8a8a;
  --line: #e7e7e7;
  --line-strong: #cecece;
  --gold: #1bb98a;
  --gold-soft: #e6f8f2;
  --emerald: #1bb98a;
  --emerald-soft: #e6f8f2;
  --red: #f15353;
  --red-soft: #fff0f0;
  --blue: #448cff;
  --violet: #8c6be8;
  --orange: #f08a45;
  --shadow: 0 13px 34px rgba(20, 20, 20, .065);
}
html[data-mode="light"][data-theme="moss"] { --gold: #49a860; --gold-soft: #e9f6ec; }
html[data-mode="light"][data-theme="voyage"] { --gold: #268db5; --gold-soft: #e4f4fa; }
html[data-mode="light"][data-theme="crimson"] { --gold: #e57943; --gold-soft: #fff0e8; }
html[data-mode="light"][data-theme="aurora"] { --gold: #7559cf; --gold-soft: #f0ebff; }

body { background: var(--bg); }
.route-map .topbar { display: none; }
.route-map .view { width: min(780px, 100%); padding-top: max(24px, env(safe-area-inset-top)); background-image: none; }
.home-toolbar { height: 58px; display: flex; align-items: center; justify-content: space-between; }
.floating-control {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.floating-control .icon { width: 22px; height: 22px; }
.home-heading { margin: 29px 2px 31px; }
.home-heading p { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.home-heading h1 { margin: 0; font-size: 42px; line-height: 1.08; font-weight: 800; }
.home-heading > span { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }

.topbar {
  height: calc(86px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 18px 0;
  grid-template-columns: 52px 1fr 52px;
  border-bottom: 0;
  background: rgba(242, 242, 242, .88);
}
html[data-mode="dark"] .topbar { background: rgba(16, 18, 19, .9); }
.topbar .icon-button { width: 50px; height: 50px; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.brand { padding: 4px; }
.brand-glyph, .brand strong { display: none; }
.brand small { max-width: 230px; margin: 0; color: var(--ink); font-size: 18px; font-weight: 760; }
.view { width: min(760px, 100%); padding: 28px 18px 120px; }
.page-head { margin: 6px 2px 30px; align-items: center; }
.page-head h1 { font-size: 36px; font-weight: 800; }
.page-head p { margin-top: 6px; font-size: 12px; }
.eyebrow { color: var(--muted); font-size: 10px; }
.section { margin: 32px 0; }
.section-head { margin: 0 3px 13px; }
.section-head h2 { font-size: 19px; font-weight: 780; }
.section-head .meta { font-size: 12px; }

.primary-button, .secondary-button, .danger-button, .text-button { border-radius: 14px; }
.primary-button { min-height: 46px; border: 0; background: var(--ink); color: var(--surface); box-shadow: 0 8px 20px rgba(0, 0, 0, .1); }
html[data-mode="dark"] .primary-button { color: var(--bg); }
.secondary-button { min-height: 46px; border: 0; background: var(--surface); box-shadow: var(--shadow); }
.danger-button { min-height: 44px; border-color: transparent; background: var(--red-soft); }
.text-button { color: var(--ink); }

.role-banner {
  min-height: 0;
  padding: 24px 22px 20px;
  border: 0;
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
html[data-mode="light"] .role-banner { background: var(--surface); }
.role-banner::after { display: none; }
.role-line { align-items: flex-start; }
.role-line .card-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.role-line h1 { margin: 0; font-size: 38px; line-height: 1; }
.role-line h1 small { margin-left: 9px; color: var(--muted); font-size: 13px; font-weight: 560; }
.trend-chip { padding: 7px 11px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 12px; font-weight: 750; }
.title-chip { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); }
.level-seal { width: auto; min-width: 126px; height: 42px; padding: 0 14px; border-radius: 14px; background: var(--gold-soft); color: var(--gold); white-space: nowrap; }
.xp-track { height: 7px; margin-top: 24px; border-radius: 99px; background: var(--surface-soft); }
.xp-track > i { border-radius: inherit; background: var(--gold); }
.xp-meta { margin-top: 8px; }
.hero-metrics { gap: 0; margin-top: 19px; border: 0; border-top: 1px solid var(--line); background: transparent; }
.hero-metrics > div { padding: 17px 11px 5px; background: transparent; }
.hero-metrics > div + div { border-left: 1px solid var(--line); }
.hero-metrics strong { font-size: 21px; }

.map-grid { gap: 12px; }
.map-node {
  min-height: 154px;
  padding: 17px;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
html[data-mode="light"] .map-node { background: var(--surface); }
.map-node::before { display: none; }
.map-node:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(20, 20, 20, .09); }
.map-node .node-icon { width: 43px; height: 43px; border-radius: 13px; background: color-mix(in srgb, var(--system) 12%, var(--surface)); }
.map-node .node-index { color: #b5b5b5; }
.map-node h3 { margin: 22px 0 3px; color: var(--ink); font-size: 20px; }
.map-node p { padding-right: 22px; }
.map-node .node-arrow { position: absolute; right: 15px; bottom: 15px; color: #b2b2b2; }

.item-row, .goal-item, .note-item {
  min-height: 74px;
  padding: 14px 15px;
  border: 0;
  border-radius: 19px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.item-row.clickable:hover { border-color: transparent; background: var(--surface); }
.item-main strong { font-size: 15px; }
.status-mark { background: var(--red-soft); }
.todo-row, .todo-row.done, .todo-row.overdue { border: 0; }
.todo-row.overdue { box-shadow: inset 3px 0 var(--red), var(--shadow); }
.todo-row.done .status-mark { background: var(--emerald); }
.tag, .source-badge { min-height: 24px; border: 0; background: var(--surface-strong); }
.tag.active { border: 0; background: var(--gold-soft); }
.goal-item { border-left: 0; }
.stage-card { border-left: 0; border-radius: 19px; box-shadow: var(--shadow); }
.progress-track { border-radius: 99px; }
.progress-track i { border-radius: 99px; }

.calendar-shell { overflow: hidden; border: 0; border-radius: 25px; background: var(--surface); box-shadow: var(--shadow); }
.calendar-toolbar { min-height: 66px; padding: 8px 13px; border-bottom: 0; }
.calendar-toolbar .icon-button { border-radius: 50%; background: var(--surface-strong); }
.calendar-weekdays { padding: 0 10px; }
.calendar-grid { padding: 0 10px 13px; }
.calendar-day { border: 0; border-radius: 13px; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.selected { background: var(--surface-strong); color: var(--ink); }
.calendar-day.today span:first-child { border-color: var(--gold); }
.timeline-item { min-height: 78px; padding: 14px 5px; }

.metric-grid { gap: 11px; }
.metric { min-height: 106px; padding: 17px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.metric .icon { color: var(--ink); }
.energy-bars { height: 220px; padding: 24px 20px 29px; border: 0; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.energy-y-axis { height: 220px; padding: 24px 0 29px; }
.energy-plot { border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.energy-grid-lines { inset: 24px 20px 29px; }
.energy-chart-unit { margin-top: 7px; }
.energy-bar { border-radius: 99px; background: var(--ink); }
.timer-display { margin: 12px 0; padding: 27px 0; border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.segmented { padding: 4px; border-radius: 16px; background: var(--surface-soft); }
.segmented button { border-radius: 13px; }
.segmented button.active { border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search-box input { min-height: 52px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.note-item p { line-height: 1.65; }

.anniversary-grid { gap: 11px; }
.anniversary-card { min-height: 146px; padding: 17px; border: 0; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.anniversary-card .days { color: var(--ink); }
.achievement-grid { gap: 10px; }
.achievement { min-height: 112px; border: 0; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); }
.achievement .badge-icon { border: 0; border-radius: 13px; background: var(--surface-strong); transform: none; }
.achievement .badge-icon .icon { transform: none; }
.achievement.unlocked { border: 0; }
.achievement.unlocked .badge-icon { border: 0; background: var(--gold-soft); color: var(--gold); }
.theme-choice { min-height: 78px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.theme-choice.active { box-shadow: inset 0 0 0 2px var(--gold), var(--shadow); }

input, textarea, select { min-height: 48px; border: 0; border-radius: 14px; background: var(--surface-strong); }
.check-option { min-height: 44px; border: 0; border-radius: 13px; background: var(--surface-strong); }
.check-option:has(input:checked) { border: 0; background: var(--gold-soft); }
.mood { border: 0; background: var(--surface-strong); }
.sheet-backdrop { background: rgba(0, 0, 0, .28); backdrop-filter: blur(4px); }
.sheet { border: 0; border-radius: 28px 28px 0 0; background: var(--bg-elevated); }
.sheet-head .icon-button { border-radius: 50%; }
.toast { border: 0; border-radius: 14px; background: #171717; color: #fff; }

.tabbar {
  height: calc(82px + env(safe-area-inset-bottom));
  padding: 9px 20px env(safe-area-inset-bottom);
  border-top: 0;
  background: rgba(255, 255, 255, .93);
  box-shadow: 0 -8px 30px rgba(20, 20, 20, .07);
}
html[data-mode="dark"] .tabbar { background: rgba(21, 25, 27, .94); }
.tab { border-radius: 16px; }
.tab.active { color: var(--ink); }
.tab.active::before { display: none; }
.tab.active .icon { padding: 4px; border-radius: 8px; background: var(--gold-soft); color: var(--gold); }

@media (min-width: 860px) {
  #app-shell { padding-left: 0; padding-bottom: 108px; }
  .topbar { padding-left: max(24px, calc((100vw - 920px) / 2)); padding-right: max(24px, calc((100vw - 920px) / 2)); }
  .tabbar { width: 560px; height: 72px; padding: 8px 18px; inset: auto auto 22px 50%; transform: translateX(-50%); grid-template-columns: repeat(5, 1fr); grid-template-rows: 1fr; border: 0; border-radius: 24px; box-shadow: 0 14px 45px rgba(20, 20, 20, .16); }
  .view { width: min(900px, 100%); }
  .route-map .view { width: min(900px, 100%); }
  .map-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .map-node { min-height: 170px; }
  .toast { bottom: 112px; }
}

@media (max-width: 390px) {
  .home-heading h1 { font-size: 38px; }
  .role-banner { padding-left: 18px; padding-right: 18px; }
  .role-line h1 { font-size: 34px; }
  .map-node { min-height: 145px; padding: 15px; }
  .map-node h3 { margin-top: 18px; font-size: 18px; }
}

@media (max-width: 560px) {
  .anniversary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .today-health-grid { grid-template-columns: 1fr; }
  .trial-map { height: 220px; }
  .trial-map-caption { max-width: 72%; }
}

[hidden] { display: none !important; }
.home-heading h1 small { color: var(--muted); font-size: 19px; font-weight: 650; }
.chip-button { border: 0; }
.chip-button .icon { display: inline-block; width: 14px; height: 14px; margin-left: 3px; vertical-align: -2px; }
.level-seal { border: 0; }
.hero-metrics > button {
  min-width: 0;
  padding: 17px 11px 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.hero-metrics > button + button,
.hero-metrics > div + button,
.hero-metrics > button + div { border-left: 1px solid var(--line); }
.hero-metrics > button strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; }
.hero-metrics > button span { display: flex; align-items: center; gap: 4px; margin-top: 2px; color: var(--muted); font-size: 10px; }
.hero-metrics > button .icon { width: 12px; height: 12px; }
.metric.energy-summary {
  grid-column: 1 / -1;
  min-height: 118px;
  position: relative;
  color: var(--ink);
  text-align: left;
}
.energy-summary strong { font-size: 34px; }
.energy-summary strong small, .energy-guide-head strong small { margin-left: 2px; color: var(--muted); font-size: 14px; }
.energy-score-track { display: block; height: 7px; margin-top: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-soft); }
.energy-score-track b { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
.today-hero { margin: 0 0 26px; padding: 21px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.today-hero.is-complete { box-shadow: inset 0 0 0 2px var(--gold), var(--shadow); }
.today-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.today-hero h1 { margin: 0; font-size: 30px; line-height: 1.12; }
.today-hero p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.today-hero-mark { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 15px; background: var(--gold-soft); color: var(--gold); }
.today-hero-mark .icon { width: 24px; height: 24px; }
.today-hero.is-complete .today-hero-mark { background: var(--gold); color: #111; }
.trial-map { height: 240px; margin-top: 18px; position: relative; overflow: hidden; border: 4px solid var(--ink); border-radius: 8px; background: #d8cfaa; image-rendering: pixelated; }
html[data-mode="dark"] .trial-map { background: #1d2925; }
.trial-map::before { content: ""; position: absolute; width: 10px; height: 10px; left: 4%; top: 15%; background: #b2a77c; box-shadow: 18px 0 #b2a77c, 36px 8px #b2a77c, 54px 0 #b2a77c, 330px 14px #b2a77c, 348px 6px #b2a77c, 500px 40px #b2a77c, 518px 48px #b2a77c, 536px 40px #b2a77c, 140px 174px #b2a77c, 158px 166px #b2a77c, 176px 174px #b2a77c; opacity: .72; }
html[data-mode="dark"] .trial-map::before { background: #2f463b; box-shadow: 18px 0 #2f463b, 36px 8px #2f463b, 54px 0 #2f463b, 330px 14px #2f463b, 348px 6px #2f463b, 500px 40px #2f463b, 518px 48px #2f463b, 536px 40px #2f463b, 140px 174px #2f463b, 158px 166px #2f463b, 176px 174px #2f463b; }
.trial-route { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; }
.trial-route path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: square; stroke-linejoin: miter; }
.trial-route-shadow { stroke: rgba(17, 17, 17, .28); stroke-width: 14; }
.trial-route-line { stroke: #f8f4df; stroke-width: 8; stroke-dasharray: 10 6; }
html[data-mode="dark"] .trial-route-line { stroke: #a8b9a9; }
.trial-node { width: 28px; height: 28px; position: absolute; left: var(--node-x); top: var(--node-y); z-index: 3; display: grid; place-items: center; border: 3px solid var(--ink); background: var(--surface); transform: translate(-50%, -50%); }
.trial-node i { display: grid; place-items: center; color: var(--muted); font: 800 9px/1 ui-monospace, monospace; font-style: normal; }
.trial-node .icon { width: 12px; height: 12px; }
.trial-node.is-passed { background: var(--gold); }
.trial-node.is-passed i { color: #111; }
.trial-node.is-current { background: #fff; box-shadow: 0 0 0 4px var(--gold); }
.trial-node.is-current i { color: #111; }
.trial-node.is-locked { opacity: .56; }
.trial-character { width: 48px; height: 60px; position: absolute; left: var(--to-x); top: var(--to-y); z-index: 6; transform: translate(-50%, -88%); animation: trial-character-move .62s steps(6, end) both; }
.trial-character::after { content: ""; width: 28px; height: 6px; position: absolute; left: 10px; bottom: 1px; z-index: -1; background: rgba(17, 17, 17, .25); }
.trial-character > small { position: absolute; left: 50%; top: -13px; z-index: 2; padding: 2px 4px; border: 2px solid #111; background: #f1e5bd; color: #111; font: 800 8px/1 ui-monospace, monospace; white-space: nowrap; transform: translateX(-50%); }
.trial-character img { width: 48px; height: 60px; display: block; image-rendering: pixelated; animation: trial-character-step .3s steps(2, end) 2; }
.trial-map.is-complete .trial-character img { animation: trial-character-clear .5s steps(2, end) 2; }
.trial-map-caption { max-width: calc(100% - 28px); position: absolute; left: 12px; top: 12px; z-index: 7; padding: 7px 9px; border: 3px solid var(--ink); background: var(--surface); box-shadow: 4px 4px 0 rgba(17, 17, 17, .22); }
.trial-map-caption span, .trial-map-caption strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-map-caption span { color: #a63f37; font: 800 8px/1 ui-monospace, monospace; }
.trial-map-caption strong { margin-top: 4px; font-size: 11px; }
.trial-terrain { width: 8px; height: 24px; position: absolute; z-index: 2; background: #806448; }
.trial-terrain::before { content: ""; width: 28px; height: 14px; position: absolute; left: -10px; top: -12px; background: #687451; box-shadow: 6px -8px #687451, 12px 0 #687451; }
.trial-terrain-a { left: 13%; top: 31%; }
.trial-terrain-b { right: 18%; bottom: 16%; }
.trial-terrain-c { left: 47%; bottom: 7%; transform: scale(.8); }
@keyframes trial-character-move { from { left: var(--from-x); top: var(--from-y); } to { left: var(--to-x); top: var(--to-y); } }
@keyframes trial-character-step { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes trial-character-clear { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-8px) rotate(4deg); } }
.today-progress { margin-top: 22px; }
.today-progress > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.today-progress strong { font-size: 25px; font-variant-numeric: tabular-nums; }
.today-progress span, .today-progress small { color: var(--muted); font-size: 11px; }
.today-progress-track { height: 8px; margin-top: 8px; overflow: hidden; border-radius: 999px; background: var(--surface-strong); }
.today-progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--gold); transition: width .3s ease; }
.today-progress > small { display: block; margin-top: 6px; }
.today-hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 17px; }
.today-hero-actions > * { min-width: 0; }
.today-section { margin-top: 26px; }
.today-section .section-head { align-items: end; }
.today-section h2 { margin: 0; font-size: 18px; }
.today-level-list { display: grid; gap: 9px; }
.today-level { min-width: 0; min-height: 78px; padding: 12px 11px 12px 13px; display: grid; grid-template-columns: 31px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.today-level.is-done { background: color-mix(in srgb, var(--gold) 9%, var(--surface)); }
.today-level.is-danger { box-shadow: inset 3px 0 var(--red), var(--shadow); }
.today-level-number { align-self: start; padding-top: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.today-level-main { min-width: 0; }
.today-level-title { display: flex; align-items: baseline; gap: 7px; min-width: 0; }
.today-level-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.today-level-title time { flex: none; color: var(--gold); font-size: 11px; font-variant-numeric: tabular-nums; }
.today-level-main small { display: block; margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.today-level.is-done .today-level-title strong { color: var(--gold); text-decoration: line-through; }
.today-level.is-danger .today-level-title strong { color: var(--red); }
.today-level-actions { display: flex; align-items: center; gap: 3px; }
.today-check { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); }
.today-check:hover { border-color: var(--gold); color: var(--gold); }
.today-check.is-done { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); }
.today-check-static { cursor: default; border: 0; background: var(--surface-strong); color: var(--muted); }
.today-check-static.is-danger { color: var(--red); background: var(--red-soft); }
.today-health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.today-health-card { min-width: 0; min-height: 126px; padding: 14px; display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 13px; border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.today-health-card:hover { transform: translateY(-1px); }
.today-health-card.is-done { background: color-mix(in srgb, var(--emerald) 10%, var(--surface)); }
.today-health-icon { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--surface-strong); color: var(--gold); }
.today-health-copy { min-width: 0; }
.today-health-copy strong, .today-health-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-health-copy strong { font-size: 13px; }
.today-health-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.today-health-state { align-self: flex-end; color: var(--muted); }
.today-health-card.is-done .today-health-state { color: var(--emerald); }

/* Today campaign: the DOM runs in task order while the battlefield advances upward. */
.campaign-hero {
  margin: 0 0 14px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  border: 3px solid #171914;
  border-radius: 8px;
  background: #d9cfaa;
  color: #171914;
  box-shadow: 6px 6px 0 #6d7052;
  image-rendering: pixelated;
}
.campaign-hero h1 { margin: 2px 0 0; font-size: 32px; line-height: 1.05; }
.campaign-hero p:not(.eyebrow) { margin: 7px 0 0; color: #555744; font-size: 12px; }
.campaign-hero .eyebrow { margin: 0; color: #9e3e35; font: 900 9px/1 ui-monospace, monospace; }
.campaign-xp {
  min-width: 78px;
  padding: 10px 9px;
  align-self: start;
  border: 3px solid #171914;
  background: #f1e7bd;
  text-align: center;
  box-shadow: 3px 3px 0 rgba(23, 25, 20, .28);
}
.campaign-xp strong, .campaign-xp span { display: block; }
.campaign-xp strong { color: #9e3e35; font: 900 20px/1 ui-monospace, monospace; }
.campaign-xp span { margin-top: 5px; font: 800 8px/1 ui-monospace, monospace; }
.commander-note {
  grid-column: 1 / -1;
  padding: 11px 13px;
  position: relative;
  border-left: 5px solid #9e3e35;
  background: #f1e7bd;
}
.commander-note span, .commander-note strong { display: block; }
.commander-note span { color: #77745b; font: 800 8px/1 ui-monospace, monospace; }
.commander-note strong { margin-top: 6px; font-size: 13px; line-height: 1.5; }
.campaign-progress { grid-column: 1 / -1; position: relative; padding-left: 23px; }
.campaign-progress > div { display: flex; justify-content: space-between; font-size: 11px; font-weight: 800; }
.campaign-progress > i {
  width: 10px;
  height: 48px;
  position: absolute;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  border: 2px solid #171914;
  background: #eee4bf;
}
.campaign-progress > i > b { width: 100%; display: block; background: #69704a; transition: height .45s steps(5, end); }
.campaign-progress > small { display: block; margin-top: 7px; color: #555744; font-size: 10px; }
.campaign-hero .today-hero-actions { grid-column: 1 / -1; margin-top: 0; }
.campaign-hero .primary-button,
.campaign-hero .secondary-button { border: 2px solid #171914; border-radius: 3px; box-shadow: 2px 2px 0 rgba(23, 25, 20, .25); }
.campaign-hero .primary-button { background: #69704a; color: #fff; }
.campaign-hero .secondary-button { background: #f1e7bd; color: #171914; }
.campaign-hero.is-complete { background: #c3c59b; box-shadow: 6px 6px 0 #4d553f; }
.campaign-quotes {
  margin: 18px 0 24px;
  border-top: 3px solid #171914;
  border-bottom: 3px solid #171914;
  background: #eee5c4;
  color: #171914;
}
.campaign-quotes > summary {
  min-height: 62px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.campaign-quotes > summary::-webkit-details-marker { display: none; }
.campaign-quotes > summary::after {
  content: "+";
  width: 25px;
  height: 25px;
  flex: none;
  display: grid;
  place-items: center;
  border: 2px solid #171914;
  font: 900 16px/1 ui-monospace, monospace;
}
.campaign-quotes[open] > summary::after { content: "−"; }
.campaign-quotes > summary > span { min-width: 0; }
.campaign-quotes > summary b,
.campaign-quotes > summary small { display: block; }
.campaign-quotes > summary b { font-size: 15px; }
.campaign-quotes > summary small { margin-top: 4px; color: #706e58; font: 800 8px/1 ui-monospace, monospace; }
.campaign-quotes > summary > strong { margin-left: auto; color: #9e3e35; font: 900 11px/1 ui-monospace, monospace; }
.campaign-quote-groups { padding: 2px 14px 20px; border-top: 1px solid #aaa180; }
.campaign-quote-group { padding: 20px 0 2px; }
.campaign-quote-group + .campaign-quote-group { border-top: 1px dashed #aaa180; }
.campaign-quote-group h2 { margin: 0 0 12px; color: #9e3e35; font-size: 14px; }
.campaign-quote-group ol { margin: 0; padding-left: 30px; }
.campaign-quote-group li { padding: 0 0 13px 3px; font-size: 13px; line-height: 1.75; }
.campaign-quote-group li::marker { color: #6b704e; font: 800 10px/1 ui-monospace, monospace; }

.trial-campaign {
  min-height: 760px;
  margin: 20px -12px 0;
  padding: 68px 16px 72px;
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  gap: 42px;
  overflow: hidden;
  border: 4px solid #171914;
  border-radius: 8px;
  background: #b8ad83;
  box-shadow: inset 0 0 0 6px #d6cca8;
  image-rendering: pixelated;
}
.trial-campaign::before {
  content: "";
  width: 10px;
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 66px;
  bottom: 62px;
  border: 3px solid #25291f;
  background: #eee5c4;
  transform: translateX(-50%);
  box-shadow: 6px 0 0 rgba(37, 41, 31, .15);
}
.trial-campaign::after {
  content: "";
  width: 18px;
  height: 18px;
  position: absolute;
  left: 7%;
  top: 9%;
  z-index: 0;
  background: #737653;
  box-shadow: 18px 0 #737653, 9px -12px #5b6748, 72vw 76px #737653, calc(72vw - 12px) 64px #5b6748, 11vw 340px #7d7655, calc(66vw - 6px) 510px #5b6748, 22vw 690px #737653;
}
.campaign-mission {
  min-height: 144px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
}
.campaign-mission:nth-child(odd) .campaign-card { grid-column: 1; grid-row: 1; margin-right: 13px; }
.campaign-mission:nth-child(even) .campaign-card { grid-column: 3; grid-row: 1; margin-left: 13px; }
.campaign-node {
  width: 38px;
  height: 38px;
  grid-column: 2;
  grid-row: 1;
  z-index: 4;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 4px solid #171914;
  background: #e7ddba;
  color: #171914;
  font: 900 11px/1 ui-monospace, monospace;
  box-shadow: 4px 4px 0 rgba(23, 25, 20, .24);
}
.campaign-node .icon { width: 16px; height: 16px; }
.campaign-card {
  min-width: 0;
  padding: 12px;
  border: 3px solid #171914;
  border-radius: 4px;
  background: #eee5c4;
  color: #171914;
  box-shadow: 5px 5px 0 rgba(23, 25, 20, .25);
}
.campaign-card::after {
  content: "";
  width: 13px;
  height: 13px;
  position: absolute;
  top: 50%;
  border-top: 3px solid #171914;
  border-right: 3px solid #171914;
  background: #eee5c4;
}
.campaign-mission:nth-child(odd) .campaign-card::after { right: 52px; transform: translateY(-50%) rotate(45deg); }
.campaign-mission:nth-child(even) .campaign-card::after { left: 52px; transform: translateY(-50%) rotate(225deg); }
.campaign-card-head { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.campaign-card-head span { min-width: 0; overflow: hidden; color: #6b6953; font: 800 8px/1 ui-monospace, monospace; text-overflow: ellipsis; white-space: nowrap; }
.campaign-card-head b { flex: none; color: #9e3e35; font: 900 9px/1 ui-monospace, monospace; }
.campaign-title { min-width: 0; margin-top: 10px; display: flex; align-items: flex-start; gap: 8px; }
.campaign-title > span { width: 26px; height: 26px; flex: none; display: grid; place-items: center; background: #d3c89f; }
.campaign-title .icon { width: 15px; height: 15px; }
.campaign-title > div { min-width: 0; }
.campaign-title strong, .campaign-title small { display: block; overflow: hidden; text-overflow: ellipsis; }
.campaign-title strong { font-size: 13px; line-height: 1.3; white-space: nowrap; }
.campaign-title small { margin-top: 4px; color: #66644f; font-size: 9px; line-height: 1.35; }
.campaign-actions { min-width: 0; margin-top: 11px; display: flex; align-items: center; gap: 5px; }
.campaign-command {
  min-width: 0;
  min-height: 34px;
  padding: 7px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 2px solid #171914;
  border-radius: 2px;
  background: #69704a;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 2px 2px 0 rgba(23, 25, 20, .22);
}
.campaign-command .icon { width: 13px; height: 13px; }
.campaign-command.is-neutral { background: #d3c89f; color: #171914; }
.campaign-actions .icon-button { width: 34px; height: 34px; flex: none; border: 2px solid #171914; border-radius: 2px; background: transparent; color: #171914; }
.campaign-mission.is-done .campaign-node { background: #69704a; color: #fff; }
.campaign-mission.is-done .campaign-card { background: #c9cba4; }
.campaign-mission.is-done .campaign-card::after { background: #c9cba4; }
.campaign-mission.is-done .campaign-command { background: #3f4937; }
.campaign-mission.is-danger .campaign-card { border-color: #7f302b; box-shadow: 5px 5px 0 rgba(127, 48, 43, .24); }
.campaign-mission.is-danger .campaign-card-head span,
.campaign-mission.is-danger .campaign-title strong { color: #7f302b; }
.campaign-mission.is-intel .campaign-card { background: #d8d0b2; }
.campaign-mission.is-intel .campaign-card::after { background: #d8d0b2; }
.campaign-mission.is-current .campaign-node { background: #a63f37; color: #fff; animation: campaign-beacon 1.3s steps(2, end) infinite; }
.campaign-mission.is-current .campaign-card { box-shadow: 7px 7px 0 #a63f37; }
.campaign-avatar {
  width: 58px;
  height: 72px;
  position: absolute;
  z-index: 7;
  left: 50%;
  top: -56px;
  transform: translateX(-50%);
  animation: campaign-arrive .7s steps(6, end) both;
}
.campaign-avatar small {
  position: absolute;
  left: 50%;
  top: -7px;
  z-index: 2;
  padding: 3px 5px;
  border: 2px solid #171914;
  background: #eee5c4;
  color: #171914;
  font: 900 8px/1 ui-monospace, monospace;
  white-space: nowrap;
  transform: translateX(-50%);
}
.campaign-avatar img { width: 58px; height: 72px; display: block; image-rendering: pixelated; filter: drop-shadow(4px 4px 0 rgba(23, 25, 20, .22)); animation: campaign-idle .8s steps(2, end) infinite; }
.campaign-finish {
  min-height: 104px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: center;
}
.campaign-finish > .campaign-node { grid-column: 2; }
.campaign-finish > div { grid-column: 3; margin-left: 13px; padding: 14px; border: 3px solid #171914; background: #d8d0b2; box-shadow: 5px 5px 0 rgba(23, 25, 20, .25); }
.campaign-finish > div span, .campaign-finish > div strong { display: block; }
.campaign-finish > div span { color: #9e3e35; font: 900 8px/1 ui-monospace, monospace; }
.campaign-finish > div strong { margin-top: 6px; font-size: 13px; }
.campaign-finish.is-complete > .campaign-node,
.campaign-finish.is-complete > div { background: #c9cba4; }
.campaign-finish .campaign-avatar { top: -44px; }
html[data-mode="dark"] .campaign-hero { background: #30382d; color: #f0e7ca; box-shadow-color: #141814; }
html[data-mode="dark"] .campaign-hero p:not(.eyebrow) { color: #b8b89f; }
html[data-mode="dark"] .campaign-xp,
html[data-mode="dark"] .commander-note { background: #20261f; color: #f0e7ca; }
html[data-mode="dark"] .campaign-progress > i { background: #171b17; }
html[data-mode="dark"] .campaign-quotes { border-color: #0f120f; background: #20261f; color: #f0e7ca; }
html[data-mode="dark"] .campaign-quotes > summary::after { border-color: #f0e7ca; }
html[data-mode="dark"] .campaign-quotes > summary small { color: #aaa98f; }
html[data-mode="dark"] .campaign-quote-groups,
html[data-mode="dark"] .campaign-quote-group + .campaign-quote-group { border-color: #4b5141; }
html[data-mode="dark"] .trial-campaign { background: #29332a; box-shadow: inset 0 0 0 6px #3c4637; }
html[data-mode="dark"] .trial-campaign::before { background: #a8a47f; }
html[data-mode="dark"] .campaign-card,
html[data-mode="dark"] .campaign-node,
html[data-mode="dark"] .campaign-avatar small,
html[data-mode="dark"] .campaign-finish > div { background: #20261f; color: #f0e7ca; }
html[data-mode="dark"] .campaign-card::after { background: #20261f; }
html[data-mode="dark"] .campaign-title small,
html[data-mode="dark"] .campaign-card-head span { color: #aaa98f; }
html[data-mode="dark"] .campaign-title > span { background: #353d30; }
html[data-mode="dark"] .campaign-mission.is-done .campaign-card,
html[data-mode="dark"] .campaign-mission.is-done .campaign-card::after,
html[data-mode="dark"] .campaign-finish.is-complete > div { background: #3c4937; }
html[data-mode="dark"] .campaign-mission.is-intel .campaign-card,
html[data-mode="dark"] .campaign-mission.is-intel .campaign-card::after { background: #2d332b; }
@keyframes campaign-arrive { from { top: 10px; opacity: .25; } to { top: -56px; opacity: 1; } }
@keyframes campaign-idle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes campaign-beacon { 0%, 100% { box-shadow: 0 0 0 0 #e8d8a8, 4px 4px 0 rgba(23, 25, 20, .24); } 50% { box-shadow: 0 0 0 5px #e8d8a8, 4px 4px 0 rgba(23, 25, 20, .24); } }

@media (max-width: 560px) {
  .campaign-hero { margin-left: -4px; margin-right: -4px; padding: 17px; }
  .campaign-hero h1 { font-size: 29px; }
  .trial-campaign { margin-left: -16px; margin-right: -16px; padding-left: 10px; padding-right: 10px; }
  .campaign-mission { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
  .campaign-card { padding: 10px 9px; }
  .campaign-mission:nth-child(odd) .campaign-card { margin-right: 9px; }
  .campaign-mission:nth-child(even) .campaign-card { margin-left: 9px; }
  .campaign-mission:nth-child(odd) .campaign-card::after { right: 46px; }
  .campaign-mission:nth-child(even) .campaign-card::after { left: 46px; }
  .campaign-title > span { display: none; }
  .campaign-title strong { font-size: 12px; }
  .campaign-actions { align-items: stretch; }
  .campaign-command { flex: 1; padding-left: 5px; padding-right: 5px; }
  .campaign-finish { grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); }
}
.section-note { margin: 0 2px 14px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.guide-intro { padding: 18px; border-radius: 18px; background: var(--surface-strong); }
.guide-intro > strong { display: block; font-size: 19px; }
.guide-intro p { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.guide-list, .score-list { display: grid; gap: 8px; margin-top: 16px; }
.guide-row, .score-row {
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--surface-strong);
}
.guide-row > span { color: var(--muted); font-size: 12px; }
.guide-row > small { color: var(--muted); font-size: 11px; }
.guide-row.reached { background: var(--gold-soft); }
.guide-row.reached > span, .guide-row.reached > small { color: var(--gold); }
.energy-guide-head { display: flex; align-items: end; justify-content: space-between; padding: 2px 2px 13px; border-bottom: 1px solid var(--line); }
.energy-guide-head strong { font-size: 42px; line-height: 1; }
.energy-guide-head span { color: var(--gold); font-size: 13px; font-weight: 750; }
.score-row { grid-template-columns: 1fr auto; }
.score-row div strong, .score-row div small { display: block; }
.score-row div small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.score-row > span { font-weight: 760; font-variant-numeric: tabular-nums; }

.finite-time-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
.finite-time-picker select { min-width: 0; padding-left: 10px; padding-right: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.finite-time-picker b { color: var(--muted); font-size: 18px; }
.all-day-window { padding: 15px; border-radius: 14px; background: var(--gold-soft); color: var(--muted); text-align: center; }
.all-day-window strong { color: var(--gold); font-variant-numeric: tabular-nums; }

.timing-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.action-kind-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.timing-choice { min-width: 0; }
.timing-choice input { position: absolute; opacity: 0; pointer-events: none; }
.timing-choice > span {
  min-height: 78px;
  padding: 10px 5px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
.timing-choice.selected > span { background: var(--gold-soft); color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.timing-choice .icon { width: 20px; height: 20px; }
.timer-button.active { background: var(--red-soft); color: var(--red); }

@media (min-width: 700px) {
  .metric.energy-summary { grid-column: span 2; }
}

@media (max-width: 430px) {
  .guide-row { grid-template-columns: 68px 1fr; }
  .guide-row > small { grid-column: 2; }
  .todo-row .item-actions .icon-button { width: 31px; height: 31px; }
}

.memo-add-button { width: 48px; min-width: 48px; padding: 0; border-radius: 50%; }
.memo-tools { margin-top: 0; }
.memo-filters { margin-top: 11px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.memo-filters::-webkit-scrollbar { display: none; }
.memo-section { margin-top: 24px; }
.memo-list-head { display: flex; align-items: center; justify-content: space-between; margin: 0 3px 12px; }
.memo-list-head h2 { margin: 0; font-size: 19px; }
.memo-list-head span { color: var(--muted); font-size: 12px; }
.memo-groups { display: grid; gap: 24px; }
.memo-year-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 9px; }
.memo-year-head h3 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 15px; }
.memo-year-head h3 .icon { color: #e7a500; }
.memo-year-head span { color: var(--muted); font-size: 11px; }
.memo-list { width: 100%; max-width: 100%; overflow: hidden; border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.memo-row { min-height: 96px; position: relative; display: flex; align-items: stretch; overflow: hidden; background: var(--red); }
.memo-row + .memo-row::before { content: ""; height: 1px; position: absolute; top: 0; left: 17px; right: 17px; background: var(--line); }
.memo-open { width: 100%; min-width: 0; flex: 1; padding: 15px 17px; border: 0; position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; overflow: hidden; background: var(--surface); color: var(--ink); text-align: left; touch-action: pan-y; transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.memo-row.swiped-left .memo-open { transform: translateX(-86px); }
.memo-row.swiped-right .memo-open { transform: translateX(86px); }
.memo-row.dragging .memo-open { transition: none; }
.memo-copy { width: 100%; min-width: 0; flex: 1; overflow: hidden; }
.memo-copy h3 { width: 100%; max-width: 100%; margin: 0; overflow: hidden; color: var(--ink); font-size: 16px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.memo-copy p { display: -webkit-box; margin: 5px 0 6px; overflow: hidden; color: var(--muted); font-size: 12px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.memo-copy small { color: var(--muted); font-size: 11px; }
.memo-delete-action { width: 86px; height: 100%; padding: 0; border: 0; position: absolute; right: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #ff3b30; color: #fff; font-size: 11px; }
.memo-delete-action .icon { width: 18px; height: 18px; }
.memo-pin-action { width: 86px; height: 100%; padding: 0; border: 0; position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #ffcc00; color: #2b2100; font-size: 11px; }
.memo-pin-action .icon { width: 18px; height: 18px; }
.memo-editor-sheet { height: min(92dvh, 820px); }
.memo-editor { height: calc(100% - 54px); display: flex; flex-direction: column; }
.memo-body { min-height: 0; flex: 1; }
.memo-body textarea { height: 100%; min-height: 300px; padding: 17px; resize: none; background: transparent; font-size: 16px; line-height: 1.75; }
.memo-editor .form-actions { margin-top: auto; }
.visually-hidden { width: 1px; height: 1px; padding: 0; position: absolute; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.memo-page-editor { min-height: calc(100vh - 150px); display: flex; flex-direction: column; }
.memo-page-head { flex: none; }
.memo-page-form { min-height: 0; display: block; }
.memo-editor-meta { flex: none; }
.memo-page-body { margin-top: 14px; }
.memo-page-body textarea { width: 100%; height: auto; min-height: 430px; overflow: hidden; padding: 21px; border-radius: 22px; resize: none; background: var(--surface); box-shadow: var(--shadow); font-size: 16px; line-height: 1.8; }
.memo-editing .tabbar { display: none; }
.journal-editing .tabbar { display: none; }
.memo-editing #app-shell { padding-bottom: env(safe-area-inset-bottom); }
.journal-editing #app-shell { padding-bottom: env(safe-area-inset-bottom); }
.memo-editing .view { padding-bottom: 24px; }
.journal-editing .view { padding-bottom: 24px; }
.journal-date-field { max-width: 280px; }
.journal-page-editor .mood-row { margin-top: 10px; }
.journal-saved-preview { max-height: 210px; padding: 18px; margin-bottom: 20px; overflow: auto; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.journal-saved-preview small { color: var(--muted); }
.journal-saved-preview p { margin: 9px 0 0; white-space: pre-wrap; line-height: 1.7; }

@media (max-width: 560px) {
  input, textarea, select { font-size: 16px; }
  .memo-editor-sheet { height: calc(100dvh - max(18px, env(safe-area-inset-top))); border-radius: 28px 28px 0 0; }
  .memo-page-editor { min-height: calc(100dvh - 146px - env(safe-area-inset-top)); }
  .memo-page-body textarea { min-height: calc(100dvh - 360px - env(safe-area-inset-top)); }
}

/* Daily stability release */
[data-section] { scroll-margin-top: 108px; }
.update-banner {
  width: min(560px, calc(100vw - 28px));
  min-height: 66px;
  padding: 10px 11px 10px 16px;
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-height) + 12px + env(safe-area-inset-bottom));
  z-index: 72;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-elevated);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .2);
  transform: translateX(-50%);
}
.update-banner > div { min-width: 0; }
.update-banner strong, .update-banner span { display: block; }
.update-banner strong { font-size: 14px; }
.update-banner span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.update-banner .primary-button { min-height: 40px; flex: none; }
body:has(.sheet-backdrop) .toast { top: calc(82px + env(safe-area-inset-top)); bottom: auto; }

.today-overview { margin-bottom: 28px; }
.today-overview .section-head { align-items: end; margin-bottom: 14px; }
.today-overview .section-head h2 { margin: 0; font-size: 22px; }
.today-overview .section-head .eyebrow { margin-bottom: 3px; }
.today-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.today-metric {
  min-width: 0;
  min-height: 108px;
  padding: 13px;
  border: 0;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  box-shadow: var(--shadow);
}
.today-metric > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--gold-soft); color: var(--gold); }
.today-metric > span .icon { width: 17px; height: 17px; }
.today-metric strong { width: 100%; margin-top: 10px; overflow-wrap: anywhere; font-size: 16px; line-height: 1.2; }
.today-metric small { width: 100%; margin-top: 4px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; line-height: 1.35; }
.today-metric.is-warning > span { background: var(--red-soft); color: var(--red); }
.today-metric.is-warning strong { color: var(--red); }
.weekly-review-entry { width: 100%; min-height: 76px; padding: 14px 16px; border: 0; border-radius: 20px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 20px; align-items: center; gap: 12px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.weekly-review-entry > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--emerald-soft); color: var(--emerald); }
.weekly-review-entry strong, .weekly-review-entry small { display: block; }
.weekly-review-entry small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.weekly-review-entry > .icon { color: var(--muted); }
.weekly-review-head { margin-bottom: 16px; }
.weekly-review-head strong, .weekly-review-head span { display: block; }
.weekly-review-head strong { font-size: 18px; }
.weekly-review-head span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.weekly-review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.weekly-review-metric { min-width: 0; min-height: 112px; padding: 14px; border-radius: 16px; background: var(--surface-strong); }
.weekly-review-metric .icon { color: var(--emerald); }
.weekly-review-metric strong, .weekly-review-metric small { display: block; }
.weekly-review-metric strong { margin-top: 13px; overflow-wrap: anywhere; font-size: 18px; }
.weekly-review-metric small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.section-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.unscheduled-row { border: 0; box-shadow: var(--shadow); }
.unscheduled-row .status-mark { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--surface)); color: var(--blue); }
.schedule-actions { display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.schedule-button { min-height: 32px; padding: 5px 9px; border: 0; border-radius: 11px; background: var(--surface-strong); color: var(--ink); font-size: 11px; }
.action-date-groups { display: grid; gap: 9px; }
.action-date-group { overflow: hidden; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.action-date-group > summary { min-height: 64px; padding: 12px 15px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.action-date-group > summary::-webkit-details-marker { display: none; }
.action-date-group > summary strong, .action-date-group > summary small { display: block; }
.action-date-group > summary small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.action-date-group > summary > .icon { color: var(--muted); transition: transform .2s ease; }
.action-date-group[open] > summary > .icon { transform: rotate(90deg); }
.action-date-group > .list { padding: 0 8px 8px; }
.action-history-controls { min-height: 54px; margin-top: 0; display: flex; align-items: center; justify-content: space-between; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.action-history-controls strong { font-size: 13px; }
.action-history-controls .icon-button:disabled { opacity: .3; }
.history-day-groups { display: grid; gap: 25px; }
.history-day { min-width: 0; }
.history-todo-row { min-height: 64px; }
.history-todo-row.history-completed { background: color-mix(in srgb, var(--emerald) 8%, var(--surface)); box-shadow: inset 3px 0 var(--emerald), var(--shadow); }
.history-todo-row.history-completed .status-mark { border-color: var(--emerald); background: var(--emerald-soft); color: var(--emerald); }
.history-todo-row.history-completed .item-main strong { color: var(--emerald); text-decoration: line-through; }
.history-todo-row.history-completed .item-main small { color: color-mix(in srgb, var(--emerald) 72%, var(--muted)); }
.history-todo-row.history-incomplete { background: color-mix(in srgb, var(--red) 7%, var(--surface)); box-shadow: inset 3px 0 var(--red), var(--shadow); }
.history-todo-row.history-incomplete .status-mark { border-color: var(--red); background: var(--red-soft); color: var(--red); }
.history-todo-row.history-incomplete .item-main strong { color: var(--red); }
.history-todo-row.history-incomplete .item-main small { color: color-mix(in srgb, var(--red) 68%, var(--muted)); }
.exercise-total-metric strong small { color: var(--muted); font-size: 13px; font-weight: 650; }
.exercise-total-metric > span { color: var(--muted); }
.energy-history-groups { display: grid; gap: 9px; }
.energy-history-day { overflow: hidden; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.energy-history-day > summary { min-height: 68px; padding: 12px 15px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.energy-history-day > summary::-webkit-details-marker { display: none; }
.energy-history-day > summary > div { min-width: 0; }
.energy-history-day > summary strong, .energy-history-day > summary small { display: block; }
.energy-history-day > summary small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.energy-history-day > summary > .icon { flex: none; color: var(--muted); transition: transform .2s ease; }
.energy-history-day[open] > summary > .icon { transform: rotate(90deg); }
.energy-history-day > .list { padding: 0 8px 8px; }
.energy-history-actions { display: grid; gap: 6px; margin-top: 10px; }
.energy-history-more { width: 100%; }
.energy-history-collapse { justify-self: center; }

.stage-standard { overflow: hidden; border-radius: 15px; background: var(--surface-strong); }
.stage-standard summary { min-height: 54px; padding: 12px 14px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; }
.stage-standard summary::-webkit-details-marker { display: none; }
.stage-standard summary span { font-size: 13px; font-weight: 720; }
.stage-standard summary small { color: var(--muted); font-size: 11px; }
.stage-standard-body { padding: 2px 14px 14px; display: grid; gap: 14px; }
.stage-record-list { display: grid; gap: 7px; margin: 0 0 12px; }
.stage-record-row { min-height: 58px; padding: 9px 10px 9px 12px; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: 9px; background: var(--surface); }
.stage-record-row > div:first-child { min-width: 0; }
.stage-record-row strong, .stage-record-row small { display: block; overflow-wrap: anywhere; }
.stage-record-row strong { font-size: 13px; }
.stage-record-row small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.archive-manager-section { padding-top: 0; }
.archive-manager-entry { width: 100%; min-height: 76px; padding: 15px 17px; border: 0; border-radius: 20px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 24px; align-items: center; gap: 12px; background: var(--surface); color: var(--ink); text-align: left; box-shadow: var(--shadow); }
.archive-manager-entry > span { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-strong); color: var(--muted); }
.archive-manager-entry strong, .archive-manager-entry small { display: block; }
.archive-manager-entry small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.archive-manager-entry > .icon { color: var(--muted); }
.archived-goal-main { min-width: 0; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; }
.archived-goal-row .item-actions { flex: none; }
.archive-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.energy-bar.blank { height: 2px; min-height: 2px; background: var(--line); }
.data-status-list { overflow: hidden; margin-bottom: 12px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.data-status-list > div { min-height: 52px; padding: 12px 15px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.data-status-list > div + div { border-top: 1px solid var(--line); }
.data-status-list span { color: var(--muted); font-size: 12px; }
.data-status-list strong { text-align: right; font-size: 12px; overflow-wrap: anywhere; }
.backup-reminder { margin: 0 0 12px; padding: 12px 14px; border-radius: 15px; background: var(--gold-soft); color: var(--gold); font-size: 12px; }

@media (min-width: 700px) {
  .today-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (min-width: 860px) {
  .update-banner { bottom: 106px; }
  body:has(.sheet-backdrop) .toast { top: 92px; }
}

@media (max-width: 560px) {
  .today-overview .section-head .meta { display: none; }
  .unscheduled-row { flex-wrap: wrap; }
  .unscheduled-row .item-main { min-width: calc(100% - 42px); }
  .schedule-actions { width: 100%; justify-content: flex-end; padding-left: 36px; }
}

@media (max-width: 370px) {
  .today-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .exercise-timer-value { font-size: 40px; }
}

/* Today Trial 2.0 */
.command-center {
  grid-template-columns: minmax(0, 1fr) 82px;
  background: #d8cfaa;
}
.command-center .command-status { grid-column: 1 / -1; }
.command-status > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 11px; font-weight: 850; }
.command-status > i { height: 10px; margin-top: 8px; display: block; overflow: hidden; border: 2px solid #171914; background: #eee5c4; }
.command-status > i > b { height: 100%; display: block; background: #69704a; transition: width .4s steps(6, end); }
.command-status > small { margin-top: 7px; display: block; color: #555744; font-size: 10px; }

.trial-planner {
  margin: 22px 0;
  padding: 16px;
  border: 3px solid #171914;
  border-radius: 6px;
  background: #e8dfbe;
  color: #171914;
  box-shadow: 6px 6px 0 #6d7052;
}
.trial-planner > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.trial-planner h2 { margin: 2px 0 0; font-size: 22px; }
.trial-planner header p:not(.eyebrow) { margin: 6px 0 0; color: #686650; font-size: 11px; }
.trial-plan-group { margin-top: 20px; }
.trial-plan-group h3 { margin: 0 0 9px; color: #6b6953; font: 850 10px/1.2 ui-monospace, monospace; }
.trial-plan-sortable { display: grid; gap: 7px; }
.trial-plan-row {
  min-width: 0;
  min-height: 62px;
  padding: 8px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 78px auto;
  align-items: center;
  gap: 8px;
  border: 2px solid #272920;
  background: #f2e9c8;
  box-shadow: 2px 2px 0 rgba(23, 25, 20, .2);
}
.trial-plan-row.is-fixed { opacity: .68; background: #c9cba4; }
.trial-plan-row.is-dragging { z-index: 8; border-color: #9e3e35; box-shadow: 5px 5px 0 rgba(158, 62, 53, .34); }
.trial-plan-row > div { min-width: 0; }
.trial-plan-row strong, .trial-plan-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trial-plan-row strong { font-size: 12px; }
.trial-plan-row small { margin-top: 4px; color: #6b6953; font-size: 9px; }
.trial-drag-handle { width: 34px; height: 42px; display: grid; place-items: center; border: 0; background: transparent; color: #565a43; touch-action: none; }
.trial-drag-handle .icon { width: 18px; height: 18px; }
.trial-plan-time { width: 78px; min-width: 0; padding: 7px 4px; border: 1px solid #888267; border-radius: 3px; background: #fff9dc; color: #171914; font-size: 11px; }
.trial-plan-row .icon-button { width: 30px; height: 30px; border-radius: 2px; }
.trial-plan-empty { margin: 0; padding: 18px; border: 1px dashed #8d876b; color: #6b6953; font-size: 11px; text-align: center; }
.trial-plan-pool { padding-top: 16px; border-top: 1px dashed #979074; }
.trial-plan-pool > button { width: 100%; min-height: 54px; padding: 8px 10px; display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 8px; border: 0; border-bottom: 1px solid #c0b693; background: transparent; color: #171914; text-align: left; }
.trial-plan-pool > button > span { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #77765c; }
.trial-plan-pool strong, .trial-plan-pool small { display: block; }
.trial-plan-pool strong { font-size: 12px; }
.trial-plan-pool small { margin-top: 3px; color: #6b6953; font-size: 9px; }
.trial-planner > footer { margin-top: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.trial-campaign.campaign-v2 {
  min-height: 0;
  margin: 26px -12px 0;
  padding: 0;
  display: block;
  position: relative;
  overflow: hidden;
  background: #aea47a;
  box-shadow: inset 0 0 0 7px #d6cca8;
}
.trial-campaign.campaign-v2::before,
.trial-campaign.campaign-v2::after { display: none; }
.campaign-route { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.campaign-route path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: square; }
.campaign-route-shadow { stroke: rgba(23, 25, 20, .32); stroke-width: 18; }
.campaign-route-line { stroke: #efe6c5; stroke-width: 11; stroke-dasharray: 15 8; }
.campaign-v2 .campaign-mission {
  height: 160px;
  min-height: 0;
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--route-bottom);
  z-index: 3;
  display: block;
}
.campaign-v2 .campaign-node {
  width: 42px;
  height: 42px;
  position: absolute;
  left: var(--route-x);
  top: 50%;
  z-index: 5;
  display: grid;
  transform: translate(-50%, -50%);
}
.campaign-v2 .campaign-card {
  width: min(44%, 300px);
  min-width: 0;
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
}
.campaign-v2 .card-left .campaign-card { left: 4%; margin: 0; }
.campaign-v2 .card-right .campaign-card { right: 4%; margin: 0; }
.campaign-v2 .campaign-card::after { width: 12px; height: 12px; top: 50%; }
.campaign-v2 .card-left .campaign-card::after { left: auto; right: -9px; transform: translateY(-50%) rotate(45deg); }
.campaign-v2 .card-right .campaign-card::after { left: -9px; right: auto; transform: translateY(-50%) rotate(225deg); }
.campaign-v2 .campaign-avatar {
  width: 58px;
  height: 78px;
  padding: 0;
  position: absolute;
  left: var(--route-x);
  top: 15px;
  z-index: 8;
  border: 0;
  background: transparent;
  transform: translateX(-50%);
}
.campaign-v2 .campaign-avatar small { top: -7px; }
.campaign-v2 .campaign-mission.is-locked:not(.is-done) .campaign-card { opacity: .72; filter: saturate(.6); }
.campaign-v2 .campaign-mission.is-skipped .campaign-card { opacity: .58; }
.campaign-v2 .campaign-mission.is-skipped .campaign-node { background: #8a8368; color: #eee5c4; }
.campaign-v2 .campaign-finish {
  height: 96px;
  min-height: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 8px;
  z-index: 5;
  display: block;
}
.campaign-v2 .campaign-finish > .campaign-node { position: absolute; left: 50%; top: 40px; transform: translate(-50%, -50%); }
.campaign-v2 .campaign-finish > div { width: min(39%, 260px); margin: 0; position: absolute; left: 57%; top: 10px; }
.campaign-v2 .campaign-finish .campaign-avatar { left: 50%; top: 5px; }
.campaign-settled, .campaign-locked { min-height: 32px; display: inline-flex; align-items: center; gap: 5px; color: #555744; font-size: 9px; font-weight: 800; }
.campaign-settled { color: #43513a; }
.campaign-settled .icon, .campaign-locked .icon { width: 13px; height: 13px; }
.campaign-mini-command { min-height: 34px; padding: 6px 8px; border: 2px solid #171914; border-radius: 2px; background: #d4c9a4; color: #171914; font-size: 9px; font-weight: 800; }

.trial-scenery { position: absolute; z-index: 2; pointer-events: none; opacity: .92; }
.trial-scenery img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.scene-a { width: 42px; height: 56px; left: 5%; bottom: 12%; }
.scene-b { width: 36px; height: 48px; right: 6%; bottom: 47%; }
.scene-c { width: 68px; height: 50px; left: 5%; top: 17%; }
.scene-d { width: 40px; height: 40px; right: 7%; top: 31%; }
.scene-e { width: 45px; height: 52px; right: 8%; bottom: 22%; }
.scene-f { width: 40px; height: 54px; left: 7%; top: 42%; }
.trial-intel-board { max-width: 42%; padding: 10px; position: absolute; right: 5%; top: 115px; z-index: 4; border: 2px solid #171914; background: #d8d0b2; box-shadow: 3px 3px 0 rgba(23, 25, 20, .24); }
.trial-intel-board > span { display: flex; align-items: center; gap: 5px; color: #9e3e35; font: 850 9px/1 ui-monospace, monospace; }
.trial-intel-board small { margin-top: 6px; display: block; overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.trial-quote-dialog { position: fixed; inset: 0; z-index: 120; display: flex; align-items: flex-end; justify-content: center; gap: 0; padding: 24px 18px calc(100px + env(safe-area-inset-bottom)); background: rgba(20, 22, 18, .52); }
.trial-quote-dialog > img { width: 76px; height: 94px; flex: none; margin-right: -13px; position: relative; z-index: 2; image-rendering: pixelated; animation: campaign-idle .8s steps(2, end) infinite; }
.trial-quote-dialog > div { width: min(420px, calc(100vw - 78px)); padding: 16px; border: 3px solid #171914; background: #f1e7bd; color: #171914; box-shadow: 6px 6px 0 rgba(23, 25, 20, .36); }
.trial-quote-dialog span { color: #9e3e35; font: 850 9px/1 ui-monospace, monospace; }
.trial-quote-dialog blockquote { margin: 10px 0 14px; font-size: 14px; font-weight: 750; line-height: 1.7; }
.trial-quote-dialog button { min-height: 32px; padding: 6px 12px; float: right; border: 2px solid #171914; background: #69704a; color: #fff; font-size: 10px; font-weight: 800; }
.trial-close-list { display: grid; gap: 7px; }
.trial-close-list span { min-height: 38px; padding: 8px 10px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-strong); font-size: 12px; }
.trial-upgrade-sheet { display: grid; gap: 10px; padding: 0 20px 22px; }
.trial-upgrade-sheet > button { min-height: 78px; padding: 13px; display: grid; grid-template-columns: 42px minmax(0, 1fr) 20px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); text-align: left; }
.trial-upgrade-sheet > button > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 6px; background: var(--gold-soft); color: var(--gold); }
.trial-upgrade-sheet strong, .trial-upgrade-sheet small { display: block; }
.trial-upgrade-sheet small { margin-top: 4px; color: var(--muted); font-size: 10px; }

html[data-mode="dark"] .command-center { background: #30382d; }
html[data-mode="dark"] .command-status > i { background: #171b17; }
html[data-mode="dark"] .command-status > small { color: #b8b89f; }
html[data-mode="dark"] .trial-planner { border-color: #0f120f; background: #252d25; color: #f0e7ca; box-shadow-color: #111510; }
html[data-mode="dark"] .trial-planner header p:not(.eyebrow),
html[data-mode="dark"] .trial-plan-group h3,
html[data-mode="dark"] .trial-plan-row small { color: #aaa98f; }
html[data-mode="dark"] .trial-plan-row { border-color: #111510; background: #323a2f; }
html[data-mode="dark"] .trial-plan-row.is-fixed { background: #3c4937; }
html[data-mode="dark"] .trial-plan-time { border-color: #555d4b; background: #1b211b; color: #f0e7ca; color-scheme: dark; }
html[data-mode="dark"] .trial-plan-pool > button { color: #f0e7ca; }
html[data-mode="dark"] .trial-campaign.campaign-v2 { background: #29332a; box-shadow: inset 0 0 0 7px #3c4637; }
html[data-mode="dark"] .campaign-route-line { stroke: #a8a47f; }
html[data-mode="dark"] .trial-intel-board { background: #20261f; color: #f0e7ca; }

/* 今日试炼：原创战争远征像素场景 */
.trial-campaign.campaign-v2 {
  border: 4px solid #222b20;
  background-color: #66764a;
  background-image: url("assets/trial-ground.svg");
  background-size: 128px 128px;
  box-shadow: inset 0 0 0 7px #3f4e36, inset 0 0 0 10px rgba(24, 30, 23, .42);
  image-rendering: pixelated;
}
.campaign-route-shadow { stroke: #303828; stroke-width: 25; opacity: .9; }
.campaign-route-line { stroke: #aa8145; stroke-width: 16; stroke-dasharray: 26 5; }
.campaign-route-line { filter: drop-shadow(0 2px 0 rgba(38, 39, 27, .55)); }
.command-center {
  border-color: #222b20;
  background: #354832;
  color: #f1e7bd;
  box-shadow: 5px 5px 0 rgba(34, 43, 32, .28);
}
.command-center .eyebrow,
.command-center .campaign-xp strong,
.command-center .command-status b { color: #e6b654; }
.command-center .command-status > i { background: #20291e; border-color: #1e271c; }
.command-center .command-status > i b { background: #bb8a3e; }
.command-center .today-hero-actions .primary-button { background: #a33c31; border-color: #1f261d; }
.command-center .today-hero-actions .secondary-button { background: #697a4c; border-color: #1f261d; color: #f7edc5; }
.campaign-v2 .campaign-card {
  border-color: #222b20;
  border-radius: 2px;
  background: #eee3ba;
  box-shadow: 5px 5px 0 rgba(34, 43, 32, .42);
}
.campaign-v2 .campaign-card::after { border-color: #222b20; background: #eee3ba; }
.campaign-v2 .campaign-card-head span { color: #4c5e3e; }
.campaign-v2 .campaign-card-head b { color: #9e3e35; }
.campaign-v2 .campaign-title > span { background: #c6bd91; color: #293525; }
.campaign-v2 .campaign-title small { color: #596047; }
.campaign-v2 .campaign-node { border-color: #222b20; background: #d6bd78; box-shadow: 4px 4px 0 rgba(34, 43, 32, .45); }
.campaign-v2 .campaign-mission.is-done .campaign-node { background: #71854f; }
.campaign-v2 .campaign-mission.is-done .campaign-card,
.campaign-v2 .campaign-mission.is-done .campaign-card::after { background: #b5bd8e; }
.campaign-v2 .campaign-mission.is-current .campaign-card { box-shadow: 7px 7px 0 #a33c31; }
.campaign-v2 .campaign-mission.is-current .campaign-node { background: #a33c31; }
.campaign-v2 .campaign-finish > div { border-color: #222b20; background: #d8c58b; box-shadow: 5px 5px 0 rgba(34, 43, 32, .42); }
.trial-scenery { z-index: 2; opacity: 1; }
.trial-scenery img { image-rendering: pixelated; filter: drop-shadow(3px 3px 0 rgba(31, 37, 27, .26)); }
.scene-outpost { width: 104px; height: 84px; left: 1%; top: 2%; }
.scene-sandbags { width: 82px; height: 39px; right: 1%; }
.scene-02 { top: 9%; }
.scene-10 { top: 63%; left: 1%; transform: scaleX(-1); }
.scene-tree { width: 31px; height: 42px; }
.scene-03 { left: 2%; top: 17%; }
.scene-11 { right: 2%; top: 39%; transform: scaleX(-1); }
.scene-dead-tree { width: 34px; height: 48px; }
.scene-04 { right: 2%; top: 20%; }
.scene-12 { left: 2%; top: 78%; }
.scene-trench { width: 105px; height: 59px; }
.scene-05 { left: 0; top: 30%; }
.scene-13 { right: 0; top: 71%; transform: scaleX(-1); }
.scene-wire { width: 108px; height: 32px; right: -1%; }
.scene-06 { top: 46%; }
.scene-14 { left: -1%; top: 87%; transform: scaleX(-1); }
.scene-tent { width: 67px; height: 49px; right: 1%; }
.scene-07 { top: 37%; }
.scene-18 { left: 1%; top: 91%; transform: scaleX(-1); }
.scene-crate { width: 34px; height: 34px; left: 2%; }
.scene-08 { top: 53%; }
.scene-17 { right: 2%; top: 83%; left: auto; }
.scene-bridge { width: 45px; height: 60px; right: 1%; top: 57%; }
.scene-sign { width: 36px; height: 42px; right: 2%; top: 26%; }
.scene-flag { width: 34px; height: 43px; left: 2%; top: 60%; }
.trial-campaign.campaign-v2::after { display: block; width: 7px; height: 7px; left: 8%; top: 14%; background: #b1a16d; box-shadow: 14px 22px #354d36, 28px 410px #b1a16d, 42px 660px #354d36, 24px 920px #b1a16d; }
html[data-mode="dark"] .trial-campaign.campaign-v2 { background-color: #43543d; background-image: url("assets/trial-ground.svg"); box-shadow: inset 0 0 0 7px #293829, inset 0 0 0 10px rgba(10, 15, 10, .55); }
html[data-mode="dark"] .campaign-route-line { stroke: #9c783e; }
html[data-mode="dark"] .campaign-v2 .campaign-card { background: #2c3629; color: #f0e7ca; }
html[data-mode="dark"] .campaign-v2 .campaign-card::after { background: #2c3629; }

@media (max-width: 560px) {
  .scene-outpost { width: 82px; height: 66px; left: 0; }
  .scene-sandbags { width: 68px; height: 32px; }
  .scene-trench { width: 84px; height: 47px; }
  .scene-wire { width: 82px; height: 25px; }
  .scene-bridge { width: 34px; height: 46px; }
  .scene-tent { width: 54px; height: 40px; }
  .scene-sign, .scene-flag { transform: scale(.8); transform-origin: bottom center; }
}

@media (max-width: 560px) {
  .trial-planner { margin-left: -4px; margin-right: -4px; padding: 13px; }
  .trial-plan-row { grid-template-columns: 30px minmax(0, 1fr) 70px auto; gap: 5px; }
  .trial-drag-handle { width: 30px; }
  .trial-plan-time { width: 70px; font-size: 10px; }
  .trial-campaign.campaign-v2 { margin-left: -16px; margin-right: -16px; }
  .campaign-v2 .campaign-card { width: 45%; padding: 10px 8px; }
  .campaign-v2 .campaign-title > span { display: none; }
  .campaign-v2 .campaign-title strong { font-size: 11px; }
  .campaign-v2 .campaign-title small { white-space: normal; }
  .campaign-v2 .campaign-actions { flex-wrap: wrap; }
  .campaign-v2 .campaign-command { width: auto; flex: 1; }
  .campaign-v2 .campaign-avatar { width: 50px; height: 68px; }
  .campaign-v2 .campaign-avatar img { width: 50px; height: 68px; }
  .trial-intel-board { max-width: 44%; }
  .trial-quote-dialog { padding-left: 8px; padding-right: 12px; }
  .trial-quote-dialog > img { width: 62px; height: 78px; }
  .trial-quote-dialog > div { width: calc(100vw - 62px); padding: 13px; }
  .trial-quote-dialog blockquote { font-size: 13px; }
}

/* 浅色模式可读性：试炼信息保持像素感，但不牺牲阅读 */
html:not([data-mode="dark"]) .trial-campaign.campaign-v2,
html:not([data-mode="dark"]) .trial-planner { color: #1e281b; }
html:not([data-mode="dark"]) .command-status > div { font-size: 12px; }
html:not([data-mode="dark"]) .command-status > small { color: #e9e2bf; font-size: 11px; font-weight: 700; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-card-head span { color: #344a31; font-size: 10px; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-card-head b { font-size: 10px; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-title strong { color: #172318; font-size: 14px; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-title small { color: #3f5238; font-size: 10.5px; line-height: 1.45; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-command { min-height: 36px; font-size: 11px; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-mini-command { min-height: 36px; color: #1b2619; font-size: 10px; font-weight: 850; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-settled,
html:not([data-mode="dark"]) .campaign-v2 .campaign-locked { color: #30492d; font-size: 10px; }
html:not([data-mode="dark"]) .campaign-v2 .campaign-mission.is-locked:not(.is-done) .campaign-card { opacity: .86; filter: saturate(.82); }
html:not([data-mode="dark"]) .trial-intel-board { background: #eee3ba; color: #1e281b; }
html:not([data-mode="dark"]) .trial-intel-board > span { font-size: 10px; }
html:not([data-mode="dark"]) .trial-intel-board small { color: #3f5238; font-size: 10px; }
html:not([data-mode="dark"]) .trial-planner header p:not(.eyebrow) { color: #3f5238; font-size: 12px; }
html:not([data-mode="dark"]) .trial-plan-group h3 { color: #30492d; font-size: 11px; }
html:not([data-mode="dark"]) .trial-plan-row strong { color: #172318; font-size: 13px; }
html:not([data-mode="dark"]) .trial-plan-row small,
html:not([data-mode="dark"]) .trial-plan-pool small { color: #3f5238; font-size: 10px; }
html:not([data-mode="dark"]) .trial-plan-pool strong { color: #172318; font-size: 13px; }

@media (max-width: 560px) {
  html:not([data-mode="dark"]) .campaign-v2 .campaign-title strong { font-size: 12px; }
  html:not([data-mode="dark"]) .campaign-v2 .campaign-title small { font-size: 10px; }
  html:not([data-mode="dark"]) .campaign-v2 .campaign-command { font-size: 10px; }
}

/* 试炼核心信息：在深色指挥部与浅色地图上都保持清晰 */
.command-center .campaign-hero p:not(.eyebrow),
.command-center p:not(.eyebrow) { color: #ddd6b5; font-size: 14px; font-weight: 700; }
.command-center .campaign-xp { background: #f4e5ad; color: #49391f; }
.command-center .campaign-xp strong { color: #754715; font-size: 25px; }
.command-center .campaign-xp span { color: #49391f; font-size: 11px; }
.command-center .command-status > small { font-size: 12px; font-weight: 750; }
.campaign-v2 .campaign-card-head span { font-size: 10px; }
.campaign-v2 .campaign-card-head b { font-size: 10px; }
.campaign-v2 .campaign-title strong { font-size: 15px; }
.campaign-v2 .campaign-title small { font-size: 11px; line-height: 1.45; }
.campaign-v2 .campaign-command { min-height: 38px; font-size: 12px; }
.campaign-v2 .campaign-mini-command { min-height: 38px; font-size: 11px; }
.campaign-v2 .campaign-settled,
.campaign-v2 .campaign-locked { font-size: 10px; }
html:not([data-mode="dark"]) .command-center .campaign-hero p:not(.eyebrow),
html:not([data-mode="dark"]) .command-center p:not(.eyebrow) { color: #e6dfc0; }
html:not([data-mode="dark"]) .command-center .campaign-xp strong { color: #6a4118; }
html:not([data-mode="dark"]) .command-center .campaign-xp span { color: #49391f; }
html:not([data-mode="dark"]) .trial-campaign.campaign-v2 .campaign-title strong { color: #172318; }

@media (max-width: 560px) {
  .command-center .campaign-hero p:not(.eyebrow),
  .command-center p:not(.eyebrow) { font-size: 13px; }
  .campaign-v2 .campaign-title strong { font-size: 13px; }
  .campaign-v2 .campaign-title small { font-size: 10.5px; }
  .campaign-v2 .campaign-command { min-height: 36px; font-size: 11px; }
}

/* 深色模式与浅色模式使用同一套字号，仅颜色不同 */
html[data-mode="dark"] .command-status > div { font-size: 12px; }
html[data-mode="dark"] .command-status > small { font-size: 11px; }
html[data-mode="dark"] .campaign-v2 .campaign-card-head span,
html[data-mode="dark"] .campaign-v2 .campaign-card-head b { font-size: 10px; }
html[data-mode="dark"] .campaign-v2 .campaign-title strong { font-size: 14px; }
html[data-mode="dark"] .campaign-v2 .campaign-title small { font-size: 10.5px; line-height: 1.45; }
html[data-mode="dark"] .campaign-v2 .campaign-command { min-height: 36px; font-size: 11px; }
html[data-mode="dark"] .campaign-v2 .campaign-mini-command { min-height: 36px; font-size: 10px; }
html[data-mode="dark"] .campaign-v2 .campaign-settled,
html[data-mode="dark"] .campaign-v2 .campaign-locked { font-size: 10px; }
html[data-mode="dark"] .trial-intel-board > span,
html[data-mode="dark"] .trial-intel-board small { font-size: 10px; }
html[data-mode="dark"] .trial-plan-group h3 { font-size: 11px; }
html[data-mode="dark"] .trial-plan-row strong,
html[data-mode="dark"] .trial-plan-pool strong { font-size: 13px; }
html[data-mode="dark"] .trial-plan-row small,
html[data-mode="dark"] .trial-plan-pool small { font-size: 10px; }

@media (max-width: 560px) {
  html[data-mode="dark"] .campaign-v2 .campaign-title strong { font-size: 12px; }
  html[data-mode="dark"] .campaign-v2 .campaign-title small { font-size: 10px; }
  html[data-mode="dark"] .campaign-v2 .campaign-command { min-height: 36px; font-size: 10px; }
}

/* 行动状态与长列表收尾优化 */
.todo-status-label { display: inline-block; margin-right: 5px; font-weight: 760; }
.todo-status-label.is-done { color: var(--emerald); }
.todo-status-label.is-overdue { color: var(--red); }
.todo-status-label.is-future { color: var(--blue); }
.todo-status-label.is-today { color: var(--orange); }
.todo-row.is-today .status-mark { color: var(--orange); border-color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.todo-row.is-future .status-mark { color: var(--blue); border-color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); }
.history-completed .status-mark { color: var(--emerald); border-color: var(--emerald); background: var(--emerald-soft); }
.history-incomplete .status-mark { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.campaign-v2 .campaign-command, .campaign-v2 .campaign-mini-command { min-height: 46px; }
.campaign-v2 .campaign-command .icon, .campaign-v2 .campaign-mini-command .icon { width: 16px; height: 16px; }
.list-more { width: 100%; margin-top: 10px; }
.update-banner button[aria-busy="true"] { cursor: wait; opacity: .65; }
.action-date-group,
.history-day,
.energy-history-day { content-visibility: auto; contain-intrinsic-size: 72px; }
@media (prefers-reduced-motion: reduce) {
  .trial-campaign *,
  .trial-campaign *::before,
  .trial-campaign *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
