/* Destinee's budget app ("My Budget" until she names it), in her palette "Destinee's Riled"
   (ref/concepts/good-days-color-palette.png) and the mockup screens (ref/concepts/good-days-three-screens.png). Light only. */
@font-face {
  font-family: "Fraunces Display";
  src: url("fonts/fraunces-display.woff") format("woff"); /* Fraunces, SIL OFL 1.1: fonts/OFL-Fraunces.txt */
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #F8F8E8;
  --surface: #FFFDF7;
  --forest: #184838;
  --ink: #183830;
  --muted: #607068;
  --sage: #E0E8D8;
  --border: #C8D0C0;
  --clay: #E08860;
  --clay-dark: #A86038;
  --clay-soft: #F4E3D8;
  --ochre: #D8B453;
  --ochre-soft: #F5EAC9;
  --on-dark: #E6EDE2;
  --serif: "Fraunces Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: 20px;
  --radius: 18px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-tap-highlight-color: transparent; }
/* An app, not a page: no text selection or long-press menus, which also keeps Chrome's "Touch to Search"
   Google bar from opening when a plain word is tapped. Fields stay selectable. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, select, textarea { -webkit-user-select: text; user-select: text; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
p { margin: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.card.dark :focus-visible, .card.dark:focus-visible { outline-color: var(--ochre); }
.vh { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; left: -10px; top: 0; }
.noscript { padding: 24px; }

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: max(10px, env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}

/* ------------------------------------------------------------ header and type */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0 0; }
.wordmark { font-family: var(--serif); font-weight: 560; color: var(--forest); font-size: 24px; letter-spacing: -0.01em; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 2px; margin-right: -10px; }
.chip { background: var(--ochre-soft); color: var(--ink); font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; }
.icon-btn { flex: none; width: 44px; height: 44px; display: inline-grid; place-items: center; border: 0; padding: 0; background: transparent; color: var(--forest); border-radius: 12px; }
.icon-btn:active { background: var(--sage); }

