/* Basyt: plain, calm, mobile first. One accent colour (plus WhatsApp green on its own
   button), no shadows or gradients. */
:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #222222;
  --muted: #6b6b6b;
  --line: #e4e2dd;
  --accent: #3d6b8e;
  --accent-text: #ffffff;
  --accent-soft: #eef3f7;
  --danger: #a33a3a;
  --ok: #3d7a57;
  --warn: #9a6a1c;
  --warn-soft: #fbf3e4;
  --danger-soft: #fbeeee;
  --wa: #2f7a4f;
  --wa-soft: #e8f3ec;
  --radius: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181a; --surface: #1e2124; --text: #e6e6e3; --muted: #9a9a96; --line: #2c3034;
    --accent: #7fa6c4; --accent-text: #10161b; --accent-soft: #1f2a33; --danger: #e08a8a; --ok: #8cc4a3; --warn: #e0b46a; --warn-soft: #2e2618; --danger-soft: #2e1c1c;
    --wa: #8cc9a2; --wa-soft: #1c2a22;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16181a; --surface: #1e2124; --text: #e6e6e3; --muted: #9a9a96; --line: #2c3034;
  --accent: #7fa6c4; --accent-text: #10161b; --accent-soft: #1f2a33; --danger: #e08a8a; --ok: #8cc4a3; --warn: #e0b46a; --warn-soft: #2e2618; --danger-soft: #2e1c1c;
    --wa: #8cc9a2; --wa-soft: #1c2a22;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  overflow-wrap: anywhere;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 var(--s3); line-height: 1.35; font-weight: 600; }
