/* MASØN servis – čistý, Apple-style design. Mobile-first, bez externích knihoven.
   Light + dark mode (prefers-color-scheme), safe-area insety, plynulé přechody. */

:root {
    /* Plochy */
    --bg: #f5f5f7;
    --bg-blur: rgba(245, 245, 247, .72);
    --card: #ffffff;
    --surface-2: #f5f5f7;
    --surface-3: #ececef;

    /* Text */
    --ink: #1d1d1f;
    --muted: #6e6e73;
    --faint: #8e8e93;

    /* Linky a obrysy */
    --line: rgba(0, 0, 0, .08);
    --line-strong: rgba(0, 0, 0, .14);

    /* Akcenty */
    --accent: #0071e3;
    --accent-press: #0062c4;
    --accent-soft: rgba(0, 113, 227, .1);
    --danger: #ff3b30;
    --danger-press: #e22a20;
    --booking: #c2255c; /* ztmaveno kvůli kontrastu bílého textu (WCAG AA) */
    --ok: #34c759;

    /* Tvar */
    --radius: 14px;
    --radius-lg: 20px;
    --radius-sm: 9px;

    /* Stíny */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 3px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 18px rgba(0, 0, 0, .07);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, .22);

    /* Easing (iOS sheet) */
    --ease-sheet: cubic-bezier(.32, .72, 0, 1);

    /* Safe-area */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #000000;
        --bg-blur: rgba(20, 20, 22, .7);
        --card: #1c1c1e;
        --surface-2: #2c2c2e;
        --surface-3: #3a3a3c;

        --ink: #f5f5f7;
        --muted: #98989d;
        --faint: #8e8e93;

        --line: rgba(255, 255, 255, .1);
        --line-strong: rgba(255, 255, 255, .2);

        --accent: #0a84ff;
        --accent-press: #3395ff;
        --accent-soft: rgba(10, 132, 255, .18);
        --danger: #ff453a;
        --danger-press: #ff6961;
        --booking: #ff5277;
        --ok: #30d158;

        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
        --shadow-md: 0 4px 18px rgba(0, 0, 0, .5);
        --shadow-lg: 0 12px 48px rgba(0, 0, 0, .7);
    }
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.45;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    padding-left: var(--sal);
    padding-right: var(--sar);
}

::selection { background: var(--accent-soft); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
/* Karty kalendáře jsou ovladatelné klávesnicí – zřetelný focus. */
.cell:focus-visible,
.day:focus-visible,
.wcard:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Topbar ---------- */
.topbar {
    background: var(--bg-blur);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--line);
    padding: calc(.65rem + var(--sat)) 1rem .65rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    flex-wrap: wrap;
    max-width: 1100px;
    margin: 0 auto;
}
.topbar__row + .topbar__row { margin-top: .65rem; }
.brand {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: -.01em;
}
.topbar__auth {
    display: flex;
    align-items: center;
    gap: .5rem;
}
.toolbar { gap: .6rem; }
.viewswitch { flex: 1; }
.viewswitch__btn { flex: 1; }
.monthnav { flex: 1 1 100%; justify-content: center; }

/* ---------- Tlačítka ---------- */
.btn {
    appearance: none;
    border: 1px solid transparent;
    background: var(--accent);
    color: #fff;
    border-radius: 980px;
    padding: .5rem 1.05rem;
    font-size: .92rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 40px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    transition: background .18s ease, transform .12s ease, opacity .18s ease, box-shadow .18s ease;
    white-space: nowrap;
}
.btn:hover { background: var(--accent-press); }
.btn:active { transform: scale(.96); }
.btn--ghost {
    background: var(--card);
    color: var(--ink);
    border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--icon {
    background: var(--card);
    color: var(--ink);
    border-color: var(--line-strong);
    border-radius: 50%;
    min-width: 40px;
    width: 40px;
    padding: 0;
    font-size: .9rem;
}
.btn--icon:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-press); }
.btn[disabled] {
    opacity: .4;
    cursor: not-allowed;
    transform: none;
}
.link {
    color: var(--accent);
    text-decoration: none;
    font-size: .92rem;
    font-weight: 500;
    padding: .35rem .2rem;
}
.link:hover { text-decoration: underline; }

