:root {
  --green: #4e6b4c;
  --green-dark: #355334;
  --sand: #cfb38f;
  --sand-soft: #e9d9bd;
  --ivory: #fcf9ed;
  --ink: #314532;
  --muted: #718070;
  --line: rgba(78, 107, 76, 0.13);
  --shadow: 0 12px 30px rgba(68, 81, 55, 0.08);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(145deg, #f0e5cf 0%, var(--ivory) 46%, #e8e6d8 100%);
  color: var(--ink);
}
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }
.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: env(safe-area-inset-top) 20px calc(92px + env(safe-area-inset-bottom));
  background: rgba(252, 249, 237, 0.92);
  box-shadow: 0 0 60px rgba(54, 71, 49, 0.14);
  overflow: hidden;
}
.view { animation: enter .26s ease-out; }
@keyframes enter { from { opacity: .35; transform: translateY(7px) } to { opacity: 1; transform: none } }
.eyebrow { margin: 16px 0 8px; color: var(--muted); font-size: 14px; letter-spacing: .04em; }
h1 { margin: 0 0 24px; font-size: clamp(34px, 8vw, 43px); line-height: 1.12; font-family: "Songti SC", "STSong", serif; font-weight: 600; letter-spacing: .02em; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 15px; }
p { margin: 0; }
.section-title { display: flex; align-items: center; gap: 9px; margin: 25px 4px 12px; font-size: 16px; font-weight: 700; }
.section-title .glyph { color: var(--green); font-size: 20px; }
.card {
  border: 0;
  border-radius: 20px;
  padding: 18px;
  margin: 14px 0;
  background: rgba(255, 253, 247, .74);
  box-shadow: none;
}
.card.sand { background: linear-gradient(135deg, #ead9bc, var(--sand-soft)); border-color: transparent; }
.card.green { color: var(--ivory); background: linear-gradient(135deg, var(--green), #587956); border-color: transparent; }
.card.compact { padding: 14px 16px; border-radius: 17px; }
.status-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; }
.status-number { font-size: 20px; font-weight: 800; color: var(--green); }
.status-strip small { display: block; color: var(--muted); margin-bottom: 3px; }
.capacity-hint { grid-column: 1 / -1; padding-top: 10px; border-top: 1px solid rgba(78, 107, 76, .13); font-size: 14px; }
.status-edit { grid-column: 1 / -1; justify-self: start; }
.home-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 12px; }
.home-quick-grid .card { margin: 0; }
.home-status small, .meditation-shortcut small { display: block; color: var(--muted); font-size: 12px; }
.status-pair { display: flex; gap: 11px; margin: 8px 0 10px; }
.status-pair span { color: var(--muted); font-size: 12px; }
.status-pair b { color: var(--green); font-size: 24px; line-height: 1; }
.status-pair em { display: block; margin-top: 3px; font-style: normal; }
.home-status .mini-button { min-height: 31px; padding: 4px 0; }
.meditation-shortcut { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; width: 100%; text-align: left; color: var(--ink); }
.meditation-shortcut b { display: block; margin: 2px 0; font-size: 15px; }
.meditation-shortcut em { display: block; color: var(--muted); font-size: 11px; font-style: normal; }
.meditation-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--ivory); background: var(--green); font-size: 22px; }
.main-card { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; }
.main-card h2 { font-family: "Songti SC", "STSong", serif; font-size: 37px; }
.main-card .main-label { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.starburst { font-size: 29px; color: #fcf9ed; line-height: 1; }
.main-card .next { font-size: 17px; line-height: 1.6; }
.row-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.button-card { width: 100%; text-align: left; }
.row-card .row-icon { font-size: 24px; color: var(--green); width: 28px; text-align: center; }
.row-card .row-copy { flex: 1; }
.row-card small { display: block; margin-bottom: 4px; color: var(--muted); }
.row-card b { font-size: 17px; }
.chevron { color: var(--green); font-size: 23px; }
.home-duo { display: grid; grid-template-columns: .9fr 1.1fr; gap: 10px; margin: 13px 0; }
.home-duo .card { margin: 0; }
.home-expectation { display: flex; flex-direction: column; justify-content: space-between; min-height: 128px; background: linear-gradient(135deg, #ead9bc, var(--sand-soft)); }
.home-expectation small { color: var(--muted); }
.home-expectation b { display: block; margin: 7px 0; line-height: 1.4; font-family: "Songti SC", "STSong", serif; font-size: 21px; }
.home-expectation .mini-button { align-self: flex-start; min-height: 32px; padding: 4px 0; }
.home-worry { width: 100%; min-height: 128px; text-align: left; align-items: flex-start; padding: 15px; }
.home-worry .row-icon { width: auto; font-size: 21px; }
.home-worry .row-copy { overflow: hidden; }
.home-worry .row-copy b { display: -webkit-box; overflow: hidden; font-size: 14px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.home-worry .chevron { align-self: center; }
.primary, .secondary, .outline, .mini-button {
  font-weight: 750;
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
.primary { width: 100%; min-height: 52px; padding: 12px 20px; border-radius: 16px; background: var(--green); color: var(--ivory); box-shadow: 0 8px 18px rgba(53,83,52,.16); }
.primary:active, .secondary:active, .outline:active, .mini-button:active { transform: scale(.98); }
.secondary { min-height: 45px; padding: 9px 14px; border-radius: 14px; background: var(--sand); color: var(--ink); }
.outline { min-height: 44px; padding: 8px 3px; background: transparent; color: var(--green); }
.mini-button { min-height: 32px; padding: 4px 0; background: transparent; color: var(--green); font-size: 13px; }
.split-actions { display: flex; gap: 10px; }
.split-actions > * { flex: 1; }
.tabbar {
  position: fixed;
  z-index: 5;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(78, 107, 76, .13);
  background: rgba(252,249,237,.97);
  backdrop-filter: blur(12px);
}
.tab { padding: 6px 1px; background: transparent; color: #677465; border-radius: 16px; }
.tab span { display: block; font-size: 22px; line-height: 22px; font-family: Georgia, serif; }
.tab b { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; }
.tab.active { color: var(--green); background: rgba(78, 107, 76, .07); }
.stack { display: grid; gap: 11px; }
.meter { height: 10px; overflow: hidden; background: rgba(78,107,76,.14); border-radius: 99px; }
.meter span { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.capacity-grid { display: grid; grid-template-columns: 1fr auto; gap: 13px; align-items: center; }
.capacity-grid b { font-size: 26px; }
.plan-item { display: flex; align-items: center; gap: 13px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.plan-item:last-child { border-bottom: 0; }
.schedule-list { padding-top: 4px; padding-bottom: 4px; }
.schedule-item { gap: 9px; }
.schedule-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.schedule-actions .mini-button { min-height: 30px; padding: 3px 0; }
.mini-button.danger { color: #9c4b42; background: transparent; }
.empty-state { padding: 10px 2px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.plan-icon { width: 37px; height: 37px; display: grid; place-items: center; flex: none; border-radius: 13px; background: var(--sand-soft); color: var(--green); font-size: 19px; }
.plan-item .plan-copy { flex: 1; }
.plan-item small { display: block; color: var(--muted); margin-bottom: 3px; }
.plan-load { font-size: 13px; color: var(--green); font-weight: 800; }
.subnav { display: flex; gap: 8px; margin: -8px 0 16px; overflow-x: auto; padding-bottom: 4px; }
.chip { white-space: nowrap; padding: 8px 3px; margin-right: 14px; background: transparent; color: var(--muted); }
.chip.active { color: var(--green); box-shadow: inset 0 -2px 0 var(--green); }
.record-area { width: 100%; min-height: 210px; resize: vertical; border: 0; border-radius: 25px; padding: 18px; outline: none; color: var(--ink); line-height: 1.8; background: linear-gradient(135deg, #f1e1c5, var(--sand-soft)); }
.record-note { color: var(--muted); font-size: 13px; margin: 12px 3px; }
.preview { border: 0; background: #fffdf8; }
.preview-path { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin: 10px 0 14px; font-size: 13px; color: var(--green); }
.tag { display: inline-flex; align-items: center; border-radius: 99px; padding: 6px 10px; background: var(--sand-soft); font-size: 12px; font-weight: 800; color: var(--green); }
.preview-section { padding: 14px 0; border-top: 1px dashed rgba(78, 107, 76, .25); }
.preview-section:first-of-type { border-top: 0; }
.preview-section h3 { margin-bottom: 7px; }
.preview-section p { line-height: 1.6; font-size: 14px; }
.onedrive-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 0; border-top: 1px dashed rgba(78, 107, 76, .25); }
.onedrive-box b, .onedrive-box small { display: block; }
.onedrive-box small { margin-top: 4px; font-size: 12px; }
.connected { color: var(--green); }
.disconnected { color: #9c6a35; }
.onedrive-actions { align-items: center; margin-top: 10px; }
.onedrive-actions .mini-button { flex: 0 0 auto; }
.worry-header { color: var(--muted); font-size: 15px; line-height: 1.7; }
.worry-card h2 { font-size: 23px; line-height: 1.45; }
.worry-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 17px; }
.worry-meta div { padding-top: 10px; border-top: 1px solid rgba(78,107,76,.17); }
.worry-meta small { display: block; margin-bottom: 4px; color: var(--muted); }
.expectation-result { min-height: 166px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.expectation-result small { color: var(--muted); }
.expectation-result b { margin: 12px 0 8px; font-size: 30px; font-family: "Songti SC", serif; }
.expectation-result p { color: var(--muted); font-size: 14px; }
.choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.choice { min-height: 78px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: #fffdf7; color: var(--green); }
.choice span { display: block; font-size: 23px; margin-bottom: 5px; }
.roulette { display: grid; place-items: center; width: 176px; height: 176px; margin: 18px auto; border-radius: 50%; color: var(--ivory); background: radial-gradient(circle at 35% 30%, #668561, var(--green-dark)); box-shadow: 0 10px 24px rgba(78,107,76,.22), inset 0 0 0 9px rgba(252,249,237,.12); text-align: center; font-weight: 800; line-height: 1.7; }
.roulette span { display: block; font-size: 28px; }
.meditation-select { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.meditation-option { min-height: 112px; text-align: left; padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--green); }
.meditation-option:first-child { padding-left: 3px; }
.meditation-option.active { color: var(--ivory); background: var(--green); }
.meditation-option span { display: block; font-size: 28px; margin-bottom: 9px; }
.quiet-session { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 25px 18px 18px; text-align: center; }
.quiet-session > small { color: var(--muted); font-size: 13px; }
.quiet-session .split-actions { width: 100%; margin-top: 8px; }
.breath-orb { display: grid; place-items: center; width: 128px; height: 128px; border-radius: 50%; background: rgba(78, 107, 76, .12); }
.breath-orb i { display: block; width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle at 36% 32%, #8eab89, var(--green)); box-shadow: 0 10px 25px rgba(78, 107, 76, .2); }
.quiet-session.is-playing .breath-orb i { animation: quiet-breathe 7s ease-in-out infinite; }
@keyframes quiet-breathe { 0%, 100% { transform: scale(.72); opacity: .72; } 50% { transform: scale(1.48); opacity: 1; } }
.wave { height: 70px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.wave i { width: 4px; border-radius: 3px; background: var(--green); animation: breathe 1.3s ease-in-out infinite alternate; }
.wave i:nth-child(2n) { animation-delay: .2s; }
.wave i:nth-child(3n) { animation-delay: .4s; }
@keyframes breathe { from { height: 10px } to { height: 46px } }
.audio-controls { display: grid; grid-template-columns: 1fr 66px 1fr; gap: 9px; align-items: center; text-align: center; font-size: 13px; }
.audio-play { width: 64px; height: 64px; border-radius: 50%; color: var(--ivory); background: var(--green); font-size: 22px; }
.milestone { display: grid; grid-template-columns: 40px 1fr; gap: 14px; position: relative; padding-bottom: 19px; }
.milestone:last-child { padding-bottom: 0; }
.milestone:not(:last-child)::before { content: ""; position: absolute; left: 19px; top: 39px; bottom: -1px; border-left: 2px dashed var(--line); }
.node { z-index: 1; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--sand); color: var(--muted); background: var(--ivory); }
.milestone.done .node { color: var(--ivory); background: var(--green); border-color: var(--green); }
.milestone.current .node { border: 7px solid var(--green); box-shadow: 0 0 0 4px var(--sand-soft); }
.milestone small { display: block; color: var(--muted); margin-top: 3px; }
.review-prompt { min-height: 96px; background: transparent; border-bottom: 1px solid var(--line); border-radius: 0; }
.review-prompt h3 { margin-bottom: 8px; font-size: 18px; }
.review-prompt p { color: var(--muted); line-height: 1.55; font-size: 14px; }
.modal-backdrop { position: fixed; z-index: 10; inset: 0; display: flex; align-items: flex-end; background: rgba(31, 46, 31, .28); }
.sheet { width: min(100%, 480px); margin: 0 auto; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--ivory); box-shadow: 0 -12px 30px rgba(31,46,31,.16); }
.sheet h2 { font-size: 23px; margin-bottom: 8px; }
.sheet p { line-height: 1.65; color: var(--muted); margin-bottom: 17px; }
.sheet .primary { margin-top: 12px; }
.field { display: block; margin: 13px 0; }
.field span { display: block; margin: 0 2px 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; color: var(--ink); background: #fffdf7; outline-color: var(--green); }
.field textarea { min-height: 86px; resize: vertical; line-height: 1.6; }
#toast { position: fixed; z-index: 30; left: 50%; bottom: 105px; transform: translate(-50%, 16px); width: max-content; max-width: calc(100% - 40px); padding: 11px 16px; border-radius: 99px; color: var(--ivory); background: var(--green-dark); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: .2s ease; font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 520px) { .app-shell { border-left: 1px solid rgba(78,107,76,.12); border-right: 1px solid rgba(78,107,76,.12); } }
