/* MsgBox Orders: admin, auth and platform pages. RTL-first, mobile-first. */

:root {
    --color-bg: #f5f6f8;
    --color-surface: #ffffff;
    --color-text: #1d2330;
    --color-muted: #5f6b7a;
    --color-border: #d9dee5;
    --color-primary: #0f766e;
    --color-primary-hover: #0b5c56;
    --color-primary-text: #ffffff;
    --color-danger: #b42318;
    --color-success-bg: #e7f6ee;
    --color-success-text: #11603a;
    --color-error-bg: #fdecea;
    --color-error-text: #8a1c12;
    --color-warning-bg: #fff6e0;
    --color-warning-text: #7a4b00;
    /* New orders: blue, the usual "needs a look" colour. Red stays for real problems (an order waiting too long,
       errors, deleting), so it keeps its meaning. */
    --color-info: #1d4ed8;
    --color-info-bg: #e8efff;
    --color-info-text: #1e3a8a;
    --color-focus: #2563eb;
    --color-support-bg: #9a3412;
    --color-support-text: #ffffff;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Hebrew", Arial, sans-serif;
}

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

/* Component display rules must never un-hide an element marked hidden. */
[hidden] { display: none !important; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }

a { color: var(--color-primary); }

:focus-visible {
    outline: 3px solid var(--color-focus);
    outline-offset: 2px;
}

.muted { color: var(--color-muted); }

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

.skip-link {
    position: absolute;
    inset-inline-start: 1rem;
    top: -3rem;
    background: var(--color-surface);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    z-index: 10;
}
.skip-link:focus { top: 1rem; }

/* Layout */

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}

.topbar__business { font-weight: 600; }

.topbar__nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-inline-start: auto;
}

.topbar__user {
    color: var(--color-muted);
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.brand {
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.brand--center { display: block; text-align: center; margin-bottom: 1rem; }

.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.page-header h1 { margin: 0; }

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.banner {
    padding: 0.75rem 1rem;
    text-align: center;
}
.banner--warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.banner--error { background: var(--color-error-bg); color: var(--color-error-text); }

/* Support mode: impossible to miss, on every admin page, until the platform admin leaves. */
.support-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding: 0.6rem 1rem;
    background: var(--color-support-bg);
    color: var(--color-support-text);
}
.support-bar__text { margin: 0; }
.support-bar__text strong { margin-inline-end: 0.35rem; }
/* .btn.support-bar__exit: the general .btn rules come later in this file and would win otherwise. */
.btn.support-bar__exit { background: var(--color-support-text); color: var(--color-support-bg); border-color: var(--color-support-text); }
.btn.support-bar__exit:hover { background: var(--color-warning-bg); }
.support-bar__exit:focus-visible { outline-color: var(--color-support-text); outline-offset: 2px; }

.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}
.alert--success { background: var(--color-success-bg); color: var(--color-success-text); }
.alert--error { background: var(--color-error-bg); color: var(--color-error-text); }
.alert--support { background: var(--color-warning-bg); color: var(--color-warning-text); }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}
.badge--published { background: var(--color-success-bg); color: var(--color-success-text); border-color: transparent; }
.badge--suspended { background: var(--color-error-bg); color: var(--color-error-text); border-color: transparent; }
.badge--draft { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }

/* Sub navigation */

.subnav {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    padding: 0 1rem;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
}
.subnav a {
    padding: 0.7rem 0.75rem;
    color: var(--color-muted);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
}
.subnav a.is-active { color: var(--color-text); font-weight: 600; border-bottom-color: var(--color-primary); }

.inline-form { display: inline; }

/* Forms */

.form { display: grid; gap: 1rem; }

.field { display: grid; gap: 0.35rem; margin: 0; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; }
.field legend { margin-bottom: 0.35rem; }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="url"],
input[type="search"], input[type="number"], input[type="date"], select, textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font: inherit;
    color: inherit;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

/* Chrome pads the inside of a date field, which makes it taller than the text fields next to it. */
input[type="date"]::-webkit-datetime-edit-fields-wrapper { padding-top: 0; padding-bottom: 0; }

[aria-invalid="true"] { border-color: var(--color-danger); }

.field__hint { margin: 0; font-size: 0.875rem; color: var(--color-muted); }

/* A group of fields chosen by radios (the payment provider): laid out like the form around it. */
.provider-fields { display: grid; gap: 1rem; margin: 0; border: 0; padding: 0; min-width: 0; }
.provider-fields[hidden] { display: none; }
/* An English example inside a Hebrew hint: keep it whole, so it never breaks at its hyphen. */
.field__example { white-space: nowrap; }
/* The code screen after sign-up: the number never breaks at its dash, and the forms stand apart. */
.verify-phone__number { white-space: nowrap; }
.verify-phone > * + *,
.auth-stack > * + * { margin-top: 1rem; }
/* An address inside a Hebrew line: whole, and broken only if longer than the line. */
.ltr-whole { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.field__hint.is-ok { color: var(--color-success-text); }
.field__hint.is-error { color: var(--color-danger); }
/* A hint the person must not miss, though nothing is wrong yet (the business phone is shown to customers). */
.field__hint.is-warning { color: var(--color-danger); }
.field__error { margin: 0; font-size: 0.875rem; color: var(--color-danger); }

/* Password input with an eye button on its left edge (the end of the line in RTL). */
.password-field { position: relative; }
.password-field input { padding-left: 2.9rem; }
/* Edge draws its own eye inside password fields; ours replaces it. */
.password-field input::-ms-reveal { display: none; }
.password-field__toggle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    padding: 0;
    color: var(--color-muted);
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
}
.password-field__toggle[hidden] { display: none; }
.password-field__toggle:hover { color: var(--color-text); }
.password-field__toggle[aria-pressed="true"] .password-field__icon--show,
.password-field__toggle[aria-pressed="false"] .password-field__icon--hide { display: none; }