h1 { font-family: var(--serif); font-weight: 560; color: var(--forest); font-size: 30px; line-height: 1.12; margin: 16px 0 4px; letter-spacing: -0.01em; }
h2 { font-family: var(--serif); font-weight: 560; color: var(--ink); font-size: 20px; line-height: 1.2; margin: 0; }
h3 { margin: 0; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title-row h1 { margin-bottom: 2px; }
.arrows { display: flex; margin-right: -10px; }
.kicker { margin: 0 0 14px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.kicker-link { margin-left: 10px; text-transform: none; letter-spacing: 0; font-size: 12.5px; }
.lead { color: var(--muted); font-size: 15.5px; margin: 6px 0 18px; }
.foot { text-align: center; font-size: 12px; color: var(--muted); margin: 20px 0 6px; }
.foot svg { vertical-align: -2px; }
.empty { color: var(--muted); font-size: 14.5px; }
.banner { background: var(--clay-soft); color: var(--clay-dark); padding: 10px 14px; border-radius: 12px; font-size: 14px; margin-top: 10px; }

/* ------------------------------------------------------------ cards */
.card { display: block; width: 100%; border-radius: var(--radius); padding: 16px 18px 18px; margin: 14px 0; border: 0; text-align: left; }
.card-btn > span { display: block; }
.card-btn > .split { display: flex; }
.card.dark { background: var(--forest); color: var(--surface); }
.card.ochre { background: var(--ochre-soft); }
.card.sage { background: var(--sage); }
.card.surface { background: var(--surface); border: 1px solid var(--border); }
.label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.card.dark .label { color: var(--on-dark); }
.card.ochre .label { color: var(--clay-dark); }
.card.sage .label { color: var(--forest); }
.card.surface .label { color: var(--muted); }
.big { margin: 10px 0 6px; font-family: var(--serif); font-weight: 560; font-size: 38px; line-height: 1; font-variant-numeric: lining-nums; letter-spacing: -0.01em; }
.mid { font-family: var(--serif); font-weight: 560; font-size: 25px; line-height: 1.1; color: var(--ink); white-space: nowrap; }
.mid .of { font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--muted); }
.line { font-size: 13.5px; }
.line.strong { font-weight: 600; font-size: 15px; margin-top: 8px; color: var(--ink); }
.card.dark .line { color: var(--on-dark); }
.card.ochre .line { color: var(--muted); margin-top: 6px; }
.split { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.split.small { font-size: 13px; color: var(--muted); }
.over { color: var(--clay-dark); font-weight: 600; }
.pill { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: var(--ochre); color: var(--ink); padding: 3px 9px; border-radius: 999px; }
.confirmed { color: var(--forest); font-weight: 600; }
.plan-card { display: flex; justify-content: space-between; align-items: center; }
.plan-card .big { color: var(--forest); font-size: 32px; margin-bottom: 0; }
.count { color: var(--muted); font-size: 13.5px; }

.note { display: block; width: 100%; text-align: left; border: 0; border-radius: 14px; padding: 15px 16px; margin: 14px 0; font-size: 14px; line-height: 1.4; }
.note.sage { background: var(--sage); color: var(--ink); }
.note.clay { background: var(--clay-soft); color: var(--clay-dark); text-align: center; font-weight: 600; }
.note.with-chevron { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.note.with-chevron svg { flex: none; color: var(--forest); }

/* ------------------------------------------------------------ month */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 24px 0 8px; }
.head-amt { font-family: var(--serif); font-size: 20px; }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.key::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 0; }
.key.payday::before { background: var(--forest); }
.key.bill::before { background: var(--clay); }
.key.spending::before { background: var(--ochre); }
.weekdays, .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
.weekdays span { font-size: 11px; font-weight: 600; color: var(--muted); padding: 6px 0 4px; }
.day { position: relative; height: 48px; border: 0; background: transparent; display: grid; place-items: center; padding: 0 0 6px; border-radius: 12px; }
.day:active { background: var(--sage); }
.day .num { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-size: 14.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.day.is-payday .num { background: var(--forest); color: var(--surface); font-weight: 700; }
.day.is-today:not(.is-payday) .num { box-shadow: inset 0 0 0 1.5px var(--forest); font-weight: 700; color: var(--forest); }
.day .dots { position: absolute; bottom: 3px; left: 0; right: 0; display: flex; justify-content: center; gap: 3px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: block; }
.dot.bill { background: var(--clay); }
.dot.spending { background: var(--ochre); }

.block { margin-top: 24px; }
.block > h2 { margin-bottom: 6px; }
.agenda-row { width: 100%; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; }
.tag { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.name { min-width: 0; overflow-wrap: anywhere; }
.name small { display: block; font-size: 12.5px; color: var(--muted); }
.amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.bill { color: var(--clay-dark); }
.amt.plus { color: var(--forest); }
.is-paid .name, .is-paid .bill-name { color: var(--muted); }
.paid-note { color: var(--forest); font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------ payday */
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 14px; }
.list-card > li + li { border-top: 1px solid var(--border); }
.bill-row { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 6px 0; margin-left: -8px; }
.paid-toggle { width: 44px; height: 44px; border: 0; padding: 0; background: transparent; display: grid; place-items: center; }
.paid-mark { display: block; width: 44px; height: 44px; } /* App Asset Creator "confirm", her palette */
.bill-main { border: 0; background: transparent; text-align: left; padding: 8px 0; display: flex; flex-direction: column; min-width: 0; }
.bill-name { font-weight: 600; overflow-wrap: anywhere; }
.bill-due { font-size: 12.5px; color: var(--muted); }
.list-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; background: transparent; text-align: left; padding: 13px 0; }
.list-row.static { padding: 6px 0; }

/* ------------------------------------------------------------ budget */
.budget-head, .budget-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 62px; gap: 12px; align-items: center; }
.budget-head { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--border); }
.budget-head span:not(:first-child), .budget-row .times, .budget-row .month { text-align: right; }
.budget-row { width: 100%; border: 0; border-bottom: 1px solid var(--border); background: transparent; text-align: left; padding: 12px 0; font-size: 14.5px; }
.budget-row .times { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.budget-row .month { font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.add-row { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--forest); font-weight: 650; padding: 10px 0; min-height: 44px; }

/* ------------------------------------------------------------ activity */
.bar { height: 10px; background: var(--sage); border-radius: 999px; overflow: hidden; margin: 12px 0 8px; }
.bar > span { display: block; height: 100%; width: var(--w, 0%); background: var(--forest); border-radius: 999px; }
/* the App Asset Creator bar's motion (restrained: 0.45 s, ease out), redrawn here because hers moves with her spending */
.bar > span { animation: bar-fill .45s cubic-bezier(.2, .7, .3, 1) both; }
@keyframes bar-fill { from { width: 0; } }
.motion-panel { display: grid; place-items: center; margin: 6px 0 4px; }
.center { text-align: center; }
.bar.over > span { background: var(--clay); }
.cat-progress > li { padding: 10px 0 2px; }
.cat-progress .bar { height: 7px; margin: 8px 0 4px; }
.small-amt { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-day h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 14px 0 6px; }

/* ------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 22px; border-radius: 999px; border: 0; font-weight: 650; font-size: 16px; text-align: center; }
.btn.wide { display: flex; width: 100%; margin: 10px 0; }
.btn.primary { background: var(--forest); color: var(--surface); }
.btn.secondary { background: var(--sage); color: var(--forest); }
.btn.quiet { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 1px var(--border); }
.btn.danger { background: var(--clay-dark); color: var(--surface); }
.btn.quiet.danger-text { color: var(--clay-dark); }
.btn:active { filter: brightness(.94); }
.link { border: 0; background: none; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; font-weight: 650; font-size: inherit; padding: 10px 6px; margin: -10px -6px; }

/* ------------------------------------------------------------ dock */
.screen { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 18px max(var(--gutter), env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(var(--gutter), env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgb(248 248 232 / 0), var(--paper) 30%);
}
.tabbar { max-width: 440px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; border: 0; background: transparent; color: var(--muted); border-radius: 15px; font-size: 12px; font-weight: 500; }
.tab[aria-current="page"] { background: var(--sage); color: var(--forest); font-weight: 700; }
.credit { max-width: 440px; margin: 6px auto 0; text-align: right; font-size: 12px; color: var(--muted); }
.setup-credit { padding: 0 0 max(14px, env(safe-area-inset-bottom)); }

/* ------------------------------------------------------------ sheets and forms */
dialog#sheet {
  width: 100%; max-width: 480px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0;
  border-radius: 22px 22px 0 0; background: var(--paper); color: var(--ink); overflow-y: auto; overscroll-behavior: contain;
}
dialog#sheet::backdrop { background: rgb(24 56 48 / .4); }
.sheet-head { position: sticky; top: 0; z-index: 1; background: var(--paper); display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 10px 6px 20px; }
.sheet-head h2 { font-size: 22px; color: var(--forest); overflow-wrap: anywhere; }
.sheet-body { padding: 4px 20px max(24px, env(safe-area-inset-bottom)); }
.sheet-sub { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 18px 0 6px; }
.form { display: flex; flex-direction: column; gap: 14px; margin: 6px 0; }
.form.card { margin: 14px 0; }
.form-title { font-size: 18px; color: var(--forest); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 650; color: var(--muted); }
.input { width: 100%; min-height: 48px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: 16px; }
select.input { appearance: none; background-image: none; padding-right: 14px; }
.input:focus { outline: 2px solid var(--forest); outline-offset: 0; border-color: var(--forest); }
.input[aria-invalid="true"] { border-color: var(--clay-dark); box-shadow: 0 0 0 1px var(--clay-dark); }
.money-box { position: relative; display: block; min-width: 0; }
.money-box .currency { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-box .input { padding-left: 27px; }
.hint { font-size: 12.5px; color: var(--muted); }
.form-error { color: var(--clay-dark); font-weight: 650; font-size: 14px; }
.form-error:empty { display: none; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.total-line { color: var(--muted); font-size: 14.5px; margin: 10px 0; }
.total-line strong { color: var(--ink); font-size: 16px; }
.confirm p { margin: 12px 0 8px; font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.confirm-actions .btn { flex: 1; }

.choices { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.choices legend { font-size: 13px; font-weight: 650; color: var(--muted); padding: 0; margin-bottom: 8px; }
.choice { position: relative; display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 15px; text-align: center; padding: 8px; }
.choice input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.choice.on { background: var(--forest); color: var(--surface); border-color: var(--forest); }
.choice:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px; }

.menu { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 0 14px; margin: 4px 0 8px; }
.menu li + li { border-top: 1px solid var(--border); }
.menu-item { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 0; background: transparent; text-align: left; padding: 13px 0; font-weight: 600; }
.menu-item small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 400; }
.menu-item svg { flex: none; color: var(--muted); }
.menu-item.switch { cursor: pointer; }
.menu-item.switch input { appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--border); position: relative; margin: 0; transition: background .15s; }
.menu-item.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); transition: transform .15s; }
.menu-item.switch input:checked { background: var(--forest); }
.menu-item.switch input:checked::after { transform: translateX(18px); }
.about { margin-top: 18px; color: var(--muted); font-size: 14px; }
.about h3 { font-family: var(--serif); font-weight: 560; color: var(--forest); font-size: 17px; margin-bottom: 6px; }
.about p + p { margin-top: 8px; }
.version { font-size: 12px; }