h1 { font-size: 20px; }
h2, h3 { font-size: 17px; }
p { margin: 0 0 var(--s3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.i-sm { width: 16px; height: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: var(--s2); top: var(--s2); background: var(--surface); padding: var(--s2); z-index: 10; }

/* Layout */
.wrap { padding-inline: var(--s4); margin-inline: auto; max-width: 720px; }
main { padding-block: var(--s4) 96px; min-height: 60vh; }
.section { margin-block-end: var(--s5); }

/* Header: logo, the few links people need most, and the menu button */
.top { background: var(--surface); border-block-end: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
.top-bar { display: flex; align-items: center; gap: var(--s2); min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 700; font-size: 19px; color: var(--text); margin-inline-end: auto; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo:hover { text-decoration: none; }
.top-links { display: flex; align-items: center; gap: var(--s1); }
.top-link { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); min-width: 44px; min-height: 44px; padding-inline: var(--s2); color: var(--text); font: inherit; font-size: 15px; background: none; border: 0; border-radius: var(--radius); cursor: pointer; }
.top-link:hover { text-decoration: none; background: var(--accent-soft); }
.top-link .i { width: 22px; height: 22px; }

/* Menu sheet (a modal <dialog>): slides in from the side the menu button is on */
.sheet { position: fixed; inset-block: 0; inset-inline-end: 0; inset-inline-start: auto; margin: 0; width: min(88vw, 380px); max-width: none; height: 100%; max-height: none; padding: 0; border: 0; border-inline-start: 1px solid var(--line); background: var(--bg); color: var(--text); overflow-y: auto; overscroll-behavior: contain; }
.sheet::backdrop { background: rgb(0 0 0 / 0.4); }
html:has(.sheet[open]) { overflow: hidden; }
.sheet-inner { display: grid; gap: var(--s4); padding: var(--s3) var(--s4) var(--s5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.sheet-section { border-block-start: 1px solid var(--line); padding-block-start: var(--s4); }
.sheet-title { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 var(--s2); }
.sheet-list { margin: 0; padding: 0; list-style: none; }
.sheet-list a, .sheet-list button { display: flex; align-items: center; gap: var(--s3); width: 100%; min-height: 44px; padding: 0 var(--s2); color: var(--text); background: none; border: 0; border-radius: var(--radius); font: inherit; text-align: start; cursor: pointer; }
.sheet-list a:hover, .sheet-list button:hover { background: var(--accent-soft); text-decoration: none; }
.sheet-list .i { color: var(--muted); }
.sheet-list form { margin: 0; }
.sheet-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s2); }
.sheet-cats a { font-size: 14px; gap: var(--s2); line-height: 1.3; }
.sheet-more { display: inline-block; margin-block-start: var(--s2); font-size: 14px; }
.sheet-foot { display: flex; gap: var(--s4); font-size: 14px; }
.sheet-foot a { color: var(--muted); }
.chip.chip-specialty { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.specialty-chips { margin-block-end: var(--s3); }
.chip-empty { color: var(--muted); }
.serves { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); margin: 0 0 var(--s4); padding: var(--s2) var(--s3); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); }
.serves .i { color: var(--accent); width: 18px; height: 18px; }
.chips.service-chips { margin: var(--s4) 0 0; padding-block-start: var(--s4); border-block-start: 1px solid var(--line); }
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); margin-block-end: var(--s5); }
.hero-greeting { font-size: 20px; margin: 0; }
.hero-time { margin: var(--s1) 0 var(--s3); font-size: 13px; color: var(--muted); }
.hero-time span { font-variant-numeric: tabular-nums; }
.hero-sub { margin: var(--s4) 0 var(--s2); font-size: 13px; color: var(--muted); }
.hero-chips { margin: 0; }
.chip-on { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Buttons: primary and secondary only */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { border-color: var(--accent); filter: brightness(0.94); }
.btn-block { display: flex; width: 100%; }
/* Secondary actions: tinted, no border, so they read apart from the main button. */
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn-soft:hover { border-color: var(--accent); }
.btn-wa { background: var(--wa-soft); border-color: transparent; color: var(--wa); }
.btn-wa:hover { border-color: var(--wa); }
/* Minor actions (share, copy): small and quiet. */
.btn-quiet { min-height: 40px; padding: 0 var(--s3); background: transparent; color: var(--muted); font-size: 15px; }
.btn-quiet:hover { color: var(--text); }
.btn-quiet .i { width: 18px; height: 18px; }
.btn-danger { color: var(--danger); }
.btn[disabled], .btn.htmx-request { opacity: 0.6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }

/* Forms */
.field { margin-block-end: var(--s4); }
.field > label:not(.btn):not(.check), .label { display: block; font-weight: 500; margin-block-end: var(--s1); }
.help { display: block; color: var(--muted); font-size: 14px; margin-block-start: var(--s1); }
.error { display: block; color: var(--danger); font-size: 14px; margin-block-start: var(--s1); }
input[type=text], input[type=tel], input[type=email], input[type=search], input[type=number], select, textarea {
  display: block; width: 100%; min-height: 44px; padding: var(--s2) var(--s3);
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 2px solid var(--accent-soft); outline-offset: 0; }
.check { display: flex; align-items: center; gap: var(--s2); min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: var(--s1) var(--s3); }
.checks .check-all { grid-column: 1 / -1; border-block-end: 1px solid var(--line); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.row2:has(> [hidden]) { grid-template-columns: 1fr; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s4); margin-block-end: var(--s4); }
.note { background: var(--accent-soft); border-radius: var(--radius); padding: var(--s3); margin-block-end: var(--s4); font-size: 15px; }
.note-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.note-ok { background: transparent; border: 1px solid var(--ok); color: var(--ok); }

/* Search */
.search { display: flex; gap: var(--s2); }
.search input { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s3); padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: var(--s1); min-height: 32px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; color: var(--text); }
a.chip:hover { text-decoration: none; border-color: var(--muted); }

