/* =========================================================================
   Admin dashboard — final layer, loaded after admin-editorial.css.
   Brings the dashboard onto the public site's design system: the same
   tokens (--mono-*, --accent), square geometry, Cairo / Tajawal for Arabic,
   DM Sans / Cormorant for English, JetBrains Mono for numbers and labels.
   Earlier layers use `!important` heavily, so rules here are scoped with
   `html:root body.admin-body` (out-ranks their dark-theme selectors) and use
   `!important` where they must win. Functional CSS and all JS are untouched.
   ========================================================================= */

html:root body.admin-body {
  --a-bg: var(--mono-dark);
  --a-panel: var(--mono-panel);
  --a-line: var(--mono-line);
  --a-ink: var(--mono-text);
  --a-muted: var(--mono-muted);
  --a-accent: var(--accent);
  --a-soft: color-mix(in srgb, var(--accent) 9%, transparent);
  --a-danger: #b5402f;
  --a-success: #3d7a50;
  /* the rail stays dark in both themes, like a camera body */
  --a-rail: #16140f;
  --a-rail-line: #2b2821;
  --a-rail-ink: #f2efe9;
  --a-rail-muted: #9a9387;
  --a-mono: "JetBrains Mono", ui-monospace, monospace;
  --a-ar: "Tajawal", "Cairo", sans-serif;
  --a-ar-display: "Cairo", "Tajawal", sans-serif;
  /* English faces fall back to the Arabic ones, so Arabic client names still render well in English mode */
  --a-en: "DM Sans", "Tajawal", Arial, sans-serif;
  --a-en-display: "Cormorant Garamond", "Cairo", Georgia, serif;
  --a-font: var(--a-ar);
  --a-display: var(--a-ar-display);

  /* feed the older layers' variables so anything not restyled below follows along */
  --admin-ink: var(--a-ink) !important;
  --admin-muted: var(--a-muted) !important;
  --admin-paper: var(--a-bg) !important;
  --admin-card: var(--a-panel) !important;
  --admin-line: var(--a-line) !important;
  --admin-gold: var(--a-accent) !important;
  --admin-clay: var(--a-ink) !important;

  background: var(--a-bg) !important;
  color: var(--a-ink) !important;
  font-family: var(--a-font) !important;
}
html[data-theme="dark"]:root body.admin-body { --a-danger: #e0705c; --a-success: #6fbf86; }
html[dir="ltr"]:root body.admin-body { --a-font: var(--a-en); --a-display: var(--a-en-display); }

html:root body.admin-body :is(input, select, textarea, button) { font-family: var(--a-font) !important; }
html:root body.admin-body :focus-visible { outline: 2px solid var(--a-accent) !important; outline-offset: 2px; }

/* ---------- Shell: rail on the reading side ---------- */
html[dir="rtl"]:root body.admin-body .admin-layout { flex-direction: row-reverse; }
html:root body.admin-body .admin-main { background: var(--a-bg) !important; padding: clamp(28px, 3.6vw, 56px) clamp(20px, 3.6vw, 60px) 90px !important; min-width: 0; }

/* ---------- Rail ---------- */
html:root body.admin-body .admin-sidebar {
  flex-basis: 264px !important; width: 264px !important; min-width: 264px !important;
  padding: 30px 20px 22px !important; gap: 24px !important;
  background: var(--a-rail) !important; color: var(--a-rail-ink) !important;
  border: 0 !important; border-inline-end: 1px solid var(--a-rail-line) !important; box-shadow: none !important;
}
html[dir="rtl"]:root body.admin-body .admin-sidebar { border-inline-end: 0 !important; border-left: 1px solid var(--a-rail-line) !important; }
html:root body.admin-body .admin-sidebar .brand {
  display: grid !important; justify-items: start; gap: 12px !important; min-height: 0;
  padding-bottom: 22px; border-bottom: 1px solid var(--a-rail-line);
  font: inherit !important; color: var(--a-rail-ink) !important;
}
html:root body.admin-body .admin-sidebar .brand { width: 100%; }
html[dir="rtl"]:root body.admin-body .admin-sidebar .brand { display: flex !important; flex-direction: column; align-items: flex-end; align-self: stretch; }
html[dir="rtl"]:root body.admin-body .admin-sidebar .brand > * { margin-left: auto !important; margin-right: 0 !important; }
@media (min-width: 769px) {
  html[dir="rtl"]:root body.admin-body .admin-sidebar > .admin-preferences { align-self: flex-end; }
}
html:root body.admin-body .admin-logo { display: block; width: 158px; height: auto; }
html:root body.admin-body .admin-brand-tag { display: block; color: var(--a-rail-muted); font: 500 10px/1 var(--a-mono); letter-spacing: .26em; text-transform: uppercase; }

html:root body.admin-body .admin-preferences { gap: 8px !important; }
html:root body.admin-body .admin-preferences button {
  min-height: 36px !important; padding: 0 14px !important; border-radius: 0 !important;
  border: 1px solid var(--a-rail-line) !important; background: transparent !important; box-shadow: none !important;
  color: var(--a-rail-ink) !important; font: 600 12px/1 var(--a-en) !important; letter-spacing: .1em; text-transform: uppercase;
  transition: border-color .25s ease, color .25s ease !important;
}
html:root body.admin-body .admin-preferences .admin-theme-toggle { width: 36px !important; padding: 0 !important; }
/* In English mode this button reads "العربية": no tracking, Arabic face */
html[dir="ltr"]:root body.admin-body .admin-language-toggle { font: 700 13px/1 var(--a-ar) !important; letter-spacing: 0 !important; }
html:root body.admin-body .admin-preferences button:hover { border-color: var(--a-accent) !important; color: var(--a-accent) !important; }

html:root body.admin-body .admin-sidebar nav { gap: 2px !important; counter-reset: rail; }
html:root body.admin-body .admin-sidebar nav a {
  counter-increment: rail; position: relative; display: flex !important; align-items: center; gap: 12px !important;
  min-height: 48px; padding: 0 14px !important; border-radius: 0 !important; border: 0 !important;
  background: transparent !important; box-shadow: none !important; transform: none !important;
  color: #c4bdb1 !important; font: 600 15px/1 var(--a-font) !important;
  transition: background-color .25s ease, color .25s ease !important;
}
html:root body.admin-body .admin-sidebar nav a i { width: 18px; color: var(--a-rail-muted) !important; font-size: 14px; transition: color .25s ease; }
html:root body.admin-body .admin-sidebar nav a::after {
  content: counter(rail, decimal-leading-zero); margin-inline-start: auto;
  color: #6c665c; font: 500 10px/1 var(--a-mono); letter-spacing: .08em; direction: ltr;
}
html:root body.admin-body .admin-sidebar nav a:hover { color: #fff !important; background: rgba(255, 255, 255, .04) !important; }
html:root body.admin-body .admin-sidebar nav a:is(.active, [aria-current="page"]) { color: #fff !important; background: rgba(201, 121, 63, .14) !important; }
html:root body.admin-body .admin-sidebar nav a:is(.active, [aria-current="page"])::before {
  content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 2px; background: #c9793f;
}
html:root body.admin-body .admin-sidebar nav a:is(.active, [aria-current="page"]) i,
html:root body.admin-body .admin-sidebar nav a:is(.active, [aria-current="page"])::after { color: #e0995f !important; }

html:root body.admin-body .admin-sidebar nav button#logoutBtn {
  min-height: 46px !important; margin-top: auto; border-radius: 0 !important;
  border: 1px solid var(--a-rail-line) !important; background: transparent !important; box-shadow: none !important;
  color: #d6cfc3 !important; font: 600 14px/1 var(--a-font) !important;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease !important;
}
html:root body.admin-body .admin-sidebar nav button#logoutBtn:hover { background: #b5402f !important; border-color: #b5402f !important; color: #fff !important; }

html:root body.admin-body .hamburger-btn { border: 1px solid var(--a-rail-line) !important; border-radius: 0 !important; color: var(--a-rail-ink) !important; }

/* ---------- Page head ---------- */
html:root body.admin-body .admin-top {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 32px;
  margin: 0 0 clamp(26px, 3vw, 40px) !important; padding: 0 0 clamp(22px, 2.6vw, 32px) !important;
  border: 0 !important; border-bottom: 1px solid var(--a-line) !important; background: none !important;
}
html:root body.admin-body .admin-top .eyebrow {
  display: inline-flex !important; align-items: center; gap: 12px; margin: 0 0 14px !important;
  color: var(--a-accent) !important; font: 700 13px/1.3 var(--a-font) !important; letter-spacing: 0; text-transform: none;
}
html:root body.admin-body .admin-top .eyebrow::before { content: ""; width: 28px; height: 1px; background: currentColor; }
html:root body.admin-body .admin-top .eyebrow i { display: none; }
html[dir="ltr"]:root body.admin-body .admin-top .eyebrow { font: 500 11px/1.3 var(--a-mono) !important; letter-spacing: .18em; text-transform: uppercase; }
html:root body.admin-body .admin-top h1 {
  margin: 0 !important; color: var(--a-ink) !important;
  font: 800 clamp(32px, 3.3vw, 50px)/1.25 var(--a-display) !important; letter-spacing: 0 !important;
}
html[dir="ltr"]:root body.admin-body .admin-top h1 { font: 600 clamp(40px, 4vw, 62px)/1 var(--a-display) !important; letter-spacing: -.025em !important; }
/* the gallery title carries an id that older layers style; match it explicitly (size stays theirs on phones) */
html:root body.admin-body .admin-top h1#manageTitle { font-family: var(--a-display) !important; font-weight: 800 !important; color: var(--a-ink) !important; }
html[dir="ltr"]:root body.admin-body .admin-top h1#manageTitle { font-weight: 600 !important; }
html:root body.admin-body :is(.admin-page-intro, #galleryLink) {
  max-width: 620px; margin: 12px 0 0 !important; color: var(--a-muted) !important; font: 400 15px/1.8 var(--a-font) !important;
}
html:root body.admin-body #galleryLink { font-family: var(--a-mono) !important; font-size: 12.5px !important; direction: ltr; text-align: start; overflow-wrap: anywhere; }
html:root body.admin-body #galleryLink i { color: var(--a-accent); }

/* ---------- Cards ---------- */
html:root body.admin-body :is(.admin-card, .access-code-section) {
  border-radius: 0 !important; border: 1px solid var(--a-line) !important; background: var(--a-panel) !important;
  box-shadow: none !important; padding: clamp(20px, 2.4vw, 32px) !important;
}
html:root body.admin-body .admin-card:hover { box-shadow: none !important; }
html:root body.admin-body .admin-grid { gap: clamp(16px, 2vw, 28px) !important; }
html:root body.admin-body .admin-main > section + section { margin-top: clamp(16px, 2vw, 24px) !important; }

html:root body.admin-body .admin-card-heading {
  display: flex !important; align-items: flex-start; gap: 14px !important;
  margin: 0 0 22px !important; padding: 0 0 18px !important; border: 0 !important; border-bottom: 1px solid var(--a-line) !important;
}
html:root body.admin-body .admin-card-heading::before, html:root body.admin-body .admin-card-heading::after,
html:root body.admin-body .admin-card h2::before, html:root body.admin-body .admin-card h2::after { display: none !important; }
html:root body.admin-body .admin-step-number {
  display: inline-block !important; flex: 0 0 auto; width: auto !important; height: auto !important; min-width: 0 !important;
  padding: 7px 0 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important;
  color: var(--a-accent) !important; font: 500 12px/1 var(--a-mono) !important; letter-spacing: .06em;
}
html:root body.admin-body .admin-step-number i { font-size: 13px; }
html:root body.admin-body :is(.admin-card h2, .access-code-title) {
  display: flex !important; align-items: center; gap: 10px !important; margin: 0 !important; padding: 0 !important;
  border: 0 !important; color: var(--a-ink) !important; font: 800 20px/1.4 var(--a-display) !important; letter-spacing: 0;
}
html[dir="ltr"]:root body.admin-body :is(.admin-card h2, .access-code-title) { font: 600 26px/1.15 var(--a-display) !important; letter-spacing: -.01em; }
html:root body.admin-body .admin-card h2 i { color: var(--a-accent) !important; font-size: .78em; }
html:root body.admin-body .admin-card-intro { margin: 6px 0 0 !important; color: var(--a-muted) !important; font: 400 14px/1.7 var(--a-font) !important; }

/* ---------- Fields ---------- */
html:root body.admin-body label { color: var(--a-ink) !important; font: 700 13.5px/1.4 var(--a-font) !important; }
html:root body.admin-body label small { color: var(--a-muted) !important; font: 400 12px/1.5 var(--a-font) !important; }
html:root body.admin-body :is(input:not([type="file"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 48px; border-radius: 0 !important; border: 1px solid var(--a-line) !important;
  background-color: var(--a-bg) !important; color: var(--a-ink) !important; box-shadow: none !important;
  font: 500 15px/1.4 var(--a-font) !important; transition: border-color .2s ease, box-shadow .2s ease !important;
}
html:root body.admin-body textarea { min-height: 96px; }
html:root body.admin-body :is(input, textarea)::placeholder { color: color-mix(in srgb, var(--a-muted) 75%, transparent) !important; }
html:root body.admin-body :is(input:not([type="file"]), select, textarea):focus {
  border-color: var(--a-accent) !important; box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-accent) 16%, transparent) !important; outline: none !important;
}
html:root body.admin-body input:read-only:not([type="date"]) { border-style: dashed !important; }
html:root body.admin-body #accessCodeInput { font-family: var(--a-mono) !important; letter-spacing: .14em; }
html:root body.admin-body .date-picker-wrapper .date-icon { color: var(--a-accent) !important; }
html:root body.admin-body #gallerySearch { margin-bottom: 18px !important; background-position: right 14px center !important; padding-inline: 16px 44px !important; }
html[dir="ltr"]:root body.admin-body #gallerySearch { background-position: left 14px center !important; padding-inline: 44px 16px !important; }

/* ---------- Buttons ---------- */
html:root body.admin-body :is(.button, .btn-outline) {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 9px !important;
  border-radius: 0 !important; box-shadow: none !important; background-image: none !important; transform: none !important;
  font: 700 14px/1 var(--a-font) !important; letter-spacing: 0; text-transform: none; text-decoration: none !important;
  transition: background-color .25s ease, border-color .25s ease, color .25s ease !important;
}
html[dir="ltr"]:root body.admin-body :is(.button, .btn-outline) { font-size: 12px !important; letter-spacing: .08em; text-transform: uppercase; }
html:root body.admin-body .button.primary {
  min-height: 50px; padding: 0 24px !important;
  border: 1px solid var(--a-ink) !important; background: var(--a-ink) !important; color: var(--a-bg) !important;
}
html:root body.admin-body .button.primary i { color: var(--a-accent) !important; transition: color .25s ease; }
html:root body.admin-body .button.primary:hover:not(:disabled) { border-color: var(--a-accent) !important; background: var(--a-accent) !important; color: #fff !important; }
html:root body.admin-body .button.primary:hover:not(:disabled) i { color: #fff !important; }
html:root body.admin-body .button.primary.full { min-height: 56px; font-size: 16px !important; }
html:root body.admin-body .button.primary.small { min-height: 48px; padding: 0 18px !important; }
html:root body.admin-body :is(.button.secondary, .btn-outline) {
  min-height: 42px; padding: 0 16px !important;
  border: 1px solid var(--a-line) !important; background: transparent !important; color: var(--a-ink) !important;
}
html:root body.admin-body :is(.button.secondary, .btn-outline) i { color: var(--a-muted) !important; }
html:root body.admin-body :is(.button.secondary, .btn-outline):hover:not(:disabled) { border-color: var(--a-ink) !important; background: var(--a-ink) !important; color: var(--a-bg) !important; }
html:root body.admin-body :is(.button.secondary, .btn-outline):hover:not(:disabled) i { color: var(--a-bg) !important; }
html:root body.admin-body .button.danger {
  min-height: 42px; padding: 0 16px !important;
  border: 1px solid color-mix(in srgb, var(--a-danger) 45%, transparent) !important; background: transparent !important; color: var(--a-danger) !important;
}
html:root body.admin-body .button.danger:hover:not(:disabled) { border-color: var(--a-danger) !important; background: var(--a-danger) !important; color: #fff !important; }
html:root body.admin-body .button:disabled { opacity: .5; cursor: not-allowed; }
html:root body.admin-body .back-arrow { transform: none; }
html[dir="ltr"]:root body.admin-body .back-arrow { transform: scaleX(-1); }

/* ---------- Status ---------- */
html:root body.admin-body .status-message { font: 600 14px/1.6 var(--a-font) !important; }
html:root body.admin-body .status-message.success { color: var(--a-success) !important; }
html:root body.admin-body .status-message.error { color: var(--a-danger) !important; }
html:root body.admin-body .loading-state .spinner { border-color: var(--a-line) !important; border-top-color: var(--a-accent) !important; }
html:root body.admin-body .gallery-empty-state {
  margin: 0 !important; padding: 34px 20px !important; border: 1px dashed var(--a-line) !important; border-radius: 0 !important;
  background: transparent !important; color: var(--a-muted) !important; text-align: center; font: 500 14.5px/1.6 var(--a-font) !important;
}

/* ---------- Galleries list: hairline rows ---------- */
html:root body.admin-body #galleriesList { gap: 0 !important; border-top: 1px solid var(--a-line); }
html:root body.admin-body #galleriesList .gallery-row {
  margin: 0 !important; padding: 16px 8px !important; gap: 12px 16px !important;
  border: 0 !important; border-bottom: 1px solid var(--a-line) !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important; transition: background-color .25s ease !important;
}
html:root body.admin-body #galleriesList .gallery-row:hover { background: var(--a-soft) !important; }
html:root body.admin-body #galleriesList .gallery-row.expired { opacity: .62; }
html:root body.admin-body .gallery-cover {
  width: 64px !important; height: 64px !important; flex: 0 0 64px; border-radius: 0 !important; overflow: hidden;
  border: 1px solid var(--a-line) !important; background: var(--a-bg) !important; color: var(--a-accent) !important; box-shadow: none !important;
}
html:root body.admin-body .gallery-cover img { width: 100%; height: 100%; object-fit: cover; border-radius: 0 !important; }
html:root body.admin-body #galleriesList .gallery-row strong { color: var(--a-ink) !important; font: 700 16.5px/1.4 var(--a-display) !important; }
html:root body.admin-body #galleriesList .gallery-identity .muted { color: var(--a-muted) !important; font: 500 13px/1.5 var(--a-font) !important; }
html:root body.admin-body .gallery-row-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--a-muted) !important; font: 500 12.5px/1.4 var(--a-font) !important; }
html:root body.admin-body .gallery-row-meta span { color: var(--a-muted) !important; }
html:root body.admin-body .gallery-row-meta i { margin-inline-end: 6px; color: var(--a-accent) !important; }
html:root body.admin-body .thumb-actions { gap: 6px !important; }
html:root body.admin-body .thumb-actions .button { min-height: 36px !important; padding: 0 12px !important; font-size: 13px !important; }
html[dir="ltr"]:root body.admin-body .thumb-actions .button { font-size: 11px !important; }
/* Row actions: Manage = solid, Copy = outline, Trash = danger outline.
   Older layers target these by #galleriesList, so the selectors repeat it to win in both themes. */
html:root body.admin-body #galleriesList .thumb-actions a.button {
  border: 1px solid var(--a-ink) !important; background: var(--a-ink) !important; color: var(--a-bg) !important;
}
html:root body.admin-body #galleriesList .thumb-actions a.button:hover { border-color: var(--a-accent) !important; background: var(--a-accent) !important; color: #fff !important; }
html:root body.admin-body #galleriesList .thumb-actions button.button.secondary {
  border: 1px solid var(--a-line) !important; background: transparent !important; color: var(--a-ink) !important;
}
html:root body.admin-body #galleriesList .thumb-actions button.button.secondary:hover { border-color: var(--a-ink) !important; background: var(--a-ink) !important; color: var(--a-bg) !important; }
html:root body.admin-body #galleriesList .thumb-actions button.button.danger {
  border: 1px solid color-mix(in srgb, var(--a-danger) 45%, transparent) !important; background: transparent !important; color: var(--a-danger) !important;
}
html:root body.admin-body #galleriesList .thumb-actions button.button.danger:hover { border-color: var(--a-danger) !important; background: var(--a-danger) !important; color: #fff !important; }
html:root body.admin-body #galleriesList .gallery-notes-row { border-top: 1px dashed var(--a-line) !important; color: var(--a-muted) !important; font: 400 13.5px/1.7 var(--a-font) !important; }

