﻿/* The wordmark only. Body text stays on the system stack. */
@font-face {
    font-family: "Pretendard Brand";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("fonts/pretendard-std-variable.woff2") format("woff2");
}

/*
 * The palette is the mark's own: its green as the accent and its coral
 * darkened into the colour that marks money going out. Turaveller and Tugether
 * are mixed from the same jar, so the three sit in one room rather than three.
 *
 * The surfaces are glass: translucent panels over a fixed field of soft colour
 * (.backdrop), blurred so the colour reads as light rather than as a picture.
 * The field is the mark's green and coral with a cool blue between them.
 */
:root {
    color-scheme: light dark;
    --bg: #eceee9;
    --panel: #fffefa;
    --border: #d5d9d0;
    --text: #1f2a26;
    /* Darker than the old muted grey: it sits on glass now, not on cream. */
    --muted: #59625b;
    --accent: #17504a;
    --accent-soft: rgba(23, 80, 74, 0.11);
    /* The mark's coral is #f1705c, too pale on cream to read as a number. */
    --negative: #a54e36;
    /* The mark's own green, a shade brighter than the wordmark's, so a gain
       separates from body text instead of sitting alongside it. */
    --positive: #186c5c;
    --on-accent: #fffefa;
    --warn: #8a4a12;
    --warn-soft: rgba(196, 110, 30, 0.15);

    /* Glass. --glass is a panel, --glass-strong is what floats over the page
       (the tab bar, the selected tab), --glass-line its rim of light. */
    --glass: rgba(255, 255, 255, 0.52);
    --glass-strong: rgba(255, 255, 255, 0.74);
    --glass-line: rgba(255, 255, 255, 0.78);
    --glass-blur: blur(26px) saturate(170%);
    --glass-shadow: 0 10px 30px rgba(24, 40, 34, 0.09), inset 0 1px 0 rgba(255, 255, 255, 0.85);
    --glass-lift: 0 16px 40px rgba(24, 40, 34, 0.16), inset 0 1px 0 rgba(255, 255, 255, 1);
    --field: rgba(255, 255, 255, 0.66);
    --field-line: rgba(31, 42, 38, 0.13);
    --hairline: rgba(31, 42, 38, 0.09);
    --glow-1: #a9e3cf;
    --glow-2: #ffc9b0;
    --glow-3: #b8c9f4;

    /*
     * Latin faces first, Korean faces after. A browser falls back per glyph, so
     * this keeps Latin text on exactly the face it was on while giving Hangul a
     * named font rather than whatever the generic fallback happens to be. None
     * of the Latin faces here contains a single Hangul syllable, and neither
     * does the bundled Pretendard subset -- that one is Latin-only and set for
     * the wordmark. Each Korean face listed ships with its platform: Apple SD
     * Gothic Neo on Apple, Malgun Gothic on Windows, Noto Sans CJK KR on
     * Android and most Linux desktops.
     */
    --font-ui: "Segoe UI", system-ui, -apple-system, "Apple SD Gothic Neo",
               "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR",
               "Nanum Gothic", sans-serif;
    --radius: 24px;
    --radius-sm: 14px;
    /* Shared with Turaveller and Tugether: the deep green is the family colour. */
    --brand-ink: #28332f;
    --brand-green: #17504a;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* Warm charcoal rather than blue-black: the same green, turned down. */
        --bg: #111513;
        --panel: #1c211e;
        --border: #2d3531;
        --text: #e7eae4;
        --muted: #a2aaa2;
        --accent: #6ec3ab;
        --accent-soft: rgba(110, 195, 171, 0.15);
        --negative: #e59178;
        --positive: #6ec3ab;
        --on-accent: #111513;
        --warn: #f0b27a;
        --warn-soft: rgba(240, 178, 122, 0.15);
        --glass: rgba(34, 40, 37, 0.55);
        --glass-strong: rgba(44, 51, 47, 0.78);
        --glass-line: rgba(255, 255, 255, 0.08);
        --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
        --glass-lift: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
        --field: rgba(255, 255, 255, 0.06);
        --field-line: rgba(255, 255, 255, 0.12);
        --hairline: rgba(255, 255, 255, 0.08);
        --glow-1: #1d4a3f;
        --glow-2: #4a2c22;
        --glow-3: #222f4d;
        /* Lifted off the family colours: #17504a on a dark panel is unreadable. */
        --brand-ink: #e7eae4;
        --brand-green: #6ec3ab;
    }
}

