/* Agency panel and client back office. No framework, no CDN, no inline styles.
   Slate-blue light theme: a slate sidebar menu on a light grey page. */

:root {
  --bg: #eceff1;
  --surface: #ffffff;
  --surface-2: #f5f7f8;
  --text: #263238;
  --muted: #546e7a;
  --line: #cfd8dc;
  --line-strong: #b0bec5;
  --field-line: #78909c;
  --accent: #455a64;
  --accent-hover: #263238;
  --accent-text: #ffffff;
  --link: #1565c0;
  --danger: #c62828;
  --ok: #2e7d32;
  --warn: #b45309;
  --sidebar: #455a64;
  --sidebar-text: rgb(255 255 255 / 86%);
  --sidebar-width: 220px;
  --bar-height: 56px;
  --radius: 6px;
  --shadow: 0 1px 3px rgb(0 0 0 / 12%);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b2327;
    --surface: #232d32;
    --surface-2: #2a353b;
    --text: #eceff1;
    --muted: #a7b6bd;
    --line: #37474f;
    --line-strong: #4f6168;
    --field-line: #7d9099;
    --accent: #90a4ae;
    --accent-hover: #b0bec5;
    --accent-text: #102027;
    --link: #82b1ff;
    --danger: #ff8a80;
    --ok: #81c784;
    --warn: #ffb74d;
    --sidebar: #263238;
    --shadow: 0 1px 3px rgb(0 0 0 / 40%);
    color-scheme: dark;
  }
}

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