/* ---------- Gallery manage ---------- */
html:root body.admin-body .access-code-section { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px !important; }
html:root body.admin-body .access-code-context { display: flex; align-items: center; gap: 14px; margin-inline-end: auto; }
html:root body.admin-body .code-label { display: grid; gap: 6px; }
html:root body.admin-body .code-label small { color: var(--a-muted) !important; font: 600 12px/1 var(--a-font) !important; }
html:root body.admin-body .code-label small i { color: var(--a-accent); }
html:root body.admin-body .access-code-section .code-value {
  padding: 10px 16px !important; border: 1px solid var(--a-line) !important; border-radius: 0 !important;
  background: var(--a-bg) !important; color: var(--a-ink) !important; font: 500 17px/1 var(--a-mono) !important; letter-spacing: .28em; direction: ltr;
}
html:root body.admin-body .section-panel {
  border: 1px solid var(--a-line) !important; border-radius: 0 !important; background: var(--a-bg) !important; box-shadow: none !important;
}
html:root body.admin-body .section-panel > label i, html:root body.admin-body .section-panel small i { color: var(--a-accent) !important; }
html:root body.admin-body .section-panel > small { color: var(--a-muted) !important; font: 400 12.5px/1.6 var(--a-font) !important; }

html:root body.admin-body .dropzone {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px !important; min-height: 168px !important; padding: 28px 24px !important; text-align: center !important;
  border: 1px dashed color-mix(in srgb, var(--a-ink) 28%, transparent) !important; border-radius: 0 !important;
  background: var(--a-bg) !important; box-shadow: none !important; color: var(--a-ink) !important;
  transition: border-color .25s ease, background-color .25s ease !important;
}
html:root body.admin-body .dropzone:is(:hover, :focus-visible, .is-dragging) { border-color: var(--a-accent) !important; border-style: solid !important; background: var(--a-soft) !important; }
html:root body.admin-body .dropzone > * { align-self: center !important; }
html:root body.admin-body .dropzone > i { margin: 0 0 4px !important; color: var(--a-accent) !important; font-size: 28px !important; }
html:root body.admin-body .dropzone strong { max-width: 46ch; color: var(--a-ink) !important; font: 800 16px/1.6 var(--a-display) !important; }
html[dir="ltr"]:root body.admin-body .dropzone strong { font: 600 21px/1.3 var(--a-display) !important; }
html:root body.admin-body .dropzone span { color: var(--a-muted) !important; font: 400 13px/1.6 var(--a-font) !important; }

/* Files: sections, thumbnails */
html:root body.admin-body #filesGrid > .section-block { border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; }
html:root body.admin-body #filesGrid > .section-block + .section-block { margin-top: 26px; }
html:root body.admin-body .section-heading {
  display: flex !important; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 0 0 14px !important; padding: 0 0 10px !important; border: 0 !important; border-bottom: 1px solid var(--a-line) !important; background: none !important;
}
html:root body.admin-body .section-heading h3 { margin: 0 !important; color: var(--a-ink) !important; font: 800 17px/1.4 var(--a-display) !important; }
html[dir="ltr"]:root body.admin-body .section-heading h3 { font: 600 22px/1.2 var(--a-display) !important; }
html:root body.admin-body .section-count {
  padding: 4px 9px !important; border: 1px solid var(--a-line) !important; border-radius: 0 !important; background: none !important;
  color: var(--a-accent) !important; font: 700 12px/1 var(--a-font) !important; letter-spacing: 0;
}
html:root body.admin-body .thumb-grid { gap: 12px !important; }
/* Thumbnails: the photo fills the card; name + actions sit on a dark fade over it */
html:root body.admin-body .thumb-card {
  padding: 0 !important; border: 1px solid var(--a-line) !important; border-radius: 0 !important;
  background: var(--a-bg) !important; box-shadow: none !important; transform: none !important; transition: border-color .25s ease !important;
}
html:root body.admin-body .thumb-card:hover { border-color: var(--a-accent) !important; box-shadow: none !important; transform: none !important; }
html:root body.admin-body .thumb-card :is(img, video, .thumb-media) { border-radius: 0 !important; }
html:root body.admin-body .thumb-card::after { background: linear-gradient(180deg, transparent, rgba(14, 12, 10, .82)) !important; }
html:root body.admin-body .thumb-card .thumb-file-name { color: rgba(255, 255, 255, .86) !important; font: 500 10.5px/1.4 var(--a-mono) !important; direction: ltr; text-shadow: none; }
html:root body.admin-body .thumb-card .thumb-actions :is(a, button) {
  flex: 1 1 0; min-height: 34px !important; padding: 0 8px !important; border-radius: 0 !important;
  border: 1px solid rgba(255, 255, 255, .28) !important; background: rgba(18, 16, 13, .62) !important; color: #fff !important;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 12.5px !important;
}
html:root body.admin-body .thumb-card .thumb-actions a:hover { border-color: #c9793f !important; background: #c9793f !important; color: #fff !important; }
html:root body.admin-body .thumb-card .thumb-actions .button.danger:hover { border-color: #b5402f !important; background: #b5402f !important; color: #fff !important; }
html:root body.admin-body .card-status { color: #fff !important; font-size: 12px !important; }

html:root body.admin-body .sections-management { border-top: 1px solid var(--a-line) !important; border-radius: 0 !important; }
html:root body.admin-body .sections-management summary { color: var(--a-ink) !important; font: 800 16px/1.5 var(--a-display) !important; cursor: pointer; }
html:root body.admin-body .sections-management summary i { color: var(--a-accent) !important; }

/* Upload progress */
html:root body.admin-body .upload-summary,
html:root body.admin-body .progress-item { border: 1px solid var(--a-line) !important; border-radius: 0 !important; background: var(--a-bg) !important; box-shadow: none !important; }
html:root body.admin-body :is(.upload-summary-bar, .storage-metric-bar) {
  height: 8px !important; border: 0 !important; border-radius: 0 !important; overflow: hidden;
  background: color-mix(in srgb, var(--a-ink) 10%, transparent) !important;
}
html:root body.admin-body :is(.upload-summary-bar, .storage-metric-bar) span { border-radius: 0 !important; background: var(--a-accent) !important; }
html:root body.admin-body .progress-item.is-done { border-color: color-mix(in srgb, var(--a-success) 40%, var(--a-line)) !important; }
html:root body.admin-body .progress-item.is-error { border-color: color-mix(in srgb, var(--a-danger) 50%, var(--a-line)) !important; }

/* ---------- Storage ---------- */
html:root body.admin-body .storage-metric {
  padding: clamp(22px, 3vw, 36px) !important; border: 1px solid var(--a-line) !important; border-radius: 0 !important;
  background: var(--a-bg) !important; box-shadow: none !important; color: var(--a-ink) !important;
}
html:root body.admin-body .storage-metric-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
html:root body.admin-body .storage-metric-head strong { color: var(--a-ink) !important; font: 800 20px/1.4 var(--a-display) !important; }
html:root body.admin-body .storage-metric-head strong i { color: var(--a-accent); }
html:root body.admin-body .storage-metric-head > span { color: var(--a-accent) !important; font: 500 clamp(34px, 4vw, 52px)/1 var(--a-en-display) !important; letter-spacing: -.02em; direction: ltr; }
html:root body.admin-body .storage-metric-bar { height: 12px !important; }
html:root body.admin-body .storage-metric-foot { display: flex; justify-content: space-between; gap: 16px; margin-top: 16px; }
html:root body.admin-body .storage-metric-foot :is(.muted, small) { color: var(--a-muted) !important; font: 600 13.5px/1.5 var(--a-font) !important; }
html:root body.admin-body .storage-metric-foot i { color: var(--a-accent); }

/* ---------- Trash rows (also the sections list on gallery-manage) ---------- */
html:root body.admin-body .trash-list { border-top: 0 !important; }
html:root body.admin-body .trash-list > .trash-row:first-child { padding-top: 6px !important; }
html:root body.admin-body .trash-row {
  margin: 0 !important; padding: 18px 8px !important; border: 0 !important; border-bottom: 1px solid var(--a-line) !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
}
html:root body.admin-body .trash-row:hover { background: var(--a-soft) !important; }
html:root body.admin-body .trash-row h3 { margin: 0 0 4px !important; color: var(--a-ink) !important; font: 700 16.5px/1.4 var(--a-display) !important; }
html:root body.admin-body .trash-row small { color: var(--a-muted) !important; font: 500 12px/1.5 var(--a-font) !important; }
html:root body.admin-body .trash-row strong { color: var(--a-ink) !important; font: 600 14px/1.5 var(--a-font) !important; }
html:root body.admin-body .trash-actions { gap: 6px !important; }
html:root body.admin-body .trash-actions .button { min-height: 36px !important; padding: 0 12px !important; font-size: 13px !important; }

/* ---------- Login ---------- */
html:root body.admin-body .auth-shell { min-height: 100svh; display: grid; place-items: center; padding: 24px; background: var(--a-bg) !important; }
html:root body.admin-body .auth-card {
  width: min(440px, 100%) !important; padding: clamp(30px, 5vw, 48px) clamp(24px, 4vw, 44px) !important;
  border: 1px solid var(--a-line) !important; border-radius: 0 !important; background: var(--a-panel) !important;
  box-shadow: 0 40px 80px -48px rgba(30, 20, 10, .45) !important; text-align: start;
}
html:root body.admin-body .auth-logo { display: block; width: 150px; height: auto; margin: 0 0 30px; }
html:root body.admin-body .auth-card .eyebrow {
  display: inline-flex !important; align-items: center; gap: 12px; margin: 0 0 12px !important;
  color: var(--a-accent) !important; font: 500 11px/1 var(--a-mono) !important; letter-spacing: .18em; text-transform: uppercase;
}
html:root body.admin-body .auth-card .eyebrow::before { content: ""; width: 24px; height: 1px; background: currentColor; }
html[dir="rtl"]:root body.admin-body .auth-card .eyebrow { font: 700 13px/1.3 var(--a-font) !important; letter-spacing: 0; }
html:root body.admin-body .auth-card .eyebrow i { display: none; }
html:root body.admin-body .auth-card h1 { margin: 0 0 8px !important; color: var(--a-ink) !important; font: 800 32px/1.3 var(--a-display) !important; text-align: start !important; }
html[dir="ltr"]:root body.admin-body .auth-card h1 { font: 600 42px/1.05 var(--a-display) !important; letter-spacing: -.02em; }
html:root body.admin-body .auth-description { margin: 0 0 28px !important; color: var(--a-muted) !important; font: 400 15px/1.7 var(--a-font) !important; text-align: start !important; }
html:root body.admin-body .auth-card label { display: grid; gap: 8px; margin-bottom: 18px; text-align: start; }
html:root body.admin-body .auth-card .input-wrapper i { color: var(--a-accent) !important; }
html:root body.admin-body .auth-card .button.primary { width: 100%; min-height: 54px; margin-top: 6px; font-size: 16px !important; }
html:root body.admin-body #loginError { margin-top: 14px; color: var(--a-danger) !important; font: 600 14px/1.5 var(--a-font) !important; }
html:root body.admin-body .admin-login-preferences button {
  min-height: 38px !important; border-radius: 0 !important; border: 1px solid var(--a-line) !important;
  background: var(--a-panel) !important; color: var(--a-ink) !important; box-shadow: none !important;
}
html:root body.admin-body .admin-login-preferences button:hover { border-color: var(--a-accent) !important; color: var(--a-accent) !important; }

/* ---------- Signed-in user chip, role badges, owner-only gating, section placeholder ---------- */
html:root body.admin-body .admin-sidebar nav .admin-user {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: auto; padding: 14px 14px 12px;
  border-top: 1px solid var(--a-rail-line); color: var(--a-rail-ink); font: 600 14px/1.4 var(--a-font); overflow-wrap: anywhere;
}
html:root body.admin-body .admin-sidebar nav .admin-user[hidden] { display: none; }
html:root body.admin-body .admin-sidebar nav .admin-user-sep { color: #6c665c; }
html:root body.admin-body .admin-sidebar nav .admin-user + button#logoutBtn { margin-top: 0; }
html:root body.admin-body .admin-user-role {
  display: inline-block; padding: 3px 9px; border: 1px solid currentColor; color: var(--a-rail-muted);
  font: 600 12px/1.3 var(--a-font); letter-spacing: 0;
}
html:root body.admin-body .admin-user-role[data-role="owner"] { color: #e0995f; background: rgba(201, 121, 63, .12); }
html[dir="ltr"]:root body.admin-body .admin-user-role { font: 500 10.5px/1.3 var(--a-mono); letter-spacing: .12em; text-transform: uppercase; }
/* owner-only stays hidden until the shell knows the signed-in role is owner (also covers elements rendered later) */
html:root body:not([data-role="owner"]) [data-owner-only] { display: none !important; }

html:root body.admin-body .admin-placeholder {
  display: grid; justify-items: start; gap: 6px; max-width: 640px; padding-block: clamp(28px, 4vw, 48px) !important;
}
html:root body.admin-body .admin-placeholder-icon { margin-bottom: 10px; color: var(--a-accent); font-size: 22px; }
html:root body.admin-body .admin-placeholder h2 { padding: 0 !important; }

/* ---------- Stories (list + editor) ---------- */
html:root body.admin-body .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
html:root body.admin-body :is(.gallery-empty-state, .st-editor-note, .st-uploads, .st-photo-alt, .st-publish, .st-danger-zone, #photosBody, #photosLocked, #orderHint)[hidden] { display: none !important; }
html:root body.admin-body :is(input, textarea)[dir="ltr"] { text-align: left !important; }
html:root body.admin-body :is(input, textarea)[dir="rtl"] { text-align: right !important; }
html:root body.admin-body .st-num { font-family: var(--a-mono) !important; font-size: .92em; letter-spacing: .02em; }
html:root body.admin-body .st-muted { color: var(--a-muted); font: 500 14px/1.6 var(--a-font); }

/* toolbar */
html:root body.admin-body .st-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 20px; margin-bottom: 22px; }
html:root body.admin-body .st-toolbar .st-filters { margin-inline-start: auto; }
html:root body.admin-body .st-order-state { min-height: 0; margin: -10px 0 12px; font: 500 13px/1.6 var(--a-font); color: var(--a-muted); }
html:root body.admin-body .st-order-state:has(.st-save-state:empty) { display: none; }
html:root body.admin-body .st-search { position: relative; flex: 1 1 280px; max-width: 420px; display: block; }
html:root body.admin-body .st-search i { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--a-muted); font-size: 14px; pointer-events: none; }
html:root body.admin-body .st-search input { width: 100%; padding-inline: 44px 16px !important; }
html:root body.admin-body .st-filters { display: flex; flex-wrap: wrap; border: 1px solid var(--a-line); background: var(--a-panel); }
html:root body.admin-body .st-filter {
  display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 16px; border: 0; border-inline-start: 1px solid var(--a-line);
  background: transparent; color: var(--a-muted); font: 700 14px/1 var(--a-font) !important; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
html:root body.admin-body .st-filter:first-child { border-inline-start: 0; }
html:root body.admin-body .st-filter:hover { color: var(--a-ink); }
html:root body.admin-body .st-filter.is-active { background: var(--a-ink); color: var(--a-bg); }
html:root body.admin-body .st-count { font: 500 11.5px/1 var(--a-mono); color: var(--a-accent); }
html:root body.admin-body .st-filter.is-active .st-count { color: var(--a-accent); }
html:root body.admin-body .st-hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 22px; color: var(--a-muted); font: 500 13px/1.6 var(--a-font); }
html:root body.admin-body .st-hint > i { color: var(--a-accent); }
html:root body.admin-body .st-save-state { color: var(--a-success); font-weight: 700; }
html:root body.admin-body .st-save-state[data-state="saving"] { color: var(--a-muted); }
html:root body.admin-body .st-save-state[data-state="error"] { color: var(--a-danger); }

/* story cards */
html:root body.admin-body .st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
html:root body.admin-body .st-card {
  position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--a-line); background: var(--a-panel);
  transition: border-color .25s ease;
}
html:root body.admin-body .st-card:hover, html:root body.admin-body .st-card:focus-within { border-color: var(--a-accent); }
html:root body.admin-body .st-card-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: color-mix(in srgb, var(--a-ink) 6%, var(--a-bg)); }
html:root body.admin-body .st-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease; }
html:root body.admin-body .st-card:hover .st-card-media img { transform: scale(1.03); }
html:root body.admin-body .st-card.is-draft .st-card-media img { filter: saturate(.55); }
html:root body.admin-body .st-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--a-muted) 60%, transparent); font-size: 28px; }
html:root body.admin-body .st-card-index {
  position: absolute; top: 0; inset-inline-start: 0; padding: 7px 10px; background: rgba(14, 12, 10, .72); color: #f2efe9;
  font: 500 11px/1 var(--a-mono); letter-spacing: .08em;
}
html:root body.admin-body .st-card-media .st-pills { position: absolute; bottom: 10px; inset-inline-start: 10px; }
html:root body.admin-body .st-pills { display: flex; flex-wrap: wrap; gap: 6px; }
html:root body.admin-body .st-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid transparent;
  font: 700 12px/1.2 var(--a-font); letter-spacing: 0;
}
html:root body.admin-body .st-pill i { font-size: 10px; }
html:root body.admin-body .st-pill-published { background: var(--a-success); color: #fff; }
html:root body.admin-body .st-pill-draft { background: var(--a-panel); border-color: var(--a-line); border-style: dashed; color: var(--a-muted); }
html:root body.admin-body .st-pill-featured { background: var(--a-accent); color: #fff; }
html[dir="ltr"]:root body.admin-body .st-pill { font: 500 10.5px/1.2 var(--a-mono); letter-spacing: .1em; text-transform: uppercase; }
html:root body.admin-body .st-card-body { display: grid; gap: 4px; padding: 16px 18px 18px; }
html:root body.admin-body .st-card-title { margin: 0 !important; padding: 0 !important; border: 0 !important; font: 800 18px/1.45 var(--a-ar-display) !important; color: var(--a-ink); }
html:root body.admin-body .st-card-title a { color: inherit; text-decoration: none; }
html:root body.admin-body .st-card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
html:root body.admin-body .st-card-sub { margin: 0; overflow: hidden; color: var(--a-muted); font: 500 15px/1.3 var(--a-en-display); text-overflow: ellipsis; white-space: nowrap; text-align: start; }
html[dir="rtl"]:root body.admin-body .st-card-sub { text-align: right; }
html[dir="ltr"]:root body.admin-body .st-card-sub { text-align: left; }
html:root body.admin-body .st-card-sub[lang="ar"] { font: 500 13.5px/1.4 var(--a-ar); }
html[dir="ltr"]:root body.admin-body .st-card-title { font: 600 23px/1.2 var(--a-en-display) !important; }
html:root body.admin-body .st-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--a-line); color: var(--a-muted); font: 500 12.5px/1.4 var(--a-font); }
html:root body.admin-body .st-meta-photos { display: inline-flex; align-items: center; gap: 6px; color: var(--a-ink); }
html:root body.admin-body .st-meta-photos i { color: var(--a-accent); }
html:root body.admin-body .st-card > .st-handle {
  position: absolute; z-index: 2; top: 0; inset-inline-end: 0; display: grid; place-items: center; width: 34px; height: 31px;
  border: 0; background: rgba(14, 12, 10, .72); color: #f2efe9; cursor: grab; touch-action: none;
  font-size: 12px; opacity: 0; transition: opacity .2s ease, background .2s ease;
}
html:root body.admin-body .st-card:hover > .st-handle, html:root body.admin-body .st-card:focus-within > .st-handle, html:root body.admin-body .st-card > .st-handle:focus-visible { opacity: 1; }
html:root body.admin-body .st-card > .st-handle:hover, html:root body.admin-body .st-card > .st-handle:focus-visible { background: var(--a-accent); color: #fff; outline: none; }
@media (hover: none) { html:root body.admin-body .st-card > .st-handle { opacity: 1; } }
html:root body.admin-body .st-grid.is-filtered .st-handle { display: none; }
html:root body.admin-body .is-drag-source { opacity: .35; outline: 1px dashed var(--a-accent); }
html:root body.admin-body .st-drag-ghost { opacity: .92; box-shadow: 0 24px 50px -20px rgba(20, 14, 8, .55); border-color: var(--a-accent) !important; }
html:root body.admin-body.is-sorting, html:root body.admin-body.is-sorting * { cursor: grabbing !important; user-select: none; }

/* editor head */
html:root body.admin-body .st-editor-top { align-items: flex-end; }
html:root body.admin-body .st-editor-head { display: grid; justify-items: start; gap: 12px; min-width: 0; }
html:root body.admin-body .st-editor-head h1 { overflow-wrap: anywhere; }
html:root body.admin-body .st-back { display: inline-flex; align-items: center; gap: 10px; color: var(--a-muted); font: 700 13.5px/1 var(--a-font); text-decoration: none; }
html:root body.admin-body .st-back:hover { color: var(--a-accent); }
html:root body.admin-body .st-editor-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
html:root body.admin-body .st-view-page { display: grid; justify-items: center; gap: 6px; }
html:root body.admin-body .st-view-page .button { min-height: 50px !important; }
html:root body.admin-body .st-view-page small { color: var(--a-muted); font: 500 12px/1.4 var(--a-font); }
html:root body.admin-body .button.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: auto; }
html:root body.admin-body .button.is-disabled:hover { background: transparent !important; color: var(--a-ink) !important; border-color: var(--a-line) !important; }
html:root body.admin-body .button.is-disabled:hover i { color: var(--a-muted) !important; }
html:root body.admin-body .st-editor-status { margin: -14px 0 16px; }
html:root body.admin-body .st-editor-status:empty { display: none; }