/* Categories */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin: 0; padding: 0; list-style: none; }
.cats a { display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: var(--s2) var(--s3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-size: 15px; line-height: 1.3; }
.cats a:hover { text-decoration: none; border-color: var(--accent); }
.cats .i { color: var(--muted); }

/* Service rows */
.rows { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rows > li + li { border-block-start: 1px solid var(--line); }
.row { display: flex; gap: var(--s3); padding: var(--s3); color: var(--text); }
.row:hover { text-decoration: none; background: var(--accent-soft); }
.thumb { width: 72px; height: 72px; flex: none; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb .i { width: 28px; height: 28px; }
.row-body { min-width: 0; flex: 1; }
.row-title { font-weight: 500; line-height: 1.4; margin-block-end: 2px; }
.row-price { color: var(--accent); font-size: 15px; }
.row-meta { color: var(--muted); font-size: 14px; }
.more { list-style: none; padding: var(--s3); }
.empty { padding: var(--s5) var(--s4); text-align: center; color: var(--muted); }

/* Service page */
.gallery { display: flex; gap: var(--s2); overflow-x: auto; scroll-snap-type: x mandatory; margin-block-end: var(--s4); padding-block-end: var(--s1); }
.gallery img { scroll-snap-align: start; flex: none; width: 85%; height: auto; max-width: 520px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.gallery img:only-child { width: 100%; }
.price-lg { font-size: 18px; font-weight: 600; color: var(--accent); margin-block-end: var(--s3); }
.desc { white-space: pre-line; }
.dl { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s4); margin: 0 0 var(--s4); }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.contact { display: grid; gap: var(--s2); }
.provider-label { font-size: 14px; font-weight: 500; color: var(--muted); margin: 0 0 var(--s1); }
.provider-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s3); font-size: 17px; }
.contact-actions { display: grid; gap: var(--s2); }
.contact-actions > *, .contact-phone > * { margin: 0; }
.contact-phone { display: contents; }
.share-row { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s2); }
.status { display: inline-block; font-size: 13px; padding: 0 var(--s2); border-radius: var(--radius); border: 1px solid var(--line); color: var(--muted); }
.status-active { color: var(--ok); border-color: var(--ok); }
.status-rejected, .status-removed { color: var(--danger); border-color: var(--danger); }

