:root {
  color-scheme: light;
  --bg: #f0f6f8;
  --paper: #f0f6f8;
  --panel: #f8fcfd;
  --panel-soft: #d9e0e3;
  --ink: #0c1016;
  --ink-soft: #1e232c;
  --muted: #5f6a72;
  --muted-2: #a5abad;
  --line: rgba(12, 16, 22, 0.12);
  --line-strong: rgba(12, 16, 22, 0.22);
  --blue: #11181c;
  --blue-strong: #0c1016;
  --blue-soft: #dde8eb;
  --red: #c26a5a;
  --red-soft: #f2d6cf;
  --amber: #897357;
  --amber-soft: #e9ded0;
  --green: #6b8a77;
  --green-soft: #dce8e1;
  --violet: #76708a;
  --violet-soft: #e2e1ea;
  --chart-living: #82a4b4;
  --chart-growth: #728b70;
  --chart-social: #8a7ca0;
  --chart-risk: #b27665;
  --chart-other: #8f989d;
  --shadow: 0 24px 70px rgba(12, 16, 22, 0.16);
  --shadow-soft: 0 14px 42px rgba(12, 16, 22, 0.07);
  --radius-card: 24px;
  --radius-control: 16px;
  --radius-pill: 999px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

* {
  margin: 0;
}

html {
  min-height: 100%;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(rgba(36, 33, 29, 0.032) 0.8px, transparent 0.8px),
    linear-gradient(180deg, rgba(255, 254, 250, 0.82), rgba(247, 246, 241, 0.92));
  background-size: 7px 7px, 100% 100%;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

p,
h1,
h2,
h3,
strong,
b {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 20;
  transform: translateY(calc(-100% - 32px));
  border-radius: var(--radius-pill);
  padding: 10px 14px;
  color: var(--paper);
  background: var(--ink);
  transition: transform 180ms var(--ease-out);
  pointer-events: none;
}

.skip-link:focus-visible {
  transform: translateY(0);
  pointer-events: auto;
}

.app-shell {
  width: min(100%, 430px);
  margin-inline: auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(38px + env(safe-area-inset-bottom));
}

.masthead {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 2px 4px 0;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(253, 253, 255, 0.78);
  font-size: 0.92rem;
  font-weight: 760;
  box-shadow: 0 1px 8px rgba(29, 29, 31, 0.05);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0;
}

.brand-subtitle {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 720;
}

.install-button {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  color: var(--blue);
  background: transparent;
  font-weight: 680;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.install-button:active {
  transform: scale(0.97);
}

.stage-hero {
  display: grid;
  gap: 18px;
  padding: 30px 2px 22px;
  color: var(--ink);
  text-align: center;
}

.stage-hero-main {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.stage-badge-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.stage-badge,
.stage-tone,
.quiet-badge,
.date-chip,
.panel-code {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  padding: 0 12px;
  font-size: 0.76rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
}

.stage-badge {
  color: var(--paper);
  background: var(--ink);
}

.stage-badge.small {
  color: var(--ink);
  background: var(--panel-soft);
}

.stage-tone,
.quiet-badge,
.panel-code {
  color: var(--muted);
  background: var(--panel-soft);
}

.stage-hero h2 {
  max-width: 100%;
  font-size: 2.44rem;
  line-height: 1.04;
  font-weight: 820;
  letter-spacing: 0;
}

.stage-hero p {
  max-width: 31ch;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.56;
}

.stage-hero-main strong {
  color: var(--red);
  font-size: 0.94rem;
  font-weight: 760;
}

.stage-yellow .stage-hero-main strong,
.stage-blue .stage-hero-main strong {
  color: var(--blue-strong);
}

.stage-green .stage-hero-main strong {
  color: var(--green);
}

.hero-data {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(253, 253, 255, 0.82);
  box-shadow: var(--shadow-soft);
}

.stage-hero .metric-card {
  border: 0;
  border-radius: 0;
  padding: 14px 8px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.stage-hero .metric-card + .metric-card {
  border-left: 1px solid var(--line);
}

.stage-hero .metric-card span,
.stage-hero .metric-card small {
  color: var(--muted);
}

.stage-hero .metric-card strong {
  color: var(--ink);
  font-size: 1.12rem;
}

.stage-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-inline: 2px;
}

.track-step {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 680;
}

.track-step span {
  height: 4px;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.11);
}

.track-step.is-done span {
  background: var(--green);
}

.track-step.is-active {
  color: var(--ink);
}

.track-step.is-active span {
  background: var(--blue);
}

.dock {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  width: 100%;
  margin: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px;
  background: rgba(253, 253, 255, 0.78);
  box-shadow: 0 16px 38px rgba(29, 29, 31, 0.08);
  backdrop-filter: blur(22px);
}

.dock-item {
  min-width: 0;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font-size: 0.78rem;
  font-weight: 720;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.dock-item.is-active {
  color: var(--ink);
  background: var(--panel-soft);
}

.section-heading {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 8px 8px;
  text-align: center;
}

.section-heading h1 {
  max-width: 11ch;
  font-size: 2.08rem;
  line-height: 1.08;
  font-weight: 820;
  letter-spacing: 0;
}

.date-chip {
  color: var(--ink);
  background: rgba(253, 253, 255, 0.78);
  box-shadow: 0 1px 8px rgba(29, 29, 31, 0.05);
}

.app-main {
  display: grid;
}

.view {
  display: none;
}

.view.is-active {
  display: grid;
  gap: 14px;
}

.panel,
.score-panel,
.metric-card {
  border: 0;
  border-radius: var(--radius-card);
  background: rgba(253, 253, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 22px;
}

.maintenance-stack {
  display: grid;
  gap: 10px;
  margin-top: 2px;
}

.utility-panel {
  overflow: hidden;
  padding: 0;
  background: rgba(253, 253, 255, 0.72);
  box-shadow: 0 8px 24px rgba(29, 29, 31, 0.045);
}

.utility-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 16px 18px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: background 160ms var(--ease-out);
}

.utility-summary::-webkit-details-marker {
  display: none;
}

.utility-summary::after {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-left: -2px;
  border-right: 1.8px solid var(--muted-2);
  border-bottom: 1.8px solid var(--muted-2);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms var(--ease-out), border-color 180ms var(--ease-out);
}

.utility-summary:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.62);
  outline-offset: -4px;
  border-radius: var(--radius-card);
}

.utility-panel[open] .utility-summary::after {
  transform: rotate(225deg) translate(-2px, -1px);
  border-color: var(--ink-soft);
}

.utility-summary b,
.utility-summary small {
  display: block;
}

.utility-summary b {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 780;
}

.utility-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.utility-summary .panel-code {
  margin-left: auto;
}

.utility-content {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding: 16px 18px 18px;
}

.utility-content .rule-list {
  margin-top: 0;
}

.utility-content .cloud-actions,
.utility-content .cloud-status,
.utility-content .danger {
  margin-top: 0;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-heading.compact {
  align-items: center;
}

.panel-heading h2 {
  color: var(--ink);
  font-size: 1.22rem;
  line-height: 1.16;
  font-weight: 780;
}

.panel-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

.score-panel {
  --score: 0deg;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.score-ring {
  display: grid;
  width: 96px;
  height: 96px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 58%, transparent 59%),
    conic-gradient(var(--blue) var(--score), rgba(0, 113, 227, 0.12) 0deg);
}

.score-ring span {
  color: var(--ink);
  font-size: 1.82rem;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.score-ring small {
  margin-top: -24px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 680;
}

.score-copy {
  min-width: 0;
}

.score-copy h2 {
  font-size: 1.22rem;
  line-height: 1.18;
  font-weight: 780;
}

.score-copy p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
}

.score-parts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.score-parts span {
  border-radius: var(--radius-pill);
  padding: 6px 9px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.74rem;
  font-weight: 680;
}

.score-parts span.is-done {
  color: var(--blue-strong);
  background: var(--blue-soft);
}

.guide-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-radius: var(--radius-card);
  padding: 20px;
  color: var(--paper);
  background: linear-gradient(180deg, #262629, var(--ink));
  box-shadow: var(--shadow);
}

.guide-panel span {
  display: block;
  color: rgba(251, 251, 253, 0.62);
  font-size: 0.78rem;
  font-weight: 680;
}

.guide-panel h2 {
  margin-top: 5px;
  font-size: 1.34rem;
  line-height: 1.1;
  font-weight: 780;
}

.guide-panel p {
  margin-top: 8px;
  color: rgba(251, 251, 253, 0.76);
  font-size: 0.92rem;
}

.guide-panel small {
  display: block;
  margin-top: 10px;
  color: rgba(251, 251, 253, 0.58);
  font-size: 0.78rem;
}

.guide-action {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 760;
  white-space: nowrap;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.guide-action:active {
  transform: scale(0.97);
}

.action-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border-radius: var(--radius-pill);
  padding: 5px;
  background: rgba(253, 253, 255, 0.76);
  box-shadow: 0 10px 28px rgba(29, 29, 31, 0.06);
}

.action-switcher button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font-weight: 720;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.action-switcher button.is-active {
  color: var(--ink);
  background: var(--panel-soft);
}

.action-switcher button:active {
  transform: scale(0.97);
}

.stats-switcher {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  padding: 5px;
  background: var(--panel-soft);
}

.stats-switcher button {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--muted);
  background: transparent;
  font-weight: 760;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.stats-switcher button.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 1px 8px rgba(29, 29, 31, 0.04);
}

.stats-switcher button:active {
  transform: scale(0.97);
}

.form-panel {
  display: grid;
  gap: 15px;
}

.form-panel.action-panel:not(.is-active) {
  display: none;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span,
.choice-field legend {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--panel-soft);
  outline: none;
  transition: border-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

input,
select {
  min-height: 52px;
  padding: 0 14px;
}

textarea {
  min-height: 112px;
  resize: vertical;
  padding: 13px 14px;
  line-height: 1.45;
}

input::placeholder {
  color: var(--muted-2);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(0, 113, 227, 0.36);
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.12);
}

.choice-field {
  display: grid;
  gap: 9px;
  min-width: 0;
  border: 0;
  padding: 0;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.choice-grid label {
  min-width: 0;
}

.choice-grid input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.choice-grid span {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: var(--radius-control);
  padding: 0 8px;
  color: var(--ink-soft);
  background: var(--panel-soft);
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.16;
  text-align: center;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.choice-grid input:checked + span {
  color: var(--paper);
  background: var(--ink);
}

.choice-grid input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14);
}

.choice-grid label:active span {
  transform: scale(0.97);
}

.quick-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.quick-template {
  display: grid;
  min-height: 62px;
  gap: 4px;
  border: 0;
  border-radius: 14px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel-soft);
  text-align: left;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.quick-template b,
.quick-template span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-template b {
  font-size: 0.88rem;
  font-weight: 760;
}

.quick-template span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.quick-template:active {
  transform: scale(0.97);
}

.check-stack {
  display: grid;
  gap: 10px;
}

.switch-row {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  border-radius: var(--radius-control);
  padding: 9px 12px;
  color: var(--ink-soft);
  background: var(--panel-soft);
  font-weight: 700;
}

.switch-row input {
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 28px;
  min-height: 28px;
  appearance: none;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0;
  background: #d7d7dc;
  transition: background-color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.switch-row input::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 4px rgba(29, 29, 31, 0.22);
  transition: transform 160ms var(--ease-out);
}

.switch-row input:checked {
  background: var(--blue);
}

.switch-row input:checked::after {
  transform: translateX(20px);
}

.switch-row span {
  min-width: 0;
}

.button,
.file-button {
  min-height: 50px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 18px;
  font-weight: 760;
  line-height: 1;
  text-decoration: none;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out), box-shadow 150ms var(--ease-out);
}

.button:active,
.file-button:active,
.dock-item:active {
  transform: scale(0.97);
}

.button:focus-visible,
.file-button:focus-visible,
.dock-item:focus-visible,
.record-delete:focus-visible,
.lesson-toggle:focus-visible,
.quick-template:focus-visible,
.mini-button:focus-visible,
.quick-prompts button:focus-visible,
.stats-switcher button:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.56);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.primary {
  color: var(--paper);
  background: var(--blue);
  box-shadow: 0 10px 22px rgba(0, 113, 227, 0.18);
}