/* tabs */
html:root body.admin-body .st-tabs { display: flex; gap: 0; margin-bottom: clamp(18px, 2vw, 26px); border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .st-tab {
  position: relative; display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 22px; border: 0; background: none;
  color: var(--a-muted); font: 800 16px/1 var(--a-ar-display) !important; cursor: pointer; transition: color .2s ease;
}
html[dir="ltr"]:root body.admin-body .st-tab { font: 600 13px/1 var(--a-en) !important; letter-spacing: .1em; text-transform: uppercase; }
html:root body.admin-body .st-tab:hover:not(:disabled) { color: var(--a-ink); }
html:root body.admin-body .st-tab.is-active { color: var(--a-ink); }
html:root body.admin-body .st-tab.is-active::after { content: ""; position: absolute; inset-inline: 0; bottom: -1px; height: 2px; background: var(--a-accent); }
html:root body.admin-body .st-tab:disabled { opacity: .45; cursor: not-allowed; }

/* owner toggles */
html:root body.admin-body .st-publish { display: grid !important; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 28px; margin-bottom: clamp(16px, 2vw, 24px); }
html:root body.admin-body .st-publish[hidden], html:root body.admin-body .st-danger-zone[hidden] { display: none !important; }
html:root body.admin-body .st-switch { position: relative; display: flex !important; align-items: center; gap: 14px; cursor: pointer; }
html:root body.admin-body .st-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
html:root body.admin-body .st-switch-ui { position: relative; flex: 0 0 auto; width: 46px; height: 26px; border: 1px solid var(--a-line); background: var(--a-bg); transition: background-color .2s ease, border-color .2s ease; }
html:root body.admin-body .st-switch-ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; background: var(--a-muted); transition: inset-inline-start .2s ease, background-color .2s ease; }
html:root body.admin-body .st-switch input:checked + .st-switch-ui { background: var(--a-accent); border-color: var(--a-accent); }
html:root body.admin-body .st-switch input:checked + .st-switch-ui::after { inset-inline-start: 23px; background: #fff; }
html:root body.admin-body .st-switch input:focus-visible + .st-switch-ui { outline: 2px solid var(--a-accent); outline-offset: 2px; }
html:root body.admin-body .st-switch strong { display: block; color: var(--a-ink); font: 800 15.5px/1.4 var(--a-display); }
html:root body.admin-body .st-switch small { display: block; color: var(--a-muted) !important; font: 400 13px/1.5 var(--a-font) !important; }
html:root body.admin-body .st-editor-note { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 12px 16px; border: 1px solid var(--a-line); border-inline-start: 2px solid var(--a-accent); background: var(--a-soft); color: var(--a-ink); font: 500 14px/1.6 var(--a-font); }
html:root body.admin-body .st-editor-note i { color: var(--a-accent); }

/* form sections */
html:root body.admin-body .st-section + .st-section { margin-top: clamp(16px, 2vw, 24px); }
html:root body.admin-body .st-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin: 0 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .st-section-head .admin-card-intro { margin: 0 !important; flex-basis: 100%; }
html:root body.admin-body .st-lang-heads { display: none; }
html:root body.admin-body .st-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 clamp(16px, 2vw, 28px); }
html:root body.admin-body .st-field { display: grid; align-content: start; gap: 8px; margin-bottom: 18px; min-width: 0; }
html:root body.admin-body .st-field label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
html:root body.admin-body .st-field :is(input, select, textarea) { width: 100%; padding: 12px 14px; }
html:root body.admin-body .st-field textarea { resize: vertical; line-height: 1.75 !important; }
html:root body.admin-body .st-field [dir="ltr"]:not(.st-slug-input) { font-family: var(--a-en) !important; }
html:root body.admin-body .st-req { color: var(--a-accent); font-weight: 800; }
html:root body.admin-body .st-field-error { margin: 0; color: var(--a-danger); font: 700 13px/1.5 var(--a-font); }
html:root body.admin-body .st-field-error:empty { display: none; }
html:root body.admin-body .st-field-hint { margin: 0; color: var(--a-accent); font: 600 13px/1.5 var(--a-font); }
html:root body.admin-body .st-field-hint[hidden] { display: none; }
html:root body.admin-body .st-counter { margin: -2px 0 0; color: var(--a-muted); font: 500 11px/1 var(--a-mono); text-align: end; direction: ltr; }
html[dir="rtl"]:root body.admin-body .st-counter { text-align: left; }
html:root body.admin-body [aria-invalid="true"] { border-color: var(--a-danger) !important; }
html:root body.admin-body .st-slug-field { margin-bottom: 0; }
html:root body.admin-body .st-slug-input { display: flex; align-items: stretch; border: 1px solid var(--a-line); background: var(--a-bg); transition: border-color .2s ease, box-shadow .2s ease; }
html:root body.admin-body .st-slug-input:focus-within { border-color: var(--a-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--a-accent) 16%, transparent); }
html:root body.admin-body .st-slug-input:has([aria-invalid="true"]) { border-color: var(--a-danger); }
html:root body.admin-body .st-slug-prefix { display: flex; align-items: center; padding: 0 4px 0 14px; color: var(--a-muted); font: 500 14px/1 var(--a-mono); white-space: nowrap; }
html:root body.admin-body .st-slug-input input { flex: 1; min-width: 0; border: 0 !important; box-shadow: none !important; padding-inline-start: 0 !important; font-family: var(--a-mono) !important; font-size: 14.5px !important; }

