/* ============================================================
   Shared components: buttons, cards, chips, forms, tables,
   toasts, modals, skeletons, empty states.
   ============================================================ */

/* ---- Logo (shared across marketing, auth, admin) ---- */
.mk-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.mk-logo:hover { text-decoration: none; }

.mk-logo__mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(99, 91, 255, 0.35);
    flex-shrink: 0;
}

.mk-logo__name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--c-ink);
    letter-spacing: -0.01em;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 12px 24px;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-body);
    line-height: 1.2;
    border: 1px solid transparent;
    text-decoration: none;
    white-space: nowrap;
    transition: transform var(--t-fast) var(--ease-out),
                box-shadow var(--t-fast) var(--ease-out),
                background-color var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

.btn--primary {
    background: var(--grad-primary);
    color: #fff;
}
.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-btn);
}

.btn--ghost {
    background: var(--c-surface);
    color: var(--c-ink);
    border-color: rgba(10, 37, 64, 0.15);
}
.btn--ghost:hover {
    border-color: rgba(10, 37, 64, 0.3);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.btn--danger {
    background: var(--c-error);
    color: #fff;
}
.btn--danger:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(186, 26, 26, 0.3); }

.btn--soft {
    background: var(--c-primary-tint);
    color: var(--c-primary);
}
.btn--soft:hover { background: #d6d2ff; }

.btn--sm { padding: 8px 16px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { padding: 16px 32px; font-size: var(--fs-body-lg); border-radius: var(--r-lg); }
.btn--block { width: 100%; }

.btn--icon {
    padding: 10px;
    border-radius: var(--r-md);
    color: var(--c-text-soft);
}
.btn--icon:hover { background: var(--c-surface-low); color: var(--c-ink); }

/* ---- Cards ---- */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-card);
    padding: var(--sp-6);
}

.card--hover {
    transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out);
}
.card--hover:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lift);
}

.card--feature { text-align: left; }
.card--feature h3 { margin: var(--sp-4) 0 var(--sp-2); }
.card--feature p { color: var(--c-text-soft); font-size: var(--fs-sm); }

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    background: var(--grad-primary-soft);
    color: var(--c-action);
}
.feature-icon--pink { background: linear-gradient(135deg, rgba(236, 72, 153, .12), rgba(168, 85, 247, .12)); color: #ec4899; }
.feature-icon--cyan { background: linear-gradient(135deg, rgba(0, 212, 255, .12), rgba(14, 165, 233, .12)); color: #0284c7; }
.feature-icon--green { background: linear-gradient(135deg, rgba(16, 185, 129, .14), rgba(0, 195, 137, .14)); color: var(--c-success); }

/* ---- Chips / badges ---- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-1);
    padding: 4px 12px;
    border-radius: var(--r-full);
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.04em;
}

.chip--tint    { background: var(--c-primary-tint); color: var(--c-primary); }
.chip--success { background: var(--c-success-tint); color: var(--c-success); }
.chip--warning { background: var(--c-warning-tint); color: var(--c-warning); }
.chip--error   { background: var(--c-error-tint); color: var(--c-error); }
.chip--info    { background: var(--c-info-tint); color: var(--c-info); }
.chip--neutral { background: var(--c-surface-mid); color: var(--c-text-soft); }

/* ---- Reliability score ----
   Shared across the admin client list/detail, the calendar picker and the
   client portal, so it lives here (components.css, loaded by every layout)
   rather than in one layout's sheet. Banded green/amber/red by score. */
.reliability {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: var(--r-full);
    font-size: var(--fs-label);
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}
.reliability__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.reliability--high   { background: var(--c-success-tint); color: var(--c-success); }
.reliability--medium { background: var(--c-warning-tint); color: var(--c-warning); }
.reliability--low    { background: var(--c-error-tint); color: var(--c-error); }
.reliability--new    { background: var(--c-surface-mid); color: var(--c-text-soft); }
.reliability--global { background: var(--c-primary-tint); color: var(--c-primary); }

/* The large score, used on the client detail card and the portal panel. */
.reliability-score { display: flex; align-items: center; gap: var(--sp-4); }
.reliability-score__pct { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--c-text-soft); }
.reliability-score--high .reliability-score__pct   { color: var(--c-success); }
.reliability-score--medium .reliability-score__pct { color: var(--c-warning); }
.reliability-score--low .reliability-score__pct    { color: var(--c-error); }
.reliability-score__meta { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-sm); }
.reliability-score__label { font-weight: 600; }

