/* 40. ütem: a design-rendszer (tervvászon „40. ütem”, UI UX Pro Max: könyvelői SaaS, sűrű, világos). A színek, a betű, a térköz és az
   árnyék itt, egy helyen; a lap többi része csak ezekre a tokenekre hivatkozik. A jelző színek jelentése nem változott. */

/* Inter, a saját szerverünkről (a CSP csak a saját forrást engedi); a latin-ext részben vannak az ő és ű betűk. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/inter/inter-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url("/fonts/inter/inter-latin-ext.woff2") format("woff2");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Kék (márka): a 600 a fő szín, a 950 a bal sáv. */
    --blue-50: #EEF4FF;
    --blue-100: #DCE7FE;
    --blue-200: #BCD0FB;
    --blue-300: #8DAEF5;
    --blue-400: #5F8DF4;
    --blue-500: #3B6FE8;
    --blue-600: #1F5BD8;
    --blue-700: #1A4AB3;
    --blue-800: #163C8C;
    --blue-900: #0F2A66;
    --blue-950: #0A1F4D;
    /* Semleges, kékes szürke: 50 a lap háttere, 200 a keret, 400 a mezők kerete (fehéren 3:1 fölött), 600 a halvány szöveg. */
    --gray-25: #FAFBFD;
    --gray-50: #F4F6FB;
    --gray-100: #ECF0F7;
    --gray-200: #DDE3EE;
    --gray-300: #C5CEDE;
    --gray-400: #7D8BA8;
    --gray-500: #64728F;
    --gray-600: #4A5672;
    --gray-700: #343F57;
    --gray-900: #121A2C;
    /* A sötétkék bal sáv szövegei. */
    --side-text: #C9D6F2;
    --side-muted: #8AA1CC;
    /* Jelző színek: szöveg (a háttérén legalább 4,5:1), háttér, keret, erős (sáv, pont), sötét (szöveg a színes háttéren). */
    --ok: #15703A;
    --ok-bg: #EAF7EF;
    --ok-border: #B5E2C4;
    --ok-strong: #1F9D55;
    --ok-ink: #0E4F28;
    --warn: #A15C07;
    --warn-bg: #FFF7E6;
    --warn-border: #F6D49A;
    --warn-strong: #E8A317;
    --warn-ink: #4A2E05;
    --warn-hi: #FFD27A;
    --bad: #B42318;
    --bad-bg: #FDF1F0;
    --bad-border: #F4C7C2;
    --bad-strong: #D92D20;
    --bad-ink: #7A1810;
    --nav: #0F6E66;
    --nav-bg: #EBF8F6;
    --nav-border: #A7DDD5;
    --purple: #6B2F86;
    --purple-bg: #F5EEF9;
    --purple-border: #DCC6E8;
    --orange: #B54708;
    --orange-bg: #FFF3EA;
    --orange-border: #F7CDB0;
    /* Forma: sarkok, árnyékok (kártya, lenyíló, felugró ablak), mozgás. */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-1: 0 1px 2px rgba(18, 26, 44, 0.06), 0 1px 1px rgba(18, 26, 44, 0.03);
    --shadow-2: 0 4px 14px rgba(18, 26, 44, 0.08);
    --shadow-3: 0 18px 44px rgba(18, 26, 44, 0.2);
    --ease: 160ms ease;
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    /* A korábbi nevek (a lap sok helyen ezekre hivatkozik). */
    --ld-bg: var(--gray-50);
    --ld-surface: #FFFFFF;
    --ld-border: var(--gray-200);
    --ld-text: var(--gray-900);
    --ld-muted: var(--gray-600);
    --ld-link: var(--blue-700);
    --ld-primary: var(--blue-600);
    --ld-brand: var(--blue-900);
}

/* A gyökér 16 px marad (a munkalapok rem-ben megadott méretei erre épülnek); a 14 px-es alapszöveg a body-n van. */
html, body {
    margin: 0;
    background: var(--ld-bg);
    color: var(--ld-text);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body {
    font-size: 14px;
}

/* Egyforma széles számjegyek ott, ahol összegeket vetünk össze (munkalapok, számoszlop, számkártya): a Ft-oszlopok pontosan
   egymás alá kerülnek. Csak itt, mert az Inter ilyenkor a kötőjelet is kiszélesíti („E - mail”). */
.ws-grid,
input[data-money],
.stat dd,
.number {
    font-variant-numeric: tabular-nums;
}

/* Telefonon és érintőképernyőn nagyobb alapbetű. */
@media (max-width: 640px), (pointer: coarse) {
    body {
        font-size: 15px;
    }
}

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

button, input, select, textarea {
    font-family: inherit;
}

a {
    color: var(--ld-link);
    font-weight: 600;
}

a:hover {
    color: var(--ld-brand);
}

a:focus-visible,
button:focus-visible,
input[type="file"]:focus-visible,
.alert:focus {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

h1 {
    margin: 0;
    font-size: 22px;
    color: var(--ld-brand);
}

h1:focus {
    outline: none;
}

code {
    overflow-wrap: anywhere;
}

.brand {
    font-size: 24px;
    font-weight: 800;
    color: var(--ld-brand);
}

.card {
    width: 100%;
    max-width: 420px;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.muted {
    margin: 0;
    color: var(--ld-muted);
}

/* Űrlapok: a tervvászon belépő- és regisztrációs képernyői szerint. */
.form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field label {
    font-size: 14px;
    font-weight: 600;
}

/* 16 px, hogy iPhone-on a mezőre koppintva ne nagyítson rá a böngésző; a keret kontrasztja legalább 3:1. */
.field input {
    font: inherit;
    font-size: 16px;
    padding: 11px 12px;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
    color: var(--ld-text);
    background: var(--ld-surface);
}

.field input[aria-invalid="true"] {
    border: 2px solid var(--bad);
}

/* Kézzel írható dátum (DateInput): szövegmező, mellette naptárgomb; a böngésző dátummezője rejtve, csak a naptárát nyitjuk meg vele. */
.date-field {
    position: relative;
    display: flex;
    gap: 6px;
    min-width: 0;
}

.date-field input[data-date] {
    flex: 1;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.date-field-pick {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
    background: var(--ld-surface);
    color: var(--blue-700, #1D4ED8);
    cursor: pointer;
}

.date-field-pick:hover {
    background: var(--gray-50);
}

.date-field-pick:focus-visible {
    outline: 3px solid var(--blue-600);
    outline-offset: 2px;
}

/* A naptár a gomb alatt nyílik: a rejtett mező a gomb helyén, láthatatlanul (a showPicker csak megjelenített mezőn működik). */
.date-field .date-field-native {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 44px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.field-hint {
    font-size: 13px;
    font-weight: 400;
    color: var(--ld-muted);
}

.field-error {
    font-size: 13px;
    font-weight: 600;
    color: var(--bad-ink);
}

/* A kártya alji „Még nincs fiókod?” sora: kisebb betű, de legalább 44 px magas érintési cél a linkhez. */
.card > .muted {
    font-size: 14px;
}

.card > .muted a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    font-size: 14px;
}

.remember input {
    flex: none;
    width: 20px;
    height: 20px;
    margin: 0;
}

.button {
    min-height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--ld-primary);
    color: #FFFFFF;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.button:hover {
    background: var(--ld-brand);
}

.alert {
    margin: 0;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
}

.alert-error {
    background: var(--bad-bg);
    border: 1px solid var(--bad-border);
    color: var(--bad-ink);
}

/* Figyelmeztetés, ami nem hiba (pl. fogyó tartalékkódok): a tervvászon sárgás színeivel, hogy ne keveredjen a piros hibasávval. */
.alert-warning {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn);
}

.alert-info {
    background: var(--ok-bg);
    border: 1px solid var(--nav-border);
    color: var(--nav);
}

/* Belépés utáni oldal: cím és alatta a kártya(k), a tervvászon Biztonság képernyője szerint, felülről indulva.
   (A „page” nevet a MainLayout már használja, ezért saját név.) */
.app-page {
    width: 100%;
    max-width: 520px;
    align-self: flex-start;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.muted strong {
    color: var(--ld-text);
}

.page-title {
    font-size: 26px;
}

.card-wide {
    max-width: 520px;
}

.card p {
    margin: 0;
}

.card-title {
    margin: 0;
    font-size: 18px;
    color: var(--ld-brand);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.section-title {
    margin: 0;
    font-size: 16px;
    color: var(--ld-brand);
}

.pill {
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 3px 10px;
    background: var(--blue-50);
    color: var(--ld-muted);
}

.pill-on {
    background: var(--ok-bg);
    color: var(--nav);
}

.status-row {
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 14px;
}

.qr {
    width: 200px;
    height: 200px;
    align-self: center;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
}

/* A kulcs és a tartalékkódok: fix szélességű betű, hogy a hasonló jelek (0 és O) jól elkülönüljenek. */
.secret,
.recovery-codes {
    font-family: ui-monospace, Consolas, Menlo, monospace;
    font-weight: 600;
    letter-spacing: 0.06em;
    background: var(--ld-bg);
    border: 1px solid var(--ld-border);
    border-radius: 12px;
}

.secret {
    font-size: 15px;
    padding: 10px 12px;
    overflow-wrap: anywhere;
}

.recovery-codes {
    list-style: none;
    margin: 0;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 18px;
    font-size: 17px;
    text-align: center;
}

/* Egy kód soha ne törjön két sorba: kézzel átírva könnyű lenne összekeverni a feleket. */
.recovery-codes li {
    white-space: nowrap;
}

@media (max-width: 420px) {
    .recovery-codes {
        grid-template-columns: 1fr;
    }
}

.field input.code-input {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-align: center;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button-secondary {
    flex: 1 1 180px;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    background: var(--ld-surface);
    color: var(--ld-link);
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.button-secondary:hover {
    background: var(--blue-50);
}

.button-danger {
    color: var(--bad-ink);
    border-color: var(--bad-border);
}

.button-danger:hover {
    background: var(--bad-bg);
}

/* A telefon párosítása: jóváhagyás az ellenőrző kóddal, és a párosított telefonok listája. */
.approval {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.key-code {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--ld-brand);
    text-align: center;
    white-space: nowrap;
}

.button-wide {
    flex: 1 1 180px;
}

.device-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.device-text {
    flex: 1 1 200px;
    overflow-wrap: anywhere;
}

.device-dates {
    font-size: 13px;
    color: var(--ld-muted);
}

.device-row .button-secondary {
    flex: 0 0 auto;
}

/* Gombnak látszó link: a terv elsődleges gombja, legalább 44 px magas érintési céllal. */
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 12px;
    background: var(--ld-primary);
    color: #FFFFFF;
    font-weight: 700;
    text-decoration: none;
}

.button-link:hover {
    background: var(--ld-brand);
    color: #FFFFFF;
}

/* A rejtett elem akkor is rejtve maradjon, ha az osztálya megjeleníti (pl. a QR-rész kártyaként flex). */
[hidden] {
    display: none !important;
}

/* A belépőoldal: a jelszavas űrlap és mellette (keskeny képernyőn alatta) a QR-belépés, a tervvászon szerint. */
.sign-in {
    width: 100%;
    max-width: 860px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
}

.sign-in > .card {
    flex: 1 1 320px;
}

.qr-sign-in {
    align-items: center;
    text-align: center;
    background: var(--gray-25);
}

.qr-check {
    font-size: 15px;
}

.qr-check strong {
    font-size: 20px;
    color: var(--ld-brand);
    letter-spacing: 0.08em;
}

.qr-sign-in .button-secondary {
    flex: 0 0 auto;
    align-self: stretch;
}

/* Az ügynökök: széles oldal, kártyarács, avatarok, fülek és listák, a tervvászon 5. ütemének képernyői szerint. */
.wide-page {
    width: 100%;
    max-width: 1120px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.group-title {
    margin-bottom: 12px;
}

.agent-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
    gap: 16px;
}

.agent-card {
    height: 100%;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    text-decoration: none;
    color: var(--ld-text);
    font-weight: 400;
}

.agent-card:hover {
    border-color: var(--ld-primary);
    color: var(--ld-text);
}

.agent-name {
    font-size: 17px;
    color: var(--ld-brand);
}

.agent-title {
    font-size: 13px;
    color: var(--ld-muted);
}

.agent-counts {
    font-size: 13px;
    font-weight: 600;
    color: var(--ld-link);
}

.agent-log {
    font-size: 12px;
    color: var(--ld-muted);
}

.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--ld-brand);
}

.avatar-small {
    width: 56px;
    height: 56px;
}

.avatar-large {
    width: 112px;
    height: 112px;
    border: 3px solid var(--ld-border);
}

.avatar-huge {
    width: 150px;
    height: 150px;
    border: 4px solid var(--ld-surface);
    box-shadow: 0 0 0 1px var(--ld-border);
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--ld-border);
}

.tab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    color: var(--ld-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.tab[aria-current="page"] {
    color: var(--ld-brand);
    border-bottom-color: var(--ld-primary);
}

.list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.note-list,
.plain-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.note-item {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-decoration: none;
    color: var(--ld-text);
    font-weight: 400;
}

.note-item:hover {
    border-color: var(--ld-primary);
}

.note-item strong {
    color: var(--ld-brand);
}

.note-excerpt {
    overflow-wrap: anywhere;
}

.note-meta {
    font-size: 13px;
    color: var(--ld-muted);
}

.archived summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--ld-link);
    font-weight: 600;
}

.pre-line {
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.edit-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 18px;
    align-items: start;
}

.edit-columns .card {
    max-width: none;
}

.field textarea,
.field select,
.search-form input {
    font: inherit;
    font-size: 16px;
    padding: 11px 12px;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
    color: var(--ld-text);
    background: var(--ld-surface);
}

.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
    border: 2px solid var(--bad);
}

.field textarea {
    resize: vertical;
}

.avatar-choice {
    border: 0;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-choice legend {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
}

.avatar-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.avatar-option input {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* A kiválasztott avatar kerete: a kis rádiógomb egyedül nehezen látszik. */
.avatar-option:has(input:checked) img {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

.revisions {
    max-width: none;
}

.revision {
    border-top: 1px solid var(--ld-border);
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.revision-previous {
    color: var(--ld-text);
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-form input {
    flex: 1 1 260px;
}

.button-link-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* A Claude-kapcsoló: javaslatok, engedélyezés, élő frissítés (tervvászon, 6. ütem). */
.pill-warning {
    background: var(--warn-bg);
    color: var(--warn);
}

.proposals {
    max-width: none;
    border-color: var(--warn-border);
    background: var(--warn-bg);
}

.proposal {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    background: var(--ld-surface);
    border: 1px solid var(--warn-border);
    border-radius: 14px;
    padding: 12px 14px;
}

.proposal-text {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-wrap: anywhere;
}

.proposal .buttons .button,
.proposal .buttons .button-secondary {
    flex: 0 0 auto;
    padding: 0 16px;
}

.consent-list {
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    line-height: 1.7;
}

.secret-inline {
    overflow-wrap: anywhere;
}

.live-toast,
.live-banner {
    position: fixed;
    z-index: 10;
    right: 16px;
    left: auto;
    bottom: 16px;
    max-width: min(460px, calc(100vw - 32px));
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    box-shadow: 0 8px 24px rgba(7, 28, 70, 0.25);
}

.live-toast {
    background: var(--ld-brand);
    color: #FFFFFF;
    /* Nincs rajta gomb: ne fogja meg a mögötte lévő kattintást. */
    pointer-events: none;
}

/* A sáv alatt is látszódjon az oldal alja (pl. a Mentés gomb). */
body.has-live-banner {
    padding-bottom: 200px;
}

.proposal-body {
    font-size: 14px;
}

/* A kép balra, a szöveg mellette jobbra (hosszú szövegnél sem tör a kép alá). */
.live-toast {
    flex-wrap: nowrap;
}

.live-toast img {
    flex: none;
    width: 36px;
    height: 36px;
}

.live-toast span {
    flex: 1 1 auto;
    min-width: 0;
}

.live-banner {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    color: var(--warn);
}

.live-banner span {
    flex: 1 1 220px;
}

.live-banner .button-secondary {
    flex: 0 0 auto;
}

/* 7. ütem: az ügynök-sáv, az asztal és a napló, a tervvászon képernyői szerint. */
.status-work {
    color: var(--ok);
    font-weight: 600;
}

.status-wait {
    color: var(--warn);
    font-weight: 600;
}

/* Az állapot színe mindig szöveggel együtt jelenik meg; a pont csak segít. */
.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 0;
    box-sizing: border-box;
}

.dot-on {
    background: var(--ok-strong);
}

.dot-wait {
    background: var(--warn-strong);
}

.dot-off {
    background: var(--side-muted);
}

.dot-none {
    background: var(--ld-surface);
    border: 2px solid var(--side-muted);
}

.status-avatar {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
}

.status-avatar .status-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 14px;
    height: 14px;
    margin: 0;
    border: 2px solid var(--ld-surface);
}

.status-avatar .dot-none {
    background: var(--ld-border);
}

/* Az ügynökök a fő sávban, a menü alatt (egységes oldalsablon, 10. ütem): sötét háttéren világos szöveg. */
.agent-side-group {
    margin: 0 0 6px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--side-muted);
}

.agent-side-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.agent-side-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 4px 12px;
    border-radius: 10px;
    color: #FFFFFF;
    font-weight: 400;
    text-decoration: none;
}

.agent-side-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.agent-side-item[aria-current="page"] {
    background: var(--ld-primary);
}

.agent-side-item .avatar {
    width: 32px;
    height: 32px;
}

.agent-side-item .status-avatar .status-dot {
    border-color: var(--ld-brand);
}

.agent-side-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.agent-side-text strong {
    font-size: 14px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1.25;
}

.agent-side-status {
    font-size: 12px;
    color: var(--side-text);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-side-status.status-work {
    color: #8FE3B0;
}

.agent-side-status.status-wait {
    color: var(--warn-hi);
}

/* A kiválasztott (kék hátterű) ügynöknél fehér, hogy a kontraszt meglegyen; az állapotot a pont is jelzi. */
.agent-side-item[aria-current="page"] .agent-side-status {
    color: #FFFFFF;
}

/* A sötét sávon (és a telefonos felső sávon) a kék fókuszkeret nem látszana. Globálisan, mert az ügynökök linkjei
   külön komponensben vannak, és az elrendezés saját (hatókörös) stílusa nem érné el őket. */
.app-nav a:focus-visible,
.app-nav button:focus-visible,
.app-topbar a:focus-visible,
.app-topbar button:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 2px;
}

.agent-side-more {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
    color: var(--blue-100);
}

/* Egy bíráló oldalán a bírálók linkje mutatja, hol vagy. */
.agent-side-more[aria-current] {
    border-radius: 10px;
    background: var(--ld-primary);
    color: #FFFFFF;
}

.agent-side-more:hover {
    color: #FFFFFF;
}

.agent-state {
    font-size: 14px;
    font-weight: 600;
}

.desk {
    /* A csempék a tartalom (nem az ablak) szélességéhez igazodnak: az oldalsáv mellett, nagyított Windows-kijelzőn is. */
    container: desk / inline-size;
    width: 100%;
    max-width: 1180px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.desk-hello {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 16px;
}

.desk-hello .page-title {
    margin: 0;
}

.desk-summary {
    margin: 6px 0 0;
    font-size: 15px;
    color: var(--ld-muted);
}

.desk-date {
    font-size: 14px;
    font-weight: 600;
    color: var(--ld-muted);
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 999px;
    padding: 6px 14px;
}

.tiles {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 18px;
}

.tile {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 20px;
    padding: 18px 20px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(11, 46, 111, 0.06), 0 6px 18px rgba(11, 46, 111, 0.06);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.tile > * {
    max-width: 100%;
}

.tile-wide {
    grid-column: span 7;
}

.tile-side {
    grid-column: span 5;
}

.tile-third {
    grid-column: span 4;
}

.tile-title {
    margin: 0;
    font-size: 16px;
    color: var(--ld-brand);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tile-count {
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 9px;
    background: var(--warn-bg);
    color: var(--warn);
}

.tile p {
    margin: 0;
}

/* A csempe szöveges linkje is kényelmes érintési cél legyen. */
.tile > a:not(.button-link) {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

.tile-rows {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.tile-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--blue-50);
}

.tile-row:last-child {
    border-bottom: 0;
}

.tile-row .avatar {
    width: 36px;
    height: 36px;
}

.avatar-blank {
    display: inline-block;
    background: var(--ld-border);
}

.tile-row strong {
    display: block;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.tile-row small {
    display: block;
    font-size: 13px;
    color: var(--ld-muted);
    overflow-wrap: anywhere;
}

.tile-row time {
    font-size: 12px;
    color: var(--ld-muted);
    white-space: nowrap;
}

.tile-facts {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 14px;
    font-size: 14px;
}

.tile-facts dt {
    color: var(--ld-muted);
}

.tile-facts dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.fact-ok {
    color: var(--ok);
}

.fact-warn {
    color: var(--warn);
}

.timeline {
    gap: 0;
}

.timeline-day {
    margin: 12px 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ld-muted);
}

.timeline-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.timeline-item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid var(--blue-50);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.timeline-item time {
    color: var(--ld-muted);
    font-variant-numeric: tabular-nums;
}

.timeline-kind {
    font-size: 12px;
    font-weight: 700;
    color: var(--ld-link);
    margin-right: 6px;
}

@container desk (max-width: 820px) {
    .tile-wide,
    .tile-side {
        grid-column: span 12;
    }
}

@container desk (max-width: 640px) {
    .tile-third {
        grid-column: span 12;
    }
}

/* 8. ütem: a projektek (lista, idővonal, pénzügy), a tervvászon képernyői szerint. */
.pill-plan {
    background: var(--blue-50);
    color: var(--ld-link);
}

.project-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}

.project-card {
    height: 100%;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 18px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    color: var(--ld-text);
    font-weight: 400;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(11, 46, 111, 0.05);
}

.project-card:hover {
    border-color: var(--ld-primary);
    color: var(--ld-text);
}

.project-name {
    font-size: 18px;
    color: var(--ld-brand);
}

.project-summary {
    font-size: 14px;
    color: var(--ld-muted);
    line-height: 1.45;
}

.project-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    width: 100%;
    font-size: 13px;
    color: var(--ld-muted);
    border-top: 1px solid var(--blue-50);
    padding-top: 10px;
}

.project-facts strong {
    color: var(--ld-text);
}

.timeline-month {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ld-muted);
}

/* Függőleges idővonal: a pont színe a fajtát jelzi, de a fajta mindig szövegben is ott van. */
.project-timeline {
    list-style: none;
    margin: 0;
    padding: 0 0 0 26px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-timeline::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--ld-border);
}

.timeline-entry {
    position: relative;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    font-size: 14px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.timeline-entry::before {
    content: "";
    position: absolute;
    left: -24px;
    top: 18px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 3px solid var(--side-muted);
}

.timeline-milestone::before {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
}

.timeline-decision::before {
    border-color: var(--warn-strong);
}

.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: var(--ld-muted);
}

.timeline-meta .timeline-kind {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.timeline-title {
    font-size: 16px;
    color: var(--ld-brand);
}

.money-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 14px;
}

.money-box {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.money-box span {
    font-size: 12px;
    font-weight: 600;
    color: var(--ld-muted);
}

.money-box strong {
    font-size: 22px;
    color: var(--ld-brand);
    font-variant-numeric: tabular-nums;
}

.budget-meter {
    width: 100%;
    height: 10px;
}

.money-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
    gap: 0 12px;
}

.table-scroll {
    overflow-x: auto;
}

.money-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.money-table th {
    text-align: left;
    color: var(--ld-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 6px 8px;
    border-bottom: 1px solid var(--ld-border);
}

.money-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--blue-50);
    vertical-align: middle;
}

.money-table .number {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.money-in {
    color: var(--ok);
}

/* A sztornózott tétel áthúzva, halványan; a „Sztornózva” felirat is mondja (nem csak a stílus). */
.money-void td {
    color: var(--ld-muted);
    text-decoration: line-through;
}

.money-void td:last-child {
    text-decoration: none;
}

.link-button {
    min-height: 44px;
    border: 0;
    background: none;
    padding: 0 4px;
    color: var(--ld-link);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

.tile-half {
    grid-column: span 6;
}

.tile-row-plain {
    grid-template-columns: minmax(0, 1fr) auto;
}

.tile-row-side {
    font-size: 12px;
    color: var(--ld-muted);
    white-space: nowrap;
}

@container desk (max-width: 640px) {
    .tile-half {
        grid-column: span 12;
    }
}

/* Asztali nézet: a belépés utáni oldalakon a kártyák kitöltik a tartalom szélességét. A 420/520 px-es korlát a belépő- és
   a regisztrációs oldal keskeny kártyájáé; ott marad. */
.wide-page .card,
.app-page .card {
    max-width: none;
}

/* A mezők a széles kártyában se nyúljanak az egész sorra: így olvashatóbb. */
.wide-page .form > .field,
.app-page .form > .field {
    max-width: 760px;
}

.app-page {
    max-width: 1120px;
}

/* 9. ütem: képek (borító, Képek fül, bejegyzés képei), a tervvászon képernyői szerint. */
.project-cover {
    display: block;
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid var(--ld-border);
}

.project-card-cover {
    display: block;
    width: calc(100% + 40px);
    max-width: none;
    height: 130px;
    margin: -18px -20px 4px;
    object-fit: cover;
    border-radius: 18px 18px 0 0;
}

/* Borító nélkül halvány minta, hogy a kártyák egy magasságban induljanak. */
.project-card-blank {
    background: repeating-linear-gradient(135deg, var(--blue-50), var(--blue-50) 10px, var(--gray-50) 10px, var(--gray-50) 20px);
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upload-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* A „húzd ide vagy kattints” mező: a fájlválasztó átlátszóan, a mező teljes területén fekszik (js/dropzone.js). */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 20px;
    border: 2px dashed var(--blue-300);
    border-radius: 14px;
    background: var(--gray-50);
    text-align: center;
    color: var(--ld-text);
}

.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--ld-primary);
    background: var(--blue-50);
}

.dropzone:focus-within {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

.dropzone-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--ld-link);
}

.dropzone-link {
    color: var(--ld-link);
    font-weight: 700;
    text-decoration: underline;
}

.dropzone-hint {
    font-size: 14px;
    color: var(--ld-muted);
}

.dropzone-files {
    font-size: 14px;
    font-weight: 600;
    color: var(--ld-brand);
    overflow-wrap: anywhere;
}

.dropzone-files:empty {
    display: none;
}

.upload-row .muted {
    flex: 1 1 260px;
    font-size: 14px;
}

.image-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 14px;
}

.image-card {
    height: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    overflow: hidden;
    color: var(--ld-text);
    font-weight: 400;
    text-decoration: none;
}

.image-card:hover {
    border-color: var(--ld-primary);
    color: var(--ld-text);
}

.image-card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--ld-bg);
}

.image-caption {
    padding: 8px 10px 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.image-meta {
    padding: 2px 10px 10px;
    font-size: 12px;
    color: var(--ld-muted);
}

.image-card .pill {
    margin: 0 10px 10px;
    align-self: flex-start;
}

.image-full {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-full img {
    display: block;
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    border-radius: 14px;
    border: 1px solid var(--ld-border);
}

.entry-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.entry-thumbs img {
    display: block;
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 8px;
}

.thumb-list {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.thumb-list li {
    width: 120px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.thumb-list img {
    display: block;
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
}

/* 10. ütem: az egységes oldalsablon (tervvászon „Egységes oldalsablon”): morzsamenü, oldalfej, egy fő gomb jobb fent,
   számkártyák. A tartalom balra igazodik, és legfeljebb 1240 px széles. */
.wide-page,
.app-page {
    max-width: 1240px;
    gap: 20px;
}

.page-title {
    font-size: 28px;
    line-height: 1.2;
}

.crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--ld-muted);
}

.crumbs li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.crumbs li + li::before {
    content: "›" / "";
    color: var(--side-muted);
}

/* A morzsamenü linkjei is kényelmes érintési célok, de a sor ne legyen magas. */
.crumbs a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px 20px;
}

.page-head-text {
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
}

.lead {
    margin: 0;
    max-width: 760px;
    color: var(--ld-muted);
    overflow-wrap: anywhere;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.page-actions .button-link,
.page-actions .button-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* A kártya fejléce: cím balra, a folytatás linkje („Mind (12) →”) jobbra. */
.card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
}

/* Üres állapot: kártya egy egyszínű ikonnal, egy mondattal arról, mi kerül ide, és ha van, a gombbal. */
.empty-card {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--blue-50);
    color: var(--ld-muted);
}

.empty-text {
    margin: 0;
    max-width: 560px;
    color: var(--ld-muted);
}

.empty-action .button-secondary {
    flex: 0 0 auto;
}

/* Számkártyák az oldal tetején (pl. a projekt áttekintése). */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    margin: 0;
}

.stat {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat dt {
    font-size: 14px;
    color: var(--ld-muted);
}

.stat dd {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--ld-brand);
}

.stat small {
    font-size: 13px;
    font-weight: 400;
    color: var(--ld-muted);
}

.overview-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

@media (max-width: 1400px) {
    .overview-columns {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    }

    .overview-columns > :last-child {
        grid-column: 1 / -1;
    }
}

.overview-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.overview-thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.overview-thumbs img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
}

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

/* Telefonon a morzsamenü linkje is teljes értékű érintési cél. */
@media (max-width: 900px) {
    .crumbs a {
        min-height: 44px;
    }
}

/* 11. ütem: kompakt asztali elrendezés (tervvászon „Kompakt asztali elrendezés”). A projektlista táblázata, a nézetváltó,
   a legutóbbi bejegyzések listája; gépen (901 px fölött) kisebb térközök, egysoros oldalfej, a számok egy sávban.
   Telefonon minden marad, ahogy az egységes oldalsablon szerint volt (44 px-es érintési célok). */
.list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 16px;
    border-bottom: 1px solid var(--ld-border);
}

.list-bar .tabs {
    border-bottom: 0;
}

/* A keret legalább 3:1 a fehérhez; a sarkok a linkeken kerekek (nem overflow: hidden), hogy a fókuszkeret ne vágódjon le. */
.view-switch {
    display: inline-flex;
    margin-bottom: 6px;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
}

.view-switch a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    font-size: 14px;
    text-decoration: none;
}

.view-switch a:first-child {
    border-radius: 9px 0 0 9px;
}

.view-switch a:last-child {
    border-radius: 0 9px 9px 0;
}

.view-switch a[aria-current] {
    background: var(--ld-primary);
    color: #FFFFFF;
}

.data-box {
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ld-border);
    background: var(--gray-50);
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ld-muted);
    white-space: nowrap;
}

.data-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--blue-50);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table .number {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.data-table small {
    color: var(--ld-muted);
}

.data-table .pill + .pill {
    margin-left: 6px;
}

.project-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 220px;
}

.project-cell img,
.project-cell-blank {
    flex: none;
    width: 48px;
    height: 34px;
    border-radius: 6px;
    object-fit: cover;
    background: repeating-linear-gradient(135deg, var(--blue-50) 0 8px, var(--gray-50) 8px 16px);
}

.project-cell a {
    color: var(--ld-brand);
}

.project-cell small {
    display: block;
}

.budget-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.budget-cell .budget-meter {
    width: 72px;
}

.recent-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.recent-list li {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-top: 1px solid var(--blue-50);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.recent-list li:first-child {
    border-top: 0;
    padding-top: 0;
}

.recent-list time {
    font-size: 13px;
    color: var(--ld-muted);
}

.recent-list .timeline-kind {
    display: block;
}

/* A kártyák a halvány háttéren egy finom árnyékkal válnak el (a keret egymagában beleolvadna). */
.card,
.tile,
.stat,
.empty-card,
.data-box,
.project-card {
    box-shadow: 0 1px 3px rgba(16, 32, 63, 0.08);
}

/* Gépen kompakt: kisebb térközök és gombok, egysoros oldalfej, a számok egy sávban, sűrűbb sáv. */
@media (min-width: 901px) {
    /* Gépen a tartalom kitölti a teljes munkaterületet (az éles próbán kérve); a hosszú szövegeket a saját szabályuk
       (pl. .lead, a mezők) tartja olvasható szélességen. */
    .wide-page,
    .app-page,
    .desk {
        max-width: none;
        gap: 12px;
    }

    /* Az űrlapok gombsora a mezőkkel egy szélességen marad, ne nyúljon a teljes munkaterületre. */
    .wide-page .form > .buttons,
    .wide-page .form > .button,
    .app-page .form > .buttons,
    .app-page .form > .button {
        max-width: 760px;
    }

    .page-title {
        font-size: 22px;
    }

    .page-head {
        align-items: center;
        gap: 10px 16px;
    }

    .page-head-text {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 2px 14px;
    }

    .lead {
        font-size: 14px;
    }

    .crumbs ol {
        font-size: 13px;
    }

    .crumbs a {
        min-height: 28px;
    }

    .button,
    .button-link,
    .button-secondary,
    .view-switch a {
        min-height: 38px;
        font-size: 14px;
        border-radius: 10px;
    }

    .button-link,
    .button-secondary {
        padding: 0 14px;
    }

    .tab {
        min-height: 38px;
        font-size: 14px;
        padding: 0 12px;
    }

    .card,
    .tile {
        padding: 14px 16px;
        gap: 10px;
        border-radius: 12px;
    }

    .card-title {
        font-size: 16px;
    }

    .overview-columns,
    .overview-side {
        gap: 12px;
    }

    .empty-card {
        padding: 20px;
    }

    .dropzone {
        padding: 20px;
    }

    /* A számok egyetlen kártyában, jól látható elválasztókkal: négy oszlop (1100 px alatt kettő, lásd lent). A belső
       mezők nem takarhatják el a kártya kerek sarkait (nincs bennük kattintható elem, így a levágás nem rejt fókuszt). */
    .stat-row {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0;
        background: var(--ld-surface);
        border: 1px solid var(--ld-border);
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 1px 3px rgba(16, 32, 63, 0.08);
    }

    .stat-row .stat {
        box-shadow: none;
        border: 0;
        border-left: 1px solid var(--ld-border);
        border-radius: 0;
        padding: 10px 16px;
    }

    .stat-row .stat:first-child {
        border-left: 0;
    }

    .stat dt {
        font-size: 12px;
    }

    .stat dd {
        font-size: 18px;
    }

    .agent-side-item {
        min-height: 38px;
        padding: 3px 10px;
        gap: 8px;
    }

    .agent-side-item .avatar {
        width: 24px;
        height: 24px;
    }

    .agent-side-item .status-avatar .status-dot {
        width: 10px;
        height: 10px;
    }

    .agent-side-text strong {
        font-size: 13px;
    }

    .agent-side-status {
        font-size: 11px;
    }

    .agent-side-group,
    .agent-side-more {
        padding: 0 10px;
    }

    .agent-side-more {
        min-height: 36px;
        font-size: 12px;
    }

    /* Alapnézetben (?nezet= nélkül) gépen a táblázat látszik, telefonon a kártyák. */
    .only-narrow {
        display: none;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .stat-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stat-row .stat:nth-child(odd) {
        border-left: 0;
    }

    .stat-row .stat:nth-child(n + 3) {
        border-top: 1px solid var(--ld-border);
    }
}

@media (max-width: 900px) {
    .only-wide {
        display: none;
    }
}

/* 12. ütem: a napló (Ügynökök › Napló) és a rajztábla (tervvászon „12. ütem: Napló és rajztábla”). */
.quick-entry {
    gap: 8px;
}

.quick-entry-label {
    font-weight: 700;
    color: var(--ld-brand);
}

.quick-entry-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-entry-row input {
    flex: 1 1 320px;
    min-height: 44px;
    box-sizing: border-box;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
    padding: 0 12px;
    font: inherit;
}

.quick-entry-row .button,
.quick-entry-row .button-secondary {
    flex: 0 0 auto;
    padding: 0 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.quick-entry-hint {
    font-size: 13px;
}

.journal-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--gray-400);
    border-radius: 999px;
    background: var(--ld-surface);
    font-size: 14px;
    text-decoration: none;
}

.chip[aria-current] {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: #FFFFFF;
}

.journal-bar .search-form {
    flex: 0 1 420px;
}

.journal-day {
    margin: 4px 0 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ld-muted);
}