/* photographers */
html:root body.admin-body .st-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
html:root body.admin-body .st-person { position: relative; display: block !important; cursor: pointer; }
html:root body.admin-body .st-person input { position: absolute; opacity: 0; width: 1px; height: 1px; }
html:root body.admin-body .st-person-box {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0 12px; min-height: 60px; padding: 10px 14px;
  border: 1px solid var(--a-line); background: var(--a-bg); transition: border-color .2s ease, background-color .2s ease;
}
html:root body.admin-body .st-person-box i { grid-row: span 2; display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--a-line); color: transparent; font-size: 11px; }
html:root body.admin-body .st-person-box strong { color: var(--a-ink); font: 700 14.5px/1.35 var(--a-ar); }
html:root body.admin-body .st-person-box small { color: var(--a-muted) !important; font: 500 12.5px/1.3 var(--a-en) !important; }
html:root body.admin-body .st-person:hover .st-person-box { border-color: color-mix(in srgb, var(--a-accent) 60%, var(--a-line)); }
html:root body.admin-body .st-person input:checked + .st-person-box { border-color: var(--a-accent); background: var(--a-soft); }
html:root body.admin-body .st-person input:checked + .st-person-box i { border-color: var(--a-accent); background: var(--a-accent); color: #fff; }
html:root body.admin-body .st-person input:focus-visible + .st-person-box { outline: 2px solid var(--a-accent); outline-offset: 2px; }

html:root body.admin-body .st-danger-zone {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: clamp(16px, 2vw, 24px);
  padding: 18px clamp(20px, 2.4vw, 32px); border: 1px dashed color-mix(in srgb, var(--a-danger) 45%, var(--a-line));
}
html:root body.admin-body .st-danger-zone strong { display: block; color: var(--a-ink); font: 800 15.5px/1.4 var(--a-display); }
html:root body.admin-body .st-danger-zone small { color: var(--a-muted); font: 400 13px/1.5 var(--a-font); }

/* photos tab */
html:root body.admin-body .st-dropzone { min-height: 150px !important; }
html:root body.admin-body .st-uploads { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--a-line); background: var(--a-panel); }
html:root body.admin-body .st-uploads[hidden] { display: none; }
html:root body.admin-body .st-uploads-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
html:root body.admin-body .st-uploads-head strong { color: var(--a-ink); font: 800 15px/1.4 var(--a-display); }
html:root body.admin-body .st-uploads-head .button { min-height: 34px !important; padding: 0 12px !important; font-size: 13px !important; }
html:root body.admin-body .st-uploads .upload-summary-bar { display: block; height: 4px !important; margin-bottom: 12px; }
html:root body.admin-body .st-uploads .upload-summary-bar span { display: block; height: 100%; transition: width .3s ease; }
html:root body.admin-body .st-upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; max-height: 260px; overflow: auto; margin: 0; padding: 0; list-style: none; }
html:root body.admin-body .st-upload { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 10px; border-bottom: 1px solid var(--a-line); font: 500 13px/1.4 var(--a-font); }
html:root body.admin-body .st-upload-name { overflow: hidden; color: var(--a-ink); text-overflow: ellipsis; white-space: nowrap; font-family: var(--a-mono); font-size: 12px; }
html:root body.admin-body .st-upload-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; color: var(--a-muted); }
html:root body.admin-body .st-upload.is-done .st-upload-status { color: var(--a-success); }
html:root body.admin-body .st-upload.is-error .st-upload-status { color: var(--a-danger); }
html:root body.admin-body .st-upload-bar { position: absolute; inset-inline: 0; bottom: -1px; height: 2px; }
html:root body.admin-body .st-upload-bar span { display: block; height: 100%; background: var(--a-accent); transition: width .2s ease; }
html:root body.admin-body .st-upload.is-done .st-upload-bar span { background: var(--a-success); }
html:root body.admin-body .st-upload.is-error .st-upload-bar { display: none; }
html:root body.admin-body .st-link-btn { padding: 0; border: 0; background: none; color: var(--a-accent); font: 700 13px/1 var(--a-font) !important; text-decoration: underline; cursor: pointer; }
:is(#panelPhotos, #panelGallery) .st-hint { margin-top: 22px; }

html:root body.admin-body .st-photo-grid { display: grid; align-items: start; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
html:root body.admin-body .st-photo { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--a-line); background: var(--a-panel); transition: border-color .2s ease; }
html:root body.admin-body .st-photo:hover, html:root body.admin-body .st-photo:focus-within { border-color: color-mix(in srgb, var(--a-accent) 60%, var(--a-line)); }
html:root body.admin-body .st-photo.is-cover { border-color: var(--a-accent); }
html:root body.admin-body .st-photo-media { position: relative; aspect-ratio: 1; overflow: hidden; background: color-mix(in srgb, var(--a-ink) 6%, var(--a-bg)); }
html:root body.admin-body .st-photo-media img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
html:root body.admin-body .st-photo-index { position: absolute; top: 0; inset-inline-start: 0; padding: 6px 9px; background: rgba(14, 12, 10, .72); color: #f2efe9; font: 500 10.5px/1 var(--a-mono); letter-spacing: .08em; }
html:root body.admin-body .st-cover-badge { position: absolute; top: 8px; inset-inline-end: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; background: var(--a-accent); color: #fff; font: 700 12px/1 var(--a-font); }
html:root body.admin-body .st-cover-badge i { font-size: 10px; }
html:root body.admin-body .st-photo-bar { display: flex; align-items: center; gap: 2px; padding: 4px; border-top: 1px solid var(--a-line); }
html:root body.admin-body .st-photo-handle { margin-inline-end: auto; }
html:root body.admin-body .st-icon-btn {
  display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; border: 1px solid transparent; background: none;
  color: var(--a-muted); font-size: 14px; cursor: pointer; transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
html:root body.admin-body .st-icon-btn:hover { border-color: var(--a-line); color: var(--a-ink); }
html:root body.admin-body .st-icon-btn.has-value { color: var(--a-ink); }
html:root body.admin-body .st-photo-handle { cursor: grab; touch-action: none; }
html:root body.admin-body .st-cover-btn.is-on { color: var(--a-accent); }
html:root body.admin-body .st-cover-btn:hover { color: var(--a-accent); }
html:root body.admin-body .st-delete-btn:hover { border-color: var(--a-danger); background: var(--a-danger); color: #fff; }
html:root body.admin-body .st-photo-alt { display: grid; gap: 8px; padding: 10px; border-top: 1px dashed var(--a-line); }
html:root body.admin-body .st-photo-alt[hidden] { display: none; }
html:root body.admin-body .st-alt-field { display: grid !important; gap: 4px; font: 600 12px/1.4 var(--a-font) !important; color: var(--a-muted) !important; }
html:root body.admin-body .st-alt-field input { min-height: 38px !important; padding: 6px 10px; font-size: 13.5px !important; }
html:root body.admin-body .st-alt-state { min-height: 1em; color: var(--a-success) !important; font: 600 11.5px/1.2 var(--a-font) !important; }
html:root body.admin-body #photosEmpty { margin-top: 4px !important; }

/* ---------- Team (members, member editor, accounts) ---------- */
html:root body.admin-body :is(.st-editor-actions, .st-hint, .dropzone, .tm-accounts, .tm-portrait-actions, #galleryBody, #galleryLocked, #teamEditorNote, .st-link-btn)[hidden] { display: none !important; }
html:root body.admin-body .tm-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
html:root body.admin-body .tm-card-media { aspect-ratio: 4 / 5; }
html:root body.admin-body .tm-card-media img { object-position: center 30%; }
html:root body.admin-body .tm-card.is-mine { border-color: color-mix(in srgb, var(--a-accent) 70%, var(--a-line)); }
html:root body.admin-body .tm-card-role { margin: 2px 0 0; color: var(--a-accent); font: 700 13px/1.4 var(--a-font); }
html:root body.admin-body .tm-card .st-card-meta { justify-content: space-between; }
html:root body.admin-body .tm-card .st-meta-photos span:last-child { color: var(--a-muted); font-weight: 500; }
html:root body.admin-body .tm-card .st-card-media .st-pills { z-index: 3; }
html:root body.admin-body .tm-card .st-card-meta button.tm-visibility { position: relative; z-index: 3; min-height: 0 !important; height: auto !important; width: auto !important; padding: 5px 10px !important; margin: 0 !important; border-radius: 0 !important; box-shadow: none !important; font: 700 12px/1.2 var(--a-font) !important; cursor: pointer; transition: filter .2s ease, transform .2s ease; }
html:root body.admin-body button.tm-visibility:hover { filter: brightness(1.08); transform: translateY(-1px); }
html:root body.admin-body button.tm-visibility:focus-visible { outline: 2px solid var(--a-accent); outline-offset: 2px; }
html:root body.admin-body button.tm-visibility:disabled { opacity: .6; cursor: progress; }
html:root body.admin-body .tm-card.is-draft .st-card-media img { filter: grayscale(.6) brightness(.85); }
html:root body.admin-body .tm-card-switch { position: relative; z-index: 2; gap: 8px !important; }
html:root body.admin-body .tm-card-switch .st-switch-ui { width: 38px; height: 22px; }
html:root body.admin-body .tm-card-switch .st-switch-ui::after { width: 14px; height: 14px; }
html:root body.admin-body .tm-card-switch input:checked + .st-switch-ui::after { inset-inline-start: 19px; }
html:root body.admin-body .tm-card-switch-label { color: var(--a-muted); font: 600 12.5px/1 var(--a-font); }
html:root body.admin-body .tm-card .st-card-body { padding-inline-end: 18px; padding-bottom: 14px; }

html:root body.admin-body .tm-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
html:root body.admin-body .tm-fieldset:disabled :is(input, textarea, select) { opacity: .75; cursor: not-allowed; }
html:root body.admin-body .tm-profile-grid { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); align-items: stretch; gap: clamp(16px, 2vw, 24px); }
html:root body.admin-body .tm-profile-fields { display: grid; gap: clamp(16px, 2vw, 24px); min-width: 0; }
html:root body.admin-body .tm-profile-fields > .admin-card, html:root body.admin-body .tm-profile-grid > .admin-card { margin: 0 !important; }
html:root body.admin-body .tm-portrait-card { display: grid; gap: 12px; }
html:root body.admin-body .tm-portrait-card .st-section-head { margin-bottom: 4px; }
html:root body.admin-body .tm-portrait-frame { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border: 1px solid var(--a-line); background: color-mix(in srgb, var(--a-ink) 6%, var(--a-bg)); }
html:root body.admin-body .tm-portrait-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
html:root body.admin-body .tm-portrait-frame img[hidden] { display: none; }
html:root body.admin-body .tm-portrait-empty { position: absolute; inset: 0; display: grid; place-items: center; color: color-mix(in srgb, var(--a-muted) 55%, transparent); font-size: 54px; }
html:root body.admin-body .tm-portrait-empty[hidden] { display: none; }
html:root body.admin-body .tm-portrait-drop { min-height: 0 !important; padding: 16px !important; gap: 2px !important; }
html:root body.admin-body .tm-portrait-drop > i { font-size: 20px !important; }
html:root body.admin-body .tm-portrait-drop strong { font-size: 14.5px !important; }
html[dir="ltr"]:root body.admin-body .tm-portrait-drop strong { font-size: 17px !important; }
html:root body.admin-body .tm-portrait-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
html:root body.admin-body .tm-danger-link { color: var(--a-danger) !important; }

/* accounts */
html:root body.admin-body .tm-accounts { margin-top: clamp(40px, 5vw, 64px); padding-top: clamp(26px, 3vw, 36px); border-top: 1px solid var(--a-line); }
html:root body.admin-body .tm-accounts-head { margin-bottom: clamp(16px, 2vw, 24px); }
html:root body.admin-body .tm-accounts-head h2 { margin: 6px 0 8px !important; padding: 0 !important; border: 0 !important; color: var(--a-ink); font: 800 clamp(24px, 2.4vw, 30px)/1.3 var(--a-display) !important; }
html[dir="ltr"]:root body.admin-body .tm-accounts-head h2 { font: 600 clamp(30px, 3vw, 38px)/1.1 var(--a-display) !important; }
html:root body.admin-body .tm-accounts-head .admin-card-intro { margin: 0 !important; max-width: 62ch; }
html:root body.admin-body .tm-accounts-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
html:root body.admin-body .tm-accounts-head .button { flex: 0 0 auto; }
html:root body.admin-body .tm-accounts-head .button[hidden] { display: none !important; }
html:root body.admin-body .tm-account-form { margin: 0 0 clamp(16px, 2vw, 24px) !important; padding: 0 !important; border-color: color-mix(in srgb, var(--a-accent) 45%, var(--a-line)) !important; }
html:root body.admin-body .tm-account-form[hidden] { display: none !important; }
html:root body.admin-body .tm-account-form-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 18px; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .tm-account-form-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-accent); }
html:root body.admin-body .tm-account-form-head h3 { margin: 0 0 4px !important; padding: 0 !important; border: 0 !important; color: var(--a-ink); font: 800 19px/1.3 var(--a-display) !important; }
html[dir="ltr"]:root body.admin-body .tm-account-form-head h3 { font: 600 23px/1.2 var(--a-display) !important; }
html:root body.admin-body .tm-account-form-head p { margin: 0; color: var(--a-muted); font: 500 13px/1.5 var(--a-font); }
html:root body.admin-body .tm-account-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; padding: 22px 24px 4px; }
html:root body.admin-body .tm-account-form-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--a-line); background: color-mix(in srgb, var(--a-bg) 60%, transparent); }
html:root body.admin-body .tm-account-status { margin: 0 0 14px !important; }
html:root body.admin-body .tm-account-status:empty { display: none; }
html:root body.admin-body .tm-account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(12px, 1.6vw, 18px); margin: 0; padding: 0; list-style: none; }
html:root body.admin-body .tm-account-grid[aria-busy="true"]:empty { min-height: 120px; }
html:root body.admin-body .tm-acc { display: flex; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--a-line); background: var(--a-panel); transition: border-color .2s ease; }
html:root body.admin-body .tm-acc:hover { border-color: color-mix(in srgb, var(--a-accent) 50%, var(--a-line)); }
html:root body.admin-body .tm-acc.is-owner { border-color: color-mix(in srgb, var(--a-accent) 55%, var(--a-line)); background: color-mix(in srgb, var(--a-accent) 5%, var(--a-panel)); }
html:root body.admin-body .tm-acc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
html:root body.admin-body .tm-account-avatar { flex: 0 0 46px; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-accent); font: 700 18px/1 var(--a-display); }
html:root body.admin-body .tm-acc.is-owner .tm-account-avatar { border-color: var(--a-accent); background: var(--a-accent); color: #fff; }
html:root body.admin-body .tm-account-who { flex: 1; display: grid; gap: 3px; min-width: 0; }
html:root body.admin-body .tm-account-who strong { overflow: hidden; color: var(--a-ink); font: 700 16px/1.35 var(--a-font); text-overflow: ellipsis; white-space: nowrap; }
html:root body.admin-body .tm-account-who small { overflow: hidden; color: var(--a-muted); font: 500 12.5px/1.3 var(--a-mono); text-overflow: ellipsis; white-space: nowrap; text-align: start; }
html[dir="rtl"]:root body.admin-body .tm-account-who small { text-align: right; }
html:root body.admin-body .tm-acc-delete { flex: 0 0 auto; align-self: flex-start; }
html:root body.admin-body .tm-acc-badges { display: flex; align-items: center; gap: 8px; }
html:root body.admin-body .tm-account-self { color: var(--a-muted); font: 600 12.5px/1 var(--a-font); }
html:root body.admin-body .tm-acc-foot { display: grid; gap: 8px; margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--a-line); }
html:root body.admin-body .tm-acc-foot.is-static { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--a-muted); font: 600 13px/1.4 var(--a-font); }
html:root body.admin-body .tm-acc-foot.is-static i { color: var(--a-accent); }
html:root body.admin-body .tm-acc-foot-label { display: inline-flex; align-items: center; gap: 8px; color: var(--a-muted) !important; font: 600 12.5px/1.3 var(--a-font) !important; }
html:root body.admin-body .tm-acc-foot-label i { color: var(--a-accent); }
html:root body.admin-body .tm-account-select { width: 100%; min-height: 42px !important; padding: 6px 12px !important; font-size: 14px !important; }
html:root body.admin-body .tm-password { position: relative; }
html:root body.admin-body .tm-password input { padding-inline-end: 48px !important; }
html[dir="rtl"]:root body.admin-body .tm-password input { padding-inline: 48px 14px !important; }
html:root body.admin-body .tm-password .st-icon-btn { position: absolute; top: 50%; inset-inline-end: 6px; transform: translateY(-50%); }
html[dir="rtl"]:root body.admin-body .tm-password .st-icon-btn { inset-inline-end: auto; left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  html[dir="rtl"]:root body.admin-body .admin-layout { flex-direction: column; }
  html:root body.admin-body .admin-sidebar {
    flex-basis: auto !important; width: 100% !important; min-width: 0 !important; min-height: 0 !important;
    padding: 12px 16px !important; gap: 10px 12px !important; border: 0 !important; border-bottom: 1px solid var(--a-rail-line) !important;
  }
  html:root body.admin-body .admin-sidebar .brand { padding: 0; border: 0; gap: 4px !important; }
  html:root body.admin-body .admin-logo { width: 116px; }
  html:root body.admin-body .admin-brand-tag { display: none; }
  html:root body.admin-body .admin-sidebar nav { border: 1px solid var(--a-rail-line) !important; border-radius: 0 !important; background: #1d1a15 !important; box-shadow: none !important; }
  html:root body.admin-body .admin-sidebar nav button#logoutBtn { margin-top: 6px; }
  html:root body.admin-body .admin-main { padding: 22px 16px 70px !important; }
  html:root body.admin-body .admin-top h1 { font-size: clamp(28px, 8vw, 36px) !important; }
  html:root body.admin-body .access-code-context { margin-inline-end: 0; }
  html:root body.admin-body .st-pair { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .st-toolbar { align-items: stretch; }
  html:root body.admin-body .st-search { max-width: none; }
  html:root body.admin-body .st-filters { width: 100%; }
  html:root body.admin-body .st-filter { flex: 1 1 auto; justify-content: center; padding: 0 8px; }
  html:root body.admin-body .st-grid { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .st-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  html:root body.admin-body .st-editor-actions { width: 100%; }
  html:root body.admin-body .st-editor-actions > * { flex: 1 1 0; }
  html:root body.admin-body .st-editor-actions .button { width: 100%; }
  html:root body.admin-body .st-tab { flex: 1; justify-content: center; }
  html:root body.admin-body .tm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  html:root body.admin-body .tm-card .st-card-body { padding: 12px 12px 12px; }
  html:root body.admin-body .tm-card .st-card-title { font-size: 16px !important; }
  html:root body.admin-body .tm-card .st-card-meta { flex-wrap: wrap; }
  html:root body.admin-body .tm-profile-grid { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .tm-portrait-card { grid-template-columns: 120px minmax(0, 1fr); align-items: start; }
  html:root body.admin-body .tm-portrait-card .st-section-head { grid-column: 1 / -1; }
  html:root body.admin-body .tm-portrait-card > :not(.st-section-head, .tm-portrait-frame) { grid-column: 2; }
  html:root body.admin-body .tm-portrait-frame { grid-row: span 4; }
  html:root body.admin-body .tm-account-fields { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .tm-accounts-head .button { width: 100%; }
  html:root body.admin-body #memberForm .st-slug-prefix { padding-inline-start: 10px; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  html:root body.admin-body * { transition: none !important; }
}

/* ---------- Deliveries (list + editor) ---------- */
html:root body.admin-body :is(.dl-banner, .dl-custom-date, #contentArea, #editorActions, .dl-sweep-btn)[hidden] { display: none !important; }
html:root body.admin-body .dl-pill-active { background: var(--a-success); color: #fff; }
html:root body.admin-body .dl-pill-soon { background: var(--a-accent); color: #fff; }
html:root body.admin-body .dl-pill-expired { background: var(--a-panel); border-color: var(--a-line); border-style: dashed; color: var(--a-muted); }
html:root body.admin-body .dl-pill-trashed { background: transparent; border-color: color-mix(in srgb, var(--a-danger) 55%, transparent); color: var(--a-danger); }
html:root body.admin-body .dl-sweep-btn { margin-inline-start: auto; min-height: 46px !important; }
html:root body.admin-body .dl-list-status { min-height: 1.6em; margin: 0 0 12px; }

html:root body.admin-body .dl-list { display: grid; gap: 12px; }
html:root body.admin-body .dl-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; align-items: center; gap: 16px 22px;
  padding: 14px; border: 1px solid var(--a-line); background: var(--a-panel); transition: border-color .25s ease;
}
html:root body.admin-body .dl-row:hover, html:root body.admin-body .dl-row:focus-within { border-color: color-mix(in srgb, var(--a-accent) 60%, var(--a-line)); }
html:root body.admin-body .dl-row:is(.is-expired, .is-purged, .is-trashed) .dl-row-media img { filter: grayscale(.8); opacity: .75; }
html:root body.admin-body .dl-row-media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: color-mix(in srgb, var(--a-ink) 6%, var(--a-bg)); }
html:root body.admin-body .dl-row-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
html:root body.admin-body .dl-row-main { display: grid; gap: 4px; min-width: 0; }
html:root body.admin-body .dl-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
html:root body.admin-body .dl-row-title { margin: 0 !important; padding: 0 !important; border: 0 !important; color: var(--a-ink); font: 800 18px/1.4 var(--a-ar-display) !important; }
html[dir="ltr"]:root body.admin-body .dl-row-title { font: 600 23px/1.2 var(--a-en-display) !important; }
html:root body.admin-body .dl-row-title a { color: inherit; text-decoration: none; }
html:root body.admin-body .dl-row-title a:hover { color: var(--a-accent); }
html:root body.admin-body .dl-row-sub { margin: 0; color: var(--a-muted); font: 500 13.5px/1.5 var(--a-font); }
html:root body.admin-body .dl-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 4px; color: var(--a-muted); font: 500 13px/1.5 var(--a-font); }
html:root body.admin-body .dl-row-size { display: inline-flex; align-items: center; gap: 6px; color: var(--a-ink); }
html:root body.admin-body .dl-row-size i { color: var(--a-accent); }
html:root body.admin-body .dl-row-expiry { color: var(--a-ink); font-weight: 600; }
html:root body.admin-body .dl-row.is-soon .dl-row-expiry { color: var(--a-accent); }
html:root body.admin-body .dl-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 600px; }
html:root body.admin-body .dl-action { min-height: 38px !important; padding: 0 12px !important; font-size: 13px !important; gap: 7px !important; white-space: nowrap; }
html[dir="ltr"]:root body.admin-body .dl-action { font-size: 11px !important; }
html:root body.admin-body .dl-action .fa-whatsapp { color: #25d366 !important; }

/* extend menu */
html:root body.admin-body .dl-menu { position: relative; }
html:root body.admin-body .dl-menu > summary { list-style: none; cursor: pointer; }
html:root body.admin-body .dl-menu > summary::-webkit-details-marker { display: none; }
html:root body.admin-body .dl-menu[open] > summary { border-color: var(--a-ink) !important; }
html:root body.admin-body .dl-menu-pop {
  position: absolute; z-index: 20; top: calc(100% + 4px); inset-inline-end: 0; display: grid; min-width: 140px;
  border: 1px solid var(--a-ink); background: var(--a-bg); box-shadow: 0 18px 40px -22px rgba(20, 14, 8, .55);
}
html:root body.admin-body .dl-menu-item { padding: 11px 16px; border: 0; border-bottom: 1px solid var(--a-line); background: none; color: var(--a-ink); font: 700 14px/1 var(--a-font) !important; text-align: start; cursor: pointer; }
html:root body.admin-body .dl-menu-item:last-child { border-bottom: 0; }
html:root body.admin-body .dl-menu-item:hover, html:root body.admin-body .dl-menu-item:focus-visible { background: var(--a-ink); color: var(--a-bg); }

/* editor */
html:root body.admin-body .dl-editor-pills { align-items: center; }
html:root body.admin-body .dl-expiry-text { color: var(--a-muted); font: 600 13.5px/1.4 var(--a-font); }
html:root body.admin-body .dl-banner {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 20px; margin: 0 0 clamp(16px, 2vw, 24px);
  padding: 18px clamp(18px, 2.4vw, 28px); border: 1px solid var(--a-ink); border-inline-start: 3px solid var(--a-accent); border-radius: 0 !important; box-shadow: none !important; background: var(--a-soft);
}
html:root body.admin-body .dl-banner-link { display: grid; flex: 1 1 340px; gap: 8px; min-width: 0; }
html:root body.admin-body .dl-banner-link label { color: var(--a-muted); font: 700 12.5px/1 var(--a-font); }
html[dir="ltr"]:root body.admin-body .dl-banner-link label { font: 500 11px/1 var(--a-mono); letter-spacing: .14em; text-transform: uppercase; }
html:root body.admin-body .dl-banner-link input { width: 100%; padding: 12px 14px; font: 500 14px/1.3 var(--a-mono) !important; background: var(--a-bg); }
html:root body.admin-body .dl-banner-actions { display: flex; flex-wrap: wrap; gap: 8px; }
html:root body.admin-body .dl-banner-actions .button { min-height: 46px !important; }
html:root body.admin-body .dl-banner-actions .fa-whatsapp { color: #25d366 !important; }
html:root body.admin-body .dl-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
html:root body.admin-body .dl-fieldset:disabled :is(input, textarea, select, label) { opacity: .7; cursor: not-allowed; }
html:root body.admin-body #deliveryForm .st-section { margin-bottom: clamp(16px, 2vw, 24px); }
html:root body.admin-body #deliveryForm .st-section + .st-section { margin-top: 0; }

html:root body.admin-body .dl-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--a-line); background: var(--a-bg); width: fit-content; max-width: 100%; }
html:root body.admin-body .dl-seg-option { position: relative; display: block !important; margin: 0 !important; cursor: pointer; }
html:root body.admin-body .dl-seg-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
html:root body.admin-body .dl-seg-option span {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 16px; border-inline-start: 1px solid var(--a-line);
  color: var(--a-muted); font: 700 14px/1 var(--a-font); transition: background-color .2s ease, color .2s ease;
}
html:root body.admin-body .dl-seg-option:first-child span { border-inline-start: 0; }
html:root body.admin-body .dl-seg-option:hover span { color: var(--a-ink); }
html:root body.admin-body .dl-seg-option input:checked + span { background: var(--a-ink); color: var(--a-bg); }
html:root body.admin-body .dl-seg-option input:focus-visible + span { outline: 2px solid var(--a-accent); outline-offset: -2px; }
html:root body.admin-body .dl-custom-date { max-width: 280px; margin: 16px 0 0; }
html:root body.admin-body #deliveryForm [data-error-for="expiresAt"] { margin-top: 12px; }
html:root body.admin-body .dl-expiry-preview { margin: 14px 0 0; color: var(--a-ink); font: 600 14px/1.5 var(--a-font); }
html:root body.admin-body .dl-expiry-preview:empty { display: none; }

html:root body.admin-body #contentArea > .st-section + .st-section { margin-top: clamp(16px, 2vw, 24px); }
html:root body.admin-body .dl-sections { display: grid; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
html:root body.admin-body .dl-sections:empty { display: none; }
html:root body.admin-body .dl-section { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto 36px; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--a-line); background: var(--a-bg); }
html:root body:not([data-role="owner"]).admin-body .dl-section { grid-template-columns: 36px minmax(0, 1fr) auto; }
html:root body.admin-body .dl-section input { min-height: 40px !important; padding: 6px 12px !important; }
html:root body.admin-body .dl-section-handle { cursor: grab; touch-action: none; }
html:root body.admin-body .dl-section-count { display: inline-flex; align-items: center; gap: 6px; padding-inline: 6px; color: var(--a-ink); font-size: 13px; }
html:root body.admin-body .dl-section-count i { color: var(--a-accent); }
html:root body.admin-body .dl-add-section { display: flex; flex-wrap: wrap; gap: 8px; }
html:root body.admin-body .dl-add-section input { flex: 1 1 240px; min-height: 46px; padding: 10px 14px; }
html:root body.admin-body .dl-add-section .button { min-height: 46px !important; }
html:root body.admin-body #sectionsStatus { margin: 10px 0 0; }
html:root body.admin-body #sectionsStatus:empty, html:root body.admin-body #uploadStatus:empty { display: none; }
html:root body.admin-body .dl-upload-target { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 12px; }
html:root body.admin-body .dl-upload-target label { color: var(--a-ink); font: 700 14px/1 var(--a-font); }
html:root body.admin-body .dl-upload-target select { min-width: 220px; min-height: 44px; padding: 8px 12px; }
html:root body.admin-body #uploadStatus { margin: 10px 0 0; }
html:root body.admin-body .dl-cover-hint { margin-top: 22px !important; }
html:root body.admin-body .dl-file-group + .dl-file-group { margin-top: 26px; }
html:root body.admin-body .dl-file-group-title { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px !important; padding: 0 0 10px !important; border: 0 !important; border-bottom: 1px solid var(--a-line) !important; color: var(--a-ink); font: 800 16px/1.4 var(--a-display) !important; }
html:root body.admin-body .dl-file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
html:root body.admin-body .dl-file-media { aspect-ratio: 4 / 3; }
html:root body.admin-body .dl-file-video { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: #16140f; color: #f2efe9; font: 700 13px/1 var(--a-font); }
html:root body.admin-body .dl-file-video i { color: var(--a-accent); font-size: 26px; }
html:root body.admin-body .dl-file-name { margin: 0; padding: 8px 10px 0; overflow: hidden; color: var(--a-ink); font: 500 12px/1.4 var(--a-mono); text-overflow: ellipsis; white-space: nowrap; }
html:root body.admin-body .dl-file-size { margin-inline-end: auto; padding-inline: 6px; color: var(--a-muted); font-size: 12px; }

@media (max-width: 980px) {
  html:root body.admin-body .dl-row { grid-template-columns: 96px minmax(0, 1fr); }
  html:root body.admin-body .dl-row-actions { grid-column: 1 / -1; justify-content: flex-start; max-width: none; }
}
@media (max-width: 768px) {
  html:root body.admin-body .dl-sweep-btn { margin-inline-start: 0; width: 100%; }
  html:root body.admin-body .dl-row { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; }
  html:root body.admin-body .dl-row-title { font-size: 16px !important; }
  html:root body.admin-body .dl-row-actions .dl-action { flex: 1 1 auto; }
  html:root body.admin-body .dl-menu { flex: 1 1 auto; }
  html:root body.admin-body .dl-menu > summary { width: 100%; }
  html:root body.admin-body .dl-banner-actions, html:root body.admin-body .dl-banner-actions .button { width: 100%; }
  html:root body.admin-body .dl-seg { width: 100%; }
  html:root body.admin-body .dl-seg-option { flex: 1 1 30%; }
  html:root body.admin-body .dl-seg-option span { justify-content: center; width: 100%; padding: 0 8px; border-bottom: 1px solid var(--a-line); }
  html:root body.admin-body .dl-file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:root body.admin-body .dl-upload-target select { flex: 1 1 100%; }
}

/* ---------- Bookings ---------- */
html:root body.admin-body .bk-list { display: grid; gap: 12px; }
html:root body.admin-body .bk-row {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 14px 22px;
  padding: 14px; border: 1px solid var(--a-line); background: var(--a-panel); transition: border-color .25s ease;
}
html:root body.admin-body .bk-row:hover, html:root body.admin-body .bk-row:focus-within { border-color: color-mix(in srgb, var(--a-accent) 60%, var(--a-line)); }
html:root body.admin-body .bk-row.is-past { opacity: .72; }
html:root body.admin-body .bk-row.is-cancelled .dl-row-title { text-decoration: line-through; text-decoration-color: var(--a-muted); }
html:root body.admin-body .bk-date { display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 76px; border: 1px solid var(--a-line); background: var(--a-bg); }
html:root body.admin-body .bk-date strong { color: var(--a-ink); font: 800 26px/1 var(--a-ar-display); }
html:root body.admin-body .bk-date span { color: var(--a-muted); font: 600 11.5px/1.2 var(--a-font); text-align: center; }
html:root body.admin-body .bk-main { display: grid; gap: 4px; min-width: 0; }
html:root body.admin-body .bk-phone { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 4px 0 0; color: var(--a-muted); font-size: 13px; }
html:root body.admin-body .bk-phone i { color: var(--a-accent); }
html:root body.admin-body .bk-total { color: var(--a-ink); }
html:root body.admin-body .bk-status-new { background: var(--a-accent); color: #fff; }
html:root body.admin-body .bk-status-confirmed { background: var(--a-success); color: #fff; }
html:root body.admin-body .bk-status-cancelled { background: var(--a-panel); border-color: var(--a-line); border-style: dashed; color: var(--a-muted); }
html:root body.admin-body .bk-cal { background: transparent; border-color: var(--a-line); color: var(--a-muted); }
html:root body.admin-body .bk-cal-synced { border-color: color-mix(in srgb, var(--a-success) 50%, transparent); color: var(--a-success); }
html:root body.admin-body .bk-cal-failed { border-color: color-mix(in srgb, var(--a-danger) 55%, transparent); color: var(--a-danger); }
html:root body.admin-body .st-filter i { color: var(--a-accent); }

/* drawer */
html:root body.admin-body dialog.bk-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(520px, 100vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
  padding: 0; border: 0; border-inline-start: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink); overflow: auto;
}
html[dir="rtl"]:root body.admin-body dialog.bk-drawer { inset: 0 auto 0 0; }
html:root body.admin-body dialog.bk-drawer::backdrop { background: rgba(14, 12, 10, .55); }
html:root body.admin-body .bk-drawer-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--a-line); background: var(--a-bg);
}
html:root body.admin-body .bk-drawer-head h2 { margin: 4px 0 0 !important; padding: 0 !important; border: 0 !important; font: 800 22px/1.35 var(--a-ar-display) !important; color: var(--a-ink); }
html[dir="ltr"]:root body.admin-body .bk-drawer-head h2 { font: 600 27px/1.15 var(--a-en-display) !important; }
html:root body.admin-body .bk-drawer-body { display: grid; gap: 0; padding: 4px 24px 32px; }
html:root body.admin-body .bk-block { padding: 18px 0; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .bk-block:last-child { border-bottom: 0; }
html:root body.admin-body .bk-block h3 { margin: 0 0 12px !important; padding: 0 !important; border: 0 !important; color: var(--a-muted); font: 700 12.5px/1 var(--a-font) !important; }
html[dir="ltr"]:root body.admin-body .bk-block h3 { font: 500 11px/1 var(--a-mono) !important; letter-spacing: .14em; text-transform: uppercase; }
html:root body.admin-body .bk-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
html:root body.admin-body .bk-control { display: grid !important; align-content: start; gap: 8px; margin: 0 !important; }
html:root body.admin-body .bk-control > span:first-child { color: var(--a-muted); font: 700 12.5px/1 var(--a-font); }
html:root body.admin-body .bk-control select { width: 100%; min-height: 44px; padding: 8px 12px; }
html:root body.admin-body .bk-cal-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 44px; }
html:root body.admin-body .bk-cal-error { margin: 0 0 4px !important; font-size: 12.5px !important; }
html:root body.admin-body .bk-phone-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 8px; }
html:root body.admin-body .bk-phone-line > .st-num { flex: 1 1 auto; color: var(--a-ink); font-size: 16px; }
html:root body.admin-body .bk-fields { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 8px 18px; margin: 0; }
html:root body.admin-body .bk-field { display: contents; }
html:root body.admin-body .bk-field dt { color: var(--a-muted); font: 600 13px/1.5 var(--a-font); }
html:root body.admin-body .bk-field dd { margin: 0; color: var(--a-ink); font: 600 14px/1.5 var(--a-font); overflow-wrap: anywhere; }
html:root body.admin-body .bk-field dd[dir="ltr"] { font-family: var(--a-mono); font-size: 13px; text-align: start; }
html[dir="rtl"]:root body.admin-body .bk-field dd[dir="ltr"] { text-align: right; }
html:root body.admin-body .bk-notes { margin: 0; white-space: pre-wrap; color: var(--a-ink); font: 500 14px/1.7 var(--a-font); }

/* ---------- Booking links ---------- */
html:root body.admin-body .bk-tabs { margin-top: 4px; }
html:root body.admin-body #panelBookings[hidden], html:root body.admin-body #panelLinks[hidden], html:root body.admin-body .bl-result[hidden], html:root body.admin-body #linkForm[hidden], html:root body.admin-body .bl-date-warning[hidden] { display: none !important; }
html:root body.admin-body .bl-pill { background: transparent; border-color: var(--a-line); color: var(--a-muted); }
html:root body.admin-body .bl-open { background: var(--a-accent); border-color: var(--a-accent); color: #fff; }
html:root body.admin-body .bl-used { background: var(--a-success); border-color: var(--a-success); color: #fff; }
html:root body.admin-body .bl-revoked { border-style: dashed; }
html:root body.admin-body .bl-row.is-expired, html:root body.admin-body .bl-row.is-revoked { opacity: .72; }
html:root body.admin-body .bl-meta { color: var(--a-muted); }
html:root body.admin-body .bl-row.is-open .bl-meta { color: var(--a-accent); font-weight: 700; }
html:root body.admin-body .bl-del { min-width: 38px; justify-content: center; }
html:root body.admin-body .bl-del:hover { color: var(--a-danger) !important; border-color: var(--a-danger) !important; }
html:root body.admin-body dialog.bl-dialog { width: min(600px, 100vw); }
html:root body.admin-body .bl-dialog .bk-block { padding: 16px 0; }
html:root body.admin-body .bl-dialog .st-field { margin-bottom: 14px; }
html:root body.admin-body .bl-dialog .st-field:last-child { margin-bottom: 0; }
html:root body.admin-body .bl-hint { margin: 0 0 14px !important; font-size: 13px !important; }
html:root body.admin-body #linkExpiryNote { margin: 12px 0 0 !important; }
html:root body.admin-body .bl-date-warning { margin: 0; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--a-accent) 45%, transparent); border-inline-start-width: 3px; background: color-mix(in srgb, var(--a-accent) 8%, transparent); color: var(--a-ink); font: 600 13px/1.6 var(--a-font); }
html:root body.admin-body .bl-remaining { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--a-line); background: var(--a-panel); }
html:root body.admin-body .bl-remaining span { color: var(--a-muted); font: 700 13.5px/1.3 var(--a-font); }
html:root body.admin-body .bl-remaining strong { color: var(--a-ink); font: 600 20px/1 var(--a-mono); }
html:root body.admin-body .bl-remaining strong.is-negative { color: var(--a-danger); }
html:root body.admin-body .bl-form-actions { position: sticky; bottom: 0; display: flex; gap: 10px; margin: 8px -24px -32px; padding: 16px 24px 20px; border-top: 1px solid var(--a-line); background: var(--a-bg); }
html:root body.admin-body .bl-form-actions .button { min-height: 48px !important; }
html:root body.admin-body .bl-form-actions .button.primary { flex: 1 1 auto; }
html:root body.admin-body #linkFormStatus { margin: 8px 0 0; }
html:root body.admin-body #linkFormStatus:empty { display: none; }
html:root body.admin-body .bl-result { display: grid; gap: 16px; padding: 28px 0 8px; text-align: center; }
html:root body.admin-body .bl-result-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: color-mix(in srgb, var(--a-success) 16%, transparent); color: var(--a-success); font-size: 26px; }
html:root body.admin-body .bl-result-title { margin: 0 !important; padding: 0 !important; border: 0 !important; color: var(--a-ink) !important; font: 800 22px/1.3 var(--a-ar-display) !important; letter-spacing: 0 !important; text-transform: none !important; }
html:root body.admin-body .bl-result .st-muted { margin: 0 auto; max-width: 42ch; line-height: 1.8; }
html:root body.admin-body .bl-result .dl-banner-link { text-align: start; }
html:root body.admin-body .bl-result-actions { justify-content: center; }
html:root body.admin-body .bl-result-actions .button { flex: 1 1 auto; }
html:root body.admin-body .bl-result-actions .button.primary .fa-whatsapp { color: #fff !important; }
html:root body.admin-body .bl-result-done { justify-self: center; min-width: 140px; }
@media (max-width: 768px) {
  html:root body.admin-body .bl-form-actions { margin-inline: -16px; padding-inline: 16px; }
  html:root body.admin-body .admin-top .st-editor-actions, html:root body.admin-body #newLinkBtn { width: 100%; }
  html:root body.admin-body .bk-tabs .st-tab { flex: 1 1 50%; justify-content: center; padding: 0 10px; }
}

/* ---------- Overview ---------- */
html:root body.admin-body .ov-actions { display: flex; flex-wrap: wrap; gap: 10px; }
html:root body.admin-body .ov-counters, html:root body.admin-body .sg-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 18px); margin-bottom: clamp(16px, 2vw, 24px); }
html:root body.admin-body .sg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: clamp(16px, 2vw, 24px); }
html:root body.admin-body .ov-counter {
  display: grid; gap: 14px; padding: 20px 22px; border: 1px solid var(--a-line); background: var(--a-panel); color: var(--a-ink); text-decoration: none;
  transition: border-color .25s ease;
}
html:root body.admin-body a.ov-counter:hover { border-color: var(--a-accent); }
html:root body.admin-body .ov-counter-label { color: var(--a-muted); font: 700 13px/1.3 var(--a-font); }
html[dir="ltr"]:root body.admin-body .ov-counter-label { font: 500 11px/1.3 var(--a-mono); letter-spacing: .14em; text-transform: uppercase; }
html:root body.admin-body .ov-counter strong { color: var(--a-ink); font-size: clamp(28px, 3vw, 38px) !important; font-weight: 500; line-height: 1; }
html:root body.admin-body #overviewStatus:empty { display: none; }
html:root body.admin-body .ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); align-items: start; }
html:root body.admin-body .ov-grid > .st-section { margin: 0 !important; }
html:root body.admin-body .ov-grid .st-section-head .st-back { font-size: 12.5px; }
html:root body.admin-body .ov-list { display: grid; margin: 0; padding: 0; list-style: none; }
html:root body.admin-body .ov-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .ov-item:last-child { border-bottom: 0; }
html:root body.admin-body .ov-item a { flex: 1 1 auto; min-width: 0; color: var(--a-ink); font: 700 15px/1.4 var(--a-font); text-decoration: none; }
html:root body.admin-body .ov-item a:hover { color: var(--a-accent); }
html:root body.admin-body .ov-item-meta { color: var(--a-muted); font: 500 13px/1.4 var(--a-font); }
html:root body.admin-body .ov-item-meta.is-soon { color: var(--a-accent); font-weight: 700; }
html:root body.admin-body .ov-empty { margin: 0; color: var(--a-muted); font: 500 14px/1.6 var(--a-font); }
html:root body.admin-body .ov-empty[hidden] { display: none; }