html { font-family: var(--font); font-size: 16px; line-height: 1.5; color: var(--text); background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.skip-link { position: absolute; left: -999px; top: 0; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 1100; }

svg.i { width: 1.05em; height: 1.05em; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.15em; }

/* ---------------------------------------------------------------- shell */

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 1000;
  display: flex; flex-direction: column; background: var(--sidebar); color: var(--sidebar-text);
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  box-shadow: 2px 0 8px rgb(38 50 56 / 25%); transition: transform .25s ease;
  scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 30%) transparent;
}
.sidebar :focus-visible { outline-color: #ffffff; outline-offset: -3px; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: 14px 12px 13px; border-bottom: 1px solid rgb(255 255 255 / 14%); margin-bottom: 6px; }
.sidebar-brand a { display: flex; align-items: center; gap: .6rem; color: #ffffff; text-decoration: none;
  font-weight: 700; font-size: 1.05rem; line-height: 1.25; min-width: 0; }
.sidebar-brand small { display: block; color: rgb(255 255 255 / 72%); font-size: .75rem; font-weight: 400; }
.brand-logo { height: 2rem; width: auto; max-width: 4.5rem; object-fit: contain; background: #ffffff; border-radius: 4px; padding: 2px; }
.sidebar-close { display: none; }

.sidebar-nav { list-style: none; margin: 0; padding: 0; }
.sidebar-nav li.group-start { border-top: 1px solid rgb(255 255 255 / 9%); margin-top: 5px; padding-top: 5px; }
.sidebar-nav a, .sidebar-back, .sidebar-switch > summary, .sidebar-foot button, .sidebar-who {
  display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 12px 7px 13px;
  color: var(--sidebar-text); text-decoration: none; font-size: 13px; font-weight: 500; line-height: 20px;
  border-left: 3px solid transparent; white-space: nowrap; overflow: hidden;
  transition: background-color .15s ease, color .15s ease;
}
.sidebar-nav a > span:first-of-type, .sidebar-back > span, .sidebar-who > span { overflow: hidden; text-overflow: ellipsis; }
.sidebar svg.i { width: 15px; height: 15px; opacity: .85; }
.sidebar-nav a:hover, .sidebar-back:hover, .sidebar-switch > summary:hover, .sidebar-foot button:hover {
  background: rgb(255 255 255 / 8%); color: #ffffff;
}
.sidebar-nav a[aria-current="page"] { background: rgb(255 255 255 / 12%); color: #ffffff; border-left-color: #ffffff; font-weight: 600; }
.sidebar-nav a[aria-current="page"] svg.i, .sidebar-nav a:hover svg.i { opacity: 1; }
.nav-badge { margin-left: auto; background: #c62828; color: #ffffff; font-size: 11px; font-weight: 700; line-height: 1;
  padding: 3px 6px; border-radius: 999px; }
.sidebar-back { border-bottom: 1px solid rgb(255 255 255 / 9%); margin-bottom: 5px; }
.sidebar-switch { margin-bottom: 5px; }
.sidebar-switch > summary { cursor: pointer; list-style: none; }
.sidebar-switch > summary::-webkit-details-marker { display: none; }
.sidebar-switch form { display: block; }
.sidebar-switch button { all: unset; box-sizing: border-box; display: block; width: 100%; cursor: pointer;
  padding: 6px 12px 6px 36px; font-size: 13px; color: var(--sidebar-text); }
.sidebar-switch button:hover { background: rgb(255 255 255 / 8%); color: #ffffff; }
.sidebar-switch button:focus-visible { outline: 3px solid #ffffff; outline-offset: -3px; }
.sidebar > nav { flex: 1; }
.sidebar-foot { border-top: 1px solid rgb(255 255 255 / 14%); padding: 6px 0 10px; margin-top: 1rem; }
.sidebar-foot form { margin: 0; }
.sidebar-foot button { width: 100%; background: none; border: 0; border-left: 3px solid transparent; border-radius: 0;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 500; }
.sidebar-foot button:hover { border-color: transparent; }
.sidebar-who { color: rgb(255 255 255 / 72%); }
a.sidebar-who:hover { background: rgb(255 255 255 / 8%); color: #ffffff; }
a.sidebar-who[aria-current="page"] { background: rgb(255 255 255 / 12%); color: #ffffff; border-left-color: #ffffff; }

.shell-main { margin-left: var(--sidebar-width); min-height: 100vh; }
main { width: 100%; max-width: 72rem; margin: 0 auto; padding: 1.75rem 2rem 4rem; }
main.narrow { max-width: 28rem; }

.mobile-bar { display: none; }
.sidebar-overlay { position: fixed; inset: 0; background: rgb(0 0 0 / 50%); z-index: 999; }
.sidebar-overlay[hidden] { display: none; }

@media (max-width: 991.98px) {
  .mobile-bar { display: flex; align-items: center; gap: .5rem; position: fixed; inset: 0 0 auto 0; z-index: 998;
    height: var(--bar-height); padding: 0 .5rem; background: var(--sidebar); color: #ffffff;
    box-shadow: 0 2px 8px rgb(38 50 56 / 30%); }
  .mobile-brand { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .menu-button, .sidebar-close { display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; padding: 0; background: none; border: 0; color: #ffffff; cursor: pointer; }
  .menu-button svg.i, .sidebar-close svg.i { width: 22px; height: 22px; opacity: 1; }
  .menu-button:focus-visible { outline: 3px solid #ffffff; outline-offset: -3px; }
  .sidebar { transform: translateX(-100%); width: min(280px, 85vw); box-shadow: none; visibility: hidden;
    transition: transform .25s ease, visibility 0s linear .25s; }
  body[data-menu-open] .sidebar { transform: none; visibility: visible; box-shadow: 2px 0 8px rgb(38 50 56 / 25%);
    transition: transform .25s ease; }
  .sidebar-nav a, .sidebar-back, .sidebar-switch > summary, .sidebar-foot button, .sidebar-who { min-height: 44px; font-size: 14px; }
  .shell-main { margin-left: 0; padding-top: var(--bar-height); }
  main { padding: 1.25rem 1rem 3rem; }
}

h1 { font-size: 1.5rem; margin: 0 0 1rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 2rem 0 .75rem; }
p.lede { color: var(--muted); margin-top: -.5rem; }

/* ---------------------------------------------------------------- blocks */

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card + .card { margin-top: 1rem; }
.card > :first-child, .card > form:first-child > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }

.flash { border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line); background: var(--surface); }
.flash.ok { border-color: var(--ok); }
.flash.error { border-color: var(--danger); }
.flash.warn { border-color: var(--warn); }

.badge { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .8rem; border: 1px solid var(--line); color: var(--muted); }
.badge.admin { border-color: var(--accent); color: var(--accent); }
.badge.off { border-color: var(--danger); color: var(--danger); }

.muted { color: var(--muted); }
.mono, code { font-family: var(--mono); font-size: .9em; }
.secret { font-family: var(--mono); background: var(--bg); padding: .5rem .75rem; border-radius: 6px; word-break: break-all; }
.codes { columns: 2; font-family: var(--mono); list-style: none; padding: 0; }
.qr { display: block; width: 12rem; height: 12rem; background: #fff; border-radius: 6px; }

/* ---------------------------------------------------------------- tables */

table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: .6rem .75rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
tbody tr:hover td { background: var(--surface-2); }
td.actions { text-align: right; white-space: nowrap; }
td.actions form { display: inline; }

/* ---------------------------------------------------------------- forms */

form.stack { display: grid; gap: 1rem; }
form.inline { display: flex; flex-wrap: wrap; gap: .75rem; align-items: end; }
label { display: grid; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.error-text { color: var(--danger); font-size: .9rem; margin: 0; }

input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="number"],
input[type="tel"], input[type="date"], input[type="time"], input[type="search"], select, textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--field-line); border-radius: 6px; padding: .55rem .7rem; min-width: 0;
}
input[inputmode="numeric"] { letter-spacing: .2em; font-family: var(--mono); }

button, .button {
  font: inherit; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 6px; padding: .55rem 1rem; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-text); text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.secondary, .button.secondary { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent-hover); }
button.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
button.danger:hover { background: var(--danger); color: #ffffff; }
button.link, button.link:hover { background: none; border: none; color: var(--link); padding: 0; font-weight: 400; text-decoration: underline; }
button:disabled, button:disabled:hover { opacity: .55; cursor: not-allowed; background: var(--surface); border-color: var(--line-strong); color: var(--muted); }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth .card { width: 100%; max-width: 26rem; }
.auth h1 { font-size: 1.4rem; }
.auth .tenant-name { color: var(--muted); margin: 0 0 1.25rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.media-card { padding: .75rem; margin: 0; }
.media-card img { width: 100%; height: 10rem; object-fit: cover; border-radius: 6px; display: block; }
.media-card figcaption { font-size: .85rem; margin-top: .5rem; }

/* forms builder and answers */
.builder-columns { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.builder-list { list-style: none; padding: 0; margin: 0; }
.builder-preview { position: sticky; top: 1rem; }
@media (max-width: 900px) { .builder-columns { grid-template-columns: minmax(0, 1fr); } .builder-preview { position: static; } }
.answers dt { font-weight: 600; margin-top: .75rem; }
.answers dd { margin: .2rem 0 0; white-space: pre-line; }
ul.plain { list-style: none; padding: 0; margin: 0; }
tr.unread td { font-weight: 600; }

/* toasts */
.toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 50; }
.toast { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: var(--radius);
  padding: .65rem 1rem; box-shadow: 0 4px 16px rgb(16 24 40 / 18%); max-width: 22rem; }
.toast.error { border-left-color: var(--danger); }

/* site editing */
.notice { border: 1px solid var(--warn); background: var(--surface); border-radius: var(--radius); padding: .75rem 1rem; margin-bottom: 1rem; }
.notice.locked { border-color: var(--warn); }
.changes-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; justify-content: space-between;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: .75rem 1rem; margin-bottom: 1.25rem; }
.changes-bar .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.changes-bar form { display: inline; }
.block-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.block-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.block-card > summary { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; cursor: pointer; list-style: none; }
.block-card > summary::-webkit-details-marker { display: none; }
.block-card .block-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.block-card .block-body { padding: 0 1rem 1rem; display: grid; gap: 1rem; }
.block-card.is-hidden { opacity: .65; }
.drag { cursor: grab; color: var(--muted); border: 0; background: none; padding: 0 .25rem; font-size: 1.1rem; }
fieldset.items { border: 1px dashed var(--line); border-radius: var(--radius); padding: .75rem; display: grid; gap: .75rem; }
fieldset.items legend { font-weight: 600; font-size: .9rem; padding: 0 .25rem; }
.item { border: 1px solid var(--line); border-radius: 6px; padding: .75rem; display: grid; gap: .6rem; }
.field-row { display: grid; gap: .3rem; }
.field-problem { color: var(--danger); font-size: .85rem; }
.thumb { width: 6rem; height: 4rem; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.preview-shell { display: grid; gap: 1rem; }
.devices { display: flex; gap: .5rem; flex-wrap: wrap; }
.devices button[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }
.preview-stage { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; overflow: auto; }
.preview-stage iframe { display: block; margin: 0 auto; border: 1px solid var(--line); background: #fff; width: 100%; height: 75vh; border-radius: 6px; }
.preview-stage[data-size="tablet"] iframe { width: 820px; max-width: 100%; }
.preview-stage[data-size="phone"] iframe { width: 390px; max-width: 100%; }
.hours-grid { display: grid; gap: .5rem; }
.hours-grid .day { display: grid; grid-template-columns: 7rem repeat(3, minmax(0, 1fr)); gap: .5rem; align-items: center; }
.hours-grid .range { display: flex; gap: .25rem; align-items: center; }
.hours-grid input[type="time"] { font: inherit; padding: .4rem; border: 1px solid var(--field-line); border-radius: 6px; background: var(--surface); color: var(--text); min-width: 0; }
@media (max-width: 700px) { .hours-grid .day { grid-template-columns: 1fr; } }
.status-live { color: var(--ok); font-weight: 600; }
.status-failed { color: var(--danger); font-weight: 600; }
.block-row { padding: .75rem 1rem; }
.media-pick { display: grid; gap: .5rem; }
.media-pick > details > summary { list-style: none; width: fit-content; }
.media-pick > details > summary::-webkit-details-marker { display: none; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .5rem; margin-top: .5rem;
  max-height: 22rem; overflow: auto; padding: .25rem; }
.pick { display: grid; gap: .25rem; font-weight: 400; font-size: .8rem; border: 2px solid var(--line); border-radius: 6px; padding: .35rem; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--accent); }
.pick img { width: 100%; height: 5rem; object-fit: cover; border-radius: 4px; }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pick:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.auth-logo { display: block; max-height: 4rem; max-width: 12rem; margin: 0 0 1rem; object-fit: contain; }
.checklist { list-style: none; padding: 0; margin: .5rem 0; display: grid; gap: .35rem; }
.checklist li { padding-left: 1.5rem; position: relative; }
.checklist li::before { position: absolute; left: 0; font-weight: 700; }
.checklist li.fix::before { content: "!"; color: var(--danger); }
.checklist li.check::before { content: "?"; color: var(--warn); }

/* client cards (agency panel) */
.new-client { margin: 0 0 1.5rem; }
.new-client > summary { list-style: none; width: fit-content; }
.new-client > summary::-webkit-details-marker { display: none; }
.new-client[open] > summary { margin-bottom: 1rem; }
.client-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21rem), 1fr)); }
.client-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; }
.client-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: 1.25rem 1.25rem .25rem; }
.client-card h2 { margin: 0; font-size: 1.3rem; }
.client-card h2 a { color: var(--text); text-decoration: none; }
.client-card h2 a:hover { text-decoration: underline; }
.client-card p { margin: .5rem 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1.1rem; color: var(--muted); }
.client-card p > span, .client-card p > a, .client-address { display: inline-flex; align-items: center; gap: .4rem; }
.client-card p.client-address { gap: .4rem; }
.client-card p.client-published { align-items: flex-start; }
.client-card p.client-published svg.i { margin-top: .2em; }
.client-card p.client-published > span { align-items: flex-start; }
.client-address a { color: var(--muted); text-decoration: none; word-break: break-all; }
.client-address a:hover { color: var(--accent); }
.client-new { color: var(--warn); font-weight: 600; text-decoration: none; }
.client-changes { color: var(--accent); }
.client-card > footer { margin-top: auto; border-top: 1px solid var(--line); padding: .9rem 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.client-card > footer form { display: inline; }
.client-card > footer button, .client-card > footer .button { padding: .4rem .75rem; font-size: .95rem;
  display: inline-flex; align-items: center; gap: .4rem; }
.state { flex: none; font-size: .85rem; font-weight: 700; padding: .2rem .65rem; border-radius: 6px; color: #fff; }
.state-published { background: #2e7d32; }
.state-draft { background: #607d8b; }
.state-suspended { background: #c62828; }
.button.is-disabled { opacity: .5; cursor: not-allowed; }

/* page header with actions (title left, buttons right; stacked on phones) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem 1.5rem;
  border-bottom: 1px solid var(--line); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: .25rem 0 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* back-office home */
.site-summary { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.25rem; margin-bottom: 1rem;
  color: var(--muted); }
.site-summary > span { display: inline-flex; align-items: center; gap: .45rem; }
.site-summary > span.state { color: #ffffff; }
.site-summary a { color: var(--text); }
.site-summary .button { margin-left: auto; }
.tiles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); margin-bottom: 1.5rem; }
.tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .9rem 1rem; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile > svg.i { grid-row: 1 / 3; width: 1.6rem; height: 1.6rem; color: var(--muted); }
.tile-number { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.tile-text { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.tile-label { color: var(--muted); font-size: .85rem; line-height: 1.3; }
.tile-alert { border-left-color: var(--danger); }
.tile-alert > svg.i { color: var(--danger); }
.tile-active { border-left-color: var(--link); }
.tile-active > svg.i { color: var(--link); }
.dash-columns { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
.dash-columns .card + .card { margin-top: 0; }
.message-list { list-style: none; margin: 0 -1.5rem; padding: 0; border-top: 1px solid var(--line); }
.message-list li { border-bottom: 1px solid var(--line); }
.message-list a { display: grid; gap: .15rem; padding: .7rem 1.5rem; color: var(--text); text-decoration: none; }
.message-list a:hover { background: var(--surface-2); }
.message-top { display: flex; align-items: center; gap: .5rem; }
.message-top time { margin-left: auto; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.message-summary { color: var(--muted); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-list li.unread .message-summary { color: var(--text); }
.badge.new { border-color: var(--danger); color: var(--danger); font-weight: 600; }
@media (max-width: 575.98px) {
  .site-summary .button { margin-left: 0; }
  .card { padding: 1.1rem; }
  .message-list { margin: 0 -1.1rem; }
  .message-list a { padding: .7rem 1.1rem; }
}

/* SEO */
.seo-score { font-weight: 600; }
.seo-score.fix { color: var(--danger); }
.seo-score.ok { color: var(--ok); }
.seo-issues { list-style: none; padding: 0; margin: .75rem 0 0; display: grid; gap: .35rem; font-size: .92rem; }
.seo-issues li { display: flex; align-items: flex-start; gap: .5rem; }
.seo-issues li svg.i { margin-top: .2em; }
.seo-issues li.fix svg.i { color: var(--danger); }
.seo-issues li.check svg.i { color: var(--warn); }
.seo-pages { display: grid; gap: 1rem; }
.seo-pages .card + .card { margin-top: 0; }
.seo-page > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .75rem; margin-bottom: .75rem; }
.seo-page h3 { margin: 0; font-size: 1.1rem; }
.seo-page fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.serp { display: grid; gap: .1rem; max-width: 600px; padding: .85rem 1rem; margin-bottom: 1rem; border: 1px solid var(--line);
  border-radius: 8px; background: #ffffff; font-family: Arial, sans-serif; }
.serp-site { font-size: 14px; color: #202124; }
.serp-url { font-size: 12px; color: #4d5156; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-title { font-size: 20px; line-height: 1.3; color: #1a0dab; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
[data-counter].over { color: var(--danger); font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
form.card > fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* page editor beside a live preview (wide screens) */
.editor-preview { display: none; }
.editor-preview-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.editor-preview-bar .devices { flex: 1; }
.editor-preview-bar button, .editor-preview-bar .button { padding: .35rem .7rem; font-size: .9rem; }
@media (min-width: 1200px) {
  main.wide { max-width: none; }
  .editor-split { display: grid; grid-template-columns: minmax(26rem, 5fr) minmax(0, 6fr); gap: 1.5rem; align-items: start; }
  .editor-preview { display: flex; flex-direction: column; gap: .5rem; position: sticky; top: 1rem; height: calc(100vh - 2rem); }
  .editor-preview .preview-stage { flex: 1; min-height: 0; padding: 0; overflow: hidden; background: var(--surface-2); }
  .editor-preview .preview-stage iframe { height: 100%; border: 0; border-radius: 0; margin: 0; transform-origin: 0 0; }
  .editor-preview .hint { margin: 0; }
}
.block-body > .inline { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.block-body > .inline form { margin: 0; }

/* my account */
.account-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.account-grid .card + .card { margin-top: 0; }
.account-grid .inline { display: flex; flex-wrap: wrap; gap: .5rem; }

/* menus module */
.menu-row { display: flex; align-items: center; gap: .75rem; }
.menu-row .block-title a { color: var(--text); text-decoration: none; }
.menu-details > summary { cursor: pointer; }
.menu-details[open] > summary { margin-bottom: 1rem; }
.menu-details > form + form { margin-top: 1rem; }
.menu-sections { gap: 1rem; }
.menu-section-head { display: flex; align-items: center; gap: .75rem; }
.menu-section-head h3 { margin: 0; font-size: 1.15rem; flex: 1; }
.section-settings { margin: .5rem 0 0; }
.section-settings > summary { cursor: pointer; color: var(--link); text-decoration: underline; width: fit-content; font-size: .9rem; }
.section-settings[open] > summary { margin-bottom: .75rem; }
.section-settings form + form { margin-top: .75rem; }
.dish-list { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .5rem; }
.dish > summary { padding: .6rem .85rem; }
.dish-price { margin-left: auto; font-weight: 600; white-space: nowrap; }
.dish .block-body fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.dish fieldset.variants legend, .dish fieldset.inline legend { font-weight: 600; font-size: .9rem; padding: 0; margin-bottom: .35rem; }
.add-dish { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
form.inline label { font-weight: 600; }
/* rows of fields side by side (a <div> or <fieldset> with class "inline") */
div.inline, fieldset.inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .5rem 1rem; }
fieldset.inline { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.inline > legend { padding: 0; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; }
div.inline > label:not(.check), fieldset.inline > label:not(.check) { flex: 1 1 10rem; }
div.inline > label input[size], fieldset.inline > label input[size] { max-width: 8rem; }

/* quotes and estimates */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin: 0 0 1.25rem; }
.tabs a { padding: .5rem 1rem; color: var(--muted); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
th.num, td.num { text-align: right; white-space: nowrap; }
.badge.estimate-sent { border-color: var(--link); color: var(--link); }
.badge.estimate-accepted { border-color: var(--ok); color: var(--ok); font-weight: 600; }
.badge.estimate-declined, .badge.estimate-withdrawn { border-color: var(--danger); color: var(--danger); }
.estimate-state { display: grid; gap: .75rem; }
.estimate-state p { margin: 0; }
.estimate-signature { max-width: 320px; max-height: 120px; background: #ffffff; border: 1px solid var(--line); border-radius: 6px; }
.estimate-form fieldset.card { margin: 0; }
.estimate-form legend { font-weight: 700; padding: 0 .25rem; }
.line-head, .line-row { display: grid; grid-template-columns: minmax(12rem, 1fr) 5.5rem 5.5rem 7rem 3.5rem 7rem; gap: .5rem; align-items: start; }
.line-head { font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.line-row { padding: .5rem 0; border-top: 1px solid var(--line); }
.line-row input[type="text"] { width: 100%; }
.line-description { display: grid; gap: .3rem; }
.line-description textarea { font-size: .9rem; resize: vertical; }
.line-amount { text-align: right; font-weight: 600; padding-top: .55rem; }
.line-remove { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); }
.estimate-totals { display: grid; grid-template-columns: auto 8rem; justify-content: end; gap: .25rem 1rem; margin: .5rem 0 0; }
.estimate-totals dd { margin: 0; text-align: right; }
.accepted-for-customer > summary { cursor: pointer; color: var(--link); width: fit-content; }
.accepted-for-customer[open] > summary { margin-bottom: .75rem; }
@media (max-width: 760px) {
  .line-head { display: none; }
  .line-row { grid-template-columns: 1fr 1fr; }
  .line-description { grid-column: 1 / -1; }
}

/* appointments */
.calendar-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1rem; }
.calendar-bar .button { padding: .35rem .75rem; font-size: .9rem; }
.calendar-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; }
.calendar-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; min-height: 9rem; display: flex; flex-direction: column; }
.calendar-day.is-today { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.calendar-day h2 { margin: 0 0 .5rem; font-size: .95rem; }
.calendar-day h2 span { color: var(--muted); font-weight: 400; }
.calendar-items { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.calendar-items a { display: grid; gap: .05rem; padding: .4rem .5rem; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 4px; color: var(--text); text-decoration: none; font-size: .85rem; }
.calendar-items a:hover { background: var(--bg); }
.calendar-items .booking-cancelled a { border-left-color: var(--line-strong); opacity: .6; text-decoration: line-through; }
.calendar-items .booking-no_show a { border-left-color: var(--danger); }
.calendar-time { font-weight: 600; }
.calendar-empty { font-size: .85rem; margin: 0; }
.calendar-add { margin-top: auto; padding-top: .5rem; font-size: .85rem; }
.open-times { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.open-times a { padding: .25rem .6rem; border: 1px solid var(--accent); border-radius: 999px; text-decoration: none; color: var(--text); font-size: .9rem; }
.open-times a[aria-current] { background: var(--accent); color: var(--accent-text); }
.badge.booking-confirmed { border-color: var(--ok); color: var(--ok); }
.badge.booking-cancelled, .badge.booking-no_show { border-color: var(--danger); color: var(--danger); }
.cancel-booking { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
input[type="datetime-local"] { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--field-line); border-radius: 6px; padding: .5rem .6rem; }
@media (max-width: 991.98px) { .calendar-week { grid-template-columns: 1fr; } .calendar-day { min-height: 0; } }

/* analytics */
.stats-chart { width: 100%; height: auto; display: block; margin: .5rem 0 1rem; }
.stats-chart rect { fill: var(--accent); }
.stats-chart rect:hover { fill: var(--accent-hover); }
.stats-chart .axis { stroke: var(--line-strong); stroke-width: 1; }
.stats-bars li { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; margin-bottom: .6rem; }
.stats-bars meter { grid-column: 1 / -1; width: 100%; height: .5rem; }
.tile-label .up { color: var(--ok); font-weight: 600; }
.tile-label .down { color: var(--danger); font-weight: 600; }