/* ---- Forms ---- */
.field { margin-bottom: var(--sp-4); }

.field__label {
    display: block;
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--c-ink);
    margin-bottom: var(--sp-2);
}

.field__hint {
    font-size: var(--fs-sm);
    color: var(--c-text-faint);
    margin-top: var(--sp-1);
}

.field__error {
    font-size: var(--fs-sm);
    color: var(--c-error);
    margin-top: var(--sp-1);
    animation: fade-up var(--t-fast) var(--ease-out);
}

/* Phone hints (js/lib/phone.js): the corrected number, a landline, a foreign number. */
.phone-hint { font-size: var(--fs-sm); margin-top: var(--sp-1); }
.field__hint--ok { color: var(--c-success); }
.field__hint--warn { color: var(--c-warning); }
.field__hint--error { color: var(--c-error); }
.field__hint--info { color: var(--c-info); }
.check-row.is-disabled { opacity: 0.55; cursor: not-allowed; }

/* SMS counters (js/lib/sms-length.js): "23 simb. · 1 SMS · lietuviškos raidės: 70 simb. per SMS". */
.sms-counter { font-size: 12px; color: var(--c-text-faint); }
.sms-counter.is-unicode { color: var(--c-info); }
.sms-counter.is-multi { color: var(--c-warning); font-weight: 600; }

.input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-md);
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input::placeholder { color: var(--c-text-faint); }

.input:focus {
    outline: none;
    border-color: var(--c-action);
    box-shadow: var(--focus-ring);
}

.input.is-invalid { border-color: var(--c-error); }

textarea.input { resize: vertical; min-height: 96px; }

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23777587' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* A checkbox (or radio) with its label on one row.
   This lived in auth.css as `.auth-remember` while FIVE admin forms used it -
   and the admin layout never loads auth.css, so on every one of those pages the
   row had no layout at all: label jammed against the box, no spacing, no
   pointer. It is a shared control, so it lives in components.css, which every
   layout loads. */
.check-row {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    cursor: pointer;
    user-select: none;
}
.check-row + .check-row { margin-top: var(--sp-2); }

/* ── Checkboxes & radios ───────────────────────────────────────────────────
   The project had NO styling for these at all, so every one of them rendered
   as the raw OS control: different on every platform, mismatched against the
   .input fields next to them, and with no visible disabled state (which the
   Premium-locked notification toggles depend on to read as locked rather than
   broken). Styled to match .input: same border, same radius language, same
   focus ring. */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--c-border-strong);
    border-radius: 5px;
    background: var(--c-surface);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: background var(--t-fast) var(--ease-out),
                border-color var(--t-fast) var(--ease-out);
}
input[type="radio"] { border-radius: 50%; }

/* The mark is drawn with a pseudo-element rather than a background image so it
   needs no asset and inherits colour. */
input[type="checkbox"]::before {
    content: '';
    width: 10px;
    height: 10px;
    transform: scale(0);
    transition: transform var(--t-fast) var(--ease-out);
    box-shadow: inset 1em 1em #fff;
    /* A checkmark polygon, not a tick glyph: fonts render "✓" inconsistently. */
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type="radio"]::before {
    content: '';
    width: 8px; height: 8px; border-radius: 50%;
    transform: scale(0);
    transition: transform var(--t-fast) var(--ease-out);
    box-shadow: inset 1em 1em #fff;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--c-action);
    border-color: var(--c-action);
}
input[type="checkbox"]:checked::before,
input[type="radio"]:checked::before { transform: scale(1); }

input[type="checkbox"]:hover:not(:disabled),
input[type="radio"]:hover:not(:disabled) { border-color: var(--c-action); }

input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Disabled must LOOK disabled: a locked Premium row that dims but still shows a
   crisp interactive box reads as a bug. */