.secondary {
  color: var(--paper);
  background: var(--ink);
}

.ghost,
.file-button {
  color: var(--ink);
  background: var(--panel-soft);
}

.danger {
  width: 100%;
  margin-top: 12px;
  color: var(--red);
  background: var(--red-soft);
}

.button-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cloud-actions {
  margin-top: 14px;
}

.cloud-status {
  margin-top: 12px;
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.86rem;
}

.cloud-status[data-tone="success"] {
  color: var(--green);
  background: var(--green-soft);
}

.cloud-status[data-tone="danger"] {
  color: var(--red);
  background: var(--red-soft);
}

.file-button {
  display: grid;
  place-items: center;
}

.file-button input {
  display: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.simulation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric-card {
  min-width: 0;
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.metric-card small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.74rem;
}

.record-list,
.risk-list,
.progress-list,
.gate-list,
.lesson-list {
  display: grid;
  gap: 10px;
}

.record,
.risk-card,
.gate-item,
.month-close-grid div,
.lesson-card,
.lock-panel,
.allocation-note,
.insight-line,
.growth-map article,
.gate-matrix article {
  border-radius: 18px;
  background: var(--panel-soft);
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
}

.record.is-flagged,
.risk-card.danger {
  background: var(--red-soft);
}

.record b,
.record strong {
  display: block;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.record small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
}

.record-side {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.record-delete {
  min-height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 9px;
  color: var(--muted);
  background: rgba(253, 253, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
}

.empty-state {
  border-radius: 18px;
  padding: 15px;
  color: var(--muted);
  background: var(--panel-soft);
  font-size: 0.92rem;
}

.budget-list {
  display: grid;
  gap: 10px;
}

.budget-row {
  display: grid;
  gap: 10px;
  border-radius: 18px;
  padding: 14px;
  color: var(--ink);
  background: var(--panel-soft);
}

.budget-row-head,
.budget-row-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.budget-row-head span {
  min-width: 0;
}

.budget-row-head b,
.budget-row-head strong {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 780;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
}

.budget-row-head strong {
  white-space: nowrap;
}

.budget-row-head small,
.budget-row-foot {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.budget-row-head small {
  display: block;
  margin-top: 4px;
}

.budget-track {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(12, 16, 22, 0.08);
}

.budget-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--chart-other);
  transition: width 220ms var(--ease-out);
}

.budget-row.is-reverse .budget-track {
  background: rgba(107, 138, 119, 0.2);
}

.budget-tone-living .budget-track span {
  background: var(--chart-living);
}

.budget-tone-growth .budget-track span,
.budget-tone-good .budget-track span {
  background: var(--green);
}

.budget-tone-warn .budget-track span {
  background: var(--amber);
}

.budget-tone-danger {
  color: var(--red);
  background: var(--red-soft);
}

.budget-tone-danger .budget-row-head b,
.budget-tone-danger .budget-row-head strong {
  color: #703a31;
}

.budget-tone-danger .budget-row-head small,
.budget-tone-danger .budget-row-foot {
  color: rgba(112, 58, 49, 0.78);
}

.budget-tone-danger .budget-track {
  background: rgba(112, 58, 49, 0.16);
}

.budget-tone-danger .budget-track span {
  background: var(--red);
}

.budget-tone-good {
  background: var(--green-soft);
}

.budget-tone-warn {
  background: var(--amber-soft);
}

.ledger-search {
  margin-bottom: 12px;
}

.ledger-switcher {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ledger-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.ledger-record {
  align-items: flex-start;
}

.ledger-kind {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: var(--radius-pill);
  padding: 0 8px;
  color: var(--muted);
  background: rgba(253, 253, 255, 0.66);
  font-size: 0.7rem;
  font-weight: 760;
}

.close-check-list,
.bill-list,
.review-grid {
  display: grid;
  gap: 10px;
}

.close-check-list {
  margin: 12px 0;
}

.close-check,
.bill-item,
.review-grid article,
.review-next,
.bill-summary {
  border-radius: 18px;
  background: var(--panel-soft);
}

.close-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
}

.close-check > span,
.bill-status {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  border-radius: var(--radius-pill);
  padding: 0 8px;
  color: var(--muted);
  background: rgba(253, 253, 255, 0.64);
  font-size: 0.68rem;
  font-weight: 780;
  white-space: nowrap;
}

.close-check b,
.bill-item b,
.review-next b {
  display: block;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 780;
}

.close-check small,
.bill-item small,
.review-grid small,
.review-next p,
.bill-summary span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 660;
}

.close-check.needs-review {
  background: var(--amber-soft);
}

.bill-summary {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
  padding: 14px;
}

.bill-summary strong {
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.bill-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 13px;
}

.bill-main {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
}

.bill-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.bill-side strong {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bill-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.mini-button {
  min-height: 30px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 10px;
  color: var(--ink);
  background: rgba(253, 253, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 760;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out), color 150ms var(--ease-out);
}

.mini-button.dark {
  color: var(--paper);
  background: var(--ink);
}

.mini-button.ghost {
  color: var(--muted);
  background: transparent;
}

.mini-button:active {
  transform: scale(0.97);
}

.bill-tone-warn {
  background: var(--amber-soft);
}

.bill-tone-danger {
  background: var(--red-soft);
}

.bill-tone-good {
  background: var(--green-soft);
}

.recurring-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.review-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-grid article,
.review-next {
  padding: 14px;
}

.review-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.review-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.review-grid article.is-risk {
  background: var(--red-soft);
}

.review-next {
  margin-top: 10px;
}

.risk-card {
  padding: 14px;
}

.risk-card.warning {
  background: var(--amber-soft);
}

.risk-card b {
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 760;
}

.risk-card p {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.lock-panel {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
  padding: 14px;
  background: linear-gradient(180deg, #f2f2f5, #ececf0);
}

.lock-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--ink);
}

.lock-mark::before,
.lock-mark::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.lock-mark::before {
  top: 9px;
  width: 14px;
  height: 11px;
  border: 2px solid var(--paper);
  border-bottom: 0;
  border-radius: 9px 9px 0 0;
}

.lock-mark::after {
  top: 18px;
  width: 18px;
  height: 13px;
  border-radius: 4px;
  background: var(--paper);
}

.lock-panel h3,
.lesson-card h3,
.gate-matrix h3 {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.16;
  font-weight: 780;
}

.lock-panel p,
.lesson-card p,
.allocation-note p,
.insight-line p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
}

.gate-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 13px;
}