.journal-feed {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
    gap: 12px;
}

.journal-entry {
    height: 100%;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(16, 32, 63, 0.08);
}

.journal-entry h3 {
    margin: 0 0 4px;
    font-size: 16px;
    overflow-wrap: anywhere;
}

.journal-entry h3 a {
    color: var(--ld-brand);
}

.journal-body {
    margin: 0;
    font-size: 14px;
    color: var(--gray-700);
    white-space: pre-line;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.journal-thumb {
    display: block;
    width: 160px;
    align-self: start;
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--ld-surface);
}

.sketch-svg {
    display: block;
    width: 100%;
    height: auto;
}

.journal-edit {
    display: grid;
    grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.journal-edit > .card {
    max-width: none;
}

.sketch {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sketch-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background: var(--gray-50);
}

.sketch-tools[hidden] {
    display: none;
}

.sketch-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ld-text);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.sketch-tool:hover {
    background: var(--blue-50);
}

.sketch-tool[aria-pressed="true"] {
    background: var(--ld-primary);
    color: #FFFFFF;
}

.sketch-sep {
    width: 1px;
    height: 28px;
    margin: 0 4px;
    background: var(--ld-border);
}

/* A színgomb 44 px-es érintési cél; a színt a belső kör mutatja, a kijelöltet a sötét gyűrű (és az aria-pressed). */
.sketch-color {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sketch-color::before {
    content: "";
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid #FFFFFF;
    box-shadow: 0 0 0 1px var(--gray-400);
    background: var(--swatch);
}

.sketch-color[aria-pressed="true"]::before {
    box-shadow: 0 0 0 3px var(--ld-text);
}

.sketch-color-0 { --swatch: var(--blue-700); }
.sketch-color-1 { --swatch: var(--orange); }
.sketch-color-2 { --swatch: var(--ok); }
.sketch-color-3 { --swatch: var(--gray-900); }

.sketch-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

.sketch-label[hidden] {
    display: none;
}

.sketch-label input {
    min-height: 38px;
    width: 260px;
    max-width: 60vw;
    border: 1px solid var(--gray-400);
    border-radius: 8px;
    padding: 0 10px;
    font: inherit;
    font-size: 14px;
}

.sketch-paper {
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background-color: #FFFFFF;
    background-image: radial-gradient(var(--blue-100) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Rajzoláskor az ujj ne görgesse az oldalt. */
.sketch-svg.is-live {
    touch-action: none;
    cursor: crosshair;
}

.sketch-hint[hidden],
.sketch-nojs[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .journal-edit {
        grid-template-columns: minmax(0, 1fr);
    }

    .journal-thumb {
        width: 110px;
    }
}

/* 13. ütem: Munka – a megbízók kártyái (Áttekintés) és a Beállítások (tervvászon „13. ütem: Munka – megbízók”). */
.client-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 16px;
}

.client-card {
    height: 100%;
    min-height: 360px;
    box-sizing: border-box;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    color: var(--ld-text);
    font-weight: 400;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(16, 32, 63, 0.08);
}

.client-card:hover {
    border-color: var(--blue-300);
    color: var(--ld-text);
}

.client-card-head {
    display: flex;
    align-items: center;
    gap: 20px;
}

.client-card-head > span:last-child {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.client-card-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--ld-brand);
    overflow-wrap: anywhere;
}

.client-card-soon {
    flex: 1;
    border: 1px dashed var(--gray-300);
    border-radius: 12px;
    background: var(--gray-50);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 18px;
    text-align: center;
    font-size: 14px;
    color: var(--ld-muted);
}

.client-card-soon strong {
    color: var(--ld-text);
}

.client-card-foot {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--ld-link);
}

.client-logo {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    object-fit: contain;
    background: #FFFFFF;
    border: 1px solid var(--ld-border);
}

.client-initials {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: #FFFFFF;
    font-weight: 800;
}

.client-logo-large {
    width: 120px;
    height: 120px;
    font-size: 36px;
}

.client-logo-small {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    font-size: 14px;
}

.client-logo-preview {
    width: 140px;
    height: 140px;
    font-size: 40px;
}

.client-settings {
    display: grid;
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.client-list {
    padding: 6px;
    gap: 2px;
}

.client-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 6px 10px;
    border-radius: 10px;
    color: var(--ld-text);
    font-weight: 400;
    text-decoration: none;
}

.client-row:hover {
    background: var(--gray-50);
    color: var(--ld-text);
}

.client-row[aria-current] {
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-300);
}

.client-row strong,
.client-row small {
    display: block;
    overflow-wrap: anywhere;
}

.client-row small {
    font-size: 12px;
    color: var(--ld-muted);
}

/* Az archivált megbízó logója halványabb; a szöveg nem, hogy olvasható maradjon (a sor felirata mondja, hogy archivált). */
.client-row-archived .client-logo {
    opacity: 0.6;
}

.client-list-label {
    margin: 8px 10px 2px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ld-muted);
}

.client-detail {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo-edit {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

@media (max-width: 900px) {
    .client-settings,
    .logo-edit {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-card {
        min-height: 0;
    }

    .client-logo-large {
        width: 84px;
        height: 84px;
        font-size: 26px;
    }
}

/* 14. ütem: a megbízó adószáma és székhelye (kártya, űrlap). */
.client-facts {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 6px;
    font-size: 14px;
    color: var(--gray-700);
    overflow-wrap: anywhere;
}

.client-facts b {
    color: var(--ld-text);
    font-weight: 600;
}

.field input.input-short {
    max-width: 240px;
}

.client-address {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 10px 12px;
    max-width: 560px;
}

.client-address legend {
    font-size: 14px;
    font-weight: 700;
    padding: 0;
    margin-bottom: 6px;
}

.client-address-wide {
    grid-column: 1 / -1;
}

@media (max-width: 480px) {
    .client-address {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 15. ütem: a megbízók ügyfelei (lista, adatlap, űrlap) és a megbízó kártyájának ügyfélszáma. */
.client-card {
    position: relative;
}

/* A név linkje kifeszül a kártyára (az egész kártya kattintható); a fókusz a kártya körül látszik. */
.client-card-link {
    text-decoration: none;
}

.client-card-link::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 16px;
}

.client-card-link:focus-visible {
    outline: none;
}

.client-card-link:focus-visible::after {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

.client-card-customers {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    min-height: 44px;
}

.required-mark {
    font-weight: 400;
    color: var(--ld-muted);
}

.address-list-archived li {
    color: var(--ld-muted);
}

.nowrap {
    white-space: nowrap;
}

.customer-name {
    font-weight: 700;
    color: var(--ld-brand);
    text-decoration: none;
}

.customer-full {
    display: block;
    font-size: 12px;
    color: var(--ld-muted);
}

.customer-cards {
    list-style: none;
    margin: 0;
    padding: 0;
}

.customer-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ld-surface);
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--ld-text);
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(16, 32, 63, 0.08);
}

.customer-card strong {
    font-size: 17px;
    color: var(--ld-brand);
}

.customer-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
}

.customer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.customer-wide {
    grid-column: span 2;
}

.facts {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 6px 12px;
    margin: 0;
    font-size: 14px;
}

.facts dt {
    color: var(--ld-muted);
}

.facts dd {
    margin: 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.address-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.address-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--ld-border);
    overflow-wrap: anywhere;
}

.address-list li:first-child {
    border-top: 0;
}

/* A sor gombjai csak akkorák, amekkora a szövegük (nem nyúlnak szét a sorban). */
.address-actions {
    display: flex;
    gap: 8px;
    flex: none;
}

.address-actions .button-small,
.address-add > summary {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

.address-period {
    display: block;
    font-size: 13px;
    color: var(--ld-muted);
}

/* Az új cím űrlapja alapból csukva: a „+ Cím hozzáadása” gomb nyitja le. */
.address-add {
    border-top: 1px solid var(--ld-border);
    padding-top: 12px;
}

.address-add > summary {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    cursor: pointer;
    list-style: none;
    width: auto;
}

.address-add > summary::-webkit-details-marker {
    display: none;
}

.address-add[open] > summary {
    margin-bottom: 12px;
}

.address-add .address-form {
    border-top: 0;
    padding-top: 0;
}

.address-fields > .address-date {
    flex: 0 0 200px;
}

.address-list small {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--ld-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.address-form {
    border-top: 1px solid var(--ld-border);
    padding-top: 12px;
}

.card-subtitle {
    margin: 0;
    font-size: 15px;
    color: var(--ld-brand);
}

/* A címkék egy sorban maradnak (a „(kötelező)” sem tör), így a mezők egy vonalban állnak; ha nincs elég hely, a
   település a következő sorba kerül (a kártya keskeny gépi ablakban is a kétharmad szélesség). */
.address-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 12px;
    align-items: flex-start;
}

.address-fields > .field {
    flex: 0 0 180px;
}

.address-fields > .field:nth-child(2) {
    flex-basis: 200px;
}

.address-fields > .field:nth-child(3) {
    flex: 1 1 220px;
}

.address-fields > .address-street {
    flex: 1 1 100%;
}

.address-fields label {
    white-space: nowrap;
}

.button-small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.customer-form fieldset {
    border: 0;
    border-top: 1px solid var(--ld-border);
    margin: 0;
    padding: 14px 0 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
}

.customer-form fieldset:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.customer-form legend {
    font-size: 15px;
    font-weight: 800;
    color: var(--ld-brand);
    padding: 0;
    margin-bottom: 8px;
}

.customer-form-wide {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    /* A kártyák csak keskenyen látszanak (only-narrow); a megjelenítés itt, hogy gépen a rejtés érvényes maradjon. */
    .customer-cards {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .customer-grid,
    .customer-form fieldset {
        grid-template-columns: minmax(0, 1fr);
    }

    .address-fields > .field:nth-child(n) {
        flex: 1 1 100%;
    }

    .customer-wide {
        grid-column: auto;
    }

    .button-small {
        min-height: 44px;
    }

    .facts {
        grid-template-columns: minmax(0, 1fr);
    }

    .facts dd {
        margin-bottom: 6px;
    }
}

/* Kattintásra a vágólapra másolt érték (js/masolas.js): szövegnek látszik, a másolás után egy pillanatra „Másolva”. */
.copy-value {
    position: relative;
    border: 0;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: copy;
    user-select: text;
}

.copy-value:hover {
    background: var(--blue-50);
}

/* A jelzés a szöveg mellett jobbra (egy táblázat első sorában fölötte levágná a görgethető doboz). */
.copy-value.is-copied::after {
    content: "Másolva";
    position: absolute;
    left: calc(100% + 6px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--ld-brand);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* 16. ütem: a profil (a menü alján a kép, a név és a jog; a Profil oldal). */
.profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 6px 12px;
    border-radius: 10px;
    color: #FFFFFF;
    text-decoration: none;
}

.profile-badge:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

/* A profil-sor a Profil és a Biztonság menüpontja: ha ott vagy, kiemelt, mint a többi aktuális menüpont. */
.profile-badge[aria-current] {
    background: var(--ld-primary);
    color: #FFFFFF;
}

/* A kék háttéren a jog sora és a fókuszjel is fehér (a szürke és a kék keret nem látszana). */
.profile-badge[aria-current] .profile-badge-text span {
    color: #FFFFFF;
}

.profile-badge:focus-visible {
    outline-color: #FFFFFF;
}

.profile-badge-image {
    flex: none;
    width: 36px;
    height: 36px;
}

.profile-badge-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.profile-badge-text strong {
    font-size: 14px;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.profile-badge-text span {
    font-size: 12px;
    color: var(--side-text);
}

.profile-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--blue-500);
    color: #FFFFFF;
    font-weight: 800;
    font-size: 13px;
}

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
    max-width: 1100px;
}

.profile-photo {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    font-size: 38px;
}

@media (max-width: 900px) {
    /* Telefonon a másolható érték is akkora érintési cél, mint egy gomb. */
    .copy-value {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        margin: 0 -4px;
    }

    .profile-grid,
    .profile-photo {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* A másolás értesítése (js/masolas.js) az ügynökökéhez hasonló; ha nem sikerült, piros. */
.copy-toast-error {
    background: var(--bad-ink);
}

/* 17. ütem: a Profil áttekintő (összefoglaló kártya és csempék, az OptiDesk mintájára). */
.profile-summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.profile-summary-image {
    flex: none;
    width: 56px;
    height: 56px;
    font-size: 20px;
}

.profile-summary-who {
    flex: 1 1 260px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.profile-summary-who strong {
    font-size: 18px;
    color: var(--ld-brand);
    overflow-wrap: anywhere;
}

.profile-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--ld-muted);
    overflow-wrap: anywhere;
}

.profile-stats {
    display: flex;
    margin: 0;
}

.profile-stats div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 18px;
    border-left: 1px solid var(--ld-border);
}

.profile-stats dt {
    font-size: 12px;
    font-weight: 600;
    color: var(--ld-muted);
}

.profile-stats dd {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.profile-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.profile-tile {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-tile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    color: var(--ld-brand);
}

.profile-tile-head .pill {
    margin-left: auto;
}

.profile-tile-icon {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--blue-50);
    color: var(--ld-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-kv {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
}

.profile-kv div {
    display: flex;
    gap: 12px;
}

.profile-kv dt {
    flex: 0 0 96px;
    color: var(--ld-muted);
}

.profile-kv dd {
    margin: 0;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
}

.profile-tile-foot {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--ld-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.profile-tile-foot .button-small {
    flex: 0 0 auto;
}

@media (max-width: 1100px) {
    .profile-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .profile-tiles {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-stats {
        width: 100%;
    }

    .profile-stats div:first-child {
        border-left: 0;
        padding-left: 0;
    }
}

/* 17. ütem utójavítás: a Biztonság oldal az egységes sablon szerint (két kártya egymás mellett, tömör űrlapok). */
.security-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.security-grid > .card {
    max-width: none;
}

.security-wide {
    grid-column: 1 / -1;
}

/* A mezők és a gombok csak akkorák, amekkora kell (ne nyúljanak a kártya teljes szélességére). */
.security-grid .field {
    max-width: 360px;
}

.security-grid .buttons > .button-secondary,
.security-grid .form > .button,
.security-grid .buttons > .button {
    flex: 0 0 auto;
    align-self: flex-start;
    min-height: 44px;
    padding: 0 18px;
}

.security-fact {
    font-size: 14px;
}

.security-history {
    font-size: 14px;
}

.security-history > summary {
    cursor: pointer;
    color: var(--ld-link);
    font-weight: 600;
    min-height: 32px;
    display: flex;
    align-items: center;
}

.security-history[open] > summary {
    margin-bottom: 8px;
}

.security-history .device-row + .device-row {
    margin-top: 8px;
}

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

    .security-grid .field {
        max-width: none;
    }
}

/* 18. ütem: bankszámlák és tevékenységek (a címek kártyájának mintájára). */
.address-fields > .address-wide-field {
    flex: 1 1 300px;
}

/* A jelölőnégyzet szövege tördelhető (a címkék nowrap-ja keskeny képernyőn kilógna), a négyzet fent marad. */
.address-fields > .check-field {
    white-space: normal;
}

.address-fields > .field.detail-short-field {
    flex: 0 0 160px;
}

.address-fields > .field.detail-grow-field {
    flex: 1 1 220px;
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    min-height: 44px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.check-field input {
    width: 20px;
    height: 20px;
}

@media (max-width: 900px) {
    .address-fields > .field.detail-short-field,
    .address-fields > .field.detail-grow-field {
        flex: 1 1 100%;
    }
}

/* Az ügyfél adatlapja két hasábban: balra a listák, jobbra az adatok kártyái; a két hasáb egymástól függetlenül nő. */
.customer-columns {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.customer-main,
.customer-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

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

/* Az ügyfél összefoglaló sávja (Adatlap, Díjazás, Kommunikáció fölött): négy cella, mind a saját fülére visz; telefonon 2×2. */
/* Oszlopokban telik: három cellánál (átvilágítás nélkül) sem marad üres negyedik oszlop. */
.customer-summary {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-surface);
    overflow: hidden;
}

.customer-summary li + li {
    border-left: 1px solid var(--ld-border);
}

.customer-summary a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 44px;
    height: 100%;
    padding: 10px 14px;
    color: inherit;
    text-decoration: none;
}

.customer-summary a:hover {
    background: var(--gray-25);
}

.customer-summary span {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    color: var(--gray-600);
}

.customer-summary b {
    font-size: 16px;
    font-variant-numeric: tabular-nums;
    color: var(--gray-900);
    overflow-wrap: anywhere;
}

.customer-summary small {
    font-size: 12px;
    color: var(--gray-600);
}

.customer-summary a.is-warn b {
    color: var(--warn);
}

@media (max-width: 640px) {
    .customer-summary {
        grid-auto-flow: row;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .customer-summary li:nth-child(odd) {
        border-left: 0;
    }

    .customer-summary li:nth-child(n + 3) {
        border-top: 1px solid var(--ld-border);
    }
}

/* Az összevont adatkártyák (Cégadatok, Elérhetőség és címek) szakaszai: kis cím, vékony elválasztó. */
.customer-data .customer-data-sub {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--ld-border);
    font-size: 14px;
}

/* A kártyacím alatti első szakasz nem kezdődik vonallal. */
.customer-data .card-title + .customer-data-sub {
    margin-top: 4px;
    padding-top: 0;
    border-top: 0;
}

/* A Díjazás fül „Idő és óradíj” diagramjai (SVG, a szerver rajzolja): óradíj vonallal és szaggatott célvonallal, a részem oszlopokkal.
   A hónap oszlopa rávitt egérrel vagy fókuszban mutatja a hónap adatait (a CSP miatt minden szín és méret osztályból). */
.tc-cap {
    margin: 4px 0 2px;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.tc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin: 0 0 4px;
    color: var(--gray-600);
    font-size: 12px;
}

.tc-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tc-key-line,
.tc-key-target {
    display: inline-block;
    width: 16px;
    height: 0;
    border-top: 2px solid var(--blue-600);
}

.tc-key-target {
    border-top: 2px dashed var(--gray-500);
}

.tc-key-bad {
    color: var(--bad);
}

.tc-chart {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Keskeny képernyőn a diagram nem zsugorodik olvashatatlanra: legalább 520 px széles, a doboza vízszintesen görget. */
.tc-scroll {
    overflow-x: auto;
}

@media (max-width: 600px) {
    .tc-chart {
        min-width: 520px;
    }
}

.tc-grid {
    stroke: var(--gray-100);
}

.tc-axis {
    fill: var(--gray-500);
    font-size: 10.5px;
}

.tc-target {
    stroke: var(--gray-500);
    stroke-width: 1.5;
    stroke-dasharray: 5 4;
}

.tc-line {
    fill: none;
    stroke: var(--blue-600);
    stroke-width: 2;
    stroke-linejoin: round;
}

.tc-dot {
    fill: var(--blue-600);
    stroke: var(--ld-surface);
    stroke-width: 2;
}

.tc-dot.is-bad {
    fill: var(--bad);
}

.tc-value {
    fill: var(--blue-900);
    font-size: 11px;
    font-weight: 700;
}

.tc-value.is-bad {
    fill: var(--bad);
}

.tc-bar {
    fill: var(--blue-600);
}

.tc-bar.is-idle {
    fill: var(--blue-200);
}

.tc-hit {
    fill: transparent;
}

.tc-col {
    outline: none;
}

.tc-tip {
    display: none;
    pointer-events: none;
}

.tc-col:hover .tc-tip,
.tc-col:focus-within .tc-tip {
    display: inline;
}

.tc-col:focus-within .tc-hit {
    stroke: var(--blue-600);
    stroke-width: 2;
}

.tc-cross {
    stroke: var(--gray-500);
    stroke-dasharray: 2 3;
}

.tc-tip-box {
    fill: var(--gray-900);
}

.tc-tip-head {
    fill: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
}

.tc-tip-text {
    fill: #D6DCE8;
    font-size: 10.5px;
}

.tc-note,
.tc-empty {
    margin: 6px 0 8px;
    color: var(--gray-600);
    font-size: 12px;
}

.tc-empty {
    padding: 10px 12px;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    background: var(--gray-25);
}

.tc-muted {
    color: var(--gray-500);
}

/* A csomag fajtája a csomag neve mellett. */
.fee-head .pkg-kind {
    margin-left: 8px;
    vertical-align: 2px;
}

/* A Díjazás és a Kommunikáció fül: a két kártya egymás mellett, keskenyebb ablakban egymás alatt. */
.customer-tab-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

@media (max-width: 1100px) {
    .customer-tab-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Munka › Beállítások alfülei (19. ütem): kisebb, gömbölyű gombok a fülsor alatt. */
.subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.subtab {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--ld-border);
    border-radius: 999px;
    background: var(--ld-surface);
    text-decoration: none;
}

.subtab[aria-current="page"] {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: #FFFFFF;
}

.code-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.code-search input {
    flex: 1 1 220px;
    min-width: 0;
    font: inherit;
    font-size: 16px;
    padding: 11px 12px;
    border: 1px solid var(--gray-400);
    border-radius: 10px;
    color: var(--ld-text);
    background: var(--ld-surface);
}

.code-search .button-secondary {
    flex: 0 0 auto;
}

.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    color: var(--ld-muted);
}

.code-paste {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.875rem;
}

.code-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
}

.code-skipped {
    margin: 6px 0 0;
    padding-left: 18px;
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
}

/* A tevékenység és a kódlista űrlapja rácsban: a kód mellett a hosszú (KSH-) megnevezés kitölti a sort, alatta a dátumok. */
.address-fields.activity-fields {
    display: grid;
    grid-template-columns: 200px 200px minmax(0, 1fr);
}

.activity-fields > .address-wide-field {
    grid-column: 2 / -1;
}

.activity-fields > .address-street {
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .address-fields.activity-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    .activity-fields > .address-wide-field {
        grid-column: auto;
    }
}

/* Telefonon a kódlista kis gombjai is elérik a 44 px-es érintési célt. */
@media (max-width: 600px) {
    .pager .button-small,
    .data-table .button-small {
        min-height: 44px;
    }
}

/* Élő ajánlás a mező alatt (a tevékenység kódja és megnevezése): a lista a mező alá nyílik, a többi tartalom fölé. */
.suggest-box {
    position: relative;
}

.suggest-box > input {
    width: 100%;
    box-sizing: border-box;
}

.suggest-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 20;
    width: max-content;
    min-width: 100%;
    max-width: min(36rem, calc(100vw - 32px));
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    background: var(--ld-surface);
    box-shadow: 0 6px 18px rgba(16, 32, 63, 0.16);
}

.suggest-list[hidden] {
    display: none;
}

.suggest-list li {
    display: flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
    padding: 6px 12px;
    font-weight: 400;
    white-space: normal;
    cursor: pointer;
}

.suggest-list li strong {
    color: var(--ld-brand);
    margin-right: 6px;
}

.suggest-list li:hover,
.suggest-list li[aria-selected="true"] {
    background: var(--blue-100);
}

/* A kiválasztott sort nem csak a szín jelzi (színvakon, nagy kontrasztú módban is látszik). */
.suggest-list li[aria-selected="true"] {
    box-shadow: inset 3px 0 0 var(--ld-primary);
}

/* Telefonon a lista a mező szélességén marad (ne lógjon ki a képernyőről), a hosszú megnevezés tördelődik. */
@media (max-width: 600px) {
    .suggest-list {
        right: 0;
        width: auto;
        max-width: 100%;
    }
}

/* Az adónem űrlapja (21. ütem): a kiegészítők keretben, rácsban; a rejtett mező (hidden) tényleg eltűnik. */
.tax-extras {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 14px;
    margin: 0;
    padding: 10px 14px 12px;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
}

.tax-extras legend {
    padding: 0 4px;
    font-weight: 700;
    color: var(--ld-brand);
}

.tax-extras select,
.tax-extras input:not([type="checkbox"]) {
    width: 100%;
    box-sizing: border-box;
}

.tax-extras > .check-field {
    align-self: end;
    white-space: normal;
}

.tax-fields [hidden],
.tax-extras[hidden] {
    display: none;
}

.tax-warning {
    color: var(--warn);
}

/* Telefonon a kártyák kis gombjai és a lenyitó gomb is elérik a 44 px-es érintési célt. */
@media (max-width: 600px) {
    .address-actions .button-small,
    .address-add > summary {
        min-height: 44px;
    }
}

/* A keskeny jobb hasábban (pl. a Címek kártya) a két dátum egymás mellett fér el. */
.customer-side .address-fields > .address-date {
    flex: 1 1 140px;
    min-width: 0;
}

.customer-side .address-fields > .address-date input {
    width: 100%;
    box-sizing: border-box;
}

/* Felugró ablak a „+ … hozzáadása” űrlapokhoz (ModalForm): középen, elsötétített háttér előtt, rövid beúszással. */
.modal {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: var(--ld-surface);
    color: var(--ld-text);
    box-shadow: 0 24px 60px rgba(11, 46, 111, 0.28);
    overflow: auto;
}

.modal::backdrop {
    background: rgba(11, 46, 111, 0.38);
    backdrop-filter: blur(2px);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 20px 20px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-title {
    margin: 0;
    font-size: 18px;
    color: var(--ld-brand);
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 26px;
    line-height: 1;
    color: var(--ld-muted);
    text-decoration: none;
}

.modal-close:hover {
    background: var(--ld-bg);
    color: var(--ld-brand);
}

.modal[open] {
    animation: modal-in 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal[open]::backdrop {
    animation: modal-fade-in 200ms ease-out;
}

.modal.closing {
    animation: modal-out 150ms ease-in forwards;
}

.modal.closing::backdrop {
    animation: modal-fade-out 150ms ease-in forwards;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
}

@keyframes modal-out {
    to {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
}

@keyframes modal-fade-out {
    to {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal[open],
    .modal[open]::backdrop,
    .modal.closing,
    .modal.closing::backdrop {
        animation: none;
    }
}

/* Telefonon alulról, teljes szélességben. */
@media (max-width: 600px) {
    .modal {
        width: 100vw;
        max-width: 100vw;
        max-height: calc(100vh - 24px);
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
    }
}

.modal-opener {
    align-self: flex-start;
    flex: 0 0 auto;
}

/* Az ablakban a mezők nem lehetnek szélesebbek nála (a hosszú adónem-nevek miatt a választó kinyúlna). */
.modal .field {
    min-width: 0;
}

.modal select,
.modal input,
.modal textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/* A megerősítő ablak (pl. Archiválás): keskenyebb, a szöveg és két gomb. */
.modal-confirm {
    width: min(460px, calc(100vw - 32px));
}

.modal-text {
    margin: 0;
    color: var(--ld-text);
}

.button-confirm {
    background: var(--bad);
    border-color: var(--bad);
}

.button-confirm:hover {
    background: var(--bad-ink);
    border-color: var(--bad-ink);
}

/* Az ügyfél szerkesztő űrlapja fülekre bontva: a fülsor az űrlap kártyája fölött, a kártya nem nyúlik a teljes szélességre. */
.form-tabs {
    max-width: 980px;
}

.customer-form {
    max-width: 980px;
}

.tab-errors {
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--bad-bg);
    color: var(--bad-ink);
    font-size: 12px;
    font-weight: 700;
}

/* Ha a fülek működnek (a szkript jelzi), egyszerre egy szakasz látszik, a szakaszcím (a fül neve) nélkül. */
.customer-form.has-tabs fieldset[data-section] {
    border-top: 0;
    padding-top: 0;
}

.customer-form.has-tabs fieldset[data-section] > legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.customer-form fieldset[hidden] {
    display: none;
}

/* Az átvilágítás (22. ütem): piros, ha sürgős (lejárt, nincs rögzítve), sárgás, ha hamarosan esedékes; a teendők a kártyán. */
.pill-danger {
    background: var(--bad-bg);
    color: var(--bad-ink);
}

.due-ok {
    margin: 0;
    color: var(--nav);
    font-weight: 600;
}

.due-todos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.due-todo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    border: 1px solid var(--warn-border);
    background: var(--warn-bg);
    border-radius: 10px;
    padding: 8px 12px;
    color: var(--warn-ink);
}

/* A gomb csak akkora, amekkora a szövege (a gombok alapból kitöltik a sort). */
/* A kártya gombjai egy sorban; ne nyúljanak meg (a másodlagos gomb alapból sorba rendezett gombokra készült: flex 1 1 180px). */
.due-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.due-actions > .button-secondary,
.due-actions > .modal-opener {
    flex: 0 0 auto;
    width: auto;
    gap: 6px;
}

.due-actions > .modal-opener {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

/* Telefonon a kis gombok 44 px-esek (mint a .button-small); a felugró ablak nyitógombja is. */
@media (max-width: 900px) {
    .due-actions > .modal-opener {
        min-height: 44px;
    }
}

.due-off {
    margin: 0;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--gray-50);
    color: var(--gray-600);
}

.due-todo.due-urgent {
    border-color: var(--bad-border);
    background: var(--bad-bg);
    color: var(--bad-ink);
}

.due-stamp {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0 8px;
    margin: 0;
    font-size: 13px;
    color: var(--ld-muted);
}

/* Az Értesítések lista: pötty (olvasatlan: kék), cím, szöveg, idő, és jobbra a gombok. */
.notice-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notice-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border-top: 1px solid var(--ld-border);
    padding: 12px 0;
}

.notice-item:first-child {
    border-top: 0;
    padding-top: 0;
}

.notice-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--ld-primary);
}

.notice-read .notice-dot {
    background: transparent;
    border: 1px solid var(--ld-border);
}

.notice-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.notice-body small {
    color: var(--ld-muted);
}

.notice-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 4px 8px;
}

.notice-actions form {
    margin: 0;
}

.notify-permission {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0;
    color: var(--ld-muted);
}

.notify-permission[hidden] {
    display: none;
}

@media (max-width: 700px) {
    .notice-item {
        grid-template-columns: 12px minmax(0, 1fr);
    }

    .notice-actions {
        grid-column: 2;
        justify-content: flex-start;
    }
}

/* 24. ütem: a futó stopper sávja minden oldal tetején. */
.run-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin: 0 0 16px;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--ld-brand);
    color: #FFFFFF;
    font-size: 14px;
}

.run-bar strong {
    font-size: 17px;
    font-variant-numeric: tabular-nums;
}

.run-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #3DDC84;
}

.run-what {
    flex: 1 1 200px;
}

.run-link {
    color: #FFFFFF;
    font-weight: 700;
}

.run-bar form {
    margin: 0;
}