input[type="checkbox"]:disabled,
input[type="radio"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--c-surface-mid);
}
input[type="checkbox"]:disabled:checked,
input[type="radio"]:disabled:checked { background: var(--c-text-faint); border-color: var(--c-text-faint); }

/* File pickers: the raw OS control sat inside an .input border looking like a
   broken text field. The browse button becomes a small soft button and the
   file name sits beside it in the field's own type. */
input[type="file"].input { padding: 7px 10px; cursor: pointer; line-height: 1.6; }
input[type="file"].input::file-selector-button {
    margin-right: 10px;
    padding: 5px 12px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--r-sm);
    background: var(--c-surface-low);
    color: var(--c-ink);
    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
}
input[type="file"].input::file-selector-button:hover { background: var(--c-surface-mid); }

/* Fingers need more than 18px. The box stays 18px visually; the padding around
   it grows the hit area only where there is no pointer precision. */
@media (pointer: coarse) {
    input[type="checkbox"],
    input[type="radio"] { outline-offset: 8px; }
}

/* Toggle switch */
/* The switch paints its own track and hides the input, so it must keep its
   full-size invisible hit area. Higher specificity than the rules above, and
   deliberately AFTER them. */
.switch input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    display: block;
}
.switch input[type="checkbox"]::before { content: none; }

.switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch__track {
    width: 100%; height: 100%;
    border-radius: var(--r-full);
    background: var(--c-surface-high);
    transition: background var(--t-med) var(--ease-out);
}
.switch__track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
    transition: transform var(--t-med) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--c-action); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--focus-ring); }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--c-border); background: var(--c-surface); box-shadow: var(--shadow-card); }

/* A tappable value inside a table cell (tel:, mailto:). Given a real tap
   target rather than being link-shaped text. */
.cell-link { color: var(--c-ink); text-decoration: none; }
.cell-link:hover { color: var(--c-action); text-decoration: underline; }

.client-cell { display: flex; align-items: center; gap: var(--sp-3); color: var(--c-ink); text-decoration: none; }
.client-cell:hover { text-decoration: none; }
.client-cell__name { font-weight: 600; }

/* ---- table--cards: reflow a wide table into cards on a phone ----
   A 5-column table on a 375px screen is a sideways scroll hunt. Below 640px
   each row becomes a card and every cell carries its own label. */
@media (max-width: 640px) {
    .table--cards { display: block; }
    .table--cards thead { display: none; }
    .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: auto; }

    .table--cards tr {
        padding: var(--sp-3) var(--sp-4);
        border-bottom: 1px solid var(--c-border);
    }
    .table--cards tr:last-child { border-bottom: 0; }

    .table--cards td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--sp-3);
        padding: 5px 0;
        border: 0;
        min-height: 32px;
    }
    .table--cards td::before {
        content: attr(data-label);
        font-family: var(--font-mono);
        font-size: var(--fs-label);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--c-text-faint);
        flex: none;
    }
    /* The name is the card's heading, so it needs no label and no split row. */
    .table--cards td:first-child { padding-bottom: var(--sp-2); }
    .table--cards td:first-child::before { display: none; }
    .table--cards td:first-child { justify-content: flex-start; }
    .table--cards .client-cell__name { font-size: var(--fs-body); }

    /* 44px minimum: these are the reasons you opened the list on a phone. */
    .table--cards .cell-link {
        display: inline-flex; align-items: center; justify-content: flex-end;
        min-height: 44px; padding-left: var(--sp-3);
        color: var(--c-action); font-weight: 500;
        text-align: right; word-break: break-all;
    }
}

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: var(--fs-label);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-text-faint);
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-border);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--c-border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--c-surface-low); }

/* ---- Flash / alert ---- */
.alert {
    display: flex;
    gap: var(--sp-3);
    align-items: flex-start;
    padding: var(--sp-4);
    border-radius: var(--r-md);
    font-size: var(--fs-sm);
    margin-bottom: var(--sp-4);
    animation: fade-up var(--t-med) var(--ease-out);
}
.alert--success { background: var(--c-success-tint); color: var(--c-success); }
.alert--error   { background: var(--c-error-tint); color: var(--c-error); }
.alert--info    { background: var(--c-info-tint); color: var(--c-info); }
.alert--warning { background: var(--c-warning-tint); color: var(--c-warning); }