.gate-item > span {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid rgba(29, 29, 31, 0.18);
  border-radius: 50%;
  background: var(--panel);
}

.gate-item.is-done > span {
  border-color: var(--blue);
  background: radial-gradient(circle at center, var(--blue) 0 45%, transparent 48%);
}

.gate-item b {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 760;
}

.gate-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-row {
  display: grid;
  gap: 8px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 680;
}

.progress-head strong {
  color: var(--ink-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.09);
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 220ms var(--ease-out);
}

.progress-row.debt .bar > span {
  background: var(--red);
}

.progress-row.risk .bar > span {
  background: var(--amber);
}

.progress-row.cash .bar > span {
  background: var(--green);
}

.progress-row.surplus .bar > span {
  background: var(--blue);
}

.progress-row.stable .bar > span {
  background: var(--amber);
}

.progress-row.learning .bar > span,
.progress-row.cap .bar > span {
  background: var(--violet);
}

.pie-card {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 2px 0 18px;
}

.pie-chart-wrap {
  position: relative;
  width: min(100%, 266px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

.pie-chart {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.pie-track,
.pie-segment {
  fill: none;
  transform: rotate(-90deg);
  transform-origin: 110px 110px;
}

.pie-track {
  stroke: rgba(29, 29, 31, 0.07);
  stroke-width: 28;
}

.pie-segment {
  stroke-width: 27;
  stroke-linecap: butt;
  opacity: 0.72;
  cursor: pointer;
  animation: pie-enter 260ms var(--ease-out) backwards;
  animation-delay: calc(var(--segment-index) * 38ms);
  transition:
    filter 180ms var(--ease-out),
    opacity 180ms var(--ease-out),
    stroke-width 180ms var(--ease-out);
}

.pie-segment.is-selected {
  stroke-width: 35;
  opacity: 1;
  filter: drop-shadow(0 9px 14px rgba(29, 29, 31, 0.13));
}

.pie-segment:focus-visible {
  outline: none;
  stroke-width: 36;
  opacity: 1;
  filter: drop-shadow(0 0 7px rgba(0, 113, 227, 0.38));
}

.tone-living {
  stroke: var(--chart-living);
  background: var(--chart-living);
}

.tone-growth {
  stroke: var(--chart-growth);
  background: var(--chart-growth);
}

.tone-social {
  stroke: var(--chart-social);
  background: var(--chart-social);
}

.tone-risk {
  stroke: var(--chart-risk);
  background: var(--chart-risk);
}

.tone-other {
  stroke: var(--chart-other);
  background: var(--chart-other);
}

.pie-center {
  position: absolute;
  inset: 50%;
  width: 132px;
  height: 132px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: var(--ink);
  background: var(--panel);
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(29, 29, 31, 0.07),
    0 16px 34px rgba(29, 29, 31, 0.08);
  text-align: center;
  pointer-events: none;
}

.pie-center span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 780;
}

.pie-center strong {
  color: var(--ink);
  font-size: 1.38rem;
  font-weight: 820;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  animation: value-pop 180ms var(--ease-out);
}

.pie-center small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.pie-insight {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  border-radius: 18px;
  padding: 11px 13px;
  color: var(--ink-soft);
  background: var(--panel-soft);
  font-size: 0.86rem;
  font-weight: 680;
}

.pie-insight.is-risk {
  color: #7f4b16;
  background: var(--amber-soft);
}

.direction-list {
  display: grid;
  gap: 10px;
}

.direction-row {
  display: grid;
  gap: 9px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 18px;
  padding: 14px;
  color: inherit;
  background: var(--panel-soft);
  text-align: left;
  transition:
    background 180ms var(--ease-out),
    border-color 180ms var(--ease-out),
    box-shadow 180ms var(--ease-out),
    transform 160ms var(--ease-out);
}

.direction-row.is-risk {
  background: var(--amber-soft);
}

.direction-row.is-selected {
  border-color: rgba(0, 113, 227, 0.22);
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(29, 29, 31, 0.06);
}

.direction-row:active {
  transform: scale(0.985);
}

.direction-row:focus-visible {
  outline: 2px solid rgba(0, 113, 227, 0.62);
  outline-offset: 2px;
}

.direction-head,
.direction-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.direction-title {
  display: flex;
  align-items: flex-start;
  min-width: 0;
  gap: 9px;
}

.direction-swatch {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  margin-top: 7px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(29, 29, 31, 0.08);
}

.direction-head b {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 780;
}

.direction-head small,
.direction-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 680;
}

.direction-head strong {
  color: var(--ink);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.direction-bar {
  height: 8px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(29, 29, 31, 0.08);
}

.direction-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--blue);
  transition: width 220ms var(--ease-out);
}