/* Glass costs a blur per panel. Where the browser cannot do it, or the person
   asked for less transparency, the panels go solid and nothing else changes. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root { --glass: var(--panel); --glass-strong: var(--panel); }
}

@media (prefers-reduced-transparency: reduce) {
    :root { --glass: var(--panel); --glass-strong: var(--panel); --glass-blur: none; }
}

/*
 * The Tu lockup, shared with Turaveller and Tugether. It lives here rather than
 * in scoped component CSS because the sign-in and invitation pages are plain
 * HTML endpoints, and this stylesheet is the only thing they share with the app.
 */
.brand-lockup { display: inline-flex; align-items: center; gap: .55rem; white-space: nowrap; }

.brand-icon {
    flex: none;
    width: var(--brand-icon-size, 30px);
    height: var(--brand-icon-size, 30px);
    border-radius: 26%;
    box-shadow: 0 3px 9px #17504a19;
}

.brand-wordmark {
    color: var(--brand-ink);
    font-family: "Pretendard Brand", var(--font-ui);
    font-size: var(--brand-text-size, 1.2rem);
    font-weight: 750;
    line-height: 1.1;
    letter-spacing: -.045em;
}

.brand-wordmark-tu { color: var(--brand-green); font-weight: 800; }

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font-ui);
}

/*
 * Korean has no spaces inside a word but plenty between phrases, and the
 * default break-anywhere behaviour splits a word across lines mid-syllable.
 * keep-all is the convention: break at the spaces, not inside the words. The
 * override keeps a long unbroken string -- an address, a hash -- from pushing
 * a table wider than the page.
 */
:lang(ko) {
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Radial washes rather than blurred shapes: the same soft light without a
   filter running over the whole window. */
.backdrop {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(38rem 38rem at 6% 4%, var(--glow-3), transparent 70%),
        radial-gradient(34rem 34rem at 96% 30%, var(--glow-2), transparent 70%),
        radial-gradient(40rem 40rem at 40% 105%, var(--glow-1), transparent 70%),
        var(--bg);
}

/* The one material. Everything that used to be a white box with a border is
   this now: panels, cards, the sidebar, the tab bar. */
.sidebar, .panel, .card, .tabbar-links, .tabbar-add, .list-group, .seg {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-line);
    box-shadow: var(--glass-shadow);
}