.run-stop {
    min-height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: #FFFFFF;
    color: var(--ld-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.run-stop:focus-visible,
.run-link:focus-visible {
    outline: 3px solid #FFFFFF;
    outline-offset: 2px;
}

/* 24. ütem: a Feladatok fül és a feladat oldala. */
.chip-small {
    min-height: 36px;
    font-size: 13px;
}

.task-group th {
    background: var(--ld-bg);
    color: var(--ld-muted);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: left;
}

.task-group-title {
    font-size: 15px;
    margin: 16px 0 8px;
    color: var(--ld-muted);
}

.task-late {
    color: var(--bad-ink);
    font-weight: 700;
}

.client-mark {
    display: flex;
    width: fit-content;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    padding: 0 8px;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.client-mark::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.client-mark-0 { color: var(--warn); }
.client-mark-1 { color: var(--blue-700); }
.client-mark-2 { color: var(--ok); }
.client-mark-3 { color: var(--purple); }
.client-mark-4 { color: var(--bad-ink); }
.client-mark-5 { color: var(--gray-600); }

/* A megbízó választott színe (38. ütem): mind sötét árnyalat, fehéren legalább 5,4:1 kontraszttal. */
.client-color-narancs { color: #9A5B00; }
.client-color-kek { color: #1F4FB8; }
.client-color-zold { color: #156B3E; }
.client-color-lila { color: #7A2E8E; }
.client-color-piros { color: #8E2418; }
.client-color-palakek { color: #3F5170; }
.client-color-turkiz { color: #0F766E; }
.client-color-rozsa { color: #A1286A; }
.client-color-barna { color: #7C4A1E; }
.client-color-indigo { color: #4338CA; }

.color-dot {
    display: inline-block;
    flex: none;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 50%;
    background: currentColor;
}

.color-dot-auto { border: 1px dashed currentColor; background: transparent; }
.choice-chip input:checked + span .color-dot { box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3px rgba(0, 0, 0, 0.35); }
.client-colors .field-hint, .client-colors .field-error { flex: 0 0 100%; }

@media (max-width: 640px) {
    .client-colors .choice-chip span { min-height: 44px; }
}

.task-progress {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.task-bar {
    display: inline-block;
    width: 64px;
    height: 6px;
    border-radius: 9px;
    background: var(--gray-100);
    overflow: hidden;
}

.task-bar i {
    display: block;
    height: 100%;
    background: var(--ld-primary);
}

.task-start {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.task-running {
    font-weight: 700;
    color: var(--ok);
}

.task-stages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 0 0 14px;
}

.task-stage {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 12px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-surface);
    color: var(--ld-text);
    text-decoration: none;
}

.task-stage[aria-current] {
    border-color: var(--ld-primary);
    box-shadow: inset 0 0 0 2px var(--ld-primary);
}

.task-stage.is-done strong {
    color: var(--ok);
}

.task-stage-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--ld-muted);
}

.task-stage .task-bar {
    width: 100%;
}

.task-layout {
    display: grid;
    /* A munkaterületnek kell a hely: a jobb oldali kártyák (állapot, idő, adatok) keskeny, rögzített sávban. */
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: 16px;
    align-items: start;
}

.task-work,
.task-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.task-side-alone {
    max-width: 520px;
}

/* Munkalapos pontnál a munkalapé a hely: az állapot-, idő- és adatkártyák egy gombbal nyílnak, felül (a szakaszkártyák maradnak). */
.task-layout.is-sheet {
    grid-template-columns: minmax(0, 1fr);
}

.task-side-fold {
    order: -1;
    gap: 10px;
}

.task-side-fold summary {
    display: inline-flex;
    align-items: center;
    align-self: flex-end;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--ld-surface);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.task-side-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.task-done-by {
    font-size: 12px;
}

/* A pont fejléce: a cím mellett a Kész jelzés és a „kipipálta” (nem szétszórva a sor két végére). */
.task-workspace > .card-head {
    justify-content: flex-start;
}

.task-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-bg);
}

.task-point {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px 3px 4px;
    border: 1px solid var(--ld-border);
    border-radius: 999px;
    background: var(--ld-surface);
    font-size: 14px;
}

.task-point form {
    margin: 0;
}

.task-point a {
    color: var(--ld-text);
    font-weight: 600;
    text-decoration: none;
}

.task-point a:hover {
    text-decoration: underline;
}

.task-point.is-current {
    border-color: var(--ld-primary);
    background: var(--blue-50);
}

.task-point.is-done a {
    color: var(--ld-muted);
}

.task-check {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-400);
    border-radius: 50%;
    background: var(--ld-surface);
    color: #FFFFFF;
    font-weight: 800;
    cursor: pointer;
}

.task-point.is-done .task-check {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
}

.task-next {
    margin-left: auto;
}

.task-steps-input {
    font-family: inherit;
}

.task-time {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.task-time li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.task-time li form {
    margin: 0;
}

.task-time .is-voided {
    color: var(--ld-muted);
    text-decoration: line-through;
}

@media (max-width: 900px) {
    .task-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Telefonon a stopper leállítása és a pipagomb is legalább 44 px (érintés). */
@media (max-width: 900px) {
    .task-check {
        width: 44px;
        height: 44px;
    }

    .run-stop {
        min-height: 44px;
    }
}

/* A Feladatok szűrősávja egy sorban: balra az állapotok, jobbra a legördülők (js/legordulo.js: a felirat a gombon belül). */
.task-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 4px 0 14px;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.filter-field {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ld-muted);
}

/* Kiegészítve a felirat a gombon belül van; a címke csak a felolvasónak marad. */
ld-select.filter-field:has(.ldsel-button) > label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.filter-field select,
.ldsel-button {
    min-height: 36px;
    padding: 0 10px;
    border: 1px solid var(--gray-400);
    border-radius: 999px;
    background: var(--ld-surface);
    color: var(--ld-text);
    font: inherit;
    font-size: 13px;
}

.ldsel-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 260px;
    text-align: left;
    cursor: pointer;
}

.ldsel-label {
    color: var(--ld-muted);
    font-weight: 700;
}

.ldsel-button:hover,
.ldsel-button[aria-expanded="true"] {
    border-color: var(--ld-primary);
}

.ldsel-value {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ldsel-pop {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 100%;
    width: max-content;
    max-width: min(340px, 90vw);
    padding: 6px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: 0 10px 28px rgba(16, 32, 63, .16);
}

.ldsel-search {
    width: 100%;
    min-height: 38px;
    margin: 0 0 6px;
    padding: 0 10px;
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
}

.ldsel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.ldsel-list:focus {
    outline: none;
}

.ldsel-list li {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.ldsel-list li.is-active {
    background: var(--blue-50);
}

.ldsel-list li.is-on {
    font-weight: 700;
    color: var(--ld-primary);
}

.ldsel-list li.ldsel-none {
    color: var(--ld-muted);
    cursor: default;
}

.filter-submit {
    width: auto;
}

/* A sor végi (ügyfél) lista jobbra igazítva nyílik, hogy ne lógjon ki a lapról. */
.filter-field-wide .ldsel-pop {
    left: auto;
    right: 0;
}

/* Kiegészítve választásra azonnal szűr, a gomb csak JavaScript nélkül kell. */
.filter-bar.is-enhanced .filter-submit {
    display: none;
}

/* A beállított (alapértéktől eltérő) szűrő kiemelve: a megjegyzett szűrés is látsszon. */
.filter-field.is-set select,
.filter-field.is-set .ldsel-button {
    border-color: var(--ld-primary);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--ld-primary);
}

.filter-clear {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 640px) {
    .ldsel-button,
    .filter-clear {
        min-height: 44px;
    }
}

/* 25. ütem: a grafikus lépésszerkesztő (js/lepesek.js), a feladatnál és a sablonnál ugyanaz. */
.steps-toggle {
    align-self: flex-end;
    margin: -4px 0 4px;
    font-size: 13px;
}

.steps-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.steps-section {
    padding: 10px 12px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-surface);
}

.steps-section.is-over,
.steps-item.is-over {
    box-shadow: inset 0 2px 0 var(--ld-primary);
}

.steps-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
}

.steps-section-name {
    flex: 1;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--ld-bg);
    font: inherit;
    font-weight: 800;
    font-size: 15px;
}

.steps-section-name:focus,
.steps-section-name:hover {
    border-color: var(--gray-400);
}

.steps-count {
    font-size: 12.5px;
    white-space: nowrap;
}

.steps-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.steps-item {
    display: grid;
    grid-template-columns: 18px 16px minmax(0, 1fr) 110px auto 32px 32px 32px;
    gap: 6px;
    align-items: center;
    padding: 4px;
    border-radius: 9px;
}

.steps-item:hover {
    background: var(--ld-bg);
}

.steps-item.is-dragging {
    opacity: .5;
}

.steps-grip {
    color: var(--gray-400);
    font-weight: 800;
    letter-spacing: -2px;
    cursor: grab;
    user-select: none;
}

.steps-done {
    color: var(--ok);
    font-weight: 800;
}

.steps-text,
.steps-kind,
.steps-desc {
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    background: var(--ld-surface);
    font: inherit;
    font-size: 14px;
}

.steps-desc {
    grid-column: 3 / -1;
    min-height: 0;
    padding: 6px 8px;
    font-size: 13px;
    resize: vertical;
}

.steps-desc-toggle {
    font-size: 13px;
}

.steps-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--ld-border);
    border-radius: 8px;
    background: var(--ld-surface);
    color: var(--ld-text);
    font: inherit;
    cursor: pointer;
}

.steps-icon:disabled {
    opacity: .35;
    cursor: default;
}

.steps-icon.steps-remove {
    color: var(--bad-ink);
    font-weight: 800;
}

.steps-add {
    align-self: flex-start;
    min-height: 36px;
    margin-top: 6px;
    padding: 0 12px;
    border: 1px dashed var(--gray-400);
    border-radius: 9px;
    background: transparent;
    color: var(--ld-link);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* 25. ütem: a sablonok listája és űrlapja. */
.template-list {
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.template-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0 16px;
}

.template-archive {
    margin: 12px 0 0;
}

.template-pick {
    margin: 0 0 12px;
}

.task-value-form {
    margin: 0 0 8px;
}

@media (max-width: 640px) {
    /* Érintőképernyőn az áthúzás nem megy: a fogantyú helyett a ↑/↓ gombok, 44 px-esek. */
    .steps-grip {
        display: none;
    }

    .steps-item {
        grid-template-columns: 14px minmax(0, 1fr) repeat(3, 44px);
    }

    .steps-text {
        grid-column: 2;
    }

    .steps-kind,
    .steps-desc-toggle {
        grid-column: 2 / -1;
    }

    .steps-desc {
        grid-column: 1 / -1;
    }

    .steps-section-head {
        flex-wrap: wrap;
    }

    .steps-section-name {
        flex-basis: 100%;
    }

    .steps-icon {
        width: 44px;
        height: 44px;
    }

    .steps-add {
        min-height: 44px;
    }
}

.steps-section-name:focus-visible,
.steps-text:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 1px;
}

/* A szerkesztő mezői tömörek (az űrlapok általános, magas mezőstílusa helyett). */
.form .steps-editor input.steps-text,
.form .steps-editor input.steps-section-name,
.form .steps-editor select.steps-kind {
    height: 36px;
    min-height: 36px;
    padding: 0 8px;
    font-size: 14px;
}

.form .steps-editor textarea.steps-desc {
    min-height: 0;
    padding: 6px 8px;
    font-size: 13px;
}

/* A feladat állapota színesen: pontonként egy szelet, a kipipált zöld (a szakasz-sávban és a listán). */
.task-segs {
    display: inline-flex;
    gap: 2px;
    width: 100%;
    max-width: 120px;
    height: 8px;
    vertical-align: middle;
}

.task-stage .task-segs {
    max-width: none;
}

.task-segs i {
    flex: 1;
    min-width: 3px;
    border-radius: 3px;
    background: var(--gray-200);
}

.task-segs i.is-on {
    background: var(--ok-strong);
}

.task-progress {
    min-width: 150px;
}

.task-progress.is-complete {
    color: var(--ok);
    font-weight: 700;
}

.task-stage.is-done {
    border-color: #8FD0A8;
    background: var(--ok-bg);
}

.task-point.is-done {
    border-color: #8FD0A8;
    background: var(--ok-bg);
}

.task-point.is-done a {
    color: var(--ok);
}

.task-point.is-done .task-check {
    background: var(--ok-strong);
    border-color: var(--ok-strong);
}

.task-point.is-done.is-current {
    border-color: var(--ld-primary);
}

/* Az ügyfél formája ikonnal a név előtt (Ügyfelek lista). */
.form-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    border-radius: 8px;
    background: var(--blue-50);
    color: var(--ld-primary);
    vertical-align: middle;
}

.form-icon-soletrader {
    background: var(--ok-bg);
    color: var(--ok);
}

.form-icon-other {
    background: var(--purple-bg);
    color: var(--purple);
}

/* A listák keresője a szűrősávban (Ügyfelek). */
.filter-search {
    min-height: 36px;
    width: 220px;
    padding: 0 12px;
    border: 1px solid var(--gray-400);
    border-radius: 999px;
    background: var(--ld-surface);
    font: inherit;
    font-size: 13px;
}

@media (max-width: 640px) {
    .filter-search {
        width: 100%;
        min-height: 44px;
    }
}

/* Zebracsíkos sorok a táblázatokban, hogy a sort szemmel könnyű legyen követni. */
.data-table tbody tr:nth-child(even) > td {
    background: var(--gray-25);
}

/* A Feladatok táblázatban a csoportfejléc az első sor: a csíkozás az első feladatsor után kezdődik. */
.task-table tbody tr:nth-child(even) > td {
    background: none;
}

.task-table tbody tr:nth-child(odd):not(.task-group) > td {
    background: var(--gray-25);
}

.data-table tbody tr:not(.task-group):hover > td {
    background: var(--blue-50);
}

/* Az Idő oszlop jobbra zárva (fejléc és cella). */
.data-table .task-time-col {
    text-align: right;
}

.task-time-col .task-start {
    justify-content: flex-end;
}

/* Az Ügyfelek lista névcellája: az ikon a két sorral (rövid és teljes név) egy magas. */
.customer-cell {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.customer-cell .form-icon {
    flex: none;
    width: 36px;
    height: auto;
    min-height: 36px;
    margin: 0;
}

.customer-names {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

/* Az élő szűrés elrejtett sorai és kártyái (a megjelenítési szabályok ne írják felül). */
[data-search][hidden],
[data-live-none][hidden] {
    display: none !important;
}

/* A felugró ablakok gombsorában a fő gomb (pl. Mentés) a nagyobb, a Mégse a kisebb. */
.modal .buttons > .button {
    flex: 2 1 200px;
}

.modal .buttons > .button-secondary {
    flex: 1 1 120px;
}

/* Választógombok chipként (pl. a Várakozom ablak: mire vársz). */
.choice-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    border: 0;
}

.choice-chips legend {
    width: 100%;
    margin: 0 0 6px;
    padding: 0;
    font-weight: 700;
}

.choice-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.choice-chip span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--gray-400);
    border-radius: 999px;
    background: var(--ld-surface);
    color: var(--ld-link);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.choice-chip input:checked + span {
    background: var(--ld-primary);
    border-color: var(--ld-primary);
    color: #FFFFFF;
}

.choice-chip input:focus-visible + span {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

/* A felugró ablak teteje (cím, bezárás és pl. a sablonválasztó) görgetéskor is látszik. */
.modal-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: -18px -20px 0;
    padding: 18px 20px 12px;
    background: var(--ld-surface);
    border-bottom: 1px solid var(--ld-border);
}

.modal-top .template-pick {
    margin: 0;
}

/* A választógombok egy sorban (a .field alapból egymás alá rendez). */
.field.choice-chips {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
}

/* A felugró ablakban az űrlap felső vonala helyett a ragadós fejléc vonala elég (ne legyen kettő). */
.modal .address-form {
    border-top: 0;
    padding-top: 0;
}

/* ===== Feladatsablonok (a tervvászon „feladatsablon oldal” szerint) ===== */

/* Fajta-színek: jelvény és címke. */
.kind-taxreturn { --kind-bg: var(--warn-bg); --kind-ink: var(--warn); }
.kind-payroll { --kind-bg: var(--ok-bg); --kind-ink: var(--ok); }
.kind-bookkeeping { --kind-bg: var(--blue-50); --kind-ink: var(--blue-700); }
.kind-other { --kind-bg: var(--purple-bg); --kind-ink: var(--purple); }

.kind-badge {
    flex: none;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--kind-bg);
    color: var(--kind-ink);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
}

.kind-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--kind-bg);
    color: var(--kind-ink);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* A lista szűrősávja: egy fehér sávban. */
.template-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 4px 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    background: var(--ld-surface);
}

/* Mester–részlet: balra a táblázat, jobbra az előnézet (keskenyen egymás alatt). */
.template-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 14px;
    align-items: start;
}

.template-table {
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    background: var(--ld-surface);
}

/* A ⋯ menü kilóghat a táblázatból (nincs levágás); a lekerekítést a fejléc és a lábléc adja. */
.template-head {
    border-radius: 14px 14px 0 0;
}

.template-head,
.template-row {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1.3fr) minmax(0, .8fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 16px;
}

.template-head {
    background: var(--gray-50);
    border-bottom: 1px solid var(--ld-border);
    color: var(--ld-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.template-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.template-row {
    border-bottom: 1px solid var(--gray-100);
}

.template-row:nth-child(even) {
    background: var(--gray-25);
}

.template-row:hover {
    background: var(--gray-50);
}

.template-row.is-selected {
    background: var(--blue-50);
    box-shadow: inset 3px 0 0 var(--ld-primary);
}

.template-name-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.template-names {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.template-names a {
    color: var(--ld-text);
    font-weight: 700;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.template-names a:hover {
    color: var(--ld-link);
    text-decoration: underline;
}

.template-names small {
    color: var(--ld-muted);
    font-size: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.template-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--ld-muted);
}

.template-steps b {
    color: var(--ld-text);
}

.template-segs {
    display: flex;
    gap: 2px;
    height: 6px;
    max-width: 160px;
}

.template-segs i {
    border-radius: 3px;
    background: var(--blue-300);
}

.template-segs-wide {
    max-width: none;
    height: 8px;
}

.template-num {
    text-align: right;
    font-size: 13px;
}

.template-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
}

.template-actions .button-small {
    flex: none;
    min-height: 34px;
    white-space: nowrap;
}

.template-foot,
.template-none {
    margin: 0;
    padding: 10px 16px;
    color: var(--ld-muted);
    font-size: 12px;
}

/* A sor ⋯ menüje (details: JavaScript nélkül is nyílik). */
.row-menu {
    position: relative;
}

.row-menu summary {
    list-style: none;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ld-border);
    border-radius: 9px;
    background: var(--ld-surface);
    color: var(--ld-muted);
    font-weight: 800;
    cursor: pointer;
}

.row-menu summary::-webkit-details-marker {
    display: none;
}

.row-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    min-width: 190px;
    padding: 6px;
    border: 1px solid var(--ld-border);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: 0 10px 28px rgba(16, 32, 63, .16);
    display: flex;
    flex-direction: column;
}

.row-menu-list a,
.row-menu-list button {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ld-text);
    font: inherit;
    font-size: 14px;
    line-height: 38px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.row-menu-list a:hover,
.row-menu-list button:hover {
    background: var(--blue-50);
}

.row-menu-list form {
    margin: 0;
}

/* A kiválasztott sablon előnézete. */
.template-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.stat-tiles span {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--ld-bg);
    color: var(--ld-muted);
    font-size: 12px;
}

.stat-tiles b {
    color: var(--ld-text);
    font-size: 18px;
}

.preview-section h3 {
    display: flex;
    justify-content: space-between;
    margin: 0 0 4px;
    color: var(--ld-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.preview-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.preview-section li {
    position: relative;
    padding: 2px 0 2px 22px;
    font-size: 13px;
}

.preview-section li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--gray-400);
    border-radius: 4px;
}

.preview-section li.is-value::before {
    border-color: #C98A1E;
}

.template-preview-go {
    justify-content: center;
}

/* ===== A sablon szerkesztőoldala ===== */
.editor-bar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin: 0 0 14px;
    padding: 12px 16px;
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    background: var(--ld-surface);
    box-shadow: 0 2px 10px rgba(11, 46, 111, .06);
}

.editor-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--ld-muted);
    font-size: 12px;
}

.editor-crumbs li + li::before {
    content: "›";
    margin-right: 6px;
}

.editor-bar-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.editor-bar-name h1 {
    margin: 0;
    color: var(--ld-brand);
    font-size: 22px;
}

.dirty-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--warn);
    font-size: 12px;
    font-weight: 600;
}

.dirty-flag[hidden] {
    display: none;
}

.dirty-flag i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--warn-strong);
}

.editor-bar-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.editor-bar-actions .button-small {
    flex: none;
}

.editor-cancel {
    padding: 0 10px;
    color: var(--ld-muted);
    font-weight: 600;
    text-decoration: none;
}

.editor-cancel:hover {
    color: var(--ld-text);
    text-decoration: underline;
}

.editor-save {
    min-width: 140px;
    padding: 0 20px;
    font-weight: 800;
}

.template-editor {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}

.template-editor > :first-child:not(.template-editor-main) {
    grid-column: 1 / -1;
}

.template-editor-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.template-editor-side .card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.field.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid .choice-chip span {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
    border-radius: 10px;
}

.template-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
}

.template-help summary {
    color: var(--ld-brand);
    font-weight: 700;
    cursor: pointer;
}

.template-help p {
    margin: 0;
    color: var(--ld-muted);
    font-size: 13px;
    line-height: 1.6;
}

.template-editor-side .template-danger {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-color: var(--bad-border);
}

.template-danger .button-small {
    flex: none;
    color: #A3392B;
    border-color: var(--bad-border);
}

/* ===== A lépésszerkesztő új kinézete (js/lepesek.js) ===== */
.steps-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
}

.steps-summary {
    color: var(--ld-muted);
    font-size: 13px;
    font-weight: 600;
}

.steps-bar-tools {
    display: flex;
    align-items: center;
    gap: 10px;
}

.steps-fold-all {
    font-size: 13px;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border-radius: 10px;
    background: var(--gray-100);
}

.segmented button {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--ld-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: var(--ld-surface);
    color: var(--ld-text);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(11, 46, 111, .15);
}

.steps-section {
    padding: 0;
    overflow: hidden;
    border-radius: 14px;
}

.steps-section-head {
    margin: 0;
    padding: 8px 10px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.steps-section.is-collapsed .steps-section-head {
    border-bottom: 0;
}

.steps-number {
    flex: none;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--ld-primary);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
}

.form .steps-editor input.steps-section-name {
    border-color: transparent;
    background: transparent;
    color: var(--ld-brand);
    font-weight: 700;
}

.form .steps-editor input.steps-section-name:hover,
.form .steps-editor input.steps-section-name:focus {
    border-color: var(--gray-300);
    background: var(--ld-surface);
}

.steps-section.is-collapsed .steps-section-name {
    flex: 0 1 220px;
}

.steps-count {
    color: var(--ld-muted);
    font-size: 12px;
    white-space: nowrap;
}

.steps-fold {
    color: var(--ld-muted);
}

.steps-items {
    list-style: none;
    margin: 0;
    padding: 4px 6px 8px;
}

.steps-item {
    grid-template-columns: 18px 36px minmax(0, 1fr) auto auto;
    align-items: start;
    padding: 5px 6px;
}

.steps-item:focus-within {
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1.5px var(--ld-primary);
}

.steps-item .steps-grip {
    padding-top: 8px;
}

.steps-num {
    padding-top: 9px;
    color: var(--gray-500);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.steps-item.is-done .steps-num {
    color: var(--ok);
    font-weight: 800;
}

.steps-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.form .steps-editor input.steps-text {
    border-color: var(--gray-200);
}

.form .steps-editor textarea.steps-desc {
    grid-column: auto;
    border-color: transparent;
    background: transparent;
    color: var(--ld-muted);
    font-size: 12.5px;
    resize: none;
}

.form .steps-editor textarea.steps-desc:focus,
.form .steps-editor textarea.steps-desc:hover {
    border-color: var(--gray-200);
    background: var(--ld-surface);
}

.steps-desc-toggle {
    align-self: flex-start;
    padding: 0 9px;
    color: #4F6BA8;
    font-size: 12px;
    text-decoration: none;
}

/* Egy pont = egy sor: keret csak egér alatt és szerkesztéskor; a fajta kis jelvény (✓ kék, # narancs). */
.steps-items > .steps-item + .steps-item {
    border-top: 1px solid var(--gray-100);
}

.steps-item {
    grid-template-columns: 18px 32px 26px minmax(0, 1fr) auto;
    border-radius: 8px;
}

.form .steps-editor input.steps-text {
    border-color: transparent;
    background: transparent;
}

.form .steps-editor input.steps-text:hover,
.form .steps-editor input.steps-text:focus {
    border-color: var(--gray-300);
    background: var(--ld-surface);
}

.steps-badge {
    margin-top: 5px;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid var(--blue-200);
    border-radius: 7px;
    background: var(--blue-50);
    color: var(--ld-primary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.steps-badge.is-value {
    border-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.steps-badge:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

.steps-actions {
    align-items: center;
    padding-top: 3px;
}

.steps-preview {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    color: var(--ld-muted);
    font-size: 12.5px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.steps-actions {
    display: flex;
    gap: 2px;
}

.steps-actions .steps-icon {
    border-color: transparent;
    background: none;
    color: var(--gray-500);
}

.steps-actions .steps-icon:hover:not(:disabled) {
    background: var(--ld-bg);
    color: var(--ld-text);
}

.steps-new {
    display: grid;
    grid-template-columns: 18px 32px 26px minmax(0, 1fr);
    gap: 6px;
    align-items: center;
    padding: 4px 6px;
}

.steps-new-plus {
    grid-column: 3;
    text-align: center;
    color: var(--gray-400);
    font-size: 18px;
}

.form .steps-editor input.steps-new-input {
    height: 34px;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    font: inherit;
    font-size: 14px;
}

.steps-add {
    align-self: stretch;
    min-height: 46px;
    border-radius: 14px;
    border: 1.5px dashed var(--blue-300);
}

@media (max-width: 900px) {
    .template-layout,
    .template-editor {
        grid-template-columns: minmax(0, 1fr);
    }

    .template-head {
        display: none;
    }

    .template-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .template-row > :nth-child(2),
    .template-row > :nth-child(4) {
        display: none;
    }

    .template-row > .template-steps {
        grid-column: 1;
    }

    .template-row > .template-actions {
        grid-row: 1 / span 2;
        grid-column: 2;
    }
}

@media (max-width: 640px) {
    .steps-item {
        grid-template-columns: 30px 26px minmax(0, 1fr);
    }

    .steps-item .steps-grip {
        display: none;
    }

    .steps-actions {
        grid-column: 3;
    }

    .steps-new {
        grid-template-columns: 30px 26px minmax(0, 1fr);
    }

    .steps-new-plus {
        grid-column: 2;
    }

    .editor-save {
        min-width: 0;
        flex: 1;
    }
}

/* A sablonlista és a szerkesztő: fókuszkeret a lenyitókon, telefonon 44 px-es célok, keskenyen a fajta és a használat. */
summary:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 2px;
}

.template-mobile-meta {
    display: none;
}

@media (max-width: 900px) {
    .template-mobile-meta {
        display: block;
    }

    .row-menu summary,
    .template-actions .button-small,
    .editor-cancel,
    .segmented button {
        min-height: 44px;
    }

    .row-menu summary {
        width: 44px;
        height: 44px;
    }

    .editor-cancel {
        display: inline-flex;
        align-items: center;
    }
}

@media (max-width: 640px) {
    .steps-kind button {
        min-width: 44px;
    }
}

/* ===== 26. ütem: generálás és ütemezés ===== */
.schedule-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
    align-items: end;
}

.schedule-wide {
    grid-column: 1 / -1;
}

.checkbox-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 14px;
}

.schedule-exceptions ul {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.schedule-exceptions li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

/* Új kivétel: az ügyfél és a mód ugyanolyan mezőként, mint a kártya többi mezője; a gomb velük egy vonalban. */
.schedule-exception-add {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 4px 12px;
    align-items: end;
}

.schedule-exception-add select {
    width: 100%;
}

.schedule-exception-add .button-secondary {
    grid-column: 1 / -1;
}

.generation-period {
    margin: 4px 0 14px;
}

.generation-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.generation-group {
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    background: var(--ld-surface);
    overflow: hidden;
}

.generation-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    gap: 6px 12px;
    padding: 10px 14px;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-100);
}

.generation-head h2 {
    margin: 0;
    font-size: 15px;
    color: var(--ld-brand);
}

.generation-head .muted {
    font-size: 13px;
}

.generation-rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.generation-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 6px 14px;
    border-bottom: 1px solid var(--gray-100);
}

.generation-row input {
    width: 20px;
    height: 20px;
}

.generation-row label {
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.generation-row small {
    color: var(--ld-muted);
    font-size: 12px;
}

.generation-row.is-exists,
.generation-row.is-skipped {
    color: var(--ld-muted);
}

.generation-row.is-exists label {
    cursor: default;
}

.generation-state {
    font-size: 13px;
}

.generation-foot {
    position: sticky;
    bottom: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--ld-border);
    border-radius: 14px;
    background: var(--ld-surface);
    box-shadow: 0 -2px 10px rgba(11, 46, 111, .06);
}

.generation-foot .button {
    flex: none;
    padding: 0 20px;
}

.generation-nudge {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid var(--warn-border);
    border-radius: 12px;
    background: var(--warn-bg);
    font-size: 14px;
}

.generation-nudge .button-small {
    flex: none;
}

/* 27. ütem: a felfüggesztett és a törölt feladat szürke címkéje. */
.pill-suspended {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* A nyitott ⋯ menü ne vágódjon le a görgethető táblázatban. */
.table-scroll:has(.row-menu[open]) {
    overflow: visible;
}

@media (max-width: 640px) {
    .steps-badge {
        min-width: 44px;
        min-height: 44px;
        margin-top: 0;
    }

    .steps-item {
        grid-template-columns: 30px 44px minmax(0, 1fr);
    }

    .row-menu summary {
        min-width: 44px;
        min-height: 44px;
    }
}

/* 28. ütem: a célzott adónemek sorai (adónem + gyakoriság). */
.schedule-taxes {
    border: 0;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px;
}

.schedule-tax-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 8px;
}

.schedule-tax-row select {
    width: 100%;
}

@media (max-width: 640px) {
    .schedule-tax-row {
        grid-template-columns: minmax(0, 1fr);
        padding-bottom: 8px;
        border-bottom: 1px solid var(--ld-border);
    }
}

/* 29. ütem: a bérpapírok pontjának jelvénye és munkaterülete. */
.steps-badge.is-payroll {
    border-color: var(--nav-border);
    background: var(--ok-bg);
    color: #0F6B4C;
}