.checkbox { display: flex; align-items: flex-start; gap: 0.5rem; }
.checkbox input { margin-top: 0.3rem; }

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.choice {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
/* The font picker: each choice a small preview in its own font (StoreFont). */
.font-grid { grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.font-choice { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 0.5rem; row-gap: 0.15rem; }
.font-choice > input { grid-row: 1; }
.font-choice__label { grid-row: 1; font-size: 0.875rem; color: var(--color-muted); }
.font-choice__sample { grid-column: 1 / -1; font-size: 1.35rem; line-height: 1.3; overflow-wrap: anywhere; }
.font-choice__text { grid-column: 1 / -1; font-size: 1rem; }
/* The background picker: a swatch of each light tint (StoreBackground). */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.5rem; }
.swatch { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.65rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); cursor: pointer; }
.swatch:has(input:checked) { border-color: var(--color-primary); box-shadow: inset 0 0 0 1px var(--color-primary); }
.swatch__color { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 1px solid var(--color-border-strong, #9aa1ad); }
.swatch__color--theme { background: linear-gradient(135deg, #ffffff 50%, #faf6f1 50%); }

.slug-input {
    display: flex;
    align-items: stretch;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    overflow: hidden;
}
.slug-input input { border: 0; border-radius: 0; min-width: 0; }
.slug-input:focus-within { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.slug-input input:focus-visible { outline: none; }
.slug-input__suffix {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: var(--color-muted);
    background: var(--color-bg);
    white-space: nowrap;
}

.form--grid { grid-template-columns: 1fr; }
.field--wide { grid-column: 1 / -1; }

.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-weight: 600; }
.switch input {
    appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    margin: 0;
    border-radius: 999px;
    background: var(--color-border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    flex: none;
}
.switch input::after {
    content: "";
    position: absolute;
    top: 0.2rem;
    inset-inline-start: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #fff;
    transition: inset-inline-start 0.15s;
}
.switch input:checked { background: var(--color-primary); }
.switch input:checked::after { inset-inline-start: 1.45rem; }

.day-row { border: 0; border-bottom: 1px solid var(--color-border); margin: 0; padding: 0.75rem 0; min-width: 0; }
.day-row:last-of-type { border-bottom: 0; }
.day-row[aria-invalid="true"] { background: var(--color-error-bg); }
.day-row__head { display: flex; align-items: center; gap: 1rem; min-height: 2.75rem; }
.day-row__head .switch { min-width: 6.5rem; }
.day-row__copy { margin-inline-start: auto; font-size: 0.875rem; }
.day-row__ranges { display: grid; gap: 0.5rem; margin-top: 0.25rem; }
.day-row__ranges > .link-button { justify-self: start; font-size: 0.875rem; }

.time-range { display: flex; align-items: flex-end; gap: 0.5rem; }
.time-range label { display: grid; gap: 0.2rem; font-size: 0.8rem; color: var(--color-muted); }
.time-range .time-select { width: 6.5rem; }
/* The times and the remove button share one height, so the row lines up (2.75rem keeps the button a comfortable tap target). */
.time-range .time-select, .time-range .icon-button { height: 2.75rem; }

.icon-button {
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.closure-list, .holiday-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.5rem; }
.closure-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.disclosure summary { cursor: pointer; color: var(--color-primary); font-weight: 600; padding: 0.5rem 0; }
.disclosure[open] summary { margin-bottom: 0.75rem; }

/* "דיוור": a phone number and a date never break in two on a narrow screen; the table scrolls in its frame instead. */
.consents-table td:nth-child(2), .consents-table td:nth-child(4) { white-space: nowrap; }

/* A long list in pages ("דיוור"): previous, where we are, next. */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem; margin-top: 1rem; }

.status-line { font-size: 1.1rem; font-weight: 600; margin: 0 0 1rem; display: flex; align-items: center; gap: 0.5rem; }
.status-line::before { content: ""; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--color-muted); flex: none; }
.status-line--open::before { background: #16a34a; }
.status-line--paused::before { background: #d97706; }
.status-line--closed::before, .status-line--no_hours::before, .status-line--frozen::before { background: var(--color-danger); }
/* The last week of the paid (or free) period: said once on the dashboard, not on every screen. */
.billing-soon { margin: 0.5rem 0 0; padding: 0.6rem 0.8rem; border-radius: 8px; background: #fff7e6; border: 1px solid #f3d19c; }

.chip-group { display: flex; flex-wrap: wrap; gap: 0.5rem; border: 0; padding: 0; margin: 0; }
.chip-group legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; }
.chip span {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 1rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    cursor: pointer;
}
.chip input:checked + span { border-color: var(--color-primary); background: var(--color-success-bg); color: var(--color-success-text); font-weight: 600; }
.chip input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: 2px; }

/* Page structure */

.page-header__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-inline-start: auto; }
.form-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; position: sticky; bottom: 0; padding: 0.75rem 0; background: linear-gradient(transparent, var(--color-bg) 30%); }
.stack { display: grid; gap: 0.5rem; }
.danger-zone { border-color: #f3c2bd; }
.inline-fields { display: flex; gap: 0.5rem; }
.inline-fields input { flex: 1; min-width: 0; }
.input--short { max-width: 7rem; }
.input--price { max-width: 7rem; }
.field--inline { display: grid; gap: 0.25rem; }

.editor-layout { display: grid; gap: 1rem; align-items: start; }
.editor-layout__main { min-width: 0; }
.editor-layout__side { display: grid; gap: 1rem; min-width: 0; }

/* Menu overview */

.menu-category { scroll-margin-top: 1rem; }
.menu-category__head { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.menu-category__head h2 { margin: 0; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.menu-category__actions { display: flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; }

.product-list { list-style: none; margin: 0 0 0.75rem; padding: 0; }
.product-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border);
    scroll-margin-top: 1rem;
}
.product-row:last-child { border-bottom: 0; }
.product-row__image { width: 3rem; height: 3rem; border-radius: 8px; object-fit: cover; flex: none; }
.product-row__image--empty { background: var(--color-bg); border: 1px dashed var(--color-border); }
.product-row__main { flex: 1 1 10rem; min-width: 0; }
.product-row__name { font-weight: 600; }
.product-row__meta { font-size: 0.875rem; display: flex; gap: 0.35rem; align-items: center; flex-wrap: wrap; }
.product-row__actions { display: flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; }

.status-select { width: auto; padding: 0.4rem 0.5rem; font-size: 0.875rem; }
.status-select--sold_out { border-color: var(--color-danger); color: var(--color-danger); }
.status-select--hidden { color: var(--color-muted); background: var(--color-bg); }

.move-buttons { display: inline-flex; gap: 0.25rem; }
.icon-button--small { width: 2.25rem; height: 2.25rem; font-size: 1rem; }
.icon-button[disabled] { opacity: 0.35; cursor: default; }

/* Product form */

.group-picker { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.group-picker__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
}
.group-picker__item.is-disabled { opacity: 0.5; }
.group-picker__item:has(input:checked) { border-color: var(--color-primary); background: var(--color-success-bg); }

.image-preview { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.image-preview img { width: 6rem; height: 6rem; object-fit: cover; border-radius: 8px; }

/* Configurator (price check) */

.config-groups { display: grid; gap: 0.75rem; }
.config-group { border: 1px solid var(--color-border); border-radius: 8px; padding: 0.5rem 0.75rem 0.75rem; margin: 0; min-width: 0; }
.config-group legend { font-weight: 700; padding: 0 0.25rem; }
.config-group__rules { font-weight: 400; font-size: 0.8rem; }
.config-option { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
.config-option__label { display: flex; align-items: center; gap: 0.5rem; flex: 1; min-width: 10rem; min-height: 2.25rem; cursor: pointer; }
.config-option__price { font-size: 0.875rem; }
.config-option__placement { width: auto; padding: 0.3rem 0.4rem; font-size: 0.875rem; }
.config-option__qty { width: 4.5rem; padding: 0.3rem 0.4rem; }
.config-nested { width: 100%; padding-inline-start: 1.5rem; margin-top: 0.25rem; }
.config-locked { font-size: 0.875rem; margin: 0; }
.config-quantity { margin-top: 0.75rem; max-width: 8rem; }
.configurator__result { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--color-border); }
.configurator__price { font-size: 1.25rem; margin: 0 0 0.5rem; }
.configurator__errors { margin: 0; padding-inline-start: 1.25rem; color: var(--color-danger); }

/* Option group editor */

.option-rows { display: grid; gap: 0.75rem; }
.option-row {
    display: grid;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}
.option-row[aria-invalid="true"] { border-color: var(--color-danger); }
.option-row__fields { display: grid; grid-template-columns: 1fr 7rem; gap: 0.5rem; }
.option-row__flags { display: flex; gap: 1rem; flex-wrap: wrap; }
.option-row__combo { display: grid; gap: 0.5rem; padding-top: 0.5rem; border-top: 1px dashed var(--color-border); }
.option-row__linked { display: grid; gap: 0.5rem; }
.option-row__actions { display: flex; gap: 0.25rem; justify-content: flex-end; }

.price-matrix td, .price-matrix th { white-space: nowrap; }
.price-matrix input { min-width: 4.5rem; }

.option-chips { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.option-chip { position: relative; display: inline-flex; }
.option-chip input { position: absolute; opacity: 0; }
/* Only the outer span is the pill; the name, price and "sold out" inside it stay plain text. */
.option-chip > span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.5rem;
    padding: 0 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    cursor: pointer;
    background: var(--color-surface);
}
.option-chip__sold-out { display: none; color: var(--color-danger); font-weight: 600; font-size: 0.8rem; }
/* Available: green with a check, like the other selectable chips. Sold out: grey, struck through, "אזל". */
.option-chip input:checked + span { border-color: var(--color-primary); background: var(--color-success-bg); color: var(--color-success-text); }
.option-chip input:checked + span .muted { color: inherit; }
.option-chip__check { flex: none; }
.option-chip input:not(:checked) + span .option-chip__check { display: none; }
.option-chip > span:hover { box-shadow: 0 0 0 1px currentColor; }
.option-chip input:not(:checked) + span { color: var(--color-muted); background: var(--color-bg); }
.option-chip input:not(:checked) + span .option-chip__name { text-decoration: line-through; }
.option-chip input:not(:checked) + span .option-chip__sold-out { display: inline; }
.option-chip input:focus-visible + span { outline: 3px solid var(--color-focus); outline-offset: 2px; }

.color-field { display: flex; align-items: center; gap: 0.75rem; }
.color-field input[type="color"] { width: 3.5rem; height: 2.75rem; padding: 0.2rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); }
.image-preview--wide img { width: 12rem; height: 5rem; }

.area-list { list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.5rem; }
.area-list__item { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.65rem 0.75rem; border: 1px solid var(--color-border); border-radius: 8px; }
.area-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem; flex: 1; }
.area-form > label { display: grid; gap: 0.2rem; font-size: 0.8rem; color: var(--color-muted); }
.area-form > label:first-child { flex: 1 1 8rem; }
.area-form .checkbox { align-items: center; min-height: 2.75rem; }

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    font: inherit;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
}
.btn--primary { background: var(--color-primary); color: var(--color-primary-text); }
.btn--primary:hover { background: var(--color-primary-hover); }
.btn--secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn--danger { background: var(--color-surface); color: var(--color-danger); border-color: var(--color-danger); }
.btn--block { width: 100%; }
.btn--small { padding: 0.35rem 0.75rem; font-size: 0.875rem; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--color-primary);
    text-decoration: underline;
    cursor: pointer;
}