/* ---------- Storage ---------- */
html:root body.admin-body .sg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; }
html:root body.admin-body .sg-head > div { display: grid; gap: 10px; }
html:root body.admin-body .sg-used { color: var(--a-ink); font-size: clamp(38px, 4.4vw, 56px) !important; font-weight: 500; line-height: 1; }
html:root body.admin-body .sg-cost strong { color: var(--a-accent); font-size: 26px !important; line-height: 1; }
html:root body.admin-body .sg-bar { position: relative; height: 18px; margin: 0 0 40px; border: 1px solid var(--a-line); background: var(--a-bg); }
html:root body.admin-body .sg-fill { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--a-ink); transition: width .6s ease; }
html:root body.admin-body .sg-fill.is-over { background: var(--a-accent); }
html:root body.admin-body .sg-marker { position: absolute; top: -8px; bottom: -8px; width: 2px; margin-inline-start: -1px; background: var(--a-accent); }
html:root body.admin-body .sg-marker-label { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; transform: translateX(50%); color: var(--a-accent); font: 700 12px/1 var(--a-font); white-space: nowrap; }
html[dir="ltr"]:root body.admin-body .sg-marker-label { transform: translateX(-50%); }
html:root body.admin-body .sg-note { margin: 0 !important; }
html:root body.admin-body #storageStatus:empty { display: none; }

