/* Daylight is an opt-in cascade over the preserved Classic design. No data or
   interaction logic depends on these selectors; switching is instantaneous. */
:root[data-theme="daylight"] {
  color-scheme: light;
  --bg: #F5F7FC; --surface: #FFFFFF; --surface-2: #EDF1F9;
  --ink: #17263E; --ink-2: #5C6980; --ink-3: #8F9BB0;
  --border: #E3E9F3; --track: #E8EDF5;
  --brand: #315EDF; --brand-deep: #284FBF; --brand-tint: #E8EFFF;
  --on-ink: #F4F7FF; --red: #AC3B38; --red-tint: #FCECE9;
  --year: #7257B2; --year-deep: #604697; --year-tint: #F0EBFC;
  --debt: #28786C; --debt-deep: #246459; --debt-tint: #E8F4EF;
  --radius-card: 24px; --radius: 15px; --radius-sheet: 30px;
  --shadow: 0 2px 8px #17263E05;
  --shadow-card: 0 4px 22px #17263E06;
  --shadow-raised: 0 8px 30px #17263E14;
}
[data-theme="daylight"] body { background: var(--bg); }
[data-theme="daylight"] .screen { padding-left: 20px; padding-right: 20px; }
[data-theme="daylight"] :is(.month-head, .detail-head) { padding-top: 12px; padding-bottom: 18px; }
[data-theme="daylight"] .month-title { font-size: 1.5rem; letter-spacing: -.035em; font-weight: 750; }
[data-theme="daylight"] .space-switch { box-shadow: none; border-color: transparent; background: var(--surface-2); }
[data-theme="daylight"] .space-name { font-size: .84rem; font-weight: 650; }
[data-theme="daylight"] .year-link { font-size: .8rem; font-weight: 550; color: var(--ink-2); }
[data-theme="daylight"] :is(.card, .hero, .tx-list, .year-list, .debt-hero) { border: 1px solid #E9EDF5; }
[data-theme="daylight"] .hero { padding: 24px 22px 20px; }
[data-theme="daylight"] .hero-top { flex-direction: row-reverse; justify-content: space-between; gap: 14px; }
[data-theme="daylight"] .hero-top-text { flex: 1; }
[data-theme="daylight"] .hero-top .money-col-amount { font-size: clamp(2rem, 8.6vw, 3.1rem); font-weight: 700; color: var(--ink); letter-spacing: -.045em; line-height: 1.2; margin: 4px 0; overflow-wrap: anywhere; }
[data-theme="daylight"] .hero-top .money-col-label { font-size: .9rem; font-weight: 500; }
[data-theme="daylight"] .hero-top .ring { width: 76px; height: 76px; }
[data-theme="daylight"] .hero-top .ring > svg { width: 100%; height: 100%; }
[data-theme="daylight"] .ring-pct { font-size: 1.12rem; font-weight: 700; }
[data-theme="daylight"] .ring-cap { font-size: .65rem; }
[data-theme="daylight"] .hero-rule { border: 0; margin: 18px 0 0; }
[data-theme="daylight"] .money-cols { gap: 9px; margin-bottom: 14px; }
[data-theme="daylight"] .money-cols .money-col { padding: 12px; border-radius: 14px; background: #F5F7FC; }
[data-theme="daylight"] .money-col-amount { color: var(--ink); font-size: clamp(1.05rem, 4.5vw, 1.38rem); font-weight: 700; overflow-wrap: anywhere; }
[data-theme="daylight"] .money-cols .money-col:last-child { background: var(--debt-tint); }
[data-theme="daylight"] .money-cols .money-col:last-child .money-col-amount { color: var(--debt-deep); }
[data-theme="daylight"] .hero-line { font-size: .79rem; line-height: 1.5; margin-bottom: 6px; }
[data-theme="daylight"] .hero-top .money-col-amount.warn,
[data-theme="daylight"] .money-col-amount.warn { color: var(--warn); }
[data-theme="daylight"] .hero-warn { background: #FFFCF6; border-color: var(--warn-edge); }
[data-theme="daylight"] .income-strip { background: var(--surface); border: 1px solid var(--border); box-shadow: none; padding: 12px 15px; border-radius: 17px; font-size: .86rem; color: var(--ink); }
[data-theme="daylight"] .income-strip > .icon:first-child { width: 34px; height: 34px; padding: 7px; border-radius: 11px; background: var(--brand-tint); }
[data-theme="daylight"] .income-strip-hint { color: var(--brand-deep); opacity: 1; font-weight: 550; }

/* The two bowls become useful shortcuts, with the same colours everywhere. */
.daylight-bowls { display: none; }
[data-theme="daylight"] .daylight-bowls { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 16px 0 10px; }
[data-theme="daylight"] .bowl-shortcut { position: relative; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 15px; border-radius: 20px; background: var(--brand-tint); color: var(--brand-deep); min-width: 0; }
[data-theme="daylight"] .bowl-shortcut-yearly { background: var(--year-tint); color: var(--year-deep); }
[data-theme="daylight"] .bowl-shortcut-head { width: 100%; display: flex; align-items: center; justify-content: space-between; font-size: .8rem; margin-bottom: 10px; }
[data-theme="daylight"] .bowl-shortcut-head > .icon { width: 32px; height: 27px; }
[data-theme="daylight"] .bowl-shortcut-yearly .bowl-shortcut-head > .icon { width: 26px; }
[data-theme="daylight"] .bowl-shortcut > strong { font-size: .98rem; font-weight: 650; letter-spacing: -.025em; }
[data-theme="daylight"] .bowl-shortcut > small { margin-top: 4px; font-size: .73rem; display: flex; align-items: center; gap: 2px; }
[data-theme="daylight"] .bowl-shortcut > small .icon { width: 14px; height: 14px; }
[data-theme="daylight"] .plan-hint { margin: 0 0 4px; font-size: .79rem; }
[data-theme="daylight"] .plan-hint .link-btn { font-weight: 550; color: var(--ink-2); }
[data-theme="daylight"] .budget-categories { margin: 12px 0 28px; }
[data-theme="daylight"] .category-heading { border-bottom: 0; margin-bottom: 5px; font-size: 1rem; font-weight: 700; letter-spacing: -.015em; gap: 8px; }
[data-theme="daylight"] .category-heading > .icon { width: 30px; height: 30px; padding: 4px; background: var(--brand-tint); border-radius: 9px; }
[data-theme="daylight"] :is(.budget-yearly, .plan-yearly, .bowl-yearly, .concept-account-small) { --brand: var(--year); --brand-deep: var(--year-deep); --brand-tint: var(--year-tint); }
[data-theme="daylight"] .cat-list { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 21px; padding: 0 16px; box-shadow: var(--shadow); }
[data-theme="daylight"] .cat-list:empty { display: none; }
[data-theme="daylight"] .cat-list > li + li { border-top: 1px solid var(--border); }
[data-theme="daylight"] .cat-row { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 18px 0; }
[data-theme="daylight"] .cat-name { font-weight: 650; gap: 10px; }
[data-theme="daylight"] .cat-name .category-icon { width: 34px; height: 34px; padding: 7px; border-radius: 11px; }
[data-theme="daylight"] .cat-row-sub { font-size: .76rem; color: var(--ink-2); margin-top: 4px; }
[data-theme="daylight"] .cat-left { font-size: .88rem; font-weight: 650; color: var(--ink); }
[data-theme="daylight"] .cat-left.neg { color: var(--red); }
[data-theme="daylight"] .bar { height: 5px; margin-top: 10px; }
[data-theme="daylight"] .card { padding: 21px; margin-bottom: 16px; }
[data-theme="daylight"] .card-title { font-weight: 700; letter-spacing: -.02em; }
[data-theme="daylight"] .setting-row { padding-top: 14px; padding-bottom: 14px; }
[data-theme="daylight"] .plan-summary { box-shadow: 0 3px 12px #17263E08; border-color: #D4E0FD; border-radius: 16px; }
[data-theme="daylight"] .plan-summary-over { border-color: var(--red-edge); }
[data-theme="daylight"] .bowl-plan-entry { border: 1px solid var(--border); background: var(--surface); padding: 19px; border-radius: 22px; box-shadow: var(--shadow); }
[data-theme="daylight"] .bowl-plan-art .icon:last-child { color: var(--year); }
[data-theme="daylight"] .bowl-target { border-color: transparent; background: var(--brand-tint); padding: 14px 5px; border-radius: 22px; }
[data-theme="daylight"] .bowl-target.is-ready { border-color: var(--brand); }
[data-theme="daylight"] .bowl-target.is-over { background: color-mix(in srgb, var(--brand) 20%, white); border-color: var(--brand); }
[data-theme="daylight"] .bowl-body { background: linear-gradient(150deg, white, var(--brand-tint)); box-shadow: 0 6px 12px color-mix(in srgb, var(--brand) 9%, transparent); }
[data-theme="daylight"] .bowl-rim { background: color-mix(in srgb, var(--brand-tint) 65%, white); }
[data-theme="daylight"] .bowl-label, [data-theme="daylight"] .bowl-count { color: var(--brand-deep); }
[data-theme="daylight"] .bowl-tag { border-radius: 12px; box-shadow: 0 2px 5px #17263E04; }
[data-theme="daylight"] .bowl-dock { padding-bottom: 10px; }
[data-theme="daylight"] .bowl-guide { background: var(--bg); box-shadow: 0 24px 80px #17263E40; }
[data-theme="daylight"] :is(.debt-section, .debt-screen, .debt-form, .debt-payment-panel, .debt-setup-art) { --brand: var(--debt); --brand-deep: var(--debt-deep); --brand-tint: var(--debt-tint); }
[data-theme="daylight"] .debt-section { background: var(--debt-tint); border-color: #D9EAE3; }
[data-theme="daylight"] .debt-row { padding: 16px; background: #FFFFFFA8; border: 1px solid #D9EAE3; border-radius: 17px; margin: 10px 0; }
[data-theme="daylight"] .debt-progress { height: 8px; background: #D4E9E0; }
[data-theme="daylight"] .debt-progress > span { background: linear-gradient(90deg, #28786C, #5AA58F); }
[data-theme="daylight"] .debt-hero { background: linear-gradient(160deg, white 40%, var(--debt-tint)); }
[data-theme="daylight"] .saved-row { box-shadow: none; }
[data-theme="daylight"] .btn { font-weight: 650; }
[data-theme="daylight"] .btn-primary { box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 15%, transparent); }
[data-theme="daylight"] .btn-secondary { background: var(--brand-tint); border-color: transparent; }
[data-theme="daylight"] .input { border-color: var(--border); border-radius: 13px; background: #FAFBFE; }
[data-theme="daylight"] .sheet { box-shadow: 0 -8px 50px #17263E17; }
[data-theme="daylight"] .sheet-title { font-weight: 700; letter-spacing: -.035em; }
[data-theme="daylight"] .amount-input { color: var(--ink); font-weight: 650; letter-spacing: -.045em; }
[data-theme="daylight"] .transaction-choice { border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 20px; }
[data-theme="daylight"] .transaction-choice > .icon { background: var(--brand-tint); border-radius: 14px; }
[data-theme="daylight"] .tabbar { border: 1px solid #DFE5F0; box-shadow: 0 8px 28px #17263E12; background: #FFFFFFF5; height: 74px; padding: 6px; border-radius: 25px; max-width: 560px; margin-left: auto; margin-right: auto; }
[data-theme="daylight"] .tab { min-height: 58px; border-radius: 19px; }
[data-theme="daylight"] .tab.on { background: var(--brand-tint); color: var(--brand-deep); box-shadow: none; }
[data-theme="daylight"] .fab-add { width: 84px; height: 58px; border-radius: 19px; box-shadow: 0 4px 10px #315EDF21; }
[data-theme="daylight"] .tab.on .tab-label { font-weight: 700; }
[data-theme="daylight"] .toast-action { color: #C1D3FF; }
[data-theme="daylight"] .brand-mark { border-radius: 26px; background: linear-gradient(145deg, #4978EC, #315EDF); }
[data-theme="daylight"] :is(.onb-title, .onb-h2) { letter-spacing: -.04em; font-weight: 700; }
[data-theme="daylight"] :is(.pay-card, .bowl-choice, .concept-account) { box-shadow: var(--shadow); border-radius: 22px; }

/* Reversible appearance controls are present in both designs. */
.appearance-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 12px; border: 0; }
.appearance-choice { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 13px; border: 1px solid var(--border); border-radius: 15px; cursor: pointer; min-width: 0; }
.appearance-choice:has(input:checked) { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.appearance-choice input { position: absolute; right: 12px; top: 12px; width: 18px; height: 18px; accent-color: var(--brand); }
.appearance-choice strong { font-size: .95rem; }
.appearance-choice small { font-size: .76rem; color: var(--ink-2); }
.appearance-swatch { display: flex; gap: 4px; margin: 4px 0 8px; padding: 7px; border-radius: 8px; background: #F5F7FC; }
.appearance-swatch i { display: block; width: 13px; height: 18px; border-radius: 4px; background: #315EDF; }
.appearance-swatch i:nth-child(2) { background: #BCA9E8; }
.appearance-swatch i:nth-child(3) { background: #64A591; }
.appearance-classic .appearance-swatch { background: #F6F4EF; }
.appearance-classic .appearance-swatch i { background: #166B4D; }
.appearance-classic .appearance-swatch i:nth-child(2) { background: #A8C4B6; }
.appearance-classic .appearance-swatch i:nth-child(3) { background: #E2DED3; }
.appearance-status { font-size: .8rem; color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) {
  [data-theme="daylight"] :is(.btn, .bowl-shortcut, .debt-row, .tab, .appearance-choice) { transition: background .18s ease, box-shadow .18s ease, transform .18s ease; }
  [data-theme="daylight"] :is(.btn, .bowl-shortcut, .debt-row):active { transform: scale(.98); }
  [data-theme="daylight"] .screen-enter .daylight-bowls { animation: screen-arrive .4s .08s both; }
  [data-theme="daylight"] .screen-enter .budget-categories { animation: screen-arrive .4s .12s both; }
  [data-theme="daylight"] .screen-enter .debt-section { animation: screen-arrive .4s .16s both; }
  @media (hover: hover) {
    [data-theme="daylight"] .bowl-shortcut:hover { transform: translateY(-2px); box-shadow: 0 5px 12px #17263E09; }
    [data-theme="daylight"] .bowl-shortcut:hover .icon { transform: rotate(-5deg); }
    [data-theme="daylight"] .debt-row:hover { background: white; }
  }
}
@media (max-width: 360px) {
  [data-theme="daylight"] .screen { padding-left: 14px; padding-right: 14px; }
  [data-theme="daylight"] .month-title { font-size: 1.23rem; }
  [data-theme="daylight"] .hero { padding: 18px 15px 15px; }
  [data-theme="daylight"] .hero-top .ring { width: 62px; height: 62px; }
  [data-theme="daylight"] .money-cols .money-col { padding: 10px; }
  [data-theme="daylight"] .bowl-shortcut { padding: 12px; }
  [data-theme="daylight"] .bowl-shortcut > strong { font-size: .9rem; }
  [data-theme="daylight"] .cat-list { padding: 0 12px; }
  [data-theme="daylight"] .cat-name .category-icon { width: 28px; height: 28px; padding: 5px; }
  [data-theme="daylight"] .cat-name { gap: 7px; }
  [data-theme="daylight"] .card { padding: 17px; }
}
@media (min-width: 700px) {
  [data-theme="daylight"] .screen { max-width: 760px; padding-top: 24px; }
  [data-theme="daylight"] .hero-top .money-col-amount { font-size: 3.2rem; }
  [data-theme="daylight"] .daylight-bowls { gap: 16px; }
  [data-theme="daylight"] .bowl-shortcut { padding: 19px; }
  [data-theme="daylight"] .bowl-shortcut-head > .icon { width: 42px; height: 34px; }
  [data-theme="daylight"] .bowl-shortcut > strong { font-size: 1.12rem; }
}

/* Keep the month readable beside the household switch on small phones. */
[data-theme="daylight"] .month-row .month-year { display: block; font-size: .73rem; font-weight: 500; letter-spacing: .015em; color: var(--ink-2); }
[data-theme="daylight"] .month-row .month-title { line-height: 1.15; }
[data-theme="daylight"] .month-row .icon-btn { width: 36px; min-width: 36px; }
[data-theme="daylight"] .month-row .space-switch { max-width: 32%; padding-left: 10px; }
[data-theme="daylight"] .money-cols .money-line-note { display: none; }
@media (min-width: 700px) { [data-theme="daylight"] .month-row .month-year { display: inline; font-size: inherit; font-weight: inherit; color: inherit; } }

[data-theme="daylight"] .month-row .month-nav:not(:has(.icon-btn)) { margin-left: 0; }

[data-theme="daylight"] .onb-footer { background: var(--bg); box-shadow: 0 -10px 18px -6px var(--bg); }