/* ---- Toasts ---- */
.toast-region {
    position: fixed;
    bottom: var(--sp-5);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    align-items: center;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--c-ink);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-modal);
    font-size: var(--fs-sm);
    font-weight: 500;
    pointer-events: auto;
    animation: toast-in var(--t-med) var(--ease-spring);
}

.toast--success { background: var(--grad-success); }
.toast--error   { background: var(--c-error); }
.toast--warning { background: var(--c-warning, #b7791f); }

.toast.is-leaving { animation: toast-out var(--t-med) var(--ease-out) forwards; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
    to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

/* ---- Modal (glassmorphism Level-2 overlay) ---- */
/*
 * No blur on either layer, on any machine.
 *
 * Measured at 6x CPU throttle on a desktop viewport, where the old
 * coarse-pointer exception did not apply: the two blurs cost 61.6 ms of GPU
 * render-pass work per 2.6 s of scrolling that simply does not exist without
 * them. The clearest single reading is the week strip, which is 7,616 px wide
 * and blurred at its sticky head: scrolling it 60 ticks cost 376 ms of main
 * thread before and 243 ms after, for the same distance and the same layouts.
 *
 * (The dialog's own scrolling improved for a different reason, the single
 * scroller in the rebuilt form, not because it gained a composited scroller:
 * it had one before as well. Two facts worth keeping apart.)
 *
 * The dialog is opaque instead, which reads as calmly and costs nothing.
 */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: grid;
    place-items: center;
    padding: var(--sp-4);
    background: rgba(10, 37, 64, 0.45);
    animation: fade-in var(--t-fast) ease-out;
}

.modal {
    width: min(560px, 100%);
    max-height: min(85vh, 720px);
    overflow: auto;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-modal);
    padding: var(--sp-6);
    /* Opacity and transform only: a spring that overshoots a shadowed layer
       used to cost 38 ms of the 163 ms after the click, a quarter of the open. */
    animation: modal-rise var(--t-fast) ease-out;
}

@keyframes modal-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-5);
}

.modal.is-leaving, .modal-overlay.is-leaving { animation: fade-in var(--t-fast) ease-out reverse forwards; }

/* ---- Skeletons ---- */
.skeleton {
    border-radius: var(--r-sm);
    background: linear-gradient(90deg, var(--c-surface-low) 25%, var(--c-surface-mid) 37%, var(--c-surface-low) 63%);
    background-size: 400px 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    color: transparent !important;
    user-select: none;
}

/* ---- Empty states ---- */
.empty-state {
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
    color: var(--c-text-soft);
}
.empty-state__icon {
    width: 72px;
    height: 72px;
    margin: 0 auto var(--sp-4);
    border-radius: var(--r-full);
    display: grid;
    place-items: center;
    background: var(--grad-primary-soft);
    color: var(--c-action);
}
.empty-state h3 { margin-bottom: var(--sp-2); }
.empty-state p { max-width: 360px; margin: 0 auto var(--sp-5); font-size: var(--fs-sm); }

/* ---- Avatar ---- */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--c-primary-tint);
    color: var(--c-primary);
    font-weight: 600;
    font-size: var(--fs-sm);
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
/* The calendar's week strip asked for this size from the start and no rule
   ever gave it one, so its sub-heads drew the full 40 px circle. */
.avatar--xs { width: 22px; height: 22px; font-size: 10px; }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }
.avatar--lg { width: 56px; height: 56px; font-size: var(--fs-h3); }

/* ---- Dropdown ---- */
.dropdown { position: relative; }
.dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lift);
    padding: var(--sp-2);
    z-index: var(--z-dropdown);
    animation: pop-in var(--t-fast) var(--ease-out);
}
.dropdown__item {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: var(--r-sm);
    font-size: var(--fs-sm);
    color: var(--c-text);
    text-decoration: none;
}
.dropdown__item:hover { background: var(--c-surface-low); text-decoration: none; }
.dropdown__item--danger { color: var(--c-error); }

