:root {
    --bg: #f3f5f7;
    --card: #ffffff;
    --text: #1f2933;
    --muted: #616e7c;
    --line: #d9e2ec;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b91c1c;
    --ok: #047857;
    --ok-bg: #ecfdf5;
    --danger-bg: #fef2f2;
}

* {
    box-sizing: border-box;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.45;
}

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.admin-hours-app *,
.admin-hours-app *::before,
.admin-hours-app *::after {
    box-sizing: border-box;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.lang-switcher-block {
    margin-top: 4px;
}

.lang-link {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 650;
    padding: 6px 8px;
    border-radius: 6px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.lang-link.is-active {
    color: var(--accent-dark);
    background: #e6fffa;
}

.tabs {
    margin: 0 0 16px;
    border-bottom: 1px solid var(--line);
}

.tabs-track {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0;
    margin-inline: -4px;
    padding-inline: 4px;
}

.tab-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 10px 14px;
    color: var(--muted);
    text-decoration: none;
    font-weight: 650;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
}

.tab-link-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.tab-icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    display: block;
}

.tab-link-label {
    min-width: 0;
}

.tab-link.is-active {
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}

.tab-link:hover,
.tab-link:focus {
    color: var(--accent-dark);
}

.settings-meta {
    display: grid;
    gap: 12px;
    margin: 0 0 16px;
}

.settings-meta dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.settings-meta dd {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.lang-list {
    margin: 0;
    padding-inline-start: 1.1rem;
    font-weight: 500;
}

.temp-today-row {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.temp-today-panel {
    margin: 4px 0 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
}

.temp-today-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.temp-today-panel-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
}

.temp-today-range {
    margin: 0 0 4px;
    font-size: 1.15rem;
    font-weight: 700;
}

.temp-today-state {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 650;
}

.temp-today-message {
    margin: 0 0 12px;
}

.temp-today-actions {
    margin-top: 0;
}

.temp-today-actions .temp-edit-link {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid var(--line);
    min-width: 0;
}

.temp-delete-inline {
    margin: 0;
    flex: 1 1 auto;
}

.temp-delete-inline button,
.temp-form-actions button {
    width: 100%;
}

.temp-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.temp-status-badge.temp-status-scheduled {
    background: #e6fffa;
    color: var(--accent-dark);
}

.temp-status-badge.temp-status-active {
    background: #ecfdf5;
    color: var(--ok);
    box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.25);
}

.temp-status-badge.temp-status-finished {
    background: #eef2f7;
    color: var(--muted);
}

.temp-status {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
}

.temp-status-active {
    color: var(--ok);
}

.temp-status-scheduled {
    color: var(--accent-dark);
}

.temp-status-finished {
    color: var(--muted);
}

/* Custom datepicker (exceptions / special) */
.ah-datepicker {
    position: relative;
}

.ah-datepicker-control {
    position: relative;
}

.ah-datepicker-display {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    background: #fff;
    color: var(--text);
    text-align: start;
    cursor: pointer;
    font-weight: 600;
}

.ah-datepicker-native-enhanced {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.ah-datepicker-dialog {
    position: absolute;
    z-index: 40;
    inset-inline-start: 0;
    top: calc(100% + 6px);
    width: min(100%, 320px);
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(31, 41, 51, 0.16);
    padding: 12px;
}

.ah-datepicker-dialog[hidden] {
    display: none !important;
}

.ah-datepicker-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 10px;
}

.ah-datepicker-title {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 700;
    font-size: 0.98rem;
}

.ah-datepicker-select-wrap {
    display: inline-flex;
    margin: 0;
    min-width: 0;
}

.ah-datepicker-select {
    max-width: 100%;
    min-height: 36px;
    padding: 4px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.ah-datepicker-select-month {
    max-width: 9.5rem;
}

.ah-datepicker-select-year {
    max-width: 5.25rem;
    font-variant-numeric: tabular-nums;
}

.ah-datepicker-nav {
    flex: 0 0 auto;
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 1.25rem;
    line-height: 1;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.ah-datepicker-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.ah-datepicker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.ah-datepicker-empty {
    min-height: 40px;
}

.ah-datepicker-day {
    min-height: 40px;
    min-width: 0;
    padding: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text);
    font-weight: 600;
    font-size: 0.92rem;
}

.ah-datepicker-day.is-today {
    box-shadow: inset 0 0 0 1px var(--accent);
}

.ah-datepicker-day.is-selected {
    background: var(--accent);
    color: #fff;
}

.ah-datepicker-day:hover,
.ah-datepicker-day:focus {
    background: #e6fffa;
    color: var(--accent-dark);
}

.ah-datepicker-day.is-selected:hover,
.ah-datepicker-day.is-selected:focus {
    background: var(--accent-dark);
    color: #fff;
}

.ah-datepicker-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.ah-datepicker-today-btn,
.ah-datepicker-close-btn {
    min-height: 40px;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 0.9rem;
}

@media (max-width: 375px) {
    .ah-datepicker-dialog {
        width: 100%;
        max-width: 100%;
    }

    .ah-datepicker-header {
        gap: 4px;
    }

    .ah-datepicker-nav {
        min-width: 36px;
        min-height: 36px;
    }

    .ah-datepicker-select {
        font-size: 0.8rem;
        min-height: 34px;
        padding: 3px 4px;
    }

    .ah-datepicker-select-month {
        max-width: 7.75rem;
    }

    .ah-datepicker-select-year {
        max-width: 4.75rem;
    }

    .temp-today-actions {
        flex-direction: column;
    }

    .temp-form-actions {
        flex-direction: column;
    }

    .wrap {
        padding: 12px 10px 28px;
    }

    .lang-link {
        padding: 6px 6px;
        font-size: 0.74rem;
    }

    .special-card {
        padding: 12px;
    }

    .special-card-date {
        font-size: 1.1rem;
    }

    .special-actions {
        grid-template-columns: 1fr;
    }
}

h1 {
    margin: 0;
    font-size: 1.45rem;
}

h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
}

h3.subhead {
    margin: 24px 0 10px;
    font-size: 1rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.card-today {
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.12);
}

.today-date {
    margin: 0 0 12px;
    font-size: 1.05rem;
    font-weight: 650;
}

