:root {
  color-scheme: light;
  --bg: #f7f4f2;
  --paper: #ffffff;
  --paper-soft: #fbfaf9;
  --ink: #1f2226;
  --muted: #74787d;
  --line: #e8e5e2;
  --soft-line: rgba(31, 34, 38, 0.08);
  --theme-a: #c9112d;
  --theme-b: #ef2e5e;
  --theme-c: #8d1727;
  --theme-pale: #fff1f3;
  --shadow: 0 18px 46px rgba(30, 34, 40, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body,
button,
input,
select,
textarea {
  word-break: keep-all;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(540px 420px at 100% -80px, rgba(255,255,255,.92), transparent 70%),
    linear-gradient(180deg, #fff 0%, var(--bg) 42%, #fff 100%);
  color: var(--ink);
  overflow-x: hidden;
}
body.branch-wedding {
  --theme-a: #c9112d;
  --theme-b: #ef2e5e;
  --theme-c: #8d1727;
  --theme-pale: #fff1f3;
}
body.branch-birth {
  --theme-a: #166f85;
  --theme-b: #48b7aa;
  --theme-c: #314f83;
  --theme-pale: #edf8f7;
}
button, input, select, textarea {
  font: inherit;
}
button {
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}
.hidden { display: none !important; }
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  animation: splashOut .45s ease 2.65s forwards;
}
.splash-center {
  display: grid;
  justify-items: center;
  gap: 10px;
  transform: translateY(-12px);
}
.splash-logo {
  position: relative;
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 30px;
  background:
    linear-gradient(135deg, #fff 0%, #fff8f9 52%, #effafa 100%),
    #fff;
  border: 1px solid rgba(31,34,38,.08);
  box-shadow: 0 18px 44px rgba(30,34,40,.10);
}
.splash-logo::before {
  content: "";
  position: absolute;
  inset: 15px;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cdefs%3E%3ClinearGradient id='r' x1='116' y1='142' x2='258' y2='360' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ff4c78'/%3E%3Cstop offset='.5' stop-color='%23ef2e5e'/%3E%3Cstop offset='1' stop-color='%23b80e2a'/%3E%3C/linearGradient%3E%3ClinearGradient id='g' x1='254' y1='142' x2='396' y2='360' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%232197a8'/%3E%3Cstop offset='.55' stop-color='%23166f85'/%3E%3Cstop offset='1' stop-color='%23075464'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M133 154C166 176 164 292 204 304C230 312 230 239 257 212C244 253 240 357 195 351C138 343 137 227 109 189C115 172 123 160 133 154Z' fill='url(%23r)'/%3E%3Cpath d='M257 212C284 239 282 312 308 304C348 292 346 176 379 154C389 160 397 172 403 189C375 227 374 343 317 351C272 357 270 253 257 212Z' fill='url(%23g)'/%3E%3Cpath d='M247 223C260 234 267 268 274 294' fill='none' stroke='%231f2226' stroke-width='8' stroke-linecap='round' opacity='.1'/%3E%3C/svg%3E");
}
.splash-center strong {
  font-size: 30px;
  letter-spacing: .08em;
}
.splash-center p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.splash-screen small {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 11px;
}
@keyframes splashOut {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}
.app-shell {
  width: min(100%, 460px);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 1px rgba(31,34,38,.04);
}
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 86px;
  padding: calc(22px + env(safe-area-inset-top)) 18px 10px;
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(31,34,38,.06);
}
body.screen-home .appbar {
  min-height: 116px;
  padding: calc(30px + env(safe-area-inset-top)) 22px 16px;
}
#backToBranches { grid-column: 1; }
#addItem { grid-column: 3; }
.appbar > div {
  min-width: 0;
}
.brand-title {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}
body.screen-home .brand-title {
  grid-column: 1 / 3;
  gap: 14px;
  justify-self: start;
}
.brand-mark,
.home-brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 18px;
  background:
    linear-gradient(135deg, #fff 0%, #fff8f9 52%, #effafa 100%),
    #fff;
  border: 1px solid rgba(31,34,38,.08);
  box-shadow: 0 10px 24px rgba(30,34,40,.09);
}
.brand-mark::before,
.home-brand-mark::before {
  content: "";
  position: absolute;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cdefs%3E%3ClinearGradient id='r' x1='116' y1='142' x2='258' y2='360' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%23ff4c78'/%3E%3Cstop offset='.5' stop-color='%23ef2e5e'/%3E%3Cstop offset='1' stop-color='%23b80e2a'/%3E%3C/linearGradient%3E%3ClinearGradient id='g' x1='254' y1='142' x2='396' y2='360' gradientUnits='userSpaceOnUse'%3E%3Cstop offset='0' stop-color='%232197a8'/%3E%3Cstop offset='.55' stop-color='%23166f85'/%3E%3Cstop offset='1' stop-color='%23075464'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M133 154C166 176 164 292 204 304C230 312 230 239 257 212C244 253 240 357 195 351C138 343 137 227 109 189C115 172 123 160 133 154Z' fill='url(%23r)'/%3E%3Cpath d='M257 212C284 239 282 312 308 304C348 292 346 176 379 154C389 160 397 172 403 189C375 227 374 343 317 351C272 357 270 253 257 212Z' fill='url(%23g)'/%3E%3Cpath d='M247 223C260 234 267 268 274 294' fill='none' stroke='%231f2226' stroke-width='8' stroke-linecap='round' opacity='.1'/%3E%3C/svg%3E");
}
.brand-mark::before {
  inset: 7px;
}
.home-brand-mark::before {
  inset: 10px;
}
.brand-mark {
  width: 38px;
  height: 38px;
}
body.screen-home .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 22px;
  box-shadow: 0 18px 38px rgba(30,34,40,.12);
}
body.screen-home .brand-mark::before {
  inset: 10px;
}
.home-brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 22px;
}
.appbar p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}
.appbar p b,
.splash-center p b {
  color: var(--ink);
  font-weight: 850;
}
body.screen-home .appbar p {
  font-size: 15px;
}
.appbar h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: nowrap;
}
body.screen-home .appbar h1 {
  font-size: 25px;
  font-weight: 760;
}
.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 25px;
  line-height: 1;
}
main {
  padding: 18px 18px calc(76px + env(safe-area-inset-bottom));
}
.home-screen {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 0;
  align-content: start;
  padding-top: 28px;
}
.journey-card,
.hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  text-align: left;
  color: white;
  border-radius: 28px;
  min-height: 154px;
  padding: 22px;
  box-shadow: var(--shadow);
  background: linear-gradient(145deg, var(--theme-b), var(--theme-a) 48%, var(--theme-c));
}
.journey-card {
  z-index: 1;
  min-height: 156px;
  padding: 23px 24px;
  box-shadow: 0 24px 56px rgba(30,34,40,.13);
}
.journey-card.birth-card {
  --theme-a: #166f85;
  --theme-b: #48b7aa;
  --theme-c: #314f83;
}
.journey-card span,
.journey-card em,
.hero-card p,
.hero-card span {
  position: relative;
  z-index: 2;
  color: rgba(255,255,255,.82);
  font-style: normal;
  font-size: 13px;
  line-height: 1.4;
}
.journey-card strong {
  position: relative;
  z-index: 2;
  display: block;
  margin: 12px 0 0;
  font-size: clamp(30px, 7vw, 36px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.1;
  white-space: nowrap;
}
.abstract-mark {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.abstract-mark::before,
.abstract-mark::after,
.journey-card::before,
.hero-card::before {
  content: "";
  position: absolute;
  pointer-events: none;
}
.journey-card::before,
.hero-card::before {
  width: 124%;
  height: 78%;
  left: -18%;
  top: -20%;
  border-radius: 0 0 52% 48% / 0 0 62% 55%;
  background: rgba(255,255,255,.18);
  transform: rotate(-7deg);
  z-index: 1;
}
.abstract-mark::before {
  width: 112%;
  height: 92%;
  right: -34%;
  top: 10%;
  border-radius: 50% 45% 46% 52% / 42% 55% 45% 58%;
  background: rgba(80, 0, 20, .24);
  transform: rotate(11deg);
}
.birth-card .abstract-mark::before,
body.branch-birth .hero-card .abstract-mark::before {
  background: rgba(0, 42, 72, .22);
}
.abstract-mark::after {
  width: 118%;
  height: 42%;
  left: -26%;
  bottom: -8%;
  border-radius: 55% 45% 0 0 / 100% 100% 0 0;
  background: rgba(255,255,255,.14);
  transform: rotate(8deg);
}
.planner-screen {
  display: grid;
  gap: 14px;
}
.hero-card {
  display: grid;
  align-content: space-between;
  min-height: 172px;
}
.hero-card h2 {
  position: relative;
  z-index: 2;
  margin: 6px 0 0;
  max-width: 260px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}
.hero-metrics {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: end;
  align-self: end;
}
.hero-metrics strong {
  font-size: 34px;
  line-height: 1;
}
.setup-panel,
.quick-stats,
.today-section,
.schedule-panel,
.budget-panel,
.filter-panel,
.item-list,
.notice,
.settings-card,
.section-shortcuts {
  background: rgba(255,255,255,.9);
  border: 1px solid var(--soft-line);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(30, 34, 40, 0.06);
}
.setup-panel {
  display: grid;
  gap: 1px;
  overflow: hidden;
}
.preset-guide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: start;
  padding: 16px;
  background: linear-gradient(90deg, var(--theme-pale), rgba(255,255,255,.82));
  border-bottom: 1px solid var(--soft-line);
}
.preset-guide strong {
  display: block;
  margin-bottom: 5px;
  font-size: 15px;
}
.preset-guide p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.preset-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 6px;
}
.preset-actions button {
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  padding: 6px 10px;
  font-size: 12px;
}
.preset-actions button:first-child {
  color: #a33a45;
  background: rgba(255,255,255,.86);
}
.setup-panel label,
.search-box {
  display: grid;
  gap: 8px;
  padding: 15px 16px;
  color: var(--muted);
  font-size: 13px;
}
input, select, textarea {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}
.quick-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}
.quick-stats article {
  padding: 16px 12px;
  border-right: 1px solid var(--soft-line);
}
.quick-stats article:last-child { border-right: 0; }
.quick-stats span,
.section-head button,
.badge,
.money,
.stock,
.tip {
  color: var(--muted);
}
.quick-stats span {
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}
.quick-stats strong {
  font-size: 19px;
  font-weight: 650;
}
.section-shortcuts {
  position: sticky;
  top: calc(86px + env(safe-area-inset-top));
  z-index: 18;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 3px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  box-shadow: none;
}
.section-shortcuts button {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  min-height: 36px;
  padding: 7px 4px;
  font-size: 13px;
}
.section-shortcuts button:active {
  background: var(--theme-pale);
  color: var(--ink);
}
.today-section,
.schedule-panel,
.budget-panel {
  padding: 16px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.section-head h3 {
  margin: 0;
  font-size: 17px;
}
.section-head button {
  border: 0;
  background: transparent;
  font-size: 13px;
}
.compact-list {
  display: grid;
  gap: 8px;
}
.compact-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.schedule-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--paper-soft);
}
.schedule-tabs button,
.schedule-control button {
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
}
.schedule-tabs button.active {
  background: var(--paper);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 6px 18px rgba(30, 34, 40, .06);
}
.schedule-control {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  margin-bottom: 12px;
}
.schedule-control strong {
  text-align: center;
  font-size: 16px;
}
.schedule-control button {
  width: 38px;
  height: 38px;
  font-size: 24px;
  background: var(--paper-soft);
}
.year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.month-cell {
  display: grid;
  gap: 5px;
  min-height: 86px;
  align-content: center;
  text-align: left;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: var(--paper);
  padding: 12px;
}
.month-cell span,
.month-cell em,
.schedule-row span,
.schedule-row time {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.month-cell strong {
  font-size: 24px;
  line-height: 1;
}
.schedule-list {
  display: grid;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  overflow: hidden;
}
.schedule-row {
  display: grid;
  grid-template-columns: minmax(118px, max-content) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--paper);
}
.schedule-row:last-child { border-bottom: 0; }
.schedule-row.done {
  color: var(--muted);
  background: var(--paper-soft);
}
.schedule-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
  line-height: 1.35;
}
.schedule-row time {
  white-space: nowrap;
}
.filter-panel {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  overflow: hidden;
}
.filter-panel label:first-child {
  border-right: 1px solid var(--soft-line);
}
.category-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-strip button {
  flex: 0 0 auto;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  padding: 10px 14px;
  font-size: 14px;
}
.category-strip button.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}
.notice {
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.notice a {
  color: var(--ink);
  font-weight: 650;
}
.item-list {
  overflow: hidden;
}
.budget-panel {
  padding: 16px;
}
.budget-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  background: var(--paper);
}
.budget-summary article {
  min-width: 0;
  padding: 14px 10px;
  border-right: 1px solid var(--soft-line);
}
.budget-summary article:last-child {
  border-right: 0;
}
.budget-summary span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}
.budget-summary strong {
  display: block;
  min-width: 0;
  font-size: clamp(12px, 3.2vw, 15px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.budget-list {
  display: grid;
  gap: 8px;
}
.budget-category {
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
}
.budget-category + .budget-category {
  margin-top: 8px;
}
.budget-category summary,
.stock-category summary {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
}
.budget-category summary::-webkit-details-marker {
  display: none;
}
.budget-category summary::after,
.stock-category summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 16px;
}
.budget-category[open] summary::after,
.stock-category[open] summary::after {
  transform: rotate(180deg);
}
.budget-category summary span {
  font-size: 14px;
  font-weight: 750;
}
.budget-category summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.budget-row {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid var(--soft-line);
  border-radius: 0;
  background: var(--paper);
}
.budget-row.done {
  color: var(--muted);
  background: rgba(248,248,248,.86);
}
.budget-row strong {
  display: block;
  margin-bottom: 4px;
  font-size: 15px;
}
.budget-row span {
  color: var(--muted);
  font-size: 12px;
}
.budget-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
.budget-row dt {
  color: var(--muted);
  font-size: 11px;
}
.budget-row dd {
  margin: 3px 0 0;
  font-size: clamp(12px, 3.1vw, 13px);
  font-weight: 650;
  overflow-wrap: anywhere;
}
.stock-category {
  border: 1px solid var(--soft-line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
}
.stock-category + .stock-category {
  margin-top: 8px;
}
.stock-category summary::-webkit-details-marker {
  display: none;
}
.stock-category summary span {
  min-width: 0;
  font-size: 14px;
  font-weight: 750;
}
.stock-category summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stock-table {
  display: grid;
  border-top: 1px solid var(--soft-line);
  overflow: hidden;
}
.stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) .55fr .55fr .55fr;
  gap: 8px;
  align-items: center;
  min-height: 46px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--soft-line);
  background: var(--paper);
  font-size: 13px;
}
.stock-row:last-child {
  border-bottom: 0;
}
.stock-row span {
  text-align: right;
  color: var(--muted);
}
.stock-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.stock-row.done {
  background: var(--paper-soft);
  color: var(--muted);
}
.stock-head {
  min-height: 38px;
  background: var(--paper-soft);
  font-weight: 700;
}
.stock-head span:first-child {
  text-align: left;
}
.category-group {
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255,255,255,.74);
}
.category-group:last-child {
  border-bottom: 0;
}
.category-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  cursor: pointer;
  list-style: none;
}
.category-group summary::-webkit-details-marker {
  display: none;
}
.category-group summary span {
  font-size: 16px;
  font-weight: 700;
}
.category-group summary em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}
.category-items {
  border-top: 1px solid var(--soft-line);
}
.item {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(255,255,255,.72);
}
.item:last-child { border-bottom: 0; }
.category-items .item:last-child { border-bottom: 0; }
.item.done {
  color: var(--muted);
  background: rgba(248,248,248,.86);
}
.item.done h3,
.schedule-row.done strong {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.item h3 {
  margin: 0 0 7px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge {
  font-size: 12px;
}
.badge.variable {
  color: var(--theme-a);
}
.badge.today-date,
.schedule-row time.today-date {
  color: #e94a72;
  font-weight: 650;
}
.tip {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}
.item-side {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.money,
.stock {
  font-size: 12px;
  line-height: 1.4;
}
.money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
.money-grid div {
  padding: 9px 10px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: var(--paper-soft);
}
.money-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}
.money-grid strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}
.payment-detail,
.tip-note {
  width: 100%;
  margin: 0;
}
.payment-detail {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
.tip-note {
  padding-top: 2px;
}
.item-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.schedule-row .item-actions {
  grid-column: 1 / -1;
}
.item-actions button {
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: var(--paper-soft);
  color: var(--ink);
  min-height: 38px;
  padding: 8px 6px;
  font-size: 13px;
}
.item-actions button[data-action="complete"] {
  background: var(--theme-pale);
  color: var(--ink);
  font-weight: 650;
}
.item-actions button[data-action="delete"] {
  color: var(--muted);
}
dialog button {
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--ink);
  padding: 13px 14px;
}
.download-icon-button {
  position: relative;
  width: 42px;
  height: 42px;
  border: 1px solid var(--soft-line);
  border-radius: 50%;
  background: var(--paper-soft);
  color: var(--ink);
  padding: 0;
}
.download-icon-button::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5v14'/%3E%3Cpath d='m10 13 6 6 6-6'/%3E%3Cpath d='M6 25h20'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 5v14'/%3E%3Cpath d='m10 13 6 6 6-6'/%3E%3Cpath d='M6 25h20'/%3E%3C/svg%3E") center / contain no-repeat;
}
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  transform: translateX(-50%);
  width: min(100%, 460px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(31,34,38,.1);
  box-shadow: 0 -12px 34px rgba(30,34,40,.08);
  backdrop-filter: blur(20px);
}
.bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  min-width: 0;
  padding: 5px 2px;
  font-size: 9px;
}
.bottom-nav .nav-icon {
  width: 27px;
  height: 27px;
  display: block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
}
.nav-home {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 14.5 16 5l11 9.5'/%3E%3Cpath d='M8 13v14h6v-8h4v8h6V13'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 14.5 16 5l11 9.5'/%3E%3Cpath d='M8 13v14h6v-8h4v8h6V13'/%3E%3C/svg%3E");
}
.nav-wedding {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 27S5 19.7 5 12.4C5 8.8 7.6 6 11 6c2 0 3.8 1 5 2.6C17.2 7 19 6 21 6c3.4 0 6 2.8 6 6.4C27 19.7 16 27 16 27Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M16 27S5 19.7 5 12.4C5 8.8 7.6 6 11 6c2 0 3.8 1 5 2.6C17.2 7 19 6 21 6c3.4 0 6 2.8 6 6.4C27 19.7 16 27 16 27Z'/%3E%3C/svg%3E");
}
.nav-birth {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h4c2.4 0 4 1.7 4 4v2'/%3E%3Cpath d='M13 10h6a7 7 0 0 1 7 7v3H10L8 10'/%3E%3Cpath d='M10 20h16'/%3E%3Ccircle cx='12' cy='25' r='2.4'/%3E%3Ccircle cx='24' cy='25' r='2.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 8h4c2.4 0 4 1.7 4 4v2'/%3E%3Cpath d='M13 10h6a7 7 0 0 1 7 7v3H10L8 10'/%3E%3Cpath d='M10 20h16'/%3E%3Ccircle cx='12' cy='25' r='2.4'/%3E%3Ccircle cx='24' cy='25' r='2.4'/%3E%3C/svg%3E");
}
.nav-settings {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18.6 4 20 7.1c.7.2 1.3.5 1.9.8L25 6.8 27.2 9l-1.1 3.1c.3.6.6 1.2.8 1.9l3.1 1.4v3.2L26.9 20c-.2.7-.5 1.3-.8 1.9l1.1 3.1-2.2 2.2-3.1-1.1c-.6.3-1.2.6-1.9.8L18.6 30h-3.2L14 26.9c-.7-.2-1.3-.5-1.9-.8L9 27.2 6.8 25l1.1-3.1c-.3-.6-.6-1.2-.8-1.9L4 18.6v-3.2L7.1 14c.2-.7.5-1.3.8-1.9L6.8 9 9 6.8l3.1 1.1c.6-.3 1.2-.6 1.9-.8L15.4 4h3.2Z'/%3E%3Ccircle cx='17' cy='17' r='4.2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18.6 4 20 7.1c.7.2 1.3.5 1.9.8L25 6.8 27.2 9l-1.1 3.1c.3.6.6 1.2.8 1.9l3.1 1.4v3.2L26.9 20c-.2.7-.5 1.3-.8 1.9l1.1 3.1-2.2 2.2-3.1-1.1c-.6.3-1.2.6-1.9.8L18.6 30h-3.2L14 26.9c-.7-.2-1.3-.5-1.9-.8L9 27.2 6.8 25l1.1-3.1c-.3-.6-.6-1.2-.8-1.9L4 18.6v-3.2L7.1 14c.2-.7.5-1.3.8-1.9L6.8 9 9 6.8l3.1 1.1c.6-.3 1.2-.6 1.9-.8L15.4 4h3.2Z'/%3E%3Ccircle cx='17' cy='17' r='4.2'/%3E%3C/svg%3E");
}
.bottom-nav button.active {
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font-weight: 750;
}
.bottom-nav button.active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}
.settings-screen {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}
.settings-card {
  padding: 16px;
}
.settings-card h3 {
  margin: 0 0 7px;
  font-size: 17px;
}
.settings-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.legal-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.legal-list li + li {
  margin-top: 5px;
}
.settings-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.settings-actions button {
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 8px;
}
.wide-action {
  width: 100%;
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--ink);
  min-height: 44px;
  padding: 10px 8px;
}
.info-links {
  display: grid;
  gap: 8px;
}
.info-links button {
  position: relative;
  width: 100%;
  min-height: 50px;
  padding: 13px 42px 13px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--ink);
  text-align: left;
  font-weight: 650;
}
.info-links button::after {
  content: "›";
  position: absolute;
  right: 16px;
  top: 50%;
  color: var(--muted);
  transform: translateY(-50%);
}
.info-dialog-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
.info-dialog-body p {
  margin: 0 0 10px;
}
.info-dialog-body ul {
  margin: 0;
  padding-left: 18px;
}
dialog {
  width: min(420px, calc(100vw - 28px));
  border: 0;
  border-radius: 28px;
  padding: 0;
}
dialog::backdrop { background: rgba(0,0,0,.28); }
dialog form {
  display: grid;
  gap: 12px;
  padding: 20px;
}
dialog h3 { margin: 0; }
dialog label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
dialog input,
dialog select,
dialog textarea {
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  padding: 12px;
  background: var(--paper);
}
.category-picker {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
}
.category-picker button {
  border: 1px solid var(--soft-line);
  border-radius: 16px;
  background: var(--paper-soft);
  color: var(--ink);
  font-size: 20px;
}
.finance-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quantity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quantity-fields label:last-child {
  grid-column: 1 / -1;
}
.finance-fields label:last-child {
  grid-column: 1 / -1;
}
.finance-fields input[readonly],
.quantity-fields input[readonly] {
  color: var(--muted);
  background: var(--paper-soft);
}
.quantity-stepper {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  gap: 6px;
}
.quantity-stepper button {
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  background: var(--paper-soft);
  color: var(--ink);
  min-height: 44px;
  padding: 0;
  font-size: 18px;
}
.quantity-stepper input {
  min-width: 0;
  text-align: center;
}
.managed-category-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
}
.managed-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
}
.managed-category span {
  font-size: 14px;
  font-weight: 650;
}
.managed-category em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.managed-category button {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(233,74,114,.24);
  border-radius: 999px;
  background: rgba(233,74,114,.08);
  color: #e94a72;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
menu {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin: 0;
  padding: 0;
}
@media (min-width: 700px) {
  body {
    background:
      radial-gradient(680px 520px at 12% 18%, rgba(255,255,255,.82), transparent 70%),
      linear-gradient(115deg, #f2efec, #ffffff 55%, #f4f1ee);
  }
  .app-shell {
    margin-top: 22px;
    margin-bottom: 22px;
    min-height: calc(100vh - 44px);
    border-radius: 34px;
    overflow: hidden;
  }
}
@media (max-width: 380px) {
  main { padding-left: 14px; padding-right: 14px; }
  body:not(.branch-wedding):not(.branch-birth) .appbar {
    min-height: 82px;
  }
  .home-screen {
    gap: 14px;
    min-height: 0;
    padding-top: 24px;
  }
  .journey-card {
    min-height: 154px;
    padding: 22px;
  }
  .journey-card strong { font-size: 28px; }
  .quick-stats strong { font-size: 17px; }
}