/* A két PDF „húzd ide” mezője egymás mellett (keskenyen egymás alatt); kiválasztás után zöld keret. */
.payroll-drops {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.payroll-drop {
    min-height: 130px;
}

.payroll-drop.has-files {
    border-color: #2F9E6E;
    background: var(--nav-bg);
}

@media (max-width: 640px) {
    .payroll-drops {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 30. ütem: a bevallás jelvénye és az átadott dokumentumok listája. */
.steps-badge.is-return {
    border-color: var(--purple-border);
    background: var(--purple-bg);
    color: #5B3AA8;
}

.task-documents {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 6px;
}

.task-documents li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 10px;
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background: var(--ld-surface);
}

.task-document-name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.task-documents .button-small {
    margin-left: auto;
}

@media (max-width: 640px) {
    .payroll-form .choice-chip {
        min-height: 44px;
    }
}

/* 32. ütem: a gyorsgombok és a csúszás felelőse. */
.task-quick {
    margin: 8px 0;
}

.task-waiting {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.task-quick-inline {
    display: inline;
}

.task-late-cause {
    margin: 8px 0 0;
    padding: 6px 10px;
    border-radius: 8px;
    background: var(--warn-bg);
    color: #7A4A00;
    font-size: 14px;
}

/* 33. ütem: az év hónapjai rács és a jelvény. */
.steps-badge.is-year {
    border-color: var(--gray-300);
    background: var(--gray-100);
    color: #1F5C80;
}

.year-slots {
    list-style: none;
    margin: 0 0 8px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
}

.year-slots li {
    border: 1px solid var(--ld-border);
    border-radius: 10px;
    background: var(--ld-surface);
    font-size: 13px;
}

.year-slots li > a,
.year-slots li:not(:has(a)) {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    min-height: 44px;
    color: inherit;
    text-decoration: none;
}

.year-slots li.is-done {
    border-color: var(--nav-border);
    background: var(--nav-bg);
}

.year-slots li.is-done span {
    color: #0F6B4C;
}

.year-slots li.is-missing {
    border-style: dashed;
}

.year-slots li.is-missing span,
.year-slots li.is-out span {
    color: var(--ld-muted);
}

.year-slots li.is-out {
    background: var(--ld-bg);
}

/* 35. ütem: a pont fajtája menüből (jelvénynek látszó kis lenyíló), a munkalap és a nyomtatás. */
select.steps-kind-select {
    width: 26px;
    padding: 0;
    text-align: center;
    text-align-last: center;
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
}

.steps-badge.is-sheet {
    border-color: var(--warn-hi);
    background: var(--warn-bg);
    color: #7A5600;
}

.worksheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.worksheet-table input {
    width: 100%;
    min-width: 0;
}

.worksheet-table td.num,
.worksheet-table th.num {
    text-align: right;
    white-space: nowrap;
}

.worksheet-table tr.is-removed td {
    color: var(--ld-muted);
    text-decoration: line-through;
}

.worksheet-table tr.is-mismatch td {
    background: var(--bad-bg);
}

.worksheet-history {
    margin-top: 8px;
    font-size: 14px;
}

@media (max-width: 900px) {
    select.steps-kind-select {
        width: 44px;
        min-height: 44px;
    }
}

@media print {
    .skip-link, .app-nav, .app-topbar, .page-actions, .task-stages, .task-side, .no-print, nav, form button, .worksheet-history { display: none !important; }
    .print-only { display: block !important; }
    body { background: #FFFFFF; }
    .app-frame, .task-layout { display: block !important; }
    .table-scroll { overflow: visible !important; }
    .worksheet-table input { border: 0 !important; background: transparent !important; padding: 0 !important; }
}

.print-only {
    display: none;
}

/* Az ügyfél munkalapjai a munkaterületen (36. ütem), a régi LifeDesk lapjainak színeivel és elrendezésével. */
.wsheet {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
    color: var(--blue-900);
}

.desk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #FFFFFF;
    color: var(--blue-900);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.desk-btn::-webkit-details-marker { display: none; }
.desk-btn.primary { background: var(--blue-600); border-color: var(--blue-600); color: #FFFFFF; }
.desk-btn:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

.ck-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.ck-title h3 { margin: 0; font-size: 1.1rem; color: var(--blue-900); }
.ck-title p { margin: 2px 0 0; color: var(--gray-600); font-size: 0.8125rem; }
.ck-grow { flex: 1; }
.ck-muted { color: var(--gray-600); font-size: 0.75rem; }
.ck-year { display: inline-flex; align-items: center; gap: 6px; }
.ck-pop { position: relative; }
.ck-pop[open] > summary { background: var(--blue-50); }

.ck-panel {
    position: absolute;
    right: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(420px, 85vw);
    margin-top: 6px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0 8px 24px rgba(11, 46, 111, 0.12);
    font-size: 0.8125rem;
}

.ck-help span { display: block; color: var(--gray-600); }

.ck-todo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--gray-50);
    font-size: 0.8125rem;
}

.ck-todo .ck-msg { flex: 1 1 380px; }
.ck-todo.ok { border-color: var(--ok-border); background: var(--ok-bg); color: var(--ok); }
.ck-todo.bad { border-color: var(--orange-border); background: var(--orange-bg); color: var(--orange); }
.ck-todo.miss { border-color: var(--warn-border); background: var(--warn-bg); color: var(--warn); }

.ws-sum {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.ws-sumcard {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-top: 3px solid var(--gray-200);
    border-radius: 14px;
    background: #FFFFFF;
}

.ws-sumcard span { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.ws-sumcard strong { font-size: 1.25rem; font-weight: 800; }
.ws-sumcard small { color: var(--gray-600); font-size: 0.75rem; }
.ws-sumcard.ber { border-top-color: var(--orange); }
.ws-sumcard.ber span { color: var(--orange); }
.ws-sumcard.kv { border-top-color: var(--blue-600); }
.ws-sumcard.kv span { color: var(--blue-600); }
.ws-sumcard.ok { border-top-color: var(--ok); }
.ws-sumcard.ok span { color: var(--ok); }
.ws-sumcard.diff { border-color: var(--orange-border); border-top-color: var(--warn-strong); background: var(--orange-bg); }
.ws-sumcard.diff span, .ws-sumcard.diff small { color: var(--orange); }
.ws-sumcard.diff strong { color: var(--orange); }
.ws-sumcard.miss { border-color: var(--warn-border); border-top-color: var(--warn-strong); background: var(--warn-bg); }
.ws-sumcard.miss span, .ws-sumcard.miss small { color: var(--warn); }

.ws-box {
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: #FFFFFF;
}

.ws-grid {
    width: 100%;
    border-collapse: collapse;
    color: var(--blue-900);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.ws-grid th {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-200);
    color: var(--gray-600);
    font-size: 0.6875rem;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.ws-grid th.grp { color: var(--blue-900); font-weight: 800; text-align: center; }
.ws-grid th.ber { background: var(--orange-bg); }
.ws-grid th.kv { background: var(--blue-50); }
.ws-grid th.ch { background: var(--blue-50); }
.ws-grid th.l, .ws-grid td.l { text-align: left; }

.ws-grid td {
    padding: 0;
    border-bottom: 1px solid var(--blue-50);
    border-right: 1px solid var(--gray-50);
    text-align: right;
    white-space: nowrap;
}

.ws-grid td input {
    width: 100%;
    min-width: 92px;
    min-height: 0;
    box-sizing: border-box;
    padding: 7px 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: right;
}

.ws-grid td.l input, .ws-grid td.name input { text-align: left; }
.ws-grid td.name input { min-width: 130px; }
.ws-grid td input:focus { outline: 2px solid var(--blue-600); outline-offset: -2px; background: #FFFFFF; }
.ws-grid td input.err { outline: 2px solid var(--warn-strong); outline-offset: -3px; border-radius: 6px; background: #FFFFFF; color: var(--orange); font-weight: 800; }
.ws-grid td input.miss { outline: 1.5px dashed var(--warn-strong); outline-offset: -3px; border-radius: 6px; background: #FFFFFF; }
.ws-grid td.calc { padding: 7px 8px; background: var(--gray-50); color: var(--gray-600); font-weight: 600; }
.ws-grid td.calc.b, .ws-grid td.text.b { color: var(--blue-900); font-weight: 800; }
.ws-grid td.calc.err { color: var(--bad); font-weight: 800; }
.ws-grid td.calc.none { color: var(--gray-600); font-weight: 500; text-align: center; }
.ws-grid td.text { padding: 7px 8px; }
.ws-grid td.chipc { padding: 5px 8px; }
.ws-grid td.sumname { padding: 7px 8px; font-weight: 800; }
.ws-grid td.rm { width: 28px; text-align: center; }
.ws-grid tr.tot td { border-top: 1px solid var(--gray-200); }
.ws-grid tr.on td { background: var(--blue-50); }
.ws-grid tr.on td.calc { background: var(--blue-50); }
.ws-grid tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }
.ws-grid tr.diff td, .ws-grid tr.diff td.calc { background: var(--orange-bg); }
.ws-grid tr.diff td:first-child { box-shadow: inset 4px 0 0 var(--warn-strong); font-weight: 700; }
.ws-grid tr.ok td, .ws-grid tr.ok td.calc { background: var(--nav-bg); }
.ws-grid tr.ok td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
.ws-grid tr.miss td, .ws-grid tr.miss td.calc { background: var(--warn-bg); }
.ws-grid tr.miss td:first-child { box-shadow: inset 4px 0 0 var(--warn-hi); }
.ws-grid tr.fut td { color: var(--gray-600); background: var(--gray-25); }
.ws-grid tr.on.diff td { background: var(--orange-bg); }

.ws-month {
    min-height: 32px;
    padding: 7px 10px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-transform: lowercase;
    cursor: pointer;
}

.ws-grid tr.on .ws-month { font-weight: 800; text-decoration: underline; }
.ws-grid tr.cur .ws-month { font-weight: 800; }
.ws-grid td.monthc { padding: 7px 10px; }

.cur-tag {
    margin: 0 6px 0 2px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--blue-600);
    font-size: 0.625rem;
    font-weight: 800;
}

.ws-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.6875rem;
    font-weight: 800;
}

.ws-chip:empty { display: none; }
.ws-chip.ok { background: var(--ok-bg); color: var(--ok); }
.ws-chip.bad, .ws-chip.warn { background: var(--orange-bg); color: var(--orange); }
.ws-chip.mid { background: var(--warn-bg); color: var(--warn); }
.ws-chip.none { background: var(--gray-100); color: var(--gray-600); }

.ws-below {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.ws-part { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ws-subhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ws-subhead h4, .ls-partners h4 { margin: 0; font-size: 0.95rem; color: var(--blue-900); }
.ws-subhead h4 { flex: 1; }

.ws-field { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-600); font-size: 0.75rem; }
.ws-field input { width: 110px; padding: 5px 8px; border: 1px solid var(--gray-300); border-radius: 7px; background: #FFFFFF; color: var(--blue-900); font: inherit; text-align: right; }
.ws-field.wide { display: flex; flex-direction: column; align-items: stretch; gap: 3px; }
.ws-field.wide input { width: 100%; box-sizing: border-box; }
.ws-field input.note, .ls-fields input { text-align: left; }
.ws-field input.miss { outline: 1.5px dashed var(--warn-strong); outline-offset: -3px; }

.ws-x { min-width: 32px; min-height: 32px; border: 0; background: transparent; color: var(--gray-500); cursor: pointer; font-size: 0.75rem; }
.ws-x:hover { color: var(--bad); }

.ws-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--blue-50);
    font-size: 0.8125rem;
}

.ls-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px; border: 1px dashed var(--gray-300); border-radius: 12px; color: var(--gray-600); }
.ls-empty p { margin: 0; flex: 1 1 320px; }
.ls-body { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.ls-partners { flex: 1 1 200px; max-width: 260px; display: flex; flex-direction: column; gap: 8px; }

.ls-partner {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--blue-900);
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.ls-partner.on { border-color: var(--blue-600); box-shadow: inset 3px 0 0 var(--blue-600); background: var(--blue-50); }
.ls-partner.is-removed b { text-decoration: line-through; opacity: 0.7; }
.ls-partner small { color: var(--gray-600); }
.ls-partner strong { grid-row: span 2; align-self: center; }
.ls-partner strong.neg { color: var(--bad); }
.ls-detail { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.ls-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.ls-fields .grow { flex: 2 1 200px; }
.ls-fields .short { flex: 0 1 90px; }
.ls-fields > label { flex: 1 1 140px; }
.ls-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ls-section { display: flex; flex-direction: column; gap: 6px; }

@media (max-width: 900px) {
    .ck-pop { position: static; }
    .ck-panel { position: static; width: auto; max-width: calc(100vw - 32px); box-shadow: none; }
    .ws-sum, .ws-below { grid-template-columns: minmax(0, 1fr); }
    .desk-btn, .ws-month, .ws-x { min-height: 44px; }
    .ls-partners { max-width: none; }
}

@media print {
    .wsheet .desk-btn, .wsheet .ws-x, .ck-pop, .ck-todo button { display: none !important; }
    .ws-box { overflow: visible !important; }
    .ws-grid td input { outline: 0 !important; }
}

/* Az adóegyenleg-lap (37. ütem), a régi LifeDesk folyószámla-lapja szerint: kék a könyvelés, zöldeskék a NAV. */
.ws-sumcard.nav { border-top-color: var(--nav); }
.ws-sumcard.nav span { color: var(--nav); }
.ws-grid th.nav { background: var(--nav-bg); }
.ws-grid select, .ws-field select, .ck-panel select { padding: 5px 6px; border: 1px solid var(--gray-300); border-radius: 7px; background: #FFFFFF; color: var(--blue-900); font: inherit; }
.ws-grid td select { width: 100%; }
.ws-grid tr.is-removed td { text-decoration: line-through; opacity: 0.65; }
.tg-layout { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.tg-side { flex: 1 1 200px; max-width: 260px; display: flex; flex-direction: column; gap: 12px; }
.tg-taxes { display: flex; flex-direction: column; gap: 8px; }
.tg-taxes h4 { margin: 0; font-size: 0.95rem; color: var(--blue-900); }
.tg-tax {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--blue-900);
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}
.tg-tax.on { border-color: var(--blue-600); box-shadow: inset 3px 0 0 var(--blue-600); background: var(--blue-50); }
.tg-tax.is-removed b { text-decoration: line-through; opacity: 0.7; }
.tg-tax-top { display: flex; justify-content: space-between; gap: 8px; }
.tg-tax small { color: var(--gray-600); }
.tg-tax small.bad { color: var(--orange); font-weight: 700; }
.tg-tax small.ok { color: var(--ok); }
.tg-open-modal { align-self: flex-start; }
.tg-nav { max-width: 620px; }
.tg-nav-tax { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--blue-50); }
.tg-nav-tax.off .tg-nav-head b { color: var(--gray-600); }
.tg-nav-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.tg-nav-head span { display: flex; flex-direction: column; }
.tg-nav-head small { color: var(--gray-600); }
.tg-nav-old { color: var(--gray-600); }
.tg-nav-new { color: var(--blue-700); }

@media (max-width: 900px) {
    .tg-nav-head select { min-height: 44px; }
}
.tg-modal { display: flex; flex-direction: column; gap: 10px; }
.tg-modal .ws-field.wide select, .tg-modal .ws-field.wide input { width: 100%; box-sizing: border-box; text-align: left; }
.tg-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.tg-quarters { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.75rem; }
.tg-quarters span { padding: 4px 8px; border-radius: 999px; background: var(--blue-50); color: var(--gray-600); }
.tg-quarters span.ok { background: var(--ok-bg); color: var(--ok); }
.tg-quarters span.bad { background: var(--orange-bg); color: var(--orange); }
.tg-quarters span.prog { background: var(--warn-bg); color: var(--warn); }
.tg-why { display: block; margin-top: 2px; color: var(--gray-600); font-size: 0.6875rem; white-space: nowrap; }
.tg-more { margin-top: 4px; }
.tg-more summary { color: var(--blue-600); font-weight: 600; cursor: pointer; }
.tg-more ul { margin: 4px 0 0; padding-left: 18px; }
.tg-grid tr.tg-open td { background: var(--gray-50); }
.ws-grid td input.fx, .ws-field input.fx { font-style: italic; }
/* A „1 234 567 Ft” alak elférjen. */
.ws-grid td input[data-money] { min-width: 112px; }
.tg-grid td.calc { white-space: nowrap; }

@media (max-width: 900px) {
    .tg-side { max-width: none; }
}

@media print {
    .tg-side { display: none !important; }
    .tg-main { flex: 1 1 100%; }
    .ws-grid td select { appearance: none; border: 0; }
    .tg-why { white-space: normal; }
}


/* ===== 40. ütem: a közös elemek új megjelenése =====
   A tervvászon „40. ütem: közös elemek” táblája szerint. Szándékosan a lap végén: a fenti, ütemenként született szabályok
   méreteit és színeit itt, egy helyen írja felül (azonos súlyú szabály, a későbbi nyer). Gépen sűrű (14 px, 36 px-es
   gombok és mezők), érintőképernyőn a 44 px-es célok maradnak. */

/* Címek és szöveg: a cím sötét, nem kék; a hierarchiát a méret és a súly adja. */
h1,
.page-title {
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--gray-900);
}

.card-title,
.tile-title,
.section-title,
.modal-title {
    font-weight: 600;
    letter-spacing: -0.005em;
    color: var(--gray-900);
}

.lead,
.muted,
.empty-text {
    color: var(--gray-600);
}

/* Morzsamenü: halvány, aláhúzás csak rámutatáskor. */
.crumbs ol {
    color: var(--gray-600);
}

.crumbs a {
    color: var(--gray-600);
    font-weight: 500;
    text-decoration: none;
}

.crumbs a:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

.crumbs li + li::before {
    color: var(--gray-300);
}

/* Gombok: elsődleges (kék), másodlagos (fehér, kerettel), veszélyes; egy formában. */
.button,
.button-link,
.button-secondary {
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: var(--shadow-1);
    transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease);
}

.button,
.button-link {
    background: var(--blue-600);
}

/* Az elsődleges gombnak is legyen oldalsó belső margója (a feladat fejlécében a „Kész…” a kerethez tapadt); linkként is
   gombnak látszik. */
.button {
    padding: 0 16px;
}

a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    text-decoration: none;
}

.button:not(:disabled):hover,
.button-link:hover {
    background: var(--blue-700);
}

.button-secondary {
    border-color: var(--gray-300);
    color: var(--gray-700);
}

.button-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    color: var(--gray-900);
}

.button-danger {
    color: var(--bad);
    border-color: var(--bad-border);
}

.button-danger:hover {
    background: var(--bad-bg);
    border-color: var(--bad);
    color: var(--bad-ink);
}

/* Fülek: aláhúzásos sor; a kiválasztott kék, félkövér. */
.tabs {
    gap: 4px 18px;
    border-bottom-color: var(--gray-200);
}

.tab {
    padding: 0 2px;
    margin-bottom: -1px;
    border-bottom-width: 2px;
    color: var(--gray-600);
    font-weight: 500;
    transition: color var(--ease), border-color var(--ease);
}

.tab:hover {
    color: var(--gray-900);
    border-bottom-color: var(--gray-300);
}

.tab[aria-current="page"] {
    color: var(--blue-700);
    border-bottom-color: var(--blue-600);
    font-weight: 600;
}

/* Szűrőchipek: fehér, finom keret; a kiválasztott teli kék. */
.chip {
    border-color: var(--gray-200);
    color: var(--gray-700);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--ease), border-color var(--ease);
}

.chip:hover {
    border-color: var(--gray-400);
    background: var(--gray-25);
}

.chip[aria-current] {
    background: var(--blue-600);
    border-color: var(--blue-600);
    color: #FFFFFF;
}

/* Jelvények: színes háttér és keret; az állapotjelvény előtt egy pont (a szöveg mindig ott van, a szín csak segít). */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
    line-height: 1.45;
    white-space: nowrap;
}

.pill-on::before,
.pill-warning::before,
.pill-plan::before,
.pill-danger::before,
.pill-suspended::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-on {
    background: var(--ok-bg);
    border-color: var(--ok-border);
    color: var(--ok);
}

.pill-warning {
    background: var(--warn-bg);
    border-color: var(--warn-border);
    color: var(--warn);
}

.pill-plan {
    background: var(--blue-50);
    border-color: var(--blue-200);
    color: var(--blue-700);
}

.pill-danger {
    background: var(--bad-bg);
    border-color: var(--bad-border);
    color: var(--bad);
}

.pill-suspended {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-600);
}

/* Kártyák és dobozok: fehér, finom keret és árnyék, 12 px-es sarok. */
.card,
.tile,
.stat,
.empty-card,
.data-box,
.project-card {
    border-color: var(--gray-200);
    box-shadow: var(--shadow-1);
}

.card,
.tile,
.empty-card,
.data-box {
    border-radius: var(--radius-lg);
}

.empty-icon {
    background: var(--blue-50);
    color: var(--blue-700);
}

.stat dd {
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

/* Táblázat: halvány fejléc; finom zebra; rámutatáskor kék sor; a számok jobbra, egyforma széles számjegyekkel. */
.data-table th {
    padding: 9px 12px;
    background: var(--gray-25);
    border-bottom-color: var(--gray-200);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--gray-600);
}

/* A keskeny ügyfélkártyán a hosszú jelvény („Kész · csúszott … napot”) törhet, ne lógjon ki. */
.customer-card .pill {
    white-space: normal;
}

.data-table td {
    padding: 9px 12px;
    border-bottom-color: var(--gray-100);
}

/* A Feladatok csoportsora (Lejárt, Később) a táblázat fejlécénél sötétebb sáv. */
.data-table .task-group th {
    background: var(--gray-50);
    border-bottom-color: var(--gray-200);
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
}

/* Az adatlap soraiban (bankszámla, tevékenység, adónem, cím) a Módosítás és az Archiválás csendes gomb: keretet csak akkor
   kap, ha a sor fölött az egér vagy a sorban a fókusz van; így a tartalom nem vész el a gombok között. Felolvasónak és
   billentyűzetnek ugyanúgy gomb marad. */
.address-list > li {
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: var(--radius);
    transition: background-color var(--ease);
}

/* Csak egeres eszközön: érintőképernyőn nincs rámutatás, ott a gombok kerete mindig látszik. */
@media (hover: hover) and (pointer: fine) {
    .address-list .address-actions .button-secondary {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
        color: var(--gray-600);
    }

    .address-list > li:hover,
    .address-list > li:focus-within {
        background: var(--blue-50);
    }

    .address-list > li:hover .address-actions .button-secondary,
    .address-list .address-actions .button-secondary:focus-visible {
        border-color: var(--gray-300);
        background: #FFFFFF;
        color: var(--blue-700);
    }

    .address-list > li:hover .address-actions .button-secondary:hover {
        border-color: var(--gray-400);
    }
}

/* Keskeny képernyőn a gombok a sor szövege alá kerülnek (a szöveg ne szoruljon egy keskeny oszlopba). */
@media (max-width: 640px) {
    .address-list > li {
        flex-wrap: wrap;
    }
}

/* Mezők: 3:1 kontrasztú keret, fókuszban kék keret és halvány kék gyűrű; hibánál piros. */
.field input,
.field textarea,
.field select,
.search-form input {
    border-color: var(--gray-400);
    border-radius: var(--radius-sm);
    transition: border-color var(--ease), box-shadow var(--ease);
}

/* Az átlátszó körvonal a Windows nagy kontrasztú módjában látszó színt kap (ott a gyűrű, a box-shadow eltűnik). */
.field input:focus,
.field textarea:focus,
.field select:focus,
.search-form input:focus {
    outline: 2px solid transparent;
    outline-offset: 0;
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
    border: 1px solid var(--bad-strong);
    box-shadow: 0 0 0 3px var(--bad-bg);
}

.field label {
    color: var(--gray-700);
}

.field-error {
    color: var(--bad);
}

/* Értesítő sávok: 8 px-es sarok. */
.alert {
    border-radius: var(--radius);
    padding: 10px 14px;
}

/* Felugró ablak: 12 px-es sarok, mély árnyék, halvány háttér mögötte. */
.modal {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
}

.modal::backdrop {
    background: rgba(10, 31, 77, 0.32);
    backdrop-filter: blur(1px);
}

/* Gépen sűrű: 36 px-es gombok, 14 px-es szöveg. */
@media (min-width: 901px) {
    .button,
    .button-link,
    .button-secondary,
    .view-switch a {
        min-height: 36px;
        font-size: 13.5px;
    }

    .button-small {
        min-height: 30px;
        padding: 0 10px;
        font-size: 12.5px;
    }

    .tab {
        min-height: 38px;
        font-size: 13.5px;
        padding: 0 2px;
    }

    .chip {
        min-height: 30px;
        padding: 0 11px;
        font-size: 12.5px;
    }

    .page-title {
        font-size: 22px;
    }

    .card,
    .tile {
        padding: 16px;
    }

    .card-title {
        font-size: 15px;
    }

    .data-table {
        font-size: 13.5px;
    }

    .stat dd {
        font-size: 22px;
    }
}

/* Egérrel gépen a mezők is sűrűbbek; érintőképernyőn a 16 px-es betű marad (iPhone-on ne nagyítson rá). */
@media (min-width: 901px) and (pointer: fine) {
    .field input,
    .field textarea,
    .field select,
    .search-form input {
        font-size: 14px;
        padding: 7px 10px;
    }
}

/* Érintőképernyőn (táblagépen 900 px fölött is) a gombok, fülek, chipek és a munkalapok kis gombjai legalább 44 px-esek. */
@media (pointer: coarse) {
    .button,
    .button-link,
    .button-secondary,
    .button-small,
    .tab,
    .chip,
    .desk-btn,
    .ws-x,
    .steps-icon,
    .row-menu summary,
    .choice-chip span {
        min-height: 44px;
    }

    .tab,
    .ws-x,
    .steps-icon,
    .row-menu summary {
        min-width: 44px;
    }
}

/* ===== 40. ütem: a Feladatok lista a tervvászon mintája szerint („40. ütem: Feladatok – új megjelenés”) ===== */

/* Szűrőchipek: a szám külön, kerek jelvényben; a kiválasztottban fehéres, a lejártaké piros. */
.chip {
    gap: 6px;
}

.chip-count {
    display: inline-block;
    min-width: 8px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.chip-count.is-late {
    background: var(--bad-bg);
    color: var(--bad);
}

.chip[aria-current] .chip-count {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

/* A lenyílók gombja: „Fajta: Mind” – a felirat halvány, a választott érték félkövér, sötét. */
.ldsel-button {
    border-color: var(--gray-300);
    border-radius: var(--radius);
    color: var(--gray-600);
    font-size: 12.5px;
    transition: border-color var(--ease);
}

.ldsel-label {
    color: var(--gray-600);
    font-weight: 500;
}

.ldsel-value {
    color: var(--gray-900);
    font-weight: 600;
}

/* A táblázat: a feladat címe sötét és félkövér (rámutatáskor kék, aláhúzott), alatta halványan az időszak. */
.task-table td {
    height: 44px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.task-table .customer-name {
    color: var(--gray-900);
    font-weight: 600;
    text-decoration: none;
}

.task-table .customer-name:hover {
    color: var(--blue-700);
    text-decoration: underline;
}

.task-table .customer-full {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
}

/* A csoportsor (Lejárt · 3, Később · 1): halvány sáv, nagybetűs; a lejárt piros. */
.data-table .task-group th {
    height: 32px;
    padding-top: 0;
    padding-bottom: 0;
    letter-spacing: 0.04em;
}

.data-table .task-group.is-late th,
.task-group-title.is-late {
    color: var(--bad);
}

/* Az ügyfél: a megbízó színe egy függőleges csík a név előtt, alatta halványan a megbízó neve. */
.task-customer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-customer-bar {
    flex: none;
    width: 4px;
    height: 26px;
    border-radius: 2px;
    background: currentColor;
}

.task-customer-name {
    display: block;
    color: var(--gray-900);
    font-weight: 500;
}

.task-customer .client-mark {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    color: var(--gray-500);
    font-size: 11.5px;
    font-weight: 400;
}

.task-customer .client-mark::before {
    content: none;
}

/* Fajta és állapot: jelvény ponttal és kerettel (a fajta színei a sablonokéval azonosak). */
.kind-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border: 1px solid color-mix(in srgb, var(--kind-ink) 28%, #FFFFFF);
    background: var(--kind-bg);
    color: var(--kind-ink);
    font-weight: 600;
    line-height: 1.45;
}

.kind-pill::before,
.pill-open::before {
    content: "";
    flex: none;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.pill-open {
    background: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--gray-600);
}

/* A lejárt határidő piros, félkövér. */
.task-late {
    color: var(--bad);
    font-weight: 600;
}

/* Haladás: 120 px-es szeletes sáv, mellette halványan a szám. */
.task-segs {
    height: 6px;
}

.task-segs i {
    border-radius: 2px;
}

.task-progress {
    color: var(--gray-500);
    font-size: 12px;
}

/* A sor végi ▶ és ⋯ gombja csendes: keretet csak a sor fölött (vagy fókuszban) kap; érintőképernyőn mindig látszik. */
.task-table .task-start .button-secondary,
.task-table .row-menu summary {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    justify-content: center;
    border-radius: 7px;
}

@media (hover: hover) and (pointer: fine) {
    .task-table .task-start .button-secondary,
    .task-table .row-menu summary {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
        color: var(--gray-500);
    }

    .task-table tbody tr:hover .task-start .button-secondary,
    .task-table tbody tr:hover .row-menu summary,
    .task-table .task-start .button-secondary:focus-visible,
    .task-table .row-menu summary:focus-visible,
    .task-table .row-menu[open] summary {
        border-color: var(--gray-300);
        background: #FFFFFF;
        color: var(--gray-700);
    }
}

/* A „még nincs felvéve” figyelmeztetés: sárga sáv, jobbra a gombbal. */
.generation-nudge {
    border: 1px solid var(--warn-border);
    border-radius: 10px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-size: 13px;
}

/* Üres állapot a minta szerint: szaggatott keret, árnyék nélkül (nem tartalom, hanem hely a tartalomnak). */
.empty-card {
    border: 1px dashed var(--gray-300);
    background: var(--gray-25);
    box-shadow: none;
}

/* ===== 41. ütem: Sablonok – átláthatóbb lista és szerkesztő („41. ütem” a tervvásznon) ===== */

/* A Beállítások alfülei: kisebb, szürke kapcsolósáv (a kiválasztott fehér), hogy ne versenyezzen a fő fülekkel. */
.subtabs {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    border-radius: 10px;
    background: var(--gray-100);
}

.subtab {
    min-height: 30px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 500;
}

.subtab:hover {
    color: var(--gray-900);
}

.subtab[aria-current="page"] {
    background: var(--ld-surface);
    color: var(--gray-900);
    font-weight: 600;
    box-shadow: var(--shadow-1);
}

@media (max-width: 900px), (pointer: coarse) {
    .subtabs {
        display: flex;
        flex-wrap: wrap;
    }

    .subtab {
        min-height: 44px;
    }
}

/* A lista oszlopai: sablon, ütemezés, kinek, lépések, feladat (a külön fajta-oszlop megszűnt: a fajta a név alatt). */
/* A kijelölt chip száma: fehér a sötétebb sávon (a 20 %-os fehér háttéren a kék chipen kevés volt a kontraszt). */
.chip[aria-current] .chip-count {
    background: rgba(0, 0, 0, 0.2);
}

.chip-count {
    color: var(--gray-600);
}

/* Csak gépen: keskenyen (900 px alatt) a régi, egyoszlopos szabályok maradnak. */
@media (min-width: 901px) {
    .template-layout {
        grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    }

    .template-head,
    .template-row {
        grid-template-columns: minmax(0, 2.2fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, .6fr) auto;
    }
}

.template-row {
    min-height: 52px;
    padding-top: 7px;
    padding-bottom: 7px;
}

.template-row:nth-child(even) {
    background: none;
}

.template-row:hover {
    background: var(--gray-25);
}

/* A csoportsor (Havi · 5): halvány sáv, nagybetűs. */
.template-group h3 {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
}

.template-group {
    padding: 6px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* A név előtt a fajta színes csíkja, alatta színesen a fajta és halványan a leírás. */
.template-bar {
    flex: none;
    width: 4px;
    height: 30px;
    border-radius: 2px;
    background: var(--kind-ink);
}

.template-names a {
    font-weight: 600;
    color: var(--gray-900);
}

.template-kind {
    color: var(--kind-ink);
    font-weight: 600;
}

.template-sched {
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.template-sched.is-manual {
    color: var(--gray-600);
    font-weight: 400;
}

.template-who {
    min-width: 0;
    color: var(--gray-700);
    font-size: 12.5px;
    line-height: 1.3;
}

.template-who small {
    display: block;
    color: var(--gray-600);
    font-size: 11.5px;
}

.template-steps {
    font-size: 12.5px;
    color: var(--gray-600);
    white-space: nowrap;
}

.template-steps b {
    font-weight: 600;
}

.template-segs {
    max-width: 72px;
    height: 5px;
}

.template-segs i {
    border-radius: 2px;
}

.template-used {
    min-width: 22px;
    margin-right: 4px;
    color: var(--gray-600);
    font-size: 13px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.template-used [aria-hidden] {
    color: var(--gray-400);
}

.template-actions .template-go {
    width: 30px;
    min-width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    justify-content: center;
}

.template-actions .row-menu summary {
    width: 30px;
    height: 30px;
    border-radius: 7px;
}

/* A sor végi gombok csendesek: keretet csak a sor fölött (vagy fókuszban) kapnak; érintőképernyőn mindig látszanak. */
@media (hover: hover) and (pointer: fine) {
    .template-actions .template-go,
    .template-actions .row-menu summary {
        border-color: transparent;
        background: transparent;
        box-shadow: none;
        color: var(--gray-500);
    }

    .template-row:hover .template-go,
    .template-row:hover .row-menu summary,
    .template-actions .template-go:focus-visible,
    .template-actions .row-menu summary:focus-visible,
    .template-actions .row-menu[open] summary {
        border-color: var(--gray-300);
        background: #FFFFFF;
        color: var(--gray-700);
    }
}

/* Az előnézet: fejléc a jelvényekkel, mondatos adatok, kék sávban a következő időszak, négy számkártya, a pontok jellel. */
.template-preview {
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.template-preview-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--gray-100);
}

.template-preview-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.template-preview-tags .button-small {
    flex: none;
    margin-left: auto;
}

.template-preview-head .card-title {
    margin: 0;
    font-size: 17px;
}

.template-preview-head small {
    font-size: 12px;
}

.template-facts {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 6px 10px;
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.template-facts dt {
    color: var(--gray-500);
    font-weight: 500;
}

.template-facts dd {
    margin: 0;
    color: var(--gray-900);
}

.template-next,
.template-preview .template-next {
    margin: 12px 16px 0;
    padding: 9px 11px;
    border: 1px solid var(--blue-200);
    border-radius: 8px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 12.5px;
    line-height: 1.45;
}

.stat-tiles-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 12px 16px 4px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.stat-tiles-4 span {
    padding: 7px 10px;
    border-left: 1px solid var(--gray-100);
    border-radius: 0;
    background: none;
    font-size: 11.5px;
}

.stat-tiles-4 span:first-child {
    border-left: 0;
}

.template-preview .preview-section {
    padding: 0 16px;
}

.preview-section h3 {
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    margin: 10px 0 4px;
    color: var(--gray-600);
    font-weight: 700;
}

.preview-section-no {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--blue-600);
    color: #FFFFFF;
    font-size: 11px;
}

.preview-section-count {
    margin-left: auto;
    color: var(--gray-500);
    font-weight: 600;
}

.preview-section li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0 3px 26px;
    color: var(--gray-700);
}

.preview-section li::before {
    content: none;
}

/* A pont fajtájának jele (pipálandó szürke, adatmező narancs, munkalap NAV-kék, bevallás és bérpapír lila). */
.step-mark {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: var(--gray-100);
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
}

.step-mark.is-value { background: var(--orange-bg); color: var(--orange); }
.step-mark.is-sheet { background: var(--nav-bg); color: var(--nav); }
.step-mark.is-file { background: var(--purple-bg); color: var(--purple); }

.template-preview-foot {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.template-preview-foot .template-preview-go {
    flex: 1;
}

.template-preview-foot form {
    margin: 0;
}

/* Telefonon és keskenyen: a sor kártya (bal oldalt a fajta színével), alatta röviden az ütemezés, a pontok és a használat. */
@media (max-width: 900px) {
    .template-row > .template-sched,
    .template-row > .template-who,
    .template-row > .template-steps {
        display: none;
    }

    .template-row > .template-actions {
        grid-row: auto;
    }

    .template-used {
        display: none;
    }

    .template-actions .template-go,
    .template-actions .row-menu summary {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }
}

@media (pointer: coarse) {
    .template-actions .template-go,
    .template-actions .row-menu summary {
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
    }
}

/* A szerkesztő: ragadós fejléc összefoglaló címkékkel (az Áttekintés kártya ebbe olvadt), a jobb oszlop 420 px-es. */
.editor-bar {
    align-items: flex-start;
    border-color: var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow-2);
}

.editor-bar-name h1 {
    color: var(--gray-900);
    font-size: 20px;
    letter-spacing: -.015em;
}

.editor-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.editor-summary li {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 12px;
}

@media (min-width: 1101px) {
    .template-editor {
        grid-template-columns: minmax(0, 1fr) 420px;
    }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .template-editor {
        grid-template-columns: minmax(0, 1fr) 340px;
    }
}

/* A kártya címe mellett halványan az alcíme (a címsoron kívül, hogy a felolvasó csak a címet mondja a szakasz nevének). */
.card-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.card-title-row .card-title {
    margin: 0;
}

.card-title-row small {
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
}

/* Szegmenses kapcsoló rádiógombokból (fajta, ismétlődés, forma, kivétel): egy sorban, a kiválasztott kék. */
.seg-field {
    margin: 0;
    padding: 0;
    border: 0;
}

.seg-field legend {
    margin-bottom: 4px;
    padding: 0;
    font-weight: 600;
}

/* A részek közötti vonal a rés (1 px) a szürke háttéren: így két sorba tördelve is rendben van. */
.seg-choice {
    display: flex;
    gap: 1px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    overflow: hidden;
    background: var(--gray-200);
}

.seg-choice label {
    flex: 1 1 0;
    min-width: 0;
    position: relative;
    margin: 0;
}

.seg-choice span {
    background: var(--ld-surface);
}

.seg-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.seg-choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 6px;
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.seg-choice label:hover span {
    background: var(--gray-50);
}

.seg-choice input:checked + span {
    background: var(--blue-600);
    color: #FFFFFF;
    font-weight: 600;
}

.seg-choice input:focus-visible + span {
    outline: 3px solid var(--ld-primary);
    outline-offset: -3px;
}

.seg-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--kind-ink);
}

.seg-choice input:checked + span .seg-dot {
    background: #FFFFFF;
}

@media (forced-colors: active) {
    .seg-choice input:checked + span {
        outline: 2px solid CanvasText;
        outline-offset: -4px;
    }
}

/* Ütemezés: határnap és hétvégi tolás egymás mellett; a Hónap csak évesnél, „csak kézzel” mellett egyik sem kell. */
.template-schedule .schedule-grid {
    align-items: start;
}

.template-schedule:has(input[name="Input.Recurrence"]:checked:not([value="Annual"])) .schedule-month,
.template-schedule:has(input[name="Input.Recurrence"][value="None"]:checked) .schedule-grid {
    display: none;
}

.template-editor-side .template-next {
    margin: 0;
}

/* Kinek: az adónemsorok kártyaszerűen, a sor végén szürke × (csak JavaScripttel: a menu.js „menu-js” osztálya jelzi). */
.schedule-tax-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 130px) auto;
    gap: 6px;
    align-items: center;
}

.schedule-tax-row[hidden] {
    display: none;
}

.target-remove {
    display: none;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: none;
    color: var(--gray-500);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.menu-js .target-remove {
    display: inline-grid;
    place-items: center;
}

.target-remove:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.target-remove:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 1px;
}

.schedule-exception-add {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px auto;
    gap: 6px;
    align-items: center;
}

.seg-choice-small span {
    min-height: 32px;
}

.schedule-exception-add select {
    width: 100%;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--ld-surface);
    color: var(--gray-900);
    font: inherit;
    font-size: 13.5px;
}

@media (max-width: 900px), (pointer: coarse) {
    .schedule-exception-add select {
        min-height: 44px;
        font-size: 16px;
    }
}

/* Az archiválás csendes sáv (nem piros: nem veszélyes, semmi nem törlődik). */
.template-editor-side .template-danger {
    border-color: var(--gray-200);
    box-shadow: none;
    font-size: 12.5px;
}

/* Az Archiválás gombja piros (a felhasználó kérésére): kiemeli, hogy ezzel a sablon kikerül a listából. */
.template-danger .button-small {
    color: var(--bad);
    border-color: var(--bad-border);
}

.template-danger .button-small:hover {
    background: var(--bad-bg);
}

/* A lépések: a pont gombjai (+ leírás, ↑ ↓ ×) és a szakasz gombjai csak rámutatáskor vagy fókuszban; érintőképernyőn mindig. */
@media (hover: hover) and (pointer: fine) {
    .steps-item .steps-actions,
    .steps-section-head .steps-icon:not(.steps-fold) {
        opacity: 0;
        transition: opacity var(--ease);
    }

    .steps-item:hover .steps-actions,
    .steps-item:focus-within .steps-actions,
    .steps-section-head:hover .steps-icon,
    .steps-section-head:focus-within .steps-icon {
        opacity: 1;
    }

    /* Rejtve ne foglaljon helyet (a pont szövege a keskeny oszlopban is kiférjen): a gombsor a sor jobb szélén úszik. */
    .steps-item {
        position: relative;
    }

    .steps-item .steps-actions {
        position: absolute;
        top: 4px;
        right: 6px;
        padding: 1px 2px;
        border: 1px solid var(--gray-200);
        border-radius: 8px;
        background: var(--ld-surface);
        box-shadow: var(--shadow-1);
    }
}

.steps-remove {
    color: var(--gray-500);
}



/* Ugró fülek (csak keskenyen): Lépések · Adatok · Ütemezés · Kinek. */
.editor-jump {
    display: none;
}

@media (max-width: 900px) {
    .editor-jump {
        position: sticky;
        top: 0;
        z-index: 14;
        display: flex;
        gap: 2px;
        margin: 0 0 12px;
        padding: 3px;
        border-radius: 10px;
        background: var(--gray-100);
    }

    .editor-jump a {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        border-radius: 8px;
        color: var(--gray-700);
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
    }

    .editor-jump a:hover,
    .editor-jump a:focus-visible {
        background: var(--ld-surface);
        color: var(--gray-900);
    }

    .template-editor-main,
    .template-editor-side .card {
        scroll-margin-top: 64px;
    }

    /* Keskenyen a fejléc nem ragad (a fülek ragadnak), a gombsor pedig alul. */
    .editor-bar {
        position: static;
    }

    .editor-bar-actions {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        padding: 10px 14px;
        border-top: 1px solid var(--gray-200);
        background: var(--ld-surface);
        box-shadow: 0 -4px 14px rgba(16, 32, 63, .08);
    }

    .editor-bar-actions .button-small,
    .editor-save {
        min-height: 44px;
    }

    .editor-save {
        flex: 1;
    }

    .template-editor-page {
        padding-bottom: 80px;
    }

    html:has(.template-editor-page) {
        scroll-padding-bottom: 88px;
    }

    .schedule-exception-add {
        grid-template-columns: minmax(0, 1fr) 120px;
    }

    .schedule-exception-add .button-small {
        grid-column: 1 / -1;
        min-height: 44px;
    }

    .seg-choice span {
        min-height: 44px;
    }

    .target-remove {
        width: 44px;
        height: 44px;
    }
}

