/* Cover selection uses the active botanical theme and existing artwork only. */
.backup-section { margin-top: 32px; padding: 24px 0 80px; border-top: 1px solid var(--line); }
.backup-section h2 { margin: 6px 0 12px; font-family: Georgia, "Yu Mincho", serif; font-size: 23px; }
.backup-subtitle { margin: 26px 0 12px; font-size: 14px; color: var(--accent); }
.crypto-note { margin: 12px 0 18px; color: var(--muted); font-size: 12px; line-height: 1.7; }
#crypto-status:empty { display: none; }
.backup-section .form-note { margin: 12px 0; color: var(--muted); font-size: 12px; line-height: 1.7; text-align: left; }
.backup-actions { display: grid; gap: 12px; margin-top: 20px; }
.backup-actions button { width: 100%; min-height: 48px; margin: 0; }
#backup-status:empty { display: none; }
button.transaction-row { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; }
button.transaction-row:hover { background: var(--accent-soft); }
button.transaction-row:focus-visible { outline-offset: -2px; border-radius: 6px; }
.contribution-section { margin: 28px 0 12px; }
.contribution-row .transaction-amount { color: var(--accent); }
.editor-error { color: #9b3d35; font-size: 12px; line-height: 1.6; }
.editor-error:empty { display: none; }
.cover-picker { min-width: 0; margin: 0 0 24px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.cover-picker legend { padding: 0 6px; font-size: 15px; font-weight: 600; }
.cover-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 8px; }
.cover-option { position: relative; display: flex; align-items: center; flex-direction: column; gap: 8px; min-width: 0; padding: 5px 2px; border: 0; background: transparent; color: var(--ink); font-size: 11px; overflow-wrap: anywhere; }
.cover-option img { display: block; width: 58px; height: 58px; max-width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 3px solid transparent; background: var(--accent-soft); }
.cover-option[aria-pressed="true"] img { border-color: var(--accent); }
.cover-check { position: absolute; top: 3px; left: calc(50% + 13px); display: none; place-items: center; width: 19px; height: 19px; border-radius: 50%; color: white; background: var(--accent); font-size: 12px; }
.cover-option[aria-pressed="true"] .cover-check { display: grid; }
.cover-selection, .cover-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.cover-selection { margin: 0 0 12px; }
.cover-note { margin: 14px 0 0; }

/* Visual system adapted from the supplied My Money design reference. */
:root {
  --ink: #242927;
  --muted: #626c66;
  --accent: #2e543f;
  --accent-deep: #284b39;
  --accent-mid: #63846c;
  --accent-soft: #f1f6ef;
  --accent-tint: #e9f1e9;
  --accent-line: #aac2af;
  --accent-track: #e9ebe8;
  --botanical-filter: none;
  --green: var(--accent);
  --green-deep: var(--accent-deep);
  --sage: var(--accent-mid);
  --line: #e9ece8;
  --surface: #f8f9f6;
  --soft: #f4f6f2;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  color: var(--ink);
  background: #fff;
}

:root[data-accent-theme="sage"] {
  --accent: #496d56;
  --accent-deep: #3e604b;
  --accent-mid: #78917c;
  --accent-soft: #f2f6f1;
  --accent-tint: #eaf1e9;
  --accent-line: #abc0ac;
  --accent-track: #e9ede8;
  --botanical-filter: saturate(.73);
}

:root[data-accent-theme="dusty-blue"] {
  --accent: #42647c;
  --accent-deep: #35566e;
  --accent-mid: #7292a2;
  --accent-soft: #f1f5f7;
  --accent-tint: #e9f0f4;
  --accent-line: #afc2ca;
  --accent-track: #e8edf0;
  --botanical-filter: hue-rotate(72deg) saturate(.68);
}

:root[data-accent-theme="terracotta"] {
  --accent: #92553f;
  --accent-deep: #804531;
  --accent-mid: #a77763;
  --accent-soft: #faf4f0;
  --accent-tint: #f6ece6;
  --accent-line: #d1b4a8;
  --accent-track: #f0eae6;
  --botanical-filter: hue-rotate(225deg) saturate(.66);
}

:root[data-accent-theme="lavender"] {
  --accent: #705a7e;
  --accent-deep: #60496e;
  --accent-mid: #9785a0;
  --accent-soft: #f7f3f9;
  --accent-tint: #f0eaf3;
  --accent-line: #c8b8d0;
  --accent-track: #eee9f0;
  --botanical-filter: hue-rotate(126deg) saturate(.65);
}

body { background: #fff; }
.app-shell { max-width: 430px; }
main { padding: 0 20px calc(104px + env(safe-area-inset-bottom)); }
.screen { animation-duration: .16s; }
.site-header { min-height: 112px; padding: max(28px, calc(env(safe-area-inset-top) + 8px)) 20px 10px; overflow: visible; }
.app-shell[data-screen]:not([data-screen="home"]) .site-header { display: none; }
.month-label { color: #4e5852; font-size: 10px; font-weight: 500; letter-spacing: .075em; margin: 0 0 2px; }
.brand-name { color: #1f2421; font: 700 28px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
.brand-dot, .title-dot { color: inherit; }
.header-botanical { position: absolute; width: 157px; height: 188px; top: 26px; right: -2px; object-fit: contain; opacity: .94; pointer-events: none; z-index: 0; filter: var(--botanical-filter); }
.profile-avatar { width: 47px; height: 47px; padding: 2px; border: 1px solid var(--accent-mid); border-radius: 50%; background: #fff; object-fit: cover; box-shadow: 0 2px 9px rgba(27,48,34,.12); }
.profile-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
img[data-profile-image][src$="profile-leaf.svg"] { filter: var(--botanical-filter); }
.brand-dot, .title-dot { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.home-intro { display: none; }

/* Home: value first, then the gentle tip and compact goals. */
.balance-section { position: relative; padding-top: 4px; }
.balance-section h1 { font-size: 12px; line-height: 1.5; font-weight: 500; letter-spacing: 0; margin: 0 0 3px; }
.hero-amount { margin: 0 0 11px; color: #111713; font: 700 clamp(42px, 12.8vw, 56px)/1.06 Georgia, "Times New Roman", serif; letter-spacing: -.052em; white-space: nowrap; }
.progress-track { height: 6px; background: var(--accent-track); border-radius: 999px; }
.progress-track > span { background: linear-gradient(90deg, var(--accent-mid), var(--accent)); }
.budget-track { height: 6px; }
.budget-meta { margin-top: 8px; color: #343d37; font-size: 11px; }
.budget-meta strong { font-weight: 400; }
.budget-meta > span:last-child { color: #1f2922; font-weight: 600; }
.budget-caption { margin-top: 6px; padding: 0; border: 0; color: #87918a; font-size: 10px; }
.budget-caption strong { color: #77827a; font-size: 10px; font-weight: 500; }
.home-section { margin-top: 20px; }
.section-title-row { margin-bottom: 10px; }
.section-title-row .eyebrow { display: none; }
.section-title-row h2 { color: #1f2421; font: 700 22px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.03em; }
.text-link { color: var(--accent); font-size: 10px; font-weight: 500; }
.text-link span { padding-left: 2px; }
.suggestion-section { margin-top: 20px; }
.suggestion-section > .section-title-row { display: none; }
.growth-card { min-height: 91px; padding: 12px 48px 12px 67px; border: 1px solid #edf0ea; border-radius: 16px; background: linear-gradient(110deg, #fafbf8, #f6f8f3); box-shadow: none; position: relative; }
.growth-card::before { display: none; }
.growth-card::after { display: none; }
.suggestion-botanical { position: absolute; left: 6px; top: 50%; width: 56px; height: 76px; transform: translateY(-50%); object-fit: contain; filter: var(--botanical-filter); }
.growth-card-content { position: relative; z-index: 1; min-width: 0; }
.growth-card-head { margin: 0 0 3px; }
.growth-card-head .suggestion-leaf { display: none; }
.growth-eyebrow { color: var(--accent); font: 500 10px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 0; }
.growth-card h2, .growth-card h3 { margin: 0 0 2px; color: #27302a; font: 500 10px/1.3 -apple-system, BlinkMacSystemFont, sans-serif; }
.growth-card p { color: #26312a; font-size: 10px; line-height: 1.45; }
.growth-footer { display: block; margin: 3px 0 0; }
.growth-goal { color: var(--accent-deep); font-size: 11px; line-height: 1.35; }
.growth-card .growth-button { position: absolute; top: 50%; right: 10px; transform: translateY(-50%); width: 29px; min-height: 29px; height: 29px; padding: 0; border: 0; border-radius: 50%; background: var(--green); color: transparent; font-size: 0; }
.growth-card .growth-button::after { content: "→"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 17px Arial, sans-serif; }
.growth-card .growth-button:disabled { background: var(--accent-mid); opacity: .75; }
.growth-card .growth-button:disabled::after { content: "✓"; }

.home-goal-list { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; }
.home-goal, .goal-card { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 13px; align-items: center; min-width: 0; text-align: left; background: #fff; color: var(--ink); }
.home-goal { min-height: 92px; padding: 11px 12px; border: 0; border-radius: 0; box-shadow: none; }
.home-goal + .home-goal { border-top: 1px solid var(--line); }
.goal-thumb { display: block; width: 62px; height: 62px; border-radius: 50%; object-fit: cover; background: #edf2ec; flex: none; }
.goal-content { display: block; min-width: 0; width: 100%; }
.goal-top { margin: 0 0 9px; align-items: baseline; gap: 6px; }
.goal-name { color: #151b17; font-size: 12px; letter-spacing: .01em; line-height: 1.2; }
.goal-percent { color: #1f2922; font: 600 11px Arial, sans-serif; }
.goal-track, .goal-card .progress-track { display: block; width: 100%; height: 5px; background: var(--accent-track); }
.goal-track > span { background: var(--accent); }
.goal-values { display: flex; justify-content: flex-start; gap: 3px; margin: 6px 0 0; color: #38443b; font-size: 10px; line-height: 1.2; }
.goal-values strong { color: #303a33; font-size: 10px; font-weight: 500; }
.goal-deadline { color: #858e85; font-size: 9px; line-height: 1.1; margin: 5px 0 0; }

.daily-card { min-height: 76px; padding: 15px 16px; margin-top: 22px; border: 1px solid var(--line); border-radius: 15px; background: #fbfcfa; color: var(--ink); }
.daily-card::after { display: none; }
.daily-icon { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.daily-icon svg { width: 19px; height: 19px; }
.daily-card p { color: var(--muted); font-size: 10px; }
.daily-card strong { color: var(--ink); font: 700 20px Georgia, serif; }
.daily-note { color: var(--muted); font-size: 9px; }
.quick-grid { gap: 10px; }
.quick-action { min-height: 76px; padding: 12px; border-color: var(--line); border-radius: 15px; box-shadow: none; font-size: 11px; }
.quick-icon { width: 28px; height: 28px; border-radius: 9px; }
.quick-icon.green { background: var(--accent-tint); color: var(--accent); }
.quick-icon.outline { background: #f4f6f3; }
.quick-icon svg { width: 16px; height: 16px; }
.quick-arrow { bottom: 12px; right: 12px; color: var(--accent); }

/* Page headings and Money input use the reference's serif hierarchy. */
.screen-heading { padding: max(30px, calc(env(safe-area-inset-top) + 12px)) 0 22px; }
.money-heading, #screen-analysis > .screen-heading { position: relative; }
.money-heading::after, #screen-analysis > .screen-heading::after { content: ""; position: absolute; width: 103px; height: 122px; right: -17px; top: 7px; background: url("./assets/botanical-branch.svg") center / contain no-repeat; opacity: .74; filter: var(--botanical-filter); pointer-events: none; }
#screen-analysis > .screen-heading > p:last-child { display: none; }
.screen-heading .eyebrow { display: none; }
.screen-heading h1 { color: #151a17; font: 700 31px/1.16 Georgia, "Yu Mincho", serif; letter-spacing: -.04em; }
.screen-heading > p:last-child { margin-top: 6px; color: #5f6860; font-size: 11px; }
.screen-back { border: 0; background: transparent; color: var(--ink); width: 24px; height: 24px; padding: 0; margin-right: 7px; vertical-align: middle; }
.screen-back svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.money-heading { display: flex; align-items: center; gap: 2px; }
.money-heading h1 { font-family: "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif; font-size: 24px; }
.form-section { margin-top: 0; }
.form-section > .section-title-row { display: none; }
.field { gap: 6px; font-size: 10px; }
.field > span:first-child { color: #3b443e; font-size: 10px; font-weight: 500; }
.required, .optional { color: #9ba39b; font-size: 9px; }
.field input, .field select { min-width: 0; height: 56px; padding: 8px 13px; border: 1px solid #e3e6e2; border-radius: 13px; background-color: #fafbf9; color: var(--ink); font-size: 12px; }
.field-grid { gap: 9px; }
.field-grid .field input, .field-grid .field select { height: 64px; }
.field-grid .field select { padding-right: 25px; }
.field-date { min-height: 64px; gap: 4px; padding: 10px 13px; border: 1px solid #e3e6e2; border-radius: 13px; background: #fafbf9; cursor: pointer; }
.field-date input[type="date"] { display: block; width: 100%; height: 29px; min-height: 29px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 500; cursor: pointer; }
.field-date input[type="date"]::-webkit-calendar-picker-indicator { width: 19px; height: 19px; padding: 0; opacity: .8; cursor: pointer; }
.expense-goal-fields { display: grid; gap: 12px; margin-top: 2px; }
.living-expense-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 55px; padding: 10px 13px; border: 1px solid #e3e6e2; border-radius: 13px; background: #fafbf9; color: var(--ink); cursor: pointer; }
.living-expense-text { font-size: 12px; font-weight: 600; }
.living-expense-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.living-switch { position: relative; width: 42px; height: 24px; flex: none; border-radius: 99px; background: #ced5ce; transition: background .16s ease; }
.living-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(21, 36, 25, .14); transition: transform .16s ease; }
.living-expense-row input:checked + .living-switch { background: var(--accent); }
.living-expense-row input:checked + .living-switch::after { transform: translateX(18px); }
.living-expense-row input:focus-visible + .living-switch { outline: 2px solid var(--accent); outline-offset: 3px; }
.field-amount { gap: 2px; margin: 0 0 8px; }
.field-amount > span:first-child { color: #222a23; font-size: 14px; font-weight: 700; }
.amount-input-wrap { height: 71px; padding-left: 0; border: 0; border-radius: 0; background: #fff; color: #111713; font: 700 48px/1 Georgia, serif; }
.amount-input-wrap:focus-within { outline: 0; }
.amount-input-wrap input { flex: 1; width: 0; min-width: 0; height: 69px; padding: 0 0 0 7px; background: transparent; color: #111713; font: 700 48px/1 Georgia, serif; letter-spacing: -.055em; }
.amount-input-wrap input::placeholder { color: #c7ccc5; }
.primary-button { min-height: 53px; height: auto; margin-top: 6px; border-radius: 14px; background: var(--green-deep); font-size: 13px; box-shadow: none; }
.primary-button svg { display: none; }
.form-note { color: #9aa39a; font-size: 9px; }
.small-stat { margin-top: 27px; padding: 15px 0; display: flex; flex-direction: row; align-items: baseline; gap: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; color: var(--muted); font-size: 10px; }
.small-stat strong { color: var(--ink); font: 700 17px Georgia, serif; margin-left: auto; }
.small-stat-caption { color: var(--muted); font-size: 9px; }
.history-section { margin-top: 24px; }
.history-section h2 { font-family: Georgia, "Yu Mincho", serif; }
.transaction-list { border-top-color: var(--line); }
.transaction-row { min-height: 65px; padding: 10px 0; border-bottom-color: var(--line); }
.transaction-icon { width: 39px; height: 39px; border-radius: 50%; background: #f5eee8; color: #3a433b; font: 700 13px Georgia, serif; }
.transaction-icon[data-category="食費"] { background: #f7eee4; }
.transaction-icon[data-category="交通費"] { background: #e8f2f7; }
.transaction-icon[data-category="美容"] { background: #f6eaf3; }
.transaction-icon[data-category="消耗品"] { background: #f0f1e8; }
.transaction-info strong { color: #242b26; font-size: 12px; }
.transaction-info span { color: #7e8780; font-size: 10px; }
.transaction-amount { color: #222923; font-size: 12px; }

/* Goals follow the compact photo, title, thin bar, amount grid in the reference. */
.goal-header-actions .screen-heading { padding-bottom: 17px; }
.icon-button { width: 35px; height: 35px; border: 0; background: var(--green-deep); color: #fff; box-shadow: 0 2px 7px rgba(30,65,42,.14); }
.goal-header-actions { position: relative; }
.goal-header-actions::after { content: ""; position: absolute; right: -20px; top: 18px; width: 93px; height: 110px; background: url("./assets/botanical-branch.svg") center / contain no-repeat; opacity: .69; filter: var(--botanical-filter); pointer-events: none; z-index: 0; }
.goal-header-actions > * { position: relative; z-index: 1; }
.goals-summary { display: none; }
.goal-card-list { gap: 10px; }
.goal-card { grid-template-columns: 66px minmax(0, 1fr); min-height: 94px; gap: 13px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 2px 9px rgba(23,42,29,.018); }
.goal-card .goal-thumb { width: 66px; height: 66px; }
.goal-card .goal-top { margin-bottom: 10px; }
.goal-card .goal-name { font-size: 13px; }
.goal-card .goal-values, .goal-card .goal-values strong { font-size: 10px; }
.goal-card .goal-values { margin-top: 6px; }

/* Goal detail: panoramic cover and circular savings progress. */
.app-shell[data-view="goal-detail"] main { padding: 0 0 calc(104px + env(safe-area-inset-bottom)); }
#goal-detail .back-button { margin-left: 19px; padding: max(30px, calc(env(safe-area-inset-top) + 12px)) 0 12px; color: #202823; font-size: 11px; font-weight: 500; }
.detail-cover { position: relative; height: 194px; overflow: hidden; background: #d8e6e6; }
.detail-cover::after { content: ""; position: absolute; width: 119px; height: 140px; right: -13px; top: -20px; background: url("./assets/botanical-branch.svg") center / contain no-repeat; transform: rotate(-10deg); opacity: .93; filter: var(--botanical-filter); pointer-events: none; }
.detail-cover-image { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 48%; }
.detail-cover::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(7,30,29,.24), transparent 56%); pointer-events: none; }
.detail-heading { position: absolute; z-index: 2; left: 20px; top: 26px; right: 100px; padding: 0; color: #fff; text-shadow: 0 1px 6px rgba(15,37,36,.4); }
.detail-heading h1 { color: #fff; font: 700 28px/1.1 Georgia, serif; letter-spacing: -.03em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.detail-heading .goal-deadline { color: #fff; font-size: 10px; font-weight: 600; margin: 5px 0 0; }
.detail-heading #detail-subtitle { color: rgba(255,255,255,.92); font-size: 10px; line-height: 1.3; margin: 4px 0 0; }
.detail-hero { position: relative; z-index: 3; display: flex; flex-direction: column; align-items: center; margin: -69px 0 0; padding: 0 20px; border-radius: 0; background: transparent; color: var(--ink); }
.detail-hero > div:first-child { display: grid; gap: 0; }
.detail-ring { position: relative; width: 156px; height: 156px; display: grid; place-items: center; border: 7px solid #fff; border-radius: 50%; background: conic-gradient(var(--accent-mid) 0 var(--ring-progress, 36.6%), var(--accent-track) var(--ring-progress, 36.6%) 100%); box-shadow: 0 2px 12px rgba(28,53,38,.08); }
.detail-ring-center { width: 126px; height: 126px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 50%; background: #fff; }
.detail-ring-leaf { width: 26px; height: 26px; fill: none; stroke: var(--accent-mid); stroke-width: 1.2; }
.detail-ring #detail-percent { color: #1c241e; font: 700 31px/1.1 Georgia, serif; letter-spacing: -.04em; }
.detail-amount { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: center; gap: 6px; margin-top: 13px; max-width: 100%; color: #222a24; }
.detail-amount-main, .detail-amount-target { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.detail-hero .detail-amount-label { color: #69766c; font-size: 9px; font-weight: 500; }
.detail-amount strong { min-width: 0; overflow-wrap: anywhere; }
.detail-amount #detail-saved { color: #1d241f; font: 700 clamp(23px, 7vw, 29px) Georgia, serif; }
.detail-amount #detail-target { color: #252d26; font: 600 14px Georgia, serif; }
.detail-hero .detail-amount-separator { color: #737c72; font-size: 14px; }
.detail-finance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; max-width: 355px; margin-top: 16px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.detail-finance-grid > div { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 0 5px; text-align: center; }
.detail-finance-grid > div + div { border-left: 1px solid var(--line); }
.detail-hero .detail-finance-grid span { color: #69766c; font-size: 9px; font-weight: 500; }
.detail-finance-grid strong { color: var(--ink); font-size: clamp(11px, 3.35vw, 13px); line-height: 1.2; overflow-wrap: anywhere; }
.detail-track { width: 164px; height: 3px; margin-top: 12px; background: var(--accent-track); }
.detail-track > span { background: var(--accent); }
.detail-actions { display: flex; justify-content: center; margin: 22px 20px 0; padding: 0 0 16px; border-bottom: 1px solid var(--line); }
.detail-actions .contribution-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; min-height: 67px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 500; }
.detail-actions .contribution-button::before { content: "+"; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 26px/1 Georgia, serif; }
.detail-actions .edit-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 92px; min-height: 67px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 500; }
.detail-actions .edit-button::before { content: "✎"; display: grid; place-items: center; width: 39px; height: 39px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font: 22px Georgia, serif; }
.breakdown-section { margin: 16px 20px 0; }
.breakdown-section .section-title-row { margin-bottom: 5px; }
.breakdown-section .section-title-row h2 { font: 700 15px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; }
.breakdown-add { padding: 5px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 10px; font-weight: 500; }
.breakdown-row { min-height: 68px; position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.breakdown-row::before { content: "✦"; position: absolute; left: 0; top: 13px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 14px; }
.breakdown-labels { margin-bottom: 4px; color: #242c25; font-size: 11px; font-weight: 700; }
.breakdown-edit { color: var(--accent); font-size: 10px; font-weight: 500; }
.breakdown-meta { gap: 3px 8px; color: #5e6a60; font-size: 9px; }
.breakdown-track { height: 4px; margin-top: 7px; background: var(--accent-track); }
.breakdown-track > span { background: var(--accent-mid); }

/* Analysis centers the donut and lets the category legend breathe. */
.analysis-summary { min-height: 0; display: flex; flex-direction: column; gap: 0; padding: 8px 0 0; border: 0; border-radius: 0; background: #fff; }
.analysis-summary .eyebrow { display: none; }
.analysis-summary h2 { font-size: 10px; font-weight: 500; }
.analysis-summary > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.donut-chart { width: 202px; height: 202px; margin: 0 auto; transform: rotate(-90deg); }
.donut-chart > span, .analysis-donut-center { width: 137px; height: 137px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: #fff; transform: rotate(90deg); text-align: center; }
.analysis-donut-center .eyebrow { display: block; color: #323b34; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.analysis-donut-center small { color: #39453b; font-size: 10px; font-weight: 500; }
.analysis-donut-center h2 { margin: 0; color: #353e36; font-size: 10px; font-weight: 500; }
.analysis-donut-center strong { display: block; color: #1b211c; font: 700 24px/1 Georgia, serif; white-space: nowrap; }
.analysis-donut-center > span { color: var(--green); font-size: 10px; }
.analysis-finance-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.analysis-finance-grid > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 0 9px; }
.analysis-finance-grid > div:first-child { padding-left: 0; }
.analysis-finance-grid > div + div { border-left: 1px solid var(--line); padding-left: 17px; }
.analysis-finance-grid span { color: #69766c; font-size: 10px; }
.analysis-summary .analysis-finance-grid strong { color: var(--ink); font: 700 18px/1.2 Georgia, serif; overflow-wrap: anywhere; }
.category-section { margin-top: 24px; }
.category-section .section-title-row { margin-bottom: 8px; }
.category-row { padding: 8px 0; border: 0; }
.category-label { display: grid; grid-template-columns: minmax(0, 1fr) auto 35px; gap: 12px; margin: 0; color: #29322a; font-size: 11px; }
.category-name { min-width: 0; }
.category-dot { width: 8px; height: 8px; }
.category-label strong { font-size: 11px; font-weight: 500; }
.category-percent { text-align: right; color: #3a443a; font: 500 11px Arial, sans-serif; }
.category-track { display: none; }
.analysis-suggestion-card { margin-top: 31px; padding: 19px 18px 18px 92px; border-color: var(--line); border-radius: 17px; background: #fafbf8; box-shadow: none; }
.analysis-suggestion-card::before { content: ""; position: absolute; left: 5px; top: 50%; width: 83px; height: 128px; transform: translateY(-50%); background: url("./assets/botanical-branch.svg") center / contain no-repeat; opacity: .91; filter: var(--botanical-filter); }
.analysis-suggestion-card::after { display: none; }
.analysis-suggestion-card .growth-card-head { margin-bottom: 6px; }
.analysis-suggestion-card .growth-eyebrow { font: 700 10px Arial, sans-serif; letter-spacing: .05em; }
.analysis-suggestion-card h2 { font: 700 16px/1.3 Georgia, "Yu Mincho", serif; }
.analysis-suggestion-card p { color: #424d43; font-size: 11px; line-height: 1.65; }
.analysis-suggestion-card .growth-goal { margin: 10px 0 8px; }
.analysis-suggestion-card .growth-button { min-height: 42px; font-size: 11px; }

/* The fixed four-tab bar resembles the native iPhone reference. */
.bottom-nav { max-width: 430px; padding: 6px 7px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid #e5e9e4; background: rgba(255,255,255,.985); box-shadow: 0 -4px 14px rgba(24,45,31,.022); }
.nav-item { min-height: 51px; gap: 1px; color: #6b756c; font: 500 9px Arial, sans-serif; }
.nav-item svg { width: 25px; height: 25px; padding: 3px; stroke-width: 1.45; }
.nav-item.is-active { color: var(--green-deep); }
.nav-item.is-active svg { width: 30px; height: 30px; padding: 5px; border-radius: 11px; background: var(--accent-soft); stroke-width: 2; }
.toast { max-width: 360px; bottom: calc(77px + env(safe-area-inset-bottom)); }

/* Profile / Appearance keeps the same quiet, phone-sized visual language. */
#screen-profile { position: relative; min-height: calc(100dvh - 85px - env(safe-area-inset-bottom)); overflow-x: clip; }
#screen-profile::before { content: ""; position: absolute; top: 85px; right: -27px; width: 153px; height: 181px; background: url("./assets/botanical-branch.svg") center / contain no-repeat; opacity: .52; filter: var(--botanical-filter); pointer-events: none; }
.profile-page-header { position: relative; display: flex; align-items: center; justify-content: center; min-height: 63px; padding: max(26px, calc(env(safe-area-inset-top) + 8px)) 0 0; }
.profile-page-header h1 { margin: 0; color: var(--ink); font: 700 27px/1.15 Georgia, "Yu Mincho", serif; letter-spacing: -.035em; }
.profile-back { position: absolute; left: 0; bottom: 2px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.profile-back svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.profile-back:hover { background: var(--accent-soft); }
.profile-preview { position: relative; z-index: 1; width: 116px; height: 116px; margin: 29px auto 0; padding: 4px; border: 1px solid var(--accent-mid); border-radius: 50%; background: #fff; box-shadow: 0 3px 15px rgba(26,42,31,.07); }
.profile-preview-image { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: center; background: #f0f3ef; }
.profile-photo-actions { position: relative; z-index: 1; display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 9px; margin: 17px 0 0; }
.photo-change-button, .photo-remove-button { min-height: 44px; padding: 0 17px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.photo-change-button { border: 1px solid var(--accent-deep); background: var(--accent-deep); color: #fff; }
.photo-change-button:hover { background: var(--accent); }
.photo-remove-button { border: 1px solid var(--line); background: #fff; color: var(--accent-deep); }
.photo-remove-button:hover:not(:disabled) { border-color: var(--accent-line); background: var(--accent-soft); }
.photo-remove-button:disabled { color: #9aa29b; cursor: default; opacity: .65; }
.appearance-section { position: relative; z-index: 1; margin: 33px 0 0; padding-top: 23px; border-top: 1px solid var(--line); }
.appearance-section .eyebrow { color: var(--accent); font-size: 9px; font-weight: 700; letter-spacing: .14em; }
.appearance-section h2 { margin: 5px 0 17px; color: var(--ink); font: 700 23px/1.2 Georgia, "Yu Mincho", serif; letter-spacing: -.025em; }
.theme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.theme-option { --theme-color: #2e543f; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; min-height: 112px; padding: 13px 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); text-align: center; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.theme-option[data-theme="sage"] { --theme-color: #496d56; }
.theme-option[data-theme="dusty-blue"] { --theme-color: #42647c; }
.theme-option[data-theme="terracotta"] { --theme-color: #92553f; }
.theme-option[data-theme="lavender"] { --theme-color: #705a7e; }
.theme-option:hover { border-color: var(--accent-line); }
.theme-option:has(.theme-radio:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-option:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.theme-radio { position: absolute; width: 1px; height: 1px; opacity: 0; }
.theme-swatch { display: block; width: 48px; height: 48px; flex: none; border: 4px solid #fff; border-radius: 50%; background: var(--theme-color); box-shadow: 0 0 0 1px rgba(33,44,36,.12); }
.theme-name { min-width: 0; color: var(--ink); font-size: 11px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.theme-check { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; line-height: 1; opacity: 0; }
.theme-radio:checked ~ .theme-check { opacity: 1; }

/* Existing high-specificity controls continue to follow the chosen accent. */
.quick-action:hover, .goal-card:hover, .home-goal:hover { border-color: var(--accent-line); }
.goal-card .progress-track > span { background: var(--accent); }
.growth-button, .analysis-suggestion-card .growth-button { border-color: var(--accent); background: var(--accent); }
.growth-button:hover, .analysis-suggestion-card .growth-button:hover { background: var(--accent-deep); }
.checkbox-row input { accent-color: var(--accent); }
.breakdown-editor-note { margin: -3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.edit-button { border-color: var(--accent-line); color: var(--accent); }
.icon-button:hover { border-color: var(--accent-line); background: var(--accent-soft); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--accent); }

@media (max-width: 360px) {
  .site-header { padding-left: 17px; padding-right: 17px; }
  main { padding-left: 17px; padding-right: 17px; }
  .goal-header-actions::after { right: -17px; }
  #expense-form .field-grid { grid-template-columns: 1fr 1fr; }
  #expense-form .field-grid .field select { font-size: 11px; }
  .goal-values { flex-wrap: wrap; }
}

@media (min-width: 680px) {
  body { background: #fafbf9; }
  .app-shell { margin: 20px auto; min-height: calc(100vh - 40px); border: 1px solid #edf0eb; border-radius: 27px; box-shadow: 0 10px 42px rgba(27,49,34,.06); overflow: hidden; }
  .bottom-nav { border-right: 1px solid #edf0eb; border-left: 1px solid #edf0eb; border-radius: 0 0 27px 27px; }
}