/* Auth */

.auth-page { display: flex; min-height: 100vh; align-items: flex-start; justify-content: center; padding: 2rem 1rem; }
.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    overflow-wrap: anywhere;
}
/* The auth card is narrow at every screen size: as many choices per row as fit (two from 360px, one below),
   so labels never break inside a word. */
.auth-card .choice-grid { grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); }
.auth-links { text-align: center; margin: 1.25rem 0 0; }

/* Platform accounts: who, how much of the business quota is used, and a stepper that saves the quota. */
/* .table.accounts-table: the general .table rules come later in this file and would win otherwise. */
.table.accounts-table td { vertical-align: middle; }
.accounts-table th:first-child { width: 50%; }
.account__name { font-weight: 600; }
.account__email { font-size: 0.875rem; color: var(--color-muted); overflow-wrap: anywhere; }
.account__phone { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin-top: 0.25rem; font-size: 0.875rem; }
.account__delete { display: inline-block; margin-top: 0.25rem; font-size: 0.875rem; color: var(--color-danger); }

/* One square per business the account may own; the owned ones are filled. */
.usage__slots { display: flex; gap: 3px; margin-bottom: 0.3rem; }
.usage__slot { width: 0.7rem; height: 0.7rem; border-radius: 2px; border: 1.5px solid var(--color-primary); }
.usage__slot.is-used { background: var(--color-primary); }
.usage__slot.is-over { border-color: var(--color-warning-text); background: var(--color-warning-text); }
.usage__count { font-weight: 600; }
.usage__status { font-size: 0.8rem; color: var(--color-muted); }
.usage__status--full { color: var(--color-warning-text); }
.usage__status--room { color: var(--color-success-text); }
.usage__saved { font-size: 0.8rem; color: var(--color-success-text); margin-top: 0.25rem; }
.usage__saved::before { content: "✓ "; }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); overflow: hidden; }
.stepper__button { width: 2.75rem; height: 2.75rem; border: 0; background: none; font: inherit; font-size: 1.25rem; line-height: 1; color: var(--color-primary); cursor: pointer; }
.stepper__button:hover:not([disabled]) { background: var(--color-bg); }
.stepper__button:focus-visible { outline-offset: -3px; }
.stepper__button[disabled] { color: var(--color-border); cursor: default; }
.stepper__value { min-width: 2.75rem; display: flex; align-items: center; justify-content: center; font-weight: 600; border-inline: 1px solid var(--color-border); }