.direction-row.is-risk .direction-bar span {
  background: var(--amber);
}

@keyframes pie-enter {
  from {
    transform: rotate(-96deg) scale(0.96);
  }

  to {
    transform: rotate(-90deg) scale(1);
  }
}

@keyframes value-pop {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stats-warning {
  margin-top: 12px;
  border-radius: 18px;
  padding: 12px 14px;
  color: var(--amber);
  background: var(--amber-soft);
  font-size: 0.86rem;
  font-weight: 700;
}

.month-close-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.month-close-grid div {
  padding: 14px;
}

.month-close-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 680;
}

.month-close-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.rule-list {
  display: grid;
  gap: 11px;
  padding-left: 1.25rem;
  color: var(--ink-soft);
}

.rule-list li::marker {
  color: var(--blue);
  font-weight: 780;
}

.system-svg {
  width: 100%;
  overflow: visible;
}

.system-svg .path {
  fill: none;
  stroke: rgba(29, 29, 31, 0.18);
  stroke-width: 2;
}

.system-svg marker path {
  fill: rgba(29, 29, 31, 0.2);
}

.system-svg rect {
  stroke-width: 1;
  transition: fill 180ms var(--ease-out), stroke 180ms var(--ease-out);
}

.system-svg text {
  font-size: 12px;
  font-weight: 760;
  fill: currentColor;
}

.system-svg .is-open {
  color: var(--ink);
}

.system-svg .is-open rect {
  fill: var(--paper);
  stroke: rgba(0, 113, 227, 0.28);
}

.system-svg .is-locked {
  color: var(--muted-2);
}

.system-svg .is-locked rect {
  fill: #ededf0;
  stroke: rgba(29, 29, 31, 0.08);
}