.shell {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 24px;
    width: 236px;
    flex: 0 0 236px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    border-radius: 30px;
    padding: 20px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar .brand { text-decoration: none; padding: 0 10px; --brand-icon-size: 30px; --brand-text-size: 1.2rem; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar nav a:hover { background: var(--field); color: var(--text); }

.sidebar nav a.active {
    background: var(--glass-strong);
    box-shadow: 0 2px 10px rgba(24, 40, 34, 0.10);
    color: var(--accent);
    font-weight: 600;
}

.nav-icon { flex: none; }

.sidebar-foot {
    margin-top: auto;
    padding: 14px 12px 0;
    border-top: 1px solid var(--hairline);
    font-size: 12px;
    color: var(--muted);
}

.content { flex: 1; min-width: 0; padding-top: 8px; }

/* Only on a phone; see the media query at the end. */
.tabbar { display: none; }

h1 { font-size: 34px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.02em; line-height: 1.2; }
/* Focus lands on the title after every navigation so a screen reader starts
   there; it is not something a sighted user moved to, so no ring. */
h1:focus { outline: none; }
h2 { font-size: 15px; margin: 0 0 12px; letter-spacing: -0.1px; }
.page-sub { color: var(--muted); margin: 0 0 22px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.text-link { color: var(--accent); text-decoration: none; font-size: 13px; font-weight: 600; }
.text-link:hover { text-decoration: underline; }

.panel {
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 18px;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }

.card {
    border-radius: 22px;
    padding: 16px 18px;
}

.card .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.card .value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 14px; }
.panel-heading h2 { margin-bottom: 2px; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--hairline); }
.mini-metrics > div { padding: 14px 16px 0 0; min-width: 0; }
.mini-metrics .label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.mini-metrics strong { font-size: 17px; font-variant-numeric: tabular-nums; }

/* The dashboard's decision panel: what is waiting on a decision, one row each,
   each a link to where it is decided. */
.decide-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 -10px;
    padding: 12px 10px;
    border-radius: 18px;
    color: var(--text);
    text-decoration: none;
}
a.decide-row:hover { background: var(--field); }
.decide-row + .decide-row { margin-top: 2px; }
.decide-row > .nav-icon:last-child { color: var(--muted); width: 18px; height: 18px; flex: none; }
.decide-row .list-text { display: flex; flex-direction: column; gap: 2px; }
.decide-row[hidden] { display: none; }
.list-icon.warn { background: var(--warn-soft); color: var(--warn); }

/* --- Page structures from the mockups ---------------------------------- */

/* The small line over a page's title: the period, the currency. */
.eyebrow { margin: 0 0 2px; color: var(--muted); font-size: 14px; font-weight: 500; }
.page-heading { margin-bottom: 20px; align-items: flex-end; flex-wrap: wrap; }
.page-heading h1 { margin: 0; }

/* A link that reads as the page's main action. */
.pill-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px 0 16px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pill-link .nav-icon { width: 18px; height: 18px; stroke-width: 2.4; }
.pill-link:hover { filter: brightness(1.08); }

/* Two columns, the first twice the second, that become one on a narrow
   screen without a media query. */