/* Post form images */
.uploads { display: flex; flex-wrap: wrap; gap: var(--s2); margin: 0 0 var(--s2); padding: 0; list-style: none; }
.uploads li { position: relative; }
.uploads img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); cursor: pointer; }
.uploads li:first-child img { border: 2px solid var(--accent); }
.uploads .remove { position: absolute; top: 2px; inset-inline-end: 2px; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; padding: 0; }
.uploads .loading { width: 80px; height: 80px; border: 1px dashed var(--line); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
.file-pick { position: relative; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }

/* Bottom action bar (mobile) */
.bottom { position: fixed; inset-inline: 0; bottom: 0; z-index: 4; background: var(--surface); border-block-start: 1px solid var(--line); padding: var(--s2) var(--s4) calc(var(--s2) + env(safe-area-inset-bottom)); }
.bottom .btn { width: 100%; }

/* Footer */
footer { border-block-start: 1px solid var(--line); padding-block: var(--s4) 96px; color: var(--muted); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); margin-block-end: var(--s2); }
footer a { color: var(--muted); }
.footer-version { margin-block-start: var(--s2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: end; }

/* Toast */
#toast { position: fixed; z-index: 20; inset-inline: var(--s4); top: var(--s3); display: flex; justify-content: center; pointer-events: none; }
.toast { pointer-events: auto; max-width: 520px; padding: var(--s3) var(--s4); border-radius: var(--radius); background: var(--text); color: var(--bg); animation: toast 5s forwards; }
.toast-error { background: var(--danger); color: #fff; }
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* Flags */
.flag { width: 20px; height: 15px; flex: none; border-radius: 2px; object-fit: cover; outline: 1px solid rgb(0 0 0 / 0.08); outline-offset: -1px; }
.chip, .dd-panel a { display: inline-flex; align-items: center; gap: var(--s2); }

/* Custom select: button + listbox; dropdown on wide screens, bottom sheet on phones */
.cs { position: relative; }
.cs-native { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.cs-button { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 44px; padding: var(--s2) var(--s3); font: inherit; font-size: 16px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-align: start; cursor: pointer; }
.cs-button:hover { border-color: var(--muted); }
.cs-button[aria-expanded="true"] { border-color: var(--accent); outline: 2px solid var(--accent-soft); }
.cs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-placeholder { color: var(--muted); }
.cs-chevron { width: 18px; height: 18px; color: var(--muted); }
.cs-button .i:not(.cs-chevron) { color: var(--muted); }
.cs-list { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto; overscroll-behavior: contain; margin: 0; padding: var(--s1) 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cs-list:focus { outline: none; }
.cs-list.cs-up { top: auto; bottom: calc(100% + 4px); }
.cs-list [role="option"] { display: flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s3); cursor: pointer; }
.cs-list [role="option"] .i { color: var(--muted); }
.cs-list [role="option"]:hover, .cs-list .cs-active { background: var(--accent-soft); }
.cs-list [aria-selected="true"] { color: var(--accent); font-weight: 600; }
.cs-list [aria-selected="true"]::after { content: ""; margin-inline-start: auto; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.cs-list [aria-disabled="true"] { opacity: 0.5; cursor: default; }
.cs-head { display: none; }
.cs-backdrop { display: none; }
@media (max-width: 719px) {
  .cs-list { position: fixed; z-index: 41; inset-inline: 0; top: auto; bottom: 0; max-height: 72vh; border-radius: var(--radius) var(--radius) 0 0; border-block-end: 0; padding: 0 0 calc(var(--s3) + env(safe-area-inset-bottom)); }
  .cs-head { display: block; position: sticky; top: 0; z-index: 1; padding: var(--s3) var(--s4); font-weight: 600; background: var(--surface); border-block-end: 1px solid var(--line); }
  .cs-list [role="option"] { min-height: 52px; padding: 0 var(--s4); font-size: 16px; }
  .cs-backdrop { display: block; position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / 0.4); }
  .cs-backdrop[hidden] { display: none; }
  html.cs-locked { overflow: hidden; }
}

/* Legal pages: readable measure, numbered sections, collapsible contents */
.legal { max-width: 680px; }
.legal p, .legal li { line-height: 1.85; }
.legal-updated { color: var(--muted); font-size: 14px; }
.legal-toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-block: var(--s4) var(--s2); }
.legal-toc > summary { min-height: 44px; display: flex; align-items: center; padding: 0 var(--s4); font-weight: 600; cursor: pointer; list-style: none; }
.legal-toc > summary::-webkit-details-marker { display: none; }
.legal-toc > summary::after { content: ""; margin-inline-start: auto; width: 7px; height: 7px; border-inline-end: 2px solid var(--muted); border-block-end: 2px solid var(--muted); transform: rotate(45deg); }
.legal-toc[open] > summary::after { transform: rotate(225deg); }
.legal-toc ol { margin: 0; padding: 0 var(--s5) var(--s4); padding-inline-start: calc(var(--s5) + var(--s4)); display: grid; gap: var(--s1); }
.legal-toc a { display: inline-block; padding-block: 2px; }
.legal-section { border-block-start: 1px solid var(--line); padding-block: var(--s4) var(--s2); scroll-margin-top: 72px; }
.legal-section h2 { margin-block-end: var(--s3); }
.legal-num { color: var(--muted); font-weight: 500; }
.legal-lead { font-weight: 600; margin-block-end: var(--s2); }
.legal-section ul { margin: 0 0 var(--s3); padding-inline-start: var(--s5); display: grid; gap: var(--s2); }
.legal-section li::marker { color: var(--muted); }
.legal-foot { border-block-start: 1px solid var(--line); padding-block-start: var(--s4); color: var(--muted); font-size: 14px; }

/* Prohibited list: cards with an icon; red tint for banned, accent tint for licence-only */
.rules-page { max-width: 720px; }
.rules-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin: 0 0 var(--s3); padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.rules-legend li { display: inline-flex; align-items: center; gap: var(--s2); }
.legend-dot { width: 12px; height: 12px; border-radius: 3px; }
.legend-ban { background: var(--danger); }
.legend-licensed { background: var(--accent); }
.legend-notyet { background: var(--muted); }
.rules-notyet .rule { border-inline-start-color: var(--muted); }
.rules-notyet .rule-icon { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }
.cat-rules { display: grid; gap: var(--s2); }
.cat-rule { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 72px; }
.cat-rule > summary { display: flex; align-items: center; gap: var(--s2); min-height: 48px; padding: 0 var(--s3); cursor: pointer; list-style: none; font-weight: 500; }
.cat-rule > summary::-webkit-details-marker { display: none; }
.cat-rule > summary .i { color: var(--muted); }
.cat-rule > summary .rules-count { margin-inline-start: auto; }
.cat-rule[open] > summary { border-block-end: 1px solid var(--line); }
.cat-rule ul { list-style: none; margin: 0; padding: var(--s2) var(--s3); display: grid; gap: var(--s2); }
.cat-rule li { display: flex; align-items: center; gap: var(--s2); }
.cat-rule li .legend-dot { flex: none; }
.cat-rule > p { margin: 0; padding: 0 var(--s3) var(--s3); }
@media (min-width: 720px) { .cat-rules { grid-template-columns: 1fr 1fr; align-items: start; } }
.rules-jump { margin-block: var(--s3) var(--s4); }
.rules-group { border-block-start: 1px solid var(--line); padding-block: var(--s4) var(--s2); scroll-margin-top: 72px; }
.rules-group h2 { display: flex; align-items: center; gap: var(--s2); margin-block-end: var(--s1); }
.rules-count { font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 var(--s2); }
.rules { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin: var(--s3) 0 0; padding: 0; list-style: none; }
.rule { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3); background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--danger); border-radius: var(--radius); scroll-margin-top: 72px; }
.rule h3 { font-size: 16px; margin: 0 0 2px; }
.rule p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.rule-icon { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius); color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.rule-icon .i { width: 22px; height: 22px; }
.rules-licensed .rule { border-inline-start-color: var(--accent); }
.rules-licensed .rule-icon { color: var(--accent); background: var(--accent-soft); }
.steps { margin: var(--s3) 0; padding-inline-start: var(--s5); display: grid; gap: var(--s2); line-height: 1.8; }
.rules-link { display: inline-flex; align-items: center; gap: var(--s1); margin-block-start: var(--s2); color: var(--accent); }
.rules-link .i { width: 16px; height: 16px; }
@media (min-width: 720px) { .rules { grid-template-columns: 1fr 1fr; } }