/* Telefonon a négyrészes kapcsoló (fajta, ismétlődés) két sorban; az adónemsorban a gyakoriság a második sorban. */
@media (max-width: 1100px) {
    .seg-choice:has(> label:nth-child(4)) {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {

    .schedule-tax-row {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .schedule-tax-row select + label + select {
        grid-column: 1;
    }

    .schedule-tax-row .target-remove {
        grid-row: 1;
        grid-column: 2;
    }
}

@media (pointer: coarse) {
    .seg-choice span {
        min-height: 44px;
    }

    .target-remove {
        width: 44px;
        height: 44px;
    }
}

/* „Mind összecsuk / Mind kinyit”: gomb (nem link), a Szerkesztő/Szöveg kapcsolóval egy magasságban; a felirat váltásakor sem ugrik. */
.steps-fold-all {
    flex: none;
    min-width: 116px;
    min-height: 36px;
    padding: 0 12px;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.steps-fold-all[hidden] {
    display: none;
}

@media (max-width: 900px), (pointer: coarse) {
    .steps-fold-all {
        min-height: 44px;
    }
}

/* A szegmensek a feliratuk hosszához igazodnak (a „Bérszámfejtés” több helyet kap, nem lóg ki), és nem törnek. */
.seg-choice label {
    flex: 1 1 auto;
}

.seg-choice span {
    padding: 0 8px;
    white-space: nowrap;
}

/* A Mégse is keretes gomb, mint a „Feladat ebből” (a régi szöveglink-stílus helyett). */
.editor-bar-actions .editor-cancel {
    flex: none;
    padding: 0 14px;
    color: var(--gray-700);
    font-weight: 600;
    text-decoration: none;
}

.editor-bar-actions .editor-cancel:hover {
    color: var(--gray-900);
    text-decoration: none;
}

/* ===== 42. ütem: Pontfajta-választó („42. ütem” a tervvásznon) ===== */

/* A pont fajtáinak egységes színei: a szerkesztő választója, a sablon előnézete és a feladat lapja is ezeket használja. */
.sk-check { --sk-bg: var(--gray-50); --sk-bd: var(--gray-200); --sk-ink: var(--gray-600); }
.sk-value { --sk-bg: var(--orange-bg); --sk-bd: var(--orange-border); --sk-ink: var(--orange); }
.sk-payroll { --sk-bg: var(--ok-bg); --sk-bd: var(--ok-border); --sk-ink: var(--ok); }
.sk-return { --sk-bg: var(--purple-bg); --sk-bd: var(--purple-border); --sk-ink: var(--purple); }
.sk-year { --sk-bg: var(--blue-50); --sk-bd: var(--blue-200); --sk-ink: var(--blue-700); }
.sk-sheet { --sk-bg: var(--nav-bg); --sk-bd: var(--nav-border); --sk-ink: var(--nav); }

.step-mark {
    border: 1px solid var(--sk-bd, var(--gray-200));
    background: var(--sk-bg, var(--gray-100));
    color: var(--sk-ink, var(--gray-600));
}

.task-point a .step-mark {
    margin-right: 6px;
    vertical-align: -4px;
}

/* A pont sorában: színes jel és ▾ – egy gomb, ami a választót nyitja. */
.steps-kind-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 4px;
    padding: 2px 3px 2px 2px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: none;
    color: var(--gray-500);
    cursor: pointer;
}

.steps-kind-btn:hover {
    border-color: var(--gray-300);
    background: var(--ld-surface);
}

.steps-kind-btn:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 1px;
}

.steps-kind-btn[aria-expanded="true"] {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.steps-kind-tile,
.kind-tile {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--sk-bd);
    border-radius: 7px;
    background: var(--sk-bg);
    color: var(--sk-ink);
}

.kind-tile {
    width: 28px;
    height: 28px;
}

.steps-item {
    grid-template-columns: 18px 32px 44px minmax(0, 1fr) auto;
}

.steps-new {
    grid-template-columns: 18px 32px 44px minmax(0, 1fr);
}

@media (max-width: 640px) {
    .steps-item,
    .steps-new {
        grid-template-columns: 30px 52px minmax(0, 1fr);
    }
}

@media (max-width: 640px), (pointer: coarse) {
    .steps-kind-btn {
        min-width: 44px;
        min-height: 44px;
        margin-top: 0;
        justify-content: center;
    }
}

/* A választó: csoportosított lista, minden fajta neve és egysoros magyarázata; a mostani kék háttérrel és pipával. */
.kind-picker {
    position: fixed;
    z-index: 60;
    width: 340px;
    max-width: calc(100vw - 16px);
    box-sizing: border-box;
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-3);
}

.kind-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px 4px;
    color: var(--gray-600);
    font-size: 12px;
}

.kind-head b {
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 600;
}

.kind-list {
    max-height: min(520px, 70vh);
    overflow: auto;
    outline: none;
}

.kind-group {
    margin: 8px 10px 4px;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.kind-option {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 18px;
    gap: 10px;
    align-items: center;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}

.kind-text b {
    display: block;
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 600;
}

.kind-text small {
    display: block;
    color: var(--gray-600);
    font-size: 11.5px;
    line-height: 1.35;
}

.kind-option.is-current {
    background: var(--blue-50);
}

.kind-tick {
    display: inline-flex;
    color: transparent;
}

.kind-option.is-current .kind-tick {
    color: var(--blue-600);
}

.kind-option.is-active {
    box-shadow: inset 0 0 0 2px var(--blue-600);
}

.kind-foot {
    display: flex;
    gap: 10px;
    margin-top: 4px;
    padding: 8px 10px 4px;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-600);
    font-size: 11.5px;
}

.kind-foot kbd,
.steps-help kbd {
    font: inherit;
    font-size: 11px;
    padding: 0 5px;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--gray-50);
    color: var(--gray-700);
}

@media (forced-colors: active) {
    .kind-option.is-active {
        outline: 2px solid Highlight;
        outline-offset: -2px;
    }

    .kind-option.is-current .kind-tick {
        color: CanvasText;
    }
}

/* Telefonon: alulról felcsúszó lap, 48 px-es sorokkal, Bezár gombbal, sötétített háttérrel. */
.kind-backdrop {
    position: fixed;
    inset: 0;
    z-index: 59;
    background: rgba(16, 24, 40, .45);
}

.kind-picker.is-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    padding: 8px 8px calc(14px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 16px 16px 0 0;
}

.kind-picker.is-sheet .kind-head b {
    font-size: 15px;
}

.kind-picker.is-sheet .kind-option {
    min-height: 48px;
}

.kind-picker.is-sheet .kind-close {
    flex: none;
    min-height: 44px;
}

/* A lépések alatti súgó: kék tájékoztató kártya, a billentyűk és a jelölések kis címkékben. */
.steps-help {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding: 11px 13px;
    border: 1px solid var(--blue-200);
    border-radius: 10px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 12.5px;
    line-height: 1.6;
}

.steps-help svg {
    flex: none;
    margin-top: 2px;
    color: var(--blue-600);
}

.steps-help p {
    margin: 0;
}

.steps-help b {
    font-weight: 600;
}

.steps-help kbd {
    border-color: var(--blue-200);
    background: #FFFFFF;
    color: var(--blue-800);
}

.steps-help code {
    padding: 0 4px;
    border: 1px solid var(--blue-100);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--blue-900);
    font-size: 11.5px;
}

/* Telefonon, amíg a lap nyitva van, az alatta lévő oldal nem görög. */
.kind-locked,
.kind-locked body {
    overflow: hidden;
}

/* Szöveg mód: a szövegdoboz kitölti a szerkesztő szélességét, magas, és fix szélességű betűvel a jelölések (## , [adat]) jól olvashatók. */
ld-steps {
    display: block;
}

ld-steps .task-steps-input {
    display: block;
    width: 100%;
    min-height: 420px;
    box-sizing: border-box;
    padding: 12px 14px;
    border-radius: 10px;
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 13.5px;
    line-height: 1.6;
    resize: vertical;
}

/* ===== 43. ütem: Megbízók – adatlap új megjelenéssel („43. ütem” a tervvásznon) ===== */

/* A megbízó színe változóként is (a kezdőbetűs logó hátteréhez, a színmintához és az élő mintához). */
.client-color-narancs { --client: #9A5B00; }
.client-color-kek { --client: #1F4FB8; }
.client-color-zold { --client: #156B3E; }
.client-color-lila { --client: #7A2E8E; }
.client-color-piros { --client: #8E2418; }
.client-color-palakek { --client: #3F5170; }
.client-color-turkiz { --client: #0F766E; }
.client-color-rozsa { --client: #A1286A; }
.client-color-barna { --client: #7C4A1E; }
.client-color-indigo { --client: #4338CA; }
.client-mark-0 { --client: var(--warn); }
.client-mark-1 { --client: var(--blue-700); }
.client-mark-2 { --client: var(--ok); }
.client-mark-3 { --client: var(--purple); }
.client-mark-4 { --client: var(--bad-ink); }
.client-mark-5 { --client: var(--gray-600); }

.client-initials[class*="client-color-"],
.client-initials[class*="client-mark-"] {
    background: var(--client);
    border-color: var(--client);
    color: #FFFFFF;
}

/* Elrendezés: balra a lista (300 px), jobbra az adatlap. */
.client-settings {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 14px;
}

.client-list {
    padding: 8px;
}

.client-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px 8px;
}

.client-list-head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.client-row {
    min-height: 52px;
    padding: 6px 8px;
    border-radius: 9px;
}

.client-row[aria-current] {
    background: var(--blue-50);
    box-shadow: inset 3px 0 0 var(--blue-600);
}

.client-row strong {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    font-weight: 600;
}

.client-row small {
    color: var(--gray-600);
}

.client-logo-small {
    width: 36px;
    height: 36px;
    font-size: 13px;
}

.client-new-row {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 8px 4px 2px;
    border: 1.5px dashed var(--blue-300);
    border-radius: 9px;
    color: var(--blue-700);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.client-new-row:hover,
.client-new-row[aria-current] {
    background: var(--blue-50);
}

.client-archived {
    margin-top: 8px;
}

.client-archived summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border-radius: 8px;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    cursor: pointer;
}

.client-archived summary:hover {
    background: var(--gray-50);
}

/* Az adatlap fejléce: logó (rajta „csere” ikon), név, a lényeg egy sorban, jobbra „Ügyfelei”. */
.client-back {
    display: none;
}

.client-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}

.client-head-logo {
    position: relative;
    flex: none;
    border-radius: 14px;
}

.client-head-logo:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: 3px;
}

.client-logo-head {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    font-size: 22px;
}

.client-logo-new {
    background: var(--blue-50);
    border: 1.5px dashed var(--blue-300);
    color: var(--blue-700);
}

.client-head-logo-edit {
    position: absolute;
    right: -6px;
    bottom: -6px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--gray-600);
    box-shadow: var(--shadow-1);
}

.client-head-main {
    min-width: 0;
    flex: 1;
}

.client-head-main h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.015em;
}

.client-facts-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--gray-600);
    font-size: 12.5px;
}

.client-facts-line b {
    color: var(--gray-900);
    font-weight: 600;
}

.client-facts-line a {
    font-weight: 600;
}

.client-head-action {
    flex: none;
}

/* A kártyák: Alapadatok és Székhely egymás mellett, a Megjelenés teljes szélességben. */
.client-form {
    display: block;
    border: 0;
    padding: 0;
    background: none;
    box-shadow: none;
}

/* Két oszlop; egy sor kártyái egyforma magasak (Alapadatok–Székhely, Megjelenés–Elszámolás). */
.client-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.client-card-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.client-card-section .card-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.client-card-section .client-address {
    max-width: none;
}

.client-card-section .client-address legend {
    margin-bottom: 4px;
}

/* A Megjelenés kártyán a színminták alatt a logó. */
.client-appearance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
}

/* A színminták: kerek pötty, alatta a név; a kiválasztott gyűrűvel és kék háttérrel. */
.client-swatches {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-swatches legend,
.client-logo-label {
    margin-bottom: 6px;
    padding: 0;
    font-weight: 600;
}

.client-logo-label {
    display: block;
}

.client-swatch-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
}

.client-swatch {
    position: relative;
}

.client-swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.client-swatch span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 7px 2px;
    border-radius: 9px;
    color: var(--gray-700);
    font-size: 11.5px;
    text-align: center;
    cursor: pointer;
}

.client-swatch span:hover {
    background: var(--gray-50);
}

.client-swatch-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--client, var(--gray-400));
}

.client-swatch-auto {
    background: conic-gradient(#9A5B00, #1F4FB8, #156B3E, #7A2E8E, #8E2418, #9A5B00);
}

.client-swatch input:checked + span {
    background: var(--blue-50);
    color: var(--gray-900);
    font-weight: 600;
}

.client-swatch input:checked + span .client-swatch-dot {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 4px var(--blue-600);
}

.client-swatch input:focus-visible + span {
    outline: 3px solid var(--ld-primary);
    outline-offset: -1px;
}

@media (forced-colors: active) {
    .client-swatch input:checked + span {
        outline: 2px solid Highlight;
    }
}

/* Élő minta: így látszik a megbízó a Feladatok listáján (a választott szín CSS-sel követi a választást). */
.client-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    background: var(--gray-25);
}

.client-preview-bar {
    flex: none;
    width: 4px;
    height: 26px;
    border-radius: 2px;
    background: var(--client);
}

.client-preview b {
    display: block;
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 500;
}

.client-preview small {
    display: block;
    color: var(--client);
    font-size: 12px;
}

.client-appearance:has(input[name="Input.Color"][value="narancs"]:checked) .client-preview { --client: #9A5B00; }
.client-appearance:has(input[name="Input.Color"][value="kek"]:checked) .client-preview { --client: #1F4FB8; }
.client-appearance:has(input[name="Input.Color"][value="zold"]:checked) .client-preview { --client: #156B3E; }
.client-appearance:has(input[name="Input.Color"][value="lila"]:checked) .client-preview { --client: #7A2E8E; }
.client-appearance:has(input[name="Input.Color"][value="piros"]:checked) .client-preview { --client: #8E2418; }
.client-appearance:has(input[name="Input.Color"][value="palakek"]:checked) .client-preview { --client: #3F5170; }
.client-appearance:has(input[name="Input.Color"][value="turkiz"]:checked) .client-preview { --client: #0F766E; }
.client-appearance:has(input[name="Input.Color"][value="rozsa"]:checked) .client-preview { --client: #A1286A; }
.client-appearance:has(input[name="Input.Color"][value="barna"]:checked) .client-preview { --client: #7C4A1E; }
.client-appearance:has(input[name="Input.Color"][value="indigo"]:checked) .client-preview { --client: #4338CA; }

/* A logó a Megjelenés kártyában: előnézet és a feltöltő mező egymás mellett. */
.client-logo-field .logo-edit {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.client-logo-field .client-logo-preview {
    width: 88px;
    height: 88px;
    font-size: 28px;
}

.client-logo-field .dropzone {
    min-height: 96px;
    padding: 10px;
}

.client-logo-field .upload-row {
    margin-top: 10px;
}

.client-logo-field .upload-row .button-small {
    flex: none;
}

/* A ragadós Mentés-sáv az űrlap alján. */
.client-savebar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 10px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-2);
}

.client-savebar > :first-child {
    flex: 1;
}

.client-savebar .button-small {
    flex: none;
}

.client-save {
    min-width: 130px;
    justify-content: center;
}

/* Az archiválás külön, csendes sáv a lap alján; a gomb piros keretes (a visszahozás nem). */
.client-danger {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    box-shadow: none;
    color: var(--gray-600);
    font-size: 12.5px;
}

.client-danger h3 {
    margin: 0;
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 600;
}

.client-danger p {
    margin: 2px 0 0;
}

.client-danger-icon {
    flex: none;
    color: var(--gray-500);
}

.client-danger .button-small {
    flex: none;
    margin-left: auto;
}

.client-archive {
    border-color: var(--bad-border);
    color: var(--bad);
}

.client-archive:hover {
    background: var(--bad-bg);
}

/* Üres állapot: nincs még megbízó. */
.client-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 40px 20px;
    border-style: dashed;
    text-align: center;
}

.client-empty h2 {
    margin: 0;
    font-size: 18px;
}

.client-empty p {
    max-width: 460px;
    margin: 0;
    color: var(--gray-600);
    font-size: 13.5px;
}

.client-empty-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--blue-50);
    color: var(--blue-600);
}

@media (max-width: 1100px) {
    .client-cards {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Telefonon: a lista és az adatlap külön nézet; a sorok 56 px-esek, a Mentés-sáv alul a képernyőhöz tapad. */
@media (max-width: 900px) {
    .client-settings {
        grid-template-columns: minmax(0, 1fr);
    }

    .client-settings.is-picked .client-list,
    .client-settings:not(.is-picked) .client-detail {
        display: none;
    }

    .client-back {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        font-weight: 600;
    }

    .client-row {
        min-height: 56px;
    }

    .client-head {
        flex-wrap: wrap;
    }

    .client-head-main {
        flex: 1 1 calc(100% - 96px);
    }

    .client-head-action {
        flex: 1 1 100%;
        min-height: 44px;
        justify-content: center;
    }

    .client-swatch span {
        min-height: 44px;
    }

    .client-swatch-dot {
        width: 32px;
        height: 32px;
    }

    .client-savebar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        margin: 0;
        border-width: 1px 0 0;
        border-radius: 0;
    }

    .client-savebar .button-small,
    .client-save {
        min-height: 44px;
    }

    .client-detail {
        padding-bottom: 80px;
    }

    .client-danger {
        flex-wrap: wrap;
    }

    .client-danger .button-small {
        min-height: 44px;
    }
}

/* A ragadós (telefonon rögzített) Mentés-sáv ne takarja a billentyűzettel fókuszba hozott mezőt. */
html:has(.client-savebar) {
    scroll-padding-bottom: 88px;
}

.client-logo-field .dropzone input {
    scroll-margin-top: 120px;
}

/* ===== 44. ütem: Megbízó – a részem az elszámolásból ===== */

/* Az Elszámolás kártyán a mező alatt a példa. */
.client-share {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

/* A mező a százalékjellel egy egységben (a jel nem része az értéknek, a felolvasónak a címke mondja). */
.input-suffix {
    display: flex;
    align-items: stretch;
    max-width: 160px;
}

.field .input-suffix input {
    min-width: 0;
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.input-suffix > span {
    display: grid;
    place-items: center;
    width: 40px;
    border: 1px solid var(--gray-300);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    background: var(--gray-50);
    color: var(--gray-600);
    font-weight: 600;
}

/* A példa: kék keretben a kétszínű sáv (a tiéd kék, a megbízóé szürke) és az összegek. */
.client-share-sample {
    padding: 12px 14px;
    border: 1px solid var(--blue-200);
    border-radius: 10px;
    background: var(--blue-50);
}

.client-share-title {
    margin: 0 0 6px;
    color: var(--blue-900);
    font-size: 12px;
    font-weight: 600;
}

progress.client-share-bar {
    display: block;
    width: 100%;
    height: 14px;
    border: 0;
    border-radius: 7px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    background: var(--gray-200);
    color: var(--blue-600);
}

progress.client-share-bar::-webkit-progress-bar {
    border-radius: 7px;
    background: var(--gray-200);
}

progress.client-share-bar::-webkit-progress-value {
    background: var(--blue-600);
    transition: width var(--ease);
}

progress.client-share-bar::-moz-progress-bar {
    background: var(--blue-600);
}

.client-share-figures {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin: 6px 0 0;
    color: var(--gray-700);
    font-size: 12.5px;
}

.client-share-figures b {
    color: var(--gray-900);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.client-share-note {
    margin: 8px 0 0;
    color: var(--gray-600);
    font-size: 12px;
    line-height: 1.5;
}

@media (forced-colors: active) {
    progress.client-share-bar {
        border: 1px solid CanvasText;
    }
}

@media (prefers-reduced-motion: reduce) {
    progress.client-share-bar::-webkit-progress-value {
        transition: none;
    }
}

@media (max-width: 900px), (pointer: coarse) {
    .field .input-suffix input {
        min-height: 44px;
    }
}

/* Telefonon négy színminta egy sorban (a hat túl szűk a nevekhez). */
@media (max-width: 640px) {
    .client-swatch-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Tájékoztató kártya (a UI UX Pro Max consistency szabálya szerint): a hosszabb, „így működik” jellegű tudnivaló kék keretben,
   mint a sablonok „Következő időszak” sávja és a lépések súgója. A rövid, egy mezőre vonatkozó súgó szürke szöveg marad. */
.info-note {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 9px 11px;
    border: 1px solid var(--blue-200);
    border-radius: 8px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 12.5px;
    line-height: 1.5;
}

.info-note svg {
    flex: none;
    margin-top: 1px;
    color: var(--blue-600);
}

.info-note b {
    font-weight: 600;
}

.client-logo-field .info-note {
    margin-top: 10px;
}

/* A sablonlista szakaszcsíkja lépésenként (a CSP miatt stílus nélkül): a szakasz első lépése előtt kis rés. */
.template-segs {
    gap: 1px;
}

.template-segs i {
    flex: 1 1 0;
    min-width: 1px;
}

.template-segs i.is-break:not(:first-child) {
    margin-left: 3px;
}

/* A logó kiválasztáskor azonnal feltöltődik (js/dropzone.js); a gomb csak JavaScript nélkül kell (a menu.js „menu-js” osztálya jelzi). */
.menu-js .upload-fallback {
    display: none;
}

/* ===== 45. ütem: Tevékenységi kódok – átlátható lista és betöltés (a 40. ütem tokenjeivel) ===== */

/* Az évjáratok kódrendszerenként: egy kártya a rendszer nevével, benne az évjáratok gombként, a legfrissebb jelvénnyel. */
.code-systems {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.code-system {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
}

.code-system-name {
    display: flex;
    flex-direction: column;
    flex: none;
    min-width: 150px;
    margin: 0;
}

.code-system-name b {
    color: var(--gray-900);
    font-size: 14px;
    font-weight: 700;
}

.code-system-name small {
    color: var(--gray-500);
    font-size: 12px;
}

.code-year-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.code-year-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--gray-300);
    border-radius: 9px;
    background: var(--ld-surface);
    color: var(--gray-700);
    font-size: 13.5px;
    text-decoration: none;
    transition: background var(--ease), border-color var(--ease);
}

.code-year-link b {
    font-weight: 700;
}

.code-year-link small {
    color: var(--gray-600);
    font-size: 12px;
}

.code-year-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.code-year-link[aria-current="page"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
    color: var(--blue-800);
}

.code-badge {
    display: inline-flex;
    align-items: center;
    padding: 0 7px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.code-badge-latest {
    color: var(--ok);
    background: var(--ok-bg);
    border-color: var(--ok-border);
}

.code-badge-older {
    color: var(--gray-600);
    background: var(--gray-100);
    border-color: var(--gray-200);
}

/* Balra a kódlista, jobbra a betöltés; keskenyebb képernyőn egymás alatt. */
.code-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 400px;
    gap: 14px;
    align-items: start;
}

.code-list {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.code-list-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 14px 16px 12px;
}

.code-list-head .card-title {
    margin: 0;
    font-size: 17px;
}

.code-list-meta {
    color: var(--gray-500);
    font-size: 12.5px;
}

.code-list-head .code-add {
    margin-left: auto;
}

.code-list .code-search {
    flex-wrap: nowrap;
    padding: 0 16px 12px;
}

.code-search-box {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 6px 0 11px;
    border: 1px solid var(--gray-400);
    border-radius: 9px;
    background: var(--ld-surface);
    color: var(--gray-500);
}

.code-search-box:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.code-search .code-search-box input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
}

/* A saját × gomb a keresést is törli (a böngészőé csak a mezőt), ezért a böngészőé nem kell. */
.code-search-box input::-webkit-search-cancel-button {
    -webkit-appearance: none;
    appearance: none;
}

.code-search-clear {
    display: grid;
    flex: none;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.code-search-clear[hidden],
.menu-js .code-search-submit {
    display: none;
}

.code-search-clear:hover {
    background: var(--gray-200);
    color: var(--gray-900);
}

.code-results {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0 16px 12px;
    color: var(--gray-600);
    font-size: 12.5px;
}

.code-results b {
    color: var(--gray-900);
}

.code-table {
    margin: 0;
}

.code-table .code-cell {
    width: 110px;
}

.code-chip {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-900);
    font: 600 12.5px/1.45 ui-monospace, Consolas, monospace;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* A keresés találata: a kódkezdet a jelvényen, a szövegrészlet a megnevezésben sárgán. */
.code-chip.is-hit,
.code-name mark {
    background: #FFF1B8;
    border-color: #F1D77A;
    color: inherit;
}

.code-name mark {
    border-radius: 3px;
    padding: 0 1px;
}

.code-table .code-action {
    width: 56px;
    text-align: right;
}

/* Csendes ceruza a sor végén: rámutatáskor és fókuszkor kap keretet. */
.code-edit {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--gray-500);
    transition: background var(--ease), border-color var(--ease), color var(--ease);
}

.code-table tr:hover .code-edit,
.code-edit:focus-visible {
    border-color: var(--gray-300);
    background: var(--ld-surface);
    color: var(--blue-700);
    box-shadow: var(--shadow-1);
}

.code-edit:hover {
    border-color: var(--blue-300);
    background: var(--blue-50);
}

.code-pager {
    padding: 10px 16px;
    border-top: 1px solid var(--gray-100);
    font-size: 12.5px;
}

.code-pager-range {
    flex: 1;
}

.code-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 26px 20px 30px;
    text-align: center;
}

.code-no-results .empty-icon {
    background: var(--gray-100);
    color: var(--gray-500);
}

.code-no-results h3 {
    margin: 0;
    font-size: 15px;
}

.code-no-results p {
    max-width: 440px;
    margin: 0;
    color: var(--gray-600);
    font-size: 13px;
}

.code-no-results .buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

.code-no-results .buttons > * {
    flex: 0 0 auto;
    width: auto;
}

.code-no-results .buttons svg {
    margin-right: 4px;
}

.code-rename-context {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    color: var(--gray-600);
    font-size: 12.5px;
}

/* A betöltés: számozott lépések, színes előnézet, a gombok a kártya alján. */
.code-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-import {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.code-import > .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 14px 16px 0;
    font-size: 15px;
}

.code-import > .card-title svg {
    color: var(--gray-500);
}

.code-import-lead {
    margin: 4px 0 0;
    padding: 0 16px;
    color: var(--gray-600);
    font-size: 12.5px;
}

.code-import-form {
    gap: 0;
}

.code-import-form > .alert,
.code-import-form > .server-errors {
    margin: 12px 16px 0;
}

.code-steps {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.code-step {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    padding: 12px 16px;
}

.code-step + .code-step {
    border-top: 1px solid var(--gray-100);
}

.code-step-no {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--blue-600);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
}

.code-step.is-done .code-step-no {
    background: var(--ok);
}

.code-step-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.code-step-title {
    margin: 0;
    padding: 0;
    color: var(--gray-900);
    font-size: 13.5px;
    font-weight: 600;
}

.code-system-choice span {
    flex-direction: column;
    gap: 0;
    min-height: 44px;
    font-size: 13px;
    font-weight: 600;
}

.code-system-choice small {
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 500;
}

.code-system-choice input:checked + span small {
    color: var(--blue-100);
}

.code-system-choice {
    min-inline-size: 0;
}

.code-preview-status:focus {
    outline: none;
}

.code-year-field {
    margin: 0;
}

.code-import .info-note code {
    padding: 0 4px;
    border: 1px solid var(--blue-200);
    border-radius: 4px;
    background: var(--ld-surface);
    font: 600 11.5px ui-monospace, Consolas, monospace;
}

.code-preview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
}

.code-preview > div {
    display: flex;
    flex-direction: column-reverse;
    gap: 1px;
    padding: 8px 9px;
    border: 1px solid;
    border-radius: 9px;
}

.code-preview dt {
    font-size: 11.5px;
    font-weight: 600;
}

.code-preview dd {
    margin: 0;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.code-preview .is-new {
    color: var(--ok);
    background: var(--ok-bg);
    border-color: var(--ok-border);
}

.code-preview .is-changed {
    color: var(--warn);
    background: var(--warn-bg);
    border-color: var(--warn-border);
}

.code-preview .is-same {
    color: var(--gray-600);
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.code-preview .is-skipped {
    color: var(--orange);
    background: var(--orange-bg);
    border-color: var(--orange-border);
}

.code-skipped-list summary {
    color: var(--blue-700);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}

.code-import-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.code-import-actions .button {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.code-keep-note {
    margin: 0;
}

.page-header .button-link svg,
.code-main .empty-action .button-link svg {
    margin-right: 6px;
    vertical-align: -3px;
}

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

/* Táblagépen és telefonon 44 px-es érintési célok. */
@media (max-width: 1100px), (pointer: coarse) {
    .code-edit,
    .code-search-clear {
        width: 44px;
        height: 44px;
    }

    .code-year-link {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .code-system {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .code-year-link {
        min-height: 44px;
    }

    /* Telefonon a kódok sorokban: fent a jelvény, alatta a megnevezés, jobbra a mindig látható ceruza. */
    .code-table thead {
        display: none;
    }

    .code-table,
    .code-table tbody {
        display: block;
    }

    .code-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: center;
        gap: 2px 10px;
        padding: 9px 12px;
        border-top: 1px solid var(--gray-100);
    }

    .code-table td {
        display: block;
        padding: 0;
        border: 0;
        background: none !important;
    }

    .code-table .code-cell,
    .code-table .code-name {
        grid-column: 1;
        width: auto;
    }

    .code-table .code-action {
        grid-column: 2;
        grid-row: 1 / span 2;
        width: auto;
    }

    .code-edit {
        width: 44px;
        height: 44px;
        border-color: var(--gray-200);
        color: var(--blue-700);
    }

    .code-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .code-import-actions {
        position: sticky;
        bottom: 0;
    }
}

@media (forced-colors: active) {
    .code-chip.is-hit,
    .code-name mark {
        outline: 1px solid Highlight;
    }

    .code-year-link[aria-current="page"] {
        outline: 2px solid Highlight;
    }
}

@media (prefers-reduced-motion: reduce) {
    .code-year-link,
    .code-edit {
        transition: none;
    }
}

/* ===== 46. ütem: OptiDesk-kapcsolat – áttekinthető állapot és beállítás (a 40. ütem tokenjeivel) ===== */

/* Kapcsolat nélkül: bevezető, balra a három lépés és a kulcs, jobbra mit kapsz. */
.optidesk-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.optidesk-intro-main,
.optidesk-intro-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 22px;
}

.optidesk-intro-side {
    border-left: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.optidesk-intro .card-title {
    margin: 0;
    font-size: 19px;
}

.optidesk-intro-lead {
    margin: 0;
    color: var(--gray-600);
    font-size: 13px;
}

.optidesk-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.optidesk-steps li {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr);
    gap: 10px;
    color: var(--gray-700);
    font-size: 13px;
}

.optidesk-steps b {
    color: var(--gray-900);
}

.optidesk-step-no {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--blue-600);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
}

.optidesk-label {
    margin: 0;
    color: var(--gray-500);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* A kulcs mezője a megjelenítés gombbal (a gomb csak JavaScripttel látszik). */
.optidesk-key-form {
    gap: 10px;
}

.optidesk-key-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--gray-400);
    border-radius: 9px;
    background: var(--ld-surface);
    overflow: hidden;
}

.optidesk-key-input:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100);
}

.optidesk-key-input input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    border-radius: 0;
    outline: 0;
    background: transparent;
    font-family: ui-monospace, Consolas, monospace;
}

.optidesk-reveal {
    display: none;
    flex: none;
    place-items: center;
    width: 44px;
    border: 0;
    border-left: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
    cursor: pointer;
}

.menu-js .optidesk-reveal {
    display: grid;
}

.optidesk-reveal:hover,
.optidesk-reveal[aria-pressed="true"] {
    background: var(--blue-50);
    color: var(--blue-700);
}

.optidesk-reveal:focus-visible {
    outline: 3px solid var(--ld-primary);
    outline-offset: -3px;
}

.optidesk-key-form .buttons svg,
.optidesk-refresh svg {
    margin-right: 6px;
    vertical-align: -3px;
}

[data-busy-text][aria-busy="true"] {
    cursor: progress;
    opacity: 0.85;
}

/* Kapcsolódva: fent az állapot (iroda, jelvény, tények, frissítés), hibánál sárgán az ok és a teendő. */
.optidesk-status {
    padding: 0;
    gap: 0;
    overflow: hidden;
}

.optidesk-status-main {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
}

.optidesk-status-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--blue-600);
    color: #FFFFFF;
}

.optidesk-status.has-error .optidesk-status-icon {
    border: 1px solid var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.optidesk-status-text {
    min-width: 0;
}

.optidesk-status .card-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0;
    font-size: 19px;
}

.optidesk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.optidesk-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.optidesk-pill.is-ok {
    border-color: var(--ok-border);
    background: var(--ok-bg);
    color: var(--ok);
}

.optidesk-pill.is-warn {
    border-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.optidesk-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
    color: var(--gray-600);
    font-size: 12.5px;
}

.optidesk-facts li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.optidesk-facts svg {
    color: var(--gray-400);
}

.optidesk-facts b {
    color: var(--gray-900);
    font-weight: 600;
}

.optidesk-key {
    font-family: ui-monospace, Consolas, monospace;
}

.optidesk-refresh {
    flex: none;
    margin-left: auto;
}

.optidesk-error {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin: 0 20px 16px;
    padding: 10px 12px;
    border: 1px solid var(--warn-border);
    border-radius: 10px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-size: 12.5px;
}

.optidesk-error svg {
    flex: none;
    margin-top: 1px;
    color: var(--warn);
}

.optidesk-error b {
    display: block;
}

.optidesk-schedule {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px 20px;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-25);
    color: var(--gray-600);
    font-size: 12.5px;
}

.optidesk-schedule svg {
    flex: none;
    color: var(--gray-400);
}

/* Az átvilágítás számlálói és mire használja a program, egymás mellett. */
.optidesk-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.optidesk-card .card-title svg {
    margin-right: 6px;
    color: var(--gray-500);
    vertical-align: -3px;
}

.optidesk-counts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.optidesk-counts li {
    display: flex;
}

.optidesk-counts li > * {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow var(--ease);
}

.optidesk-counts a:hover {
    box-shadow: var(--shadow-2);
}

.optidesk-counts b {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.optidesk-counts small {
    font-size: 11.5px;
    font-weight: 500;
}

.optidesk-counts .is-ok {
    border-color: var(--ok-border);
    background: var(--ok-bg);
    color: var(--ok);
}

.optidesk-counts .is-warn {
    border-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.optidesk-counts .is-mute {
    border-color: var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
}

.optidesk-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 0;
    font-size: 13px;
}

.optidesk-links a {
    display: inline-block;
    padding: 4px 0;
}

.optidesk-uses {
    margin: 0;
    padding: 0;
    list-style: none;
}

.optidesk-uses li {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-top: 1px solid var(--gray-100);
}

.optidesk-uses li:first-child {
    border-top: 0;
}

.optidesk-use-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--blue-50);
    color: var(--blue-700);
}

.optidesk-uses b {
    display: block;
    color: var(--gray-900);
    font-size: 13.5px;
    font-weight: 600;
}

.optidesk-uses small {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
}

.optidesk-uses em {
    padding: 0 7px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
    line-height: 18px;
    white-space: nowrap;
}

.optidesk-uses em.is-write {
    border-color: var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-700);
}

/* A feladatok átvétele lezárult (az OptiDesk kivezette a Feladatokat): csak egy tájékoztató marad. */
.optidesk-retired {
    margin: 0;
}

.optidesk-danger form {
    flex: none;
    margin-left: auto;
}

/* A kulcs cseréje összecsukva (ritka lépés); hibánál nyitva jön. */
.optidesk-rekey {
    padding: 0;
    gap: 0;
}

.optidesk-rekey summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--gray-500);
    cursor: pointer;
    list-style: none;
}

.optidesk-rekey summary::-webkit-details-marker {
    display: none;
}

.optidesk-rekey summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 2px solid var(--gray-400);
    border-bottom: 2px solid var(--gray-400);
    transform: rotate(45deg);
    transition: transform var(--ease);
}

.optidesk-rekey[open] summary::after {
    transform: rotate(-135deg);
}

.optidesk-rekey summary b {
    color: var(--gray-900);
    font-size: 13.5px;
    font-weight: 600;
}

.optidesk-rekey summary small {
    margin-left: 6px;
    font-size: 12px;
}

.optidesk-rekey .optidesk-key-form {
    padding: 0 16px 16px;
}

@media (max-width: 1100px) {
    .optidesk-grid,
    .optidesk-intro {
        grid-template-columns: minmax(0, 1fr);
    }

    .optidesk-intro-side {
        border-top: 1px solid var(--gray-100);
        border-left: 0;
    }
}