.today-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 16px;
}

@media (max-width: 480px) {
    .today-meta {
        grid-template-columns: 1fr;
    }
}

.today-meta dt {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.today-meta dd {
    margin: 2px 0 0;
    font-size: 1.05rem;
    font-weight: 650;
}

.today-effective {
    color: var(--accent-dark);
}

.today-status.is-open {
    color: var(--ok);
}

.today-status.is-closed {
    color: var(--danger);
}

.today-special-note {
    margin: -8px 0 0;
}

.today-meta [hidden] {
    display: none;
}

.temp-form {
    margin: 0;
}

.temp-form .subhead {
    margin-top: 0;
}

select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 16px;
    background: #fff;
    color: var(--text);
}

.warn {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 650;
}

.expander {
    margin-top: 10px;
}

.expander summary {
    list-style: none;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--accent);
    color: #fff;
    font-weight: 650;
    cursor: pointer;
}

.expander summary::-webkit-details-marker {
    display: none;
}

.expander[open] > summary {
    margin-bottom: 12px;
    background: var(--accent-dark);
}

.expander-danger summary {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
}

.expander-danger[open] > summary {
    background: var(--danger-bg);
}

.special-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.special-list li {
    margin: 0;
    padding: 0;
    border: 0;
}

.special-card {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    padding: 14px;
    width: 100%;
}

.special-card-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 12px;
}

.special-card-date {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
}

.special-card-weekday {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--text);
}