.login { display: flex; gap: .4rem; }
.login input,
.team__add input,
.team__table input {
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink);
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .95rem;
    min-height: 40px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.login input:focus,
.team__add input:focus,
.team__table input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Segmented control (přepínač zobrazení) ---------- */
.viewswitch {
    display: inline-flex;
    border-radius: 10px;
    padding: 2px;
    background: var(--surface-3);
    gap: 2px;
}
.viewswitch__btn {
    appearance: none;
    border: 0;
    background: transparent;
    padding: .42rem .9rem;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--ink);
    min-height: 34px;
    border-radius: 8px;
    transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.viewswitch__btn.is-active {
    background: var(--card);
    color: var(--ink);
    box-shadow: var(--shadow-sm);
}

.monthnav {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}
.monthnav[hidden] { display: none; }
.monthnav__label {
    font-weight: 600;
    font-size: 1.02rem;
    min-width: 8.5rem;
    text-align: center;
    text-transform: capitalize;
    letter-spacing: -.01em;
}

/* ---------- Layout ---------- */
main {
    padding: 1rem;
    max-width: 1100px;
    margin: 0 auto;
}
.view[hidden] { display: none; }

/* ---------- Legenda barev ---------- */
.legend {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .9rem;
    margin-bottom: .9rem;
    font-size: .8rem;
    color: var(--muted);
}
.legend__item { display: inline-flex; align-items: center; gap: .3rem; }
.legend__swatch {
    width: .7rem;
    height: .7rem;
    border-radius: 3px;
    flex: 0 0 auto;
}
.legend__emoji { font-size: .85rem; }

.footer {
    padding: 1rem 1rem calc(2rem + var(--sab));
    color: var(--muted);
    font-size: .82rem;
    text-align: center;
}
.sync {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.btn--sm { min-height: 34px; padding: .35rem .85rem; font-size: .84rem; }
.sync__icon { display: inline-block; }
.sync__icon.is-spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sync__status { color: var(--muted); font-size: .82rem; }
.sync__status--ok { color: var(--ok); font-weight: 600; }
.sync__status--err { color: var(--danger); font-weight: 600; }

/* ---------- Mřížka (měsíc) ---------- */
.grid__weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}
.grid__weekday {
    text-align: center;
    font-size: .74rem;
    font-weight: 600;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}
.cell {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    min-height: 86px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    overflow: hidden;
    transition: background .15s ease, transform .12s ease, box-shadow .15s ease;
}
.cell:hover { box-shadow: var(--shadow-sm); }
.cell:active { transform: scale(.985); }
.cell--out { background: transparent; border-color: transparent; }
.cell--out .cell__num { color: var(--faint); opacity: .55; }
.cell--today { background: var(--accent-soft); border-color: transparent; }
.cell__num {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    align-self: flex-end;
    width: 1.55rem;
    height: 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.cell--today .cell__num {
    background: var(--accent);
    color: #fff;
}

.chip {
    font-size: .72rem;
    line-height: 1.25;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
    overflow: hidden;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 3px;
}
.chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
/* Emoji glyf se používá jen v kompaktní mobilní mřížce (viz @media níže). */
.chip__emoji { display: none; flex: 0 0 auto; }
.chip--booking { background: var(--booking); font-weight: 600; }
.chip--more {
    color: var(--muted);
    background: transparent;
    padding: 0 6px;
    font-weight: 600;
    text-shadow: none;
}

/* ---------- Seznam ---------- */
.list {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}
.list__bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: -.1rem;
}
.list__month {
    position: sticky;
    top: calc(var(--topbar-h, 0px));
    z-index: 5;
    background: var(--bg);
    padding: .4rem .15rem .3rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: capitalize;
    letter-spacing: -.01em;
}
.day__today-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border-radius: 999px;
    padding: 1px 8px;
    vertical-align: middle;
    letter-spacing: .01em;
}
.day {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .85rem 1rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow .15s ease;
}
.day:hover { box-shadow: var(--shadow-md); }
.day--today {
    border-color: transparent;
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
}
.day__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .55rem;
}
.day__date {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -.01em;
}
.day--today .day__date { color: var(--accent); }
.day__weekday { color: var(--muted); font-size: .85rem; text-transform: capitalize; }
.day__items {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.day__empty {
    color: var(--faint);
    font-size: .88rem;
    padding: .15rem .1rem;
}
.item {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem .65rem;
    border-radius: 11px;
    background: var(--surface-2);
}
.item__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}
/* Pobyt může mít víceřádkový popis → tečku zarovnáme k prvnímu řádku.
   U servisních eventů (jeden řádek + vyšší tlačítko) ji necháme svisle
   vystředit přes align-items: center na .item, ať nečouhá nahoře. */