.email-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-block-end: var(--s3); }
.email-value { font-weight: 600; overflow-wrap: anywhere; }
.verify-result { text-align: center; padding-block: var(--s5); }

/* Reports: a red link on service pages, and the admin queue */
.report-box { margin-block: var(--s2) var(--s4); }
.report-link { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s2); background: none; border: 0; color: var(--danger); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.report-link:hover { text-decoration-thickness: 2px; }
.report-link .i { width: 18px; height: 18px; }
.report-form { background: var(--surface); border: 1px solid var(--danger); border-radius: var(--radius); padding: var(--s4); }
.report-form fieldset, .reject-box fieldset { border: 0; margin: 0 0 var(--s3); padding: 0; }
.report-form legend { font-weight: 600; margin-block-end: var(--s2); }
.report-form .check { min-height: 40px; }
.report-form .check input { accent-color: var(--danger); }
.btn-report { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-report:hover { border-color: var(--danger); filter: brightness(0.94); }
.admin-reports { margin: var(--s3) 0 0; padding: 0; list-style: none; display: grid; gap: var(--s3); }
.admin-report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3) var(--s4); }
.admin-report-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-block-end: var(--s2); }
.admin-report-title { display: block; font-weight: 600; margin-block-end: var(--s1); }
/* Dashboard: section tabs, queue cards, user stats. */
.admin-nav { display: flex; flex-wrap: wrap; gap: var(--s2); padding-block-end: var(--s3); margin-block-end: var(--s3); border-block-end: 1px solid var(--line); }
.admin-tabs { margin-block-end: var(--s3); }
.admin-search { margin-block-end: var(--s4); }
.queue-main { display: flex; gap: var(--s3); align-items: flex-start; }
.queue-main > div { min-width: 0; }
.queue-main p { margin: 0 0 var(--s1); }
.reject-box > summary { list-style: none; }
.reject-box > summary::-webkit-details-marker { display: none; }
.reject-box[open] { flex-basis: 100%; }
.reject-box form { margin: var(--s2) 0 0; }
.admin-stats { list-style: none; margin: var(--s2) 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); font-size: 14px; color: var(--muted); }
.stat-warn, .stat-warn a { color: var(--danger); }
.admin-settings fieldset { border: 0; padding: 0; margin: 0 0 var(--s5); }
.admin-settings legend { font-weight: 600; font-size: 17px; margin-block-end: var(--s3); }
.me-reason { margin: 0 0 var(--s2); font-size: 14px; }
.check-home { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s2); padding-block-end: var(--s2); border-block-end: 1px solid var(--line); }
.check-home .check { font-weight: 600; }
.check-home input { opacity: 0.7; }
.locked-field { display: flex; align-items: center; gap: var(--s2); min-height: 44px; margin: 0; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--text); }
.locked-field .i { margin-inline-start: auto; width: 18px; height: 18px; color: var(--muted); }
fieldset.field { border: 0; padding: 0; margin-inline: 0; }
fieldset.field > legend { padding: 0; }
.required { color: var(--danger); }
.ai-note { display: flex; gap: var(--s2); align-items: flex-start; margin: var(--s2) 0 0; }
.ai-note .i { flex: none; margin-block-start: 3px; width: 18px; height: 18px; }
.admin-nav .badge { margin-inline-start: var(--s1); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin: var(--s4) 0; }
.admin-filters { display: grid; gap: var(--s2); margin-block-end: var(--s3); }
.admin-filters .btn { justify-self: start; }
.stat-grid { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s2); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); display: grid; gap: var(--s1); }
.stat-num { font-size: 26px; font-weight: 600; line-height: 1.2; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th, .admin-table td { text-align: start; padding: var(--s2); border-block-end: 1px solid var(--line); }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 14px; }
.activity p { margin: 0 0 var(--s1); }
.profile-name { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.kv-grid { list-style: none; margin: 0 0 var(--s2); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--s2); }
.kv-grid li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); font-size: 14px; }
.kv-grid strong { font-size: 17px; }
.profile-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; gap: var(--s2); }
.profile-list > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); display: grid; gap: var(--s1); }
.profile-list .admin-note { margin: 0; }
.inline-list { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s2); }
.ua { font-size: 12px; overflow-wrap: anywhere; text-align: start; }
dd .ua { display: block; margin-block-start: var(--s1); }
.admin-note { background: var(--bg); border-radius: var(--radius); padding: var(--s2) var(--s3); white-space: pre-line; font-size: 15px; }

