@layer reset, base, layout, components, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  body, h1, h2, h3, p, ul, fieldset { margin: 0; }
  button, input, select { font: inherit; }
  button, a, input, select { -webkit-tap-highlight-color: transparent; }
  button, select { cursor: pointer; }
  button { color: inherit; }
  img { max-width: 100%; display: block; }
  ul { padding: 0; list-style: none; }
  [hidden] { display: none !important; }
}
@layer base {
  :root {
    color-scheme: light;
    --bg: #f5f7fb; --surface: #fff; --surface-soft: #f8faff; --text: #1b2941;
    --muted: #627088; --secondary-text: #5e6c84; --border: #e7ecf4;
    --blue: #2563eb; --blue-hover: #1d4ed8; --blue-soft: #eaf1ff; --blue-text: #2356b6;
    --nav-active: #ecf2ff; --input-bg: #fff; --shadow: 0 8px 30px #162e5c07;
    --danger: #c23d4b; --danger-soft: #fff0f1; --saved-bg: #eef0ff; --saved-text: #5955b1;
    --neutral-bg: #f0f3f8; --neutral-text: #617089;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px; line-height: 1.5; font-weight: 400;
    background: var(--bg); color: var(--text);
    scroll-padding-top: 2rem; scroll-behavior: smooth;
  }
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101722; --surface: #192332; --surface-soft: #1b283c; --text: #e6edf8;
    --muted: #91a0b8; --secondary-text: #afbdd2; --border: #2a384e;
    --blue: #91b5ff; --blue-hover: #b3cbff; --blue-soft: #203b68; --blue-text: #bed3ff;
    --nav-active: #203451; --input-bg: #172232; --shadow: none;
    --danger: #ff9aa6; --danger-soft: #3d2734; --saved-bg: #303151; --saved-text: #c4c1ff;
    --neutral-bg: #263246; --neutral-text: #b7c4da;
  }
  body { min-width: 20rem; min-height: 100dvh; }
  button { border: 0; }
  button:disabled, select:disabled { cursor: not-allowed; opacity: .48; }
  a { color: inherit; text-decoration: none; }
  button, a, input, select { touch-action: manipulation; }
  :focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
  h1, h2, h3, strong { font-weight: 650; }
  .icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
  .svg-sprite { position: absolute; width: 0; height: 0; pointer-events: none; }
  .skip-link { position: fixed; top: .6rem; left: .6rem; padding: .7rem 1rem; background: var(--surface); color: var(--blue); border-radius: .7rem; z-index: 10; transform: translateY(-180%); }
  .skip-link:focus { transform: translateY(0); }
  .noscript { position: fixed; inset: auto 1rem 1rem; background: var(--surface); color: var(--text); padding: 1rem; border: 1px solid var(--border); border-radius: 1rem; z-index: 10; }
}
@layer layout {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 15.5rem; padding: 2.2rem 1.2rem 1.25rem; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; z-index: 2; overflow-y: auto; }
  .main { margin-left: 15.5rem; padding: 2.4rem clamp(1.5rem, 3.1dvw, 3.5rem) 1.5rem; max-width: 112rem; min-height: 100dvh; }
  .brand { display: flex; align-items: center; gap: .65rem; padding: 0 .15rem; }
  .brand-mark { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; color: #fff; background: #2563eb; border-radius: .85rem; flex-shrink: 0; }
  .brand-mark .icon { width: 1.55rem; height: 1.55rem; }
  .brand strong { font-size: 1.18rem; letter-spacing: -.045rem; display: block; }
  .brand-dot { color: var(--blue); }
  .brand small { display: block; font-size: .75rem; font-weight: 600; letter-spacing: .04rem; color: var(--muted); margin-top: .15rem; }
  .navigation { margin-top: 3.1rem; display: flex; flex-direction: column; gap: .5rem; }
  .nav-label { font-size: .75rem; font-weight: 650; letter-spacing: .08rem; color: var(--muted); padding: 0 .8rem; margin-bottom: .65rem; }
  .nav-link { display: flex; align-items: center; gap: .6rem; padding: .85rem .7rem; min-height: 3rem; border-radius: .7rem; font-size: .875rem; font-weight: 500; color: var(--secondary-text); transition: background .15s, color .15s; }
  .nav-link:hover { background: var(--surface-soft); color: var(--blue); }
  .nav-link.active { background: var(--nav-active); color: var(--blue); font-weight: 650; }
  .nav-link .icon { width: 1.1rem; height: 1.1rem; }
  .nav-short { display: none; }
  .nav-count { display: grid; place-items: center; min-width: 1.4rem; height: 1.4rem; background: var(--neutral-bg); border-radius: .4rem; margin-left: auto; font-size: .75rem; color: var(--secondary-text); }
  .sidebar-bottom { margin-top: auto; padding-top: 3rem; }
  .sidebar-note { padding: 1.2rem; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 1rem; margin: 0 .2rem 1.6rem; }
  .note-symbol { display: block; color: var(--blue); margin-bottom: .75rem; }
  .sidebar-note strong { font-size: .95rem; letter-spacing: -.015rem; }
  .sidebar-note p { margin-top: .6rem; font-size: .8rem; line-height: 1.65; color: var(--secondary-text); }
  .appearance { padding: 0 .1rem; }
  .theme-segment { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg); border: 1px solid var(--border); padding: .3rem; border-radius: .7rem; margin-top: .6rem; }
  .theme-segment button { display: flex; flex-direction: column; gap: .25rem; align-items: center; justify-content: center; min-height: 3.2rem; padding: .4rem; background: transparent; color: var(--muted); border-radius: .5rem; font-size: .875rem; }
  .theme-segment .icon { width: 1.05rem; height: 1.05rem; }
  .theme-segment button[aria-pressed="true"] { background: var(--surface); color: var(--blue); box-shadow: 0 1px 4px #1b29410b; }
  .profile { display: flex; gap: .6rem; align-items: center; padding: 1.3rem .1rem 0; margin-top: 1.3rem; border-top: 1px solid var(--border); }
  .profile img { width: 2.4rem; height: 2.4rem; border-radius: 50%; aspect-ratio: 1; object-fit: cover; background: white; border: 1px solid var(--border); }
  .profile strong { font-size: .8rem; display: block; }
  .profile span { font-size: .75rem; color: var(--muted); display: block; margin-top: .12rem; }
  .profile-lock { margin-left: auto; width: .95rem; height: .95rem; color: var(--muted); }
  .mobile-theme { display: none; }
  .page-header { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-bottom: 2rem; }
  .eyebrow { color: var(--muted); font-size: .7rem; font-weight: 650; letter-spacing: .1rem; margin-bottom: .6rem; }
  .page-header h1 { font-size: clamp(1.75rem, 1.1rem + 1.25dvw, 2.3rem); line-height: 1.25; letter-spacing: -.07rem; }
  .page-header h1 > span { color: var(--blue); }
  .page-description { color: var(--secondary-text); font-size: .9rem; margin-top: .6rem; }
  .header-actions { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }
  .month-notice { display: flex; align-items: center; gap: 1rem; padding: 1.1rem; margin-bottom: 1.4rem; background: var(--blue-soft); border: 1px solid var(--blue); border-radius: .85rem; }
  .month-notice > div { flex: 1; }
  .month-notice strong { font-size: .95rem; }
  .month-notice p { font-size: .875rem; color: var(--secondary-text); margin-top: .2rem; }
  .month-dialog-note { font-size: .85rem; color: var(--secondary-text); padding: .8rem; background: var(--surface-soft); border-radius: .6rem; }
  .month-pill { display: flex; gap: .5rem; align-items: center; font-size: .875rem; color: var(--secondary-text); padding: .7rem .9rem; border: 1px solid var(--border); background: var(--surface); border-radius: .65rem; white-space: nowrap; }
  .month-pill .icon { width: 1rem; height: 1rem; }
  .overview { display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); gap: 1rem; }
  .stat-card { padding: 1.35rem 1.3rem 1.2rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface); min-width: 0; position: relative; overflow: hidden; }
  .stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: var(--secondary-text); font-size: .875rem; min-height: 2.75rem; }
  .stat-value { display: block; font-size: clamp(1.5rem, .75rem + 1.4dvw, 2rem); line-height: 1.25; letter-spacing: -.065rem; font-variant-numeric: tabular-nums; margin: .75rem 0 .45rem; overflow-wrap: anywhere; position: relative; z-index: 1; }
  .stat-foot { font-size: .78rem; color: var(--muted); position: relative; z-index: 1; }
  .stat-icon { width: 2rem; height: 2rem; border-radius: .65rem; display: grid; place-items: center; }
  .stat-icon .icon { width: 1.05rem; height: 1.05rem; }
  .paid-icon { background: var(--blue-soft); color: var(--blue); }
  .saved-icon { background: var(--saved-bg); color: var(--saved-text); }
  .pending-icon { background: var(--neutral-bg); color: var(--neutral-text); }
  .total-card { background: #17428a; color: #fff; border-color: #17428a; }
  .total-card .stat-top { color: #cfddfb; }
  .total-card .stat-top .icon { color: #b6ceff; width: 1.25rem; height: 1.25rem; }
  .total-card .stat-foot { color: #c0d3fb; }
  .card-orbit { position: absolute; right: -3rem; bottom: -5rem; width: 10rem; height: 10rem; border: 1px solid #ffffff13; border-radius: 50%; box-shadow: 0 0 0 1.6rem #ffffff05, 0 0 0 3.2rem #ffffff04; pointer-events: none; }
  .progress-panel { display: flex; align-items: center; gap: 2rem; background: var(--surface); border: 1px solid var(--border); border-radius: .85rem; padding: 1rem 1.25rem; margin: 1.15rem 0 2.3rem; }
  .progress-copy { display: flex; gap: .75rem; align-items: center; flex-shrink: 0; }
  .progress-icon { display: grid; place-items: center; color: var(--blue); width: 2.4rem; height: 2.4rem; border-radius: .7rem; background: var(--blue-soft); }
  .progress-copy strong { display: block; font-size: .85rem; }
  .progress-copy div > span { display: block; color: var(--muted); font-size: .78rem; margin-top: .15rem; }
  .progress-meter { display: flex; align-items: center; gap: 1rem; flex: 1; min-width: 0; }
  progress { width: 100%; height: .45rem; border: 0; border-radius: 1rem; background: var(--neutral-bg); accent-color: var(--blue); appearance: none; }
  progress::-webkit-progress-bar { background: var(--neutral-bg); border-radius: 1rem; }
  progress::-webkit-progress-value { background: var(--blue); border-radius: 1rem; }
  progress::-moz-progress-bar { background: var(--blue); border-radius: 1rem; }
  .progress-meter > strong { font-size: .8rem; color: var(--blue); min-width: 2rem; text-align: right; }
  .accounts-header { display: flex; align-items: center; justify-content: space-between; gap: 1.25rem; margin-bottom: 1.2rem; }
  .accounts-header h2 { font-size: 1.15rem; letter-spacing: -.025rem; }
  .accounts-header p { color: var(--muted); font-size: .85rem; margin-top: .3rem; }
  .list-tools { display: flex; align-items: center; gap: .65rem; }
  .fortnights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
  .fortnight { background: var(--surface); border: 1px solid var(--border); border-radius: 1rem; box-shadow: var(--shadow); container-type: inline-size; scroll-margin-top: 1.5rem; overflow: clip; }
  .fortnight-header { display: flex; align-items: center; gap: .75rem; padding: 1.3rem 1.2rem; border-bottom: 1px solid var(--border); }
  .fortnight-symbol { display: grid; place-items: center; width: 2.45rem; height: 2.45rem; border-radius: .75rem; color: var(--blue); background: var(--blue-soft); flex-shrink: 0; }
  .fortnight-header h3 { font-size: 1rem; letter-spacing: -.02rem; }
  .fortnight-header p { font-size: .875rem; color: var(--muted); margin-top: .2rem; }
  .bill-count { margin-left: auto; padding: .25rem .55rem; background: var(--neutral-bg); color: var(--secondary-text); border-radius: .45rem; font-size: .73rem; white-space: nowrap; }
  .empty-state { padding: 2.15rem 1rem; text-align: center; }
  .empty-icon { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; background: var(--surface-soft); color: #8ba4c8; border: 1px solid var(--border); border-radius: 1rem; margin: 0 auto .85rem; }
  .empty-icon .icon { width: 1.5rem; height: 1.5rem; }
  .empty-state strong { font-size: .95rem; }
  .empty-state p { color: var(--muted); font-size: .85rem; line-height: 1.7; margin-top: .45rem; }
  .no-results { padding: 2.2rem 1.25rem; color: var(--secondary-text); font-size: .9rem; }
  .fortnight-total { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .95rem 1.25rem; background: var(--surface-soft); border-top: 1px solid var(--border); }
  .fortnight-total span { font-size: .8rem; color: var(--secondary-text); }
  .fortnight-total strong { font-size: 1.05rem; color: var(--blue); font-variant-numeric: tabular-nums; }
  .fortnight-action { padding: .85rem 1.15rem 1.1rem; }
  .page-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: 1.75rem; color: var(--muted); font-size: .75rem; }
  .page-footer > span:first-child { display: flex; gap: .45rem; align-items: center; white-space: nowrap; }
  .page-footer .icon { width: .85rem; height: .85rem; }
}
@layer components {
  .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.85rem; padding: .65rem 1rem; border-radius: .65rem; font-size: .875rem; font-weight: 600; line-height: 1.4; border: 1px solid transparent; transition: background .15s, border-color .15s; }
  .button .icon { width: 1.05rem; height: 1.05rem; }
  .primary { background: #2563eb; color: #fff; }
  .primary:hover { background: #1d4ed8; }
  .secondary { background: var(--surface); color: var(--secondary-text); border-color: var(--border); }
  .secondary:hover { background: var(--surface-soft); }
  .danger { background: #c23d4b; color: white; }
  .danger:hover { background: #a92f3c; }
  .icon-button { width: 2.75rem; height: 2.75rem; display: inline-grid; place-items: center; background: transparent; color: var(--secondary-text); border-radius: .65rem; flex-shrink: 0; }
  .mobile-theme { display: none; }
  .icon-button:hover { background: var(--neutral-bg); color: var(--blue); }
  .clear-all { background: var(--surface); border: 1px solid var(--border); }
  .clear-all:hover, .delete-bill:hover { color: var(--danger); background: var(--danger-soft); }
  .search-field { display: flex; align-items: center; gap: .55rem; height: 2.75rem; padding: 0 .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: .65rem; color: var(--muted); }
  .search-field .icon { width: 1rem; height: 1rem; }
  .search-field input { background: transparent; border: 0; outline: none; color: var(--text); width: 11rem; font-size: .8rem; min-width: 0; }
  .search-field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-soft); }
  .add-account { width: 100%; background: var(--surface); border-color: var(--border); color: var(--blue); }
  .add-account:hover { background: var(--blue-soft); border-color: var(--blue); }
  .bill-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .85rem .75rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--border); }
  .bill-row:last-child { border-bottom: 0; }
  .bill-info { display: flex; align-items: center; gap: .65rem; min-width: 0; }
  .bill-symbol { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: .6rem; background: var(--neutral-bg); color: var(--secondary-text); flex-shrink: 0; }
  .bill-symbol .icon { width: 1.05rem; height: 1.05rem; }
  .bill-name { font-size: .95rem; font-weight: 600; overflow-wrap: anywhere; }
  .bill-amount { color: var(--blue-text); background: var(--blue-soft); padding: .4rem .65rem; font-size: .95rem; border-radius: .5rem; font-weight: 650; align-self: center; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; max-width: 12rem; }
  .bill-status { align-self: center; justify-self: start; position: relative; max-width: 100%; }
  .bill-status select { width: 100%; border: 1px solid transparent; min-height: 2.75rem; border-radius: .5rem; padding: .5rem 2rem .5rem .75rem; font-size: .875rem; font-weight: 550; appearance: none; background-color: var(--neutral-bg); color: var(--neutral-text); }
  .bill-status::after { content: ''; position: absolute; width: .4rem; height: .4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); right: .8rem; top: 1rem; pointer-events: none; }
  .bill-status[data-status="paid"] select { background: var(--blue-soft); color: var(--blue-text); }
  .bill-status[data-status="paid"] { color: var(--blue-text); }
  .bill-status[data-status="saved"] select { background: var(--saved-bg); color: var(--saved-text); }
  .bill-status[data-status="saved"] { color: var(--saved-text); }
  .bill-actions { display: flex; align-items: center; justify-self: end; }
  .bill-actions .icon-button { width: 2.5rem; height: 2.75rem; }
  .bill-actions .icon { width: 1rem; height: 1rem; }
  dialog { padding: 1.75rem; border: 1px solid var(--border); border-radius: 1.25rem; background: var(--surface); color: var(--text); width: min(30rem, calc(100% - 2rem)); max-height: calc(100dvh - 2rem); box-shadow: 0 24px 100px #061b4a2b; }
  dialog:modal { overscroll-behavior: contain; }
  dialog::backdrop { background: #0e1c37a6; overflow: hidden; overscroll-behavior: contain; }
  dialog h1 { font-size: 1.5rem; line-height: 1.3; letter-spacing: -.05rem; margin: .85rem 0 .45rem; overflow-wrap: anywhere; }
  .dialog-heading { display: flex; align-items: center; justify-content: space-between; }
  .dialog-description { color: var(--secondary-text); font-size: .9rem; line-height: 1.65; margin-bottom: 1.5rem; }
  .dialog-symbol { width: 2.6rem; height: 2.6rem; border-radius: .8rem; background: var(--blue-soft); color: var(--blue); display: inline-grid; place-items: center; }
  .danger-symbol { background: var(--danger-soft); color: var(--danger); }
  .form-label { display: block; font-size: .875rem; font-weight: 600; margin: 1.1rem 0 .5rem; }
  .form-input { width: 100%; min-height: 3rem; border: 1px solid var(--border); border-radius: .7rem; padding: .7rem .85rem; background: var(--input-bg); color: var(--text); font-size: 1rem; }
  .form-input::placeholder { color: var(--muted); opacity: .8; }
  .form-input:focus { border-color: var(--blue); outline-offset: 2px; }
  .amount-field { display: flex; align-items: center; border: 1px solid var(--border); background: var(--input-bg); border-radius: .7rem; }
  .amount-field:focus-within { outline: 3px solid var(--blue); outline-offset: 2px; }
  .amount-field > span { padding-left: .85rem; color: var(--secondary-text); font-size: .95rem; }
  .amount-field input { border: none; background: transparent; outline: none; box-shadow: none; }
  .field-help { display: block; font-size: .8rem; color: var(--muted); margin-top: .4rem; }
  .fortnight-picker { padding: 0; border: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: 1.25rem; }
  .fortnight-picker legend { font-size: .875rem; font-weight: 600; margin-bottom: .65rem; }
  .fortnight-picker label { position: relative; min-width: 0; }
  .fortnight-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
  .fortnight-picker label > span { display: flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid var(--border); border-radius: .65rem; min-height: 3rem; padding: .5rem; font-size: .875rem; cursor: pointer; }
  .fortnight-picker .icon { width: 1rem; height: 1rem; }
  .fortnight-picker input:checked + span { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-text); }
  .fortnight-picker input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
  .dialog-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.75rem; }
  .theme-dialog-choices { display: grid; gap: .6rem; }
  .theme-dialog-choices button { display: flex; align-items: center; gap: .75rem; min-height: 3rem; padding: .75rem; border-radius: .7rem; border: 1px solid var(--border); background: var(--surface); text-align: left; }
  .theme-dialog-choices button[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-text); }
  .form-error { color: var(--danger); font-size: .85rem; margin-top: .8rem; }
  .storage-error { display: flex; gap: .8rem; padding: 1rem; margin-bottom: 1.5rem; background: var(--danger-soft); border: 1px solid var(--danger); border-radius: .8rem; color: var(--text); }
  .storage-error > .icon { color: var(--danger); margin-top: .2rem; }
  .storage-error p { font-size: .9rem; margin-top: .25rem; }
  .storage-error button { background: transparent; padding: .5rem 0; text-decoration: underline; color: var(--danger); }
  .toast { position: fixed; inset: auto 1.5rem 1.5rem auto; max-width: min(28rem, calc(100% - 3rem)); border-radius: .8rem; border: 1px solid var(--border); background: var(--text); color: var(--surface); padding: .9rem 1.2rem; font-size: .875rem; box-shadow: 0 10px 40px #0b1c3833; z-index: 5; }
}
@layer responsive {
  @container (width < 25rem) {
    .fortnight-header { gap: .6rem; padding: 1rem; }
    .fortnight-header h3 { font-size: .95rem; }
    .fortnight-header p { font-size: .875rem; }
    .fortnight-symbol { width: 2.1rem; height: 2.1rem; }
    .bill-count { font-size: .7rem; padding: .2rem .4rem; }
    .bill-row { padding: 1rem; }
    .bill-symbol { display: none; }
    .bill-amount { max-width: 10rem; }
  }
  @container (width < 21rem) {
    .bill-count { display: none; }
  }
  @media (min-width: 1100px) and (max-width: 1280px) {
    .main { padding-inline: 1.5rem; }
    .page-header { align-items: start; }
    .header-actions { flex-direction: column; align-items: stretch; }
    .stat-card { padding: 1.1rem; }
    .stat-top { font-size: .875rem; }
  }
  @media (max-width: 1100px) {
    .sidebar { position: relative; inset: auto; width: 100%; padding: 1rem 1.5rem 0; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
    .brand { padding: 0; }
    .sidebar-bottom { display: none; }
    .mobile-theme { display: inline-grid; }
    .navigation { margin: 1rem 0 0; flex-direction: row; width: 100%; gap: 1rem; }
    .nav-label { display: none; }
    .nav-link { border-radius: .6rem .6rem 0 0; border-bottom: 2px solid transparent; padding: .8rem; min-height: 2.9rem; }
    .nav-link.active { border-color: var(--blue); }
    .nav-count { display: none; }
    .main { margin: 0; padding: 1.75rem 1.5rem; }
    .page-footer { flex-wrap: wrap; }
  }
  @media (max-width: 760px) {
    .month-notice { flex-wrap: wrap; }
    .month-notice > div { min-width: 10rem; }
    .month-notice .button { width: 100%; }
    .page-header { flex-direction: column; align-items: stretch; gap: 1.2rem; }
    .header-actions { justify-content: space-between; }
    .overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
    .stat-card { padding: 1rem; }
    .stat-top { font-size: .875rem; }
    .stat-value { font-size: clamp(1.4rem, .9rem + 2dvw, 1.9rem); }
    .progress-panel { flex-direction: column; align-items: stretch; gap: .9rem; }
    .progress-copy { align-items: center; }
    .progress-meter { padding-left: 3.15rem; }
    .accounts-header { flex-direction: column; align-items: stretch; gap: 1rem; }
    .list-tools { width: 100%; }
    .search-field { flex: 1; }
    .search-field input { width: 100%; }
    .fortnights { grid-template-columns: 1fr; }
    .page-footer { display: grid; gap: .6rem; line-height: 1.7; }
    .accounts-header p { font-size: .8rem; }
  }
  @media (max-width: 420px) {
    .sidebar { padding-inline: 1rem; }
    .brand strong { font-size: 1.1rem; }
    .navigation { gap: .25rem; justify-content: space-between; }
    .nav-link { font-size: .875rem; padding: .7rem .4rem; gap: .35rem; }
    .nav-full { display: none; }
    .nav-short { display: inline; }
    .nav-link .icon { width: .95rem; height: .95rem; }
    .main { padding: 1.5rem 1rem; }
    .page-header h1 { font-size: 1.85rem; }
    .page-description { font-size: .875rem; }
    .month-pill { padding-inline: .65rem; font-size: .875rem; }
    .header-actions .button { font-size: .875rem; }
    .stat-card { padding: .9rem; }
    .stat-icon { width: 1.6rem; height: 1.6rem; }
    .stat-top { gap: .25rem; font-size: .875rem; }
    .stat-foot { font-size: .72rem; }
    .progress-panel { padding: .9rem; }
    dialog { padding: 1.25rem; }
    .fortnight-picker label > span { font-size: .875rem; }
  }
  @media (prefers-reduced-motion: reduce) {
    :root { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
  }
}