.gate-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gate-matrix article {
  min-width: 0;
  padding: 14px;
}

.gate-matrix article.is-open {
  background: var(--green-soft);
}

.gate-matrix span,
.lesson-card span,
.growth-map span,
.allocation-note b,
.insight-line b {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 720;
}

.gate-matrix small {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.lesson-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.lesson-card.is-done {
  background: var(--green-soft);
}

.lesson-toggle {
  min-height: 38px;
  border: 0;
  border-radius: var(--radius-pill);
  padding: 0 12px;
  color: var(--paper);
  background: var(--ink);
  font-size: 0.82rem;
  font-weight: 760;
  white-space: nowrap;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.lesson-card.is-done .lesson-toggle {
  color: var(--green);
  background: rgba(47, 125, 90, 0.12);
}

.lesson-toggle:active {
  transform: scale(0.97);
}

.allocation-note,
.insight-line {
  margin-top: 12px;
  padding: 15px;
}

.growth-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.growth-map article {
  padding: 14px;
}

.growth-map strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 1.24rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.growth-map small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ai-status-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.ai-status-compact > div {
  min-width: 0;
}

.ai-status-compact span,
.ai-status-compact small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 680;
}

.ai-status-compact strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.18;
  font-weight: 800;
}

.ai-status-compact small {
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.ai-options {
  margin-top: 14px;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.quick-prompts button {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-control);
  padding: 0 10px;
  color: var(--ink-soft);
  background: var(--panel-soft);
  font-size: 0.84rem;
  font-weight: 720;
  transition: transform 150ms var(--ease-out), background-color 150ms var(--ease-out);
}

.quick-prompts button:active {
  transform: scale(0.97);
}

.ai-message-list {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.ai-message {
  max-width: 92%;
  border-radius: 18px;
  padding: 14px;
  background: var(--panel-soft);
}

.ai-message.user {
  justify-self: end;
  color: var(--paper);
  background: var(--blue);
}

.ai-message.assistant {
  justify-self: start;
}

.ai-message b {
  display: block;
  font-size: 0.76rem;
  font-weight: 760;
  opacity: 0.76;
}

.ai-message p,
.ai-message li,
.ai-message blockquote {
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.55;
}

.markdown-body > *:first-child {
  margin-top: 6px;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5 {
  margin-top: 10px;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.2;
  font-weight: 800;
}

.ai-message.user .markdown-body h3,
.ai-message.user .markdown-body h4,
.ai-message.user .markdown-body h5 {
  color: var(--paper);
}

.markdown-body strong {
  font-weight: 820;
}

.markdown-body em {
  font-style: normal;
  color: var(--ink-soft);
}

.ai-message.user .markdown-body em {
  color: rgba(251, 251, 253, 0.8);
}

.markdown-body ul,
.markdown-body ol {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding-left: 1.18rem;
}

.markdown-body li::marker {
  color: var(--muted);
  font-weight: 780;
}

.markdown-body blockquote {
  border-left: 3px solid rgba(0, 113, 227, 0.32);
  padding-left: 10px;
  color: var(--ink-soft);
}

.markdown-body code {
  border-radius: 7px;
  padding: 2px 5px;
  color: var(--ink);
  background: rgba(29, 29, 31, 0.08);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
}

.ai-composer {
  display: grid;
  gap: 12px;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 14;
  width: min(calc(100% - 28px), 430px);
  margin-inline: auto;
  transform: translateY(14px) scale(0.98);
  border-radius: var(--radius-pill);
  padding: 13px 16px;
  color: var(--paper);
  background: rgba(29, 29, 31, 0.92);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out);
  text-align: center;
  font-weight: 720;
}

.toast.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast.danger {
  background: rgba(140, 42, 29, 0.94);
}

/* Hara / MUJI inspired visual pass: quiet paper, ink, hairlines, and restrained motion. */
.app-shell {
  padding-inline: 18px;
}

.masthead {
  gap: 14px;
  margin-bottom: 6px;
}

.masthead-top {
  padding-inline: 0;
}

.brand-mark {
  border-color: var(--line-strong);
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.brand-subtitle {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 680;
}

.install-button {
  min-height: 34px;
  color: var(--ink-soft);
  background: transparent;
}

.stage-hero {
  gap: 22px;
  padding: 36px 0 26px;
  text-align: left;
}

.stage-hero-main {
  justify-items: start;
  gap: 14px;
}

.stage-badge-row {
  justify-content: flex-start;
}

.stage-badge,
.stage-tone,
.quiet-badge,
.date-chip,
.panel-code {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 0.72rem;
  font-weight: 650;
}

.stage-badge {
  border-color: var(--ink);
  color: var(--paper);
  background: var(--ink);
}

.stage-badge.small,
.stage-tone,
.quiet-badge,
.panel-code {
  color: var(--muted);
  background: rgba(255, 254, 250, 0.58);
}

.stage-hero h2 {
  max-width: 9ch;
  font-size: 2.34rem;
  line-height: 1.05;
  font-weight: 760;
}

.stage-hero p {
  max-width: 28ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.stage-hero-main strong {
  color: var(--red);
}

.stage-yellow .stage-hero-main strong,
.stage-blue .stage-hero-main strong {
  color: var(--blue-strong);
}

.hero-data {
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.68);
  box-shadow: none;
}

.stage-hero .metric-card {
  padding: 16px 10px;
}

.stage-track {
  gap: 10px;
  padding: 0;
}

.track-step {
  gap: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

.track-step span {
  height: 2px;
  background: var(--line-strong);
}

.track-step.is-active span {
  background: var(--ink);
}

.track-step.is-done span {
  background: var(--green);
}

.dock {
  top: max(10px, env(safe-area-inset-top));
  gap: 2px;
  margin-bottom: 26px;
  border-radius: 10px;
  padding: 4px;
  background: rgba(255, 254, 250, 0.9);
  box-shadow: none;
  backdrop-filter: blur(12px);
}

.dock-item {
  min-height: 40px;
  border-radius: 7px;
  font-size: 0.76rem;
  font-weight: 650;
}

.dock-item.is-active {
  color: var(--paper);
  background: var(--ink);
}

.section-heading {
  justify-items: start;
  gap: 6px;
  padding: 26px 0 14px;
  text-align: left;
}

.section-heading h1 {
  max-width: 10ch;
  font-size: 2rem;
  line-height: 1.08;
  font-weight: 760;
}

.view.is-active {
  gap: 12px;
}

.panel,
.score-panel,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.72);
  box-shadow: none;
}

.panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: 1.12rem;
  font-weight: 720;
}

.panel-heading p {
  color: var(--muted);
  line-height: 1.62;
}

.utility-panel {
  background: rgba(255, 254, 250, 0.52);
  box-shadow: none;
}

.utility-summary {
  min-height: 62px;
  padding: 15px 16px;
}

.utility-summary b {
  font-size: 0.94rem;
  font-weight: 700;
}

.utility-content {
  gap: 13px;
  padding: 16px;
}

.score-ring {
  background:
    radial-gradient(circle at center, var(--panel) 0 58%, transparent 59%),
    conic-gradient(var(--ink) var(--score), rgba(36, 33, 29, 0.12) 0deg);
}

.score-parts span,
.quick-prompts button,
.ghost,
.file-button,
.action-switcher,
.stats-switcher,
.metric-card,
.record,
.risk-card,
.gate-item,
.month-close-grid div,
.lesson-card,
.lock-panel,
.allocation-note,
.insight-line,
.growth-map article,
.gate-matrix article,
.direction-row,
.pie-insight,
.cloud-status,
.switch-row,
.choice-grid span {
  background: rgba(238, 236, 228, 0.72);
}

.score-parts span.is-done {
  color: var(--ink);
  background: var(--green-soft);
}

.guide-panel {
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink);
  box-shadow: none;
}

