/* Saldo — design system: light, professional ledger UI in Inter with the TechTools indigo accent; dark mode via [data-theme="dark"]. */

:root {
    --tt-topnav-h: 64px;

    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #eef0f4;
    --raised: #ffffff;
    --seg-on: #ffffff;
    --line: #e5e7eb;
    --line-strong: #d0d5dd;
    --text: #101828;
    --text-2: #475467;
    --text-3: #5d6778;
    --accent: #4f46e5;
    --accent-strong: #4338ca;
    --accent-deep: #c7d2fe;
    --accent-wash: #eef2ff;
    --on-accent: #ffffff;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --focus-ring: rgba(79, 70, 229, 0.16);
    --selection: rgba(79, 70, 229, 0.18);
    --pos: #067647;
    --pos-wash: #ecfdf3;
    --neg: #b42318;
    --neg-wash: #fef3f2;
    --warn: #b54708;
    --warn-wash: #fffaeb;
    --info: #026aa2;
    --info-wash: #f0f9ff;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
    --shadow: 0 16px 36px -10px rgba(16, 24, 40, 0.18), 0 4px 10px -4px rgba(16, 24, 40, 0.06);
    --scrim: rgba(16, 24, 40, 0.45);
    --input-bg: #ffffff;
    --paper: #ffffff;
    --paper-ink: #101828;
    --paper-muted: #475467;
    --paper-line: #e4e7ec;
    --paper-accent: #4338ca;

    --gold: var(--accent);
    --gold-strong: var(--accent-strong);
    --gold-deep: var(--accent-deep);
    --gold-wash: var(--accent-wash);
    --on-gold: var(--on-accent);
    --paper-gold: var(--paper-accent);

    --font-display: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-md: 0.875rem;
    --fs-lg: 1rem;
    --fs-xl: 1.25rem;
    --fs-2xl: 1.5rem;
    --fs-3xl: 1.875rem;
    --fs-4xl: 2.25rem;
    --fs-5xl: 3rem;

    --r-sm: 8px;
    --r-md: 10px;
    --r-lg: 12px;
    --rail-w: 256px;
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #0f1116;
    --surface: #15181e;
    --surface-2: #1a1d24;
    --surface-3: #22262e;
    --raised: #1c2027;
    --seg-on: #2b303b;
    --line: #292d36;
    --line-strong: #373c47;
    --text: #e7e9ee;
    --text-2: #a9b0bd;
    --text-3: #8d96a6;
    --accent: #8b93f8;
    --accent-strong: #a5acfa;
    --accent-deep: #3b3f86;
    --accent-wash: rgba(99, 102, 241, 0.16);
    --on-accent: #ffffff;
    --primary: #5d5fef;
    --primary-hover: #4f46e5;
    --focus-ring: rgba(139, 147, 248, 0.25);
    --selection: rgba(139, 147, 248, 0.3);
    --pos: #47cd89;
    --pos-wash: rgba(23, 178, 106, 0.14);
    --neg: #f97066;
    --neg-wash: rgba(240, 68, 56, 0.14);
    --warn: #fdb022;
    --warn-wash: rgba(247, 144, 9, 0.14);
    --info: #36bffa;
    --info-wash: rgba(11, 165, 236, 0.14);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow: 0 18px 44px -10px rgba(0, 0, 0, 0.65);
    --scrim: rgba(4, 6, 10, 0.7);
    --input-bg: #12151a;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { overflow-x: clip; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-text);
    font-size: var(--fs-md);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--selection); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; color: var(--text-2); }

.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }

/* ————— Shell ————— */

.saldo {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    min-height: calc(100dvh - var(--tt-topnav-h));
}

.rail {
    position: sticky;
    top: var(--tt-topnav-h);
    height: calc(100dvh - var(--tt-topnav-h));
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 18px 14px 14px;
    border-right: 1px solid var(--line);
    background: var(--surface);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
}

.entity-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 10px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-2);
    cursor: pointer;
    text-align: left;
}
.entity-switch:hover { border-color: var(--line-strong); background: var(--surface-3); }
.entity-mark {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: var(--accent-wash);
}
.entity-text { min-width: 0; flex: 1; }
.entity-name { display: block; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-meta { display: block; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entity-switch .fa-chevron-down { color: var(--text-3); font-size: 0.7rem; }

.rail-nav { display: flex; flex-direction: column; gap: 1px; margin-top: 10px; }
.rail-group { margin: 18px 10px 6px; font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; color: var(--text-3); letter-spacing: 0.06em; }
.rail-link {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 36px;
    padding: 7px 10px;
    border-radius: var(--r-sm);
    color: var(--text-2);
    font-size: var(--fs-md);
    font-weight: 500;
}
.rail-link i { width: 16px; text-align: center; font-size: 0.85rem; color: var(--text-3); }
.rail-link:hover { color: var(--text); background: var(--surface-3); }
.rail-link.active { color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.rail-link.active i { color: var(--accent); }
.rail-count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 0.7rem;
    line-height: 18px;
    text-align: center;
    background: var(--surface-3);
    color: var(--text-2);
    font-variant-numeric: tabular-nums;
}
.rail-count.alert { background: var(--neg-wash); color: var(--neg); }

.rail-foot { margin-top: auto; padding: 14px 6px 2px; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); }
.rail-foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.year-picker { display: inline-flex; align-items: center; gap: 2px; }
.year-picker button {
    width: 30px; height: 30px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-2); cursor: pointer;
}
.year-picker button:hover { background: var(--surface-2); color: var(--text); }
.year-picker strong { font-weight: 700; font-size: 1rem; min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }

.stage { min-width: 0; padding: 28px 40px 80px; }

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 26px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}
.page-head h1 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.75rem;
    line-height: 1.2;
    letter-spacing: -0.022em;
    text-wrap: balance;
}
.page-head .lede { margin: 6px 0 0; color: var(--text-2); max-width: 62ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: var(--fs-sm); color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.005em; }
.section-head h2.display { font-weight: 700; font-size: var(--fs-xl); }
.section-head .note { font-size: var(--fs-sm); color: var(--text-3); }

.mobile-bar { display: none; }

/* ————— Buttons ————— */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 8px 15px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text);
    font-weight: 600;
    font-size: var(--fs-md);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.btn:hover { border-color: var(--line-strong); background: var(--surface-2); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn i { font-size: 0.85em; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-accent); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); background: var(--surface-3); border-color: transparent; }
.btn-danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 35%, var(--line-strong)); }
.btn-danger:hover { background: var(--neg-wash); border-color: var(--neg); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: var(--fs-sm); }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.btn-group .btn + .btn { margin-left: -1px; }

.link-btn { border: 0; background: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; }
.link-btn:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

/* ————— Forms ————— */

.form-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px 16px; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.field .hint { font-size: var(--fs-xs); color: var(--text-3); }
.field .error-text, .form-error { font-size: var(--fs-xs); color: var(--neg); }
.form-alert { margin-bottom: 14px; }
.field [aria-invalid="true"], .field [aria-invalid="true"]:focus, .input[aria-invalid="true"]:focus { border-color: var(--neg); }

.input, .field input, .field select, .field textarea, .select {
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--input-bg);
    color: var(--text);
    font-size: var(--fs-md);
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--focus-ring);
}
.field input[readonly] { color: var(--text-2); background: transparent; }
.field input.num-input, .input.num-input { text-align: right; font-variant-numeric: tabular-nums; }
select option { background-color: #ffffff; color: #101828; }
:root[data-theme="dark"] select option { background-color: #181c24; color: #f2f4f7; }

.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: var(--fs-md); color: var(--text); min-height: 32px; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

.input-group { display: flex; align-items: stretch; }
.input-group .input, .input-group input { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.input-group .btn { border-radius: 0 var(--r-sm) var(--r-sm) 0; margin-left: -1px; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: var(--fs-sm); pointer-events: none; }
.input-affix input { padding-right: 44px; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 240px;
}
.search i { position: absolute; left: 12px; color: var(--text-3); font-size: 0.8rem; }
.search input { padding-left: 34px; }

/* ————— Segmented & tabs ————— */

.segmented {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-3);
    flex-wrap: wrap;
}
.segmented button {
    border: 0;
    background: transparent;
    color: var(--text-2);
    padding: 6px 12px;
    min-height: 32px;
    border-radius: 7px;
    cursor: pointer;
    font-size: var(--fs-sm);
    font-weight: 500;
    white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--seg-on); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented .count { margin-left: 6px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button {
    border: 0;
    background: none;
    padding: 10px 0 12px;
    color: var(--text-2);
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: inset 0 -2px 0 transparent;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* ————— Tables ————— */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 10px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    color: var(--text-2);
    font-weight: 600;
    font-size: var(--fs-xs);
    letter-spacing: 0.01em;
    text-align: left;
    white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--surface-2); }
.table tfoot td { padding: 12px 14px; border-top: 1px solid var(--line-strong); font-weight: 600; background: var(--surface-2); }
.table .money { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.table .money small { color: var(--text-3); font-size: 0.8em; margin-left: 3px; }
.table .primary { font-weight: 600; }
.table .sub { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-top: 1px; }
.table .actions { text-align: right; white-space: nowrap; }
.table-compact td, .table-compact th { padding: 8px 12px; }
.table .indent-1 td:first-child { padding-left: 28px; }
.table .indent-2 td:first-child { padding-left: 44px; }
.table .indent-3 td:first-child { padding-left: 60px; }
.table tr.row-strong td { font-weight: 600; }
.table tr.row-total td { font-weight: 700; border-top: 1px solid var(--line-strong); background: var(--surface-2); }

/* ————— Pills ————— */

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
    border: 1px solid transparent;
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-paid { color: var(--pos); background: var(--pos-wash); }
.pill-overdue { color: var(--neg); background: var(--neg-wash); }
.pill-unpaid { color: var(--accent); background: var(--accent-wash); }
.pill-partial { color: var(--warn); background: var(--warn-wash); }
.pill-draft { color: var(--text-3); border: 1px dashed var(--line-strong); }
.pill-cancelled { color: var(--text-3); text-decoration: line-through; }
.pill-info { color: var(--info); background: var(--info-wash); }
.pill-neutral { color: var(--text-2); background: var(--surface-3); }
.pill-neutral::before, .pill-info::before { display: none; }

.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; }

/* ————— Instruments (KPI) ————— */

.instruments { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.instrument { background: var(--surface); padding: 18px 20px; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.instrument-label { font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.instrument-value {
    margin-top: 10px;
    font-family: var(--font-display);
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.022em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.instrument-value small { font-family: var(--font-text); font-size: 0.5em; font-weight: 600; color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.instrument-foot { margin-top: 8px; font-size: var(--fs-sm); color: var(--text-3); }
.instrument-foot strong { color: var(--text-2); font-weight: 600; }
.instrument.clickable { cursor: pointer; }
.instrument.clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }

/* ————— Dashboard hero ————— */

.money-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.hero-card { min-width: 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.hero-card .eyebrow-line { font-size: var(--fs-sm); font-weight: 500; color: var(--text-2); }
.hero-figure { margin: 8px 0 2px; font-size: clamp(2rem, 3.2vw, 2.5rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.028em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-figure small { margin-left: 6px; font-size: 0.45em; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.hero-figure.neg { color: var(--neg); }
.hero-accounts { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--line); }
.hero-accounts > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); color: var(--text-2); }
.hero-accounts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-accounts strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-bars { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.result-bar { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: var(--fs-sm); color: var(--text-2); }
.result-bar .track { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.result-bar .track span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.result-bar.costs .track span { background: var(--text-3); opacity: 0.55; }
.result-bar strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); padding: 20px 22px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.panel-head .note { font-size: var(--fs-sm); color: var(--text-3); }

.chart-box { position: relative; height: 260px; }
.chart-box canvas { width: 100%; height: 100%; display: block; }
.chart-legend { display: flex; gap: 18px; font-size: var(--fs-sm); color: var(--text-2); margin-top: 10px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; vertical-align: -1px; }
.chart-tip {
    position: absolute;
    pointer-events: none;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    background: var(--raised);
    box-shadow: var(--shadow);
    font-size: var(--fs-sm);
    white-space: nowrap;
    z-index: 3;
}

.alert-list { display: flex; flex-direction: column; gap: 10px; }
.alert-item {
    display: grid;
    grid-template-columns: 4px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px 12px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.alert-item:last-child { border-bottom: 0; }
.alert-item .bar { align-self: stretch; border-radius: 4px; background: var(--info); }
.alert-item.critical .bar { background: var(--neg); }
.alert-item.warning .bar { background: var(--warn); }
.alert-item strong { display: block; font-weight: 600; }
.alert-item span { display: block; color: var(--text-3); font-size: var(--fs-sm); }
.alert-item .amount { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }

.deadline-list { display: flex; flex-direction: column; }
.deadline {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.deadline:last-child { border-bottom: 0; }
.deadline-date { text-align: center; line-height: 1.05; }
.deadline-date b { display: block; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.deadline-date span { font-size: var(--fs-xs); color: var(--text-3); }
.deadline-title { font-weight: 600; font-size: var(--fs-md); }
.deadline-detail { color: var(--text-3); font-size: var(--fs-sm); }
.deadline.soon .deadline-date b { color: var(--warn); }
.deadline.today .deadline-date b { color: var(--neg); }

.mini-list { display: flex; flex-direction: column; }
.mini-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.mini-row:last-child { border-bottom: 0; }
.mini-row .l { min-width: 0; }
.mini-row .l strong { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-row .l span { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.mini-row .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ————— Empty & loading ————— */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 56px 20px;
    color: var(--text-2);
}
.empty .empty-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); font-size: 1.2rem; }
.empty h3 { margin: 6px 0 0; font-weight: 600; font-size: 1.125rem; color: var(--text); }
.empty p { margin: 0; max-width: 46ch; }
.skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-line { height: 14px; margin: 10px 0; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ————— Overlays ————— */

.scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--tt-z-modal, 1000) + 10);
    background: var(--scrim);
    display: grid;
    place-items: center;
    padding: 20px;
    animation: fade 0.16s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
.modal {
    width: min(100%, 560px);
    max-height: calc(100dvh - 40px);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: rise 0.2s var(--ease);
}
.modal.wide { width: min(100%, 860px); }
.modal.xwide { width: min(100%, 1100px); }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.modal:focus-visible, .drawer:focus-visible, .palette:focus-visible { outline: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 14px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-weight: 600; font-size: 1.125rem; letter-spacing: -0.01em; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; }

.drawer-scrim { place-items: stretch end; padding: 0; }
.drawer {
    width: min(100%, 520px);
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: slide 0.22s var(--ease);
}
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: calc(var(--tt-z-modal, 1000) + 30);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(420px, calc(100vw - 40px));
}
.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--r-md);
    background: var(--raised);
    box-shadow: var(--shadow);
    animation: rise 0.2s var(--ease);
}
.toast.error { border-left-color: var(--neg); }
.toast.success { border-left-color: var(--pos); }
.toast.warning { border-left-color: var(--warn); }
.toast .toast-body a { color: var(--accent); font-weight: 600; }
.toast .toast-body { flex: 1; font-size: var(--fs-md); }
.toast button { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 2px; }

.menu {
    position: fixed;
    z-index: calc(var(--tt-z-modal, 1000) + 20);
    min-width: 220px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--raised);
    box-shadow: var(--shadow);
    animation: rise 0.14s var(--ease);
}
.menu button, .menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-size: var(--fs-md);
}
.menu button:hover, .menu a:hover, .menu .focused { background: var(--surface-3); }
.menu button:focus-visible, .menu a:focus-visible { background: var(--surface-3); outline-offset: -2px; }
.menu button i, .menu a i { width: 16px; color: var(--text-3); text-align: center; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.menu .menu-label { padding: 6px 10px 4px; font-size: var(--fs-xs); color: var(--text-3); }
.menu .danger { color: var(--neg); }

/* ————— Command palette ————— */

.palette-scrim { place-items: start center; padding-top: 12vh; }
.palette { width: min(100%, 640px); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.palette-input i { color: var(--accent); }
.palette-input input { flex: 1; border: 0; background: transparent; font-size: var(--fs-lg); outline: none; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette-group { padding: 8px 12px 4px; font-size: var(--fs-xs); color: var(--text-3); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-sm); cursor: pointer; }
.palette-item i { width: 18px; text-align: center; color: var(--text-3); }
.palette-item .meta { margin-left: auto; font-size: var(--fs-sm); color: var(--text-3); font-variant-numeric: tabular-nums; }
.palette-item.active { background: var(--surface-3); }
.palette-foot { display: flex; gap: 16px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--text-3); }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; font-family: var(--font-text); font-size: 0.72rem; line-height: 17px; text-align: center; color: var(--text-2); }

/* ————— Document editor ————— */

.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 26px; align-items: start; }
.editor-form { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.editor-block { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); padding: 18px 20px; }
.editor-block h3 { margin: 0 0 14px; font-size: var(--fs-lg); font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.editor-preview { position: sticky; top: calc(var(--tt-topnav-h) + 20px); min-width: 0; }
.preview-frame { border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow); background: var(--paper); }
.preview-scale { transform-origin: top left; }
.preview-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; color: var(--text-3); font-size: var(--fs-sm); }

.lines-table td { padding: 6px 6px; vertical-align: top; }
.lines-table th { padding: 8px 6px; }
.lines-table input, .lines-table select { min-height: 36px; padding: 6px 8px; font-size: var(--fs-sm); }
.lines-table .col-desc { min-width: 200px; }
.lines-table .col-qty { width: 84px; }
.lines-table .col-unit { width: 70px; }
.lines-table .col-price { width: 118px; }
.lines-table .col-vat { width: 84px; }
.lines-table .col-acc { width: 92px; }
.lines-table .col-total { width: 110px; padding-top: 14px; }
.lines-table .col-x { width: 36px; }
.line-extra { display: flex; gap: 12px; padding: 0 6px 8px; font-size: var(--fs-xs); color: var(--text-3); flex-wrap: wrap; }

.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; justify-content: end; margin-top: 14px; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--text-2); text-align: right; }
.totals dd { margin: 0; text-align: right; min-width: 140px; }
.totals .grand { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }

.partner-card { display: flex; gap: 14px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.partner-card .entity-mark { width: 38px; height: 38px; }
.partner-card strong { display: block; }
.partner-card span { display: block; font-size: var(--fs-sm); color: var(--text-3); }

.autocomplete { position: relative; width: 100%; }
.autocomplete-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 300px;
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: var(--r-md);
    background: var(--raised);
    box-shadow: var(--shadow);
}
.autocomplete-item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--surface-3); }
.autocomplete-item span { color: var(--text-3); font-size: var(--fs-sm); }

.doc-side { display: flex; flex-direction: column; gap: 18px; }
.status-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); padding: 18px 20px; }
.status-card .big { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.022em; font-variant-numeric: tabular-nums; margin: 4px 0 8px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 18px; font-size: var(--fs-md); }
.kv dt { color: var(--text-3); min-width: 0; }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline { display: flex; flex-direction: column; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 10px minmax(0, 1fr); gap: 12px; }
.timeline-item .dot { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--accent); }
.timeline-item small { display: block; color: var(--text-3); }

.doc-view { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 26px; align-items: start; }

.source-view iframe { display: block; width: 100%; height: calc(100dvh - var(--tt-topnav-h) - 150px); min-height: 520px; border: 0; border-radius: var(--r-md); background: #fff; }
.source-view img { display: block; width: 100%; border-radius: var(--r-md); }
.capture-note { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--accent-deep); border-radius: var(--r-lg); background: var(--accent-wash); }
.capture-note > i { color: var(--accent); margin-top: 3px; }
.capture-note strong { display: block; font-weight: 600; }
.capture-note span { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.capture-results .sub { display: block; }
.attachments-card h3 { margin: 0; font-size: var(--fs-lg); }
.attachments-card .mini-list { margin: 6px 0 12px; }
.attachments-card .dropzone { padding: 14px 12px; gap: 4px; font-size: var(--fs-sm); }
.attachments-card.busy { opacity: 0.6; pointer-events: none; }
.attachments-empty { margin: 6px 0 0; font-size: var(--fs-sm); line-height: 1.5; }
.attachment-name { display: flex; align-items: center; gap: 12px; }
.attachment-name > i { width: 18px; flex: none; font-size: 18px; color: var(--accent); text-align: center; }
.attachment-text { min-width: 0; }
.modal.attachment-modal { width: min(100%, 1100px); }
.doc-preview-bar { margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.doc-preview [hidden] { display: none !important; }
.original-pdf .attachment-frame { height: min(82vh, 1130px); box-shadow: var(--shadow); }
.attachment-frame { display: block; width: 100%; height: min(76vh, 1100px); border: 0; border-radius: var(--r-md); background: #fff; }
.attachment-image { display: block; max-width: 100%; max-height: 76vh; margin: 0 auto; border-radius: var(--r-md); }

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 20px;
    border: 1.5px dashed var(--line-strong);
    border-radius: var(--r-lg);
    background: var(--surface);
    color: var(--text-2);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-wash); }
.dropzone i { font-size: 1.6rem; color: var(--accent); }
.dropzone strong { color: var(--text); }

/* ————— Paper: invoices, reminders, výkazy ————— */

.paper {
    width: 210mm;
    min-height: 297mm;
    padding: 16mm 16mm 19mm;
    background: var(--paper);
    color: var(--paper-ink);
    font-family: var(--font-text);
    font-size: 9.6pt;
    line-height: 1.45;
    position: relative;
    overflow: hidden;
}
.paper .p-guilloche { position: absolute; top: 0; left: 0; right: 0; height: 30mm; opacity: 0.55; pointer-events: none; }
.paper .p-guilloche canvas, .paper .p-guilloche img { display: block; width: 100%; height: 100%; }
.paper .p-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10mm; margin-bottom: 9mm; }
.paper .p-brand { display: flex; gap: 12px; align-items: center; min-width: 0; }
.paper .p-logo { max-width: 42mm; max-height: 18mm; object-fit: contain; }
.paper .p-brand-name { font-size: 13pt; font-weight: 700; letter-spacing: -0.01em; }
.paper .p-title { text-align: right; }
.paper .p-title h1 { margin: 0; font-weight: 700; font-size: 22pt; line-height: 1.05; letter-spacing: -0.025em; color: var(--paper-ink); }
.paper .p-title .p-number { margin-top: 2mm; font-size: 11pt; font-variant-numeric: tabular-nums; color: var(--paper-accent); font-weight: 600; letter-spacing: 0.02em; }
.paper .p-title .p-kind { font-size: 8.5pt; color: var(--paper-muted); margin-top: 1mm; }
.paper .p-rule { height: 2px; background: linear-gradient(90deg, var(--paper-accent) 0 34mm, var(--paper-line) 34mm); margin: 0 0 7mm; }
.paper .p-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-bottom: 7mm; }
.paper .p-party h4 { margin: 0 0 2mm; font-size: 7.8pt; font-weight: 600; color: var(--paper-muted); letter-spacing: 0.08em; }
.paper .p-party .name { font-size: 11pt; font-weight: 600; margin-bottom: 1mm; }
.paper .p-party .ids { margin-top: 2mm; font-variant-numeric: tabular-nums; }
.paper .p-party .reg { margin-top: 2mm; font-size: 7.6pt; color: var(--paper-muted); }
.paper .p-meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4mm; padding: 4mm 0; border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); margin-bottom: 7mm; }
.paper .p-meta div span { display: block; font-size: 7.6pt; color: var(--paper-muted); }
.paper .p-meta div strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.paper .p-items { width: 100%; border-collapse: collapse; margin-bottom: 5mm; }
.paper .p-items th { font-size: 7.6pt; font-weight: 600; color: var(--paper-muted); text-align: left; padding: 0 2mm 2mm; border-bottom: 1px solid var(--paper-ink); letter-spacing: 0.04em; }
.paper .p-items td { padding: 2.4mm 2mm; border-bottom: 1px solid var(--paper-line); vertical-align: top; }
.paper .p-items .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.paper .p-sum { display: flex; justify-content: space-between; gap: 10mm; align-items: flex-start; }
.paper .p-recap { border-collapse: collapse; font-size: 8.4pt; }
.paper .p-recap th { font-weight: 600; color: var(--paper-muted); text-align: right; padding: 0 0 1mm 5mm; font-size: 7.4pt; }
.paper .p-recap th:first-child, .paper .p-recap td:first-child { text-align: left; padding-left: 0; }
.paper .p-recap td { text-align: right; padding: 1mm 0 1mm 5mm; font-variant-numeric: tabular-nums; border-top: 1px solid var(--paper-line); }
.paper .p-total { min-width: 70mm; }
.paper .p-total .row { display: flex; justify-content: space-between; gap: 6mm; padding: 1mm 0; font-variant-numeric: tabular-nums; }
.paper .p-total .grand { margin-top: 2mm; padding-top: 3mm; border-top: 1.5px solid var(--paper-ink); align-items: baseline; }
.paper .p-total .grand span:first-child { font-weight: 600; }
.paper .p-total .grand strong { font-size: 18pt; font-weight: 700; letter-spacing: -0.02em; }
.paper .p-pay { display: grid; grid-template-columns: 1fr auto; gap: 8mm; margin-top: 8mm; padding: 5mm; border: 1px solid var(--paper-line); border-radius: 3mm; align-items: center; }
.paper .p-pay .kv { font-size: 9pt; gap: 1.2mm 6mm; }
.paper .p-pay .kv dt { color: var(--paper-muted); }
.paper .p-pay .kv dd { text-align: left; font-weight: 600; }
.paper .p-qr { text-align: center; font-size: 7pt; color: var(--paper-muted); }
.paper .p-qr .qr { width: 30mm; height: 30mm; margin: 0 auto 1.5mm; display: grid; place-items: center; }
.paper .p-qr .qr img, .paper .p-qr .qr canvas { width: 100% !important; height: 100% !important; }
.paper .p-note { margin-top: 6mm; font-size: 8.8pt; white-space: pre-line; }
.paper .p-legal { margin-top: 3mm; font-size: 8pt; color: var(--paper-muted); }
.paper .p-foot { position: absolute; left: 16mm; right: 16mm; bottom: 8mm; display: flex; justify-content: space-between; gap: 6mm; font-size: 7.2pt; color: var(--paper-muted); border-top: 1px solid var(--paper-line); padding-top: 2.5mm; }
.paper .p-sign { display: flex; align-items: flex-end; gap: 3mm; margin-top: 16mm; font-size: 9pt; color: var(--paper-muted); }
.paper .p-sign-line { flex: 2; height: 7mm; border-bottom: 1px solid var(--paper-ink); }
.paper .p-sign-line.short { flex: 1; }
.paper .p-stamp { display: inline-block; margin-top: 4mm; padding: 1.5mm 4mm; border: 1.5px solid #1f7a4d; color: #1f7a4d; border-radius: 2mm; font-weight: 700; letter-spacing: 0.12em; transform: rotate(-3deg); }
.paper .p-stamp.cancel { border-color: #b3392f; color: #b3392f; }
.paper.draft::after { content: 'KONCEPT'; position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-24deg); font-family: var(--font-display); font-weight: 800; font-size: 70pt; color: rgba(16, 24, 40, 0.05); letter-spacing: 0.2em; pointer-events: none; }

/* ————— Statements (rozvaha, VZZ) ————— */

.statement-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.statement-table td:first-child { color: var(--text-3); width: 72px; font-variant-numeric: tabular-nums; }
.check-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.check-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-size: var(--fs-sm); border: 1px solid var(--line); }
.check-chip.ok { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 35%, transparent); }
.check-chip.bad { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 35%, transparent); }

