  :root {
    --base: #0A1120; --surface: #111A2C; --input: #0D1626; --hover: #16223A;
    --stroke: #1E2A40; --strokeLight: #2B3A56;
    --text: #DCE3EE; --textMuted: #A3B0C4; --textSubtle: #75839A;
    --blue: #3D7FF0; --green: #34B97A; --red: #EF6159; --orange: #E99A3C;
    --purple: #9C8AF2; --dark: #FFFFFF;
    --redTint: rgba(239,97,89,.10); --orangeTint: rgba(233,154,60,.10);
    --heading: #FFFFFF; --overlay: rgba(2,6,15,.66); --shadow: rgba(0,0,0,.45);
    --okBg: rgba(52,185,122,.14); --warnBg: rgba(233,154,60,.14); --lateBg: rgba(239,97,89,.14);
    --nav: #0E1830; --navText: #FFFFFF; --navMuted: rgba(255,255,255,.66); --navLine: rgba(255,255,255,.10);
    --hero: linear-gradient(135deg, #12264A 0%, #0E1B33 100%);
    --cardShadow: 0 1px 2px rgba(0,0,0,.35);
    --heroText: #FFFFFF; --heroMuted: rgba(255,255,255,.72); --heroPos: #7EE2B0; --heroNeg: #FFB4AE;
    color-scheme: dark;
  }
  :root[data-theme="light"] {
    --base: #F3F5F9; --surface: #FFFFFF; --input: #FFFFFF; --hover: #F5F7FB;
    --stroke: #E3E8EF; --strokeLight: #CDD5E0;
    --text: #1E2B3F; --textMuted: #4A5970; --textSubtle: #758399;
    --blue: #0B5FD6; --green: #0E8A55; --red: #C8322B; --orange: #B86200;
    --purple: #5B4BD1; --dark: #FFFFFF;
    --redTint: rgba(200,50,43,.06); --orangeTint: rgba(184,98,0,.07);
    --heading: #0B1B33; --overlay: rgba(11,27,51,.45); --shadow: rgba(11,27,51,.14);
    --okBg: #E3F4EC; --warnBg: #FCEFD9; --lateBg: #FBE6E4;
    --nav: #0B1F3F; --navText: #FFFFFF; --navMuted: rgba(255,255,255,.72); --navLine: rgba(255,255,255,.12);
    --hero: linear-gradient(135deg, #0B2A5B 0%, #0B1F3F 100%);
    --cardShadow: 0 1px 2px rgba(11,27,51,.06), 0 1px 1px rgba(11,27,51,.03);
    color-scheme: light;
  }
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body { height: 100%; }
  body {
    background: var(--base); color: var(--text);
    font-family: "Inter", -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 15px; overscroll-behavior: none; -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
  }
  button { font-family: inherit; cursor: pointer; }
  .ic { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -4px; }
  .num, .amount, .value, .val { font-variant-numeric: tabular-nums; }
  .wrap { max-width: 480px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }

  #loginView { display: flex; flex-direction: column; justify-content: center; min-height: 100svh; padding: 24px 20px; max-width: 420px; margin: 0 auto; }
  .logoChip { width: 52px; height: 52px; border-radius: 14px; background: var(--nav); color: var(--navText); display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; box-shadow: 0 6px 18px var(--shadow); }
  .logoChip .ic { width: 26px; height: 26px; stroke-width: 2; }
  h1 { color: var(--heading); font-size: 22px; font-weight: 700; text-align: center; letter-spacing: -.2px; }
  .subtitle { color: var(--textMuted); font-size: 14px; text-align: center; margin: 6px 0 22px; }
  .card { background: var(--surface); border: 1px solid var(--stroke); border-radius: 14px; padding: 22px; box-shadow: var(--cardShadow); }
  .tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 20px; border-bottom: 1px solid var(--stroke); }
  .tabBtn { padding: 11px; border: 0; font-weight: 600; font-size: 14px; background: none; color: var(--textMuted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
  .tabBtn.active { color: var(--blue); border-bottom-color: var(--blue); }
  label { display: block; color: var(--textMuted); font-size: 13px; font-weight: 500; margin: 0 0 6px; }
  input, select {
    width: 100%; background: var(--input); color: var(--text); font-family: inherit;
    border: 1px solid var(--strokeLight); border-radius: 8px;
    padding: 11px 12px; font-size: 15px; margin-bottom: 12px;
    appearance: none; -webkit-appearance: none; transition: border-color .15s, box-shadow .15s;
  }
  select { background-image: linear-gradient(45deg, transparent 50%, var(--textMuted) 50%), linear-gradient(135deg, var(--textMuted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
  input:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent); }
  input[type="checkbox"] { appearance: checkbox; -webkit-appearance: checkbox; accent-color: var(--blue); width: 18px; height: 18px; margin: 0; flex-shrink: 0; box-shadow: none; }
  input::placeholder { color: var(--textSubtle); }
  .btn { width: 100%; padding: 12px; border: 1px solid transparent; border-radius: 8px; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background .15s, border-color .15s, filter .15s; }
  .btn-primary { background: var(--blue); color: var(--dark); }
  .btn-primary:hover { filter: brightness(1.08); }
  .btn-primary:active, .btn-ghost:active { filter: brightness(.94); }
  .btn-primary:disabled, .btn-ghost:disabled { opacity: .5; }
  .btn-ghost { background: var(--surface); color: var(--text); border-color: var(--strokeLight); }
  .btn-ghost:hover { background: var(--hover); }
  .btn-sm { padding: 9px 12px; font-size: 13px; width: auto; white-space: nowrap; }
  .status { color: var(--red); font-size: 13px; text-align: center; margin-bottom: 10px; min-height: 0; }
  .status.ok { color: var(--green); }
  .link { background: none; border: 0; color: var(--blue); font-size: 13px; font-weight: 600; padding: 0; }
  .link:hover { text-decoration: underline; }

  .appBar { background: var(--nav); color: var(--navText); position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); }
  .header { display: flex; align-items: center; gap: 10px; max-width: 480px; margin: 0 auto; padding: 12px 16px; }
  .brandMark { width: 32px; height: 32px; border-radius: 8px; background: rgba(255,255,255,.12); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .brandMark .ic { width: 18px; height: 18px; stroke-width: 2; }
  .header h2 { color: var(--navText); font-size: 16px; font-weight: 700; letter-spacing: -.1px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header h2 small { color: var(--navMuted); font-weight: 500; font-size: 12px; margin-left: 6px; }
  .avatar { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,.16); color: var(--navText); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; letter-spacing: .3px; }
  .chip { color: var(--navMuted); font-size: 12px; font-weight: 500; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: none; }
  .iconBtn { background: transparent; border: 1px solid var(--navLine); color: var(--navText); font-weight: 600; border-radius: 8px; padding: 7px 10px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
  .iconBtn:hover { background: rgba(255,255,255,.08); }
  .iconBtn span { display: none; }
  .sharedBar { display: flex; align-items: center; gap: 10px; background: color-mix(in srgb, var(--purple) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--purple) 40%, var(--stroke)); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--purple); }
  .sharedBar span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sharedBar button, .shareRow button { background: var(--surface); color: var(--text); border: 1px solid var(--strokeLight); border-radius: 7px; padding: 6px 10px; font-weight: 600; font-size: 12px; white-space: nowrap; }
  .shareRow { display: flex; align-items: center; gap: 10px; background: var(--input); border: 1px solid var(--stroke); border-radius: 9px; padding: 8px 10px; margin-bottom: 6px; font-size: 13px; }
  .shareRow span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); display: flex; align-items: center; gap: 8px; }
  .shareRow .ic { color: var(--textSubtle); width: 16px; height: 16px; }

  .balanceCard { background: var(--hero); color: var(--heroText); border-radius: 16px; padding: 20px; margin-bottom: 12px; box-shadow: 0 8px 24px var(--shadow); position: relative; overflow: hidden; }
  .balanceCard::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.10), transparent 70%); pointer-events: none; }
  .balanceCard .label { color: var(--heroMuted); font-size: 13px; font-weight: 500; }
  .balanceCard .value { color: var(--heroText); font-size: 32px; font-weight: 700; letter-spacing: -.5px; margin: 6px 0 10px; }
  .balanceCard .value.neg { color: var(--heroNeg); }
  .balanceCard .sub { color: var(--heroMuted); font-size: 12px; margin-top: 3px; }
  .balanceCard .sub span { font-weight: 600; }
  .miniRow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
  .miniCard { background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; padding: 14px; box-shadow: var(--cardShadow); }
  .miniCard .label { font-size: 12px; font-weight: 500; color: var(--textMuted); display: flex; align-items: center; gap: 6px; }
  .miniCard .label i { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
  .miniCard .label .ic { width: 13px; height: 13px; stroke-width: 2.2; }
  .miniCard .value { font-size: 18px; font-weight: 700; margin-top: 8px; color: var(--heading); }
  .miniCard .sub { color: var(--textSubtle); font-size: 11px; margin-top: 2px; }
  .inc .label i { background: var(--okBg); color: var(--green); }
  .exp .label i { background: var(--lateBg); color: var(--red); }
  .inc .value { color: var(--green); }

  .meterCard { background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--cardShadow); }
  .meterCard .top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--heading); }
  .meterCard .top > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
  .meterCard .top .ic { color: var(--textSubtle); width: 16px; height: 16px; }
  .meterCard .pct { font-size: 12px; font-weight: 600; color: var(--textMuted); }
  .meterCard input { margin: 0 0 10px; padding: 7px 10px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
  .bar { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--textSubtle) 18%, transparent); overflow: hidden; }
  .bar > div { height: 100%; border-radius: 3px; transition: width .3s; }
  .meterCard .hint { color: var(--textSubtle); font-size: 12px; margin-top: 8px; line-height: 1.5; }

  .mainTabs { display: flex; gap: 0; margin: 4px 0 14px; }
  .mainTabs .tabBtn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }

  .addCard { background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: var(--cardShadow); }
  .addCard h3 { color: var(--heading); font-size: 15px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
  .addCard h3 > .ic { color: var(--blue); }
  .addCard h3 small { color: var(--textSubtle); font-weight: 500; font-size: 12px; margin-left: auto; }
  .addCard h3.editing { color: var(--orange); }
  .twoCol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .twoCol input, .twoCol select { margin-bottom: 10px; }
  .row { display: flex; gap: 8px; align-items: center; }
  .row input, .row select { margin-bottom: 0; min-width: 0; }
  .searchRow { position: relative; }
  .searchRow .ic { position: absolute; left: 12px; top: 13px; color: var(--textSubtle); pointer-events: none; }
  .searchRow input { margin-bottom: 10px; padding-left: 38px; background-color: var(--surface); }
  .chipRow { display: flex; gap: 6px; margin: -2px 0 12px; flex-wrap: wrap; }
  .smallChip { background: var(--surface); border: 1px solid var(--strokeLight); color: var(--textMuted); border-radius: 16px; padding: 5px 11px; font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
  .smallChip .ic { width: 14px; height: 14px; }
  .smallChip:hover { border-color: var(--blue); color: var(--blue); }
  .smallChip.ok { color: var(--green); }
  .filterRow { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
  .filterRow select { padding: 8px 10px; font-size: 13px; margin-bottom: 10px; background-color: var(--surface); }

  #txList, #subList { background: var(--surface); border: 1px solid var(--stroke); border-radius: 12px; overflow: hidden; box-shadow: var(--cardShadow); }
  #txList:has(> .empty), #subList:has(> .empty) { background: transparent; border: 0; box-shadow: none; }
  .txItem { display: flex; align-items: center; gap: 12px; background: var(--surface); border-bottom: 1px solid var(--stroke); padding: 12px 14px; cursor: pointer; transition: background .12s; }
  .txItem:last-of-type { border-bottom: 0; }
  .txItem:hover { background: var(--hover); }
  .txItem .dot { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
  .txItem .dot .ic { width: 18px; height: 18px; }
  .txItem .info { flex: 1; min-width: 0; }
  .txItem .title { color: var(--heading); font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .txItem .meta { color: var(--textSubtle); font-size: 12px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .txItem .amount { font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--heading); }
  .txItem .amount.pos { color: var(--green); }
  .txItem .del { background: none; border: 0; color: var(--textSubtle); padding: 6px; border-radius: 6px; display: inline-flex; }
  .txItem .del .ic { width: 17px; height: 17px; }
  .txItem .del:hover { color: var(--red); background: var(--redTint); }
  .txItem .del.rcpt:hover { color: var(--blue); background: var(--hover); }
  .txItem.late { background: var(--redTint); }
  .txItem.soon { background: var(--orangeTint); }
  #txList > .btn { border-radius: 0; border: 0; border-top: 1px solid var(--stroke); color: var(--blue); }
  .empty { color: var(--textSubtle); text-align: center; padding: 22px 0; font-size: 13px; }
  .listFooter { display: flex; justify-content: space-between; align-items: center; color: var(--textSubtle); font-size: 12px; margin: 0 2px 10px; gap: 10px; }

  .badge { font-size: 11px; font-weight: 600; border-radius: 10px; padding: 2px 8px; }
  .segRow { display: flex; gap: 2px; margin-bottom: 10px; background: color-mix(in srgb, var(--textSubtle) 14%, transparent); border-radius: 9px; padding: 3px; }
  .segBtn { flex: 1; background: transparent; color: var(--textMuted); border: 0; border-radius: 7px; padding: 7px 4px; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .segBtn.active { background: var(--surface); color: var(--heading); font-weight: 600; box-shadow: 0 1px 3px var(--shadow); }
  .swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--stroke); margin-right: 10px; }
  .swatch.sel { box-shadow: 0 0 0 2px var(--heading); }
  .queueChip { display: none; background: rgba(255,255,255,.12); border: 0; color: var(--navText); font-weight: 600; border-radius: 8px; padding: 6px 9px; font-size: 12px; }
  .badge.ok { background: var(--okBg); color: var(--green); }
  .badge.warn { background: var(--warnBg); color: var(--orange); }
  .badge.late { background: var(--lateBg); color: var(--red); }
  .payBtn { background: var(--surface); border: 1px solid var(--strokeLight); color: var(--green); font-weight: 600; font-size: 12px; border-radius: 7px; padding: 6px 10px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
  .payBtn .ic { width: 14px; height: 14px; stroke-width: 2.2; }
  .payBtn:hover { background: var(--okBg); border-color: var(--green); }
  .subTotal { color: var(--textMuted); font-size: 13px; font-weight: 500; text-align: right; margin-bottom: 10px; }
  .banner { background: var(--lateBg); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; color: var(--red); font-weight: 600; font-size: 13px; }
  .banner span { flex: 1; display: flex; align-items: center; gap: 8px; }
  .banner button { background: var(--red); color: var(--dark); border: 0; border-radius: 7px; padding: 8px 12px; font-weight: 600; font-size: 12px; }
  .banner.info { background: var(--warnBg); border-color: color-mix(in srgb, var(--orange) 35%, transparent); color: var(--orange); }
  .hintText { color: var(--textMuted); background: var(--warnBg); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 12px; }

  .catRow { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 13px; }
  .catRow .name { color: var(--heading); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .catRow .val { font-weight: 600; font-size: 12px; white-space: nowrap; color: var(--textMuted); }
  .planRow { padding: 11px 0; border-bottom: 1px solid var(--stroke); }
  .planRow:last-child { border-bottom: 0; }
  .planRow .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 14px; }
  .planRow .top b { color: var(--heading); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .planRow .sub { color: var(--textSubtle); font-size: 12px; margin: 3px 0 6px; }
  .planRow .acts { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
  .miniBtn { background: var(--surface); border: 1px solid var(--strokeLight); border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600; color: var(--text); display: inline-flex; align-items: center; gap: 4px; }
  .miniBtn:hover { background: var(--hover); }
  .miniBtn .ic { width: 14px; height: 14px; }
  .miniBtn.danger { color: var(--textSubtle); border-color: transparent; background: none; padding: 4px 6px; }
  .miniBtn.danger:hover { color: var(--red); background: var(--redTint); }
  .colorDot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
  .legend { display: flex; gap: 16px; justify-content: center; font-size: 12px; color: var(--textMuted); margin-bottom: 8px; }
  .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
  #trendSvg text { fill: var(--textSubtle); font-size: 10px; font-family: inherit; }
  .tagChip { display: inline-block; background: var(--surface); border: 1px solid var(--strokeLight); border-radius: 14px; padding: 5px 11px; font-size: 13px; margin: 0 6px 6px 0; color: var(--text); cursor: pointer; }
  .tagChip:hover { border-color: var(--blue); }
  .tagChip small { color: var(--textSubtle); margin-left: 4px; }
  .note { color: var(--textSubtle); font-size: 12px; line-height: 1.5; }

  .sheetBg { position: fixed; inset: 0; background: var(--overlay); z-index: 90; display: flex; align-items: flex-end; justify-content: center; backdrop-filter: blur(2px); }
  .sheet { background: var(--surface); border-radius: 16px 16px 0 0; width: 100%; max-width: 480px; max-height: 85svh; display: flex; flex-direction: column; padding: 20px 16px calc(84px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px var(--shadow); }
  .sheet h3 { color: var(--heading); font-size: 17px; font-weight: 700; margin-bottom: 4px; }
  .sheet .sheetSub { color: var(--textMuted); font-size: 13px; margin-bottom: 14px; }
  .sheet .list { overflow-y: auto; flex: 1; margin-bottom: 12px; }
  .impItem { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--stroke); font-size: 13px; }
  .impItem .t { color: var(--heading); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .impItem .m { color: var(--textSubtle); font-size: 12px; }
  .impItem select { grid-column: 2 / 4; margin: 0; padding: 6px 28px 6px 8px; font-size: 12px; }
  .impItem.dup .t { color: var(--textSubtle); }

  #toast {
    position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
    transform: translateX(-50%) translateY(80px);
    background: var(--heading); border: 0; border-left: 4px solid var(--green); border-radius: 10px;
    padding: 12px 16px; font-size: 14px; font-weight: 500; color: var(--surface);
    box-shadow: 0 10px 30px var(--shadow);
    opacity: 0; transition: all .25s ease; pointer-events: none;
    max-width: 92vw; z-index: 99; display: flex; align-items: center; gap: 12px;
  }
  #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
  #toast.show.hasAction { pointer-events: auto; }
  #toast.warn { border-left-color: var(--orange); }
  #toast.error { border-left-color: var(--red); }
  #toast.info { border-left-color: var(--blue); }
  #toast button { background: transparent; color: var(--surface); border: 1px solid color-mix(in srgb, var(--surface) 40%, transparent); border-radius: 7px; padding: 6px 11px; font-weight: 600; font-size: 13px; white-space: nowrap; }

  .dlLink { color: var(--navText); border: 1px solid var(--navLine); border-radius: 8px; padding: 7px 12px; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; align-items: center; gap: 6px; }
  .dlLink:hover { background: rgba(255,255,255,.08); }
  .loginDl { display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; margin-top: 20px; color: var(--textMuted); font-size: 13px; text-decoration: none; }
  .loginDl b { color: var(--blue); font-weight: 600; }
  .trust { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--textSubtle); font-size: 12px; margin-top: 14px; }
  .trust .ic { width: 14px; height: 14px; }
  .desktopOnly { display: none; }

  @media (max-width: 999px) {
    .mainTabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; background: var(--surface); border-top: 1px solid var(--stroke); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px var(--shadow); }
    .mainTabs .tabBtn { flex-direction: column; gap: 3px; padding: 7px 2px 6px; font-size: 11px; font-weight: 500; border: 0; margin: 0; border-radius: 10px; color: var(--textSubtle); }
    .mainTabs .tabBtn .ic { width: 22px; height: 22px; }
    .mainTabs .tabBtn.active { color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); font-weight: 600; }
  }

  @media (min-width: 1000px) {
    .desktopOnly { display: inline-flex; }
    .wrap { max-width: 1320px; padding: 28px 32px 120px; }
    .header { max-width: 1320px; padding: 14px 32px; gap: 14px; }
    .header h2 { font-size: 17px; }
    .chip { display: block; }
    .iconBtn span { display: inline; }
    .layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 28px; align-items: start; }
    .summaryCol { position: sticky; top: 92px; }
    .mainTabs { margin: 0 0 20px; border-bottom: 1px solid var(--stroke); gap: 4px; }
    .mainTabs .tabBtn { flex: 0 0 auto; padding: 12px 16px; font-size: 14px; }
    .mainTabs .tabBtn:hover { color: var(--heading); }
    .mainTabs .tabBtn.active:hover { color: var(--blue); }
    .split { display: grid; grid-template-columns: 370px minmax(0, 1fr); gap: 20px; align-items: start; }
    .formCol { position: sticky; top: 92px; }
    .cardsGrid:not(.hidden) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
    .cardsGrid > .btn { grid-column: 1 / -1; }
    .addCard { padding: 20px; }
    .txItem { padding: 13px 18px; }
    .txItem .title { font-size: 15px; }
    .catRow { grid-template-columns: 170px 1fr auto; }
    .sheetBg { align-items: center; }
    .sheet { border-radius: 16px; max-width: 540px; max-height: 86vh; padding: 24px; }
    #toast { left: auto; right: 32px; bottom: 32px; transform: translateY(80px); }
    #toast.show { transform: translateY(0); }
    #loginView { max-width: 420px; }
  }

  .dayHead { display: flex; justify-content: space-between; gap: 10px; padding: 8px 14px 7px; font-size: 12px; font-weight: 600; color: var(--textMuted); background: color-mix(in srgb, var(--textSubtle) 8%, var(--surface)); border-bottom: 1px solid var(--stroke); font-variant-numeric: tabular-nums; }
  .dayHead span:last-child { color: var(--textSubtle); font-weight: 500; }
  .rcptMark { display: inline-flex; vertical-align: -3px; margin-right: 4px; color: var(--textSubtle); }
  .rcptMark .ic { width: 13px; height: 13px; }
  .txItem .dot .ic { stroke-width: 2; }
  @media (max-width: 999px) { .txItem .del.rcpt { display: none; } .txItem { gap: 10px; padding: 11px 12px; } .txItem .del { padding: 4px; } }

  .donutWrap { position: relative; width: 150px; height: 150px; margin: 4px auto 16px; }
  .donutCenter { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
  .donutCenter b { color: var(--heading); font-size: 15px; }
  .donutCenter span { color: var(--textSubtle); font-size: 11px; }
  .hidden { display: none !important; }