/* The row just saved: a short highlight that shows which account changed. */
.accounts-table tr.is-saved { animation: row-saved 2.4s ease-out; }
@keyframes row-saved { from { background: var(--color-success-bg); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .accounts-table tr.is-saved { animation: none; background: var(--color-success-bg); } }

/* On a phone each account is a small card: who, then the quota and its stepper side by side. */
@media (max-width: 639px) {
    .accounts-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .accounts-table, .accounts-table tbody { display: block; }
    .table.accounts-table tr { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 1rem; align-items: center; padding: 0.85rem 0.75rem; border-bottom: 1px solid var(--color-border); }
    .table.accounts-table td { display: block; border: 0; padding: 0; }
    .table.accounts-table td:first-child { grid-column: 1 / -1; }
    .accounts-table .usage__status { white-space: nowrap; }
}
.auth-account {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.75rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.875rem;
}

/* Dashboard */

.store-url { font-size: 1.05rem; word-break: break-all; text-align: right; }
.seo-profile__title { margin: 1.25rem 0 0.25rem; font-size: 1rem; }

/* The site's QR code on the dashboard: the code beside its actions, stacked on a phone. */
.qr-share { display: flex; gap: 1.25rem; align-items: flex-start; margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--color-border); }
.qr-share__code { flex: 0 0 132px; background: #fff; border: 1px solid var(--color-border); border-radius: 8px; padding: 4px; }
.qr-share__code svg { display: block; width: 100%; height: auto; }
.qr-share__text { flex: 1; min-width: 0; }
.qr-share__text h3 { margin: 0 0 0.25rem; font-size: 1rem; }
@media (max-width: 560px) {
    .qr-share { flex-direction: column; align-items: stretch; }
    .qr-share__code { flex-basis: auto; width: 160px; align-self: center; }
}

.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.5rem; }
.checklist__item { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
/* A step with a line of what to do, or its own "done" button: the label stays beside its circle, the rest under it. */
.checklist__item.has-detail > a { flex: 1 1 0; min-width: 0; }
.checklist__item.has-detail .checklist__confirm,
.checklist__item.has-detail .checklist__hint { flex-basis: 100%; margin-inline-start: 1.85rem; }
.checklist__hint { color: var(--color-muted); font-size: 0.875rem; }
/* An address in a Hebrew line: kept whole, and broken only when it is longer than the line itself. */
.checklist__email { display: inline-block; max-width: 100%; overflow-wrap: anywhere; }
.setup-progress { margin: 0 0 0.25rem; font-size: 1.05rem; font-weight: 700; }
/* Everything required is done: the one place on the page that asks to be noticed. */
.setup-ready {
    display: grid;
    gap: 0.6rem;
    justify-items: start;
    margin: 0.25rem 0 0.75rem;
    padding: 1rem;
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    background: var(--color-success-bg);
    color: var(--color-success-text);
}
.setup-ready__title { display: flex; align-items: center; gap: 0.6rem; margin: 0; font-size: 1.2rem; font-weight: 700; }
.setup-ready__title::before {
    content: "✓";
    flex: none;
    display: grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    font-size: 1rem;
    color: var(--color-primary-text);
    background: var(--color-primary);
}
.setup-ready__text { margin: 0; }
.btn--large { padding: 0.85rem 1.75rem; font-size: 1.05rem; }
.checklist__item::before {
    content: "";
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: 50%;
}
.checklist__item.is-done { color: var(--color-success-text); }
.checklist__item.is-done::before {
    content: "✓";
    display: grid;
    place-items: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-primary-text);
    background: var(--color-primary);
    border-color: var(--color-primary);
}

/* Tables */

.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.search-form input { flex: 1 1 12rem; min-width: 0; }
.search-form select { flex: 0 1 auto; width: auto; }

.table-wrap { position: relative; overflow-x: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 0.65rem 0.75rem; text-align: start; border-bottom: 1px solid var(--color-border); vertical-align: top; }
.table th { font-size: 0.875rem; color: var(--color-muted); }
.table tr:last-child td { border-bottom: 0; }

.empty-state { text-align: center; padding: 2rem 1rem; color: var(--color-muted); }

.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.pagination__disabled { color: var(--color-muted); }

/* Landing and errors */

.landing, .error-page { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 2rem 1rem; text-align: center; }
.landing__hero { max-width: 640px; }
.landing__hero h1 { font-size: 2rem; }
.landing__lead { font-size: 1.15rem; color: var(--color-muted); }
.landing__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
.error-page__code { font-size: 3rem; font-weight: 700; color: var(--color-border); margin: 0; }

@media (min-width: 960px) {
    .editor-layout { grid-template-columns: minmax(0, 1fr) 22rem; }
    .editor-layout__side { position: sticky; top: 1rem; }
    .container:has(.editor-layout) { max-width: 1200px; }
}