/* ---------- Trash ---------- */
html:root body.admin-body .tr-days { color: var(--a-ink); }
html:root body.admin-body .tr-days.is-urgent { color: var(--a-danger); }

@media (max-width: 980px) {
  html:root body.admin-body .bk-row { grid-template-columns: 72px minmax(0, 1fr); }
  html:root body.admin-body .bk-row .dl-row-actions { grid-column: 1 / -1; justify-content: flex-start; }
  html:root body.admin-body .ov-counters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:root body.admin-body .ov-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 768px) {
  html:root body.admin-body .bk-row { gap: 12px; padding: 12px; }
  html:root body.admin-body .bk-row .dl-action { flex: 1 1 auto; }
  html:root body.admin-body .bk-controls { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .bk-drawer-head, html:root body.admin-body .bk-drawer-body { padding-inline: 16px; }
  html:root body.admin-body .ov-actions, html:root body.admin-body .ov-actions .button { width: 100%; }
  html:root body.admin-body .sg-stats { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .ov-counter { padding: 16px; }
}
html[dir="rtl"]:root body.admin-body :is(.ov-counter, .sg-head) strong[dir="ltr"] { text-align: right; }

/* ---------- Upload rows updated in place (upload-panel.js): text / % / retry / cancel toggle via [hidden] ---------- */
html:root body.admin-body .st-upload-status > [hidden] { display: none !important; }
html:root body.admin-body .st-upload-cancel { color: var(--a-muted); }
html:root body.admin-body .st-upload-collapsed .st-upload-name { color: var(--a-muted); font-family: var(--a-font); }
html:root body.admin-body .dl-file-heic { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: var(--a-panel); color: var(--a-muted); font: 700 13px/1.3 var(--a-font); text-align: center; padding: 8px; }
html:root body.admin-body .dl-file-heic i { color: var(--a-accent); font-size: 24px; }

/* ---------- Overview: three equal panels ---------- */
html:root body.admin-body .ov-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; }
html:root body.admin-body .ov-panel { display: flex; flex-direction: column; min-width: 0; margin: 0 !important; padding: 0 !important; }
html:root body.admin-body .ov-panel-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 22px 18px; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .ov-panel-icon { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--a-line); color: var(--a-accent); background: var(--a-bg); font-size: 15px; }
html:root body.admin-body .ov-panel-head h2 { margin: 0 0 4px !important; color: var(--a-ink); font: 800 19px/1.3 var(--a-font) !important; }
html[dir="ltr"]:root body.admin-body .ov-panel-head h2 { font: 600 22px/1.2 var(--a-display) !important; }
html:root body.admin-body .ov-panel-head p { margin: 0; color: var(--a-muted); font: 500 13px/1.5 var(--a-font); }
html:root body.admin-body .ov-panel .ov-list { flex: 1; display: block; padding: 6px 22px; }
html:root body.admin-body .ov-row { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 10px 0; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .ov-row:last-child { border-bottom: 0; }
html:root body.admin-body .ov-row-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
html:root body.admin-body .ov-row-main a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-ink); font: 700 15px/1.4 var(--a-font); text-decoration: none; }
html:root body.admin-body .ov-row-main a:hover { color: var(--a-accent); }
html:root body.admin-body .ov-row-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--a-muted); font: 500 12.5px/1.4 var(--a-font); }
html:root body.admin-body .ov-row-main small[dir="ltr"] { font-family: var(--a-mono); font-size: 11.5px; text-align: start; }
html:root body.admin-body .ov-date { flex: 0 0 48px; height: 52px; display: grid; place-content: center; text-align: center; border: 1px solid var(--a-line); background: var(--a-bg); }
html:root body.admin-body .ov-date b { color: var(--a-ink); font: 600 19px/1 var(--a-mono); }
html:root body.admin-body .ov-date small { margin-top: 4px; color: var(--a-accent); font: 700 11px/1 var(--a-font); }
html:root body.admin-body .ov-badge { flex: 0 0 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--a-line); color: var(--a-muted); }
html:root body.admin-body .ov-row.is-soon .ov-badge { border-color: var(--a-accent); color: var(--a-accent); background: color-mix(in srgb, var(--a-accent) 10%, transparent); }
html:root body.admin-body .ov-expiry { flex: 0 1 auto; max-width: 44%; color: var(--a-muted); font: 600 12px/1.4 var(--a-font); text-align: end; }
html:root body.admin-body .ov-expiry.is-soon { color: var(--a-accent); }
html:root body.admin-body .ov-thumb { flex: 0 0 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-muted); }
html:root body.admin-body .ov-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
html:root body.admin-body .ov-panel .ov-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 200px; padding: 24px; text-align: center; }
html:root body.admin-body .ov-panel .ov-empty[hidden] { display: none; }
html:root body.admin-body .ov-panel .ov-empty i { width: 54px; height: 54px; display: grid; place-items: center; border: 1px dashed var(--a-line); color: var(--a-muted); font-size: 18px; }
html:root body.admin-body .ov-panel-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding: 15px 22px; border-top: 1px solid var(--a-line); color: var(--a-ink); font: 700 13.5px/1 var(--a-font); text-decoration: none; transition: background .2s, color .2s; }
html:root body.admin-body .ov-panel-more:hover { background: var(--a-bg); color: var(--a-accent); }
html:root body.admin-body .ov-panel-more i { font-size: 12px; transition: transform .3s; }
html[dir="ltr"]:root body.admin-body .ov-panel-more i { transform: scaleX(-1); }
html[dir="rtl"]:root body.admin-body .ov-panel-more:hover i { transform: translateX(-4px); }
html[dir="ltr"]:root body.admin-body .ov-panel-more:hover i { transform: scaleX(-1) translateX(-4px); }
@media (max-width: 1180px) { html:root body.admin-body .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } html:root body.admin-body .ov-grid > .ov-panel:last-child { grid-column: 1 / -1; } }
@media (max-width: 768px) { html:root body.admin-body .ov-grid { grid-template-columns: minmax(0, 1fr); } html:root body.admin-body .ov-grid > .ov-panel:last-child { grid-column: auto; } }

/* Select chevron spacing — out-ranks the per-control padding rules above */
html:root body.admin-body select:not([multiple]):not([size]) { padding-inline-end: 44px !important; background-position: right 16px center !important; }
html[dir="rtl"]:root body.admin-body select:not([multiple]):not([size]) { background-position: left 16px center !important; }
html:root body.admin-body select:not([multiple]):not([size]) {
  -webkit-appearance: none !important; appearance: none !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23aa753e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-size: 12px 8px !important;
}

/* Team editor: the portrait card fills the column height; visibility sits at its foot */
html:root body.admin-body .tm-portrait-card { display: flex !important; flex-direction: column; }
html:root body.admin-body .tm-portrait-card .tm-portrait-frame { flex: 1 1 auto; aspect-ratio: auto; min-height: 340px; }
@media (max-width: 960px) { html:root body.admin-body .tm-portrait-card .tm-portrait-frame { flex: 0 0 auto; aspect-ratio: 4 / 5; min-height: 0; } }
html:root body.admin-body .tm-portrait-drop { min-height: 0 !important; padding: 16px !important; }
html:root body.admin-body .tm-portrait-visibility { padding-top: 18px; border-top: 1px solid var(--a-line); }
html:root body.admin-body .tm-portrait-visibility[hidden] { display: none !important; }
html:root body.admin-body .tm-portrait-visibility .st-switch strong { font-size: 14.5px; }
html:root body.admin-body .tm-portrait-visibility .st-switch small { font-size: 12.5px !important; }
@media (max-width: 960px) { html:root body.admin-body .tm-portrait-visibility { margin-top: 6px; } }

/* Deliveries list: filters + clean-up grouped on the left; whole row opens the delivery */
html:root body.admin-body .dl-toolbar-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-inline-start: auto; }
html:root body.admin-body .dl-toolbar-end .st-filters { margin: 0 !important; }
html:root body.admin-body .dl-toolbar-end .dl-sweep-btn { margin: 0 !important; }
html:root body.admin-body .dl-row { position: relative; cursor: pointer; }
html:root body.admin-body .dl-row-title a { color: inherit; text-decoration: none; }
html:root body.admin-body .dl-row > .dl-row-main .dl-row-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
html:root body.admin-body .dl-row-actions, html:root body.admin-body .dl-row-media { position: relative; z-index: 2; }
html:root body.admin-body .dl-row:hover .dl-row-title { color: var(--a-accent); }
@media (max-width: 768px) { html:root body.admin-body .dl-toolbar-end { width: 100%; margin: 0; } html:root body.admin-body .dl-toolbar-end .st-filters { flex: 1; } }
html:root body.admin-body .dl-new-hint { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px 16px; border: 1px dashed color-mix(in srgb, var(--a-accent) 55%, var(--a-line)); background: color-mix(in srgb, var(--a-accent) 6%, transparent); color: var(--a-ink); font: 600 13.5px/1.5 var(--a-font); }
html:root body.admin-body .dl-new-hint i { color: var(--a-accent); }
html:root body.admin-body .dl-new-hint[hidden] { display: none !important; }

/* ---------- Upload panel (stories, team, deliveries) ---------- */
html:root body.admin-body .st-uploads { margin-top: 16px; padding: 0 !important; border: 1px solid var(--a-line); background: var(--a-panel); }
html:root body.admin-body .st-uploads-head { display: flex; align-items: center; gap: 14px; margin: 0 !important; padding: 16px 18px; }
html:root body.admin-body .st-uploads-icon { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-accent); font-size: 16px; }
html:root body.admin-body .st-uploads[data-state="busy"] .st-uploads-icon i { animation: st-up-bob 1.4s ease-in-out infinite; }
html:root body.admin-body .st-uploads[data-state="done"] .st-uploads-icon { border-color: var(--a-success); background: var(--a-success); color: #fff; }
html:root body.admin-body .st-uploads[data-state="error"] .st-uploads-icon { border-color: var(--a-danger); color: var(--a-danger); }
@keyframes st-up-bob { 0%, 100% { transform: translateY(1px); } 50% { transform: translateY(-3px); } }
html:root body.admin-body .st-uploads-title { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
html:root body.admin-body .st-uploads-title strong { color: var(--a-ink); font: 800 15px/1.4 var(--a-display) !important; }
html:root body.admin-body .st-uploads-pct { color: var(--a-accent); font: 500 20px/1 var(--a-mono) !important; }
html:root body.admin-body .st-uploads[data-state="done"] .st-uploads-pct { color: var(--a-success); }
html:root body.admin-body .st-uploads-head .button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; min-height: 36px !important; padding: 0 14px !important; font-size: 13px !important; }
html:root body.admin-body .st-uploads .upload-summary-bar { display: block; height: 3px !important; margin: 0 !important; background: var(--a-line); }
html:root body.admin-body .st-uploads .upload-summary-bar span { display: block; height: 100%; background: var(--a-accent); transition: width .3s ease, background-color .3s ease; }
html:root body.admin-body .st-uploads[data-state="done"] .upload-summary-bar span { background: var(--a-success) !important; }
html:root body.admin-body .st-uploads[data-state="error"] .upload-summary-bar span { background: var(--a-danger) !important; }
html:root body.admin-body .st-upload-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 10px; max-height: 300px; overflow: auto; margin: 0; padding: 14px 18px 18px !important; list-style: none; }
html:root body.admin-body .st-upload { position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px 12px !important; border: 1px solid var(--a-line) !important; background: var(--a-bg); overflow: hidden; font: 500 13px/1.4 var(--a-font); }
html:root body.admin-body .st-upload-thumb { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--a-line); background: var(--a-panel); color: var(--a-muted); font-size: 14px; }
html:root body.admin-body .st-upload.is-uploading .st-upload-thumb { color: var(--a-accent); }
html:root body.admin-body .st-upload.is-done .st-upload-thumb { border-color: color-mix(in srgb, var(--a-success) 55%, var(--a-line)); color: var(--a-success); }
html:root body.admin-body .st-upload.is-error .st-upload-thumb { border-color: color-mix(in srgb, var(--a-danger) 55%, var(--a-line)); color: var(--a-danger); }
html:root body.admin-body .st-upload-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
html:root body.admin-body .st-upload-name { overflow: hidden; color: var(--a-ink); text-overflow: ellipsis; white-space: nowrap; font: 600 12.5px/1.4 var(--a-mono); }
html:root body.admin-body .st-upload-size { color: var(--a-muted); font: 400 11px/1.3 var(--a-mono); text-align: start; }
html[dir="rtl"]:root body.admin-body .st-upload-size { text-align: right; }
html:root body.admin-body .st-upload-status { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; font: 700 12px/1.3 var(--a-font); }
html:root body.admin-body .st-upload-pct { color: var(--a-accent); font: 500 12px/1 var(--a-mono) !important; }
html:root body.admin-body .st-upload.is-done .st-upload-text::before { content: "\f00c"; margin-inline-end: 6px; font: 900 10px/1 "Font Awesome 6 Free"; }
html:root body.admin-body .st-upload-bar { position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: transparent; }
html:root body.admin-body .st-upload-bar span { display: block; height: 100%; background: var(--a-accent); transition: width .2s ease; }
html:root body.admin-body .st-upload.is-done .st-upload-bar { opacity: 0; }
html:root body.admin-body .st-upload.is-error { border-color: color-mix(in srgb, var(--a-danger) 45%, var(--a-line)) !important; }
html:root body.admin-body .st-upload-collapsed { justify-content: center; color: var(--a-muted); }