.special-card-hours {
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.special-card-note {
    margin: 4px 0 0;
    font-size: 0.88rem;
}

.special-status-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.special-status-scheduled {
    background: #e6fffa;
    color: var(--accent-dark);
}

.special-status-today {
    background: #ecfdf5;
    color: var(--ok);
}

.special-status-finished {
    background: #eef2f7;
    color: var(--muted);
}

.special-main {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.special-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.special-actions summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 650;
}

.special-actions details[open] summary {
    margin-bottom: 10px;
}

.muted {
    color: var(--muted);
    font-size: 0.95rem;
}

.flash-ok,
.flash-err {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.flash-ok {
    background: var(--ok-bg);
    color: var(--ok);
}

.flash-err {
    background: var(--danger-bg);
    color: var(--danger);
}

.day {
    border-top: 1px solid var(--line);
    padding: 14px 0;
}

.day:first-of-type {
    border-top: 1px solid var(--line);
}

.day-name {
    font-weight: 650;
    margin-bottom: 10px;
}

.day-controls,
.time-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

label.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: var(--muted);
    min-width: 0;
    max-width: 100%;
}

form > label.field {
    margin-bottom: 12px;
}

input[type="time"],
input[type="date"],
input[type="text"],
input[type="password"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 16px;
    background: #fff;
    color: var(--text);
}

/* Shared toggle (native checkbox presentation) — scoped via admin-hours markup */
.toggle-control {
    --toggle-w: 52px;
    --toggle-h: 30px;
    --toggle-knob: 24px;
    --toggle-pad: 3px;
    grid-column: 1 / -1;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 0;
    font-size: 1rem;
    font-weight: 650;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.toggle-input {
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    width: var(--toggle-w);
    height: var(--toggle-h);
    margin: 0;
    transform: translateY(-50%);
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.toggle-track {
    position: relative;
    flex: 0 0 auto;
    width: var(--toggle-w);
    height: var(--toggle-h);
    border-radius: 999px;
    background: #c5ced6;
    border: 1px solid #b0bac4;
    box-shadow: inset 0 1px 2px rgba(31, 41, 51, 0.12);
    transition: background-color 0.18s ease, border-color 0.18s ease;
    pointer-events: none;
}

.toggle-knob {
    position: absolute;
    top: 50%;
    inset-inline-start: var(--toggle-pad);
    width: var(--toggle-knob);
    height: var(--toggle-knob);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(31, 41, 51, 0.28);
    transform: translateY(-50%);
    transition: inset-inline-start 0.18s ease, transform 0.18s ease;
}

.toggle-input:checked + .toggle-track {
    background: var(--accent);
    border-color: var(--accent-dark);
}

.toggle-input:checked + .toggle-track .toggle-knob {
    inset-inline-start: calc(var(--toggle-w) - var(--toggle-knob) - var(--toggle-pad));
}

.toggle-input:focus-visible + .toggle-track {
    outline: 3px solid rgba(15, 118, 110, 0.35);
    outline-offset: 3px;
}

.toggle-input:disabled + .toggle-track {
    opacity: 0.55;
}

.toggle-label {
    min-width: 0;
    line-height: 1.3;
}

/* Backward-compatible alias used by existing selectors */
.closed {
    grid-column: 1 / -1;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

button,
.btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    min-height: 48px;
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button.primary {
    background: var(--accent);
    color: #fff;
}

button.primary:hover,
button.primary:focus {
    background: var(--accent-dark);
}

button.danger {
    background: var(--danger);
    color: #fff;
}

button.danger:hover,
button.danger:focus {
    background: #991b1b;
}

button.link,
.btn-link {
    background: transparent;
    color: var(--muted);
    min-height: auto;
    padding: 8px 0;
}

.btn-secondary {
    background: #fff;
    color: var(--accent-dark);
    border: 1px solid var(--line);
    box-shadow: none;
}

.btn-secondary:hover,
.btn-secondary:focus {
    border-color: var(--accent);
    color: var(--accent-dark);
    background: #f8fafb;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 768px) {
    .day-controls,
    .time-fields {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
        align-items: end;
    }

    .temp-form .day-controls {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    }

    .closed {
        grid-column: auto;
        padding-bottom: 4px;
    }

    .actions {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    button.primary,
    button.danger {
        min-width: 220px;
    }
}

/* ==========================================================================
   HOURS.UI.3 — Mobile panel redesign (phones only; desktop unchanged)
   ========================================================================== */

@media (max-width: 767px) {
    .wrap {
        padding: 14px 12px 28px;
    }

    h1 {
        font-size: 1.25rem;
        line-height: 1.25;
    }

    h2 {
        margin: 0 0 6px;
        font-size: 1.05rem;
    }

    .card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    .card > .muted {
        margin: 0 0 12px;
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-bottom: 14px;
        align-items: stretch;
    }

    .topbar-actions {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .lang-switcher {
        gap: 4px;
        width: 100%;
        justify-content: flex-start;
    }

    .lang-link {
        font-size: 0.82rem;
        padding: 6px 10px;
        min-height: 36px;
    }

    .topbar-actions > form {
        margin: 0;
        align-self: flex-end;
    }

    .topbar-actions .btn-link {
        font-size: 0.88rem;
        padding: 6px 0;
        min-height: 36px;
        font-weight: 600;
    }

    .tabs {
        margin: 0 0 12px;
        border-bottom: 0;
    }

    .tabs-track {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        margin-inline: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        -webkit-overflow-scrolling: auto;
        scrollbar-width: none;
    }

    .tabs-track::-webkit-scrollbar {
        display: none;
    }

    .tab-link {
        flex: none;
        width: auto;
        min-width: 0;
        max-width: 100%;
        min-height: 52px;
        padding: 10px 8px;
        font-size: 0.9rem;
        line-height: 1.2;
        text-align: center;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        border: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
        border-radius: 10px;
        color: var(--muted);
        background: #fff;
    }

    .tab-link-inner {
        gap: 8px;
    }

    .tab-icon {
        width: 20px;
        height: 20px;
    }

    .tab-link.is-active {
        color: var(--accent-dark);
        background: #e6fffa;
        border-color: var(--accent);
        border-bottom-color: var(--accent);
        box-shadow: none;
        font-weight: 750;
    }

    .tab-link:hover,
    .tab-link:focus {
        color: var(--accent-dark);
    }

    .day-controls,
    .time-fields {
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: stretch;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .day-controls > .field,
    .time-fields > .field {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .temp-form .day-controls > .field:first-child {
        grid-column: auto;
    }

    input[type="time"],
    input[type="date"],
    select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 48px;
        padding: 10px 8px;
        font-size: 16px;
        box-sizing: border-box;
    }

    input[type="time"]:focus-visible,
    input[type="date"]:focus-visible,
    input[type="text"]:focus-visible,
    input[type="password"]:focus-visible,
    select:focus-visible {
        outline: 3px solid rgba(15, 118, 110, 0.28);
        outline-offset: 2px;
        border-color: var(--accent);
    }

    .closed,
    .toggle-control {
        grid-column: 1 / -1;
        gap: 12px;
        min-height: 48px;
        padding: 4px 0;
        font-size: 0.95rem;
        font-weight: 650;
    }

    .actions {
        margin-top: 12px;
        gap: 10px;
    }

    .actions button.primary,
    .actions button.danger,
    .temp-form-actions button,
    .temp-today-actions button,
    .temp-today-actions .temp-edit-link {
        width: 100%;
        min-width: 0;
        min-height: 48px;
    }

    .today-meta {
        gap: 8px;
        margin: 0 0 12px;
    }

    .today-date {
        margin: 0 0 10px;
        font-size: 1rem;
    }

    .temp-today-panel {
        padding: 12px;
        margin: 4px 0 10px;
    }

    .temp-today-range {
        font-size: 1.05rem;
    }

    .special-card {
        padding: 12px;
    }

    .special-actions {
        grid-template-columns: 1fr;
    }

    h3.subhead {
        margin: 18px 0 8px;
    }

    .flash-ok,
    .flash-err {
        padding: 10px 12px;
        margin-bottom: 12px;
    }
}

@media (max-width: 390px) {
    .tab-link {
        font-size: 0.86rem;
        min-height: 52px;
        padding: 8px 6px;
    }

    .tab-icon {
        width: 18px;
        height: 18px;
    }

    .tab-link-inner {
        gap: 6px;
    }
}

/* ==========================================================================
   HOURS.UI.5 — Mobile day cards for Regular tab (phones only)
   Desktop (>=768px) keeps the existing horizontal day layout.
   ========================================================================== */

@media (max-width: 767px) {
    form.card > .day {
        border: 1px solid var(--line);
        border-top: 1px solid var(--line);
        border-radius: 18px;
        background: #fff;
        padding: 16px;
        margin: 0 0 15px;
        box-shadow: 0 4px 12px rgba(15, 118, 110, 0.06);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
    }

    form.card > .day:first-of-type {
        border-top: 1px solid var(--line);
        margin-top: 4px;
    }

    form.card > .day:last-of-type {
        margin-bottom: 4px;
    }

    form.card > .day:has(.closed input[type="checkbox"]:checked),
    form.card > .day:has(.toggle-input:checked) {
        background: #f8fafb;
        border-color: #c9d4df;
        box-shadow: none;
    }

    form.card > .day:has(.toggle-input:checked) .day-name {
        border-inline-start-color: #94a3b8;
    }

    form.card > .day:has(.toggle-input:checked) input[type="time"] {
        opacity: 0.55;
        background: #f1f5f9;
    }

    form.card > .day .day-name {
        font-weight: 700;
        font-size: 1.3125rem; /* 21px */
        line-height: 1.25;
        margin: 0 0 14px;
        color: var(--text);
        padding-inline-start: 10px;
        border-inline-start: 3px solid var(--accent);
    }

    form.card > .day .day-controls,
    form.card > .day .time-fields {
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    form.card > .day label.field {
        gap: 7px;
        font-size: 0.9rem;
        font-weight: 600;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    form.card > .day input[type="time"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 54px;
        height: 54px;
        padding: 12px 12px;
        font-size: 18px;
        font-weight: 650;
        line-height: 1.2;
        border-radius: 12px;
        box-sizing: border-box;
    }

    form.card > .day .closed,
    form.card > .day .toggle-control {
        grid-column: 1 / -1;
        gap: 12px;
        min-height: 48px;
        margin-top: 2px;
        padding: 6px 0;
        font-size: 1rem;
        font-weight: 650;
    }

    form.card > .actions {
        margin-top: 16px;
    }

    form.card > .actions button.primary {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   HOURS.UI.6 — Shared toggle polish + Today/Exceptions mobile form cards
   Desktop (>=768px) structure unchanged; toggles/icons only.
   ========================================================================== */

@media (max-width: 767px) {
    /* Today temporary form — large stacked fields */
    #temp-today-form.card,
    section.card:has(.temp-form) {
        padding: 16px;
    }

    .temp-form .day-controls {
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .temp-form label.field {
        gap: 7px;
        font-size: 0.9rem;
        font-weight: 600;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .temp-form input[type="time"],
    .temp-form select {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 54px;
        height: 54px;
        padding: 12px;
        font-size: 18px;
        font-weight: 650;
        line-height: 1.2;
        border-radius: 12px;
        box-sizing: border-box;
    }

    .temp-form-actions button.primary,
    .temp-form-actions button.danger {
        width: 100%;
        min-height: 52px;
        font-size: 1.05rem;
    }

    /* Exceptions add/edit form — same mobile language */
    section.card > form .day-controls,
    section.card > form .time-fields,
    .special-card form .day-controls,
    .special-card form .time-fields {
        grid-template-columns: 1fr;
        gap: 14px;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    section.card > form > label.field.ah-datepicker-field,
    .special-card form label.field.ah-datepicker-field,
    section.card > form label.field,
    .special-card form label.field {
        gap: 7px;
        font-size: 0.9rem;
        font-weight: 600;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin-bottom: 14px;
    }

    section.card > form input[type="time"],
    section.card > form input[type="date"],
    .special-card form input[type="time"],
    .special-card form input[type="date"],
    .ah-datepicker-native {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 54px;
        height: 54px;
        padding: 12px;
        font-size: 18px;
        font-weight: 650;
        line-height: 1.2;
        border-radius: 12px;
        box-sizing: border-box;
    }

    section.card > form .toggle-control,
    .special-card form .toggle-control {
        margin: 2px 0 4px;
    }

    section.card > form > .actions button.primary,
    section.card > form > .actions button.danger,
    .special-card form .actions button.primary,
    .special-card form .actions button.danger {
        width: 100%;
        min-width: 0;
        min-height: 52px;
        font-size: 1.05rem;
    }

    /* Exception list cards — comfortable action targets */
    .special-card {
        padding: 16px;
        border-radius: 18px;
        gap: 14px;
    }

    .special-actions summary {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 14px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: #fff;
        font-weight: 650;
        cursor: pointer;
        list-style: none;
    }

    .special-actions summary::-webkit-details-marker {
        display: none;
    }

    .special-actions details {
        width: 100%;
    }

    .special-actions details[open] summary {
        border-color: var(--accent);
        color: var(--accent-dark);
        background: #e6fffa;
        margin-bottom: 10px;
    }
}

/* ==========================================================================
   HOURS.UI.7 — Compact mobile time/date/select controls (~50px)
   Phones only (<=767px). Desktop (>=768px) unchanged.
   Keeps 1-column stacked time fields; no custom JS timepicker.
   ========================================================================== */

@media (max-width: 767px) {
    /* Shared compact control size — overrides UI.3 / UI.6 tall inputs */
    input[type="time"],
    input[type="date"],
    select,
    .ah-datepicker-native,
    form.card > .day input[type="time"],
    .temp-form input[type="time"],
    .temp-form select,
    section.card > form input[type="time"],
    section.card > form input[type="date"],
    .special-card form input[type="time"],
    .special-card form input[type="date"] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        height: 50px;
        min-height: 50px;
        max-height: 50px;
        padding: 0 12px;
        font-size: 17px;
        font-weight: 600;
        line-height: normal;
        border-radius: 10px;
        -webkit-appearance: none;
        appearance: none;
    }

    /* WebKit/Safari: stop datetime-edit chrome from inflating height */
    input[type="time"]::-webkit-datetime-edit,
    input[type="date"]::-webkit-datetime-edit,
    .ah-datepicker-native::-webkit-datetime-edit {
        display: flex;
        align-items: center;
        padding: 0;
        height: 100%;
        line-height: normal;
    }

    input[type="time"]::-webkit-datetime-edit-fields-wrapper,
    input[type="date"]::-webkit-datetime-edit-fields-wrapper,
    .ah-datepicker-native::-webkit-datetime-edit-fields-wrapper {
        padding: 0;
    }

    input[type="time"]::-webkit-date-and-time-value,
    input[type="date"]::-webkit-date-and-time-value,
    .ah-datepicker-native::-webkit-date-and-time-value {
        text-align: start;
        padding: 0;
        margin: 0;
        height: auto;
        line-height: normal;
    }

    input[type="time"]::-webkit-calendar-picker-indicator,
    input[type="date"]::-webkit-calendar-picker-indicator,
    .ah-datepicker-native::-webkit-calendar-picker-indicator {
        margin-inline-start: 4px;
        opacity: 0.55;
    }

    select {
        background-color: #fff;
        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='%235a6a7a' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 12px 8px;
        padding-inline-end: 36px;
    }

    html[dir="rtl"] select {
        background-position: left 12px center;
    }

    /* Visible date control (custom display) — match time height; logic unchanged */
    .ah-datepicker-display {
        box-sizing: border-box;
        height: 50px;
        min-height: 50px;
        max-height: 50px;
        padding: 0 12px;
        font-size: 17px;
        font-weight: 600;
        line-height: normal;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
    }

    /* Hidden enhanced native stays clipped — do not fight its 1px sizing */
    input.ah-datepicker-native-enhanced {
        height: 1px !important;
        min-height: 0 !important;
        max-height: none !important;
        padding: 0 !important;
    }

    /* Spacing: readable but less scroll */
    form.card > .day .day-controls,
    form.card > .day .time-fields,
    .temp-form .day-controls,
    section.card > form .day-controls,
    section.card > form .time-fields,
    .special-card form .day-controls,
    .special-card form .time-fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    form.card > .day label.field,
    .temp-form label.field,
    section.card > form label.field,
    .special-card form label.field,
    section.card > form > label.field.ah-datepicker-field,
    .special-card form label.field.ah-datepicker-field {
        gap: 7px;
        margin-bottom: 0;
    }

    form.card > .day .closed,
    form.card > .day .toggle-control {
        margin-top: 4px;
        padding: 6px 0;
        min-height: 48px;
    }

    section.card > form .toggle-control,
    .special-card form .toggle-control {
        margin: 4px 0 4px;
        min-height: 48px;
    }

    .actions button.primary,
    .actions button.danger,
    .temp-form-actions button.primary,
    .temp-form-actions button.danger,
    .temp-today-actions button,
    form.card > .actions button.primary,
    section.card > form > .actions button.primary,
    section.card > form > .actions button.danger,
    .special-card form .actions button.primary,
    .special-card form .actions button.danger {
        min-height: 52px;
    }
}

/* ==========================================================================
   HOURS.UI.8 — Exceptions list polish (mobile) + closed-day semantics
   - Edit/Delete side-by-side, compact, auto width
   - Soft-danger Delete summary
   - Closed-all-day hours line uses --danger (open hours stay neutral)
   - Time/date/select ~48px (still >=44px); primary Add stays ~52px
   ========================================================================== */

.special-hours-closed {
    color: var(--danger);
    font-weight: 700;
}

.special-action-delete > summary {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

.special-action-delete > summary:hover,
.special-action-delete > summary:focus-visible {
    background: #fee2e2;
    color: var(--danger);
    border-color: var(--danger);
    outline: 2px solid color-mix(in srgb, var(--danger) 35%, transparent);
    outline-offset: 2px;
}

.special-action-delete[open] > summary {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: var(--danger);
}

@media (max-width: 767px) {
    /* Card spacing — compact but readable */
    .special-card {
        padding: 14px;
    }

    .special-card-body {
        gap: 0;
        margin-bottom: 15px;
    }

    .special-card-date {
        margin: 0;
    }

    .special-card-weekday {
        margin: 5px 0 0;
    }

    .special-card-hours {
        margin: 14px 0 0;
    }

    .special-card-note {
        margin: 10px 0 0;
    }

    .special-status-badge {
        margin-top: 11px;
    }

    /* Edit + Delete in one row; natural width (not 50% stretch) */
    .special-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        grid-template-columns: none;
    }

    .special-actions details {
        width: auto;
        flex: 0 0 auto;
        min-width: 0;
    }

    .special-actions summary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: auto;
        min-width: 0;
        height: 44px;
        min-height: 44px;
        max-height: 46px;
        padding: 0 16px;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.2;
        border-radius: 11px;
        box-sizing: border-box;
        list-style: none;
        white-space: nowrap;
    }

    .special-actions summary::-webkit-details-marker {
        display: none;
    }

    .special-action-edit > summary {
        background: #fff;
        color: var(--text);
        border: 1px solid var(--line);
    }

    .special-action-edit[open] > summary {
        border-color: var(--accent);
        color: var(--accent-dark);
        background: #e6fffa;
        margin-bottom: 10px;
    }

    .special-action-delete[open] > summary {
        margin-bottom: 10px;
    }

    /* When a details panel opens, allow wrap so form can use full width */
    .special-actions:has(details[open]) {
        flex-wrap: wrap;
    }

    .special-actions details[open] {
        flex: 1 1 100%;
        width: 100%;
    }

    /* Minimal control height trim: 50 → 48 (still finger-friendly) */
    input[type="time"],
    input[type="date"],
    select,
    .ah-datepicker-native,
    form.card > .day input[type="time"],
    .temp-form input[type="time"],
    .temp-form select,
    section.card > form input[type="time"],
    section.card > form input[type="date"],
    .special-card form input[type="time"],
    .special-card form input[type="date"] {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        font-size: 16px;
    }

    .ah-datepicker-display {
        height: 48px;
        min-height: 48px;
        max-height: 48px;
        font-size: 16px;
    }

    select {
        height: 48px;
        min-height: 48px;
        max-height: 50px;
    }

    /* Primary Add / save stays slightly taller */
    section.card > form > .actions button.primary,
    .special-card form .actions button.primary {
        min-height: 52px;
    }
}

/* ==========================================================================
   HOURS.UI.9 — Desktop Exceptions Add/Edit time fields
   Root cause: >=768px uses grid 1fr 1fr auto + .closed { grid-column: auto },
   so “Zamknięte cały dzień” sits beside Od/Do and squeezes input[type=time].
   Edit is worse inside .special-actions 1fr 1fr. Mobile (<=767) unchanged.
   Exclude .temp-form — Today keeps State | Od | Do (3-col desktop grid).
   HOURS.UI.12 — removed UI.10/UI.11 tablet-only (768–1024) overrides;
   >=768 uses this same desktop model (no third tablet layout layer).
   ========================================================================== */

@media (min-width: 768px) {
    /* Od | Do equal columns; toggle below (not third column) — Exceptions only */
    section.card > form:not(.temp-form) .day-controls,
    section.card > form:not(.temp-form) .time-fields,
    .special-card form .day-controls,
    .special-card form .time-fields {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: end;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    section.card > form:not(.temp-form) .day-controls > .field,
    section.card > form:not(.temp-form) .time-fields > .field,
    .special-card form .day-controls > .field,
    .special-card form .time-fields > .field {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    section.card > form:not(.temp-form) input[type="time"],
    .special-card form input[type="time"] {
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
    }

    /* Beat desktop .closed { grid-column: auto } for Exceptions only */
    section.card > form:not(.temp-form) .toggle-control.closed,
    section.card > form:not(.temp-form) .closed,
    .special-card form .toggle-control.closed,
    .special-card form .closed {
        grid-column: 1 / -1;
    }

    /* Open Edit/Delete panel uses full card width (summaries stay 2-col when closed) */
    .special-actions:has(details[open]) {
        grid-template-columns: 1fr;
    }

    .special-actions details[open] {
        grid-column: 1 / -1;
        min-width: 0;
        width: 100%;
    }

    .special-actions details[open] form {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* ==========================================================================
   HOURS.UI.13 — Real iPad Safari: native input[type=time] must fill column
   Root cause: <=767 already sets -webkit-appearance:none + width:100%, so
   iPhone time fields stretch. >=768 had width:100% but kept native
   appearance — iPadOS Safari then sizes the control to the value (~80–90px)
   while the grid track stays wide (e.g. 211 / 322px). No grid/wrap/breakpoint
   changes. Native type=time picker preserved (same approach as mobile UI.7).
   Scope: Today temp, Exceptions add/edit, Regular day cards (desktop already
   uses width:100% design intent).
   ========================================================================== */

@media (min-width: 768px) {
    .temp-form label.field,
    form.card > .day label.field,
    section.card > form:not(.temp-form) label.field,
    .special-card form label.field {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }

    .temp-form input[type="time"],
    .temp-form select,
    form.card > .day input[type="time"],
    section.card > form:not(.temp-form) input[type="time"],
    .special-card form input[type="time"] {
        display: block;
        width: 100%;
        min-width: 0;
        max-width: none;
        box-sizing: border-box;
        /* Required on iPadOS Safari for width to apply to type=time.
           Mobile (<=767) already uses this; wheel/native picker still opens. */
        -webkit-appearance: none;
        appearance: none;
        background-color: #fff;
    }

    .temp-form input[type="time"]::-webkit-datetime-edit,
    form.card > .day input[type="time"]::-webkit-datetime-edit,
    section.card > form:not(.temp-form) input[type="time"]::-webkit-datetime-edit,
    .special-card form input[type="time"]::-webkit-datetime-edit {
        width: 100%;
        display: inline-flex;
        align-items: center;
        padding: 0;
    }

    .temp-form input[type="time"]::-webkit-datetime-edit-fields-wrapper,
    form.card > .day input[type="time"]::-webkit-datetime-edit-fields-wrapper,
    section.card > form:not(.temp-form) input[type="time"]::-webkit-datetime-edit-fields-wrapper,
    .special-card form input[type="time"]::-webkit-datetime-edit-fields-wrapper {
        width: 100%;
    }

    .temp-form input[type="time"]::-webkit-date-and-time-value,
    form.card > .day input[type="time"]::-webkit-date-and-time-value,
    section.card > form:not(.temp-form) input[type="time"]::-webkit-date-and-time-value,
    .special-card form input[type="time"]::-webkit-date-and-time-value {
        text-align: start;
        width: 100%;
        min-width: 100%;
    }

    .temp-form input[type="time"]::-webkit-calendar-picker-indicator,
    form.card > .day input[type="time"]::-webkit-calendar-picker-indicator,
    section.card > form:not(.temp-form) input[type="time"]::-webkit-calendar-picker-indicator,
    .special-card form input[type="time"]::-webkit-calendar-picker-indicator {
        margin-inline-start: auto;
        opacity: 0.55;
    }
}

/* RTL knob already uses inset-inline-start — no extra flip needed */
bdi[dir="ltr"],
input[type="time"],
input[type="date"] {
    unicode-bidi: isolate;
}

html[dir="rtl"] .lang-switcher,
html[dir="rtl"] .topbar-actions,
html[dir="rtl"] .tabs-track {
    direction: rtl;
}

html[dir="rtl"] .special-main,
html[dir="rtl"] .special-card-body {
    text-align: start;
    align-items: flex-start;
}

html[dir="rtl"] .ah-datepicker-dialog {
    direction: rtl;
}

html[dir="rtl"] .temp-today-panel-head,
html[dir="rtl"] .temp-today-actions {
    text-align: start;
}

/* ==========================================================================
   Login page (scoped) — ZaghaDental brand gold #bea063
   Does not alter Today / Regular / Exceptions / Settings panel chrome.
   ========================================================================== */

.login-page {
    --login-gold: #bea063;
    --login-gold-dark: #a8884f;
    --login-gold-soft: rgba(190, 160, 99, 0.18);
    --login-cream: #f7f3ec;
    --login-cream-deep: #efe8dc;
    --login-card: #ffffff;
    --login-text: #2a2a2a;
    --login-muted: #7a7368;
    --login-line: #e6dfd3;
    --login-danger: #b91c1c;
    --login-danger-bg: #fef2f2;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse 80% 60% at 15% 20%, rgba(190, 160, 99, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 90% 80%, rgba(190, 160, 99, 0.1), transparent 50%),
        linear-gradient(165deg, #fbfaf7 0%, var(--login-cream) 45%, var(--login-cream-deep) 100%);
    color: var(--login-text);
}

.login-shell {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 32px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
    z-index: 1;
    overflow-x: hidden;
}

.login-lang {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.login-page .login-lang .lang-link {
    min-height: 40px;
    min-width: 44px;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--login-muted);
    font-weight: 700;
    letter-spacing: 0.04em;
    font-size: 0.8rem;
}

.login-page .login-lang .lang-link:hover,
.login-page .login-lang .lang-link:focus-visible {
    color: var(--login-gold-dark);
    background: rgba(255, 255, 255, 0.7);
    outline: none;
}

.login-page .login-lang .lang-link.is-active {
    color: var(--login-gold-dark);
    background: #fff;
    border-color: var(--login-gold);
    box-shadow: 0 0 0 1px var(--login-gold-soft);
}

.login-card {
    position: relative;
    z-index: 2;
    width: 100%;
    background: var(--login-card);
    border: 1px solid var(--login-line);
    border-radius: 24px;
    padding: 28px 22px 24px;
    box-shadow:
        0 1px 2px rgba(42, 42, 42, 0.04),
        0 18px 40px rgba(42, 42, 42, 0.06);
}

.login-brand {
    text-align: center;
    margin-bottom: 22px;
}

.login-logo {
    display: block;
    width: 64px;
    height: auto;
    margin: 0 auto 14px;
}

.login-brand-name {
    margin: 0;
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    font-weight: 750;
    letter-spacing: 0.14em;
    color: var(--login-gold);
    line-height: 1.2;
}

.login-brand-tagline {
    margin: 8px 0 0;
    font-size: 0.92rem;
    color: var(--login-muted);
    font-weight: 500;
}

.login-panel-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 8px;
}

.login-panel-line {
    flex: 1 1 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--login-gold), transparent);
    opacity: 0.75;
}

.login-panel-label {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--login-gold-dark);
    white-space: nowrap;
}

.login-panel-sub {
    margin: 0 0 20px;
    text-align: center;
    font-size: 1.05rem;
    font-weight: 650;
    color: var(--login-text);
}

.login-page .login-alert {
    margin-bottom: 16px;
    border: 1px solid rgba(185, 28, 28, 0.18);
    background: var(--login-danger-bg);
    color: var(--login-danger);
    font-weight: 600;
}

.login-page .login-form {
    gap: 14px;
}

.login-page .login-field {
    margin-bottom: 0;
    color: var(--login-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.login-input-wrap {
    position: relative;
    display: block;
}

.login-input-icon {
    position: absolute;
    inset-inline-start: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--login-gold);
    pointer-events: none;
    display: inline-flex;
    opacity: 0.9;
}

.login-page .login-input {
    width: 100%;
    min-height: 52px;
    border: 1px solid var(--login-line);
    border-radius: 12px;
    padding: 12px 14px;
    padding-inline-start: 44px;
    font-size: 16px;
    background: #fbfaf8;
    color: var(--login-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.login-page .login-input-password {
    padding-inline-end: 48px;
}

.login-page .login-input:hover {
    border-color: #d4c7b0;
}

.login-page .login-input:focus,
.login-page .login-input:focus-visible {
    outline: none;
    border-color: var(--login-gold);
    background: #fff;
    box-shadow: 0 0 0 3px var(--login-gold-soft);
}

.login-toggle-password {
    position: absolute;
    inset-inline-end: 6px;
    top: 50%;
    transform: translateY(-50%);
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--login-muted);
    min-height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.login-toggle-password:hover,
.login-toggle-password:focus-visible {
    color: var(--login-gold-dark);
    background: var(--login-gold-soft);
    outline: none;
}

.login-toggle-password svg[hidden] {
    display: none !important;
}

.login-page .login-actions {
    margin-top: 4px;
    flex-direction: column;
    align-items: stretch;
}

.login-page .login-submit,
.login-page button.primary.login-submit {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    border-radius: 12px;
    background: var(--login-gold);
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(190, 160, 99, 0.28);
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.login-page .login-submit:hover,
.login-page button.primary.login-submit:hover {
    background: var(--login-gold-dark);
}

.login-page .login-submit:active,
.login-page button.primary.login-submit:active {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(190, 160, 99, 0.22);
}

.login-page .login-submit:focus-visible,
.login-page button.primary.login-submit:focus-visible {
    outline: 3px solid var(--login-gold-soft);
    outline-offset: 2px;
}

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 18px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--login-line);
    color: var(--login-muted);
    font-size: 0.82rem;
    text-align: center;
    line-height: 1.4;
}

.login-security-icon {
    display: inline-flex;
    color: var(--login-gold);
    flex: 0 0 auto;
}

.login-footer-brand {
    margin: 14px 0 0;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 650;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #b0a694;
}

.login-tooth-deco {
    position: absolute;
    inset-inline-end: 0;
    bottom: 8%;
    width: min(180px, 28vw);
    height: auto;
    color: var(--login-gold);
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
    display: none;
}

@media (min-width: 768px) {
    .login-tooth-deco {
        display: block;
    }
}

html[dir="rtl"] .login-lang {
    justify-content: flex-start;
}

html[dir="rtl"] .login-page .login-input {
    text-align: start;
}

@media (max-width: 430px) {
    .login-shell {
        padding: 16px 12px 28px;
        justify-content: flex-start;
        padding-top: 20px;
    }

    .login-card {
        border-radius: 20px;
        padding: 24px 16px 20px;
    }

    .login-logo {
        width: 56px;
    }
}

@media (max-width: 320px) {
    .login-shell {
        padding: 12px 10px 24px;
    }

    .login-card {
        padding: 20px 12px 16px;
        border-radius: 18px;
    }

    .login-brand-name {
        letter-spacing: 0.1em;
    }

    .login-panel-label {
        letter-spacing: 0.06em;
        font-size: 0.68rem;
    }

    .login-page .login-lang .lang-link {
        min-width: 40px;
        padding: 8px 8px;
    }
}

@media (min-width: 768px) {
    .login-shell {
        padding: 40px 24px;
    }

    .login-card {
        padding: 36px 40px 32px;
    }

    .login-logo {
        width: 72px;
    }
}

@media (min-width: 1440px) {
    .login-shell {
        max-width: 620px;
    }
}

@media (max-height: 640px) {
    .login-shell {
        justify-content: flex-start;
        padding-top: 16px;
        padding-bottom: 24px;
    }
}

/* =========================================================
   PRICES.UI.1 — Pricing tab UI consolidation
   (reuses special-card / special-actions / button / toggle)
   ========================================================= */

.pricing-panel > h2 {
    margin: 0 0 16px;
}

.pricing-category-tabs {
    margin: 0 0 14px;
    min-width: 0;
}

.pricing-category-tabs-track {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    min-width: 0;
}

.pricing-category-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    text-align: center;
    text-decoration: none;
    font-weight: 650;
    font-size: 0.88rem;
    line-height: 1.25;
    color: var(--muted);
    background: #f4f7f8;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    box-sizing: border-box;
}

.pricing-category-tab.is-active {
    color: var(--accent-dark);
    background: #fff;
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.pricing-category-tab:hover,
.pricing-category-tab:focus {
    color: var(--accent-dark);
    border-color: var(--accent);
}

.pricing-category {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.pricing-add-service {
    margin: 0 0 14px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    min-width: 0;
    max-width: 100%;
}

.pricing-add-service > summary {
    cursor: pointer;
    list-style: none;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    background: #fff;
    color: var(--accent-dark);
    border: 0;
    font-weight: 650;
    box-shadow: none;
}

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

.pricing-add-service[open] > summary {
    margin-bottom: 0;
    border-radius: 10px 10px 0 0;
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.pricing-add-form {
    margin: 0;
    padding: 12px 14px 14px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: grid;
    gap: 10px;
}

.pricing-item {
    margin: 0 0 12px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #f8fafc;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pricing-item.is-subservice {
    margin-inline-start: 12px;
    border-inline-start: 3px solid var(--accent);
}

.pricing-item.is-group {
    background: #f1f5f9;
}

.pricing-item.is-disabled {
    opacity: 0.78;
}

.pricing-item-form {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 12px 14px 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    min-width: 0;
    max-width: 100%;
}

.pricing-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px 14px;
    min-width: 0;
    padding-bottom: 2px;
}

.pricing-item-head-text {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.pricing-item-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.pricing-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
    color: var(--muted);
    background: #eef2f7;
}

.pricing-item-head-actions {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    max-width: 56%;
    min-width: 0;
}

.pricing-item-move {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex: 0 0 auto;
}

.pricing-move-form {
    display: none;
}

.pricing-move-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    line-height: 0;
}

.pricing-move-btn:hover,
.pricing-move-btn:focus-visible {
    background: #eef2f7;
    outline: none;
}

.pricing-move-btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.pricing-move-btn:disabled {
    opacity: 0.38;
    cursor: not-allowed;
    background: #f8fafc;
}

.pricing-item-head-toggle {
    flex: 0 1 auto;
    max-width: 100%;
    min-width: 0;
}

.pricing-item-head-toggle .toggle-control {
    grid-column: auto;
    margin: 0;
    padding: 0;
    min-height: 44px;
    gap: 8px;
    font-size: 0.92rem;
}

.pricing-item-head-toggle .toggle-label {
    font-size: 0.88rem;
}

.pricing-amounts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.pricing-amounts-heading {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 650;
    color: var(--text);
    line-height: 1.3;
}

.pricing-amount-rows {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

.pricing-amount-row {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    flex: 1 1 calc(50% - 6px);
    min-width: min(100%, 148px);
    max-width: 100%;
}

.pricing-amount-field {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.pricing-amount-label {
    display: block;
}

.pricing-amount-input {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.pricing-amount-input input {
    flex: 1 1 auto;
    min-width: 0;
    width: 5.25rem;
    max-width: 100%;
    font-variant-numeric: tabular-nums;
}

.pricing-currency {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 650;
    font-size: 0.88rem;
}

.pricing-amount-remove {
    flex: 0 0 auto;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--danger);
    cursor: pointer;
    line-height: 0;
}

.pricing-amount-remove:hover,
.pricing-amount-remove:focus-visible {
    background: var(--danger-bg);
    outline: none;
}

.pricing-amount-remove:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--danger) 40%, transparent);
    outline-offset: 1px;
}

.pricing-amount-remove[hidden] {
    display: none !important;
}

.pricing-amount-add {
    flex: 0 0 auto;
    align-self: center;
    min-height: 40px;
    padding: 6px 10px;
    font-size: 0.86rem;
    font-weight: 600;
}

.pricing-amount-add[hidden] {
    display: none !important;
}

.pricing-item-form textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    resize: vertical;
    min-height: 56px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 16px;
    background: #fff;
    color: var(--text);
}

.pricing-item-form > label.field {
    margin-bottom: 0;
}

.pricing-item-actions {
    margin-top: 2px;
}

.pricing-item-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 14px 14px;
    min-width: 0;
}

.pricing-item-footer-save-only {
    grid-template-columns: 1fr;
}

.pricing-item-footer > .primary {
    width: 100%;
    min-height: 44px;
}

.pricing-item-delete {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.pricing-item-delete > summary {
    margin: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: #fff;
    color: var(--danger);
    cursor: pointer;
    font-weight: 650;
    list-style: none;
}

.pricing-item-delete > summary::-webkit-details-marker {
    display: none;
}

.pricing-item-delete[open] > summary {
    margin-bottom: 10px;
    background: var(--danger-bg);
}

.pricing-delete-warning {
    margin: 0 0 4px;
    color: var(--danger);
    font-weight: 650;
}

.pricing-delete-form .actions {
    margin-top: 8px;
}

.pricing-no-amounts {
    margin: 0;
    font-size: 0.9rem;
}

html[dir="rtl"] .pricing-item-head {
    flex-direction: row;
}

html[dir="rtl"] .pricing-item-head-text {
    align-items: flex-start;
}

/* Vertical order icons keep ↑/↓ meaning in RTL — do not mirror. */
html[dir="rtl"] .pricing-move-btn svg {
    transform: none;
}

html[dir="rtl"] .pricing-amount-input {
    flex-direction: row;
}

html[dir="rtl"] .pricing-amount-row {
    flex-direction: row;
}

@media (min-width: 768px) {
    .pricing-amount-row {
        flex: 0 1 auto;
        min-width: 0;
        max-width: none;
    }

    .pricing-amount-input input {
        width: 5.5rem;
        max-width: 7rem;
    }

    .pricing-amount-add {
        min-height: 40px;
    }
}

@media (max-width: 767px) {
    /* PRICES.5A — category tabs 2×2, no horizontal scroll */
    .pricing-category-tabs-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pricing-category-tab {
        font-size: 0.86rem;
        padding: 10px 8px;
        min-height: 48px;
    }

    .pricing-item.is-subservice {
        margin-inline-start: 8px;
    }

    .pricing-item-head {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .pricing-item-head-actions {
        max-width: 100%;
        justify-content: space-between;
        gap: 10px;
    }

    .pricing-item-move {
        gap: 4px;
    }

    .pricing-move-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .pricing-item-head-toggle {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .pricing-item-head-toggle .toggle-control {
        width: 100%;
    }

    .pricing-amounts {
        gap: 8px;
    }

    .pricing-amount-rows {
        gap: 8px;
    }

    /* PRICES.UI.2A — one amount per row; input + trash always same row */
    .pricing-amount-row {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 2px;
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .pricing-amount-field {
        flex: 1 1 auto;
        min-width: 0;
    }

    .pricing-amount-input {
        min-width: 0;
        width: 100%;
    }

    .pricing-amount-input input {
        flex: 1 1 auto;
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 44px;
        font-size: 16px;
    }

    .pricing-amount-remove {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
    }

    .pricing-amount-add {
        flex: 1 1 100%;
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .pricing-item-form input[type="text"],
    .pricing-item-form textarea {
        font-size: 16px;
        min-height: 48px;
    }

    /* Save above Delete — full width, no accidental side-by-side tap */
    .pricing-item-footer {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pricing-item-footer > .primary,
    .pricing-item-delete > summary,
    .pricing-delete-form .danger,
    .pricing-add-service > summary,
    .pricing-item-actions .primary {
        width: 100%;
        min-height: 48px;
    }
}