@media (min-width: 640px) {
    .day-row__ranges { padding-inline-start: 3.35rem; }
    .option-row { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
    .option-row__fields { grid-template-columns: minmax(0, 1fr) 8rem; }
    .option-row__combo, .option-row .field__error { grid-column: 1 / -1; }
    .choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .form--grid { grid-template-columns: 1fr 1fr; }
}

/* Orders board */
.board { display: grid; gap: 1rem; margin-bottom: 1rem; }
@media (min-width: 900px) { .board { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; } }
.board__column { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.75rem; min-height: 8rem; }
.board__column--new { border-top: 4px solid var(--color-info); }
.board__column--preparing { border-top: 4px solid #b45309; }
.board__column--ready { border-top: 4px solid var(--color-primary); }
.board__title { display: flex; align-items: center; gap: 0.5rem; font-size: 1.05rem; margin-bottom: 0.5rem; }
.board__count { display: inline-block; min-width: 1.6rem; padding: 0 0.4rem; border-radius: 999px; background: var(--color-bg); border: 1px solid var(--color-border); font-size: 0.85rem; text-align: center; }
/* "תשלומים לבדיקה": card payments nobody could confirm, above the columns until the business checks them. */
.board__check { margin-bottom: 1rem; }
.board__check h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.board__check p { margin: 0 0 0.5rem; }
.board__check-list { margin: 0; padding-inline-start: 1.25rem; }
.board__check-list a { font-weight: 600; color: inherit; }
.board__empty { color: var(--color-muted); font-size: 0.9rem; margin: 0; }
.board__whatsapp { display: block; margin-top: 0.25rem; font-size: 0.8125rem; color: var(--color-muted); }
.board__whatsapp--sent { color: var(--color-success-text); }
.board__whatsapp--failed { color: var(--color-danger); font-weight: 600; }
/* "הסתיימו היום" on a wide screen: beside the status, so the row stays one line high. */
@media (min-width: 900px) { .table .board__whatsapp { display: inline-block; margin: 0; margin-inline-start: 0.6rem; } }
.order-card { border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem; margin-bottom: 0.75rem; background: var(--color-surface); }
.order-card--waiting { border-color: var(--color-danger); box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.15); }
.order-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.order-card__title { font-size: 1.15rem; margin: 0; display: flex; align-items: center; gap: 0.5rem; }
.order-card__time { font-size: 0.85rem; color: var(--color-muted); }
.order-card--waiting .order-card__time { color: var(--color-danger); font-weight: 600; }
.order-card__customer { margin: 0.35rem 0 0; font-weight: 600; }
.order-card__meta { margin: 0.1rem 0 0; font-size: 0.9rem; color: var(--color-muted); }
.order-card__items { list-style: none; margin: 0.5rem 0; padding: 0.5rem 0; border-top: 1px dashed var(--color-border); border-bottom: 1px dashed var(--color-border); }
.order-card__items li { padding: 0.15rem 0; font-size: 0.95rem; }
.order-card__note { display: block; margin-top: 0.2rem; padding: 0.2rem 0.5rem; background: var(--color-warning-bg); color: var(--color-warning-text); border-radius: 6px; font-size: 0.9rem; }
.order-card__total { margin: 0 0 0.5rem; font-weight: 700; }
.order-card__actions, .order-detail__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.disclosure--action > summary { list-style: none; display: inline-flex; }
.disclosure--action > summary::-webkit-details-marker { display: none; }
.disclosure--action[open] { flex-basis: 100%; }
.order-action { margin-top: 0.5rem; padding: 0.75rem; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg); display: grid; gap: 0.5rem; }
.chip--input { gap: 0.35rem; }
.chip--input input { width: 4.5rem; }
.badge--delivery { background: #e0f2fe; color: #075985; border-color: transparent; }
.badge--pickup { background: #ede9fe; color: #4c1d95; border-color: transparent; }
.badge--status-new { background: var(--color-info-bg); color: var(--color-info-text); border-color: transparent; }
.badge--status-preparing { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }
.badge--status-ready, .badge--status-out_for_delivery, .badge--status-completed { background: var(--color-success-bg); color: var(--color-success-text); border-color: transparent; }
.badge--status-rejected, .badge--status-cancelled, .badge--status-cancelled_by_customer, .badge--status-expired, .badge--status-payment_failed { background: var(--color-bg); color: var(--color-muted); }
.subnav__count { display: inline-block; min-width: 1.3rem; padding: 0 0.35rem; border-radius: 999px; background: var(--color-info); color: #fff; font-size: 0.75rem; text-align: center; margin-inline-start: 0.25rem; }
.order-lines { list-style: none; margin: 0; padding: 0; }
.order-lines__item { display: flex; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.order-lines__price { white-space: nowrap; font-weight: 600; }
.kv-list { display: grid; gap: 0.35rem; margin: 0.75rem 0 0; }
.kv-list > div { display: flex; justify-content: space-between; gap: 1rem; }
.kv-list dt { color: var(--color-muted); }
.kv-list dd { margin: 0; text-align: end; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li { display: flex; gap: 0.75rem; padding: 0.35rem 0; border-bottom: 1px solid var(--color-border); }
.event-list__time { color: var(--color-muted); white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.75rem; }
.stat { background: var(--color-bg); border: 1px solid transparent; border-radius: 8px; padding: 0.75rem; }
.stat__value { display: block; font-size: 1.5rem; font-weight: 700; }
.stat__label { color: var(--color-muted); font-size: 0.9rem; }
/* A tile that is a link: the number stays in the link color without an underline; the label carries the underline. */
a.stat { display: block; text-decoration: none; }
a.stat .stat__label { text-decoration: underline; }
a.stat:hover { border-color: var(--color-primary); background: var(--color-surface); }
/* A summary styled as a button keeps the button's colours and padding. */
.disclosure--action > summary.btn { padding: 0.35rem 0.75rem; }
.disclosure--action > summary.btn--primary { color: var(--color-primary-text); }
.disclosure--action > summary.btn--danger { color: var(--color-danger); }
.chip--input { display: inline-flex; align-items: center; gap: 0.35rem; }
.chip--input span { border: 0; background: none; padding: 0; min-height: 0; cursor: default; }
.chip--input input { position: static; opacity: 1; width: 4.5rem; min-height: 2.75rem; padding: 0 0.5rem; border: 1px solid var(--color-border); border-radius: 8px; font: inherit; }
.actions-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* API and integrations settings */

.card--highlight { border: 2px solid var(--color-primary); }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.95rem; direction: ltr; unicode-bidi: isolate; word-break: break-all; text-align: left; background: var(--color-bg); padding: 0.4rem 0.6rem; border-radius: 8px; display: inline-block; max-width: 100%; }
p.secret { display: block; margin: 0.5rem 0; font-size: 1.05rem; user-select: all; }
.secret--short { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; vertical-align: bottom; }
.kv-list--stacked > div { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.kv-list--stacked dd { text-align: start; }
.form--inline-add { grid-template-columns: minmax(0, 1fr) auto; align-items: end; margin-top: 1rem; }
.form--inline-add .field { margin: 0; }
.endpoint-list { list-style: none; padding: 0; margin: 0.75rem 0 1.25rem; display: grid; gap: 0.75rem; }
.endpoint { border: 1px solid var(--color-border); border-radius: 8px; padding: 0.75rem; }
.endpoint--paused { background: var(--color-bg); }
.endpoint__head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.endpoint__events { margin: 0.5rem 0 0; }
.endpoint__meta { margin: 0.25rem 0 0; font-size: 0.875rem; }
.table tr.is-muted td { color: var(--color-muted); }
.table tr.is-failed td { background: var(--color-error-bg); }
.badge--delivery-sent { background: var(--color-success-bg); color: var(--color-success-text); border-color: transparent; }
.badge--delivery-failed { background: var(--color-error-bg); color: var(--color-error-text); border-color: transparent; }
.badge--delivery-pending { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: transparent; }
@media (max-width: 600px) {
    .form--inline-add { grid-template-columns: 1fr; }
}
.secret--block { display: block; white-space: pre-wrap; margin: 0.5rem 0; padding: 0.75rem; font-size: 0.95rem; user-select: all; }
.section-subtitle { margin: 1.5rem 0 0.5rem; font-size: 1rem; }

/* Daily report */

.date-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.date-nav__form { display: flex; gap: 0.5rem; align-items: center; }
.date-nav__form input[type="date"] { width: auto; padding: 0.4rem 0.5rem; font: inherit; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); min-height: 2.5rem; }
.report-day { margin: 0 0 1rem; font-size: 1.15rem; }
.report-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.report-grid .card { margin-bottom: 0; }
.report-grid + .card { margin-top: 1rem; }

/* "מאיפה מגיעים" (docs/SPEC-store-analytics.md). The two chart colours were checked together: readable on the card,
   and told apart by colour-blind readers too. Blue is always visitors, orange is always orders. */
.date-nav__form select { width: auto; padding: 0.4rem 0.5rem; font: inherit; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); min-height: 2.5rem; }
.visits-headline { margin: 0 0 1rem; font-size: 1.05rem; }
.visits-table th[scope="row"] { font-size: 1rem; font-weight: 600; color: var(--color-text); }
.visits-table td { font-variant-numeric: tabular-nums; white-space: nowrap; }
.visits-table th[scope="row"] { overflow-wrap: anywhere; }
/* A phone: the four columns fit without scrolling the table sideways. */
@media (max-width: 520px) {
    .visits-table th, .visits-table td { padding: 0.55rem 0.4rem; }
    .visits-table thead th { font-size: 0.8rem; }
}

.funnel { --chart-visitors: #2a78d6; list-style: none; margin: 0 0 0.75rem; padding: 0; display: grid; gap: 0.65rem; }
.funnel__step { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 6rem; align-items: center; gap: 0.75rem; }
.funnel__track { display: block; height: 16px; }
/* Grows from the start of the line; only the far end is rounded. */
.funnel__bar { display: block; height: 100%; background: var(--chart-visitors); border-start-end-radius: 4px; border-end-end-radius: 4px; }
.funnel__value { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
    .funnel__step { grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; }
    .funnel__track { grid-column: 1 / -1; grid-row: 2; }
}

.day-charts { --chart-visitors: #2a78d6; --chart-orders: #eb6834; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.day-chart { min-width: 0; }
.day-chart__title { margin: 0 0 0.25rem; font-size: 0.95rem; }
.day-chart__plot { display: flex; align-items: flex-end; gap: 2px; height: 136px; padding-top: 1.25rem; border-bottom: 1px solid var(--color-border); }
.day-chart__col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.day-chart__bar { display: block; width: 100%; max-width: 24px; border-radius: 4px 4px 0 0; background: var(--chart-visitors); }
.day-chart--orders .day-chart__bar { background: var(--chart-orders); }
.day-chart__col:hover .day-chart__bar, .day-chart__col.is-picked .day-chart__bar { filter: brightness(1.2); }
.day-chart__peak { margin-bottom: 2px; font-size: 0.75rem; line-height: 1; color: var(--color-muted); }
.day-chart__axis { display: flex; gap: 2px; margin-top: 0.3rem; font-size: 0.75rem; color: var(--color-muted); }
.day-chart__axis span { flex: 1 1 0; min-width: 0; display: flex; justify-content: center; white-space: nowrap; }
.day-chart__readout { margin-top: 0.4rem; min-height: 1.3rem; }
.chart-table { margin-top: 1rem; }
.chart-table summary { padding: 0.6rem 0; cursor: pointer; color: var(--color-primary); font-weight: 600; }
.chart-table .table-wrap { margin-top: 0.25rem; }

.ready-links { list-style: none; margin: 0.75rem 0; padding: 0; display: grid; gap: 0.75rem; }
.ready-links__item { display: grid; grid-template-columns: 12rem minmax(0, 1fr) auto; align-items: center; gap: 0.35rem 0.75rem; }
.ready-links__place { font-weight: 600; }
.ready-links__url { overflow-wrap: anywhere; font-size: 0.9rem; color: var(--color-muted); }
.ready-links__item [data-copy-status] { grid-column: 1 / -1; }
.ready-links__item [data-copy-status]:empty { display: none; }
@media (max-width: 640px) {
    .ready-links__item { grid-template-columns: minmax(0, 1fr) auto; }
    .ready-links__place { grid-column: 1 / -1; }
}
.dashboard-visits { margin: 0.9rem 0 0; }
.card--danger { border-color: var(--color-danger); }
.settings-footer-link { margin: 1.5rem 0 0; text-align: center; }
.preset-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.preset-row__label { font-weight: 600; }

/* Kiosk settings (docs/SPEC-kiosk.md) */

.alert--warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.kiosk-code__digits {
    margin: 0.5rem 0;
    font-size: 2.75rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    font-variant-numeric: tabular-nums;
    text-align: end; /* the digits read left to right, and sit on the right like the rest of the page */
    direction: ltr;
    unicode-bidi: isolate;
}
.kiosk-code__steps,
.kiosk-about { margin: 0.75rem 0 0; padding-inline-start: 1.25rem; display: grid; gap: 0.35rem; }
.kiosk-toggle, .api-toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
/* Platform admin: the subscription of each business, and the form that marks a payment. */
.billing-cell { display: grid; gap: 0.4rem; min-width: 11rem; }
.billing-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; font-size: 0.875rem; }
.billing-form input[type="date"] { min-height: 2.25rem; padding: 0.2rem 0.4rem; }
.billing-form__check { display: inline-flex; align-items: center; gap: 0.3rem; }

/* Image upload fields (admin/partials/image-field, image-drop.js) */

/* Image upload: drop zone + preview in the exact shape the server crops to (ImageStore: largest centred
   window, so aspect-ratio + object-fit: cover shows what customers will see). Without JS the native file
   input and the remove checkbox work as before; the script adds .is-enhanced and takes over. */

.image-drop {
    --image-drop-ratio: 4 / 3;
    --image-drop-width: 20rem;    /* the whole control: prompt, preview, buttons, drag overlay */
    --image-drop-radius: 8px;
    --image-drop-edge: #7d8796;   /* dashed edge: 3.3:1 on --color-bg (WCAG 1.4.11) */
    --image-drop-tint: #e6f4f2;   /* drag-over fill: --color-primary-hover on it is 6.9:1 */
    position: relative;           /* contains the visually hidden file input */
    align-content: start;         /* in .form--grid the row can be taller than this field */
}
.image-drop--logo     { --image-drop-ratio: 1 / 1; --image-drop-radius: 50%; }
.image-drop--cover    { --image-drop-ratio: 3 / 1; --image-drop-width: 36rem; }
.image-drop--document { --image-drop-ratio: auto; }

/* The drop target. A fixed width, never "fit-content": an image inside would size it to its own pixels. */
.image-drop__body {
    position: relative;
    display: grid;
    gap: 0.6rem;
    width: min(100%, var(--image-drop-width));
}
.image-drop--logo .image-drop__body {
    grid-template-columns: 8rem minmax(0, 1fr);
    align-items: center;
    column-gap: 1rem;
}

/* Empty: one dashed box, same for every field. */
.image-drop__prompt {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 0.3rem;
    min-height: 9.5rem;
    padding: 1rem;
    text-align: center;
    color: var(--color-muted);
    background: var(--color-bg);
    border: 2px dashed var(--image-drop-edge);
    border-radius: var(--radius);
    cursor: pointer;
}
.image-drop--logo .image-drop__prompt { grid-column: 1 / -1; }
.image-drop__prompt p { margin: 0; }
.image-drop__title { font-weight: 600; color: var(--color-text); }
.image-drop__or { font-size: 0.875rem; }
.image-drop__prompt .btn { margin-top: 0.2rem; }

/* The prompt icon has the shape of the crop, so the owner sees it before choosing a photo. */
.image-drop__shape {
    display: grid;
    place-items: center;
    height: 2.25rem;
    aspect-ratio: var(--image-drop-ratio);
    margin-bottom: 0.3rem;
    color: var(--image-drop-edge);
    border: 2px solid currentColor;
    border-radius: 4px;
}
.image-drop--logo .image-drop__shape { border-radius: 50%; }
.image-drop--document .image-drop__shape { aspect-ratio: 3 / 4; }
.image-drop__shape svg { width: 1.1rem; height: 1.1rem; }

/* Filled: the preview in the final shape. */
.image-drop__frame {
    position: relative;
    width: 100%;
    aspect-ratio: var(--image-drop-ratio);
    margin: 0;
    overflow: hidden;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--image-drop-radius);
}
.image-drop__frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* A document is not cropped: show all of it. */
.image-drop--document .image-drop__frame { justify-self: start; width: auto; max-width: 100%; }
.image-drop--document .image-drop__frame img { width: auto; height: auto; max-width: 100%; max-height: 16rem; object-fit: contain; }

.image-drop__side { display: grid; gap: 0.6rem; min-width: 0; }

.image-drop__note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; margin: 0; font-size: 0.875rem; color: var(--color-muted); }
.image-drop__pill {
    padding: 0.05rem 0.55rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    background: var(--color-primary);
    color: var(--color-primary-text);
}

.image-drop__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.image-drop--logo .image-drop__actions { flex-direction: column; }

/* Chosen, not saved yet. */
.image-drop.is-new .image-drop__frame { border: 2px solid var(--color-primary); }

/* Marked for removal: still visible, clearly on its way out, with undo next to it. */
.image-drop.is-removing .image-drop__frame { border-style: dashed; border-color: var(--color-warning-text); }
.image-drop.is-removing .image-drop__frame img { opacity: 0.35; filter: grayscale(1); }
.image-drop.is-removing .image-drop__note { color: var(--color-warning-text); font-weight: 600; }

/* Error: the previous image (or the empty prompt) stays; the edge turns red and the text says what to do. */
.image-drop.is-error .image-drop__prompt,
.image-drop.is-error .image-drop__frame { border-color: var(--color-danger); }
.image-drop .field__error:empty { display: none; }

/* Drag-over: one overlay on the whole drop target. */
.image-drop__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: none;
    place-items: center;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--color-primary-hover);
    background: var(--image-drop-tint);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius);
    pointer-events: none;
}
.image-drop.is-dragover .image-drop__overlay { display: grid; }