/* ── Shared form controls ──────────────────────────────────────────────────
   These all lived in auth.css, which ONLY the auth layout loads, while the
   admin forms that depend on them (staff, services, clients, every settings
   tab) load admin.css. So `.ob-grid-2` computed to `display: block` on every
   one of those pages: the two-column form silently rendered as a single
   stacked column, and the time inputs rendered full width. Shared controls
   belong here, in the one stylesheet every layout loads. */
.field__row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.field__link { font-size: var(--fs-sm); }
.ob-grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-4);
}
@media (max-width: 560px) { .ob-grid-2 { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.ob-hours { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.ob-hours__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-3);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    background: var(--c-surface);
    transition: opacity var(--t-med);
}
.ob-hours__day {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    font-weight: 600;
    font-size: var(--fs-sm);
    cursor: pointer;
    min-width: 150px;
}
.ob-hours__times { display: flex; align-items: center; gap: var(--sp-2); }
.ob-hours__dash { color: var(--c-text-faint); }
.input--time { width: 106px; padding: 8px 10px; }
.ob-hours__closed-label {
    display: none;
    font-size: var(--fs-sm);
    color: var(--c-text-faint);
    font-style: italic;
}
.ob-hours__row.is-closed .ob-hours__times input,
.ob-hours__row.is-closed .ob-hours__dash { display: none; }
.ob-hours__row.is-closed .ob-hours__closed-label { display: inline; }
.ob-hours__row.is-closed { opacity: 0.65; background: var(--c-surface-low); }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 44px; }
.input-suffix span {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--c-text-faint);
    font-size: var(--fs-sm);
    pointer-events: none;
}

/* Used by the admin column picker and the notification rows, but defined only
   in super.css, which admin never loads. */
.chip--xs { font-size: 10px; padding: 2px 7px; }

/* Used by booking/manage.php and errors/500.php, but defined only in admin.css,
   which neither of their layouts loads. */
.dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: 1px;
}

/* A one-time-code input, used both by the client login and by the booking
   manage page's save-my-details form - two different layouts, so it lives here
   rather than in either one's stylesheet. */
.cli-code {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 24px;
    letter-spacing: 8px;
    text-align: center;
}

/* ============================================================
   PWA install banner. Rendered by partials/pwa-install.php in BOTH the staff
   and client layouts, so it lives in this shared sheet. Starts hidden;
   assets/js/lib/pwa.js reveals it and flips [data-pwa-mode] to 'prompt'
   (native install) or 'ios' (manual Add to Home Screen hint).
   ============================================================ */
.pwa-banner {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom) + var(--sp-3));
    transform: translateX(-50%) translateY(12px);
    z-index: var(--z-toast);
    width: min(440px, calc(100% - var(--sp-4) * 2));
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-4);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-modal);
    opacity: 0;
    transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.pwa-banner.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

.pwa-banner__icon { flex: 0 0 auto; }
.pwa-banner__icon img { display: block; border-radius: 10px; }