.item--booking .item__dot {
    align-self: flex-start;
    margin-top: .42rem;
}
.item__text { flex: 1; font-size: .95rem; min-width: 0; }
.item__note { color: var(--muted); font-size: .85rem; }
.item__desc {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .85rem;
    word-break: break-word;
}
.item__desc a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}
.item--booking {
    background: rgba(229, 57, 107, .08);
    background: color-mix(in srgb, var(--booking) 9%, transparent);
}
.item__edit {
    background: var(--card);
    border: 1px solid var(--line-strong);
    color: var(--accent);
    border-radius: 980px;
    min-height: 32px;
    padding: .25rem .8rem;
    cursor: pointer;
    font-size: .84rem;
    font-weight: 500;
    flex: 0 0 auto;
    transition: background .15s ease, transform .12s ease;
}
.item__edit:hover { background: var(--surface-3); }
.item__edit:active { transform: scale(.95); }

.badge {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 999px;
    vertical-align: middle;
}
.badge--in   { background: rgba(52, 199, 89, .18); background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge--out  { background: rgba(255, 59, 48, .16); background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge--busy { background: rgba(229, 57, 107, .16); background: color-mix(in srgb, var(--booking) 16%, transparent); color: var(--booking); }
.badge--on   { background: rgba(52, 199, 89, .18); background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge--off  { background: var(--surface-3); color: var(--muted); }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 3rem 1rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.empty__cta { margin-top: 1rem; }

/* ---------- FAB (rychlé přidání) ---------- */
.fab {
    position: fixed;
    right: calc(1.1rem + var(--sar));
    bottom: calc(1.1rem + var(--sab));
    z-index: 90;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: var(--accent);
    color: #fff;
    font-size: 1.9rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, transform .12s ease;
}
.fab:hover { background: var(--accent-press); }
.fab:active { transform: scale(.92); }

/* ---------- Týden (přehled Po–Ne) ---------- */
.week { display: flex; flex-direction: column; gap: .5rem; }
.wcard {
    display: flex;
    gap: .7rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: .65rem .85rem;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: box-shadow .15s ease, transform .12s ease;
}
.wcard:hover { box-shadow: var(--shadow-md); }
.wcard:active { transform: scale(.99); }
.wcard--empty { background: var(--surface-2); box-shadow: none; }
.wcard--today { border-color: transparent; box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm); }
.wcard__day {
    flex: 0 0 5rem;
    display: flex;
    flex-direction: column;
    gap: .05rem;
    justify-content: center;
}
.wcard__wd {
    font-weight: 700;
    font-size: .95rem;
    letter-spacing: -.01em;
    text-transform: capitalize;
}
.wcard--today .wcard__wd { color: var(--accent); }
.wcard__date { color: var(--muted); font-size: .8rem; }
.wcard__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: .35rem;
}
.wchip {
    font-size: .82rem;
    font-weight: 500;
    line-height: 1.3;
    padding: .26rem .6rem;
    border-radius: 8px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wchip--booking { background: var(--booking); font-weight: 600; }
.wcard__empty { color: var(--faint); font-size: .85rem; align-self: center; }

@media (min-width: 720px) {
    .week {
        display: grid;
        grid-template-columns: repeat(7, 1fr);
        gap: 8px;
        align-items: stretch;
    }
    .wcard {
        flex-direction: column;
        gap: .5rem;
        min-height: 150px;
        padding: .6rem;
    }
    .wcard__day {
        flex: 0 0 auto;
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
        gap: .3rem;
        padding-bottom: .45rem;
        border-bottom: 1px solid var(--line);
    }
    .wcard__wd { font-size: .82rem; }
    .wcard__date { font-size: .78rem; }
    .wcard__body { flex-direction: column; flex-wrap: nowrap; align-content: flex-start; gap: .3rem; }
    .wchip { font-size: .76rem; white-space: normal; }
}

/* Nápověda pro nepřihlášené */
.notice {
    max-width: 1100px;
    margin: 1rem auto 0;
    padding: .75rem 1rem;
    background: var(--accent-soft);
    border: 1px solid transparent;
    color: var(--ink);
    border-radius: var(--radius);
    font-size: .9rem;
}
.notice__link {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

/* ---------- Modal (bottom sheet na mobilu) ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal[hidden] { display: none; }
.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    opacity: 0;
    transition: opacity .26s ease;
}
.modal.is-open .modal__backdrop { opacity: 1; }
.modal__panel {
    position: relative;
    background: var(--card);
    width: 100%;
    max-width: 480px;
    border-radius: 22px 22px 0 0;
    padding: 1.1rem 1.2rem calc(1.5rem + var(--sab));
    max-height: 90vh;
    overflow: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform .34s var(--ease-sheet);
    -webkit-overflow-scrolling: touch;
}
.modal.is-open .modal__panel { transform: translateY(0); }
/* Úchyt (grabber) navrch sheetu – iOS detail. */
.modal__panel::before {
    content: "";
    display: block;
    width: 38px;
    height: 5px;
    border-radius: 3px;
    background: var(--surface-3);
    margin: -.3rem auto .8rem;
}
.modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: 1rem;
}
.modal__head h2 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -.01em;
}
.modal__body { display: flex; flex-direction: column; gap: .9rem; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--muted);
    padding-left: .15rem;
}
.field input,
.field select,
.field textarea {
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink);
    border-radius: 11px;
    padding: .65rem .8rem;
    font-size: 1rem;
    font-family: inherit;
    min-height: 46px;
    width: 100%;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.41 0 6 4.59 10.59 0 12 1.42 6 7.42 0 1.42z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.field textarea { min-height: 76px; resize: vertical; }