.guide-panel span,
.guide-panel p,
.guide-panel small {
  color: rgba(255, 254, 250, 0.72);
}

.guide-action {
  border-radius: 6px;
  color: var(--ink);
  background: var(--paper);
}

.action-switcher,
.stats-switcher {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  box-shadow: none;
}

.action-switcher button,
.stats-switcher button {
  min-height: 40px;
  border-radius: 7px;
  font-weight: 650;
}

.action-switcher button.is-active,
.stats-switcher button.is-active {
  color: var(--paper);
  background: var(--ink);
  box-shadow: none;
}

input,
select,
textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.74);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: 0 0 0 3px rgba(49, 93, 107, 0.12);
}

.choice-grid input:checked + span {
  color: var(--paper);
  background: var(--ink);
}

.switch-row input {
  background: rgba(54, 48, 41, 0.22);
}

.switch-row input:checked {
  background: var(--ink);
}

.button,
.file-button {
  min-height: 48px;
  border-radius: 8px;
  font-weight: 700;
}

.button:active,
.file-button:active,
.dock-item:active,
.guide-action:active,
.action-switcher button:active,
.stats-switcher button:active,
.quick-prompts button:active,
.direction-row:active {
  transform: scale(0.985);
}

.primary {
  color: var(--paper);
  background: var(--ink);
  box-shadow: none;
}

.secondary {
  color: var(--paper);
  background: var(--blue-strong);
}

.danger {
  color: var(--red);
  background: var(--red-soft);
}

.metric-card {
  padding: 15px;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-weight: 600;
}

.metric-card strong {
  font-size: 1.24rem;
  font-weight: 760;
}

.record,
.risk-card,
.gate-item,
.month-close-grid div,
.lesson-card,
.lock-panel,
.allocation-note,
.insight-line,
.growth-map article,
.gate-matrix article,
.direction-row {
  border-radius: 8px;
}

.record-delete,
.lesson-toggle {
  border-radius: 6px;
}

.risk-card.danger,
.record.is-flagged,
.direction-row.is-risk,
.pie-insight.is-risk,
.stats-warning,
.cloud-status[data-tone="danger"] {
  color: var(--red);
  background: var(--red-soft);
}

.cloud-status[data-tone="success"] {
  color: var(--green);
  background: var(--green-soft);
}

.pie-track {
  stroke: rgba(54, 48, 41, 0.1);
}

.pie-segment {
  opacity: 0.78;
}

.pie-segment.is-selected {
  opacity: 1;
  filter: none;
}

.pie-center {
  background: var(--paper);
  box-shadow: inset 0 0 0 1px var(--line);
}

.direction-row.is-selected {
  border-color: var(--ink);
  background: var(--paper);
  box-shadow: none;
}

.ai-message {
  border-radius: 8px;
  background: rgba(238, 236, 228, 0.74);
}

.ai-message.user {
  color: var(--paper);
  background: var(--ink);
}

.ai-status-compact strong,
.direction-head b,
.record b,
.record strong,
.metric-card strong {
  letter-spacing: 0;
}

.button:focus-visible,
.file-button:focus-visible,
.dock-item:focus-visible,
.record-delete:focus-visible,
.lesson-toggle:focus-visible,
.quick-prompts button:focus-visible,
.stats-switcher button:focus-visible,
.direction-row:focus-visible,
.pie-segment:focus-visible {
  outline-color: rgba(49, 93, 107, 0.72);
}

/* SOHub-inspired final direction: pale stage, oversized type, black feature blocks, no soft SaaS chrome. */
body {
  background-color: var(--bg);
  background-image: none;
}

.app-shell {
  width: min(100%, 430px);
  padding: max(18px, env(safe-area-inset-top)) 14px calc(44px + env(safe-area-inset-bottom));
}

.masthead {
  gap: 18px;
  margin-bottom: 8px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: var(--ink);
  background: transparent;
  font-weight: 760;
}

.brand-subtitle {
  font-size: 0.94rem;
  font-weight: 760;
}

.stage-hero {
  padding: 46px 0 30px;
}

.stage-badge,
.stage-tone,
.quiet-badge,
.date-chip,
.panel-code {
  min-height: 28px;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(12, 16, 22, 0.08);
  font-weight: 700;
}

.stage-badge {
  color: var(--paper);
  background: var(--ink);
}

.stage-hero h2 {
  max-width: 8.5ch;
  font-size: 2.82rem;
  line-height: 0.98;
  font-weight: 820;
}

.stage-hero p {
  max-width: 28ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.72;
}

.stage-hero-main strong {
  color: var(--red);
  font-weight: 760;
}

.hero-data {
  border: 1px solid rgba(12, 16, 22, 0.16);
  border-radius: 18px;
  background: rgba(248, 252, 253, 0.76);
}

.stage-track {
  gap: 12px;
}

.track-step span {
  height: 2px;
}