/* ---------- Admin "not found" state ---------- */
html:root body.admin-body .st-notfound { position: relative; display: grid; justify-items: center; gap: 12px; margin: clamp(12px, 3vw, 32px) 0; padding: clamp(40px, 6vw, 72px) 24px; border: 1px solid var(--a-line); background: var(--a-panel); text-align: center; overflow: hidden; }
html:root body.admin-body .st-notfound::before { content: ""; position: absolute; inset: 14px; border: 1px dashed color-mix(in srgb, var(--a-line) 80%, transparent); pointer-events: none; }
html:root body.admin-body .st-notfound-art { position: relative; display: grid; place-items: center; margin-bottom: 6px; }
html:root body.admin-body .st-notfound-code { color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--a-muted) 45%, transparent); font: 600 clamp(84px, 12vw, 140px)/1 var(--a-mono); letter-spacing: -.04em; }
html:root body.admin-body .st-notfound-icon { position: absolute; width: 64px; height: 64px; display: grid; place-items: center; border: 1px solid var(--a-accent); background: var(--a-panel); color: var(--a-accent); font-size: 22px; box-shadow: 0 0 0 8px var(--a-panel); }
html:root body.admin-body .st-notfound-title { margin: 0 !important; padding: 0 !important; border: 0 !important; color: var(--a-ink); font: 800 clamp(22px, 2.6vw, 30px)/1.3 var(--a-display) !important; }
html[dir="ltr"]:root body.admin-body .st-notfound-title { font: 600 clamp(28px, 3vw, 36px)/1.15 var(--a-display) !important; }
html:root body.admin-body .st-notfound-text { max-width: 46ch; margin: 0; color: var(--a-muted); font: 500 14.5px/1.7 var(--a-font); }
html:root body.admin-body .st-notfound-actions { position: relative; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 12px; }
html:root body.admin-body .st-notfound-actions .button { display: inline-flex; align-items: center; gap: 8px; }
html[dir="ltr"]:root body.admin-body .st-notfound-actions .fa-arrow-right { transform: scaleX(-1); }

/* Bookings rows: the whole card opens the booking (scoped — the row is the positioning box) */
html:root body.admin-body .bk-row { position: relative; cursor: pointer; }
html:root body.admin-body .bk-row .dl-row-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
html:root body.admin-body .bk-row :is(a, button, select, input, label, details):not(.dl-row-title a) { position: relative; z-index: 2; }
html:root body.admin-body .bk-row:hover .dl-row-title { color: var(--a-accent); }

/* Rail: language + theme sit at the bottom, just above the account line */
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs { display: flex !important; align-items: stretch; gap: 8px !important; width: 100%; margin: auto 0 0 !important; padding: 14px 0 14px !important; border: 0 !important; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs button {
  flex: 1 1 auto; width: auto !important; min-height: 40px !important; margin: 0 !important; padding: 0 14px !important; justify-content: center; display: inline-flex !important; align-items: center;
  border: 1px solid var(--a-rail-line) !important; background: transparent !important; color: var(--a-rail-ink) !important; text-align: center;
}
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs .admin-theme-toggle { flex: 0 0 44px; width: 44px !important; padding: 0 !important; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs button:hover { border-color: var(--a-accent) !important; color: var(--a-accent) !important; background: transparent !important; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs + .admin-user { margin-top: 0 !important; }

/* ---------- Rail footer: display settings + account card ---------- */
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs { gap: 0 !important; padding: 0 !important; margin: auto 0 14px !important; border: 1px solid var(--a-rail-line) !important; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs button { min-height: 42px !important; border: 0 !important; font: 600 12px/1 var(--a-en) !important; letter-spacing: .14em; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs .admin-language-toggle::before { content: "\f0ac"; margin-inline-end: 10px; font: 900 12px/1 "Font Awesome 6 Free"; letter-spacing: 0; color: var(--a-accent); }
html[dir="ltr"]:root body.admin-body .admin-sidebar nav .admin-rail-prefs .admin-language-toggle { font: 700 13px/1 var(--a-ar) !important; letter-spacing: 0; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs .admin-theme-toggle { flex: 0 0 46px; width: 46px !important; border-inline-start: 1px solid var(--a-rail-line) !important; }
html:root body.admin-body .admin-sidebar nav .admin-rail-prefs button:hover { background: rgba(201, 121, 63, .08) !important; }

html:root body.admin-body .admin-sidebar nav .admin-account { display: flex; align-items: center; gap: 10px; padding: 14px 0 2px; border-top: 1px solid var(--a-rail-line); }
html:root body.admin-body .admin-sidebar nav .admin-account .admin-user { flex: 1; min-width: 0; display: flex !important; align-items: center; gap: 12px; margin: 0 !important; padding: 0 !important; border: 0 !important; }
html:root body.admin-body .admin-sidebar nav .admin-account .admin-user[hidden] { display: none !important; }
html:root body.admin-body .admin-user-avatar { flex: 0 0 40px; height: 40px; display: grid; place-items: center; background: var(--a-accent); color: #fff; font: 700 17px/1 var(--a-display); }
html:root body.admin-body .admin-user-text { min-width: 0; display: grid; gap: 4px; }
html:root body.admin-body .admin-user-name { overflow: hidden; color: var(--a-rail-ink); font: 700 14.5px/1.2 var(--a-font); text-overflow: ellipsis; white-space: nowrap; }
html:root body.admin-body .admin-sidebar .admin-user-role { justify-self: start; padding: 0 !important; border: 0 !important; background: none !important; color: var(--a-rail-muted) !important; font: 600 12px/1.2 var(--a-font) !important; }
html:root body.admin-body .admin-sidebar .admin-user-role[data-role="owner"] { color: #e0995f !important; }
html:root body.admin-body .admin-sidebar .admin-user-role::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-inline-end: 7px; vertical-align: middle; background: currentColor; }
html[dir="ltr"]:root body.admin-body .admin-sidebar .admin-user-role { font: 500 10.5px/1.2 var(--a-mono) !important; letter-spacing: .12em; text-transform: uppercase; }
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn {
  flex: 0 0 40px; width: 40px !important; min-height: 40px !important; height: 40px; margin: 0 !important; padding: 0 !important;
  display: grid !important; place-items: center; overflow: hidden; color: transparent !important; font-size: 0 !important;
  border: 1px solid var(--a-rail-line) !important; background: transparent !important;
}
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn i { margin: 0 !important; color: var(--a-rail-muted); font-size: 15px !important; transition: color .2s ease; }
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn:hover { border-color: var(--a-danger) !important; }
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn:hover i { color: var(--a-danger); }
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn { position: relative; gap: 0 !important; line-height: 0 !important; letter-spacing: 0 !important; text-indent: 0 !important; }
html:root body.admin-body .admin-sidebar nav .admin-account #logoutBtn i { position: absolute; top: 50%; left: 50%; width: auto !important; margin: 0 !important; transform: translate(-50%, -50%) !important; line-height: 1 !important; }

/* ---------------------------------------------------------------- stories: circular cards */
html:root body.admin-body .st-orb-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: clamp(26px, 3vw, 44px) clamp(18px, 2.4vw, 36px); align-items: start; }
html:root body.admin-body .st-card.st-orb { border: 0; background: transparent; gap: 16px; }
html:root body.admin-body .st-orb-media {
  position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden; outline: none; isolation: isolate;
  background: color-mix(in srgb, var(--a-ink) 6%, var(--a-bg));
  box-shadow: 0 0 0 1px var(--a-line), 0 18px 40px -28px rgba(20, 14, 8, .6);
  transition: box-shadow .3s ease;
}
html:root body.admin-body .st-orb-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s ease, filter .3s ease; }
html:root body.admin-body .st-orb.is-draft .st-orb-media img { filter: saturate(.5); }
html:root body.admin-body .st-orb:hover .st-orb-media img, html:root body.admin-body .st-orb-media:focus-within img { transform: scale(1.05); }
html:root body.admin-body .st-orb:hover .st-orb-media, html:root body.admin-body .st-orb-media:focus-within { box-shadow: 0 0 0 2px var(--a-accent), 0 22px 46px -26px rgba(20, 14, 8, .7); }
html:root body.admin-body .st-orb-overlay {
  position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: rgba(14, 12, 10, .5); color: #fff; opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
html:root body.admin-body .st-orb:hover .st-orb-overlay, html:root body.admin-body .st-orb-media:focus-within .st-orb-overlay { opacity: 1; pointer-events: auto; }
html:root body.admin-body .st-orb-actions { display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.4vw, 18px); }
html:root body.admin-body button.st-orb-action {
  display: grid; place-items: center; width: 44px !important; height: 44px !important; min-height: 0 !important; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important; color: #fff !important;
  font-size: 21px; cursor: pointer; transition: transform .2s ease, background .2s ease;
}
html:root body.admin-body button.st-orb-action:hover, html:root body.admin-body button.st-orb-action:focus-visible { background: rgba(255, 255, 255, .16) !important; transform: translateY(-2px); outline: none; }
html:root body.admin-body button.st-orb-action[data-action="delete"]:hover { background: var(--a-danger) !important; }
html:root body.admin-body button.st-orb-action:disabled { opacity: .35; cursor: not-allowed; transform: none; background: transparent !important; }
html:root body.admin-body .st-orb-stats { margin: 0; font: 600 12.5px/1.4 var(--a-font); letter-spacing: .04em; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
html[dir="ltr"]:root body.admin-body .st-orb-stats { text-transform: uppercase; }
html:root body.admin-body .st-orb-star {
  position: absolute; z-index: 3; top: 14.6%; inset-inline-end: 14.6%; margin-top: -15px; margin-inline-end: -15px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--a-accent); color: #fff; font-size: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
html:root body.admin-body .st-orb-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; padding-inline: 4px; }
html:root body.admin-body .st-orb-date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin: 0; color: var(--a-muted); font: 500 14px/1.4 var(--a-en-display); }
html:root body.admin-body .st-orb-date > span + span::before { content: "·"; margin-inline-end: 12px; color: var(--a-line); }
html[dir="rtl"]:root body.admin-body .st-orb-date { font-family: var(--a-ar); font-size: 13px; }
html:root body.admin-body .st-orb .st-card-index { position: static; padding: 0; background: none; color: var(--a-accent); font: 500 11px/1 var(--a-mono); }
html:root body.admin-body .st-orb-row { display: flex; align-items: center; gap: 10px; }
html:root body.admin-body .st-orb-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; border: 1.5px dashed var(--a-muted); }
html:root body.admin-body .st-orb-dot.is-live { border: 0; background: #2fb35a; }
html:root body.admin-body .st-orb .st-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px !important; }
html:root body.admin-body .st-orb .st-card-title a::after { content: none; }
html:root body.admin-body .st-orb .st-card-title a:hover { color: var(--a-accent); }
html:root body.admin-body .st-orb-go { flex: 0 0 auto; color: var(--a-muted); font-size: 18px; text-decoration: none; transition: color .2s ease, transform .2s ease; }
html[dir="ltr"]:root body.admin-body .st-orb-go i { transform: scaleX(-1); }
html:root body.admin-body .st-orb:hover .st-orb-go { color: var(--a-accent); transform: translateX(-4px); }
html[dir="ltr"]:root body.admin-body .st-orb:hover .st-orb-go { transform: translateX(4px); }
html:root body.admin-body .st-orb .st-card-sub { font-size: 14px; }
html:root body.admin-body .st-orb-media { cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
html:root body.admin-body .st-orb-media img { -webkit-user-drag: none; pointer-events: none; }
html:root body.admin-body .st-orb-grid.is-filtered .st-orb-media { cursor: default; }
html:root body.admin-body button.st-orb-action { cursor: pointer; }
html:root body.admin-body .st-orb.is-drag-armed .st-orb-media { transform: scale(.96); transition: transform .3s ease, box-shadow .3s ease; box-shadow: 0 0 0 3px var(--a-accent); }
html:root body.admin-body .st-orb.is-drag-source { opacity: .3; outline: 0; }
html:root body.admin-body .st-orb.is-drag-source .st-orb-media { box-shadow: 0 0 0 2px dashed var(--a-accent); outline: 2px dashed var(--a-accent); outline-offset: 4px; }
html:root body.admin-body .st-orb.st-drag-ghost { opacity: 1; background: transparent; box-shadow: none; border: 0 !important; }
html:root body.admin-body .st-orb.st-drag-ghost .st-orb-media { transform: scale(1.04) rotate(-2deg); box-shadow: 0 0 0 2px var(--a-accent), 0 30px 60px -20px rgba(0, 0, 0, .6); }
html:root body.admin-body .st-orb.st-drag-ghost .st-orb-overlay, html:root body.admin-body .st-orb.is-drag-source .st-orb-overlay, html:root body.admin-body.is-sorting .st-orb-overlay { opacity: 0 !important; }
html:root body.admin-body .st-orb.st-drag-ghost .st-orb-body { opacity: 0; }
html:root body.admin-body .st-orb-create {
  display: grid; align-content: center; justify-items: center; gap: 12px; aspect-ratio: 1; border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--a-accent) 55%, var(--a-line)); color: var(--a-accent); text-decoration: none;
  transition: background .25s ease, border-color .25s ease;
}
html:root body.admin-body .st-orb-create:hover, html:root body.admin-body .st-orb-create:focus-visible { background: var(--a-soft); border-color: var(--a-accent); outline: none; }
html:root body.admin-body .st-orb-create-ring { font-size: 26px; transition: transform .3s ease; }
html:root body.admin-body .st-orb-create:hover .st-orb-create-ring { transform: rotate(90deg); }
html:root body.admin-body .st-orb-create-label { font: 800 15px/1.3 var(--a-ar-display); letter-spacing: .02em; }
html[dir="ltr"]:root body.admin-body .st-orb-create-label { font: 600 17px/1.2 var(--a-en-display); text-transform: uppercase; letter-spacing: .1em; }
@media (hover: none) {
  html:root body.admin-body .st-orb-overlay { background: rgba(14, 12, 10, .58); }
}
@media (max-width: 560px) {
  html:root body.admin-body .st-orb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  html:root body.admin-body button.st-orb-action { width: 34px !important; height: 34px !important; font-size: 16px; }
  html:root body.admin-body .st-orb-actions { gap: 4px; }
  html:root body.admin-body .st-orb-stats { font-size: 11px; }
  html:root body.admin-body .st-orb .st-card-title { font-size: 15px !important; }
}

/* ---------------------------------------------------------------- stories: preview dialog */
html.st-preview-open, html.st-preview-open body { overflow: hidden; }
html:root body.admin-body dialog.st-preview {
  --pv-pad: clamp(18px, 2.6vw, 34px);
  width: min(1240px, calc(100vw - 48px)); max-width: none; height: calc(100dvh - 48px); max-height: none; padding: 0; margin: auto;
  border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink); overflow: hidden;
  box-shadow: 0 50px 120px -40px rgba(0, 0, 0, .75);
}
html:root body.admin-body dialog.st-preview[open] { display: flex; flex-direction: column; animation: st-pv-in .28s cubic-bezier(.2, .8, .2, 1); }
html:root body.admin-body dialog.st-preview::backdrop { background: rgba(10, 9, 7, .7); backdrop-filter: blur(6px); }
@keyframes st-pv-in { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* top bar */
html:root body.admin-body .st-pv-bar {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px; padding: 10px 12px 10px var(--pv-pad); padding-inline-start: var(--pv-pad); padding-inline-end: 12px;
  border-bottom: 1px solid var(--a-line); background: var(--a-panel);
}
html:root body.admin-body .st-pv-bar-title { display: grid; gap: 2px; min-width: 0; }
html:root body.admin-body .st-pv-bar-eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--a-accent); font: 700 11.5px/1.3 var(--a-font); }
html[dir="ltr"]:root body.admin-body .st-pv-bar-eyebrow { font: 500 10.5px/1.3 var(--a-mono); letter-spacing: .14em; text-transform: uppercase; }
html:root body.admin-body .st-pv-bar-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 16px/1.4 var(--a-ar-display); }
html[dir="ltr"]:root body.admin-body .st-pv-bar-title strong { font: 600 20px/1.2 var(--a-en-display); }
html:root body.admin-body .st-pv-bar-tools { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
html:root body.admin-body .st-pv-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px !important; min-height: 0 !important; margin: 0 !important; padding: 0 16px !important;
  border: 1px solid var(--a-line) !important; border-radius: 999px !important; background: transparent !important; box-shadow: none !important;
  color: var(--a-ink) !important; font: 700 13px/1 var(--a-font) !important; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: border-color .2s ease, color .2s ease, background .2s ease;
}
html:root body.admin-body .st-pv-tool:hover, html:root body.admin-body .st-pv-tool:focus-visible { border-color: var(--a-accent) !important; color: var(--a-accent) !important; outline: none; }
html:root body.admin-body .st-pv-tool.is-primary { border-color: var(--a-accent) !important; background: var(--a-accent) !important; color: #fff !important; }
html:root body.admin-body .st-pv-tool.is-primary:hover { filter: brightness(1.08); color: #fff !important; }
html:root body.admin-body .st-pv-tool.is-close { width: 40px; padding: 0 !important; font-size: 17px !important; }
html:root body.admin-body .st-pv-tool[hidden] { display: none !important; }
html:root body.admin-body .st-pv-tool:focus { outline: none !important; box-shadow: none !important; }
html:root body.admin-body .st-pv-tool:focus-visible { box-shadow: 0 0 0 3px var(--a-soft) !important; }
html:root body.admin-body .st-pv-tool i { font-size: 12px; }
html:root body.admin-body .st-pv-tool.is-close i { font-size: 17px; }

/* body + layout */
html:root body.admin-body .st-preview-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
html:root body.admin-body .st-pv-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); align-items: start; min-height: 100%; }
html:root body.admin-body .st-pv-info {
  position: sticky; top: 0; display: grid; align-content: start; gap: 14px; max-height: calc(100dvh - 48px - 66px); overflow-y: auto;
  padding: var(--pv-pad); border-inline-end: 1px solid var(--a-line);
}
html:root body.admin-body .st-pv-title { margin: 6px 0 0 !important; padding: 0 !important; border: 0 !important; color: var(--a-ink) !important; font: 800 clamp(26px, 2.6vw, 34px)/1.3 var(--a-ar-display) !important; }
html[dir="ltr"]:root body.admin-body .st-pv-title { font: 500 clamp(32px, 3.2vw, 44px)/1.05 var(--a-en-display) !important; }
html:root body.admin-body .st-pv-alt { margin: -6px 0 0; color: var(--a-muted); font: 500 19px/1.3 var(--a-en-display); }
html:root body.admin-body .st-pv-alt[lang="ar"] { font: 600 15px/1.5 var(--a-ar); }
html:root body.admin-body .st-pv-alt:empty { display: none; }
html:root body.admin-body .st-pv-facts { display: grid; margin: 6px 0 0; border-top: 1px solid var(--a-line); }
html:root body.admin-body .st-pv-fact { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--a-line); }
html:root body.admin-body .st-pv-fact dt { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; color: var(--a-muted); font: 500 13px/1.4 var(--a-font); }
html:root body.admin-body .st-pv-fact dt i { width: 14px; color: var(--a-accent); font-size: 12px; text-align: center; }
html:root body.admin-body .st-pv-fact dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--a-ink); font: 600 13.5px/1.5 var(--a-font); text-align: end; }
html:root body.admin-body .st-pv-text { display: grid; gap: .8em; margin-top: 6px; color: color-mix(in srgb, var(--a-ink) 86%, var(--a-muted)); font: 400 15px/1.85 var(--a-font); }
html:root body.admin-body .st-pv-text p { margin: 0; }
html:root body.admin-body .st-pv-excerpt { color: var(--a-ink); font: 500 19px/1.6 var(--a-en-display) !important; }
html:root body.admin-body .st-pv-text[dir="rtl"] .st-pv-excerpt, html[dir="rtl"]:root body.admin-body .st-pv-excerpt { font: 700 16px/1.8 var(--a-ar) !important; }
html:root body.admin-body .st-pv-muted {
  display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; padding: 18px; border: 1px dashed var(--a-line);
  color: var(--a-muted); font: 500 13.5px/1.6 var(--a-font); text-align: center;
}
html:root body.admin-body .st-pv-muted i { color: var(--a-accent); }
html:root body.admin-body .st-pv-muted.is-error { margin: var(--pv-pad); }
html:root body.admin-body .st-pv-note { display: flex; align-items: center; gap: 9px; margin: 0; padding: 11px 14px; background: var(--a-soft); color: var(--a-ink); font: 600 13px/1.6 var(--a-font); }
html:root body.admin-body .st-pv-note i { color: var(--a-accent); }