@media (max-width: 640px) {
    .optidesk-status-main {
        flex-wrap: wrap;
        gap: 12px;
        padding: 14px;
    }

    .optidesk-status-icon {
        width: 44px;
        height: 44px;
    }

    .optidesk-refresh,
    .optidesk-refresh .button-secondary {
        width: 100%;
        margin-left: 0;
    }

    .optidesk-refresh .button-secondary {
        min-height: 44px;
    }

    .optidesk-error {
        margin: 0 14px 14px;
    }

    .optidesk-schedule {
        padding: 10px 14px;
    }

    .optidesk-counts small,
    .optidesk-rekey summary small {
        display: none;
    }

    .optidesk-intro-main,
    .optidesk-intro-side {
        padding: 16px 14px;
    }

    .optidesk-intro .optidesk-key-form .buttons {
        position: sticky;
        bottom: 0;
        padding: 10px 0;
        background: var(--ld-surface);
    }

    .optidesk-intro .optidesk-key-form .button {
        width: 100%;
        min-height: 44px;
    }
}

@media (forced-colors: active) {
    .optidesk-pill,
    .optidesk-counts li > * {
        border-color: CanvasText;
    }
}

@media (prefers-reduced-motion: reduce) {
    .optidesk-counts a,
    .optidesk-rekey summary::after {
        transition: none;
    }
}

/* ===== 47. ütem: Munka › Áttekintés – feladatok, havi zárás, munkaidő (a 40. ütem tokenjeivel) ===== */

.overview-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.month-step {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
}

.month-step-arrow {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    color: var(--gray-600);
}

.month-step-arrow:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.month-step-arrow.is-disabled {
    color: var(--gray-300);
}

.month-step-label {
    margin: 0;
    padding: 0 10px;
    color: var(--gray-900);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.overview-bar-note {
    margin: 0;
    color: var(--gray-500);
    font-size: 12.5px;
}

/* Öt számláló; a színes csík mellett a szöveg is elmondja, mi van mögötte. */
.overview-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.overview-kpis li {
    display: flex;
}

.overview-kpi {
    position: relative;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    padding: 12px 14px 12px 18px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    overflow: hidden;
}

.overview-kpi::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--kpi, var(--gray-300));
}

a.overview-kpi:hover {
    border-color: var(--gray-300);
    box-shadow: var(--shadow-2);
}

.overview-kpi b {
    color: var(--gray-900);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.overview-kpi b small {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 600;
}

.overview-kpi > small {
    color: var(--gray-500);
    font-size: 11.5px;
    font-weight: 500;
}

.overview-kpi.is-late {
    --kpi: var(--bad-strong, #D92D20);
}

.overview-kpi.is-late b {
    color: var(--bad);
}

.overview-kpi.is-soon {
    --kpi: var(--warn-strong);
}

.overview-kpi.is-waiting {
    --kpi: var(--purple);
}

.overview-kpi.is-closed {
    --kpi: var(--ok-strong);
}

.overview-kpi.is-time {
    --kpi: var(--blue-500);
}

/* Megbízónként egy kártya. */
.overview-clients {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 14px;
    align-items: start;
    margin: 0;
    padding: 0;
    list-style: none;
}

.overview-card {
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.overview-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.client-logo-medium {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    font-size: 15px;
}

.overview-card-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.overview-card-head h3 a {
    color: var(--gray-900);
    text-decoration: none;
}

.overview-card-head h3 a:hover {
    text-decoration: underline;
}

.overview-card-head small {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
}

.overview-card-more {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

.overview-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.overview-section-title {
    font-size: inherit;
    font-weight: 400;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 0 0 10px;
}

.overview-section-title b {
    color: var(--gray-900);
    font-size: 13px;
}

.overview-section-title small {
    color: var(--gray-500);
    font-size: 12px;
}

.overview-section-title a {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
}

/* A havi zárás négyzetrácsa: ügyfelenként egy négyzet; a piros gyűrű a lejártat jelzi (a jelmagyarázat szövege is). */
.close-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    gap: 16px;
    align-items: center;
}

.close-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 4px;
    list-style: none;
}

.close-grid li,
.close-legend i {
    display: block;
    border-radius: 4px;
    background: var(--gray-200);
}

.close-grid li {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.close-grid li::after {
    content: "";
}

.close-grid .is-done::after,
.close-legend .is-done::after {
    content: "✓";
}

.close-grid .is-progress::after,
.close-legend .is-progress::after {
    content: "◐";
}

.close-grid .is-waiting::after,
.close-legend .is-waiting::after {
    content: "‖";
    color: #4A2E05;
}

.close-grid .is-open::after,
.close-legend .is-open::after {
    content: "○";
    color: var(--gray-700);
}

.close-grid .is-done,
.close-legend .is-done {
    background: var(--ok-strong);
}

.close-grid .is-progress,
.close-legend .is-progress {
    background: var(--blue-500);
}

.close-grid .is-waiting,
.close-legend .is-waiting {
    background: var(--warn-strong);
}

.close-grid .is-open,
.close-legend .is-open {
    background: var(--gray-300);
    box-shadow: inset 0 0 0 1px var(--gray-500);
}

.close-grid .is-none,
.close-legend .is-none {
    background: repeating-linear-gradient(45deg, var(--ld-surface) 0 3px, var(--gray-100) 3px 5px);
    box-shadow: inset 0 0 0 1.5px var(--gray-300);
}

.close-grid .is-late,
.close-grid .is-open.is-late {
    box-shadow: 0 0 0 2px var(--ld-surface), 0 0 0 3.5px var(--bad);
}

.close-big {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    text-align: center;
}

.close-big b {
    color: var(--gray-900);
    font-size: 30px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.close-big b small {
    color: var(--gray-500);
    font-size: 16px;
    font-weight: 700;
}

.close-big span {
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 600;
}

.close-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    color: var(--gray-600);
    font-size: 12px;
}

.close-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* A jelmagyarázat négyzete ugyanazzal a jellel, mint a rácsé. */
.close-legend i {
    display: grid;
    place-items: center;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    color: #FFFFFF;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
}

.close-legend .is-late-mark {
    background: var(--ld-surface);
    box-shadow: 0 0 0 2px var(--bad);
}

.close-legend b {
    color: var(--gray-900);
    font-variant-numeric: tabular-nums;
}

.close-generate {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 10px 0 0;
    padding: 8px 10px;
    border: 1px solid var(--blue-200);
    border-radius: 9px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 12.5px;
}

.close-generate svg {
    flex: none;
    color: var(--blue-600);
}

.close-generate span {
    flex: 1 1 200px;
}

.close-generate a {
    font-weight: 700;
    white-space: nowrap;
}

/* A határidők: nap (és mennyi van hátra), cím, ügyfél, állapot; a sor a feladatra visz. */
.deadline-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.deadline-list li + li {
    border-top: 1px solid var(--gray-100);
}

.deadline-list a {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    padding: 6px 4px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
}

.deadline-list a:hover {
    background: var(--gray-50);
}

.deadline-due {
    font-size: 12.5px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.deadline-due small {
    display: block;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 500;
}

.deadline-due.is-late {
    color: var(--bad);
}

.deadline-due.is-soon {
    color: var(--warn);
}

.deadline-text {
    min-width: 0;
}

.deadline-text b {
    display: block;
    overflow: hidden;
    color: var(--gray-900);
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deadline-text small {
    display: block;
    color: var(--gray-600);
    font-size: 12px;
}

.deadline-more {
    margin: 6px 0 0;
    color: var(--gray-500);
    font-size: 12.5px;
}

/* A kártya alja: munkaidő fajtánként, linkek. */
.overview-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 12px 16px;
    background: var(--gray-25);
    color: var(--gray-600);
    font-size: 12.5px;
}

.overview-card-foot > svg {
    color: var(--gray-400);
}

.overview-card-foot b {
    color: var(--gray-900);
}

.time-bar {
    display: flex;
    width: 120px;
    height: 8px;
    border-radius: 4px;
    background: var(--gray-200);
    overflow: hidden;
}

.time-bar i {
    display: block;
}

.time-bar .is-bookkeeping {
    background: var(--orange);
}

.time-bar .is-taxreturn {
    background: var(--purple);
}

.time-bar .is-payroll {
    background: var(--blue-500);
}

.time-bar .is-other {
    background: var(--gray-400);
}

.time-bar .g-1 { flex-grow: 1; }
.time-bar .g-2 { flex-grow: 2; }
.time-bar .g-3 { flex-grow: 3; }
.time-bar .g-4 { flex-grow: 4; }
.time-bar .g-5 { flex-grow: 5; }
.time-bar .g-6 { flex-grow: 6; }
.time-bar .g-7 { flex-grow: 7; }
.time-bar .g-8 { flex-grow: 8; }
.time-bar .g-9 { flex-grow: 9; }
.time-bar .g-10 { flex-grow: 10; }
.time-bar .g-11 { flex-grow: 11; }
.time-bar .g-12 { flex-grow: 12; }
.time-bar .g-13 { flex-grow: 13; }
.time-bar .g-14 { flex-grow: 14; }
.time-bar .g-15 { flex-grow: 15; }
.time-bar .g-16 { flex-grow: 16; }
.time-bar .g-17 { flex-grow: 17; }
.time-bar .g-18 { flex-grow: 18; }
.time-bar .g-19 { flex-grow: 19; }
.time-bar .g-20 { flex-grow: 20; }

.time-kinds {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
}

.time-kinds span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.time-kinds i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
}

.time-kinds .is-bookkeeping {
    background: var(--orange);
}

.time-kinds .is-taxreturn {
    background: var(--purple);
}

.time-kinds .is-payroll {
    background: var(--blue-500);
}

.overview-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-left: auto;
}

.overview-card-links a {
    font-weight: 600;
    white-space: nowrap;
}

.overview-due {
    margin: 0;
}

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

/* Táblagépen és telefonon 44 px-es érintési célok. */
@media (max-width: 1100px), (pointer: coarse) {
    .month-step-arrow {
        width: 44px;
        height: 44px;
    }

    .overview-card-more,
    .overview-section-title a,
    .overview-card-links a,
    .deadline-more a,
    .close-generate a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding: 0 4px;
    }
}

@media (max-width: 640px) {
    .overview-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-clients {
        grid-template-columns: minmax(0, 1fr);
    }

    .close-summary {
        grid-template-columns: minmax(0, 1fr) 80px;
        gap: 10px;
    }

    .close-grid {
        grid-template-columns: repeat(9, minmax(0, 1fr));
    }

    .deadline-list a {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .deadline-list .pill {
        grid-column: 2;
        justify-self: start;
    }

    /* Keskeny képernyőn a három link külön sorba kerül, és ott tördelhet. */
    .overview-card-links {
        flex-basis: 100%;
        margin-left: 0;
    }
}

@media (forced-colors: active) {
    .close-grid li,
    .close-legend i {
        border: 1px solid CanvasText;
    }

    .close-grid .is-late {
        outline: 2px solid Highlight;
    }
}

/* ===== 48. ütem: Feladatok generálása – átlátható kijelölés (a 40. ütem tokenjeivel) ===== */

.gen-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 4px;
}

.gen-top .generation-period {
    margin: 0;
}

.gen-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gen-stats li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
}

.gen-stats b {
    font-variant-numeric: tabular-nums;
}

.gen-stats .is-new,
.gen-tag.is-new {
    border-color: var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-700);
}

.gen-stats .is-exists,
.gen-tag.is-exists {
    border-color: var(--gray-200);
    background: var(--gray-100);
    color: var(--gray-600);
}

.gen-stats .is-skipped,
.gen-tag.is-skipped {
    border-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.gen-views {
    display: inline-flex;
    margin-left: auto;
    border: 1px solid var(--gray-300);
    border-radius: 9px;
    background: var(--ld-surface);
    overflow: hidden;
}

.gen-views a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    color: var(--gray-700);
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
}

.gen-views a + a {
    border-left: 1px solid var(--gray-200);
}

.gen-views a[aria-current="page"] {
    background: var(--blue-600);
    color: #FFFFFF;
}

/* Az eszközsor csak JavaScripttel (a gombjai ott működnek). */
.gen-tools {
    display: none;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
}

.menu-js .gen-tools {
    display: flex;
}

.gen-tools > button {
    flex: 0 0 auto;
    width: auto;
}

.gen-tools .gen-quiet {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.gen-tools-sep {
    width: 1px;
    height: 24px;
    margin: 0 4px;
    background: var(--gray-200);
}

.gen-tools .chip[aria-pressed="true"] {
    border-color: var(--blue-600);
    background: var(--blue-600);
    color: #FFFFFF;
}

.gen-dot {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    margin-right: 5px;
    border-radius: 50%;
    background: var(--client, var(--gray-400));
}

.gen-tools .chip .gen-dot {
    margin-right: 0;
}

.gen-count {
    margin: 0 0 0 auto;
    color: var(--gray-600);
    font-size: 13px;
    font-weight: 600;
}

/* Sablononként: összecsukható kártya, a fejléc jelölője az egész sablont jelöli; a sorok három oszlopban. */
.gen-group {
    position: relative;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
    overflow: hidden;
}

.gen-group-all {
    display: none;
    position: absolute;
    top: 14px;
    left: 12px;
    z-index: 1;
    width: 24px;
    height: 24px;
    margin: 0;
}

.menu-js .gen-group-all {
    display: block;
}

.gen-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    padding: 12px 40px 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
    cursor: pointer;
    list-style: none;
    position: relative;
}

.menu-js .gen-group-head {
    padding-left: 46px;
}

.gen-group-head::-webkit-details-marker {
    display: none;
}

.gen-group-head::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 2px solid var(--gray-400);
    border-bottom: 2px solid var(--gray-400);
    transform: rotate(45deg);
    transition: transform var(--ease);
}

.gen-group details:not([open]) .gen-group-head {
    border-bottom: 0;
}

.gen-group details:not([open]) .gen-group-head::after {
    margin-top: -3px;
    transform: rotate(-45deg);
}

.gen-group-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    min-width: 0;
}

.gen-group-title h2 {
    margin: 0;
    color: var(--gray-900);
    font-size: 14.5px;
    font-weight: 700;
}

.gen-group-title small {
    flex-basis: 100%;
    color: var(--gray-500);
    font-size: 12px;
}

.gen-group-counts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.gen-tag {
    padding: 1px 8px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.gen-group .generation-rows {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gen-group .generation-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    min-height: 48px;
    border-right: 1px solid var(--gray-100);
}

.gen-group .generation-row:nth-child(3n) {
    border-right: 0;
}

.gen-group .generation-row label b {
    font-weight: 600;
}

.gen-group .generation-row small {
    display: flex;
    align-items: center;
    color: var(--gray-600);
}

.gen-group .generation-row.is-exists {
    color: var(--gray-500);
}

.gen-group .generation-row .gen-tag {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ügyfelenként: táblázat, sorban az ügyfelek, oszlopban a sablonok. */
.gen-matrix-wrap {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-1);
}

.gen-matrix {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.gen-matrix th,
.gen-matrix td {
    height: 44px;
    padding: 0 10px;
    border-bottom: 1px solid var(--gray-100);
    text-align: center;
}

.gen-matrix thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    height: auto;
    padding: 10px 10px 8px;
    background: var(--gray-25);
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
    vertical-align: bottom;
}

.gen-matrix thead th small {
    display: block;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 500;
}

.gen-matrix thead th .gen-all {
    margin-top: 6px;
}

.gen-matrix input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin: 0;
}

/* A cella egésze a jelölő címkéje (44 px-es érintési cél). */
.gen-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

.gen-skip-mark {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--warn-border);
    border-radius: 5px;
    background: var(--warn-bg);
    color: var(--warn);
    font-size: 12px;
    font-weight: 800;
}

/* Az ügyfél neve vízszintes görgetésnél is látszik. */
.gen-matrix tbody th,
.gen-matrix thead th.gen-matrix-name {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--ld-surface);
    box-shadow: 1px 0 0 var(--gray-200);
}

.gen-matrix thead th.gen-matrix-name {
    z-index: 3;
    background: var(--gray-25);
}

.gen-skipped {
    padding: 10px 12px;
    border: 1px solid var(--warn-border);
    border-radius: 10px;
    background: var(--warn-bg);
    font-size: 12.5px;
}

.gen-skipped h2 {
    margin: 0 0 4px;
    color: var(--warn);
    font-size: 13px;
}

.gen-skipped ul {
    margin: 0;
    padding-left: 18px;
}

.gen-matrix .gen-matrix-name {
    text-align: left;
    white-space: nowrap;
}

.gen-matrix tbody th {
    font-weight: 600;
}

.gen-matrix tbody th > * {
    vertical-align: middle;
}

.gen-matrix tbody th span {
    display: inline-block;
    margin-left: 8px;
}

.gen-matrix tbody th small {
    display: flex;
    align-items: center;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 500;
}

.gen-matrix .gen-all {
    display: none;
}

.menu-js .gen-matrix .gen-all {
    display: inline-block;
}

.gen-matrix td.is-none {
    color: var(--gray-300);
}

.gen-exists {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 800;
}

.gen-matrix tbody tr:hover > * {
    background: var(--blue-50);
}

.gen-legend {
    margin: 0;
}

/* Alul ragadós sáv a kijelöltek számával; a fókuszált sort nem takarhatja. */
.generation-form {
    scroll-padding-bottom: 96px;
}

.generation-foot {
    justify-content: flex-start;
    gap: 10px 12px;
    box-shadow: var(--shadow-2);
}

.generation-foot > svg {
    flex: none;
    color: var(--gray-400);
}

.generation-foot .muted {
    flex: 1 1 260px;
    font-size: 13px;
}

.generation-foot .button {
    min-width: 200px;
}

/* A megerősítő ablak szövege soronként (a sablononkénti összefoglaló). */
.modal-confirm .modal-text {
    white-space: pre-line;
}

html {
    scroll-padding-bottom: 96px;
}

/* Táblagépen és telefonon 44 px-es célok. */
@media (max-width: 1100px), (pointer: coarse) {
    .gen-views a {
        min-height: 44px;
    }

    .gen-group .generation-row input {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 1100px) {
    .gen-group .generation-rows {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gen-group .generation-row:nth-child(3n) {
        border-right: 1px solid var(--gray-100);
    }

    .gen-group .generation-row:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 640px) {
    .gen-views {
        margin-left: 0;
    }

    .gen-count {
        flex-basis: 100%;
        margin-left: 0;
    }

    .gen-group .generation-rows {
        grid-template-columns: minmax(0, 1fr);
    }

    .gen-group .generation-row {
        border-right: 0;
    }

    .generation-foot .button {
        width: 100%;
        min-height: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gen-group-head::after {
        transition: none;
    }
}

/* ===== 49. ütem: Bérszámla (471) – fő tábla elöl, lenyíló hónap, levezetés (a 40. ütem tokenjeivel) ===== */

.wage-head .ck-title p {
    margin-top: 1px;
    font-size: 12.5px;
}

.wage-saved {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid var(--ok-border);
    border-radius: 999px;
    background: var(--ok-bg);
    color: var(--ok);
    font-size: 12px;
    font-weight: 700;
}

.wage-save {
    color: var(--gray-600);
}

/* Az évsáv: 12 jelvény a hónap nevével és állapotjellel; kattintásra az a hónap nyílik. */
.wage-strip {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 6px;
    margin: 12px 0;
}

.wage-pip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-height: 52px;
    padding: 6px 2px;
    border: 1px solid var(--gray-200);
    border-radius: 9px;
    background: var(--ld-surface);
    color: var(--gray-600);
    font: inherit;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.wage-pip:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.wage-pip i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--gray-200);
    color: #FFFFFF;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.wage-pip.is-ok i {
    background: var(--ok);
}

.wage-pip.is-bad i {
    background: var(--bad-strong);
}

.wage-pip.is-part i {
    background: var(--warn-strong);
    color: var(--warn-ink);
}

.wage-pip.is-nowage i {
    background: var(--gray-100);
    color: var(--gray-600);
}

.wage-pip.is-empty i {
    background: var(--ld-surface);
    box-shadow: inset 0 0 0 1.5px var(--gray-300);
    color: var(--gray-500);
}

.wage-pip[aria-current="true"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
    color: var(--blue-800);
}

/* A fő tábla: a hónap gombja nyíllal jelzi, melyiké nyitott; alul az év összesen sora. */
.wage-grid-box {
    container-type: inline-size;
}

.wage-caret {
    display: inline-block;
    width: 14px;
    color: var(--gray-500);
}

.wage-grid tfoot .wage-total th,
.wage-grid tfoot .wage-total td {
    padding: 8px;
    border-top: 2px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-900);
    font-weight: 800;
}

/* A kiválasztott hónap részletei a sora alatt (a görgetett tábla látható szélességében). */
.wage-grid > tbody > tr.wage-detail-row > td {
    padding: 0 8px 10px;
    border-bottom: 2px solid var(--blue-200);
    background: var(--blue-50);
    text-align: left;
    white-space: normal;
}

.wage-detail {
    position: sticky;
    width: 100%;
    left: 8px;
    max-width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--blue-200);
    border-radius: 12px;
    background: var(--ld-surface);
    box-shadow: var(--shadow-2);
    color: var(--gray-900);
    font-size: 13px;
    overflow: hidden;
}

@supports (width: 1cqw) {
    .wage-detail {
        width: calc(100cqw - 16px);
    }
}

.wage-detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.wage-detail-head h4 {
    margin: 0;
    font-size: 14px;
}

.wage-detail-head small {
    color: var(--gray-500);
    font-size: 12px;
}

.wage-collapse {
    display: none;
    margin-left: auto;
}

.menu-js .wage-collapse {
    display: inline-flex;
}

.wage-detail-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr);
    gap: 16px;
    align-items: start;
    padding: 14px;
}

.wage-detail-body[hidden] {
    display: none;
}

.wage-detail-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.wage-detail-main .ws-sum {
    margin: 0;
}

/* A részletek szakaszai összecsukhatók; a fejlécük rövid összefoglalót mutat. */
.wage-sec {
    border-top: 1px solid var(--gray-100);
}

.wage-sec > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 10px;
    min-height: 40px;
    padding: 10px 0 6px 20px;
    cursor: pointer;
    list-style: none;
    position: relative;
}

.wage-sec > summary::-webkit-details-marker {
    display: none;
}

.wage-sec > summary::before {
    content: "▸";
    position: absolute;
    left: 2px;
    color: var(--gray-500);
}

.wage-sec[open] > summary::before {
    content: "▾";
}

.wage-sec > summary span {
    font-size: 13.5px;
    font-weight: 700;
}

.wage-sec > summary small {
    color: var(--gray-600);
    font-size: 12px;
}

.wage-sec > .ws-box,
.wage-sec > .ws-subhead,
.wage-sec > div,
.wage-sec > small {
    margin-bottom: 8px;
}

.wage-extras {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px 12px;
}

.wage-extras .wage-note {
    grid-column: 1 / -1;
}

/* A kiegészítők mezői rendes mezők (a fő tábla cellastílusa ne hasson rájuk). */
.wage-detail .wage-extras input {
    width: 100%;
    min-height: 40px;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid var(--gray-400);
    border-radius: 8px;
    background: var(--ld-surface);
    text-align: left;
}

.wage-detail .wage-extras input:focus {
    outline: 2px solid var(--blue-600);
    outline-offset: 1px;
}

/* A levezetés: áthozott maradék + bruttó − levonások − kifizetve = maradék, előjellel (nem csak színnel). */
.wage-flow {
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
}

.wage-flow h5 {
    margin: 0;
    font-size: 13.5px;
}

.wage-flow-lead {
    margin: 2px 0 8px;
    color: var(--gray-500);
    font-size: 12px;
}

.wage-flow dl {
    margin: 0;
}

.wage-flow dl > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 7px 0;
    border-top: 1px solid var(--gray-100);
}

.wage-flow dl > div:first-child {
    border-top: 0;
}

.wage-flow dt {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 8px;
    align-items: center;
    font-size: 13px;
}

.wage-flow dt i {
    grid-row: span 2;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-style: normal;
    font-weight: 800;
}

.wage-flow dt i.is-plus {
    background: var(--blue-50);
    color: var(--blue-700);
}

.wage-flow dt small {
    color: var(--gray-500);
    font-size: 11.5px;
}

.wage-flow dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.wage-flow .wage-flow-total {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 2px solid var(--gray-300);
}

.wage-flow .wage-flow-total dt {
    font-weight: 700;
}

.wage-flow .wage-flow-total dd {
    color: var(--bad);
    font-size: 16px;
}

.wage-flow .wage-flow-total.is-zero dd {
    color: var(--ok);
}

.wage-why {
    margin: 10px 0 0;
    padding: 9px 11px;
    border: 1px solid var(--warn-border);
    border-radius: 9px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-size: 12.5px;
}

.wage-why .link-button {
    display: inline;
    min-height: 0;
    padding: 0;
    font-weight: 700;
}

/* A bérlap két füle (Áttekintés, Részletek): a sor végi „Részletek ›” gomb, a hónapváltó a 12 hónap állapotával, a Részletek táblája. */
.wage-tabs {
    margin: 4px 0 10px;
}

.wage-open-cell {
    text-align: right;
}

.wage-open {
    white-space: nowrap;
}

.wage-hint {
    display: block;
    margin: 8px 2px 0;
}

.wage-step {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    margin: 0 0 12px;
}

.wage-step-name {
    min-width: 92px;
    font-size: 16px;
    text-align: center;
}

.wage-step .is-disabled {
    opacity: .4;
    cursor: default;
}

.wage-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-left: 6px;
}

.wage-dot {
    min-width: 44px;
    min-height: 32px;
    padding: 0 6px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--ld-surface);
    color: var(--gray-600);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.wage-dot.is-ok {
    border-color: var(--ok);
    background: var(--ok-bg);
    color: var(--ok);
}