.track-step.is-active span {
  background: var(--ink);
}

.dock {
  border: 1px solid rgba(12, 16, 22, 0.1);
  border-radius: var(--radius-pill);
  padding: 6px;
  background: rgba(248, 252, 253, 0.86);
}

.dock-item {
  min-height: 42px;
  border-radius: var(--radius-pill);
}

.dock-item.is-active {
  color: var(--paper);
  background: var(--ink);
}

.section-heading {
  padding: 34px 0 16px;
}

.section-heading h1 {
  max-width: 9ch;
  font-size: 2.46rem;
  line-height: 0.98;
  font-weight: 820;
}

.view.is-active {
  gap: 14px;
}

.panel,
.score-panel,
.metric-card {
  border: 1px solid rgba(12, 16, 22, 0.11);
  border-radius: var(--radius-card);
  background: rgba(248, 252, 253, 0.82);
  box-shadow: none;
}

.panel {
  padding: 22px;
}

.panel-heading h2 {
  font-size: 1.34rem;
  line-height: 1.05;
  font-weight: 790;
}

.panel-heading p {
  color: var(--muted);
}

.metric-grid,
.simulation-grid,
.field-grid,
.month-close-grid {
  gap: 12px;
}

.metric-card {
  background: rgba(217, 224, 227, 0.45);
}

.metric-card strong {
  font-size: 1.42rem;
  font-weight: 820;
}

.guide-panel {
  border: 0;
  border-radius: 24px;
  background: var(--ink);
  box-shadow: none;
}

.guide-panel h2 {
  font-size: 1.66rem;
  line-height: 0.98;
  font-weight: 810;
}

.guide-action,
.button,
.file-button,
.quick-template,
.mini-button,
.quick-prompts button,
.action-switcher button,
.stats-switcher button {
  transition: transform 180ms var(--ease-out), background-color 180ms var(--ease-out), color 180ms var(--ease-out), opacity 180ms var(--ease-out);
}

.action-switcher,
.stats-switcher {
  border: 1px solid rgba(12, 16, 22, 0.09);
  border-radius: 18px;
  background: rgba(248, 252, 253, 0.72);
}

.action-switcher button,
.stats-switcher button {
  border-radius: 14px;
}

.action-switcher button.is-active,
.stats-switcher button.is-active {
  color: var(--paper);
  background: var(--ink);
}

input,
select,
textarea,
.choice-grid span,
.switch-row {
  border-radius: 16px;
  background: rgba(217, 224, 227, 0.52);
}

input,
select,
textarea {
  border: 1px solid rgba(12, 16, 22, 0.08);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(12, 16, 22, 0.08);
}

.button,
.file-button {
  border-radius: 16px;
}

.primary {
  background: var(--ink);
}

.ghost,
.file-button,
.quick-template,
.mini-button,
.quick-prompts button {
  background: rgba(217, 224, 227, 0.62);
}

.quick-template {
  border-radius: 14px;
}

.record,
.risk-card,
.budget-row,
.close-check,
.bill-item,
.bill-summary,
.review-grid article,
.review-next,
.gate-item,
.month-close-grid div,
.lesson-card,
.lock-panel,
.allocation-note,
.insight-line,
.growth-map article,
.gate-matrix article,
.direction-row,
.pie-insight,
.cloud-status {
  border-radius: 16px;
  background: rgba(217, 224, 227, 0.48);
}

.budget-tone-good {
  background: var(--green-soft);
}

.budget-tone-warn {
  background: var(--amber-soft);
}

.budget-tone-danger {
  background: var(--red-soft);
}

.bill-tone-good {
  background: var(--green-soft);
}

.bill-tone-warn,
.close-check.needs-review {
  background: var(--amber-soft);
}

.bill-tone-danger,
.review-grid article.is-risk {
  background: var(--red-soft);
}

.mini-button.dark {
  color: var(--paper);
  background: var(--ink);
}

.mini-button.ghost {
  color: var(--muted);
  background: transparent;
}

#directionPanel {
  border: 0;
  color: var(--paper);
  background: var(--ink);
}

#directionPanel .panel-heading h2,
#directionPanel .direction-head b,
#directionPanel .direction-head strong,
#directionPanel .pie-center strong,
#directionPanel .pie-center span {
  color: var(--paper);
}

#directionPanel .panel-heading p,
#directionPanel .direction-head small,
#directionPanel .direction-meta,
#directionPanel .pie-center small,
#directionPanel .pie-insight {
  color: rgba(240, 246, 248, 0.7);
}

#directionPanel .panel-code,
#directionPanel .quiet-badge {
  color: var(--paper);
  background: rgba(240, 246, 248, 0.1);
}

#directionPanel .pie-track {
  stroke: rgba(240, 246, 248, 0.14);
}

#directionPanel .pie-center {
  background: #11181c;
  box-shadow: inset 0 0 0 1px rgba(240, 246, 248, 0.12);
}

#directionPanel .pie-insight,
#directionPanel .direction-row {
  background: rgba(240, 246, 248, 0.08);
}

#directionPanel .direction-row.is-selected {
  border-color: rgba(240, 246, 248, 0.78);
  background: rgba(240, 246, 248, 0.12);
}

#directionPanel .direction-row.is-risk {
  background: rgba(194, 106, 90, 0.22);
}

#directionPanel .direction-bar {
  background: rgba(240, 246, 248, 0.12);
}

.utility-panel {
  background: rgba(248, 252, 253, 0.62);
}

.utility-summary {
  border-radius: inherit;
}

.utility-summary b {
  font-size: 1.02rem;
}

.ai-message {
  border-radius: 18px;
}

.ai-message.assistant {
  background: rgba(217, 224, 227, 0.62);
}

.ai-message.user {
  background: var(--ink);
}

.toast {
  border-radius: 18px;
  background: rgba(12, 16, 22, 0.94);
}