/* A file is being dragged somewhere over the page: show every place it can go. */
.image-drop.is-drag-active .image-drop__prompt,
.image-drop.is-drag-active .image-drop__frame { border-color: var(--color-primary); }

/* Keyboard focus on the button inside: the button keeps its own outline, the box echoes it. */
.image-drop__prompt:has(:focus-visible) { border-color: var(--color-focus); }

/* While the browser reads the image size (a big phone photo takes a moment). */
.image-drop.is-busy .image-drop__body { opacity: 0.6; cursor: progress; }

@media (prefers-reduced-motion: no-preference) {
    .image-drop__prompt, .image-drop__frame { transition: border-color 0.15s, background-color 0.15s; }
}

/* Phone: the buttons share the row (each at least 44px tall from .btn). */
@media (max-width: 639px) {
    .image-drop__actions .btn { flex: 1 1 0; min-width: 0; }
}

/* Touch screens: nothing talks about dragging, the button is the whole story. */
@media (hover: none) and (pointer: coarse) {
    .image-drop__title, .image-drop__or { display: none; }
    .image-drop__prompt { min-height: 7.5rem; }
}

/* Dashboard recommendations (PublishChecklist::tips): visible, never pushy, foldable with "לא עכשיו". */
.setup-tips { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--color-border); }
/* Right under the card's title (a live site, nothing required missing): no second divider. */
h2 + .setup-tips { margin-top: 0; padding-top: 0; border-top: 0; }
.setup-tips__title { margin: 0 0 0.6rem; font-size: 1rem; }
.setup-tips__toggle { margin-top: 0.6rem; }
.setup-tips__done { margin: 0; color: var(--color-muted); font-size: 0.9rem; }
.setup-tips__done::before { content: "✓ "; color: var(--color-success-text); font-weight: 700; }
.setup-tips__folded > summary {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem;
    cursor: pointer; list-style: none; color: var(--color-primary); font-size: 0.9375rem; font-weight: 600;
}
.setup-tips__folded > summary::-webkit-details-marker { display: none; }
/* A chevron: down when folded, up when open. */
.setup-tips__folded > summary::after {
    content: ""; width: 0.45rem; height: 0.45rem; margin-top: -0.2rem;
    border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.setup-tips__folded[open] > summary::after { margin-top: 0.2rem; transform: rotate(-135deg); }
.setup-tips__folded[open] > summary { margin-bottom: 0.5rem; }
.setup-tips__folded > summary:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; border-radius: 4px; }