.vat-rows td:first-child { width: 56px; color: var(--accent); font-variant-numeric: tabular-nums; font-weight: 600; }
.result-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: linear-gradient(120deg, var(--accent-wash), transparent 55%), var(--surface);
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
}
.result-banner .figure { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.028em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.result-banner .figure small { font-family: var(--font-text); font-size: 0.36em; color: var(--text-3); margin-left: 6px; }
.result-banner .label { color: var(--text-2); font-size: var(--fs-sm); }

.option-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.option-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); padding: 16px 18px; position: relative; }
.option-card.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.option-card .ribbon { position: absolute; top: -10px; right: 14px; background: var(--primary); color: var(--on-accent); font-size: var(--fs-xs); font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.option-card h4 { margin: 0 0 6px; font-size: var(--fs-lg); }
.option-card .cost { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.option-card.ineligible { opacity: 0.6; }

.note-box { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: var(--fs-sm); }
.note-box.warn { background: var(--warn-wash); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); }
.note-box.bad { background: var(--neg-wash); border-color: color-mix(in srgb, var(--neg) 30%, transparent); color: var(--text); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }

/* Public landing: a spatial story about linked documents, bank movements and books. */
.landing {
    --lp-deep: #0b1539;
    --lp-mid: #142456;
    --lp-ink: #13224b;
    --lp-ice: #f6f8ff;
    --lp-pale: #e9effb;
    --lp-paper: #eaf0f9;
    --lp-paper-raised: #f2f5fb;
    --lp-paper-deep: #e7eef8;
    --lp-lilac: #a5adff;
    --lp-mint: #a7efd2;
    --lp-line-dark: rgba(203, 217, 255, .21);
    /* The two devices are one composition drawn at 760x720 and scaled with zoom. The scene sits high beside the
       title and the phone crosses the hero's straight bottom edge by --hero-overhang into the next section. */
    --devices-zoom: .95;
    --hero-overhang: 26px;
    max-width: none;
    margin: 0;
    background: var(--lp-deep);
    color: var(--lp-ice);
    overflow: clip;
}
.landing *, .landing *::before, .landing *::after { box-sizing: border-box; }
.landing [hidden] { display: none !important; }
.landing a { color: inherit; }
.landing button, .landing a { -webkit-tap-highlight-color: transparent; }
.landing :is(a, button, summary, canvas):focus-visible { outline: 3px solid #a7efd2; outline-offset: 4px; }
.landing-wrap { width: min(100%, 1488px); padding-inline: clamp(24px, 5vw, 82px); margin-inline: auto; }
.landing-jump { position: relative; z-index: 3; background: var(--lp-deep); border-bottom: 1px solid var(--lp-line-dark); }
.landing-jump-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.landing-jump-brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 1.33rem; font-weight: 800; letter-spacing: -.07em; text-decoration: none; }
.landing-jump-brand img, .landing-foot-brand img { display: block; flex: none; border-radius: 7px; }
.landing-wordmark > span { color: var(--lp-mint); }
.landing-jump-links { display: flex; align-items: center; gap: clamp(15px, 2.8vw, 38px); }
.landing-jump-links a { display: inline-flex; align-items: center; min-height: 44px; color: #d7def8; font-size: .88rem; font-weight: 600; text-decoration: none; }
.landing-jump-links a:hover { color: var(--lp-mint); }
.landing-hero { position: relative; z-index: 2; isolation: isolate; display: flex; flex-direction: column; min-height: min(780px, calc(100svh - 176px)); background: radial-gradient(ellipse 48% 56% at 69% 39%, #263d88 0%, #182e69 40%, transparent 100%), linear-gradient(130deg, #0b1539 8%, #111e4a 57%, #101b42); }
.landing-hero::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .4; background-image: linear-gradient(rgba(183, 205, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(183, 205, 255, .07) 1px, transparent 1px); background-size: 76px 76px; mask-image: linear-gradient(90deg, transparent 0%, #000 55%); }
/* The hero ends in a straight edge; only the devices (z-index above the next section) cross it. */
.landing-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, #0b1539 0%, rgba(11,21,57,.95) 20%, rgba(11,21,57,.52) 45%, transparent 67%); }
.landing-hero-aura { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.landing-hero-aura::before { content: ""; position: absolute; width: min(88vw, 1180px); height: 740px; right: -10%; top: -22%; background: radial-gradient(ellipse, rgba(121,139,255,.22), transparent 62%); filter: blur(18px); }
.landing-hero-art { position: absolute; z-index: 2; right: max(clamp(16px, 2.4vw, 60px), calc((100vw - 1488px) / 2)); bottom: calc(-1 * var(--hero-overhang)); width: calc(760px * var(--devices-zoom)); height: calc(720px * var(--devices-zoom)); }
.landing-devices { position: relative; width: 760px; height: 720px; zoom: var(--devices-zoom); }
.landing-desktop { position: absolute; top: 64px; right: 0; width: 600px; overflow: hidden; border: 1px solid rgba(214,226,255,.55); border-radius: 12px; background: #f5f7fb; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 34px 60px -28px rgba(3,10,34,.7), 0 14px 26px -18px rgba(3,10,34,.5); transform: perspective(2200px) rotateY(-9deg) rotateX(2deg); transform-origin: 70% 50%; }
.landing-desktop-bar { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px; border-bottom: 1px solid #dde3ee; background: #e9eef7; }
.landing-desktop-bar span { width: 10px; height: 10px; border-radius: 50%; background: #c3cbdb; }
.landing-desktop-bar em { margin-left: 16px; padding: 3px 14px; border-radius: 6px; background: #fff; color: #7a869d; font-size: 11px; font-style: normal; font-weight: 600; }
.landing-desktop img { display: block; width: 100%; height: auto; }
.landing-hero-content { position: relative; z-index: 3; display: flex; align-items: center; padding-block: 64px 36px; pointer-events: none; }
.landing-hero-copy { max-width: 840px; pointer-events: auto; }
.landing-kicker { margin: 0 0 26px; color: var(--lp-mint); font-weight: 650; font-size: clamp(.85rem, 1.1vw, 1rem); letter-spacing: .012em; }
.landing-hero h1 { margin: 0; font-size: clamp(3.9rem, 6.3vw, 7.1rem); font-weight: 800; letter-spacing: -.085em; line-height: .96; text-wrap: balance; text-shadow: 0 2px 38px rgba(5,13,37,.3); }
.landing-lead { max-width: 52ch; margin: 31px 0 28px; color: #d9e3ff; font-size: clamp(1.04rem, 1.3vw, 1.2rem); line-height: 1.65; }
.landing-ctas { display: flex; align-items: stretch; flex-wrap: wrap; gap: 12px; }
.landing-ctas .btn, .landing-final .btn { display: inline-flex; justify-content: center; align-items: center; gap: 24px; min-height: 58px; padding: 13px 22px; border-radius: 9px; font-size: .99rem; font-weight: 750; line-height: 1.25; text-decoration: none; }
.landing-primary { background: var(--lp-mint); border: 1px solid var(--lp-mint); color: #0d2640; box-shadow: 0 9px 31px rgba(103,229,186,.17); }
.landing-primary:hover { background: #c1f8e5; border-color: #c1f8e5; color: #0d2640; }
.landing-primary span { font-size: 1.25rem; font-weight: 500; line-height: 0; }
.landing-secondary { background: rgba(255,255,255,.075); color: #fff; border: 1px solid rgba(219,231,255,.45); }
.landing-secondary:hover { background: rgba(255,255,255,.16); color: #fff; }
.landing-cta-note, .landing-noscript { margin: 18px 0 0; max-width: 58ch; color: #b9c5e1; font-size: .78rem; line-height: 1.55; }
/* Pinned to the bottom of the hero, left of the devices. */
.landing-hero-baseline { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: auto; padding-block: 26px 24px; }
.landing-flow { display: flex; align-items: center; gap: clamp(24px, 3.3vw, 56px); }
.landing-flow span { color: #f1f5ff; white-space: nowrap; font-size: .86rem; font-weight: 650; }
.landing-flow b { padding-right: 10px; color: var(--lp-mint); font-size: .72rem; }
/* A static, CSS-built handset showing the fictional Saldo demo overview and + menu. */
.landing-phone-stage { position: absolute; left: 8px; bottom: 4px; width: 272px; isolation: isolate; }
.landing-phone-stage::after { content: ""; position: absolute; z-index: -1; left: 12%; bottom: -14px; width: 84%; height: 34px; border-radius: 50%; background: radial-gradient(ellipse, rgba(8,17,45,.34), transparent 70%); filter: blur(6px); }
.landing-phone { --phone-tilt-x: 4deg; --phone-tilt-y: -20deg; position: relative; width: 100%; aspect-ratio: 393 / 852; padding: 6px; border: 2px solid #aeb9c9; border-radius: 53px; background: linear-gradient(102deg, #52617a 0%, #dfe4eb 9%, #aab5c5 18%, #67758f 53%, #dce2ea 89%, #7a879c 100%); box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), inset 4px 0 7px rgba(25,38,63,.25), 0 0 0 1px rgba(8,20,43,.9), 11px 13px 0 rgba(7,19,42,.62), 25px 37px 48px rgba(2,8,26,.5), -5px -5px 40px rgba(133,169,255,.13); transform: perspective(1050px) rotateY(var(--phone-tilt-y)) rotateX(var(--phone-tilt-x)) rotateZ(3deg); transform-style: preserve-3d; transition: transform .32s ease-out; cursor: default; touch-action: pan-y; user-select: none; }
.landing-phone-button { position: absolute; z-index: -1; width: 3px; border-radius: 3px; background: linear-gradient(90deg, #34425e, #aeb9c9 45%, #e3e7ef); box-shadow: 0 0 0 1px rgba(6,17,37,.35); }
.landing-phone-action, .landing-phone-volume-up, .landing-phone-volume-down { left: -5px; }
.landing-phone-action { top: 15%; height: 4.5%; }
.landing-phone-volume-up { top: 25%; height: 7%; }
.landing-phone-volume-down { top: 34%; height: 7%; }
.landing-phone-side, .landing-phone-camera-control { right: -5px; }
.landing-phone-side { top: 26%; height: 9%; }
.landing-phone-camera-control { top: 67%; height: 5%; border-radius: 2px; }
.landing-phone-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border: 2px solid #070b14; border-radius: 45px; background: #f3f5fa; color: #1c2638; box-shadow: 0 0 0 1px rgba(20,31,52,.8), inset 0 0 0 1px rgba(255,255,255,.25); font-family: Inter, system-ui, sans-serif; }
.landing-phone-screen::before { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; border-radius: inherit; background: linear-gradient(105deg, rgba(255,255,255,.075), transparent 12% 88%, rgba(255,255,255,.035)); }
.landing-phone-status { position: relative; display: flex; justify-content: space-between; align-items: center; height: 49px; padding: 8px 23px 0; background: #fff; color: #111827; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.landing-phone-island { position: absolute; top: 10px; left: 50%; width: 88px; height: 25px; border-radius: 18px; transform: translateX(-50%); background: #05070b; box-shadow: inset 0 1px 1px rgba(255,255,255,.1), 0 1px 2px rgba(4,8,19,.28); }
.landing-phone-island::before { content: ""; position: absolute; right: 12px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: radial-gradient(circle at 45% 42%, #304765 0 15%, #111c30 35%, #060912 75%); }
.landing-phone-indicators { display: flex; align-items: center; gap: 5px; color: #121925; font-size: 10px; }
.landing-phone-indicators i:last-child { font-size: 13px; }
.landing-phone-appbar { display: flex; align-items: center; justify-content: space-between; height: 59px; padding: 0 19px; border-bottom: 1px solid #e5e8ef; background: #fff; font-size: 17px; font-weight: 760; letter-spacing: -.045em; }
.landing-phone-search { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; background: #f3f4fa; color: #68748b; font-size: 13px; }
.landing-phone-dashboard { padding: 12px 16px 0; }
.landing-phone-company { display: block; color: #6a7792; font-size: 11px; font-weight: 650; }
.landing-phone-dashboard > strong { display: block; margin: 4px 0 2px; color: #1c2a48; font-size: 23px; letter-spacing: -.05em; }
.landing-phone-entity-meta { margin: 0 0 9px; color: #71809a; font-size: 9px; line-height: 1.35; }
.landing-phone-overview { padding: 13px 14px; border: 1px solid #e0e5ef; border-radius: 13px; background: #fff; box-shadow: 0 4px 15px rgba(31,47,94,.035); }
.landing-phone-overview > span { display: block; color: #667289; font-size: 10px; font-weight: 650; }
.landing-phone-overview > strong { display: block; margin-top: 5px; color: #1c2a48; font-size: 24px; font-weight: 750; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.landing-phone-overview > strong small { color: #667289; font-size: 11px; font-weight: 650; letter-spacing: 0; }
.landing-phone-available > p { margin: 3px 0 11px; color: #7b87a0; font-size: 8px; line-height: 1.35; }
.landing-phone-figures { padding-top: 4px; border-top: 1px solid #e7eaf1; }
.landing-phone-figures span, .landing-phone-profit-lines span { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; padding-top: 7px; color: #63718b; font-size: 8px; line-height: 1.25; }
.landing-phone-figures b, .landing-phone-profit-lines b { color: #263651; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.landing-phone-profit { margin-top: 9px; }
.landing-phone-profit-lines { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.landing-phone-dim { position: absolute; z-index: 2; inset: 49px 0 84px; background: rgba(18,29,54,.18); pointer-events: none; }
.landing-phone-panel { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 82px; padding: 14px 14px 9px; border: 1px solid rgba(209,215,230,.9); border-radius: 17px; background: #fff; color: #1c2638; box-shadow: 0 22px 44px rgba(24,35,63,.25); }
.landing-phone-panel > strong { display: block; margin: 0 4px 8px; font-size: 14px; font-weight: 750; letter-spacing: -.02em; }
.landing-phone-menu-choice, .landing-phone-menu-item { display: flex; align-items: center; gap: 11px; min-height: 36px; width: 100%; padding: 7px; border: 0; border-radius: 9px; background: none; color: #35435c; font-size: 11px; font-weight: 650; text-align: left; }
.landing-phone-menu-choice { background: #f0edff; color: #392caa; font-weight: 750; }
.landing-phone-menu-choice span { flex: 1; }
.landing-phone-menu-choice i:first-child, .landing-phone-menu-item i { width: 18px; color: #6556dd; font-size: 14px; text-align: center; }
.landing-phone-menu-choice i:last-child { color: #6b5ade; font-size: 10px; }
.landing-phone-menu-item { border-top: 1px solid #eff0f4; border-radius: 0; }
.landing-phone-tabbar { position: absolute; z-index: 4; bottom: 11px; left: 0; right: 0; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); align-items: end; height: 72px; padding: 8px 8px 14px; border-top: 1px solid #e5e8ef; background: #fff; }
.landing-phone-tabbar > span:not(.landing-phone-plus) { display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 5px; height: 42px; color: #717b90; font-size: 9px; font-weight: 650; }
.landing-phone-tabbar > span:not(.landing-phone-plus) i { font-size: 15px; }
.landing-phone-plus { display: grid; place-items: center; align-self: start; justify-self: center; width: 50px; height: 50px; margin-top: -23px; border: 4px solid #fff; border-radius: 50%; background: #5545e6; color: #fff; box-shadow: 0 3px 11px rgba(56,39,168,.28); font-size: 16px; }
.landing-phone-homebar { position: absolute; z-index: 5; left: 50%; bottom: 5px; width: 93px; height: 4px; border-radius: 9px; transform: translateX(-50%); background: #1c2638; }
.landing-paper-chapter { background: var(--lp-paper); }
.landing-process { scroll-margin-top: calc(var(--tt-topnav-h) + 20px); padding-block: 88px clamp(85px, 8vw, 115px); color: var(--lp-ink); }
.landing-process-layout { display: grid; grid-template-columns: minmax(290px, .9fr) minmax(0, 1.1fr); gap: clamp(70px, 11vw, 175px); }
.landing-section-note { margin: 0 0 20px; font-size: .83rem; font-weight: 700; letter-spacing: .015em; }
.landing-process .landing-section-note { color: #4859bb; }
.landing-control .landing-section-note, .landing-final .landing-section-note { color: var(--lp-mint); }
.landing-process-intro { align-self: start; }
.landing-process h2, .landing-section-heading h2, .landing-control h2, .landing-faq h2, .landing-final h2 { margin: 0; font-size: clamp(2.9rem, 5.1vw, 5.7rem); font-weight: 780; letter-spacing: -.075em; line-height: 1.05; text-wrap: balance; }
.landing-process-intro > p:last-child { max-width: 47ch; margin: 28px 0 0; color: #4d5d7a; font-size: 1.04rem; line-height: 1.7; }
.landing-steps { list-style: none; padding: 0; margin: 0; }
.landing-steps li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 24px; padding: 33px 0 42px; border-top: 1px solid #cdd7e8; }
.landing-steps li:last-child { border-bottom: 1px solid #cdd7e8; }
.landing-step-number { color: #4859bb; font-size: clamp(3rem, 4vw, 4rem); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.09em; line-height: 1; }
.landing-steps h3 { margin: 0 0 12px; font-size: clamp(1.4rem, 1.8vw, 1.95rem); letter-spacing: -.045em; }
.landing-steps p { max-width: 54ch; margin: 0; color: #53617e; line-height: 1.7; }
.landing-audiences, .landing-capabilities, .landing-faq { color: var(--lp-ink); }
.landing-audiences { --lp-audience-bg: var(--lp-paper-raised); scroll-margin-top: calc(var(--tt-topnav-h) + 20px); padding-block: clamp(85px, 8vw, 120px); border-top: 1px solid #dbe3f1; background: var(--lp-audience-bg); }
.landing-section-heading { display: grid; grid-template-columns: 1.2fr .8fr; align-items: end; gap: clamp(30px, 6vw, 100px); }
.landing-section-heading .landing-section-note { grid-column: 1 / -1; margin-bottom: -7px; color: #525fc1; }
.landing-section-heading h2 { max-width: 14ch; }
.landing-section-heading > p:last-child { max-width: 45ch; margin: 0 0 4px; color: #465579; font-size: 1.04rem; line-height: 1.7; }
.landing-audience-grid { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: clamp(65px, 7vw, 105px); border-top: 1px solid #b8c5e3; border-bottom: 1px solid #b8c5e3; }
.landing-audience-grid article { min-width: 0; padding: 32px clamp(19px, 3vw, 46px) 38px; border-right: 1px solid #b8c5e3; }
.landing-audience-grid article:first-child { padding-left: 0; }
.landing-audience-grid article:last-child { border-right: 0; padding-right: 0; }
.landing-audience-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; color: #4656be; }
.landing-audience-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.landing-audience-grid h3 { margin: 48px 0 18px; font-size: clamp(2.2rem, 3.4vw, 3.8rem); letter-spacing: -.08em; line-height: 1; }
.landing-audience-grid p { min-height: 135px; margin: 0; max-width: 36ch; color: #465579; line-height: 1.65; }
.landing-audience-tail { display: block; margin-top: 40px; color: #3444aa; font-size: .81rem; font-weight: 750; }
.landing-capabilities { scroll-margin-top: calc(var(--tt-topnav-h) + 20px); padding-block: clamp(85px, 8vw, 120px) clamp(100px, 9vw, 135px); border-top: 1px solid #dbe3f1; background: var(--lp-paper-deep); }
.landing-capabilities .landing-section-heading h2 { max-width: 17ch; }
.landing-capability-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(50px, 8vw, 125px); margin-top: clamp(55px, 6vw, 92px); }
.landing-capability-list article { display: grid; grid-template-columns: 68px minmax(0, 1fr); gap: 24px; padding: 28px 0 37px; border-top: 1px solid #c8d1e5; }
.landing-capability-icon { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid #cbd5f0; border-radius: 15px; background: #edf1ff; color: #4656be; }
.landing-capability-list article:nth-child(3n + 2) .landing-capability-icon { border-color: #c3ded9; background: #eaf5f2; color: #187d70; }
.landing-capability-list article:nth-child(3n) .landing-capability-icon { border-color: #d6cfee; background: #f0edfa; color: #6254ae; }
.landing-capability-icon svg { display: block; width: 34px; height: 34px; }
.landing-capability-list h3 { margin: 0 0 10px; font-size: clamp(1.19rem, 1.55vw, 1.55rem); letter-spacing: -.045em; }
.landing-capability-list p { max-width: 55ch; margin: 0; color: #53617e; font-size: .94rem; line-height: 1.68; }
.landing-control-panel { background: radial-gradient(circle at 28% 55%, #2d4598 0, #192c68 25%, #111e49 61%); }
.landing-control-layout { display: grid; grid-template-columns: minmax(250px, .76fr) minmax(0, 1fr); align-items: center; gap: clamp(80px, 12vw, 185px); padding-block: clamp(100px, 9vw, 135px); }
.landing-control-symbol { position: relative; display: grid; place-items: center; width: min(30vw, 380px); aspect-ratio: 1; margin-inline: auto; border: 2px solid rgba(193,216,255,.7); border-radius: 50%; box-shadow: inset 0 0 0 27px rgba(164,189,255,.05), 0 0 0 31px rgba(164,189,255,.07), 0 0 70px rgba(111,146,255,.4); }
.landing-control-symbol::before { content: ""; position: absolute; inset: 14%; border: 1px solid rgba(181,204,255,.46); border-radius: 50%; }
.landing-control-symbol span { color: var(--lp-mint); font-size: clamp(5rem, 12vw, 11rem); font-weight: 400; line-height: 1; text-shadow: 0 0 45px rgba(105,240,193,.45); transform: translate(-2%, -7%); }
.landing-control h2 { max-width: 13ch; }
.landing-control-layout > div:last-child > p:not(.landing-section-note) { max-width: 59ch; margin: 28px 0; color: #cbd5f3; font-size: 1.02rem; line-height: 1.7; }
.landing-control a { color: var(--lp-mint); font-weight: 750; text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: 5px; }
.landing-control a:hover { color: #fff; }
.landing-control a span { padding-left: 8px; }
.landing-faq { scroll-margin-top: calc(var(--tt-topnav-h) + 20px); padding-block: clamp(110px, 9vw, 140px); background: var(--lp-paper-deep); }
.landing-faq-layout { display: grid; grid-template-columns: minmax(260px, .78fr) minmax(0, 1.22fr); gap: clamp(55px, 10vw, 145px); }
.landing-faq .landing-section-note { color: #515ec2; }
.landing-faq h2 { max-width: 10ch; }
.landing-faq-list { border-top: 1px solid #bdc9e3; }
.landing-faq-list details { border-bottom: 1px solid #bdc9e3; }
.landing-faq-list summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 82px; padding: 22px 5px; list-style: none; cursor: pointer; font-weight: 740; font-size: 1.08rem; letter-spacing: -.02em; }
.landing-faq-list summary::-webkit-details-marker { display: none; }
.landing-faq-list summary::after { content: "+"; flex: none; color: #4d5fc3; font-size: 1.6rem; font-weight: 400; line-height: 1; }
.landing-faq-list details[open] summary::after { content: "−"; }
.landing-faq-list details p { max-width: 70ch; margin: 0; padding: 0 34px 25px 5px; color: #485779; line-height: 1.7; }
.landing-final { padding-block: clamp(95px, 10vw, 150px); background: radial-gradient(ellipse 50% 120% at 80% 50%, #314994 0%, transparent 76%), #101c43; }
.landing-final-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.landing-final h2 { max-width: 15ch; }
.landing-final p:last-child { max-width: 54ch; margin: 25px 0 0; color: #cbd4ef; line-height: 1.65; }
.landing-final .landing-final-cta { justify-self: start; width: fit-content; max-width: 100%; min-height: 56px; margin: 0; padding: 15px 23px; border: 1px solid #d4def2; border-radius: 8px; background: #eef2fb; box-shadow: none; color: var(--lp-ink); font-size: 1rem; font-weight: 650; letter-spacing: -.015em; text-align: center; white-space: normal; }
.landing-final .landing-final-cta:hover { border-color: #fff; background: #fff; color: var(--lp-ink); }
.landing-foot { background: #0a1230; border-top: 1px solid rgba(200,215,255,.18); }
.landing-foot .landing-wrap { color: #b6c2e0; font-size: .82rem; line-height: 1.55; }
.landing-foot-grid { display: grid; grid-template-columns: 1.1fr .9fr 1fr; gap: clamp(35px, 6vw, 100px); padding-block: 62px 55px; }
.landing-foot-brand strong { display: flex; align-items: center; gap: 12px; color: #fff; font-size: 1.8rem; font-weight: 800; letter-spacing: -.075em; line-height: 1; }
.landing-foot-brand p, .landing-foot-maker p { margin: 15px 0 0; }
.landing-foot-maker > span { display: block; margin: 2px 0 8px; color: #9daed2; }
.landing-foot-maker > a { color: #fff; font-size: 1.14rem; font-weight: 740; text-decoration: none; }
.landing-foot-maker > a:hover, .landing-foot-links a:hover { color: var(--lp-mint); }
.landing-foot-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; gap: 4px 20px; }
.landing-foot-links a { display: inline-flex; align-items: center; min-height: 44px; color: #e2e8f8; text-decoration: none; }
.landing-foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 22px 30px; border-top: 1px solid rgba(200,215,255,.18); color: #aab8d6 !important; }
@media (min-width: 1700px) {
    .landing { --devices-zoom: 1; --hero-overhang: 28px; }
}
@media (max-width: 1439px) {
    .landing { --devices-zoom: .76; --hero-overhang: 22px; }
}
@media (max-width: 1250px) {
    .landing { --devices-zoom: .58; --hero-overhang: 18px; }
    .landing-hero h1 { font-size: clamp(3.6rem, 6.4vw, 5.4rem); }
    .landing-hero-content { padding-top: 56px; }
    .landing-process-layout, .landing-faq-layout { gap: 60px; }
}
@media (max-width: 1090px) {
    .landing-hero { min-height: 0; }
    .landing-hero-content { order: 1; min-height: 0; padding-block: 75px 5px; }
    .landing-hero-copy { width: 100%; max-width: 760px; }
    .landing { --devices-zoom: .88; --hero-overhang: 44px; }
    .landing-hero-baseline { order: 2; }
    .landing-hero-art { position: relative; order: 3; right: auto; bottom: auto; align-self: center; margin: 18px 0 calc(-1 * var(--hero-overhang)); }
    .landing-process { padding-top: calc(var(--hero-overhang) + 64px); }
}
@media (max-width: 760px) {
    .landing-wrap { padding-inline: 24px; }
    .landing-jump-inner { min-height: 62px; }
    .landing-hero::after { background: linear-gradient(180deg, rgba(11,21,57,.2) 0%, rgba(11,21,57,.6) 57%, transparent 100%); }
    .landing-hero-content { order: 1; min-height: 0; padding-block: 68px 5px; }
    .landing-hero-copy { width: 100%; max-width: 650px; }
    .landing-hero h1 { font-size: clamp(3.7rem, 10.5vw, 5.7rem); }
    .landing-hero-baseline { margin-top: 0; }
    .landing-hero::before { mask-image: linear-gradient(180deg, transparent 0, #000 58%); }
    .landing-process-layout, .landing-faq-layout, .landing-control-layout { grid-template-columns: minmax(0, 1fr); gap: 58px; }
    .landing-section-heading { grid-template-columns: minmax(0, 1fr); gap: 19px; }
    .landing-section-heading .landing-section-note { margin-bottom: 0; }
    .landing-section-heading > p:last-child { max-width: 58ch; }
    .landing-control-symbol { width: min(45vw, 330px); margin-inline: auto; }
}
@media (max-width: 600px) {
    .landing-wrap { padding-inline: 18px; }
    .landing-jump-inner { gap: 11px; }
    .landing-jump-brand { font-size: 1.15rem; }
    .landing-jump-links { gap: 16px; }
    .landing-jump-links a { font-size: .75rem; }
    .landing-jump-links a:nth-child(2), .landing-jump-links a:nth-child(3) { display: none; }
    .landing-hero-content { padding-top: 44px; }
    .landing-kicker { margin-bottom: 18px; font-size: .8rem; }
    .landing-hero h1 { font-size: clamp(3.07rem, 11.7vw, 4.1rem); letter-spacing: -.075em; }
    .landing-lead { margin: 22px 0 23px; font-size: .96rem; line-height: 1.61; }
    .landing-ctas { flex-direction: column; }
    .landing-ctas .btn { width: 100%; min-height: 54px; }
    .landing-cta-note { font-size: .74rem; margin-top: 14px; }
    .landing { --devices-zoom: .46; --hero-overhang: 30px; }
    .landing-phone { --phone-tilt-x: 3deg; --phone-tilt-y: -16deg; }
    .landing-hero-baseline { display: block; padding-block: 26px 0; }
    .landing-flow { justify-content: space-between; gap: 8px; }
    .landing-flow span { font-size: .73rem; }
    .landing-flow b { display: block; padding: 0 0 5px; font-size: .68rem; }
    .landing-process, .landing-audiences, .landing-capabilities, .landing-final { padding-block: 80px; }
    .landing-process { padding-block: calc(var(--hero-overhang) + 52px) 75px; }
    .landing-audiences { padding-block: 75px 80px; }
    .landing-capabilities { padding-block: 75px 95px; }
    .landing-control-layout { padding-block: 80px; }
    .landing-faq { padding-block: 100px 90px; }
    .landing-process h2, .landing-section-heading h2, .landing-control h2, .landing-faq h2, .landing-final h2 { font-size: clamp(2.7rem, 11vw, 3.7rem); }
    .landing-process-layout, .landing-faq-layout, .landing-control-layout { gap: 48px; }
    .landing-process-intro > p:last-child { font-size: .96rem; }
    .landing-steps li { grid-template-columns: 50px minmax(0,1fr); gap: 15px; padding: 24px 0 31px; }
    .landing-step-number { font-size: 3rem; }
    .landing-steps h3 { font-size: 1.34rem; }
    .landing-steps p { font-size: .9rem; }
    .landing-audience-grid { grid-template-columns: minmax(0, 1fr); margin-top: 50px; }
    .landing-audience-grid article, .landing-audience-grid article:first-child, .landing-audience-grid article:last-child { padding: 25px 0 30px; border-right: 0; border-bottom: 1px solid #b8c5e3; }
    .landing-audience-grid article:last-child { border-bottom: 0; }
    .landing-audience-grid h3 { margin: 20px 0 13px; font-size: 2.8rem; }
    .landing-audience-grid p { min-height: 0; }
    .landing-audience-tail { margin-top: 19px; }
    .landing-capability-list { grid-template-columns: minmax(0, 1fr); margin-top: 46px; }
    .landing-capability-list article { grid-template-columns: 56px minmax(0,1fr); gap: 14px; padding: 24px 0 28px; }
    .landing-capability-icon { width: 46px; height: 46px; border-radius: 12px; }
    .landing-capability-icon svg { width: 29px; height: 29px; }
    .landing-capability-list h3 { font-size: 1.16rem; }
    .landing-capability-list p { font-size: .88rem; }
    .landing-control-symbol { width: min(55vw, 250px); }
    .landing-faq-list summary { min-height: 72px; font-size: .97rem; }
    .landing-foot-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-block: 48px 38px; }
    .landing-foot-links { gap: 0 16px; }
    .landing-foot-bottom { display: block; padding-block: 22px 27px; }
    .landing-foot-bottom span { display: block; }
    .landing-foot-bottom span + span { margin-top: 8px; }
}
@media (max-width: 350px) {
    .landing-hero h1 { font-size: 2.86rem; }
    .landing-final h2 { font-size: 2.35rem; }
    .landing-jump-links { gap: 9px; }
    .landing { --devices-zoom: .4; --hero-overhang: 26px; }
    .landing-phone-panel { left: 8px; right: 8px; padding-inline: 10px; }
    .landing-phone-menu-choice, .landing-phone-menu-item { gap: 7px; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .landing *, .landing *::before, .landing *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.onboard { max-width: 880px; margin: 0 auto; }
.onboard-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 22px; }
.choice { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); padding: 20px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 8px; transition: border-color 0.15s var(--ease); }
.choice:hover { border-color: var(--accent); }
.choice i { color: var(--accent); font-size: 1.2rem; }
.choice strong { font-size: var(--fs-lg); }
.choice span { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }

/* ————— Responsive ————— */

@media (max-width: 1280px) {
    .stage { padding: 24px 28px 70px; }
    .editor { grid-template-columns: minmax(0, 1fr); }
    .editor-preview { position: static; }
    .instruments { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1080px) {
    .instruments { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .instruments > .instrument:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .dash-grid, .doc-view, .statement-grid, .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
    .saldo { grid-template-columns: minmax(0, 1fr); }
    .rail {
        position: fixed;
        z-index: calc(var(--tt-z-modal, 1000) + 5);
        top: var(--tt-topnav-h);
        left: 0;
        width: min(86vw, 320px);
        height: calc(100dvh - var(--tt-topnav-h));
        transform: translateX(-102%);
        visibility: hidden;
        transition: transform 0.22s var(--ease), visibility 0s linear 0.22s;
        box-shadow: var(--shadow);
    }
    .rail.open { transform: none; visibility: visible; transition: transform 0.22s var(--ease), visibility 0s; }
    .rail-scrim { position: fixed; inset: var(--tt-topnav-h) 0 0 0; z-index: calc(var(--tt-z-modal, 1000) + 4); background: var(--scrim); }
    .mobile-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: sticky;
        top: var(--tt-topnav-h);
        z-index: 20;
        padding: 8px 14px;
        border-bottom: 1px solid var(--line);
        background: var(--surface);
    }
    .mobile-bar .title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-bar .btn { min-height: 44px; min-width: 44px; }
    .stage { padding: 18px 16px 90px; }
    .page-head { margin-bottom: 18px; padding-bottom: 14px; }
    .page-head h1 { font-size: 1.5rem; }
    .money-hero { grid-template-columns: minmax(0, 1fr); }
    .onboard-choices { grid-template-columns: minmax(0, 1fr); }
    .form-grid .span-8, .form-grid .span-6, .form-grid .span-4, .form-grid .span-3 { grid-column: span 12; }
    .form-grid .span-2 { grid-column: span 6; }
    .search { min-width: 0; flex: 1 1 100%; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; }
    .btn-sm.btn-icon { width: 44px; min-height: 44px; }
    .rail-link { min-height: 44px; }
    .year-picker button { width: 44px; height: 44px; }
    .segmented button { min-height: 44px; }
    .toast button { min-width: 44px; min-height: 44px; margin: -12px -12px -12px 0; }
    .lines-table input, .lines-table select { min-height: 44px; }
}

@media (max-width: 640px) {
    .instruments { grid-template-columns: minmax(0, 1fr) !important; }
    .table.responsive thead { display: none; }
    .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
    .table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .table.responsive td { padding: 2px 0; border: 0; text-align: left; }
    .table.responsive td.money, .table.responsive td.num { text-align: left; }
    .table.responsive td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 96px; color: var(--text-3); font-size: var(--fs-xs); }
    .table.responsive td.hide-sm { display: none; }
    .table.responsive tfoot td { background: transparent; }
    .modal { max-height: calc(100dvh - 20px); }
    .scrim { padding: 10px; }
    .lines-table thead { display: none; }
    .lines-table tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .lines-table td { display: block; padding: 0; border: 0; }
    .lines-table td.col-desc { grid-column: 1 / -1; }
    .lines-table td.col-total { grid-column: span 2; padding-top: 10px; text-align: left; }
    .paper { transform-origin: top left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ————— Print: only the paper ————— */

@media print {
    @page { size: A4; margin: 0; }
    :root { color-scheme: light; }
    html, body { background: #fff; }
    body.printing > *:not(#printRoot) { display: none !important; }
    #printRoot { display: block !important; }
    #printRoot .paper { box-shadow: none; margin: 0; overflow: visible; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
    #printRoot .paper + .paper { break-before: page; }
    #printRoot .p-items tr, #printRoot .p-sum, #printRoot .p-pay, #printRoot .p-legal, #printRoot .p-sign, #printRoot .p-foot { break-inside: avoid; }
}
#printRoot { display: none; }

.stage-wrap { min-width: 0; }

/* ————— Cash-flow forecast, bank feeds, API keys ————— */

.forecast { margin-bottom: 22px; }
.forecast .panel-head { align-items: center; flex-wrap: wrap; }
.forecast-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--line); overflow: hidden; }
.forecast-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; background: var(--surface); min-width: 0; }
.forecast-stat span { color: var(--text-3); font-size: var(--fs-xs); }
.forecast-stat strong { font-family: var(--font-display); font-weight: 500; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.forecast-warning { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 10px 14px; border-radius: var(--r-md); background: var(--neg-wash); color: var(--text); font-size: var(--fs-sm); }
.forecast-warning i { color: var(--neg); margin-top: 3px; }
.forecast-plot { position: relative; }
.forecast-chart { width: 100%; height: 230px; }
.forecast-tooltip { position: absolute; z-index: 2; display: flex; flex-direction: column; gap: 2px; max-width: 280px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--raised); box-shadow: var(--shadow); font-size: var(--fs-xs); pointer-events: none; }
.forecast-tooltip strong { font-size: var(--fs-sm); }
.forecast-items { display: flex; flex-direction: column; margin-top: 12px; border-top: 1px solid var(--line); }
.forecast-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--line); color: var(--text); }
a.forecast-item:hover { background: var(--surface-2); color: var(--text); }
.forecast-date { color: var(--text-2); font-variant-numeric: tabular-nums; }
.forecast-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forecast-label .chip { margin-left: 8px; }
.forecast-kind { color: var(--text-3); font-size: var(--fs-xs); }
.forecast-amount { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.forecast-note { margin: 10px 0 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 0.7rem; vertical-align: middle; }

.feed-box { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--accent-deep); border-radius: var(--r-md); background: var(--accent-wash); }
.feed-box p { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.feed-box strong i { color: var(--accent); }
.feed-state { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--pos); font-size: var(--fs-xs); }
.feed-state.neg { color: var(--neg); }

.code-sample { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-3); color: var(--text); font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: var(--fs-xs); line-height: 1.6; white-space: pre-wrap; word-break: break-all; }

@media (max-width: 900px) {
    .forecast-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .forecast-item { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .forecast-kind { display: none; }
}

.alert-item.static { cursor: default; }
.alert-item.ok .bar { background: var(--pos); }
.alert-item a { color: var(--accent); white-space: nowrap; }
.alert-item span a { display: inline; }
.primary > .pill { margin-left: 8px; vertical-align: 1px; }
.busy-progress { margin-left: 8px; font-variant-numeric: tabular-nums; }
#ttnav-overlays .tt-modal-overlay { z-index: calc(var(--tt-z-modal, 1000) + 40); }

/* ————— Exporty a příkazy ————— */
.export-kinds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; margin-top: 4px; }
.export-kinds > div { display: flex; flex-direction: column; gap: 2px; }
.export-kinds .field-label { margin-bottom: 2px; color: var(--text-3); font-size: var(--fs-xs); letter-spacing: 0.04em; }
.export-hint { margin: 8px 0 0; font-size: var(--fs-sm); line-height: 1.5; }
.export-problems { margin-bottom: 16px; }
.export-problems strong { display: block; }
.export-problems ul { margin: 8px 0 0; padding-left: 18px; }
.export-problems li { margin: 3px 0; line-height: 1.45; }
.pay-intro { margin: 0 0 12px; line-height: 1.5; }
.pay-list { display: flex; flex-direction: column; max-height: 44vh; overflow-y: auto; border-top: 1px solid var(--line); }
.pay-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.pay-row:hover { background: var(--surface-2); }
.pay-row.blocked { cursor: default; }
.pay-row.blocked:hover { background: none; }
.pay-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.pay-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-main strong { font-weight: 600; overflow-wrap: anywhere; }
.pay-main span { color: var(--text-3); font-size: var(--fs-xs); line-height: 1.45; overflow-wrap: anywhere; }
.pay-main .pay-late, .pay-main .pay-problem { color: var(--neg); }
.pay-amount { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.pay-amount small { margin-left: 3px; color: var(--text-3); font-size: 0.8em; }
.pay-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 12px 0 18px; color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.pay-help { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; line-height: 1.55; }
.pay-help p { margin: 0; }

@media (max-width: 640px) {
    .export-kinds { grid-template-columns: minmax(0, 1fr); }
    .pay-list { max-height: none; }
    .pay-row { grid-template-columns: 22px minmax(0, 1fr); }
    .pay-amount { grid-column: 2; text-align: left; }
}

/* ————— Roční uzávěrka ————— */

.closing-progress { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.closing-progress-label { color: var(--text-2); font-size: var(--fs-sm); }
.closing-progress-label strong { color: var(--text); font-family: var(--font-display); font-weight: 500; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; }
.closing-progress-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.closing-progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.4s ease; }
.closing-steps { display: flex; flex-direction: column; margin: 0 0 22px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.closing-step { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.closing-step:last-child { border-bottom: 0; }
.closing-mark { display: inline-flex; justify-content: center; padding-top: 2px; color: var(--text-3); font-size: 1.05rem; }
.closing-step.is-done .closing-mark { color: var(--pos); }
.closing-step.is-todo .closing-mark { color: var(--accent); }
.closing-step.is-warning .closing-mark { color: var(--warn); }
.closing-step.is-info .closing-mark { color: var(--info); }
.closing-body { min-width: 0; }
.closing-body strong { display: block; font-weight: 600; }
.closing-body p { margin: 3px 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.closing-step.is-done .closing-body p { color: var(--text-3); }
.closing-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.closing-panel { margin-bottom: 22px; }
.closing-panel .panel-head { flex-wrap: wrap; gap: 6px 14px; }
.closing-note { margin: 12px 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }

@media (max-width: 900px) {
    .closing-step { grid-template-columns: 24px minmax(0, 1fr); }
    .closing-actions { grid-column: 2; justify-content: flex-start; }
}

/* ————— Podání daně z příjmů ————— */

.filing-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.filing-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.filing-card.ready { border-color: color-mix(in srgb, var(--pos) 35%, var(--line)); }
.filing-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.filing-card-head > div { min-width: 0; }
.filing-card-head h3 { margin: 2px 0 0; font-size: var(--fs-lg); font-weight: 600; }
.filing-card-head .pill { flex-shrink: 0; }
.filing-card-kind { color: var(--accent); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.filing-card-recipient { margin: 4px 0 0; color: var(--text-3); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.filing-deadline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; color: var(--text-2); font-size: var(--fs-sm); }
.filing-deadline > i { color: var(--accent); }
.filing-deadline details { flex-basis: 100%; }
.filing-card summary, .more-box summary { display: flex; align-items: center; min-height: 32px; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.filing-card details ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.filing-summary { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); }
.checklist { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: var(--fs-sm); }
.checklist li { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.checklist li > span { flex: 1; min-width: 0; }
.checklist li.ok > i { color: var(--pos); }
.checklist li.bad > i { color: var(--warn); }
.filing-options .stack { margin-top: 8px; }
.filing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.where-steps { margin: 0; padding-left: 20px; line-height: 1.6; }
.where-steps li + li { margin-top: 8px; }
.where-steps .btn { margin-left: 4px; }
.month-picker { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.month-chip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 4px 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.month-chip b { font-weight: 600; }
.month-chip span { min-height: 1em; font-size: var(--fs-xs); }
.month-chip[data-state="H"] { border-color: var(--accent); background: var(--accent-wash); color: var(--text); }
.month-chip[data-state="V"] { border-color: var(--info); background: var(--info-wash); color: var(--text); }
.month-chip[data-state="A"] { border-color: var(--pos); background: var(--pos-wash); color: var(--text); }
.sub-grid { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.child-row { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.child-remove { display: flex; align-items: flex-end; justify-content: flex-end; }
.more-box { border-top: 1px solid var(--line); padding-top: 6px; }
.more-box[open] > .form-grid { margin-top: 10px; }

@media (max-width: 900px) {
    .filing-card .btn-sm { min-height: 44px; }
    .filing-card summary, .more-box summary { min-height: 44px; }
}

@media (max-width: 640px) {
    .month-picker { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .filing-card { padding: 16px; }
    .filing-actions .btn { flex: 1 1 auto; }
}

/* ————— Zakázky a střediska ————— */

.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 24px; vertical-align: middle; }
.spark i { display: block; width: 5px; border-radius: 1px; background: var(--pos); opacity: 0.85; }
.spark i.neg { background: var(--neg); }
.spark i.zero { background: var(--line-strong); opacity: 1; }
a.mini-row { color: var(--text); }
a.mini-row:hover { background: var(--surface-2); color: var(--text); }

/* ————— JMHZ ————— */

.jmhz-panel { display: flex; flex-direction: column; gap: 18px; }
.jmhz-status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-2); font-size: var(--fs-sm); }
.jmhz-status strong { color: var(--text); font-weight: 600; }
.jmhz-guid { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: var(--fs-xs); overflow-wrap: anywhere; }
.jmhz-issues { display: flex; flex-direction: column; gap: 14px; }
.jmhz-group { padding: 4px 14px 2px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.jmhz-group-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0 8px; border-bottom: 1px solid var(--line); }
.jmhz-group-head strong { display: block; font-weight: 600; }
.jmhz-group-head .faint { font-size: var(--fs-xs); }
.jmhz-group .alert-list { gap: 0; }
.jmhz-toolbar { margin-bottom: 0; }
.jmhz-subhead { margin: 4px 0 10px; font-size: var(--fs-lg); font-weight: 600; }
.jmhz-actions { flex-wrap: nowrap; justify-content: flex-end; gap: 6px; }
.jmhz-employee { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); }
.jmhz-sub { padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-2); }
.jmhz-sub > .field-label { display: block; margin-bottom: 10px; }
.jmhz-child { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.jmhz-child-remove { display: flex; align-items: center; justify-content: flex-end; }
.jmhz-agreements { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; min-width: 0; margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: var(--r-md); }
.jmhz-agreements legend { padding: 0 6px; color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.jmhz-lede { margin: 0; color: var(--text-2); line-height: 1.6; }
.jmhz-steps { display: flex; flex-direction: column; gap: 12px; margin: 0; padding-left: 20px; line-height: 1.55; }
.jmhz-steps li > span { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--fs-sm); }
.jmhz-steps code { padding: 1px 6px; border-radius: 4px; background: var(--surface-3); color: var(--text); font-size: var(--fs-md); }
.jmhz-note { margin: 0; font-size: var(--fs-xs); }

@media (max-width: 640px) {
    .jmhz-agreements { grid-template-columns: minmax(0, 1fr); }
    .jmhz-actions { flex-wrap: wrap; justify-content: flex-start; }
    .jmhz-group { padding: 4px 12px 2px; }
    .jmhz-child-remove { justify-content: flex-start; }
}
.status-card .big small, .result-banner .figure small { margin-left: 5px; font-size: 0.5em; font-weight: 600; color: var(--text-3); letter-spacing: 0; }
.filing-warnings summary { cursor: pointer; color: var(--warn); font-size: var(--fs-sm); font-weight: 600; }
.filing-warnings ul, .filing-warnings p { margin: 8px 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.filing-warnings ul { padding-left: 18px; }

/* ————— Nápověda, pojmy a tmavý režim ————— */

.term { border-bottom: 1px dotted var(--text-3); cursor: help; }
.term:hover, .term:focus-visible { color: var(--accent); border-bottom-color: var(--accent); outline: none; }
.term-pop { position: fixed; z-index: calc(var(--tt-z-modal, 1000) + 40); display: flex; flex-direction: column; gap: 4px; max-width: 300px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--raised); box-shadow: var(--shadow); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; pointer-events: none; }
.term-pop strong { color: var(--text); font-weight: 600; }
.glossary { display: grid; grid-template-columns: minmax(0, 210px) minmax(0, 1fr); gap: 10px 20px; margin: 0; max-height: 56vh; overflow-y: auto; }
.glossary dt { font-weight: 600; }
.glossary dd { margin: 0; color: var(--text-2); line-height: 1.55; }
.shortcuts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: center; margin: 0; }
.shortcuts dt { white-space: nowrap; }
.shortcuts dd { margin: 0; color: var(--text-2); }

@media screen {
    :root[data-theme="dark"] .paper { filter: brightness(0.9) contrast(0.96); }
}

@media (max-width: 640px) {
    .glossary { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .glossary dd { margin-bottom: 10px; }
}

.tabbar { display: none; }

@media (max-width: 900px) {
    .tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: calc(var(--tt-z-modal, 1000) + 3);
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        align-items: center;
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--line);
        background: var(--surface);
        box-shadow: 0 -6px 18px rgba(16, 24, 40, 0.06);
    }
    .tabbar-link { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; border: 0; background: none; color: var(--text-3); font-size: 0.6875rem; font-weight: 600; cursor: pointer; }
    .tabbar-link i { font-size: 1.05rem; }
    .tabbar-link.active { color: var(--accent); }
    .tabbar-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; padding: 0 5px; border-radius: 999px; background: #d92d20; color: #ffffff; font-size: 0.625rem; line-height: 16px; text-align: center; }
    .tabbar-create { justify-self: center; display: grid; place-items: center; width: 52px; height: 52px; margin-top: -18px; border: 4px solid var(--surface); border-radius: 50%; background: var(--primary); color: var(--on-accent); font-size: 1.15rem; box-shadow: var(--shadow-sm); cursor: pointer; }
    .tabbar-create:active { background: var(--primary-hover); }
    .stage { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
    .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ————— Průvodce a moduly ————— */

.saldo.wz-focus { grid-template-columns: minmax(0, 1fr); }
.saldo.wz-focus .rail, .saldo.wz-focus .mobile-bar, .saldo.wz-focus .tabbar, .saldo.wz-focus .rail-scrim { display: none; }
.saldo.wz-focus .stage { padding: 0; }

.wz { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tt-topnav-h)); background: var(--bg); }
.wz-top { position: sticky; top: var(--tt-topnav-h); z-index: 6; display: flex; align-items: center; gap: 24px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: var(--surface); }
.wz-title { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 0 1 auto; }
.wz-title strong { display: block; font-size: var(--fs-md); font-weight: 700; white-space: nowrap; }
.wz-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-md); background: var(--primary); color: var(--on-accent); }
.wz-count { display: block; font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }
.wz-steps { display: flex; align-items: center; gap: 8px; margin: 0 auto; padding: 0; list-style: none; }
.wz-steps li { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }
.wz-steps li + li::before { content: ''; width: 24px; height: 1px; background: var(--line-strong); }
.wz-dot { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); font-size: 0.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.wz-steps li.current { color: var(--text); font-weight: 600; }
.wz-steps li.current .wz-dot { border-color: var(--primary); background: var(--primary); color: var(--on-accent); }
.saldo.wz-focus ~ .toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
.wz-steps li.done { color: var(--text-2); }
.wz-steps li.done .wz-dot { border-color: transparent; background: var(--accent-wash); color: var(--accent); }
.wz-cancel { flex: none; margin-left: auto; }
.wz-steps + .wz-cancel { margin-left: 0; }
.wz-progress { height: 3px; background: var(--surface-3); }
.wz-progress span { display: block; width: 0; height: 100%; background: var(--primary); transition: width 0.3s ease; }

.wz-body { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 32px 28px; }
.wz-narrow { max-width: 660px; margin: 0 auto; }
.wz-head { margin-bottom: 24px; }
.wz-head h1 { margin: 0; font-size: var(--fs-3xl); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance; outline: none; }
.wz-head .lede { margin: 8px 0 0; max-width: 62ch; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.55; }
.wz .hint { font-size: var(--fs-xs); color: var(--text-3); }

.wz-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.wz-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.wz-card:hover { border-color: var(--accent); box-shadow: var(--shadow-sm); }
button.wz-card:active { transform: translateY(1px); }
.wz-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash), var(--shadow-sm); }
.wz-card strong { font-size: var(--fs-lg); font-weight: 650; line-height: 1.3; }
.wz-card-key { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: var(--r-sm); color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.wz-card-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); font-size: 1.05rem; }
.wz-card-who { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.wz-card-setup { display: flex; gap: 8px; width: 100%; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.wz-card-setup i { margin-top: 4px; color: var(--pos); font-size: 0.75rem; }
.wz-demo { border-style: dashed; background: var(--surface-2); box-shadow: none; cursor: default; }
.wz-demo:hover { border-color: var(--line-strong); box-shadow: none; }
@media (min-width: 901px) {
    .wz-cards:has(> :last-child:nth-child(2)), .wz-cards:has(> :last-child:nth-child(4)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wz-demo .wz-card-icon { background: var(--surface-3); color: var(--text-2); }
.wz-demo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }

.wz-ico-row { display: flex; flex-direction: column; gap: 8px; }
.wz-ico-label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; }
.wz-ico-wrap { position: relative; display: block; max-width: 340px; }
.wz .wz-ico { min-height: 58px; padding: 10px 52px 10px 16px; font-size: var(--fs-2xl); font-weight: 600; letter-spacing: 0.14em; font-variant-numeric: tabular-nums; }
.wz .wz-ico::placeholder { color: var(--text-3); opacity: 0.55; }
.wz-ico-state { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--text-3); font-size: 1.2rem; line-height: 1; }
.wz-ico-state.ok { color: var(--pos); }
.wz-ico-state.bad { color: var(--neg); }
.wz-live { min-height: 1.5em; margin: 10px 0 14px; color: var(--text-2); font-size: var(--fs-sm); }
.wz-company { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.wz-company-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.wz-company-head strong { display: block; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; }
.wz-company-head > div > span { display: block; margin-top: 3px; color: var(--text-2); font-size: var(--fs-sm); }
.wz-company-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-lg); background: var(--accent-wash); color: var(--accent); font-size: 1.1rem; }
.wz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wz-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 500; line-height: 1.4; }
.wz-chip i { font-size: 0.72rem; }
.wz-chip.pos { border-color: transparent; background: var(--pos-wash); color: var(--pos); }
.wz-chip.neg { border-color: transparent; background: var(--neg-wash); color: var(--neg); font-weight: 600; }
.wz-chip-btn { min-height: 36px; padding: 6px 12px; font: inherit; font-size: var(--fs-sm); color: var(--text); cursor: pointer; }
.wz-chip-btn:hover { border-color: var(--accent); }
.wz-note { display: block; line-height: 1.5; }
.wz-note i { color: var(--info); }
.wz-no-ico { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 10px; }
.wz-manual { margin-top: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.wz-manual-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.wz-manual-head span { color: var(--text-3); font-size: var(--fs-sm); }

.wz-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.wz-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.wz-section { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.wz-section-head { display: flex; flex-direction: column; gap: 3px; }
.wz-section-head strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-lg); font-weight: 600; }
.wz-section-head > span { color: var(--text-3); font-size: var(--fs-sm); line-height: 1.5; }
.wz-section .segmented { align-self: flex-start; }
.wz-section .segmented.wz-seg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-self: stretch; }
.wz-tag { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; background: var(--info-wash); color: var(--info); font-size: var(--fs-xs); font-weight: 600; }
.wz-reason .hint { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }

.wz-toggles { display: flex; flex-direction: column; }
.wz-toggle { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.wz-toggle:first-child { padding-top: 0; }
.wz-toggle:last-child { padding-bottom: 0; border-bottom: 0; }
.wz-toggle-text strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.wz-toggle-text > span { display: block; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.45; }
.wz-toggle input, .mod-switch input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; }
.wz-switch { position: relative; display: block; flex: none; width: 44px; height: 26px; border-radius: 999px; background: var(--line-strong); transition: background 0.15s ease; }
.wz-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--on-accent); box-shadow: var(--shadow-sm); transition: transform 0.15s ease; }
.wz-toggle input:checked + .wz-switch, .mod-switch input:checked + .wz-switch { background: var(--primary); }
.wz-toggle input:checked + .wz-switch::after, .mod-switch input:checked + .wz-switch::after { transform: translateX(18px); }
.wz-toggle input:focus-visible + .wz-switch, .mod-switch input:focus-visible + .wz-switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.mod-switch input:disabled + .wz-switch { opacity: 0.5; cursor: not-allowed; }

.wz-regimes { display: flex; flex-direction: column; gap: 10px; }
.wz-regime { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease; }
.wz-regime:hover { border-color: var(--line-strong); }
.wz-regime.selected { border-color: var(--accent); background: var(--accent-wash); }
.wz-regime.off { background: var(--surface-2); cursor: not-allowed; }
.wz-regime input { width: 17px; height: 17px; margin: 3px 0 0; accent-color: var(--accent); }
.wz-regime-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.wz-regime-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.wz-regime-text { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.wz-regime-cost { color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.wz-regime-cost b { color: var(--text); font-weight: 700; }
.wz-regime-cost em { font-style: normal; }
.wz-regime-cost em.pos { font-weight: 600; }
.wz-regime-cost.off { color: var(--text-3); }

.wz-published { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--text-2); font-size: var(--fs-sm); }
.wz-published > span i { color: var(--pos); }
.wz .wz-account-check { min-height: 0; margin: -6px 0 0; color: var(--warn); font-size: var(--fs-sm); }
.wz-fio { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; border-color: transparent; background: var(--info-wash); color: var(--text); line-height: 1.5; }
.wz-fio strong { color: var(--info); }
.wz-step .link-btn { min-height: 44px; margin-top: 12px; }

.wz-summary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.wz-sum-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.wz-sum-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: var(--fs-lg); font-weight: 600; }
.wz-sum-card h3 > i { color: var(--accent); }
.wz-sum-card .hint { margin: -6px 0 12px; }
.wz-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--fs-sm); }
.wz-facts dt { color: var(--text-3); }
.wz-facts dd { margin: 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.wz-tips ol { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 20px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.wz-mods { display: flex; flex-direction: column; gap: 16px; }
.wz-mod-group { display: flex; flex-direction: column; gap: 6px; }
.wz-sum-card .wz-mod-group h3 { margin: 0 0 2px; color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.wz-sum-card .wz-mod-group h3 > i { color: inherit; }
.wz-mod { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; min-height: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.wz-mod:hover { border-color: var(--line-strong); }
.wz-mod > i:first-child { color: var(--accent); text-align: center; }
.wz-mod strong { display: block; font-size: var(--fs-md); font-weight: 600; }
.wz-mod small { display: block; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.4; }
.wz-mod .wz-mod-state { color: var(--accent); font-size: 1.35rem; }
.wz-mod.off { background: var(--surface-2); }
.wz-mod.off > i:first-child, .wz-mod.off .wz-mod-state { color: var(--text-3); }

.wz-foot { position: sticky; bottom: 0; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 32px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.wz-foot-end { display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-width: 0; }
.wz-hint { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.wz .wz-next { min-height: 44px; padding: 10px 22px; font-size: var(--fs-lg); }
.wz-problem { margin: 0; color: var(--neg); font-size: var(--fs-sm); font-weight: 500; text-align: right; }

.wz-done { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 620px; margin: 24px auto 0; text-align: center; }
.wz-done-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--pos-wash); color: var(--pos); font-size: 1.6rem; }
.wz-done h1 { margin: 6px 0 0; font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.025em; outline: none; }
.wz-done .lede { margin: 0; color: var(--text-2); font-size: var(--fs-lg); line-height: 1.55; }
.wz-created { display: flex; flex-direction: column; gap: 8px; width: 100%; margin: 8px 0 0; padding: 0; list-style: none; }
.wz-created li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); text-align: left; }
.wz-created li i { color: var(--pos); }
.wz-created li span { margin-left: auto; color: var(--text-3); font-size: var(--fs-sm); white-space: nowrap; }
.wz-done-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }

.gs-panel { margin-bottom: 16px; }
.gs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gs-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.gs-sub { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.gs-progress { height: 6px; margin: 14px 0 8px; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.gs-progress span { display: block; height: 100%; border-radius: inherit; background: var(--pos); transition: width 0.3s ease; }
.gs-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.gs-item { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.gs-item:last-child { padding-bottom: 0; border-bottom: 0; }
.gs-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); font-size: 0.9rem; }
.gs-item.done .gs-mark { background: var(--pos-wash); color: var(--pos); }
.gs-text { min-width: 0; }
.gs-text strong { display: block; font-weight: 600; }
.gs-text span { display: block; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.45; }
.gs-item.done .gs-text strong { color: var(--text-2); font-weight: 500; }
.gs-dismiss { color: var(--text-3); }
.gs-more { min-height: 44px; margin-top: 4px; }

.prof-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-chips .wz-chip { font-size: var(--fs-sm); color: var(--text); }
.mod-list { display: flex; flex-direction: column; }
.mod-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.mod-row:first-child { padding-top: 0; }
.mod-row:last-child { padding-bottom: 0; border-bottom: 0; }
.mod-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); }
.mod-row.off .mod-icon { background: var(--surface-3); color: var(--text-3); }
.mod-text strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
.mod-text > span { display: block; color: var(--text-3); font-size: var(--fs-sm); line-height: 1.5; }
.mod-row.off .mod-text strong { color: var(--text-2); }
.mod-badge { padding: 1px 8px; border-radius: 999px; background: var(--pos-wash); color: var(--pos); font-size: var(--fs-xs); font-weight: 600; }
.mod-switch { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }

@media (max-width: 1180px) {
    .wz-steps li:not(.current) .wz-step-label { display: none; }
}

@media (max-width: 900px) {
    .wz-top { gap: 12px; padding: 8px 16px; }
    .wz-steps { display: none; }
    .wz-cancel { min-width: 44px; min-height: 44px; }
    .wz-cancel span { display: none; }
    .wz-body { padding: 22px 16px 20px; }
    .wz-head h1 { font-size: var(--fs-2xl); }
    .wz-head .lede { font-size: var(--fs-md); }
    .wz-cards, .wz-grid, .wz-summary { grid-template-columns: minmax(0, 1fr); }
    .wz-section .segmented { align-self: stretch; }
    .wz-section .segmented button { flex: 1 1 auto; }
    .wz-foot { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
    .wz-foot-end { flex: 1; flex-wrap: wrap; gap: 8px; }
    .wz-problem { flex-basis: 100%; }
    .wz-hint { display: none; }
    .wz .wz-next { flex: 1 1 auto; max-width: 260px; }
    .wz-ico-wrap { max-width: none; }
    .wz-company-head { grid-template-columns: auto minmax(0, 1fr); }
    .wz-company-head .btn { grid-column: 1 / -1; justify-self: start; }
    .gs-item { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "mark text close" ". cta cta"; row-gap: 8px; }
    .gs-mark { grid-area: mark; }
    .gs-text { grid-area: text; }
    .gs-item > .btn:not(.gs-dismiss) { grid-area: cta; justify-self: start; }
    .gs-dismiss { grid-area: close; }
}

@media (hover: none) {
    .wz-card-key, .wz-hint { display: none; }
}

/* ————— Přehledy a klienti ————— */

.ry-card { display: flex; flex-direction: column; }
.ry-lede { margin: 2px 0 0; color: var(--text-3); font-size: var(--fs-sm); }
.ry-lines { display: flex; flex-direction: column; margin-top: 14px; border-top: 1px solid var(--line); }
.ry-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.ry-line:last-child { border-bottom: 0; padding-bottom: 0; }
.ry-line:hover { color: var(--text); }
.ry-line:hover .ry-label { color: var(--accent); }
.ry-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ry-label { font-size: var(--fs-md); font-weight: 500; }
.ry-hint { overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.ry-amount { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ry-amount.plus { color: var(--pos); }
.ry-toggle { display: flex; align-items: center; gap: 9px; margin-top: 14px; color: var(--text-2); font-size: var(--fs-sm); cursor: pointer; }
.ry-toggle input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.ry-note { margin: 10px 0 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }

a.instrument { display: block; color: var(--text); }
a.instrument:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); color: var(--text); }
.insight-card .instrument-label i { color: var(--accent); font-size: 0.85rem; }
.instrument-value.text { padding-top: 4px; font-size: var(--fs-xl); line-height: 1.3; letter-spacing: -0.012em; }
.insight-card .instrument-value.warn, .clients-summary .instrument-value.warn { color: var(--warn); }

.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--line); overflow: hidden; }
.health-tile { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 12px 14px; background: var(--surface); cursor: default; }
.health-label { color: var(--text-3); font-size: var(--fs-xs); font-weight: 500; }
.health-value { display: flex; align-items: center; gap: 7px; overflow: hidden; font-family: var(--font-display); font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.012em; white-space: nowrap; text-overflow: ellipsis; }
.health-value i { font-size: 0.75em; }
.health-value.warn { color: var(--warn); }
.health-hint { color: var(--text-2); font-size: var(--fs-xs); line-height: 1.4; }
.health-note { margin: 12px 0 0; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.5; }

.clients-summary { margin-bottom: 20px; }
.clients-list { display: flex; flex-direction: column; gap: 10px; }
.client-row {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px 18px;
    align-items: start;
    padding: 14px 16px 14px 22px;
    border: 1px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--surface);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
}
.client-row:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.client-row.current { border-color: var(--accent-deep); }
.client-bar { position: absolute; top: 12px; bottom: 12px; left: 0; width: 4px; border-radius: 0 4px 4px 0; background: var(--pos); }
.client-row.level-critical .client-bar { background: var(--neg); }
.client-row.level-warning .client-bar { background: var(--warn); }
.client-row.level-archived .client-bar { background: var(--line-strong); }
.client-firm { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.client-title { display: flex; align-items: center; gap: 6px; max-width: 100%; min-width: 0; }
.client-title .chip { flex: none; }
.client-name { flex: 0 1 auto; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font-size: var(--fs-lg); font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.client-name:hover { color: var(--accent); }
.client-meta { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.client-fact { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.client-fact-label { color: var(--text-3); font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.client-fact-main { max-width: 100%; overflow: hidden; font-variant-numeric: tabular-nums; white-space: nowrap; text-overflow: ellipsis; }
.client-fact-main .pill { max-width: 100%; }
.client-fact-sub { max-width: 100%; overflow: hidden; color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; text-overflow: ellipsis; }
.client-actions { display: flex; flex-wrap: wrap; align-self: stretch; gap: 6px; margin-top: 8px; }
.clients-note { margin: 14px 0 0; color: var(--text-3); font-size: var(--fs-sm); }

@media (max-width: 1100px) {
    .client-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .client-firm { grid-column: 1 / -1; }
}

@media (max-width: 640px) {
    .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .health-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
    .instruments.clients-summary { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .client-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 14px 14px 14px 20px; }
    .client-firm, .client-fact:nth-child(3), .client-fact:nth-child(6) { grid-column: 1 / -1; }
    .client-actions .btn { flex: 1 1 0; min-height: 44px; }
    .ry-toggle { min-height: 44px; }
    .ry-hint { white-space: normal; }
    .clients-summary .instrument { padding: 12px 14px; }
    .clients-summary .instrument-value { margin-top: 6px; font-size: 1.35rem; }
    .clients-summary .instrument-foot { margin-top: 4px; font-size: var(--fs-xs); }
}

/* ————— Automatizace ————— */

.switch { position: relative; display: inline-flex; flex: none; align-items: center; width: 44px; height: 26px; cursor: pointer; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: inherit; }
.switch-track { position: relative; width: 44px; height: 26px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface-3); transition: background 0.15s ease, border-color 0.15s ease; }
.switch-track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-3); box-shadow: var(--shadow-xs); transition: transform 0.15s ease, background 0.15s ease; }
.switch input:checked + .switch-track { border-color: var(--primary); background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); background: var(--on-accent); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .switch-track { opacity: 0.55; }

.auto-kpis { margin-bottom: 18px; padding: 16px 18px; border: 1px solid var(--accent-deep); border-radius: var(--r-lg); background: var(--accent-wash); }
.auto-kpis-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.auto-kpis-head i { color: var(--accent); }
.auto-kpis-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px 16px; }
.auto-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.auto-kpi strong { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.auto-kpi span { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.35; }

.auto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.auto-card { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.auto-card-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; }
.auto-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--accent-wash); color: var(--accent); font-size: 0.95rem; }
.auto-card-title h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.auto-card-title p { margin: 3px 0 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.auto-card.off .auto-icon { background: var(--surface-3); color: var(--text-3); }
.auto-card.off .auto-stat strong { color: var(--text-3); }
.auto-stat { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.auto-stat strong { font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.025em; line-height: 1; font-variant-numeric: tabular-nums; }
.auto-stat span { color: var(--text-2); font-size: var(--fs-sm); }
.auto-inline .select { max-width: 260px; }
.auto-note { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.auto-list { display: flex; flex-direction: column; }
.auto-list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.auto-list-row:last-child { border-bottom: 0; }
a.auto-list-row:hover { background: var(--surface-2); color: var(--text); }
.auto-list-row .l { min-width: 0; }
.auto-list-row .l strong { display: block; overflow: hidden; font-size: var(--fs-md); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.auto-list-row .l span { display: block; color: var(--text-3); font-size: var(--fs-xs); line-height: 1.45; }
.auto-list-row .l span.neg { color: var(--neg); }
.auto-list-row .r { display: flex; flex: none; align-items: center; gap: 8px; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.auto-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); font-size: var(--fs-sm); }
.auto-readonly { margin-bottom: 16px; }

.section-lede { margin: -4px 0 14px; max-width: 80ch; font-size: var(--fs-sm); line-height: 1.5; }
.rule-list { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.rule-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.rule-row:last-child { border-bottom: 0; }
.rule-row.off .rule-main { opacity: 0.6; }
.rule-order { display: flex; align-items: center; gap: 2px; }
.rule-pos { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.rule-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rule-main strong { font-weight: 600; }
.rule-main span { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; overflow-wrap: anywhere; }
.rule-main .rule-action { color: var(--text); }
.rule-main .rule-action i { margin-right: 6px; color: var(--accent); font-size: 0.8em; }
.rule-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; font-variant-numeric: tabular-nums; }
.rule-stats strong { font-weight: 600; }
.rule-stats span { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.rule-tools { display: flex; align-items: center; gap: 4px; }

.suggest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.suggest-card { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.suggest-head { display: flex; align-items: flex-start; gap: 12px; }
.suggest-head .auto-icon { background: var(--warn-wash); color: var(--warn); }
.suggest-head div strong { display: block; font-weight: 600; }
.suggest-head div span { display: block; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.suggest-samples { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: var(--fs-xs); }
.suggest-samples li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline; }
.suggest-samples small { margin-left: 3px; }
.suggest-party { overflow: hidden; color: var(--text-2); text-overflow: ellipsis; white-space: nowrap; }
.suggest-note { margin: 0; font-size: var(--fs-xs); }
.suggest-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }

.rule-editor { display: flex; flex-direction: column; gap: 16px; }
.rule-block { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.rule-block h3 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.rule-conds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.rule-cond { display: grid; grid-template-columns: 52px 124px minmax(0, 1fr); gap: 8px; align-items: center; min-width: 0; }
.rule-cond-label { color: var(--text-2); font-size: var(--fs-sm); font-weight: 500; }
.rule-range { display: flex; align-items: center; gap: 8px; max-width: 380px; }
.rule-range .input { min-width: 0; }
.rule-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rule-hint { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.rule-preview:empty { display: none; }
.rule-preview-note { margin: 0; font-size: var(--fs-sm); line-height: 1.5; }
.rule-will { color: var(--pos); font-weight: 500; }
.partner-pick { min-width: 0; }
.partner-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 4px 6px 4px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.partner-chip > i { color: var(--accent); }
.partner-chip > span { flex: 1; min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }

.table .sub.rule-tag { color: var(--accent); }
.bank-actions { flex-wrap: nowrap; }

.table th.col-check, .table td.col-check { width: 40px; padding-right: 0; }
.bulk-check { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 24px; cursor: pointer; }
.bulk-check input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; padding: 10px 12px 10px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--shadow); }
.bulk-count { display: flex; flex-direction: column; gap: 1px; min-width: 0; font-size: var(--fs-sm); }
.bulk-count span { color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.bulk-actions { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; }
.bulk-summary ul { margin: 0; padding: 0; border-top: 1px solid var(--line); list-style: none; }
.bulk-summary li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.bulk-summary li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bulk-summary p { margin: 6px 0 0; }
.bulk-total { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 0; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.bulk-intro, .bulk-note, .bulk-skipped { margin: 0; line-height: 1.5; }

.reminders { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.reminder-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; border-top: 1px solid var(--line); }
.reminder-row { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: center; padding: 2px 4px 2px 8px; border-bottom: 1px solid var(--line); border-radius: var(--r-sm); }
.reminder-row input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.reminder-row.active { background: var(--accent-wash); }
.reminder-open { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 8px 6px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.reminder-preview { position: sticky; top: 0; min-width: 0; }

.lines-tools { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.autofill-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 9px 12px; border-radius: var(--r-md); background: var(--accent-wash); font-size: var(--fs-sm); line-height: 1.5; }
.autofill-note > i { margin-top: 3px; color: var(--accent); }
.duplicate-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; line-height: 1.5; }
.duplicate-note > i { margin-top: 3px; color: var(--warn); }
.duplicate-note strong, .duplicate-note span { display: block; }
.duplicate-note a { display: inline-block; margin-top: 4px; font-weight: 600; }
.autocomplete-list.line-suggest { position: fixed; right: auto; z-index: calc(var(--tt-z-modal, 1000) - 50); max-height: min(340px, 50vh); }
.line-suggest-head { padding: 4px 10px 6px; color: var(--text-3); font-size: var(--fs-xs); }
.line-suggest .autocomplete-item { flex-direction: column; justify-content: flex-start; gap: 2px; }

@media (max-width: 1080px) {
    .auto-kpis-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .auto-grid, .rule-conds, .reminders { grid-template-columns: minmax(0, 1fr); }
    .switch { height: 44px; }
    .bulk-bar { bottom: calc(84px + env(safe-area-inset-bottom)); }
    .reminder-open { min-height: 44px; }
}

@media (max-width: 640px) {
    .auto-kpis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auto-card { padding: 16px; }
    .auto-list-row .l strong { white-space: normal; }
    .rule-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px; }
    .rule-main { grid-column: 1 / -1; order: 1; }
    .rule-stats { grid-column: 1 / -1; order: 2; flex-direction: row; align-items: baseline; gap: 8px; }
    .rule-order { order: 3; }
    .rule-tools { order: 4; justify-content: flex-end; }
    .rule-cond { grid-template-columns: 52px minmax(0, 1fr); }
    .rule-cond > .input { grid-column: 1 / -1; }
    .bank-actions { flex-wrap: wrap; }
    .table.responsive tr:has(> td.col-check) { position: relative; padding-right: 56px; }
    .table.responsive td.col-check { position: absolute; top: 6px; right: 6px; width: auto; }
    .bulk-check { min-width: 44px; min-height: 44px; }
    .bulk-bar { padding: 10px 12px; }
    .bulk-actions .btn { flex: 1 1 auto; }
    .bulk-actions .btn:disabled { display: none; }
}

/* ————— Tiskové výkazy a moderní faktura ————— */

.paper-report .p-statement th, .paper-report .p-statement td { padding: 1.3mm 2mm; font-size: 8.2pt; }
.paper-report .p-statement tr.strong td { font-weight: 600; }
.paper-report .p-section { margin: 5mm 0 2mm; font-size: 8.4pt; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--paper-muted); }
.paper.paper-modern { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.paper.paper-modern::before { content: ''; display: block; height: 7mm; margin: -16mm -16mm 10mm; background: var(--paper-accent); }
.paper-modern .p-rule { display: none; }
.paper-modern .p-title h1 { color: var(--paper-accent); }
.paper-modern .p-items th { padding-top: 2mm; background: color-mix(in srgb, var(--paper-accent) 7%, #ffffff); border-bottom-color: var(--paper-accent); }
.paper-modern .p-total .grand { border-top-color: var(--paper-accent); }
.paper-modern .p-total .grand strong { color: var(--paper-accent); }
.paper-modern .p-pay { border-color: color-mix(in srgb, var(--paper-accent) 30%, #ffffff); background: color-mix(in srgb, var(--paper-accent) 5%, #ffffff); }
.paper-report .p-statement { table-layout: fixed; }
.paper-report .p-statement th:nth-child(1) { width: 16mm; }
.paper-report .p-statement th:nth-child(3), .paper-report .p-statement th:nth-child(4) { width: 34mm; }

/* ————— Platby úřadům ————— */
.tpay-toolbar { margin-bottom: 16px; }
.tpay-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tpay-kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.tpay-kpi-label { font-size: var(--fs-sm); color: var(--text-2); }
.tpay-kpi strong { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tpay-kpi-count { font-size: var(--fs-xs); color: var(--text-3); }
.tpay-kpi.neg strong { color: var(--neg); }
.tpay-kpi.pos strong { color: var(--pos); }
.tpay-kpi.info strong { color: var(--info); }
.tpay-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; margin-bottom: 22px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.tpay-hero.overdue { border-left-color: var(--neg); }
.tpay-hero-kicker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.tpay-hero.overdue .tpay-hero-kicker { color: var(--neg); }
.tpay-dot { color: var(--text-3); }
.tpay-hero h2 { margin: 6px 0 2px; font-size: var(--fs-xl); font-weight: 700; letter-spacing: -0.01em; }
.tpay-hero-line { margin: 0; color: var(--text-2); }
.tpay-hero-amount { display: flex; align-items: center; gap: 12px; margin: 10px 0 4px; font-size: var(--fs-4xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tpay-hero-amount small, .tpay-amount small { margin-left: 6px; font-size: 0.45em; font-weight: 500; color: var(--text-3); }
.tpay-hero-to { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: var(--fs-sm); color: var(--text-2); }
.tpay-hero-qr { display: flex; justify-content: center; }
.tpay-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 12px 0 0; }
.tpay-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 7px 8px 7px 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md); }
.tpay-field dt { font-size: var(--fs-xs); color: var(--text-3); }
.tpay-field dd { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; margin: 0; }
.tpay-value { font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tpay-copy { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); cursor: pointer; }
.tpay-copy:hover { color: var(--accent); border-color: var(--line-strong); }
.tpay-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; }
.tpay-qr { box-sizing: content-box; padding: 10px; background: #ffffff; border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); }
.tpay-qr img, .tpay-qr canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.tpay-qr-wrap figcaption { max-width: 176px; font-size: var(--fs-xs); line-height: 1.4; color: var(--text-3); text-align: center; }
.tpay-qr-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 152px; min-height: 152px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); font-size: var(--fs-xs); color: var(--text-3); text-align: center; }
.tpay-qr-empty i { font-size: 1.6rem; }
.tpay-todo { margin-bottom: 22px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.tpay-todo ul { margin: 0; padding: 0; list-style: none; }
.tpay-todo li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tpay-todo li:last-child { border-bottom: 0; }
.tpay-todo li strong { display: block; font-weight: 600; }
.tpay-todo li span { display: block; font-size: var(--fs-sm); color: var(--text-3); }
.tpay-group { margin: 0 0 22px; }
.tpay-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tpay-group-head h3 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.tpay-group-head .note { font-size: var(--fs-sm); color: var(--text-3); }
.tpay-group.overdue .tpay-group-head h3 { color: var(--neg); }
.tpay-list { display: flex; flex-direction: column; gap: 12px; }
.tpay-card { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.tpay-card.with-qr { grid-template-columns: minmax(0, 1fr) auto; }
.tpay-card.is-next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.tpay-card.overdue { border-color: color-mix(in srgb, var(--neg) 45%, var(--line)); }
.tpay-card.paid, .tpay-card.nothing, .tpay-card.refund { background: var(--surface-2); }
.tpay-card.estimate { border-style: dashed; }
.tpay-card-main { min-width: 0; }
.tpay-card-head { display: flex; align-items: flex-start; gap: 10px; }
.tpay-card-titles { flex: 1; min-width: 0; }
.tpay-card-titles h4 { margin: 0; font-size: var(--fs-md); font-weight: 600; }
.tpay-card-titles span { display: block; font-size: var(--fs-xs); color: var(--text-3); }
.tpay-badge { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-wash); color: var(--accent); }
.tpay-badge.cssz { background: var(--info-wash); color: var(--info); }
.tpay-badge.zp { background: var(--pos-wash); color: var(--pos); }
.tpay-line { margin: 10px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.tpay-amount { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tpay-hero-amount .tpay-copy, .tpay-amount .tpay-copy { font-size: var(--fs-md); font-weight: 400; letter-spacing: 0; }
.tpay-amount-open { font-size: var(--fs-md); font-weight: 600; color: var(--text-2); }
.tpay-paid, .tpay-hint { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; font-size: var(--fs-sm); color: var(--text-2); }
.tpay-hint { display: block; }
.tpay-paid i { color: var(--pos); }
.tpay-missing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 8px 10px; border-radius: var(--r-md); background: var(--warn-wash); font-size: var(--fs-sm); color: var(--text); }
.tpay-missing > i { color: var(--warn); }
.tpay-missing > span { flex: 1; min-width: 160px; }
.tpay-why { margin-top: 10px; font-size: var(--fs-sm); color: var(--text-2); }
.tpay-why summary, .tpay-qr-more summary { cursor: pointer; font-size: var(--fs-xs); color: var(--text-3); }
.tpay-qr-more summary { display: flex; align-items: center; gap: 6px; }
.tpay-qr-more[open] summary { margin-bottom: 8px; }
.tpay-why ul { display: flex; flex-direction: column; gap: 4px; margin: 6px 0; padding-left: 18px; }
.tpay-why a { font-size: var(--fs-xs); }
.tpay-past { margin-bottom: 22px; }
.tpay-past > summary { margin-bottom: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.tpay-notes { margin-top: 8px; }
.tpay-notes p { margin: 0; }
.tpay-notes p + p { margin-top: 6px; }
@media (max-width: 720px) {
    .tpay-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .tpay-kpi { padding: 10px 12px; }
    .tpay-kpi-label, .tpay-kpi-count { font-size: var(--fs-xs); }
    .tpay-kpi strong { font-size: var(--fs-lg); }
    .tpay-hero { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px; }
    .tpay-hero-amount { font-size: var(--fs-3xl); }
    .tpay-card.with-qr { grid-template-columns: minmax(0, 1fr); }
    .tpay-card > .tpay-qr-wrap, .tpay-card > .tpay-qr-empty, .tpay-card > .tpay-qr-more { justify-self: center; }
    .tpay-todo li { flex-direction: column; align-items: flex-start; }
}
.result-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.result-stats .health-tile { padding: 0; background: transparent; }
.result-stats .health-value { font-size: var(--fs-lg); font-weight: 700; }
@media (max-width: 640px) {
    .result-stats { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

/* ————— OCR a import ————— */

.capture-privacy { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-sm); line-height: 1.5; }
.capture-privacy > i { margin-top: 3px; color: var(--pos); }
.ocr-progress { display: flex; flex-direction: column; gap: 6px; min-width: 210px; }
.ocr-track, .import-track { position: relative; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.ocr-fill, .import-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: inherit; background: var(--primary); transition: width 0.2s var(--ease); }
.ocr-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ocr-label { color: var(--text-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.ocr-cancel { flex: none; }

.import-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(120deg, var(--accent-wash), transparent 60%), var(--surface); box-shadow: var(--shadow-xs); }
.import-programs { display: flex; flex-wrap: wrap; gap: 8px; }
.import-program { padding: 4px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; }
.import-how { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; counter-reset: how; }
.import-how li { display: flex; flex-direction: column; gap: 2px; min-width: 150px; max-width: 230px; padding-left: 32px; position: relative; counter-increment: how; }
.import-how li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-accent); font-size: var(--fs-xs); font-weight: 700; line-height: 22px; text-align: center; }
.import-how strong { font-size: var(--fs-md); }
.import-how span { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }

.import-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.import-choice { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease); }
.import-choice.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--shadow-xs); }
.import-choice h3 { margin: 4px 0 0; font-size: var(--fs-lg); font-weight: 600; }
.import-choice p { flex: 1; margin: 0; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.55; }
.import-choice .btn { margin-top: 6px; }
.import-choice-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--accent-wash); color: var(--accent); font-size: 1.1rem; }

.import-flow { display: flex; flex-direction: column; gap: 16px; margin-bottom: 8px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); scroll-margin-top: calc(var(--tt-topnav-h) + 16px); }
.import-flow[hidden] { display: none !important; }
.import-flow-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.import-flow-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: var(--fs-xl); font-weight: 600; }
.import-flow-head h2 i { color: var(--accent); }
.import-flow-head .btn-icon { margin-left: auto; }
.import-steps { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; color: var(--text-3); font-size: var(--fs-sm); }
.import-steps li { display: flex; align-items: center; gap: 7px; }
.import-steps li span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; font-size: var(--fs-xs); font-weight: 700; }
.import-steps li.active { color: var(--text); font-weight: 600; }
.import-steps li.active span { border-color: var(--primary); background: var(--primary); color: var(--on-accent); }
.import-steps li.done span { border-color: var(--pos); color: var(--pos); }

.import-guide { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.import-guide summary { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--text); font-weight: 600; }
.import-guide summary i { color: var(--accent); }
.import-guide dl { display: grid; grid-template-columns: minmax(0, 170px) minmax(0, 1fr); gap: 8px 16px; margin: 12px 0 0; font-size: var(--fs-sm); line-height: 1.5; }
.import-guide dt { color: var(--text); font-weight: 600; }
.import-guide dd { margin: 0; color: var(--text-2); }
.import-options { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; }
.import-options.form-grid { display: grid; }
.import-check { align-items: flex-start; }
.import-check input { margin-top: 3px; }
.import-check .sub, .import-money-row .sub, .import-isdoc .sub, .import-file .sub, .import-done .sub { display: block; color: var(--text-3); font-size: var(--fs-xs); font-weight: 400; line-height: 1.45; }
.import-check-cell { display: flex; align-items: center; min-height: 40px; }
.import-tools { justify-content: space-between; gap: 10px 20px; }
.import-privacy { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); }
.import-privacy i { color: var(--pos); }
.import-isdoc { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.import-sub { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.import-sub h3 { display: flex; align-items: center; gap: 9px; margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.import-sub h3 i { color: var(--accent); }
.import-money { display: flex; flex-direction: column; gap: 12px; }
.import-money-rows { display: flex; flex-direction: column; gap: 8px; }
.import-tools .link-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; }
.import-money-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px); gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }

.import-file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.import-file > i { color: var(--accent); font-size: 1.2rem; }
.import-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.import-chip { padding: 2px 10px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; line-height: 20px; }
.import-chip.good { background: var(--pos-wash); color: var(--pos); }
.import-chip.bad { background: var(--neg-wash); color: var(--neg); }
.import-mapping { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); }
.import-mapping summary { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.import-mapping summary i { color: var(--accent); }
.import-mapping p { margin: 10px 0; font-size: var(--fs-sm); }
.import-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 14px; }
.import-map { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: var(--fs-sm); color: var(--text-2); font-weight: 500; }
.import-required { color: var(--neg); }
.import-balance { display: flex; flex-direction: column; gap: 12px; }
.import-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.import-totals > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.import-totals > div > span { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.import-totals strong { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.import-totals .ok strong { color: var(--pos); }
.import-totals .bad { border-color: color-mix(in srgb, var(--neg) 40%, transparent); background: var(--neg-wash); }
.import-totals .bad strong { color: var(--neg); }
.import-money-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px 14px; align-items: end; }
.import-money-map > strong { grid-column: 1 / -1; font-size: var(--fs-sm); }
.import-rows { transition: opacity 0.15s var(--ease); }
.import-rows.busy { opacity: 0.55; pointer-events: none; }
.import-message { display: block; max-width: 460px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.import-message.bad { color: var(--neg); }
.import-empty { margin: 8px 0; }
.import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.import-actions .btn-primary, .import-actions .btn-danger { margin-left: auto; }
.import-progress { display: flex; flex-direction: column; gap: 8px; padding: 18px 0 4px; }
.import-track { height: 8px; }
.import-progress-label { color: var(--text-2); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.import-done { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid color-mix(in srgb, var(--pos) 35%, transparent); border-radius: var(--r-md); background: var(--pos-wash); }
.import-done > i { margin-top: 2px; color: var(--pos); font-size: 1.2rem; }
.import-done.undone { border-color: var(--line); background: var(--surface-2); }
.import-done.undone > i { color: var(--text-3); }
.import-done strong { display: block; }

@media (max-width: 1080px) {
    .import-choices { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
    .import-hero, .import-flow { padding: 14px 16px; }
    .import-how li { max-width: none; }
    .import-guide dl { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .import-guide dd { margin-bottom: 8px; }
    .import-totals { grid-template-columns: minmax(0, 1fr); }
    .import-money-row { grid-template-columns: minmax(0, 1fr); }
    .import-chips { margin-left: 0; }
    .import-actions .btn-primary, .import-actions .btn-danger { width: 100%; margin-left: 0; }
    .ocr-progress { min-width: 0; }
}