#toast {
  position: fixed; left: 50%; bottom: calc(126px + env(safe-area-inset-bottom)); z-index: 20;
  transform: translate(-50%, 16px); max-width: calc(100% - 40px); width: max-content;
  background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------------------------------------ setup */
.setup { padding-top: 14px; padding-bottom: 28px; }
.hero { font-size: 42px; line-height: 1.04; margin-top: 28px; }
.concepts { display: grid; gap: 16px; margin: 24px 0 26px; }
.concept { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: center; color: var(--muted); font-size: 14.5px; }
.concept strong { display: block; font-family: var(--serif); font-weight: 560; font-size: 18px; color: var(--forest); }
.badge { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--forest); }
.badge.sage { background: var(--sage); }
.badge.clay { background: var(--clay); color: var(--surface); }
.badge.ochre { background: var(--ochre); }
.step-top { display: flex; align-items: center; justify-content: space-between; margin: 0 -10px; }
.step-dots { display: flex; gap: 6px; padding: 0 10px; }
.step-dots li { width: 22px; height: 5px; border-radius: 999px; background: var(--border); }
.step-dots li.on { background: var(--forest); }
.step-kicker { margin: 16px 0 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--clay-dark); }
.ed-head { display: flex; justify-content: space-between; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 0 6px; border-bottom: 1px solid var(--border); }
.ed-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.ed-top { display: flex; gap: 4px; align-items: center; margin-right: -10px; }
.ed-name { min-height: 42px; font-weight: 600; background: transparent; border-color: transparent; padding-left: 0; }
.ed-name:focus { background: var(--surface); padding-left: 10px; }
.ed-bottom { display: grid; grid-template-columns: minmax(0, 1fr) auto 64px auto minmax(70px, auto); align-items: center; gap: 8px; margin-top: 6px; }
.ed-times { text-align: center; padding: 11px 6px; }
.x { color: var(--muted); }
.ed-line { text-align: right; font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.confirm-check { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-weight: 600; min-height: 44px; }
.confirm-check input { width: 22px; height: 22px; accent-color: var(--forest); margin: 0; }
.sum { padding: 6px 18px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; }
.sum-row + .sum-row { border-top: 1px solid var(--border); }
.sum-row.total { font-weight: 700; color: var(--forest); font-size: 17px; }

/* small phones (320-374px wide): the name, the Illustrative chip and the settings button must share one line */
@media (max-width: 374px) {
  .wordmark { font-size: 19px; }
  .chip { font-size: 9.5px; letter-spacing: .05em; padding: 5px 8px; }
  .top-actions { margin-right: -12px; }
  h1 { font-size: 27px; }
  .hero { font-size: 36px; }
  .big { font-size: 33px; }
  .ed-bottom { grid-template-columns: minmax(0, 1fr) auto 52px auto minmax(58px, auto); gap: 6px; }
}

@media (prefers-reduced-motion: reduce) { #toast { transition: none; } .bar > span { animation: none; } }