@media (hover: hover) and (pointer: fine) {
  .button:hover,
  .file-button:hover,
  .dock-item:hover,
  .install-button:hover,
  .quick-template:hover,
  .mini-button:hover,
  .record-delete:hover {
    filter: brightness(0.98);
  }

  .lesson-toggle:hover {
    filter: brightness(1.05);
  }

  .quick-prompts button:hover {
    background: rgba(226, 223, 213, 0.92);
  }

  .stats-switcher button:hover {
    color: var(--ink);
  }

  .utility-summary:hover {
    background: rgba(241, 241, 244, 0.68);
  }

  .pie-segment:hover {
    opacity: 1;
    stroke-width: 32;
  }

  .direction-row:hover {
    background: rgba(255, 254, 250, 0.9);
  }

  .quick-template:hover {
    color: var(--ink);
    background: rgba(255, 254, 250, 0.86);
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding-inline: 12px;
  }

  .guide-panel {
    grid-template-columns: 1fr;
  }

  .guide-action {
    justify-self: start;
  }

  .metric-grid,
  .simulation-grid,
  .field-grid,
  .month-close-grid,
  .review-grid {
    grid-template-columns: 1fr;
  }

  .gate-matrix {
    grid-template-columns: 1fr;
  }

  .lesson-card {
    grid-template-columns: 1fr;
  }

  .lesson-toggle {
    justify-self: start;
  }

  .quick-prompts {
    grid-template-columns: 1fr;
  }

  .choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-heading {
    flex-direction: column;
    gap: 9px;
  }

  .panel-heading.compact {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 360px) {
  body {
    font-size: 15px;
  }

  .stage-hero h2 {
    font-size: 2.16rem;
  }

  .score-panel {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .choice-grid {
    grid-template-columns: 1fr;
  }

  .quick-template-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dock {
    gap: 3px;
    padding: 4px;
  }

  .dock-item {
    min-height: 38px;
    font-size: 0.7rem;
  }

  .record {
    grid-template-columns: 1fr;
  }

  .bill-item {
    grid-template-columns: 1fr;
  }

  .record-side {
    justify-items: start;
  }

  .bill-side {
    justify-items: start;
  }

  .bill-actions {
    justify-content: flex-start;
  }

  .pie-chart-wrap {
    width: min(100%, 238px);
  }

  .pie-center {
    width: 118px;
    height: 118px;
  }

  .pie-center strong {
    font-size: 1.2rem;
  }
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: #0c1016;
  box-shadow: none;
}

.brand-mark img {
  width: 82%;
  height: 82%;
  object-fit: contain;
}

/* Daily-use shell: keep the rules, remove the lecture from the first screen. */
.app-shell {
  padding-top: max(12px, env(safe-area-inset-top));
}

.masthead {
  gap: 10px;
  margin-bottom: 10px;
}

.masthead-top {
  padding-inline: 2px;
}

.stage-hero {
  gap: 10px;
  padding: 6px 0 8px;
  text-align: left;
}

.stage-compact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-radius: 18px;
  padding: 12px;
  color: var(--paper);
  background: var(--ink);
}

.stage-compact-main {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.stage-compact .stage-badge-row {
  justify-content: flex-start;
  gap: 6px;
}

.stage-compact .stage-badge,
.stage-compact .stage-tone {
  min-height: 24px;
  padding: 0 9px;
  font-size: 0.68rem;
}

.stage-compact .stage-badge {
  color: var(--ink);
  background: var(--paper);
}

.stage-compact .stage-tone {
  color: rgba(248, 252, 253, 0.72);
  background: rgba(248, 252, 253, 0.12);
}

.stage-compact b {
  color: var(--paper);
  font-size: 0.96rem;
  font-weight: 780;
  line-height: 1.18;
}

.stage-compact small {
  color: rgba(248, 252, 253, 0.62);
  font-size: 0.76rem;
  font-weight: 660;
}

.stage-compact .mini-button {
  min-height: 36px;
  border-radius: 12px;
  color: var(--ink);
  background: var(--paper);
  white-space: nowrap;
}

.hero-data {
  border-radius: 18px;
  box-shadow: none;
}

.stage-hero .metric-card {
  padding: 12px 10px;
}

.stage-hero .metric-card strong {
  font-size: 1rem;
}

.dock {
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  margin-bottom: 14px;
  box-shadow: none;
}

.dock-item {
  min-height: 40px;
}

#view-today .section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px 8px;
  text-align: left;
}

#view-today .section-heading h1 {
  max-width: none;
  font-size: 1.46rem;
  line-height: 1.08;
}

.daily-brief {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.daily-brief-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.daily-brief-head span,
.daily-brief-grid span,
.rhythm-item span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.daily-brief-head strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.86rem;
  line-height: 1;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
}

.daily-brief-head small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.daily-brief-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.daily-brief-grid div {
  min-width: 0;
  border-radius: 14px;
  padding: 11px 10px;
  background: rgba(217, 224, 227, 0.5);
}

.daily-brief-grid b {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 800;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.daily-brief-grid .is-risk {
  background: var(--red-soft);
}

.guide-panel {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  border-radius: 20px;
  padding: 18px;
}

.guide-panel h2 {
  margin-top: 6px;
  font-size: 1.54rem;
  line-height: 1.04;
}

.guide-panel p {
  margin-top: 7px;
  max-width: 28ch;
  font-size: 0.9rem;
}

.guide-action {
  align-self: center;
  min-height: 42px;
  border-radius: 14px;
}

.daily-rhythm-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.rhythm-item {
  display: grid;
  min-width: 0;
  min-height: 86px;
  align-content: space-between;
  gap: 7px;
  border: 0;
  border-radius: 18px;
  padding: 12px;
  color: var(--ink);
  background: rgba(253, 253, 255, 0.82);
  box-shadow: none;
  text-align: left;
  transition: transform 160ms var(--ease-out), background-color 160ms var(--ease-out);
}

.rhythm-item b {
  display: block;
  color: var(--ink);
  font-size: 0.96rem;
  line-height: 1.08;
  font-weight: 800;
}

.rhythm-item small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 660;
  line-height: 1.22;
}

.rhythm-item.needs-review {
  background: var(--amber-soft);
}

.rhythm-item.is-risk {
  background: var(--red-soft);
}

.rhythm-item.is-good {
  background: var(--green-soft);
}

.rhythm-item:active {
  transform: scale(0.98);
}

.action-switcher {
  margin-top: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .rhythm-item:hover {
    background: rgba(255, 254, 250, 0.92);
  }
}

@media (max-width: 380px) {
  .daily-rhythm-panel,
  .daily-brief-grid {
    grid-template-columns: 1fr;
  }

  .stage-compact {
    grid-template-columns: 1fr;
  }

  .stage-compact .mini-button {
    justify-self: start;
  }
}