/* Menu: a dish without a photo gets a quiet camera in its empty square. */
.product-row__image--empty { display: grid; place-items: center; color: var(--color-muted); }
.product-row__image--empty svg { width: 1.25rem; height: 1.25rem; opacity: 0.7; }

/* Help page (admin/help): short topics with a screenshot each. */
.help-intro { margin: -0.25rem 0 1rem; }
.help-toc ol { margin: 0; padding-inline-start: 1.25rem; columns: 2 12rem; column-gap: 2rem; }
.help-toc li { margin: 0.2rem 0; break-inside: avoid; }
.help-section { scroll-margin-top: 1rem; }
.help-section h2 { margin-top: 0; }
.help-section ol { margin: 0 0 1rem; padding-inline-start: 1.25rem; display: grid; gap: 0.4rem; max-width: 46rem; }
.help-shot { margin: 0; }
.help-videos { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.help-video { margin: 0; }
.help-video video { display: block; width: 100%; height: auto; background: #1d2330; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }
.help-video figcaption { margin-top: 0.5rem; display: grid; gap: 0.15rem; }
.help-video__title { font-weight: 700; }
.help-video__about { color: var(--color-muted); font-size: 0.95rem; }
/* The settings screens under "הגדרות": the same chips as the help tabs, wrapping onto a second line on a phone. */
.section-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1rem; }
.section-tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.35rem 0.85rem; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-text); text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.section-tabs a:hover { border-color: var(--color-primary); }
.section-tabs a[aria-current="page"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-text); }
/* A phone: one row that scrolls sideways, like the main menu, instead of four rows of chips above the screen. The
   current tab is scrolled into view (admin.js). */