.pwa-banner__text { flex: 1 1 auto; min-width: 0; }
.pwa-banner__title { margin: 0; font-weight: 700; font-size: var(--fs-sm); color: var(--c-ink); }
.pwa-banner__body { margin: 2px 0 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--c-text-soft); }
.pwa-banner__ios {
    display: none;
    margin: 2px 0 0;
    font-size: var(--fs-sm);
    line-height: 1.4;
    color: var(--c-text-soft);
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.pwa-banner__ios-glyph { vertical-align: middle; color: var(--c-action); }

.pwa-banner__actions { flex: 0 0 auto; display: flex; align-items: center; gap: var(--sp-1); }
.pwa-banner__install { white-space: nowrap; }
.pwa-banner__dismiss {
    background: none;
    border: 0;
    padding: 6px;
    cursor: pointer;
    color: var(--c-text-faint);
    border-radius: var(--r-sm);
    line-height: 0;
    transition: color var(--t-fast), background var(--t-fast);
}
.pwa-banner__dismiss:hover { color: var(--c-ink); background: var(--c-surface-low); }

/* Mode: the manual iOS hint replaces the body + install button. */
.pwa-banner[data-pwa-mode="ios"] .pwa-banner__body,
.pwa-banner[data-pwa-mode="ios"] .pwa-banner__install { display: none; }
.pwa-banner[data-pwa-mode="ios"] .pwa-banner__ios { display: flex; }
.pwa-banner[data-pwa-mode="prompt"] .pwa-banner__ios { display: none; }

/* Clear the staff bottom tab bar on mobile (it is fixed at z-sticky). */
@media (max-width: 900px) {
    .page-admin .pwa-banner { bottom: calc(env(safe-area-inset-bottom) + 76px); }
}
/* Same, for the client portal's bottom tab bar (shown when signed in). */
@media (max-width: 640px) {
    .has-tabbar .pwa-banner { bottom: calc(env(safe-area-inset-bottom) + 72px); }
}

/* Already installed: never show it, and never let it flash before JS runs. */
@media (display-mode: standalone) {
    .pwa-banner { display: none !important; }
}

/* Honeypot decoy (partials/honeypot.php). Parked off-screen instead of
   display:none - some bots skip fields hidden the obvious way, and this one
   only works if they fill it. Used by the signup and waitlist forms, whose
   layouts share only this stylesheet. */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- Touch screens and small GPUs: open with no animation at all ---- */
@media (pointer: coarse), (max-width: 900px), (prefers-reduced-motion: reduce) {
    .modal-overlay { animation: none; }
    .modal { animation: none; }
}

/* ============================================================
   Phones: nothing wider than the screen.

   The complaint was pages sliding sideways on a phone. Every cause found
   was one of four: a flex child holding user text with no min-width: 0 (its
   minimum is its longest word); a row of nowrap buttons that neither wraps
   nor stretches; a control sized by its content (a select is as wide as its
   widest option); 32px of card padding leaving 224px for content on a
   320px screen. Fixed at the cause, never with overflow-x: hidden on the
   body, which would only hide the scrollbar and cut the text.
   ============================================================ */
.input { min-width: 0; }
.check-row > span { min-width: 0; overflow-wrap: anywhere; }
.alert > span, .alert > div { min-width: 0; overflow-wrap: anywhere; }
.toast-region { width: max-content; max-width: calc(100% - 32px); }
.toast { max-width: 100%; overflow-wrap: anywhere; }
.table td { overflow-wrap: anywhere; }
@media (max-width: 640px) {
    .table--cards td { min-width: 0; overflow-wrap: anywhere; }
    .client-cell__name { min-width: 0; overflow-wrap: anywhere; }
}
@media (max-width: 560px) {
    .card { padding: var(--sp-4); }
    .empty-state { padding: var(--sp-6) var(--sp-3); }
    .modal { padding: var(--sp-4); }
    /* A button as wide as the card may wrap its label rather than overflow it. */
    .form-actions > .btn, .btn--block { white-space: normal; text-align: center; line-height: 1.3; }
    .ob-hours__row { flex-wrap: wrap; }
    .ob-hours__day { min-width: 0; flex: 1 1 100%; }
    .ob-hours__times { flex: 1 1 100%; }
    .ob-hours__times .input--time { flex: 1 1 0; width: auto; min-width: 0; }
}

/* ---- Sign in with a social account ---- */
/* The Google button as Google's brand rules ask: white, a thin edge, the
   four-colour G, dark text. Shared by the login and signup pages, a
   salon's booking page and the client portal (every layout links this
   sheet). The divider says "or" between it and the form. */
.btn--google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-3);
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #747775;
    font-weight: 500;
}
.btn--google:hover { background: #f6f6f8; color: #1f1f1f; transform: none; }
.btn--google:focus-visible { box-shadow: var(--focus-ring); }
.btn--google__mark { flex: 0 0 auto; width: 20px; height: 20px; }
.social-or {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-4) 0;
    color: var(--c-text-faint);
    font-size: var(--fs-sm);
}
.social-or::before,
.social-or::after {
    content: '';
    flex: 1 1 0;
    height: 1px;
    background: var(--c-border);
}