/* Datum – sjednotit napříč prohlížeči. iOS/Safari hodnotu defaultně centruje,
   takže „16. 6. 2026" opticky odskakovalo od levého kraje jako u ostatních polí. */
.field input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
    text-align: left;
}
.field input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
    margin: 0;
}
.field input[type="date"]::-webkit-calendar-picker-indicator {
    margin-left: auto;
    padding: 0;
    cursor: pointer;
    opacity: .5;
    transition: opacity .15s ease;
}
.field input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .85; }
@media (prefers-color-scheme: dark) {
    .field input[type="date"]::-webkit-calendar-picker-indicator {
        filter: invert(1);
        opacity: .55;
    }
}
.modal__actions {
    display: flex;
    gap: .5rem;
    align-items: center;
    justify-content: space-between;
    margin-top: .4rem;
}
.modal__actions .spacer { flex: 1; }

.day-events { display: flex; flex-direction: column; gap: .45rem; margin-bottom: 1rem; }
.muted { color: var(--muted); font-size: .88rem; }

/* ---------- Tým ---------- */
.team { max-width: 760px; }
.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.card h2 { margin: 0 0 .8rem; font-size: 1.08rem; font-weight: 600; letter-spacing: -.01em; }
.export__sub { margin: 1rem 0 .15rem; font-size: .92rem; font-weight: 600; letter-spacing: -.01em; }
.card .muted + .export__sub { margin-top: 1.1rem; }
.team__add { display: flex; gap: .5rem; }
.team__add input { flex: 1; }
.team__table { width: 100%; border-collapse: collapse; }
.team__table th,
.team__table td {
    text-align: left;
    padding: .65rem .45rem;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}