/* Messages */
.inbox-link, .account-link { position: relative; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; line-height: 1; }
.inbox-link .badge, .account-link .badge { position: absolute; top: 4px; inset-inline-end: 2px; min-width: 18px; height: 18px; font-size: 11px; }
.inbox-side { display: flex; flex-direction: column; align-items: flex-end; gap: var(--s1); flex: none; }
.inbox-snippet { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-unread { color: var(--text); font-weight: 600; }
.thread-head { display: flex; align-items: center; gap: var(--s2); padding-block-end: var(--s2); border-block-end: 1px solid var(--line); }
.thread-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.thread-who a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="ltr"] .back .i { transform: scaleX(-1); }
.thread-safety { display: flex; align-items: center; gap: var(--s1); margin-block: var(--s2); }
.thread-safety .i { width: 16px; height: 16px; }
.thread { list-style: none; margin: 0 0 var(--s3); padding: 0; display: flex; flex-direction: column; gap: var(--s2); min-height: 30vh; }
.bubble { max-width: 85%; align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s2) var(--s3); }
.bubble-mine { align-self: flex-end; background: var(--accent-soft); border-color: transparent; }
.bubble-body { margin: 0; white-space: pre-line; }
.bubble-tr { margin: var(--s2) 0 0; padding-block-start: var(--s2); border-block-start: 1px dashed var(--line); white-space: pre-line; font-size: 15px; }
.bubble-warn { display: flex; gap: var(--s1); align-items: flex-start; margin: var(--s2) 0 0; color: var(--danger); font-size: 14px; }
.bubble-warn .i { width: 16px; height: 16px; flex: none; margin-block-start: 3px; }
.bubble-meta { display: flex; gap: var(--s3); align-items: center; margin-block-start: var(--s1); color: var(--muted); font-size: 12px; }
.bubble-meta .linklike { font-size: 13px; }
.composer { position: sticky; bottom: 0; display: flex; gap: var(--s2); align-items: flex-end; padding-block: var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); background: var(--bg); border-block-start: 1px solid var(--line); }
.composer textarea { min-height: 44px; max-height: 160px; resize: none; }
.composer-send { flex: none; width: 48px; padding: 0; }
[dir="rtl"] .composer-send .i { transform: scaleX(-1); }
/* A conversation fills the screen: messages grow, the composer stays at the bottom. */
.app-screen { display: flex; flex-direction: column; min-height: calc(100dvh - 57px); padding-block-end: 0; }
.app-screen .thread { flex: 1; min-height: 0; }
.contact-chat { margin-block-end: var(--s2); }