@media (max-width: 699px) {
    .section-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
    .section-tabs::-webkit-scrollbar { display: none; }
    .section-tabs a { flex: 0 0 auto; white-space: nowrap; padding: 0.3rem 0.75rem; font-size: 0.875rem; }
}

.help-tabs { display: flex; gap: 0.5rem; margin: 0 0 1rem; }
.help-tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0.4rem 1rem; border: 1px solid var(--color-border); border-radius: 999px; background: var(--color-surface); color: var(--color-text); text-decoration: none; font-weight: 600; }
.help-tabs a[aria-current="page"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-primary-text); }
@media (min-width: 900px) { .help-videos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-shot img { display: block; max-width: min(100%, 44rem); height: auto; border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Product form: "+ קטגוריה חדשה" in place, and an edit link on each option group. */
.quick-category { margin-top: 0.35rem; }
.quick-category__box { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.quick-category__box input { flex: 1 1 100%; min-width: 0; }
.quick-category__box .field__error { flex-basis: 100%; }
.quick-category__box .field__error:empty { display: none; }
.group-picker__edit { margin-inline-start: auto; }

/* "API וחיבורים": the developer part, closed until opened (docs/SPEC-phase1.md section 8). */
.dev-area { display: grid; gap: 1rem; margin-top: 1rem; }
.dev-area > summary { padding: 0.75rem 1rem; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; }
.dev-area[open] > summary { margin-bottom: 0; }

/* "קיוסק" before the add-on is enabled (docs/SPEC-kiosk.md, section 2): two screenshots side by side, stacked on a phone. */
.kiosk-offer__shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin-top: 1rem; }
.kiosk-offer__shot { margin: 0; }
.kiosk-offer__shot img {
    display: block; width: 100%; height: auto;
    aspect-ratio: 1180 / 820; object-fit: cover; object-position: top; /* a tablet in landscape: both shots the same height */
    border: 1px solid var(--color-border); border-radius: 10px;
}
.kiosk-offer__shot figcaption { margin-top: 0.35rem; font-size: 0.875rem; color: var(--color-muted); }

/* "עסקים" (platform): the business, its address and the entry to support in the first cell; each add-on on one line. */
.business-cell__name { font-weight: 600; }
.business-cell__support { margin-top: 0.4rem; }
.platform-businesses .kiosk-toggle, .platform-businesses .api-toggle { flex-wrap: nowrap; white-space: nowrap; }
.kiosk-toggle + .api-toggle { margin-top: 0.4rem; }
.addon-toggle__label { min-width: 4.5rem; font-weight: 600; }
/* The table has eight kinds of facts per business: on a wide screen it gets the room, instead of hiding the last column. */
@media (min-width: 1100px) {
    .container:has(.platform-businesses) { max-width: 1240px; }
}

/* Drag and drop of the menu's categories (02.10.2026). The handle is the only place a drag starts, so scrolling a
   phone never moves a category by accident. */
.drag-handle {
    display: inline-grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    margin-inline-end: 0.25rem;
    border-radius: 8px;
    color: var(--color-muted);
    font-size: 1.25rem;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.drag-handle:hover { background: var(--color-bg); color: var(--color-text); }
.drag-handle:active { cursor: grabbing; }
.menu-category.is-drag-ghost { opacity: 0.4; outline: 2px dashed var(--color-primary); }
.sr-status:empty { display: none; }
.sr-status { margin: 0 0 0.75rem; padding: 0.5rem 0.75rem; border-radius: 8px; background: var(--color-success-bg); color: var(--color-success-text); font-weight: 600; }


/* "מועדון לקוחות" (docs/SPEC-loyalty.md): the terms, and what they mean in one sentence. */
fieldset.form--grid { border: 0; padding: 0; margin: 0; min-width: 0; }
.loyalty-summary { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: 10px; background: var(--color-bg); font-weight: 700; }