.wage-dot.is-bad {
    border-color: var(--bad);
    background: var(--bad-bg, #FDECEA);
    color: var(--bad);
}

.wage-dot.is-miss {
    border-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

/* A kijelölt hónap: vastag alsó szegély (a körvonal a fókuszé marad). */
.wage-dot[aria-current="true"] {
    box-shadow: inset 0 -3px 0 var(--blue-600);
    font-weight: 700;
}

.wage-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    margin: 6px 0 0;
    font-size: 14px;
}

.wage-sub small {
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 400;
}

.wage-cell-note {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 400;
}

/* A becsúszó nézet eltolása ne adjon vízszintes görgetősávot. */
.wage-view {
    overflow-x: clip;
}

.wage-view > .wage-detail-body {
    padding: 0;
}

/* A csúszó váltás: rövid, csak eltolás és áttetszőség; mozgáscsökkentésnél nincs. */
.ws-slide.is-slide-next {
    animation: ws-slide-next 240ms cubic-bezier(.2, .8, .2, 1);
}

.ws-slide.is-slide-prev {
    animation: ws-slide-prev 240ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes ws-slide-next {
    from { opacity: .35; transform: translateX(40px); }
    to { opacity: 1; transform: none; }
}

@keyframes ws-slide-prev {
    from { opacity: .35; transform: translateX(-40px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .ws-slide.is-slide-next,
    .ws-slide.is-slide-prev {
        animation: none;
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .wage-dot {
        min-height: 44px;
    }
}

@media (max-width: 1100px) {
    .wage-detail-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .wage-strip {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .wage-pip {
        min-height: 56px;
    }

    .wage-sec > summary {
        min-height: 44px;
    }

    .wage-why .link-button {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .wage-extras {
        grid-template-columns: minmax(0, 1fr);
    }

    .wage-detail-body {
        padding: 10px;
    }
}

@media print {
    .wage-strip,
    .wage-collapse {
        display: none;
    }
}

/* ===== 50. ütem: Adóegyenleg – adónem-sáv, egyeztetés, évsáv, lenyíló hónap (a 49. ütem osztályaival) ===== */

.tax-main {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

/* Az adónem-sáv: kártyák jellel és szöveges állapottal; gépen törik, telefonon vízszintesen görget. */
.tax-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 8px;
}

.tax-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.tax-pick {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 160px;
    min-height: 52px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--ld-surface);
    color: var(--gray-900);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.tax-pick:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.tax-pick[aria-current="true"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
}

.tax-pick-top {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tax-pick-top b {
    font-size: 13.5px;
}

.tax-pick-top small {
    margin-left: auto;
    padding-left: 8px;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 600;
}

.tax-pick i {
    display: grid;
    flex: none;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--ld-surface);
    box-shadow: inset 0 0 0 1.5px var(--gray-300);
    color: var(--gray-600);
    font-size: 11.5px;
    font-style: normal;
    font-weight: 800;
}

.tax-pick-state {
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
}

.tax-pick.is-ok i {
    background: var(--ok);
    box-shadow: none;
    color: #FFFFFF;
}

.tax-pick.is-ok .tax-pick-state {
    color: var(--ok);
}

.tax-pick.is-bad i {
    background: var(--bad-strong);
    box-shadow: none;
    color: #FFFFFF;
}

.tax-pick.is-bad .tax-pick-state {
    color: var(--bad);
}

.tax-pick.is-mid i {
    background: var(--warn-strong);
    box-shadow: none;
    color: var(--warn-ink);
}

.tax-pick.is-mid .tax-pick-state {
    color: var(--warn);
}

.tax-pick.is-removed b {
    text-decoration: line-through;
}

.tax-pick.is-removed {
    background: var(--gray-50);
}

.tax-bar .tax-add {
    align-self: stretch;
    min-width: 110px;
    min-height: 52px;
    border-style: dashed;
    color: var(--blue-700);
    font-weight: 700;
    text-decoration: none;
}

/* Az egyeztetés: könyvelés − NAV = különbség (a műveleti jelek a kártyák között). */
.tax-rec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.tax-op {
    color: var(--gray-500);
    font-size: 20px;
    font-weight: 800;
}

/* Az évsáv negyedévenként (negyedéves és éves adónemnél felirattal). */
.tax-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.tax-quarter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.tax-months.is-quarters .tax-quarter {
    padding: 6px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.tax-quarter > small {
    grid-column: 1 / -1;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
}

/* A fő tábla: Különbség oszlop; a nyitott hónap sora kiemelve. */
.tg-grid td.tax-diff {
    font-weight: 700;
    white-space: nowrap;
}

.tg-grid td.tax-diff.is-zero {
    color: var(--ok);
    font-weight: 600;
}

.tg-grid td.tax-diff.err {
    color: var(--bad);
}

.tg-grid > tbody > tr.on > td {
    background: var(--blue-50);
}

/* A hónap részletei: hol a hiba (három összeg és tipp), megjegyzés, levezetés. */
.tax-issue {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--bad-border);
    border-radius: 10px;
    background: var(--bad-bg);
    color: var(--gray-900);
    font-size: 13px;
}

.tax-issue > b {
    color: var(--bad);
}

.tax-issue dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.tax-issue dl > div {
    padding: 6px 8px;
    border: 1px solid var(--bad-border);
    border-radius: 8px;
    background: var(--ld-surface);
}

.tax-issue dt {
    color: var(--gray-600);
    font-size: 11.5px;
}

.tax-issue dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.tax-issue p {
    margin: 0;
}

.tax-issue-acts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wage-detail .tax-note {
    align-items: stretch;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 700;
}

.wage-detail .tax-note input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--gray-400);
    border-radius: 8px;
    background: var(--ld-surface);
    font-weight: 400;
    text-align: left;
}

.wage-detail .tax-note input:focus {
    outline: 2px solid var(--blue-600);
    outline-offset: 1px;
}

.tax-flow {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.tax-flow thead th {
    padding: 0 0 6px;
    color: var(--gray-500);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: right;
    text-transform: uppercase;
}

.tax-flow tbody th {
    padding: 7px 8px 7px 0;
    border-top: 1px solid var(--gray-100);
    font-weight: 500;
    text-align: left;
}

.tax-flow tbody th small {
    display: block;
    margin-left: 30px;
    color: var(--gray-500);
    font-size: 11.5px;
}

.tax-flow tbody th i {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 6px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-style: normal;
    font-weight: 800;
}

.tax-flow tbody th i.is-plus {
    background: var(--blue-50);
    color: var(--blue-700);
}

.tax-flow td {
    padding: 7px 0 7px 10px;
    border-top: 1px solid var(--gray-100);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

/* A fő tábla cellastílusa (.ws-grid th/td) ne hasson a levezetésre. */
.wage-detail .tax-flow th,
.wage-detail .tax-flow td {
    border-right: 0;
    border-bottom: 0;
}

.wage-detail .tax-flow th {
    white-space: normal;
}

.tax-flow .tax-flow-total th,
.tax-flow .tax-flow-total td {
    border-top: 2px solid var(--gray-300);
    font-weight: 800;
}

.tax-flow .tax-flow-diff th,
.tax-flow .tax-flow-diff td {
    color: var(--bad);
    font-weight: 800;
}

.tax-flow .tax-flow-diff.is-zero th,
.tax-flow .tax-flow-diff.is-zero td {
    color: var(--ok);
}

@media (max-width: 1100px) {
    .tax-months {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .tax-rec {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
    }

    .tax-op {
        display: none;
    }

    .tax-strip {
        flex: 1 1 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .tax-bar .tax-add {
        min-height: 44px;
    }

    .tax-flow {
        font-size: 12px;
    }

    .tax-flow tbody th i {
        display: none;
    }

    .tax-flow tbody th small {
        margin-left: 0;
    }

    .tax-flow td {
        padding-left: 6px;
    }

    .tax-flow thead th {
        font-size: 10px;
        letter-spacing: 0;
    }

    .wage-detail .wage-flow {
        padding: 10px;
    }

    .tax-issue dl {
        grid-template-columns: minmax(0, 1fr);
    }
}

.tg-grid th .tax-th-note {
    display: block;
    color: var(--gray-500);
    font-size: 10.5px;
    font-weight: 600;
}

@media (max-width: 1100px), (pointer: coarse) {
    .tax-pick {
        min-height: 56px;
    }

    .tg-more summary {
        display: flex;
        align-items: center;
        min-height: 44px;
    }
}

@media print {
    .tax-bar,
    .tax-months {
        display: none;
    }
}

/* ===== 51. ütem: Kölcsönök – partner-sáv, egyeztetés, partner-kártya, lenyíló hónap (a 49–50. ütem osztályaival) ===== */

.loan-pick strong {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.loan-pick.is-new {
    border-style: dashed;
    cursor: default;
}

/* Helyben váltás (js/munkalap.js): a partner vagy adónem nézete már megvan (teli pont, a váltás azonnali), vagy épp töltődik (gyűrű).
   Díszítő jel, szöveg nélkül: a felolvasó nem mondja, és a kártya szélessége sem változik. */
.tax-pick[data-prefetch] {
    position: relative;
}

.tax-pick[data-prefetch].is-cached::after,
.tax-pick[data-prefetch].is-loading::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.tax-pick[data-prefetch].is-cached::after {
    background: var(--blue-600);
}

.tax-pick[data-prefetch].is-loading::after {
    box-shadow: inset 0 0 0 1.5px var(--gray-400);
}

/* Betöltés közben (nincs még tárolt nézet) a lap halványabb, de a helyén marad. */
form[data-soft] .tax-main[aria-busy="true"] {
    opacity: .6;
    transition: opacity .15s;
}

/* A partner-kártya: fejléc a fennálló tartozással, lenyitható adatok, tételek. */
.loan-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    overflow: hidden;
}

/* Kompakt kölcsönlap: az egyeztetés egy sorban, fülek, a partnerek balra listában, középen a tételtábla. */
.loan-rec {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-25);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.loan-rec b {
    font-weight: 700;
}

.loan-rec-diff {
    font-weight: 700;
}

.loan-rec-diff.ok {
    color: var(--ok);
}

.loan-rec-diff.bad {
    color: var(--bad);
}

.loan-rec-diff.miss {
    color: var(--gray-600);
    font-weight: 600;
}

.loan-rec-count {
    margin-left: auto;
    color: var(--gray-600);
}

.loan-rec .loan-accounts {
    display: inline-flex;
    gap: 4px;
    margin-left: 0;
}

.loan-acc {
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--ld-surface);
    color: var(--gray-700);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.loan-acc[aria-current="true"] {
    border-color: var(--blue-600);
    color: var(--blue-700);
    font-weight: 700;
}

/* Rendben esetén a teendősáv nem látszik, de a felolvasó bemondja („✓ Forintra egyezik”): a mentés után így hallható. */
.ck-todo.loan-todo.ok {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .loan-acc {
        min-width: 44px;
        min-height: 44px;
    }

    .task-side-fold summary {
        min-height: 44px;
    }
}

/* A fülek gombok (helyben váltanak): csak a gomb alapstílusa nullázva, az alsó aláhúzás a közös .tab szerint. */
.loan-tabs .tab {
    border-width: 0 0 2px;
    border-style: solid;
    border-color: transparent;
    background: none;
    font: inherit;
    font-weight: 500;
    cursor: pointer;
}

.loan-tabs .tab:hover {
    border-bottom-color: var(--gray-300);
}

.loan-tabs .tab[aria-current="page"] {
    border-bottom-color: var(--blue-600);
    font-weight: 600;
}

.loan-work,
.sheet-work {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.loan-side,
.sheet-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.loan-list,
.sheet-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loan-li,
.sheet-li {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 2px 8px;
    align-items: center;
    min-height: 44px;
    padding: 6px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--gray-900);
    font: inherit;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}

.loan-li:hover,
.sheet-li:hover {
    background: var(--gray-50);
}

.loan-li[aria-current="true"],
.sheet-li[aria-current="true"] {
    background: var(--blue-50);
    box-shadow: inset 3px 0 0 var(--blue-600);
}

.loan-li i,
.sheet-li i {
    font-style: normal;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
}

.loan-li.is-ok i,
.sheet-li.is-ok i {
    color: var(--ok);
}

.loan-li.is-mid i,
.sheet-li.is-mid i {
    color: var(--warn);
}

.loan-li.is-bad i,
.sheet-li.is-bad i {
    color: var(--bad);
}

.loan-li b,
.sheet-li b {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loan-li strong,
.sheet-li strong {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.loan-li small,
.sheet-li small {
    grid-column: 2 / 4;
    color: var(--gray-600);
    font-size: 11.5px;
}

.loan-add,
.sheet-add {
    align-self: stretch;
}

.loan-items {
    max-height: 62vh;
    overflow: auto;
}

.loan-items .ls-grid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--ld-surface);
}

@media (max-width: 900px) {
    .loan-work,
    .sheet-work {
        grid-template-columns: minmax(0, 1fr);
    }

    .loan-list,
    .sheet-list {
        flex-direction: row;
        overflow-x: auto;
    }

    .loan-li,
    .sheet-li {
        flex: 0 0 220px;
        border: 1px solid var(--gray-200);
    }
}

/* A munkalapok közös fejléce: a cím (az ügyfél lapján) és a leírás egy sorban, alatta az eszközsor (év, állapot, mentés állapota,
   egy kiemelt művelet, ikongombok); az összegzés négy cellában. */
.wsheet .wage-head .ck-title {
    flex: 1 1 100%;
}

.wsheet .wage-saved {
    gap: 6px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--gray-600);
    font-weight: 500;
}

.wsheet .wage-saved::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--ok);
}

/* A lap magától ment: a Mentés gomb csak tartalék (JavaScript nélkül a nojs.css mutatja; sikertelen mentésnél és hibánál látszik). */
.wsheet .wage-save {
    display: none;
}

.wsheet[data-save-failed] .wage-save,
.wsheet[data-failed="1"] .wage-save {
    display: inline-flex;
}

.wsheet[data-save-failed] .wage-saved::before,
.wsheet[data-failed="1"] .wage-saved::before {
    background: var(--bad);
}

.ck-icon {
    justify-content: center;
    width: 32px;
    padding: 0;
    list-style: none;
}

.ck-icon::-webkit-details-marker {
    display: none;
}

.ck-main {
    gap: 6px;
}

.sheet-kpi {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.2fr);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-25);
    overflow: hidden;
}

.sheet-kpi-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 8px 14px;
    border-right: 1px solid var(--gray-100);
}

.sheet-kpi-cell:last-child {
    border-right: 0;
}

.sheet-kpi-cell > span:first-child {
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.sheet-kpi-cell > b {
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.sheet-kpi-cell > small {
    color: var(--gray-600);
    font-size: 12px;
}

.sheet-kpi-cell.is-ok > b {
    color: var(--ok);
}

.sheet-kpi-cell.is-bad > b {
    color: var(--bad);
}

.sheet-kpi-cell .loan-accounts {
    align-self: flex-start;
    margin-top: 4px;
    margin-left: 0;
}

@media (max-width: 700px) {
    .sheet-kpi {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sheet-kpi-cell:nth-child(2) {
        border-right: 0;
    }

    .sheet-kpi-cell:nth-child(-n + 2) {
        border-bottom: 1px solid var(--gray-100);
    }
}

/* Az adónemlista: fejsor, az elszámolás címkében, szám csak eltérésnél, a még üres adónem halványabban, szaggatott „+ Adónem”. */
.sheet-list-head {
    display: flex;
    justify-content: space-between;
    padding: 2px 8px 4px;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.sheet-tag {
    margin-right: 6px;
    padding: 0 5px;
    border-radius: 5px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 11px;
    font-weight: 600;
}

.sheet-li.is-none b {
    color: var(--gray-600);
    font-weight: 500;
}

.sheet-li.is-bad strong {
    color: var(--bad);
}

.sheet-li .tg-tv {
    vertical-align: 1px;
}

.sheet-add {
    border-style: dashed;
    text-decoration: none;
}

@media (max-width: 640px) {
    .ck-icon {
        width: 44px;
        min-height: 44px;
    }
}

/* Adóegyenleg: a havi tábla a lista mellett; az átvezetés jele, oszlopa és a csukott üres hónapok. A 9–10 oszlopos táblának kell a hely:
   a lista keskenyebb, az összegcellák kisebbek; ha így sem fér ki (keskenyebb képernyő), a lista a tábla fölé kerül. */
.sheet-main {
    min-width: 0;
}

.tax-main .sheet-work {
    grid-template-columns: 176px minmax(0, 1fr);
}

.tax-main .sheet-main .ws-grid td input[data-money] {
    min-width: 92px;
}

/* A keskeny adónemlistában a név két sorba törhet (nem csonkul). */
.tax-main .sheet-li b {
    white-space: normal;
}

/* A csukott sor kinyitója a vízszintesen görgetett táblában is a bal szélen marad. */
.tg-fold td label {
    position: sticky;
    left: 8px;
}

@media (max-width: 640px) {
    .tg-fold label,
    .loan-removed-pick,
    .sheet-add,
    .tg-tv-open,
    .ws-month {
        min-height: 44px;
    }

    .tg-fold-toggle {
        width: 20px;
        height: 20px;
    }
}

.tax-main {
    container-type: inline-size;
}

@container (max-width: 1240px) {
    .tax-main .sheet-work {
        grid-template-columns: minmax(0, 1fr);
    }

    .tax-main .sheet-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .tax-main .sheet-li {
        flex: 0 1 220px;
        border: 1px solid var(--gray-200);
    }

    .tax-main .sheet-side {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }

    .tax-main .sheet-list-head {
        flex: 1 1 100%;
    }

    .tax-main .sheet-list-head span + span {
        display: none;
    }
}

.tg-tv {
    display: inline-flex;
    align-items: center;
    margin-left: 4px;
    padding: 0 6px;
    border: 1px solid #DDD6FE;
    border-radius: 999px;
    background: #F5F3FF;
    color: #5B21B6;
    font-size: 11px;
    font-weight: 700;
}

.tg-grid th.tv {
    background: #F5F3FF;
    color: #5B21B6;
}

.tg-grid td.tg-tvc {
    background: #FBFAFF;
}

.tg-grid td.tg-tvc b {
    display: block;
    color: #5B21B6;
}

.tg-grid td.tg-tvc small {
    display: block;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 500;
}

.tg-fold td {
    padding: 6px 10px;
    background: var(--gray-25);
    color: var(--gray-700);
    font-size: 12.5px;
    text-align: left;
}

.tg-fold label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    cursor: pointer;
}

.ws-grid:has(.tg-fold-toggle[data-fold="a"]:not(:checked)) tr.is-folded-a,
.ws-grid:has(.tg-fold-toggle[data-fold="b"]:not(:checked)) tr.is-folded-b {
    display: none;
}

.tg-tv-open {
    margin-left: 6px;
    font-size: 12px;
}

/* A kivett partnerek: a sáv alatt csukott sor, a visszajelzés a visszavétellel, a kivett partner kártyáján szürke sáv. */
.loan-removed {
    padding: 8px 12px;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    color: var(--gray-600);
    font-size: 13px;
}

.loan-removed summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-700);
}

.loan-removed-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.loan-removed-pick {
    min-height: 32px;
    padding: 4px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--gray-25);
    color: var(--gray-700);
    font: inherit;
    cursor: pointer;
}

.loan-removed-pick:hover {
    border-color: var(--gray-400);
}

.loan-removed-pick[aria-current="true"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 600;
}

@media (max-width: 640px) {
    .loan-removed summary {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .loan-removed-pick {
        min-height: 44px;
    }
}

.loan-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.loan-note span {
    flex: 1 1 280px;
}

.loan-out {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 14px;
    padding: 9px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 13px;
}

.loan-out span {
    flex: 1 1 280px;
}

.loan-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.loan-card-head h4 {
    margin: 0;
    font-size: 15px;
}

.loan-card-head small {
    color: var(--gray-600);
    font-size: 12px;
}

.loan-balance {
    margin-left: auto;
    text-align: right;
}

.loan-balance span {
    display: block;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.loan-balance strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.loan-balance strong.neg {
    color: var(--bad);
}

.loan-card > .loan-edit,
.loan-card > .loan-items,
.loan-card > .ls-actions {
    margin: 0 14px;
}

.loan-card > .loan-edit {
    border-top: 0;
}

.loan-edit .ls-fields {
    padding: 2px 0 8px;
}

.loan-card .ls-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.loan-card .ls-actions small {
    margin-left: auto;
}

/* Az egyeztetés fejléce a főkönyvi számok váltóival. */
.loan-subhead {
    flex-wrap: wrap;
    gap: 6px 10px;
}

.loan-accounts {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
}

.ls-section .wage-strip {
    margin: 8px 0 10px;
}

/* Az Eltérés oszlop és a nyitott hónap sora (mint az adóegyenlegen). */
.ls-grid td.tax-diff {
    font-weight: 700;
    white-space: nowrap;
}

.ls-grid td.tax-diff.is-zero {
    color: var(--ok);
    font-weight: 600;
}

.ls-grid td.tax-diff.err {
    color: var(--bad);
}

.ls-grid th .tax-th-note {
    display: block;
    color: var(--gray-600);
    font-size: 11px;
    font-weight: 600;
}

.ls-grid > tbody > tr.on > td {
    background: var(--blue-50);
}

.loan-split .link-button {
    min-height: 0;
    padding: 0;
    font-weight: 700;
}

/* A lenyíló sor cellájának jobb szegélye ne lógjon túl a tábla szélén (1 px-es vízszintes görgetés). */
.wage-grid > tbody > tr.wage-detail-row > td {
    border-right: 0;
}

@supports (width: 1cqw) {
    .wage-grid-box .wage-detail {
        width: calc(100cqw - 18px);
    }
}

/* Az éves összesítés: alapból csukva, a fejléc az összegzés. */
.loan-year {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
}

.loan-year > summary {
    padding: 10px 14px 10px 30px;
}

.loan-year > summary::before {
    left: 12px;
}

.loan-year > .ws-box {
    margin: 0 12px 12px;
}

@media (max-width: 760px) {
    .loan-balance {
        margin-left: 0;
        text-align: left;
    }

    .loan-accounts {
        margin-left: 0;
    }

    .loan-card .ls-actions small {
        margin-left: 0;
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .loan-split .link-button {
        min-height: 44px;
    }

    .wage-sec > summary {
        min-height: 44px;
    }
}

@media print {
    .loan-year {
        border: 0;
    }
}

/* ===== 52. ütem: Megbízók › Számlacsomagok – kártyák, szerkesztő, számítási példa (a 40. ütem tokenjeivel) ===== */

.client-subtabs {
    margin: 12px 0;
}

.pkg-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.pkg-empty {
    text-align: center;
}

.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.pkg-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: var(--ld-surface);
    color: var(--gray-900);
    font-size: 12.5px;
    text-decoration: none;
}

.pkg-card:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.pkg-card[aria-current="true"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
}

.pkg-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pkg-card-top b {
    font-size: 14px;
}

.pkg-kind {
    margin-left: auto;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--blue-50);
    color: var(--blue-700);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.pkg-kind.is-quota {
    background: var(--orange-bg);
    color: var(--orange);
}

.pkg-kind.is-flat {
    background: var(--ok-bg);
    color: var(--ok);
}

.pkg-price {
    font-size: 17px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.pkg-price small {
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
}

.pkg-facts {
    display: grid;
    gap: 2px;
    color: var(--gray-700);
}

.pkg-card-foot {
    padding-top: 6px;
    border-top: 1px solid var(--gray-100);
    color: var(--gray-600);
}

.pkg-card-new {
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border-style: dashed;
    color: var(--blue-700);
    font-size: 13.5px;
    font-weight: 700;
}

.pkg-archived summary {
    min-height: 32px;
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.pkg-archived ul {
    margin: 6px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.pkg-next {
    margin: 0;
}

/* A szerkesztő: balra az űrlap, jobbra a számítási példa. */
.pkg-editor {
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-margin-top: 12px;
}

.pkg-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 16px;
    align-items: start;
}

.pkg-form-card {
    padding: 0;
    overflow: hidden;
}

.pkg-form-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.pkg-form-head h3 {
    margin: 0;
    font-size: 16px;
}

.pkg-form-head > a {
    flex: none;
    width: auto;
    margin-left: auto;
}

.pkg-form-card > .alert {
    margin: 12px 16px 0;
}

.pkg-sec {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
}

.pkg-sec h4 {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 0 0 10px;
    font-size: 14px;
}

.pkg-sec h4 small {
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 500;
}

.pkg-two,
.pkg-three {
    display: grid;
    gap: 12px;
}

.pkg-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pkg-three {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    margin-top: 10px;
}

.pkg-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pkg-sec .field {
    margin: 0;
}

.pkg-suffix {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pkg-suffix > span {
    color: var(--gray-600);
    font-size: 12px;
    white-space: nowrap;
}

.pkg-num {
    width: 120px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pkg-short {
    width: 80px;
}

.pkg-tiers,
.pkg-items {
    border-collapse: collapse;
    font-size: 13px;
}

.pkg-items {
    width: 100%;
}

.pkg-tiers th,
.pkg-items th {
    padding: 4px 10px 4px 0;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

.pkg-tiers td,
.pkg-items td {
    padding: 4px 10px 4px 0;
    vertical-align: top;
}

.pkg-tiers .pkg-from {
    min-width: 56px;
    padding-top: 12px;
    color: var(--gray-600);
    font-variant-numeric: tabular-nums;
}

.pkg-items input:not(.pkg-num):not(.pkg-short) {
    width: 100%;
    min-width: 130px;
}

.pkg-items .pkg-num {
    width: 100px;
}

.pkg-sec .ws-box {
    border: 0;
}

/* A fajta: szegmentált választó rádiógombokkal (a gomb rejtve, a felirat a kattintható rész). */
.pkg-kinds {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.pkg-kinds legend {
    margin-bottom: 6px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
}

.pkg-segment {
    display: inline-flex;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    overflow: hidden;
}

.pkg-segment label {
    position: relative;
    margin: 0;
}

.pkg-segment input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.pkg-segment span {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-right: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.pkg-segment label:last-child span {
    border-right: 0;
}

.pkg-segment input:checked + span {
    background: var(--blue-600);
    color: #FFFFFF;
}

.pkg-segment input:focus-visible + span {
    outline: 2px solid var(--blue-800);
    outline-offset: -3px;
}

/* A kijelölt (kék) elemen fehér fókuszkeret, hogy látsszon. */
.pkg-segment input:checked:focus-visible + span {
    outline: 2px solid #FFFFFF;
    outline-offset: -5px;
}

@media (forced-colors: active) {
    .pkg-segment input:focus-visible + span {
        outline-color: Highlight;
    }
}

/* A fajta szerinti mezők: csak a választott fajtáé látszik (JavaScript nélkül is, :has). */
.pkg-form:has(input[name="Form.Input.Kind"][value="MonthlyTiers"]:checked) [data-kind]:not([data-kind~="MonthlyTiers"]),
.pkg-form:has(input[name="Form.Input.Kind"][value="YearlyQuota"]:checked) [data-kind]:not([data-kind~="YearlyQuota"]),
.pkg-form:has(input[name="Form.Input.Kind"][value="FlatMonthly"]:checked) [data-kind]:not([data-kind~="FlatMonthly"]) {
    display: none;
}

.pkg-versions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.pkg-versions a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    color: var(--gray-900);
    font-size: 12.5px;
    text-decoration: none;
}

.pkg-versions a[aria-current="true"] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-800);
    font-weight: 700;
}

.pkg-savebar {
    position: sticky;
    bottom: 0;
    margin: 0;
    border-radius: 0;
}

/* A számítási példa: a mezői JavaScripttel látszanak; nélküle egy mondat mondja meg, mire szól. */
.pkg-calc {
    position: sticky;
    top: 12px;
    padding: 14px 16px;
}

.pkg-calc h4 {
    margin: 0;
    font-size: 14px;
}

.pkg-calc > p {
    margin: 2px 0 8px;
}

.pkg-calc-inputs {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.menu-js .pkg-calc-inputs {
    display: grid;
}

.menu-js .pkg-calc-nojs {
    display: none;
}

.pkg-calc-js-note {
    display: none;
}

.menu-js .pkg-calc-js-note {
    display: block;
}

.pkg-calc-inputs input,
.pkg-calc-inputs select {
    width: 100%;
}

.pkg-calc-lines {
    margin: 0;
}

.pkg-calc-lines > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 7px 0;
    border-top: 1px solid var(--gray-100);
}

.pkg-calc-lines dt {
    font-size: 13px;
}

.pkg-calc-lines dt small {
    display: block;
    color: var(--gray-600);
    font-size: 11.5px;
}

.pkg-calc-lines dd {
    margin: 0;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pkg-calc-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 2px solid var(--gray-300);
    font-weight: 700;
}

.pkg-calc-total small {
    display: block;
    color: var(--gray-600);
    font-size: 11.5px;
    font-weight: 500;
}

.pkg-calc-total strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

@media (max-width: 1100px) {
    .pkg-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .pkg-calc {
        position: static;
    }
}

@media (max-width: 640px) {
    .pkg-two,
    .pkg-three {
        grid-template-columns: minmax(0, 1fr);
    }

    .pkg-segment {
        display: flex;
        flex-wrap: wrap;
    }

    .pkg-segment label {
        flex: 1 1 auto;
    }

    .pkg-tiers {
        width: 100%;
        table-layout: fixed;
    }

    .pkg-tiers th:first-child {
        width: 44px;
    }

    .pkg-tiers .pkg-from {
        min-width: 0;
    }

    .pkg-tiers input {
        min-width: 0;
    }

    .pkg-tiers .pkg-suffix,
    .pkg-tiers .pkg-num {
        width: 100%;
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .pkg-segment span,
    .pkg-versions a {
        min-height: 44px;
    }
}

/* ===== 53. ütem: Ügyfél › Díjazás – kártya, idővonal, módosítás a kártyán belül (a 40. és az 52. ütem tokenjeivel) ===== */

.fee-card {
    border-color: var(--blue-200);
    box-shadow: 0 0 0 3px var(--blue-50);
    scroll-margin-top: 12px;
}

.fee-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.fee-card-head .card-title {
    margin: 0;
}

.fee-card-head > a {
    flex: none;
    width: auto;
    margin-left: auto;
}

.fee-savebar a,
.fee-empty a {
    flex: none;
    width: auto;
}

.fee-adjust .pkg-items input {
    min-height: 36px;
}

.fee-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--blue-50);
}

.fee-head.is-feefree,
.fee-head.is-notbilled {
    background: var(--gray-50);
}

.fee-head-icon {
    display: grid;
    flex: none;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--blue-600);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 800;
}

.fee-head.is-feefree .fee-head-icon,
.fee-head.is-notbilled .fee-head-icon {
    background: var(--gray-600);
}

.fee-head b {
    font-size: 15px;
}

.fee-head small {
    display: block;
    color: var(--gray-700);
    font-size: 12px;
}

.fee-head-amount {
    margin-left: auto;
    text-align: right;
}

.fee-head-amount strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.fee-facts small {
    color: var(--gray-600);
    font-weight: 500;
}

.fee-own {
    color: var(--warn-ink, var(--warn));
}

.fee-timeline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 0;
    padding: 0 0 0 16px;
    border-left: 2px solid var(--gray-200);
    font-size: 12.5px;
    list-style: none;
}

.fee-timeline li {
    position: relative;
}

.fee-timeline li::before {
    content: "";
    position: absolute;
    top: 4px;
    left: -22px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray-300);
}

.fee-timeline li.is-now::before {
    background: var(--blue-600);
}

.fee-empty {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
    border: 1px dashed var(--gray-300);
    border-radius: 12px;
    background: var(--gray-25);
    font-size: 13px;
}

.fee-empty p {
    flex: 1 1 220px;
    margin: 0;
}

/* A módosítás a kártyán belül: mód (kártyás rádiók), csomag (rádiós lista), eltérések, megjegyzés. */
.fee-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fee-form .field {
    margin: 0;
}

.fee-modes,
.fee-packages {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.fee-modes legend,
.fee-packages legend {
    margin-bottom: 6px;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
}

.fee-packages legend small {
    color: var(--gray-600);
    font-weight: 500;
}

.fee-modes {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.fee-modes legend {
    grid-column: 1 / -1;
}

.fee-modes label,
.fee-packages label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--ld-surface);
    cursor: pointer;
}

.fee-modes label:has(input:checked),
.fee-packages label:has(input:checked) {
    border-color: var(--blue-600);
    background: var(--blue-50);
    box-shadow: inset 0 0 0 1px var(--blue-600);
}

.fee-modes input,
.fee-packages input {
    flex: none;
    margin-top: 2px;
}

.fee-modes span,
.fee-packages span {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.fee-modes small,
.fee-packages small {
    color: var(--gray-600);
    font-size: 12px;
}

.fee-packages {
    display: grid;
    gap: 6px;
}

/* A csomag és az eltérések csak a „csomag szerint” módnál (JavaScript nélkül is, :has). */
.fee-form:has(input[name="Form.Input.Mode"]:not([value="Package"]):checked) .fee-package-part {
    display: none;
}

.fee-package-part {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fee-adjust summary {
    min-height: 32px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.fee-adjust summary small {
    color: var(--gray-600);
    font-weight: 500;
}

.fee-adjust .ws-box {
    margin-top: 8px;
    border: 0;
}

.fee-savebar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--gray-100);
}

.fee-savebar > span {
    margin-right: auto;
}

.pkg-users {
    margin: 0;
    font-size: 13px;
}

.fee-now {
    display: inline-block;
    margin-right: 6px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--blue-600);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 900px), (pointer: coarse) {
    .fee-adjust summary {
        display: flex;
        align-items: center;
        min-height: 44px;
    }

    .fee-adjust .pkg-items input {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .fee-modes {
        grid-template-columns: minmax(0, 1fr);
    }

    .fee-head-amount {
        margin-left: 0;
        text-align: left;
    }
}

/* A díjcsomag-szerkesztő kompakt elrendezése (a felhasználó kérésére): fejlécsor, soronkénti díjak, rövid súgók. */
.pkg-form-card .pkg-sec {
    padding: 10px 16px 12px;
}

.pkg-form-card .pkg-sec h4 {
    margin-bottom: 8px;
    font-size: 13.5px;
}

.pkg-top {
    display: grid;
    grid-template-columns: minmax(200px, 1fr) auto auto;
    gap: 10px 14px;
    align-items: end;
}

.pkg-f {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    margin: 0;
}

.pkg-f > label,
.pkg-f > legend {
    padding: 0;
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
}

.pkg-f input {
    min-height: 36px;
}

.pkg-f-name input {
    width: 100%;
}

.pkg-top .pkg-segment span {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12.5px;
}

.pkg-versions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin-top: 10px;
}

.pkg-row-label {
    color: var(--gray-700);
    font-size: 12px;
    font-weight: 700;
}

.pkg-versions-row .pkg-versions {
    margin: 0;
}

.pkg-versions-row .pkg-versions a {
    min-height: 30px;
}

.pkg-note {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 8px 0 0;
    color: var(--gray-700);
    font-size: 12px;
}

.pkg-fee-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px 14px;
}

.pkg-fee-row .pkg-num {
    width: 110px;
}

.pkg-fee-row .pkg-num.pkg-short {
    width: 64px;
}

.pkg-tiers-box {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pkg-tiers td {
    padding: 2px 10px 2px 0;
}

.pkg-tiers .pkg-from {
    padding-top: 9px;
}

.pkg-tiers input,
.pkg-items input {
    min-height: 34px;
}

.pkg-divider {
    align-self: stretch;
    width: 1px;
    margin: 0 2px;
    background: var(--gray-200);
}

.pkg-hint {
    color: var(--gray-600);
    font-size: 11.5px;
}

.pkg-items td {
    padding: 2px 8px 2px 0;
}

@media (max-width: 1100px) {
    .pkg-top {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .pkg-top .pkg-kinds {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .pkg-top {
        grid-template-columns: minmax(0, 1fr);
    }

    .pkg-divider {
        display: none;
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .pkg-f input,
    .pkg-top .pkg-segment span,
    .pkg-tiers input,
    .pkg-items input {
        min-height: 44px;
    }
}

/* Keskeny helyen (a megbízólista mellett) a számítási példa az űrlap alá kerül, hogy az űrlap egy sorban elférjen. */
.pkg-panel {
    container-type: inline-size;
}

@container (max-width: 1000px) {
    .pkg-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .pkg-calc {
        position: static;
    }

    .pkg-calc-inputs {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* A díjcsomag-szerkesztő finomítása (a felhasználó kérésére): lágy keretek, a mértékegység a mezőben, egyforma méretek. */
.pkg-form-card input:not([type="radio"]):not([type="checkbox"]),
.pkg-form-card select {
    min-height: 38px;
    padding: 0 10px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--ld-surface);
    color: var(--gray-900);
    font-size: 13.5px;
    box-shadow: none;
}

.pkg-form-card input:not([type="radio"]):not([type="checkbox"]):hover {
    border-color: var(--gray-400);
}

.pkg-form-card input:not([type="radio"]):not([type="checkbox"]):focus {
    border-color: var(--blue-600);
    outline: 3px solid var(--blue-100, var(--blue-50));
    outline-offset: 0;
}

.pkg-form-card input::placeholder {
    color: var(--gray-500);
}

/* Az összeg és a mértékegysége egy dobozban: a mező kerete a dobozé, az egység szürke jelzés a jobb szélén. */
.pkg-form-card .pkg-suffix {
    display: inline-flex;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: var(--ld-surface);
    overflow: hidden;
}

.pkg-form-card .pkg-suffix:hover {
    border-color: var(--gray-400);
}

.pkg-form-card .pkg-suffix:focus-within {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-100, var(--blue-50));
}

.pkg-form-card .pkg-suffix input:not([type="radio"]) {
    min-height: 36px;
    border: 0;
    border-radius: 0;
    outline: 0;
}

.pkg-form-card .pkg-suffix input:focus {
    outline: 0;
}

.pkg-form-card .pkg-suffix > span {
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-left: 1px solid var(--gray-200);
    background: var(--gray-50);
    color: var(--gray-600);
    font-size: 12px;
    font-weight: 600;
}

.pkg-form-card .pkg-suffix:has(input[aria-invalid="true"]) {
    border-color: var(--bad);
}

.pkg-fee-row .pkg-num {
    width: 104px;
}

.pkg-fee-row .pkg-num.pkg-short {
    width: 52px;
}

/* A fejlécsor: a név és a fajta egy magasságban. */
.pkg-top .pkg-segment {
    border-color: var(--gray-300);
    border-radius: 8px;
}

.pkg-top .pkg-segment span {
    min-height: 36px;
}

.pkg-f > label,
.pkg-f > legend {
    color: var(--gray-600);
    font-size: 11.5px;
    letter-spacing: 0.01em;
}

.pkg-form-card .pkg-sec h4 small {
    font-size: 11.5px;
}

.pkg-users {
    padding: 8px 16px;
    background: var(--gray-25);
    color: var(--gray-700);
}

/* Az egyéb tételek: rácsos sorok egyenlő közökkel. */
.pkg-form-card .pkg-items {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.pkg-form-card .pkg-items th {
    padding: 0 8px 0 0;
    color: var(--gray-600);
    font-size: 11.5px;
}

.pkg-form-card .pkg-items td {
    padding: 0 8px 0 0;
}

.pkg-form-card .pkg-items th:nth-child(2),
.pkg-form-card .pkg-items th:nth-child(3) {
    width: 96px;
}

.pkg-form-card .pkg-items th:nth-child(4) {
    width: 160px;
}

.pkg-form-card .pkg-items input:not(.pkg-num):not(.pkg-short),
.pkg-form-card .pkg-items .pkg-short {
    width: 100%;
    min-width: 0;
}

.pkg-form-card .pkg-items .pkg-suffix {
    width: 100%;
}

.pkg-form-card .pkg-items .pkg-suffix .pkg-num {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.pkg-form-card .pkg-tiers .pkg-num {
    width: 104px;
}

.pkg-divider {
    margin: 18px 4px 0;
}

/* Érintőképernyőn és telefonon 44 px; egérrel a kompakt 38 px marad (a korábbi, szélesség szerinti szabály helyett). */
@media (min-width: 641px) and (pointer: fine) {
    .pkg-f input,
    .pkg-tiers input,
    .pkg-items input,
    .pkg-top .pkg-segment span,
    .pkg-segment span,
    .pkg-versions a {
        min-height: 36px;
    }

    .pkg-form-card .pkg-suffix input:not([type="radio"]) {
        min-height: 36px;
    }
}

@media (max-width: 640px), (pointer: coarse) {
    .pkg-form-card input:not([type="radio"]):not([type="checkbox"]),
    .pkg-form-card .pkg-suffix input:not([type="radio"]) {
        min-height: 44px;
    }
}

.pkg-form-card .pkg-items {
    table-layout: fixed;
}

.pkg-form-card .pkg-items input {
    min-width: 0;
    box-sizing: border-box;
}

.pkg-form-card .pkg-divider {
    display: none;
}

/* ===== 54. ütem: Munka › Elszámolás – havi elszámolás megbízónként, lenyíló ügyfélsor (a 40. ütem tokenjeivel) ===== */

.st-month {
    padding: 0;
    overflow: hidden;
}

.st-month-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
}

.st-month-head .card-title {
    margin: 0;
}

.st-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.st-stepper b {
    min-width: 9.5em;
    text-align: center;
    font-size: 0.9375rem;
}

.st-stepper small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-stepper .desk-btn {
    min-width: 36px;
    text-decoration: none;
}

.st-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 18px;
}

.st-kpi {
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #FFFFFF;
}

.st-kpi span {
    display: block;
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.st-kpi b {
    font-size: 1.1875rem;
    font-variant-numeric: tabular-nums;
}

.st-kpi small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-kpi.ok {
    border-color: var(--ok-border);
    background: var(--ok-bg);
}

.st-kpi.ok b {
    color: var(--ok);
}

.st-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 18px 12px;
}

.st-chips a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--gray-700);
    font-size: 0.8125rem;
    font-weight: 700;
    text-decoration: none;
}

.st-chips a[aria-current] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-800);
}

.st-chips a:focus-visible,
.st-toggle:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
}

.st-group {
    margin: 0 18px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    background: #FFFFFF;
}

.st-group-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.st-group-head h3 {
    margin: 0;
    font-size: 0.9375rem;
}

.st-group-head small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-group-total {
    margin: 0 0 0 auto;
    font-size: 0.8125rem;
    text-align: right;
}

.st-group-total b {
    font-size: 0.9375rem;
    font-variant-numeric: tabular-nums;
}

.st-table-box {
    overflow-x: auto;
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.st-table > * > tr > th,
.st-table > * > tr > td {
    padding: 0 10px;
    height: 44px;
    border-bottom: 1px solid var(--gray-100);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.st-table > thead > tr > th {
    height: auto;
    padding: 7px 10px;
    border-bottom-color: var(--gray-200);
    color: var(--gray-600);
    font-size: 0.71875rem;
}

.st-table > * > tr > .l {
    text-align: left;
}

.st-table > tbody > tr > th {
    font-weight: 600;
}

.st-table tr.on > th,
.st-table tr.on > td {
    background: var(--blue-50);
}

.st-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: var(--blue-900);
    font-weight: 700;
    text-decoration: none;
}

.st-toggle span {
    color: var(--gray-500);
}

.st-table tr.st-open-row > td {
    height: auto;
    padding: 0 10px 12px;
    background: var(--blue-50);
    text-align: left;
    white-space: normal;
}

.st-notbilled {
    margin: 0;
    padding: 9px 14px;
    color: var(--gray-500);
    font-size: 0.75rem;
}

/* A lenyíló panel (a feladat pontján is). */

.st-panel {
    container-type: inline-size;
    border: 1px solid var(--blue-200);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: var(--shadow-1);
    overflow: hidden;
    scroll-margin-top: 12px;
}

.st-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-25);
}

.st-panel-title h3,
.st-panel-title h4 {
    margin: 0;
    font-size: 0.9375rem;
}

.st-panel-title p {
    margin: 0;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-panel-links {
    margin-left: auto;
    font-size: 0.8125rem;
}

.st-form > .alert {
    margin: 12px 14px 0;
}

.st-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
}

.st-col {
    min-width: 0;
}

.st-acc {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.st-acc th,
.st-acc td {
    padding: 4px 6px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.st-acc thead th {
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
}

.st-acc .l {
    text-align: left;
}

.st-acc tbody th {
    min-width: 7em;
    font-weight: 600;
    overflow-wrap: break-word;
}

.st-acc tbody th .st-hint {
    display: block;
    font-weight: 500;
}

.st-acc .st-sum th,
.st-acc .st-sum td {
    padding-top: 8px;
    border-top: 2px solid var(--gray-200);
    font-weight: 800;
}

.st-acc .st-err-row td {
    padding: 0 6px;
    text-align: left;
}

.st-acc .st-err-row .field-error:empty {
    display: none;
}

.st-num {
    width: 7.5em;
    min-height: 36px;
    padding: 0 8px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #FFFFFF;
    font: inherit;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.st-num:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 1px;
    border-color: var(--blue-600);
}

.st-num[aria-invalid="true"] {
    border-color: var(--bad);
    background: var(--bad-bg);
}

.st-num:placeholder-shown {
    border-style: dashed;
}

.st-carried {
    display: inline-block;
    min-width: 7.5em;
    padding: 0 8px;
    color: var(--gray-600);
}

.st-hint {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-col > .st-hint {
    margin: 6px 0 12px;
}

.st-field {
    display: grid;
    gap: 4px;
    margin-bottom: 10px;
}

.st-field label {
    font-size: 0.8125rem;
    font-weight: 700;
}

.st-field .field-error:empty {
    display: none;
}

.st-facts {
    display: grid;
    gap: 6px;
    margin: 0;
    font-size: 0.8125rem;
}

.st-facts div {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.st-facts dt {
    font-weight: 700;
}

.st-facts dd {
    margin: 0;
}

.st-facts small {
    color: var(--gray-500);
}

.st-lines {
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-25);
}

.st-lines-head {
    margin: 0 0 6px;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-lines-head b {
    color: var(--gray-900);
    font-size: 0.8125rem;
}

.st-lines-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.st-lines-table th,
.st-lines-table td {
    padding: 4px 0;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}

.st-lines-table th {
    font-weight: 600;
    text-align: left;
}

.st-lines-table th small {
    display: block;
    color: var(--gray-500);
    font-weight: 500;
}

.st-lines-table td {
    padding-left: 10px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.st-lines-table tr.minus td {
    color: var(--ok-ink);
}

.st-net {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 8px 0 0;
    font-size: 0.8125rem;
}

.st-net b {
    font-size: 1.0625rem;
    font-variant-numeric: tabular-nums;
}

.st-mine {
    margin: 2px 0 0;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-align: right;
}

.st-missing {
    margin: 10px 0 0;
    padding: 8px 10px 8px 26px;
    border: 1px solid var(--warn-border);
    border-radius: 10px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-size: 0.75rem;
}

.st-missing:empty {
    display: none;
}

.st-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.st-saved {
    margin-right: auto;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-actions .desk-btn {
    min-height: 40px;
}

.st-actions .desk-btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.st-closed-note {
    margin: 10px 0 8px;
    color: var(--gray-600);
    font-size: 0.75rem;
}

.st-reopen-form {
    display: grid;
    gap: 6px;
    margin-top: 8px;
}

.st-reopen-form input {
    min-height: 40px;
}

.st-reopen-form .desk-btn {
    justify-self: start;
}

.st-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 14px;
    font-size: 0.8125rem;
}

.st-note p {
    margin: 0;
}

.st-log {
    padding: 8px 14px 12px;
    border-top: 1px solid var(--gray-100);
    font-size: 0.75rem;
}

.st-log summary {
    cursor: pointer;
    font-weight: 700;
}

.st-closeall .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .st-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* A panel a saját szélessége szerint tördel (a feladat pontján keskenyebb, mint a fülön). */
@container (max-width: 760px) {
    .st-body {
        grid-template-columns: minmax(0, 1fr);
    }
}

@container (max-width: 460px) {
    .st-body {
        padding: 12px 10px;
    }

    .st-acc th,
    .st-acc td {
        padding: 4px 3px;
    }

    .st-num {
        width: 5.5em;
    }

    .st-carried {
        min-width: 0;
        padding: 0;
    }
}

@media (max-width: 640px) {
    .st-month-head,
    .st-kpis,
    .st-chips {
        padding-left: 12px;
        padding-right: 12px;
    }

    .st-group {
        margin: 0 8px 12px;
    }

    .st-stepper {
        margin-left: 0;
    }

    .st-hide-narrow {
        display: none;
    }

    .st-table > * > tr > th,
    .st-table > * > tr > td {
        padding: 0 6px;
    }

    .st-table tr.st-open-row > td {
        padding: 0 0 10px;
    }

    .st-num {
        width: 6.5em;
        min-height: 44px;
    }
}

/* Táblagépen és érintőképernyőn 44 px-es célok. */
@media (max-width: 1100px), (pointer: coarse) {
    .st-actions .desk-btn,
    .st-reopen-form input,
    .st-reopen-form .desk-btn,
    .st-chips a,
    .st-num,
    .st-stepper .desk-btn {
        min-height: 44px;
    }

    .st-stepper .desk-btn {
        min-width: 44px;
    }
}

.st-closeall {
    display: grid;
    justify-items: end;
    gap: 4px;
}

@media print {
    .st-chips,
    .st-closeall,
    .st-actions,
    .st-reopen {
        display: none;
    }
}

/* ===== 55. ütem: Számlázás az OptiDeskbe – megbízó Számlázás kártya, Számla oszlop, küldés ellenőrzéssel ===== */

.billing-form {
    display: grid;
    gap: 14px;
}

.billing-form .fee-modes {
    margin: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.billing-form .fee-modes > .field-hint,
.billing-form .fee-modes > .field-error {
    grid-column: 1 / -1;
}

@media (max-width: 640px) {
    .billing-form .fee-modes {
        grid-template-columns: minmax(0, 1fr);
    }
}

.st-checkform {
    margin-left: auto;
}

.st-send h4:focus {
    outline: none;
}

.billing-form .buttons {
    margin: 0;
}

.st-refresh {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.st-refresh small {
    color: var(--gray-500);
    font-size: 0.75rem;
}

.st-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.st-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: #FFFFFF;
    color: var(--gray-700);
    font-size: 0.71875rem;
    font-weight: 700;
    white-space: nowrap;
}

.st-badge.od {
    border-color: var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-800);
}

.st-badge.aam {
    border-color: var(--ok-border);
    background: var(--ok-bg);
    color: var(--ok);
}

.st-billbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.8125rem;
}

.st-billbar > :last-child:not(:first-child) {
    margin-left: auto;
}

.st-billbar .button,
.st-billbar .desk-btn {
    text-decoration: none;
}

.st-send {
    margin: 12px 14px;
    padding: 14px 16px;
    border: 1px solid var(--blue-200);
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: var(--shadow-2);
    scroll-margin-top: 12px;
}

.st-send h4 {
    margin: 0;
    font-size: 0.9375rem;
}

.st-send > .st-hint {
    margin: 2px 0 10px;
}

.st-send-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.st-send-table th,
.st-send-table td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-100);
    text-align: right;
    vertical-align: top;
    font-variant-numeric: tabular-nums;
}

.st-send-table thead th {
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
}

.st-send-table .l {
    text-align: left;
}

.st-send-table tbody th {
    font-weight: 600;
}

/* A számlázható összesítő kapcsolt vállalkozásonként: eszközsor, alcímek, csoportfej, részösszeg, megadatlanok, mindösszesen.
   Saját „st-bill-” nevek: az st-group és az st-missing már a megbízói kártyáé és a hibalistáé. */
.st-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 0.8125rem;
}

.st-summary-bar > span {
    margin-right: auto;
    color: var(--gray-600);
}

.st-summary-bar .desk-btn {
    min-height: 44px;
}

.st-summary-sub {
    margin: 12px 0 6px;
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.st-send-table tr.st-bill-group > th {
    padding-top: 10px;
    border-top: 2px solid var(--blue-200);
    background: var(--blue-50);
    color: var(--blue-800);
    font-weight: 700;
}

.st-send-table tr.st-bill-group small {
    color: var(--gray-600);
    font-weight: 500;
}

.st-send-table tr.st-bill-subtotal > * {
    background: var(--gray-25);
    font-weight: 700;
}

.st-send-table tr.st-bill-missing > * {
    background: var(--warn-bg);
}

/* A megadatlanok csoportfeje is sárga (a csoportfej kék szabályánál erősebben). */
.st-send-table tr.st-bill-group.st-bill-missing > th {
    border-top-color: var(--warn-border);
    background: var(--warn-bg);
    color: var(--warn);
}

.st-send-table tr.st-bill-total > * {
    border-top: 2px solid var(--gray-300);
    font-weight: 800;
}



.st-send-table input[type="checkbox"] {
    width: 20px;
    height: 20px;
}

.st-send-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.st-send-actions a,
.st-send > .button-secondary {
    flex: none;
    width: auto;
}

.st-send-actions .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.st-withdraw {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px dashed var(--gray-300);
    border-radius: 10px;
    background: #FFFFFF;
}

.st-withdraw .desk-btn {
    margin-left: auto;
}

.st-vatwarn {
    display: block;
    max-width: 22em;
    margin-top: 4px;
    color: var(--warn-ink);
    font-size: 0.71875rem;
    white-space: normal;
}

.st-unpaid {
    margin-top: 16px;
    padding: 14px 0 0;
    overflow: hidden;
}

.st-unpaid .card-title {
    margin: 0 18px 10px;
}

@media (max-width: 1100px), (pointer: coarse) {
    .st-billbar .button,
    .st-billbar .desk-btn,
    .st-send-actions .button,
    .st-send-actions a,
    .st-withdraw .desk-btn,
    .st-refresh .desk-btn {
        min-height: 44px;
    }

    .st-send-table input[type="checkbox"] {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 640px) {
    .st-refresh {
        margin-left: 0;
    }

    .st-send {
        margin: 10px 8px;
        padding: 12px;
    }
}

@media print {
    .st-refresh,
    .st-billbar .button,
    .st-withdraw,
    .st-send-actions {
        display: none;
    }
}

/* ===== 56. ütem: Pénzügy – a saját cég számlái, tételei, cash flow-ja; kézi díjszámla az Elszámolásnál ===== */

.fn-subtabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: -4px 0 14px;
}

.fn-subtabs a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}

.fn-subtabs a[aria-current] {
    background: var(--blue-50);
    color: var(--blue-800);
}

.fn-subtabs a:focus-visible,
.fn-catform select:focus-visible {
    outline: 2px solid var(--blue-600);
    outline-offset: 2px;
}

.fn-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.fn-head .st-stepper {
    margin-left: 0;
}

.fn-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.fn-kpi {
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    background: #FFFFFF;
    min-width: 0;
}

.fn-kpi span {
    display: block;
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fn-kpi b {
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
}

.fn-kpi small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
    overflow-wrap: anywhere;
}

.fn-kpi.up b {
    color: var(--ok);
}

.fn-kpi.dn b {
    color: var(--bad);
}

.fn-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.fn-side {
    display: grid;
    gap: 14px;
}

.fn-card .card-title {
    margin: 0;
}

.fn-sub {
    margin: 2px 0 10px;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.fn-chart {
    display: block;
    width: 100%;
    height: auto;
}

.fn-axis {
    stroke: var(--gray-300);
}

.fn-in {
    fill: #15803D;
}

.fn-out {
    fill: #C2410C;
    stroke: #7C2D12;
    stroke-width: 1.5;
}

.fn-balance {
    fill: none;
    stroke: var(--blue-600);
    stroke-width: 2.5;
}

.fn-dot {
    fill: #FFFFFF;
    stroke: var(--blue-600);
    stroke-width: 2;
}

.fn-months {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin: 2px 0 0;
    padding: 0 0 0 4%;
    list-style: none;
    color: var(--gray-500);
    font-size: 0.6875rem;
    text-align: center;
}

.fn-months .fn-current {
    color: var(--gray-900);
    font-weight: 800;
}

.fn-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 8px 0 0;
    color: var(--gray-600);
    font-size: 0.75rem;
}

.fn-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.fn-key.in {
    background: #15803D;
}

.fn-key.out {
    background: #C2410C;
    box-shadow: inset 0 0 0 1.5px #7C2D12;
}

.fn-key.bal {
    height: 3px;
    background: var(--blue-600);
}

.fn-table,
.fn-entries {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.fn-table th,
.fn-table td,
.fn-entries th,
.fn-entries td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--gray-100);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.fn-table thead th,
.fn-entries thead th {
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
}

.fn-table .l,
.fn-entries .l {
    text-align: left;
}

.fn-table tbody th,
.fn-entries tbody th {
    font-weight: 600;
}

.fn-table tbody th small,
.fn-entries tbody th small {
    display: block;
    color: var(--gray-500);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.fn-table tr.on > * {
    background: var(--blue-50);
}

.fn-cats,
.fn-todos {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fn-cats li {
    display: grid;
    grid-template-columns: minmax(0, 8em) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    font-size: 0.8125rem;
}

.fn-cats span {
    overflow-wrap: anywhere;
}

.fn-cats svg {
    width: 100%;
    height: 10px;
}

.fn-bar-bg {
    fill: var(--gray-100);
}

.fn-bar {
    fill: #C2410C;
}

.fn-cats b {
    font-variant-numeric: tabular-nums;
}

.fn-todos li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
}

.fn-todos .desk-btn {
    margin-left: auto;
    text-decoration: none;
}

.fn-list {
    padding: 0;
    overflow: hidden;
}

.fn-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px 0;
}

.fn-filter .st-stepper {
    margin-left: 0;
}

.fn-filter .st-chips {
    padding: 0;
}

.fn-rule {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 12px 14px 0;
    padding: 10px 12px;
    border: 1px solid var(--blue-200);
    border-radius: 10px;
    background: var(--blue-50);
    color: var(--blue-900);
    font-size: 0.8125rem;
}

.fn-rule span {
    flex: 1 1 24em;
}

.fn-rule span:focus {
    outline: none;
}

.fn-rule .desk-btn {
    text-decoration: none;
}

.fn-empty {
    margin: 14px;
    color: var(--gray-500);
}

.fn-entries {
    margin: 0;
}

.fn-entries th,
.fn-entries td {
    padding: 6px 10px;
    vertical-align: middle;
}

.fn-entries tr.removed > * {
    color: var(--gray-600);
    text-decoration: line-through;
}

.fn-entries tr.removed .desk-btn,
.fn-entries tr.removed select {
    text-decoration: none;
}

.fn-plus {
    color: var(--ok);
    font-weight: 700;
    white-space: nowrap;
}

.fn-minus {
    font-weight: 700;
    white-space: nowrap;
}

.fn-paired {
    color: var(--ok) !important;
}

.fn-catform {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.fn-entries tbody td:first-child {
    white-space: nowrap;
}

.fn-catform {
    flex-wrap: nowrap;
}

.fn-catform select {
    width: 11em;
    max-width: 11em;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    background: #FFFFFF;
    font: inherit;
    font-size: 0.8125rem;
}

.fn-catform select.fn-miss {
    border-style: dashed;
    border-color: var(--warn-border);
    background: var(--warn-bg);
}

.fn-new {
    margin: 12px 14px 14px;
}

.fn-new summary {
    cursor: pointer;
}

.fn-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.fn-form-title {
    margin: 4px 0 0;
    font-size: 0.9375rem;
}

.fn-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12em, 1fr));
    gap: 10px 12px;
    align-items: end;
}

.fn-fields .field {
    margin: 0;
}

.fn-fields .fn-wide {
    grid-column: 1 / -1;
}

.fn-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: 0.8125rem;
}