.split { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.split > * { flex: 1 1 300px; min-width: 0; margin-bottom: 0; }
.split > :first-child { flex: 2 1 520px; }

/* The one figure a page is about. */
.hero { padding: 24px 26px 20px; }
.hero .label, .tiles .label { font-size: 14px; font-weight: 600; color: var(--muted); }
.hero-value {
    font-size: clamp(36px, 6vw, 54px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
    margin: 2px 0 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--field);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.chip-pos { background: color-mix(in srgb, var(--positive) 14%, transparent); color: var(--positive); }
.chip-neg { background: color-mix(in srgb, var(--negative) 14%, transparent); color: var(--negative); }

/* Six months as paired bars: in beside out. Heights come from the page. */
.month-bars {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    height: 150px;
    margin-top: 16px;
}
.month-bar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.month-bar .bars { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.month-bar .bars span { width: min(16px, 40%); min-height: 3px; border-radius: 6px 6px 3px 3px; }
.bar-in, .dot-in { background: var(--accent); }
.bar-out, .dot-out { background: color-mix(in srgb, var(--negative) 70%, transparent); }
.month-label { text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.legend { display: flex; gap: 16px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }

/* Small panels in a row that wraps: the week, the month, staking. */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 18px; margin-bottom: 18px; }
.tiles > .panel { margin-bottom: 0; }
.tiles > [hidden] { display: none; }

/* A label and a figure per line, the last one ruled off as the total. */
.figure-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.figure-rows > div { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.figure-rows > div > span { color: var(--muted); }
.figure-rows > .total { padding-top: 8px; border-top: 1px solid var(--hairline); }

/* The week's allowance as a ring. */
.week-tile { display: flex; align-items: center; gap: 18px; color: var(--text); text-decoration: none; }
.week-tile:hover { background: var(--glass-strong); }
.week-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.week-text strong { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.week-text strong small { font-size: 13px; font-weight: 500; color: var(--muted); }
.ring { position: relative; width: 96px; height: 96px; flex: none; }
.ring svg { width: 100%; height: 100%; }
.ring circle { fill: none; stroke-width: 11; }
.ring-track { stroke: var(--hairline); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; }
.ring-fill.over { stroke: var(--negative); }
.ring-value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.ring-lg { width: 150px; height: 150px; }
.ring-lg circle { stroke-width: 12; }
.ring-value.stacked { flex-direction: column; gap: 0; text-align: center; padding: 0 18px; }
.ring-value.stacked strong { font-size: 22px; letter-spacing: -0.02em; }
.ring-value.stacked small { font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.2; }

/* Money · Weekly: the week beside the run of weeks before it. */
.week-summary { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; margin-bottom: 18px; }
.week-main { flex: 1 1 380px; display: flex; flex-wrap: wrap; align-items: center; gap: 24px; }
.week-main .figure-rows { flex: 1 1 200px; margin-top: 0; }
.week-history {
    flex: 1 1 300px;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 8px;
    height: 170px;
}
.week-bar { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.week-bar .track { position: relative; flex: 1; display: flex; align-items: flex-end; }
.week-bar .fill { width: 100%; min-height: 3px; border-radius: 8px 8px 4px 4px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.week-bar.now .fill { background: var(--accent); }
.week-bar .fill.over { background: color-mix(in srgb, var(--negative) 75%, transparent); }
/* The week's own allowance, so a bar above its line reads as over. */
.week-bar .limit { position: absolute; left: -2px; right: -2px; border-top: 2px dashed color-mix(in srgb, var(--text) 40%, transparent); }
.week-bar.now .month-label { color: var(--accent); font-weight: 700; }

/* Investments: how the holdings split across accounts. */
.split-bar { display: flex; gap: 4px; height: 14px; margin: 14px 0 10px; }
.split-bar span { border-radius: 7px; min-width: 4px; }
.legend strong { font-variant-numeric: tabular-nums; }
.tone-0 { background: var(--accent); }
.tone-1 { background: #d9772b; }
.tone-2 { background: #4f74c8; }
.tone-3 { background: #b59a2a; }
.tone-4 { background: #8a5cc2; }

/* A list in place of a table where every row is a name and a figure. */
.rows { display: flex; flex-direction: column; }
.row-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 56px;
    padding: 8px 4px;
    border-top: 1px solid var(--hairline);
}
.row-item:first-child { border-top: none; }
.row-item .list-text { display: flex; flex-direction: column; gap: 1px; }
.row-figure { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.row-item.total { border-top: 1px solid var(--field-line); }

/* The ledger: entries on the left, the form held beside them. A phone gets
   one column with the form first. */
.ledger-split {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr);
    gap: 18px;
    align-items: start;
}
.ledger-split > .panel { margin-bottom: 0; }
.ledger-split > .entry-panel {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: 24px;
    background: var(--glass-strong);
    box-shadow: var(--glass-lift);
}
.ledger-split > .recent-panel { grid-column: 1; grid-row: 1; overflow-x: auto; }

@media (max-width: 1100px) {
    .ledger-split { grid-template-columns: minmax(0, 1fr); }
    .ledger-split > .entry-panel, .ledger-split > .recent-panel { grid-column: auto; grid-row: auto; position: static; }
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--hairline); }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255, 255, 255, 0.28); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

@media (prefers-color-scheme: dark) {
    tbody tr:hover td { background: rgba(255, 255, 255, 0.04); }
}

.pos { color: var(--positive); }
.neg { color: var(--negative); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* Whether a figure will be backed by a slip. The self-reported one is coloured
   because nothing else is going to remind you of it. */
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.tag.due { background: var(--accent-soft); color: var(--accent); }
.tag.self { background: color-mix(in srgb, var(--negative) 14%, transparent); color: var(--negative); }
.tag.none { background: var(--field); color: var(--muted); border: 1px solid var(--field-line); }

/* Filing season, February to the end of May. Silent the rest of the year: a
   banner about a return in September is only noise. */
.season { border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); color: var(--accent); border-radius: 18px; padding: 12px 16px; margin-bottom: 18px; font-size: 13px; }
.navdot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-left: 5px; }

label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

input, select, textarea, button {
    font: inherit;
    color: var(--text);
    background: var(--field);
    border: 1px solid var(--field-line);
    border-radius: 12px;
    padding: 9px 12px;
    width: 100%;
}

input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; background: var(--glass-strong); }

.row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.row > div { flex: 1 1 150px; min-width: 0; }
.row > div.narrow { flex: 0 0 130px; }

button {
    cursor: pointer;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
    width: auto;
    padding: 9px 18px;
    border-radius: 999px;
}

button:hover { filter: brightness(1.08); }
button.ghost { background: var(--field); color: var(--text); border-color: var(--field-line); font-weight: 500; }
button.link { background: none; border: none; color: var(--negative); padding: 2px 6px; font-weight: 500; }

/* A form opened against one row of a table, shown in place under it. The tinted
   ground is what ties it to the row above: without it the fields read as part of
   the next row down. */
.edit-row > td { background: var(--field); padding: 14px 10px; }
.edit-account .row:last-of-type { margin-bottom: 12px; }
.edit-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

/* Sharing. A tick box sits beside its words rather than above them, which the
   block label rule would otherwise do. */
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin: 4px 0; }
.check input { width: auto; margin: 0; }
.check.child { padding-left: 20px; }
/* What the other person would see, set apart from the controls that change it:
   the one thing on that screen that is theirs rather than yours. */
.preview { border: 1px solid var(--accent); border-radius: 16px; padding: 12px 14px; margin-top: 12px; background: var(--glass-strong); }
.preview h3 { font-size: 14px; margin: 0 0 8px; }
.scroll-x { overflow-x: auto; }
.month-nav { display: flex; align-items: center; gap: 10px; margin: 6px 0 10px; }
.month-nav button { padding: 5px 12px; }
.pick-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--field-line); border-radius: 14px; padding: 6px 10px; background: var(--field); margin-bottom: 4px; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 12px; margin-bottom: 6px; }
.parts > div { display: flex; align-items: center; gap: 8px; }
.parts > div span { flex: 1; font-size: 13px; }
.parts > div input { width: 90px; }

/* Tabs and choices: a groove of glass with the chosen one raised out of it,
   rather than a filled block of accent. */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; }
.seg button {
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-weight: 500;
    padding: 7px 16px;
}
.seg button:hover { filter: none; color: var(--text); }
.seg button.on {
    background: var(--glass-strong);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(24, 40, 34, 0.14);
}

.alert { border-radius: 16px; padding: 11px 14px; margin-bottom: 12px; font-size: 13px; }
.alert.err { background: #f7e3db; color: #8c3b2a; }
.alert.ok { background: var(--accent-soft); color: var(--accent); }

@media (prefers-color-scheme: dark) {
    .alert.err { background: #33241f; color: #e59178; }
}

.empty { color: var(--muted); padding: 20px 0; text-align: center; }

.bar { height: 6px; border-radius: 3px; background: var(--accent); min-width: 2px; }

.statement-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.statement-heading h2 { margin-bottom: 2px; }
.statement-cards { margin-bottom: 12px; }
details summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; }

/* A list of places to go, one per row, grouped like a phone's settings: More,
   and anywhere else a list of links reads better than a table. */
.list-group { border-radius: 22px; overflow: hidden; margin-bottom: 14px; }
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 6px 16px;
    color: var(--text);
    text-decoration: none;
    font-size: 16px;
}
.list-row + .list-row { border-top: 1px solid var(--hairline); }
a.list-row:hover { background: var(--field); }
.list-row > .nav-icon:last-child { color: var(--muted); width: 18px; height: 18px; }
.list-icon {
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}
.list-icon .nav-icon { width: 19px; height: 19px; }
.list-text { flex: 1; min-width: 0; }
.list-row .langswitch { margin: 0; flex: 0 0 auto; }
.signout-row { justify-content: center; color: var(--negative); font-weight: 600; }

/* The phone tab bar's round button opens the ledger at its form; keep the
   form's heading clear of the top of the screen when it lands there. */
#new-entry { scroll-margin-top: 16px; }

/*
 * Amber rather than the palette's clay: this bar means the circuit is broken,
 * not that a number went the wrong way, and it should not read as either.
 */
#blazor-error-ui {
    display: none;
    position: fixed;
    box-sizing: border-box;
    bottom: 0; left: 0; right: 0;
    background: #f3e2c0;
    color: #5c4318;
    padding: 10px 16px;
    box-shadow: 0 -1px 2px #28332f2b;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; float: right; }

.sidebar-foot .signout {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    text-decoration: none;
}

.sidebar-foot .signout:hover { color: var(--text); text-decoration: underline; }

.sidebar-foot .who { color: var(--text); font-weight: 600; margin-bottom: 4px; }

@media (max-width: 720px) {
    /* The sidebar goes and the tab bar comes: four places and More, floating
       over the foot of the page. The page keeps room under its last panel so
       nothing ends up behind the bar. */
    .shell { display: block; padding: 20px 16px calc(112px + env(safe-area-inset-bottom)); }
    .sidebar { display: none; }
    .content { padding-top: 12px; }
    h1 { font-size: 32px; }

    .tabbar {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        z-index: 50;
        gap: 10px;
        align-items: center;
    }

    .tabbar-links, .tabbar-add { background: var(--glass-strong); box-shadow: var(--glass-lift); }

    .tabbar-links {
        flex: 1;
        min-width: 0;
        height: 64px;
        border-radius: 32px;
        padding: 0 6px;
        display: flex;
        align-items: center;
        justify-content: space-around;
    }

    .tabbar-links a {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 52px;
        padding: 6px 8px;
        border-radius: 22px;
        color: var(--muted);
        font-size: 10.5px;
        font-weight: 500;
        line-height: 1.2;
        text-decoration: none;
        white-space: nowrap;
    }

    .tabbar-links a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
    .tabbar-links .navdot { position: absolute; top: 5px; right: 14px; margin: 0; }

    .tabbar-add {
        flex: none;
        width: 64px;
        height: 64px;
        border-radius: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--accent);
    }

    .tabbar-add .nav-icon { width: 26px; height: 26px; stroke-width: 2.2; }

    /* Two figures side by side: one to a row leaves a phone scrolling past
       four nearly empty tiles before it reaches anything else. */
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .card { padding: 14px 16px; }
    .card .value { font-size: 20px; }
    .mini-metrics { grid-template-columns: 1fr; }
    .mini-metrics > div { padding-top: 10px; }
    .panel { padding: 18px; }
    /* A row of tabs wraps onto a second line rather than widening the page.
       Not scrolled: a tab scrolled out of sight at a tab's edge gives no sign
       it is there. A label stays on one line instead of being squeezed. */
    .seg { max-width: 100%; flex-wrap: wrap; border-radius: 22px; }
    .seg button { flex: 1 0 auto; white-space: nowrap; min-height: 40px; }
    /* A table with more columns than a phone has room for scrolls inside its
       panel; the page itself stays the width of the screen. */
    .panel { overflow-x: auto; }
    /* A thumb, not a pointer: every field and button at least 44px tall. */
    input, select, textarea, button { min-height: 44px; font-size: 16px; }
}