/* Comments */
.comments-h { display: flex; align-items: center; gap: var(--s2); }
.comments-h .i { color: var(--accent); }
.comments-list { list-style: none; margin: 0 0 var(--s3); padding: 0; display: grid; gap: var(--s3); }
.comment { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s3); }
.comment-hidden { opacity: 0.6; border-style: dashed; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-block-end: var(--s1); }
.comment-body { margin: 0; white-space: pre-line; }
.comment-tr { margin: var(--s2) 0 0; padding-block-start: var(--s2); border-block-start: 1px dashed var(--line); white-space: pre-line; font-size: 15px; }
.comment-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-block-start: var(--s2); font-size: 14px; }
.comment-actions .linklike { min-height: 32px; font-size: 14px; }
.comment-report { color: var(--danger); }
.replies { list-style: none; margin: var(--s2) 0 0; padding-inline-start: var(--s4); border-inline-start: 2px solid var(--accent-soft); display: grid; gap: var(--s2); }
.replies:empty { display: none; }
.comment-form { display: grid; gap: var(--s2); }
/* A one-line box until the user starts; then it grows and shows the rules and send. */
.comment-form textarea { min-height: 48px; }
.comment-form :is(.comment-rules, button[type=submit]) { display: none; }
.comment-form:focus-within textarea, .comment-form:has(textarea:not(:placeholder-shown)) textarea { min-height: 104px; }
.comment-form:focus-within :is(.comment-rules, button[type=submit]),
.comment-form:has(textarea:not(:placeholder-shown)) :is(.comment-rules, button[type=submit]) { display: flex; }
.comment-form button[type=submit] { justify-self: start; min-width: 120px; }
.comment-form .note { margin: 0; }
.comment-rules { display: flex; gap: var(--s1); align-items: flex-start; margin: 0; }
.comment-rules .i { flex: none; margin-block-start: 2px; }
.comment-done { margin: 0; }
.uid { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; color: var(--muted); letter-spacing: 0.02em; }
.reply-form { margin: var(--s2) 0 0; padding-inline-start: var(--s4); }
.admin-transcript { list-style: none; margin: var(--s2) 0; padding: 0; display: grid; gap: var(--s2); max-height: 360px; overflow-y: auto; }
.admin-transcript li { background: var(--bg); border-radius: var(--radius); padding: var(--s2) var(--s3); }
.admin-transcript .line-provider { background: var(--accent-soft); }
.admin-transcript p { margin: 0; white-space: pre-line; }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline; }
.htmx-request .idle-label { display: none; }

