/* Bills phone app: Fluent-like, phone first, light and dark. */
:root {
    --bg: #ffffff; --bg2: #f5f5f5; --card: #ffffff; --line: #e0e0e0; --text: #242424; --muted: #616161;
    --accent: #0f6cbd; --accent-fg: #ffffff; --ok: #107c10; --warn: #bc4b09; --bad: #c50f1f; --info: #0f6cbd; --grey: #707070;
    --radius: 8px; --tab-h: 64px; --head-h: 52px;
    font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
    color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
    :root { --bg: #1b1b1b; --bg2: #141414; --card: #262626; --line: #3a3a3a; --text: #f0f0f0; --muted: #adadad;
        --accent: #479ef5; --accent-fg: #0a0a0a; --ok: #54b054; --warn: #f7894a; --bad: #f1707b; --info: #479ef5; --grey: #9a9a9a; }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg2); color: var(--text); font-size: 16px; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 1.35rem; margin: 0 0 .5rem; } h2 { font-size: 1.1rem; margin: 1.2rem 0 .5rem; } h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 80vh; color: var(--muted); }
.splash .slow-hint { opacity: 0; animation: slow-hint-in .4s ease 6s forwards; max-width: 22rem; text-align: center; }
@keyframes slow-hint-in { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash .slow-hint { animation-duration: 0s; } }

/* shell */
.app { min-height: 100dvh; padding-top: calc(var(--head-h) + env(safe-area-inset-top)); padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 12px); }
.head { position: fixed; top: 0; left: 0; right: 0; z-index: 10; height: calc(var(--head-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 12px 0;
    display: flex; align-items: center; gap: 8px; background: var(--card); border-bottom: 1px solid var(--line); }
.head .title { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head select { max-width: 55vw; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; background: var(--bg); }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border-top: 1px solid var(--line); }
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; color: var(--muted); text-decoration: none; position: relative; }
.tabs a.active { color: var(--accent); font-weight: 600; }
.tabs .ico { font-size: 1.3rem; line-height: 1; }
.tabs .count { position: absolute; top: 6px; right: 22%; background: var(--bad); color: #fff; border-radius: 9px; font-size: .65rem; padding: 1px 5px; }
main { padding: 12px; max-width: 760px; margin: 0 auto; }

/* banners */
.banner { margin: 8px 12px 0; padding: 10px 12px; border-radius: var(--radius); font-size: .9rem; display: flex; gap: 10px; align-items: center; }
.banner.offline { background: #fff4ce; color: #4d3a00; }
.banner.update { background: var(--accent); color: var(--accent-fg); cursor: pointer; }
.banner.info { background: var(--card); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .banner.offline { background: #4d3a00; color: #fff4ce; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + 20px + env(safe-area-inset-bottom)); z-index: 20;
    background: #333; color: #fff; padding: 10px 16px; border-radius: 20px; font-size: .9rem; max-width: 90vw; }

/* cards and lists */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.card .label { font-size: .78rem; color: var(--muted); } .card .value { font-size: 1.15rem; font-weight: 600; margin-top: 2px; }
.card.wide { grid-column: 1 / -1; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; overflow: hidden; }
.panel-head { padding: 10px 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); }
.panel-head small { font-weight: 400; color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-height: 56px; }
.row:last-child { border-bottom: 0; }
.row .main { flex: 1; min-width: 0; } .row .name { font-weight: 500; overflow-wrap: anywhere; } .row .sub { font-size: .8rem; color: var(--muted); }
.row .amount { font-weight: 600; white-space: nowrap; }
.row.done .name, .row.done .amount { color: var(--muted); }
.row.link { cursor: pointer; }

/* finger-sized tick */
.tick { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); display: grid; place-items: center; font-size: 1.3rem; cursor: pointer; }
.tick.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.badge { font-size: .7rem; padding: 1px 6px; border-radius: 10px; color: #fff; }
.badge.red { background: var(--bad); } .badge.amber { background: var(--warn); } .badge.blue { background: var(--info); } .badge.grey { background: var(--grey); } .badge.green { background: var(--ok); }

/* forms and buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--radius);
    border: 1px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.small { min-height: 34px; padding: 0 10px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
label.field { display: block; margin: 10px 0; } label.field > span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
label.field.check { display: flex; align-items: center; gap: 8px; } label.field.check > span { display: inline; margin: 0; color: var(--text); font-size: .95rem; }
input[type=text], input[type=number], input[type=date], input[type=email], select, textarea {
    width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
textarea { min-height: 90px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; } .check input { width: 22px; height: 22px; }
.error { color: var(--bad); margin: 8px 0; } .muted { color: var(--muted); } .small { font-size: .85rem; }
.switcher { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.switcher .mid { text-align: center; flex: 1; } .switcher .mid .sub { font-size: .8rem; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.chip { border: 1px solid var(--line); border-radius: 16px; padding: 6px 12px; background: var(--card); cursor: pointer; font-size: .85rem; }
.chip.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.chart { width: 100%; height: auto; display: block; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--card); border-radius: 14px 14px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    max-height: 88dvh; overflow: auto; }
.center { text-align: center; } .gap { height: 12px; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: #fde7e9; color: #600; padding: 12px; }
@media (min-width: 700px) { .cards { grid-template-columns: repeat(3, 1fr); } }
/* The Bills dragon's mood on This month (13/11/2026) */
.dragon-card { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin: 10px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.dragon-card .dragon-art { flex: 0 0 auto; line-height: 0; }
.dragon-card p { margin: 0; }