.fn-form .buttons {
    margin: 0;
}

.fn-setup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.fn-sum {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.fn-sum div {
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
}

.fn-sum b {
    display: block;
    font-size: 1.125rem;
    font-variant-numeric: tabular-nums;
}

.fn-sum small {
    color: var(--gray-500);
}

.fn-sum .ok {
    border-color: var(--ok-border);
    background: var(--ok-bg);
}

.fn-commit {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.fn-commit a {
    flex: none;
    width: auto;
}

.fn-commit .button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.st-manual {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: #FFFFFF;
}

.st-manual h4 {
    margin: 0;
    font-size: 0.875rem;
}

.st-manual-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10em, 1fr));
    gap: 8px 12px;
}

.st-manual .field {
    margin: 0;
}

.st-manual .buttons {
    margin: 0;
}

@media (max-width: 1100px), (pointer: coarse) {
    .fn-subtabs a,
    .fn-catform select,
    .fn-catform .desk-btn,
    .fn-entries .desk-btn,
    .fn-todos .desk-btn,
    .st-manual .desk-btn {
        min-height: 44px;
    }
}

@media (max-width: 900px) {
    .fn-kpis,
    .fn-sum {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fn-grid,
    .fn-setup {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .fn-entries thead th:nth-child(2),
    .fn-entries tbody td:nth-child(2) {
        display: none;
    }
}

/* Az áttekintés kiegészítése (a felhasználó kérésére): viszonyítás, tartalék, kintlévőség, elszámolt–befolyt, kiugrások, partnerek, frissesség. */

.fn-kpis-5 {
    grid-template-columns: repeat(auto-fit, minmax(12em, 1fr));
}

.fn-delta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.fn-kpi .fn-delta {
    text-transform: none;
    letter-spacing: 0;
    color: inherit;
}

.fn-delta.up {
    background: var(--ok-bg);
    color: var(--ok-ink);
}

.fn-delta.dn {
    background: var(--bad-bg);
    color: var(--bad-ink);
}

.fn-delta.eq {
    background: var(--gray-100);
    color: var(--gray-700);
}

.fn-kpi .fn-delta.up {
    color: var(--ok-ink);
}

.fn-kpi .fn-delta.dn {
    color: var(--bad-ink);
}

.fn-kpi .fn-delta.eq {
    color: var(--gray-700);
}

.fn-big {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.fn-note {
    margin: 2px 0 6px;
    color: var(--gray-600);
    font-size: 0.8125rem;
}

.fn-bad {
    color: var(--bad);
}

.fn-bar-ok {
    fill: #15803D;
}

.fn-mark {
    fill: var(--gray-900);
}

.fn-ratio {
    min-width: 8em;
}

.fn-ratio svg {
    display: block;
    width: 100%;
    height: 8px;
}

.fn-ratio small {
    color: var(--gray-600);
}

.fn-trends li {
    grid-template-columns: minmax(0, 8em) minmax(0, 1fr) auto 4.5em;
}

.fn-trends svg {
    height: 12px;
}

.fn-trends small {
    color: var(--gray-500);
    text-align: right;
}

.fn-trends .fn-flag {
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--warn-bg);
    color: var(--warn-ink);
    font-weight: 700;
}

.fn-fresh {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.fn-fresh li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
}

.fn-fresh .desk-btn {
    margin-left: auto;
    text-decoration: none;
}

.fn-partners {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.fn-partners caption {
    padding-bottom: 4px;
    color: var(--gray-500);
    font-size: 0.6875rem;
    font-weight: 700;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.fn-partners .fn-table {
    margin-top: 0;
}

.fn-grid + .fn-grid {
    margin-top: 14px;
}

@media (max-width: 640px) {
    .fn-partners {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1100px), (pointer: coarse) {
    .fn-fresh .desk-btn {
        min-height: 44px;
    }
}

.fn-partners td,
.fn-table td {
    white-space: nowrap;
}

/* Keskeny képernyőn a kategóriasor két sorba: név, összeg, eltérés; alatta a sáv teljes szélességben. */
@media (max-width: 640px) {
    .fn-trends li {
        grid-template-columns: minmax(0, 1fr) auto auto;
    }

    .fn-trends svg {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .fn-kpis-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ===== 57. ütem: Előrejelzés – a következő 3 hónap várható egyenlege, a források és a tervezett tételek ===== */
.fe-today {
    margin: 0 0 10px;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.fe-calm {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
    color: var(--gray-700);
    font-size: 0.8125rem;
}

.fe-chart {
    display: block;
    width: 100%;
    height: auto;
}

.fe-band {
    fill: #FED7AA;
    fill-opacity: 0.55;
    stroke: none;
}

.fe-actual {
    fill: none;
    stroke: var(--blue-600);
    stroke-width: 2.5;
}

.fe-expected {
    fill: none;
    stroke: #C2410C;
    stroke-width: 2.5;
    stroke-dasharray: 7 5;
}

.fe-floor {
    stroke: #B91C1C;
    stroke-width: 1.5;
    stroke-dasharray: 2 4;
}

.fe-dot {
    fill: #FFFFFF;
    stroke: var(--blue-600);
    stroke-width: 2;
}

.fe-mark {
    fill: #FFFFFF;
    stroke: #C2410C;
    stroke-width: 2;
}

.fe-months {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 2px 0 0;
    padding: 0 0 0 1%;
    list-style: none;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-align: left;
}

.fe-months .fe-next {
    color: #9A3412;
    font-weight: 700;
}

.fe-key {
    display: inline-block;
    width: 14px;
    height: 10px;
    border-radius: 3px;
}

.fe-key.exp {
    height: 0;
    border-top: 3px dashed #C2410C;
    border-radius: 0;
}

.fe-key.band {
    background: #FED7AA;
}

.fe-key.floor {
    height: 0;
    border-top: 2px dotted #B91C1C;
    border-radius: 0;
}

.fe-key.next {
    background: #BBF7D0;
    box-shadow: inset 0 0 0 1px #86EFAC;
}

/* Az áttekintés grafikonjának halvány folytatása. */
.fe-in-next {
    fill: #15803D;
    fill-opacity: 0.28;
    stroke: #15803D;
    stroke-width: 1;
    stroke-dasharray: 3 2;
}

.fe-out-next {
    fill: #C2410C;
    fill-opacity: 0.28;
    stroke: #7C2D12;
    stroke-opacity: 0.5;
    stroke-width: 1;
    stroke-dasharray: 3 2;
}

.fe-balance-next {
    fill: none;
    stroke: var(--blue-600);
    stroke-width: 2;
    stroke-opacity: 0.7;
    stroke-dasharray: 6 5;
}

.fe-past th,
.fe-past td {
    color: var(--gray-600);
}

.fe-below {
    display: block;
    color: #B91C1C;
    font-size: 0.75rem;
    font-weight: 700;
}

.fe-range {
    color: var(--gray-600);
    white-space: nowrap;
}

.fe-plus {
    color: var(--ok);
}

.fe-minus {
    color: var(--bad);
}

.fe-pick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}

.fe-pick a[aria-current] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 700;
}

.fe-sources th {
    font-weight: 500;
}

.fe-total th,
.fe-total td {
    border-top: 2px solid var(--gray-300);
    font-weight: 800;
}

.fe-chip {
    margin-left: 6px;
    font-size: 0.6875rem;
    vertical-align: 1px;
}

.fe-planned {
    margin-top: 14px;
}

.fe-suggestions {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}

.fe-suggestions li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 10px 12px;
    border: 1px dashed #93C5FD;
    border-radius: 10px;
    background: var(--blue-50);
    font-size: 0.8125rem;
}

.fe-suggestions form,
.fe-actions form,
.fe-archived form {
    display: inline-flex;
    gap: 6px;
    margin: 0;
}

.fe-actions {
    white-space: nowrap;
}

.fe-actions .desk-btn + form {
    margin-left: 6px;
}

.fe-edit {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--blue-200);
    border-radius: 12px;
    background: var(--blue-50);
}

.fe-form-title {
    margin: 0 0 8px;
    font-size: 0.9375rem;
}

.fe-archived {
    margin-top: 12px;
    font-size: 0.8125rem;
}

.fe-archived summary {
    cursor: pointer;
    color: var(--gray-600);
    min-height: 44px;
    display: flex;
    align-items: center;
}

.fe-archived ul {
    display: grid;
    gap: 6px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.fe-archived li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    color: var(--gray-600);
}

/* Telefonon a grafikon és a táblázat helyett havi kártyák. */
.fe-cards {
    display: none;
    gap: 8px;
    margin: 6px 0 0;
    padding: 0;
    list-style: none;
}

.fe-cards li {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-left: 4px solid #C2410C;
    border-radius: 10px;
}

.fe-card-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.fe-cards small {
    color: var(--gray-600);
    font-size: 0.75rem;
}

@media (max-width: 640px) {
    .fe-desk {
        display: none;
    }

    .fe-cards {
        display: grid;
    }
}

/* ===== 58. ütem: Idő – ráfordított idő ügyfelenként és óradíj ===== */
.ti-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    margin-bottom: 12px;
}

.ti-head .st-stepper {
    margin-left: 0;
}

.ti-head small {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.ti-sort {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: var(--gray-600);
    font-size: 0.8125rem;
}

.ti-sort a[aria-current] {
    border-color: var(--blue-600);
    background: var(--blue-50);
    color: var(--blue-700);
    font-weight: 700;
}

.ti-table th small,
.ti-table td small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 400;
}

.ti-table tr.ti-below > th,
.ti-table tr.ti-below > td {
    background: var(--warn-bg);
}

.ti-open {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-weight: 700;
}

.ti-table tr.ti-detail > td {
    background: var(--gray-50);
}

ul.ti-parts {
    display: grid;
    gap: 4px;
    margin: 0 0 6px;
    padding: 0;
    list-style: none;
    max-width: 720px;
}

.ti-parts li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.ti-parts li b {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.ti-parts form {
    margin: 0;
}

.ti-link {
    font-size: 0.8125rem;
    font-weight: 400;
}

.ti-na {
    color: var(--gray-500);
}

.ti-bad {
    color: var(--bad);
    font-weight: 700;
}

.ti-ok {
    color: var(--ok);
    font-weight: 700;
}

.ti-compare {
    display: inline-grid;
    grid-template-columns: 100px auto;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.ti-compare svg {
    display: block;
    width: 100px;
    height: 10px;
}

.ti-bar-bg {
    fill: var(--gray-100);
}

.ti-bar-ok {
    fill: var(--blue-600);
}

.ti-bar-bad {
    fill: #B45309;
}

.ti-bar-target {
    stroke: var(--gray-900);
    stroke-width: 2;
}

.ti-list {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.8125rem;
}

.ti-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.ti-list li small {
    display: block;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.ti-list li > b {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.ti-new {
    margin-top: 14px;
}

.ti-target .field {
    max-width: 320px;
}

/* A KPI kis szövegében lévő jel és szöveg ne vegye át a felirat (nagybetűs) stílusát. */
.fn-kpi small span {
    display: inline;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: normal;
    text-transform: none;
}

/* ===== 56. ütem kiegészítés 2: Pénzügy › Tételek – az új tétel felül, szerkesztés a sorban ===== */
.fn-newrow {
    margin: 10px 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--blue-200);
    border-radius: 12px;
    background: var(--blue-50);
}

.fn-newrow-fields,
.fn-editrow-fields {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(130px, 0.9fr) minmax(120px, 0.8fr) minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: start;
}

.fn-newrow .field,
.fn-editrow .field {
    margin: 0;
    min-width: 0;
}

.fn-newrow-button,
.fn-editrow-buttons {
    display: flex;
    gap: 6px;
    align-self: start;
    padding-top: 22px;
}

.fn-editrow-fields {
    grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 0.9fr) minmax(0, 1.2fr) minmax(0, 1.4fr) minmax(150px, 1fr) minmax(110px, 0.8fr) auto;
}

.fn-entries tr.fn-editing > td {
    padding: 10px 8px;
    border-top: 2px solid var(--blue-600);
    border-bottom: 2px solid var(--blue-600);
    background: var(--blue-50);
}

.fn-lock-label {
    display: block;
    margin-bottom: 4px;
    color: var(--gray-700);
    font-size: 0.8125rem;
    font-weight: 600;
}

.fn-lock {
    display: flex;
    align-items: center;
    min-height: 44px;
    color: var(--gray-700);
    font-variant-numeric: tabular-nums;
}

.fn-acts {
    white-space: nowrap;
}

.fn-acts form {
    display: inline-block;
    margin: 0 0 0 6px;
}

.fn-miss-text {
    color: #92400E;
    font-style: italic;
}

@media (max-width: 1100px) {
    .fn-newrow-fields,
    .fn-editrow-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fn-newrow-button,
    .fn-editrow-buttons {
        padding-top: 0;
    }
}

@media (max-width: 640px) {
    .fn-newrow-fields,
    .fn-editrow-fields {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Telefonon az új tétel űrlapja a lista alá kerül, hogy a tételek görgetés nélkül látsszanak. */
    .fn-list {
        display: flex;
        flex-direction: column;
    }

    .fn-list > .fn-newrow {
        order: 2;
        margin-top: 14px;
    }

    .fn-editrow-buttons .button,
    .fn-editrow-buttons .desk-btn,
    .fn-newrow-button .button {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* ===== 59. ütem: Kommunikáció – kommunikációnapló és telefonszámok az ügyfél adatlapján ===== */
.ko-sub {
    margin: 2px 0 10px;
    color: var(--gray-500);
    font-size: 0.8125rem;
}

.ko-list,
.ko-phones {
    margin: 0 0 8px;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
}

.ko-list li {
    display: grid;
    grid-template-columns: 112px 28px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.ko-when {
    color: var(--gray-600);
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.ko-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--blue-50);
    color: var(--blue-700);
}

.ko-what small,
.ko-phones small {
    display: block;
    color: var(--gray-600);
    font-size: 0.8125rem;
}

.ko-min {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.ko-list form,
.ko-phones form {
    margin: 0;
}

.ko-void .ko-what b,
.ko-void .ko-min,
.ko-void > span > b {
    color: var(--gray-500);
    text-decoration: line-through;
}

.ko-sum {
    margin: 4px 0 10px;
    color: var(--gray-600);
    font-size: 0.8125rem;
}

.ko-phones li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
}

.ko-pill {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.6875rem;
    font-weight: 700;
    vertical-align: 1px;
}

@media (max-width: 640px) {
    .ko-list li {
        grid-template-columns: 28px minmax(0, 1fr) auto;
    }

    .ko-when {
        grid-column: 1 / -1;
    }

    .ko-list form {
        grid-column: 2 / -1;
    }
}

/* Az irány csak hívásnál: JS nélkül, a fajta választója szerint (a rejtett mezőt a felolvasó sem látja). */
.ko-form:has(#ko-fajta option:not([value="Call"]):checked) .ko-dir {
    display: none;
}

/* Gyors oldalváltás (js/gyors.js): a tárolt változatból mutatott lap jele, amíg a friss meg nem jön; utána „Frissítve”, vagy hibánál
   az ok, vagy ha közben írtál, a frissítés ajánlata. Asztalon fent középen, telefonon alul (a felső sáv menügombját nem takarja);
   a felugró ablakok (dialog) mindig fölötte vannak. */
.ld-gyors {
    position: fixed;
    top: 8px;
    left: 50%;
    z-index: 55;
    box-sizing: border-box;
    max-width: min(560px, calc(100vw - 24px));
    transform: translateX(-50%);
    text-align: center;
    padding: 5px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 999px;
    background: var(--ld-surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
    color: var(--gray-700, #33456B);
    font-size: 13px;
}

.ld-gyors.is-checking::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--blue-600);
    box-shadow: 0 0 0 3px var(--blue-50);
    vertical-align: 1px;
}

.ld-gyors.is-offer {
    border-color: #F5C66B;
    background: #FFF7E6;
    color: #6B3D05;
}

@media (prefers-reduced-motion: no-preference) {
    .ld-gyors.is-checking::before {
        animation: ld-gyors-pulse 1s ease-in-out infinite alternate;
    }
}

@media (max-width: 640px) {
    .ld-gyors {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
        transform: none;
        border-radius: 12px;
    }
}

@keyframes ld-gyors-pulse {
    from { opacity: .35; }
    to { opacity: 1; }
}

/* Azonnali pipálás (js/pipa.js): a pipa már látszik, a mentés a háttérben megy; a munkaterület a következő pontra vár. */
.task-check.is-saving,
.task-workspace .is-saving {
    opacity: .7;
    cursor: progress;
}

.task-workspace.is-loading {
    position: relative;
    cursor: progress;
}

.task-workspace.is-loading > * {
    opacity: .45;
}

.task-workspace.is-loading::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    border-radius: 12px 12px 0 0;
    background: var(--blue-600);
    animation: ld-pipa-load 1s ease-in-out infinite alternate;
}

@keyframes ld-pipa-load {
    from { opacity: .3; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .task-workspace.is-loading::before {
        animation: none;
    }
}

/* Kereshető választó űrlapmezőként (pl. a tétel kategóriája): a címke fölötte marad, a gomb olyan, mint egy beviteli mező. */
ld-select.form-select {
    position: relative;
    display: block;
}

/* A címke a gomb fölött, mint a többi mezőnél (a táblázat nem törő cellájában, pl. a tétel szerkesztősorában se kerüljön mellé). */
ld-select.form-select > label {
    display: block;
    margin-bottom: 6px;
}

/* A szerkesztősor a tételtábla első (dátum) cellájában van, ami nem tör: az űrlapon belül a szöveg rendesen tördelhet. */
.fn-entries tbody td:first-child .fn-editrow {
    white-space: normal;
}

ld-select.form-select .ldsel-button {
    width: 100%;
    max-width: none;
    min-height: 44px;
    padding: 0 12px;
    border-color: var(--gray-400);
    border-radius: 10px;
    color: var(--ld-text);
    font-size: 16px;
}

ld-select.form-select .ldsel-label {
    display: none;
}

ld-select.form-select .ldsel-value {
    flex: 1;
    color: var(--ld-text);
    font-weight: 400;
}

ld-select.form-select .ldsel-button:focus-visible {
    outline: 3px solid var(--blue-600);
    outline-offset: 2px;
}

/* Billentyűs tételrögzítés (js/tetelsor.js): a súgósor a sor alatt (telefonon rejtve), és az imént felvett tétel rövid kiemelése. */
.fn-keys {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 8px 0 0;
    color: var(--ld-muted);
    font-size: 13px;
}

.fn-keys-inline {
    display: inline-flex;
    align-self: center;
    margin: 0;
}

.fn-keys kbd {
    display: inline-block;
    min-width: 20px;
    padding: 0 6px;
    border: 1px solid var(--gray-300);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--ld-surface);
    color: var(--gray-700, #33456B);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 640px) {
    .fn-keys {
        display: none;
    }
}

tr.fn-added td {
    background: #ECF8F1;
}

@media (prefers-reduced-motion: no-preference) {
    tr.fn-added td {
        animation: fn-added-fade 2.5s ease-out 1s forwards;
    }
}

@keyframes fn-added-fade {
    to { background: transparent; }
}

/* Pénzügyi grafikonok (Cash flow, Előrejelzés): Ft-tengely, halvány rácsvonalak, a hónapok célterülete és a részletek kártyája
   (js/diagram.js). A hónapnevek a rajzterület alá igazítva (bal 58, jobb 8 egység a 760 széles rajzból). */
.fn-chart-box {
    position: relative;
}

.fn-chart-box .fe-chart {
    display: block;
    width: 100%;
    height: auto;
}

.fn-chart-box .fn-months,
.fn-chart-box .fe-months {
    padding: 0 1.05% 0 7.63%;
    color: var(--gray-600);
    font-size: 0.75rem;
    text-align: center;
}

/* Keskeny képernyőn a grafikon nem zsugorodik olvashatatlanra: vízszintesen görgethető (a hónapnevekkel együtt). */
@media (max-width: 640px) {
    .fn-chart-box {
        overflow-x: auto;
    }

    .fn-chart-box > svg,
    .fn-chart-box > ol {
        min-width: 600px;
    }
}

.fn-gridline {
    stroke: var(--gray-200);
    stroke-width: 1;
}

.fn-tick {
    fill: var(--gray-600);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.fn-unit {
    font-weight: 700;
}

.fn-hit {
    fill: transparent;
    cursor: default;
}

.fn-hit:hover,
.fn-hit.is-on {
    fill: rgba(31, 91, 216, .07);
}

.fn-hit:focus-visible {
    outline: none;
    fill: rgba(31, 91, 216, .1);
    stroke: var(--blue-700, #1A4AB3);
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
}

.fn-tip {
    position: absolute;
    z-index: 20;
    min-width: 210px;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--ld-surface);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .16);
    font-size: 13px;
    pointer-events: none;
}

.fn-tip b {
    display: block;
    margin-bottom: 6px;
    font-size: 13.5px;
}

.fn-tip dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 12px;
    margin: 0;
}

.fn-tip dt {
    display: flex;
    gap: 6px;
    align-items: center;
    color: var(--gray-600);
}

.fn-tip dd {
    margin: 0;
    color: var(--ld-text);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.fn-tip .key {
    display: inline-block;
    width: 12px;
    height: 3px;
    border-radius: 2px;
    background: transparent;
}

.fn-tip .key.in {
    background: #15803D;
}

.fn-tip .key.out {
    background: #C2410C;
}

.fn-tip .key.bal {
    background: var(--blue-600);
}

/* Pénzügy › Áttekintés: két önálló hasáb (a régi fn-grid sorok helyett), a kártyák hasábonként egymás alatt. */
.fn-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.fn-col {
    display: grid;
    gap: 14px;
    min-width: 0;
}

@media (max-width: 1100px) {
    .fn-cols {
        grid-template-columns: minmax(0, 1fr);
    }
}