@media (min-width: 720px) {
  .cats { grid-template-columns: 1fr 1fr 1fr; }
  .bottom { display: none; }
  main, footer { padding-block-end: var(--s5); }
  .gallery img { width: 60%; }
}
/* Phone vs. wide-screen header */
.desk-only { display: none; }
@media (min-width: 720px) {
  .desk-only { display: flex; }
  .mobile-only { display: none; }
}
.btn-sm { min-height: 38px; padding: 0 var(--s3); font-size: 15px; margin-inline-start: var(--s2); }
.btn-sm .i { width: 18px; height: 18px; }

/* Desktop dropdowns (<details>); app.js closes them on outside click and Escape */
.dd { position: relative; }
.dd > summary { list-style: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd[open] > summary { background: var(--accent-soft); }
.dd-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 4px); z-index: 10; min-width: 210px; margin: 0; padding: var(--s1) 0; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.dd-panel a, .dd-panel button { display: flex; align-items: center; gap: var(--s2); width: 100%; min-height: 40px; padding: 0 var(--s4); color: var(--text); background: none; border: 0; font: inherit; font-size: 15px; text-align: start; cursor: pointer; }
.dd-panel a:hover, .dd-panel button:hover { background: var(--accent-soft); text-decoration: none; }
.dd-panel a[aria-current] { color: var(--accent); font-weight: 600; }
.dd-panel .i { color: var(--muted); }
.dd-panel form { margin: 0; }
.row-body > span { display: block; }
.me-list > li { padding-block-end: var(--s3); }
.me-actions { padding-inline: var(--s3); }
.me-actions .btn { min-height: 40px; font-size: 14px; padding: 0 var(--s3); }
.search .cs { flex: 1; }

/* Services ending or ended: a bar under the header, a badge on the account link and
   highlights in My services */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Ending soon: amber. Ended or about to be removed: soft red. */
.notice-bar { background: var(--warn-soft); border-block-end: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); font-size: 15px; }
.notice-bar.notice-urgent { background: var(--danger-soft); border-block-end-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice-inner { display: grid; grid-template-columns: auto 1fr auto auto; grid-template-areas: "icon text btn close"; align-items: center; gap: var(--s2) var(--s3); padding-block: var(--s2); }
.notice-inner > .i { grid-area: icon; color: var(--warn); }
.notice-urgent .notice-inner > .i { color: var(--danger); }
.notice-inner > span { grid-area: text; }
.notice-actions { grid-area: btn; display: flex; flex-wrap: wrap; gap: var(--s2); }
.notice-actions form { margin: 0; }
.notice-actions .btn { margin: 0; }
.notice-close { grid-area: close; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-inline-end: calc(-1 * var(--s3)); color: var(--muted); }
.notice-bar[hidden] { display: none; }
.sheet-list .badge { margin-inline-start: auto; }
.note-warn { background: var(--warn-soft); }
.note-alert { background: var(--danger-soft); }
.images-cheer { display: flex; align-items: flex-start; gap: var(--s2); margin: 0 0 var(--s2); color: var(--accent); font-weight: 600; font-size: 15px; }
.images-cheer .i { flex: none; width: 18px; height: 18px; margin-block-start: 3px; }
.phone-help { margin: var(--s1) 0 0; padding-inline-start: 30px; list-style: none; display: grid; gap: 2px; }
.phone-help strong { color: var(--text); font-weight: 600; }
.service-only { display: flex; gap: var(--s2); align-items: flex-start; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); }
.service-only > .i { flex: none; color: var(--warn); margin-block-start: 3px; }
.service-only p { margin: 0; }
.service-only-title { font-weight: 700; }
.service-only-example { font-size: 14px; color: var(--muted); margin-block-start: var(--s1) !important; }
.me-list > li.me-ending, .me-list > li.me-expired { border-inline-start: 3px solid var(--warn); padding-inline-start: var(--s3); }
.me-list > li.me-expired { border-inline-start-color: var(--danger); }
.status-expired { color: var(--danger); border-color: var(--danger); }
@media (max-width: 560px) {
  .notice-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "icon text close" ". btn ."; row-gap: 0; padding-block-end: var(--s3); }
  .notice-actions { justify-self: start; }
}
.renew-all { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s3); background: var(--warn-soft); }
.renew-all p { margin: 0; flex: 1 1 14em; }