/* photos */
html:root body.admin-body .st-pv-gallery { display: grid; gap: 8px; padding: 8px; }
html:root body.admin-body .st-pv-gallery.is-empty { padding: var(--pv-pad); }
html:root body.admin-body .st-pv-photos { columns: 2; column-gap: 8px; }
html:root body.admin-body button.st-pv-photo {
  position: relative; display: block; width: 100% !important; height: auto !important; min-height: 0 !important; margin: 0 0 8px !important; padding: 0 !important;
  border: 0 !important; border-radius: 0 !important; background: color-mix(in srgb, var(--a-ink) 7%, var(--a-bg)) !important; box-shadow: none !important;
  overflow: hidden; break-inside: avoid; cursor: zoom-in;
}
html:root body.admin-body button.st-pv-photo.is-lead { margin: 0 !important; max-height: 78vh; }
html:root body.admin-body .st-pv-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s ease, opacity .3s ease; }
html:root body.admin-body .st-pv-photo:hover img { transform: scale(1.025); }
html:root body.admin-body .st-pv-photo:focus-visible { outline: 2px solid var(--a-accent) !important; outline-offset: -2px; }
html:root body.admin-body .st-pv-cover-tag {
  position: absolute; top: 12px; inset-inline-start: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  background: rgba(14, 12, 10, .72); color: #fff; font: 700 11.5px/1.2 var(--a-font); backdrop-filter: blur(4px);
}
html:root body.admin-body .st-pv-cover-tag i { color: var(--a-accent); font-size: 10px; }

/* loading */
html:root body.admin-body .st-pv-loading { display: grid; place-items: center; align-content: center; gap: 14px; min-height: 100%; color: var(--a-muted); font: 500 14px/1.5 var(--a-font); }
html:root body.admin-body .st-pv-spinner { width: 34px; height: 34px; border: 2px solid var(--a-line); border-top-color: var(--a-accent); border-radius: 50%; animation: st-pv-spin .8s linear infinite; }
@keyframes st-pv-spin { to { transform: rotate(360deg); } }

/* zoomed photo */
html:root body.admin-body .st-pv-zoom {
  position: absolute; inset: 0; z-index: 10; display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; grid-template-rows: minmax(0, 1fr); align-items: center;
  background: rgba(8, 7, 6, .96); animation: st-pv-fade .2s ease;
}
@keyframes st-pv-fade { from { opacity: 0; } }
html:root body.admin-body .st-pv-zoom figure { grid-column: 2; display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; padding: 64px 0; }
html:root body.admin-body .st-pv-zoom img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px -30px #000; }
html:root body.admin-body button.st-pv-zoom-btn {
  display: grid; place-items: center; width: 46px !important; height: 46px !important; min-height: 0 !important; margin: 0 auto !important; padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .18) !important; border-radius: 50% !important; background: rgba(255, 255, 255, .06) !important; box-shadow: none !important;
  color: #fff !important; font-size: 16px; cursor: pointer; transition: background .2s ease, border-color .2s ease;
}
html:root body.admin-body button.st-pv-zoom-btn:hover, html:root body.admin-body button.st-pv-zoom-btn:focus-visible { background: var(--a-accent) !important; border-color: var(--a-accent) !important; outline: none; }
html:root body.admin-body button.st-pv-zoom-btn:focus:not(:focus-visible) { outline: none; box-shadow: none !important; }
html:root body.admin-body button.st-pv-zoom-btn[hidden] { visibility: hidden; display: grid; }
html:root body.admin-body .st-pv-zoom .is-prev { grid-column: 1; grid-row: 1; }
html:root body.admin-body .st-pv-zoom .is-next { grid-column: 3; grid-row: 1; }
html:root body.admin-body .st-pv-zoom figure { grid-row: 1; }
html:root body.admin-body .st-pv-zoom .is-close { position: absolute; z-index: 1; top: 12px; inset-inline-end: 12px; }
html[dir="ltr"]:root body.admin-body .st-pv-zoom .is-prev i, html[dir="ltr"]:root body.admin-body .st-pv-zoom .is-next i { transform: scaleX(-1); }
html:root body.admin-body .st-pv-zoom-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, .75); font: 500 12px/1 var(--a-mono); letter-spacing: .12em; }

/* tablet: details above the photos */
@media (max-width: 900px) {
  html:root body.admin-body .st-pv-layout { grid-template-columns: minmax(0, 1fr); }
  html:root body.admin-body .st-pv-info { position: static; max-height: none; overflow: visible; border-inline-end: 0; border-bottom: 1px solid var(--a-line); }
  html:root body.admin-body .st-pv-gallery { display: contents; }
  html:root body.admin-body button.st-pv-photo.is-lead { order: 1; }
  html:root body.admin-body .st-pv-info { order: 2; }
  html:root body.admin-body .st-pv-photos { order: 3; padding: 8px; }
  html:root body.admin-body .st-pv-gallery.is-empty { display: block; order: 3; }
  html:root body.admin-body button.st-pv-photo.is-lead { max-height: 70vh; }
}
/* phone: full screen sheet */
@media (max-width: 640px) {
  html:root body.admin-body dialog.st-preview { --pv-pad: 18px; width: 100vw; height: 100dvh; border: 0; }
  html:root body.admin-body dialog.st-preview[open] { animation-name: st-pv-up; }
  html:root body.admin-body .st-pv-bar { min-height: 58px; padding-inline-start: 16px; padding-inline-end: 10px; }
  html:root body.admin-body .st-pv-tool span { display: none; }
  html:root body.admin-body .st-pv-tool { width: 40px; padding: 0 !important; }
  html:root body.admin-body .st-pv-photos { column-gap: 4px; padding: 4px; }
  html:root body.admin-body button.st-pv-photo { margin-bottom: 4px !important; }
  html:root body.admin-body button.st-pv-photo.is-lead { max-height: 62vh; }
  html:root body.admin-body .st-pv-zoom { grid-template-columns: 0 minmax(0, 1fr) 0; }
  html:root body.admin-body .st-pv-zoom figure { padding: 64px 0 70px; }
  html:root body.admin-body .st-pv-zoom .is-prev, html:root body.admin-body .st-pv-zoom .is-next { position: absolute; bottom: 10px; }
  html:root body.admin-body .st-pv-zoom .is-prev { inset-inline-start: 16px; }
  html:root body.admin-body .st-pv-zoom .is-next { inset-inline-end: 16px; }
}
@keyframes st-pv-up { from { transform: translateY(24px); opacity: 0; } }

/* ---------------------------------------------------------------- phone header + side drawer */
html:root body.admin-body .admin-bar-theme, html:root body.admin-body .admin-drawer-head, html:root body.admin-body .admin-drawer-backdrop { display: none; }
html:root body.admin-body, html:root body.admin-body .admin-layout, html:root body.admin-body .admin-main { max-width: 100%; overflow-x: clip; }
@media (max-width: 768px) {
  html:root body.admin-body .admin-sidebar {
    position: sticky !important; top: 0; z-index: 50;
    display: grid !important; grid-template-columns: 44px minmax(0, 1fr) 44px !important; grid-template-rows: auto !important;
    align-items: center !important; min-height: 64px !important; height: auto !important; padding: 10px 14px !important; gap: 0 10px !important;
    background: var(--a-rail) !important; box-shadow: 0 6px 20px rgba(0, 0, 0, .18) !important;
  }
  html:root body.admin-body .admin-sidebar .hamburger-btn,
  html:root body.admin-body .admin-sidebar .admin-bar-theme {
    display: grid !important; place-items: center; width: 44px !important; height: 44px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
    border: 1px solid var(--a-rail-line) !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;
    color: var(--a-rail-ink) !important; font-size: 17px !important; cursor: pointer; transition: border-color .2s ease, color .2s ease;
  }
  html:root body.admin-body .admin-sidebar .hamburger-btn:hover, html:root body.admin-body .admin-sidebar .admin-bar-theme:hover { border-color: var(--a-accent) !important; color: var(--a-accent) !important; }
  html:root body.admin-body .admin-sidebar .hamburger-btn { grid-column: 1 !important; grid-row: 1 !important; order: initial !important; }
  html:root body.admin-body .admin-sidebar .brand { grid-column: 2 !important; grid-row: 1 !important; display: flex !important; flex-direction: row !important; align-items: center !important; justify-content: center !important; width: auto !important; margin: 0 !important; padding: 0 !important; }
  html[dir]:root body.admin-body .admin-sidebar .brand > * { margin: 0 !important; }
  html:root body.admin-body .admin-sidebar .admin-logo { width: 124px; }
  html:root body.admin-body .admin-sidebar .admin-bar-theme { grid-column: 3 !important; grid-row: 1 !important; }
  /* the bar is laid out physically (some older rules force ltr on the rail):
     Arabic = menu on the right, theme on the left; English = mirrored */
  html:root body.admin-body .admin-sidebar { direction: ltr !important; }
  html[dir="rtl"]:root body.admin-body .admin-sidebar .hamburger-btn { grid-column: 3 !important; }
  html[dir="rtl"]:root body.admin-body .admin-sidebar .admin-bar-theme { grid-column: 1 !important; }
  html[dir="rtl"]:root body.admin-body .admin-sidebar nav { direction: rtl; }

  /* the nav becomes an off-canvas drawer from the start side */
  html:root body.admin-body .admin-sidebar nav,
  html:root body.admin-body .admin-sidebar nav.open {
    position: fixed !important; z-index: 70; inset-block: 0 !important; inset-inline-start: 0 !important; inset-inline-end: auto !important;
    display: flex !important; flex-direction: column !important; gap: 2px !important; width: min(84vw, 320px) !important; height: 100dvh !important;
    margin: 0 !important; padding: 0 14px 18px !important; overflow-y: auto; overscroll-behavior: contain;
    border: 0 !important; border-inline-end: 1px solid var(--a-rail-line) !important; border-radius: 0 !important;
    background: var(--a-rail) !important; box-shadow: 0 0 60px rgba(0, 0, 0, .45) !important;
    visibility: hidden; transform: translateX(-100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .32s;
  }
  html[dir="rtl"]:root body.admin-body .admin-sidebar nav { transform: translateX(100%); }
  html:root body.admin-body .admin-sidebar nav.open,
  html[dir="rtl"]:root body.admin-body .admin-sidebar nav.open { visibility: visible; transform: none; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  html:root body.admin-body .admin-drawer-head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin: 0 -14px 10px; padding: 14px 14px 14px 18px; padding-inline-start: 18px; border-bottom: 1px solid var(--a-rail-line); background: var(--a-rail);
  }
  html:root body.admin-body .admin-drawer-head img { width: 118px; height: auto; display: block; }
  html:root body.admin-body button.admin-drawer-close {
    display: grid; place-items: center; width: 40px !important; height: 40px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
    border: 1px solid var(--a-rail-line) !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;
    color: var(--a-rail-ink) !important; font-size: 16px; cursor: pointer;
  }
  html:root body.admin-body button.admin-drawer-close:hover { border-color: var(--a-accent) !important; color: var(--a-accent) !important; }
  html:root body.admin-body .admin-sidebar nav a { flex: 0 0 auto; min-height: 50px; }
  html:root body.admin-body .admin-sidebar nav .admin-rail-prefs { display: flex !important; margin: 14px 0 0 !important; padding-top: 14px; border-top: 1px solid var(--a-rail-line); }
  html:root body.admin-body .admin-sidebar nav .admin-rail-prefs .admin-language-toggle { flex: 1; }
  html:root body.admin-body .admin-sidebar nav .admin-account, html:root body.admin-body .admin-sidebar nav > .admin-user { margin-top: auto !important; }
  html:root body.admin-body .admin-drawer-backdrop {
    display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10, 9, 7, .55); backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none; transition: opacity .3s ease;
  }
  html.admin-drawer-open body.admin-body .admin-drawer-backdrop { opacity: 1; pointer-events: auto; }
  html.admin-drawer-open, html.admin-drawer-open body { overflow: hidden !important; }
}

/* deliveries: "view only" switch and pill */
html:root body.admin-body .dl-viewonly-switch { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--a-line); }
html:root body.admin-body .dl-viewonly-switch strong i { color: var(--a-accent); margin-inline-end: 4px; }
html:root body.admin-body .dl-pill-viewonly { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--a-accent) 16%, transparent) !important; border: 1px solid color-mix(in srgb, var(--a-accent) 55%, transparent) !important; color: var(--a-accent) !important; }
html:root body.admin-body .dl-pill-viewonly i { font-size: 10px; }
html:root body.admin-body .bl-icon { color: var(--a-accent); font-size: 22px; }
html:root body.admin-body .bl-row.is-expired .bl-icon, html:root body.admin-body .bl-row.is-revoked .bl-icon { color: var(--a-muted); }
html:root body.admin-body .bl-optional { margin-inline-start: 8px; color: var(--a-muted); font: 500 11.5px/1 var(--a-font); letter-spacing: 0; text-transform: none; opacity: .8; }

/* ---------- Bookings: terms tab (assets/js/admin/booking-terms.js) ---------- */
html:root body.admin-body #panelTerms[hidden], html:root body.admin-body #termsReset[hidden] { display: none !important; }
html:root body.admin-body #panelTerms { max-width: 860px; }
html:root body.admin-body .bt-intro { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 20px; padding: 16px 18px; border: 1px solid var(--a-line); border-inline-start: 3px solid var(--a-accent); background: var(--a-panel); }
html:root body.admin-body .bt-intro i { margin-top: 4px; color: var(--a-accent); font-size: 18px; }
html:root body.admin-body .bt-intro p { margin: 0; color: var(--a-ink); font: 500 14px/1.8 var(--a-font); }
html:root body.admin-body .bt-list { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
html:root body.admin-body .bt-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--a-line); background: var(--a-panel); }
html:root body.admin-body .bt-num { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--a-accent) 14%, transparent); color: var(--a-accent); font: 600 14px/1 var(--a-mono); }
html:root body.admin-body .bt-texts { display: grid; gap: 6px; min-width: 0; }
html:root body.admin-body .bt-texts textarea { width: 100%; min-height: 0 !important; resize: none; overflow: hidden; padding: 8px 10px !important; font: 600 14.5px/1.7 var(--a-font) !important; }
html:root body.admin-body .bt-texts textarea.bt-en { font: 500 13px/1.6 var(--a-en, var(--a-font)) !important; color: var(--a-muted) !important; }
html:root body.admin-body .bt-texts textarea.is-invalid { border-color: var(--a-danger) !important; }
html:root body.admin-body .bt-tools { display: flex; gap: 2px; }
html:root body.admin-body .bt-tools .st-icon-btn:disabled { opacity: .3; cursor: default; border-color: transparent; }
html:root body.admin-body .bt-del:hover:not(:disabled) { color: var(--a-danger) !important; border-color: var(--a-danger) !important; }
html:root body.admin-body .bt-add { width: 100%; justify-content: center; border-style: dashed !important; }
html:root body.admin-body .bt-actions { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; padding: 14px 0; border-top: 1px solid var(--a-line); background: var(--a-bg); }
html:root body.admin-body .bt-actions .status-message { margin: 0 !important; }
html:root body.admin-body .bt-note { margin: 8px 0 0 !important; font-size: 13px !important; }
html:root body.admin-body .bk-terms-accepted { font-size: 13.5px; color: var(--a-muted); }
@media (max-width: 768px) {
  html:root body.admin-body .bk-tabs .st-tab { flex: 1 1 33%; padding: 0 6px; }
  html:root body.admin-body .bt-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  html:root body.admin-body .bt-num { display: none; }
  html:root body.admin-body .bt-tools { justify-content: flex-end; }
  html:root body.admin-body .bt-actions .button { flex: 1 1 auto; }
}