.team__table tr:last-child td { border-bottom: 0; }
.team__table th {
    font-size: .74rem;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 600;
}
.team__table .num { text-align: right; }
.team__name { font-weight: 600; }
.team__actions {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.team__actions .btn { min-height: 34px; padding: .35rem .85rem; font-size: .84rem; }
.team__actions .btn--reorder {
    min-width: 34px;
    width: 34px;
    padding: 0;
    font-size: 1rem;
    line-height: 1;
}

/* Výchozí osoby podle typu */
.defaults { display: flex; flex-direction: column; gap: .55rem; }
.defaults__row { display: flex; align-items: center; gap: .7rem; }
.defaults__label { flex: 0 0 9rem; font-weight: 600; font-size: .95rem; }
.defaults__select {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--ink);
    border-radius: 10px;
    padding: .5rem .8rem;
    font-size: .95rem;
    font-family: inherit;
    min-height: 40px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M1.41 0 6 4.59 10.59 0 12 1.42 6 7.42 0 1.42z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .9rem center;
    padding-right: 2.2rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.defaults__select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.defaults__saved {
    flex: 0 0 auto;
    min-width: 4.8rem;
    color: var(--ok);
    font-size: .82rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity .2s ease;
}
.defaults__saved.is-on { opacity: 1; }
@media (max-width: 719px) {
    .defaults__label { flex-basis: 6.5rem; font-size: .9rem; }
    .defaults__saved { display: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 480px) {
    /* Login na úzkém displeji přes celou šířku, ať je pole pohodlné. */
    .topbar__auth { width: 100%; }
    .login { flex: 1; }
    .login input { flex: 1; min-width: 0; }
}
@media (max-width: 719px) {
    main { padding: .8rem; }
    .brand { font-size: 1.1rem; }
    .grid, .grid__weekdays { gap: 4px; }
    .cell {
        min-height: 62px;
        padding: 4px;
        gap: 3px;
        border-radius: 10px;
    }
    .cell__num { font-size: .76rem; width: 1.4rem; height: 1.4rem; }
    /* Štítky na mobilu kompaktně jako emoji (typ poznáš i bez barvy);
       plný text je v detailu dne / v Seznamu. */
    .cell .chip {
        font-size: .74rem;
        line-height: 1.1;
        padding: 1px 0;
        border-radius: 5px;
        justify-content: center;
        text-shadow: none;
        gap: 1px;
    }
    .cell .chip__text { display: none; }
    .cell .chip__emoji { display: inline; }
    .cell .chip--more { display: none; }
    .team__table thead { display: none; }
    .team__table,
    .team__table tbody,
    .team__table tr,
    .team__table td { display: block; width: 100%; }
    .team__table tr {
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: .6rem .8rem;
        margin-bottom: .6rem;
    }
    .team__table td { border: 0; padding: .25rem 0; }
    .team__table .num::before { content: "Eventů: "; color: var(--muted); }
    .team__actions { justify-content: flex-start; margin-top: .4rem; }
}

/* ---------- Desktop ---------- */
@media (min-width: 720px) {
    .topbar__auth { order: 2; }
    .cell { min-height: 150px; }
    .chip { font-size: .74rem; }
    .modal { align-items: center; padding: 1rem; }
    .modal__panel {
        border-radius: 22px;
        transform: scale(.96);
        opacity: 0;
        transition: transform .26s ease, opacity .26s ease;
    }
    .modal.is-open .modal__panel { transform: scale(1); opacity: 1; }
    .modal__panel::before { display: none; }
}

/* ---------- Horní progress proužek (REZEO sync) ---------- */
.progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 300;
    background: var(--accent-soft);
    overflow: hidden;
}
.progress[hidden] { display: none; }
.progress::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    background: var(--accent);
    animation: progress-slide 1.1s ease-in-out infinite;
}
@keyframes progress-slide {
    0%   { left: -40%; }
    100% { left: 100%; }
}

/* ---------- Toast ---------- */
.toasts {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(1rem + var(--sab));
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 0 1rem;
    pointer-events: none;
}
.toast {
    pointer-events: auto;
    max-width: 460px;
    width: fit-content;
    background: var(--ink);
    color: var(--bg);
    border-radius: 12px;
    padding: .7rem 1rem;
    font-size: .9rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .26s ease, transform .26s var(--ease-sheet);
}
.toast.is-on { opacity: 1; transform: translateY(0); }
.toast--ok  { background: var(--ok); color: #06320f; }
.toast--err { background: var(--danger); color: #fff; }

/* ---------- Dialog (confirm/prompt) ---------- */
.uidialog__msg { margin: 0; font-size: .95rem; color: var(--ink); }
.uidialog__panel { max-width: 420px; }

/* ---------- Respekt k reduce-motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
