/* Foundry admin. Same visual language as foundry-sites.com:
   Sora for headings, Inter for text, JetBrains Mono for small labels,
   ink surfaces with an orange accent. */
:root {
  color-scheme: light;
  --font-display: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --surface-3: #eceff5;
  --border: #e3e8f0;
  --border-strong: #cfd6e2;
  --text: #0b0f19;
  --muted: #5a6474;
  --primary: #0b0f19;
  --primary-rgb: 255, 92, 28;
  --primary-hover: #1c2436;
  --on-primary: #ffffff;
  --accent: #ff5c1c;
  --accent-deep: #c2410c;
  --accent-soft: #fff1ea;
  --link: #c2410c;
  --ink: #0b0f19;
  --ink-2: #121828;
  --chrome: #0b0f19;
  --chrome-text: #b9c2d4;
  --chrome-line: rgba(255, 255, 255, 0.1);
  --danger: #dc2626;
  --success: #0e9f6e;
  --warning: #b45309;
  --info: #2563eb;
  --scheduled: #7c3aed;
  --scheduled-rgb: 124, 58, 237;
  --radius: 10px;
  --radius-sm: 6px;
  --space: 12px;
  --shadow-soft: 0 1px 2px rgba(11, 15, 25, 0.04), 0 8px 24px rgba(11, 15, 25, 0.05);
  --shadow-lift: 0 2px 4px rgba(11, 15, 25, 0.05), 0 16px 36px rgba(11, 15, 25, 0.09);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f19;
  --surface: #121828;
  --surface-2: #171f32;
  --surface-3: #1f2940;
  --border: #253049;
  --border-strong: #34405c;
  --text: #e8ecf4;
  --muted: #9aa5bb;
  --primary: #ff6a2e;
  --primary-rgb: 255, 106, 46;
  --primary-hover: #ff8352;
  --on-primary: #0b0f19;
  --accent: #ff6a2e;
  --accent-deep: #ff9a6e;
  --accent-soft: rgba(255, 106, 46, 0.12);
  --link: #ff9a6e;
  --chrome: #070a12;
  --chrome-text: #a3adc2;
  --chrome-line: rgba(255, 255, 255, 0.08);
  --danger: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --info: #60a5fa;
  --scheduled: #a78bfa;
  --scheduled-rgb: 167, 139, 250;
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.35);
}

/* "Sistema" follows the operating system. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f19;
    --surface: #121828;
    --surface-2: #171f32;
    --surface-3: #1f2940;
    --border: #253049;
    --border-strong: #34405c;
    --text: #e8ecf4;
    --muted: #9aa5bb;
    --primary: #ff6a2e;
    --primary-rgb: 255, 106, 46;
    --primary-hover: #ff8352;
    --on-primary: #0b0f19;
    --accent: #ff6a2e;
    --accent-deep: #ff9a6e;
    --accent-soft: rgba(255, 106, 46, 0.12);
    --link: #ff9a6e;
    --chrome: #070a12;
    --chrome-text: #a3adc2;
    --chrome-line: rgba(255, 255, 255, 0.08);
    --danger: #f87171;
    --success: #34d399;
    --warning: #fbbf24;
    --info: #60a5fa;
    --scheduled: #a78bfa;
    --scheduled-rgb: 167, 139, 250;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.35), 0 20px 48px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); letter-spacing: -0.02em; color: var(--text); }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }

.eyebrow { display: block; margin: 0 0 6px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; color: var(--accent-deep); letter-spacing: 0; }
.muted { color: var(--muted); }

/* --- login --- */
.login-body { min-height: 100vh; background: var(--bg); }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 40px 56px; background: #0b0f19; color: #fff;
}
.login-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}
.login-hero::after {
  content: ""; position: absolute; right: -160px; top: -160px; width: 480px; height: 480px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 92, 28, 0.35), transparent 65%);
}
.login-hero > * { position: relative; z-index: 1; }
.login-hero .admin-brand { color: #fff; }
.login-hero h1 { max-width: 520px; margin: 0; color: #fff; font-size: clamp(30px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -0.035em; }
.login-hero p { max-width: 460px; margin: 16px 0 0; color: #b9c2d4; font-size: 16px; }
.login-hero .eyebrow { color: #ff9a6e; }
.login-points { display: grid; gap: 10px; margin: 28px 0 0; padding: 0; list-style: none; color: #d5dbe7; }
.login-points li { display: flex; gap: 10px; align-items: center; }
.login-points li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.login-foot { color: #6b7690; font-family: var(--font-mono); font-size: 12px; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: min(380px, 100%); }
.login-card h2 { margin: 0 0 6px; font-size: 26px; }
.login-card .subtitle { color: var(--muted); margin: 0 0 24px; }
.login-card form { display: flex; flex-direction: column; gap: 14px; }
.login-card label { display: flex; flex-direction: column; gap: 6px; }
.login-card label span { font-size: 13px; font-weight: 600; color: var(--text); }
.login-card input { min-height: 46px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius-sm); font: inherit; font-size: 15px; }
.login-card input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.18); }
.login-card button[type="submit"] { min-height: 48px; padding: 10px; background: var(--primary); color: var(--on-primary); border: 0; border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 600; font-size: 15px; cursor: pointer; margin-top: 6px; }
.login-card button[type="submit"]:hover { background: var(--primary-hover); }
.login-help { margin: 20px 0 0; color: var(--muted); font-size: 13px; }
.alert { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.alert-error { background: rgba(220, 38, 38, 0.08); border: 1px solid rgba(220, 38, 38, 0.4); color: var(--danger); }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-hero { padding: 28px 20px 32px; gap: 24px; }
  .login-hero h1 { font-size: 28px; }
  .login-points, .login-foot { display: none; }
}

/* --- layout --- */
.layout { min-height: 100vh; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 40; }
.admin-chrome { background: var(--chrome); color: var(--chrome-text); border-bottom: 1px solid var(--chrome-line); }
.admin-topbar__inner,
.site-nav-section__inner { width: min(1280px, calc(100% - 32px)); margin: 0 auto; }
.admin-topbar__inner { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.admin-topbar__primary { display: flex; align-items: center; gap: 26px; min-width: 0; flex: 1; }
.admin-brand { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; color: #fff; }
.admin-brand:hover { text-decoration: none; }
.admin-brand__mark { width: 26px; height: 26px; flex: none; }
.admin-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; line-height: 1; color: #fff; }
.admin-brand__dot { color: var(--accent); }
.admin-brand__suffix { padding: 3px 7px; border: 1px solid rgba(255,255,255,0.16); border-radius: 999px; color: #9aa5bb; font-family: var(--font-mono); font-size: 10.5px; line-height: 1; }
.main-nav,
.site-nav { display: flex; align-items: center; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar,
.site-nav::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--chrome-text); font-size: 13.5px; font-weight: 500; white-space: nowrap; transition: background 150ms ease, color 150ms ease; }
.nav-link:hover { background: rgba(255,255,255,0.06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,0.1); color: #fff; font-weight: 600; }
.admin-topbar__meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.admin-user { display: inline-flex; align-items: center; gap: 9px; min-width: 0; }
.admin-user__avatar { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: 50%; background: var(--accent); color: #0b0f19; font-family: var(--font-display); font-size: 12px; font-weight: 700; }
.admin-user__text { display: grid; min-width: 0; line-height: 1.2; }
.admin-user__name { color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.admin-user__email { color: #8792a8; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.user { font-size: 12px; color: var(--muted); }
.logout-form { margin: 0; }
.logout-btn { background: transparent; border: 1px solid rgba(255,255,255,0.18); color: #e8ecf4; padding: 7px 11px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 600; }
.logout-btn:hover { border-color: #fff; color: #fff; }
.prefs { position: relative; }
.prefs > summary { list-style: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); color: var(--chrome-text); cursor: pointer; }
.prefs > summary::-webkit-details-marker { display: none; }
.prefs > summary:hover, .prefs[open] > summary { background: rgba(255,255,255,0.08); color: #fff; }
.prefs > summary svg { width: 18px; height: 18px; }
.prefs__panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; gap: 12px; width: 240px; padding: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.prefs__label { display: block; margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.language-switcher,
.theme-switcher { display: flex; align-items: center; gap: 4px; }
.language-switcher button,
.theme-switcher button { flex: 1; border: 1px solid var(--border); background: var(--surface); color: var(--muted); border-radius: var(--radius-sm); padding: 6px 8px; font: inherit; font-size: 12px; cursor: pointer; font-weight: 600; }
.language-switcher button:hover,
.theme-switcher button:hover { color: var(--text); border-color: var(--border-strong); }
.language-switcher button.active,
.theme-switcher button.active { background: var(--ink); border-color: var(--ink); color: #fff; }
:root[data-theme="dark"] .language-switcher button.active,
:root[data-theme="dark"] .theme-switcher button.active { background: var(--accent); border-color: var(--accent); color: #0b0f19; }
.login-language { margin-bottom: 28px; max-width: 160px; }

.site-nav-section { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-nav-section__inner { display: flex; align-items: center; gap: 18px; min-height: 58px; }
.site-context { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 300px; padding-right: 18px; border-right: 1px solid var(--border); }
.site-context__badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-deep); font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.site-context__text { display: grid; min-width: 0; line-height: 1.25; }
.site-context-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.site-context-domain { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.site-nav { flex: 1; align-self: stretch; gap: 4px; }
.site-nav-link { position: relative; display: inline-flex; align-items: center; gap: 7px; height: 100%; min-height: 58px; padding: 0 10px; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.site-nav-link svg { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.site-nav-link:hover { color: var(--text); text-decoration: none; }
.site-nav-link.active { color: var(--text); font-weight: 600; }
.site-nav-link.active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.view-site-link { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface); }
.view-site-link:hover { border-color: var(--text); text-decoration: none; }

.content { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 64px; }

/* --- page header --- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-header h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.03em; color: var(--text); }
.page-header p { max-width: 720px; margin: 8px 0 0; color: var(--muted); font-size: 14.5px; }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.inline-action-form { display: inline-flex; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.row-actions form { margin: 0; }
.row-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.row-actions a:hover { background: var(--surface-3); text-decoration: none; }
.row-action {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.row-action:hover { background: var(--surface-3); }
.row-action--primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.row-action--primary:hover { background: var(--primary-hover); }
.contact-filters { grid-template-columns: minmax(0, 1fr) auto; }
.contacts-table td { vertical-align: top; }
.contacts-table .contact-when { white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.contacts-table .contact-who, .contacts-table .contact-message { display: table-cell; }
.contacts-table .contact-who > *, .contacts-table .contact-message > * { display: block; }
.contacts-table .contact-who { min-width: 180px; }
.contacts-table .contact-message { min-width: 260px; max-width: 520px; }
.contacts-table .contact-message .badge { display: inline-flex; margin-top: 6px; white-space: normal; }
.contact-type { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.contact-reason { margin-top: 6px; color: var(--muted); font-size: 12px; }

/* --- buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 8px 15px; background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-display); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 100ms ease; }
.btn:hover { background: var(--surface-2); border-color: var(--text); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #e0490d; border-color: #e0490d; color: #fff; }
.btn-danger { background: transparent; border-color: rgba(220, 38, 38, 0.45); color: var(--danger); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.08); border-color: var(--danger); color: var(--danger); }
.confirm-menu .btn-danger, .modal .btn-danger, .danger-zone .btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.confirm-menu .btn-danger:hover, .modal .btn-danger:hover, .danger-zone .btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { min-height: 30px; padding: 4px 10px; font-size: 12px; }

/* --- forms --- */
.form { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.form-wide { max-width: none; }
.form fieldset {
  display: grid;
  gap: 16px;
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.form label { display: flex; flex-direction: column; gap: 4px; }
.form label span { font-size: 12.5px; color: var(--text); font-weight: 600; }
.form label small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.form label small.form-warning { color: var(--danger); }
.form input, .form select, .form textarea {
  min-height: 42px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
}
.form input:focus,
.form select:focus,
.form textarea:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.copy-textarea:focus,
.prompt-textarea:focus,
.json-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}
.form textarea.code { font-family: var(--font-mono); font-size: 13px; }
.editor-textarea { min-height: 520px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.check-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--muted); font-size: 13px; }
.check-row label,
.inline-check { display: inline-flex; flex-direction: row; gap: 8px; align-items: center; }
.check-row input,
.inline-check input { width: auto; }
.danger-zone { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); }
.advanced { margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.advanced summary { cursor: pointer; color: var(--text); font-size: 13px; font-weight: 700; }
.advanced label { margin-top: 12px; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.45; }
.seo-help { margin: 12px 0 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--muted); font-size: 13px; }
.seo-help p { margin: 0; }
.field-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-soft); }
.field-section h2 { margin: 0 0 8px; font-size: 16px; }
.markdown-editor-shell {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.markdown-editor-title h2 {
  margin: 0 0 4px;
  font-size: 16px;
}
.markdown-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.markdown-editor-pane,
.markdown-preview-pane {
  min-width: 0;
}
.markdown-editor-pane {
  display: flex;
  flex-direction: column;
}
.markdown-editor-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.markdown-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
}
.markdown-tool-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-right: 6px;
  border-right: 1px solid var(--border);
}
.markdown-tool-group:last-child {
  border-right: 0;
  padding-right: 0;
}
.markdown-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}
.markdown-tool-btn:hover {
  background: var(--surface);
  border-color: var(--border);
  text-decoration: none;
}
.markdown-tool-btn:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}
.markdown-tool-btn-strong { font-weight: 900; }
.markdown-tool-btn-em { font-style: italic; }
.markdown-upload-btn input { display: none; }
.markdown-editor-pane .editor-textarea {
  border-radius: 0 0 8px 8px;
}
.markdown-editor-pane .editor-textarea.markdown-drop-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(var(--primary-rgb), 0.18), 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}
.markdown-editor-footnote {
  margin: 8px 0 0;
}
.markdown-preview-pane {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  max-height: calc(100vh - 48px);
  position: sticky;
  top: 132px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.markdown-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.markdown-preview-header h3 {
  margin: 0;
  font-size: 13px;
}
.markdown-preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}
.markdown-preview-prose {
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
}
.markdown-preview-prose > *:first-child { margin-top: 0; }
.markdown-preview-prose > *:last-child { margin-bottom: 0; }
.markdown-preview-prose h1,
.markdown-preview-prose h2,
.markdown-preview-prose h3 {
  margin: 1.4em 0 0.5em;
  line-height: 1.2;
}
.markdown-preview-prose h1 { font-size: 24px; }
.markdown-preview-prose h2 { font-size: 20px; }
.markdown-preview-prose h3 { font-size: 17px; }
.markdown-preview-prose p,
.markdown-preview-prose ul,
.markdown-preview-prose ol,
.markdown-preview-prose blockquote { margin: 0 0 1em; }
.markdown-preview-prose ul,
.markdown-preview-prose ol { padding-left: 1.35em; }
.markdown-preview-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}
.markdown-preview-prose blockquote {
  padding: 8px 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface-2);
  color: var(--muted);
}
.markdown-preview-prose a { word-break: break-word; }
.markdown-media-panel { width: min(980px, 100%); }
.markdown-media-body { gap: 14px; }
.markdown-media-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.markdown-media-controls label {
  display: grid;
  gap: 4px;
}
.markdown-media-controls label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.markdown-media-controls input {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
}
.markdown-media-controls input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}
.markdown-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.markdown-media-card {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow-soft);
}
.markdown-media-card:hover {
  border-color: rgba(var(--primary-rgb), 0.48);
}
.markdown-media-card:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.16);
}
.markdown-media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
}
.markdown-media-card__meta {
  display: grid;
  gap: 2px;
  padding: 8px;
  min-width: 0;
}
.markdown-media-card__meta strong,
.markdown-media-card__meta small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.markdown-media-card__meta strong {
  font-size: 12px;
  font-weight: 700;
}
.markdown-media-card__meta small {
  min-height: 14px;
  color: var(--muted);
  font-size: 11px;
}
.string-fields { display: grid; gap: 14px; }
.permission-list { display: grid; gap: 8px; }
.permission-row { display: grid; grid-template-columns: 1fr 180px; gap: 12px; align-items: center; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.role-card { padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.role-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.role-card h2 { margin: 0; font-size: 16px; }
.role-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.permission-matrix td:first-child small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.pill { display: inline-block; margin: 2px 4px 2px 0; padding: 3px 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: 12px; }
.muted { color: var(--muted); font-size: 12px; }

/* --- tables --- */
.data-table { width: 100%; border: 1px solid var(--border); border-collapse: separate; border-spacing: 0; border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-soft); }
.data-table th { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--surface-2); }
.data-table .empty { text-align: center; color: var(--muted); padding: 40px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table-wrap--scroll > .data-table { min-width: max-content; }
.page-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.filter-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; margin-bottom: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.filter-bar label { display: grid; gap: 5px; }
.filter-bar label span { color: var(--muted); font-size: 12px; font-weight: 600; }
.filter-bar input, .filter-bar select { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.booking-manager-filters input,
.booking-manager-filters select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.audit-table td { vertical-align: top; }
.audit-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
.audit-details summary { cursor: pointer; color: var(--primary); }
.audit-details pre { max-width: 420px; max-height: 260px; overflow: auto; margin: 8px 0 0; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); font-size: 11px; line-height: 1.45; }
.audit-kv { margin-top: 8px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 22px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.badge-active, .badge-published { background: rgba(62, 196, 126, 0.15); color: var(--success); }
.badge-sent { background: rgba(62, 196, 126, 0.15); color: var(--success); }
.badge-failed { background: rgba(224, 82, 106, 0.15); color: var(--danger); }
.badge-skipped { background: rgba(224, 179, 77, 0.15); color: var(--warning); }
.badge-draft { background: rgba(224, 179, 77, 0.15); color: var(--warning); }
.badge-admin_review { background: rgba(37, 99, 235, 0.12); color: var(--info); }
.badge-suspended, .badge-archived { background: rgba(224, 82, 106, 0.15); color: var(--danger); }
.badge-scheduled { background: rgba(var(--scheduled-rgb), 0.15); color: var(--scheduled); }
.badge-stranded { background: rgba(224, 82, 106, 0.15); color: var(--danger); }

/* --- publication scheduling --- */
.schedule-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(var(--scheduled-rgb), 0.35);
  background: rgba(var(--scheduled-rgb), 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.schedule-note--danger { border-color: var(--danger); background: rgba(224, 82, 106, 0.1); }
.schedule-note__icon { flex: none; margin-top: 1px; color: var(--scheduled); }
.schedule-note--danger .schedule-note__icon { color: var(--danger); }
.schedule-note__body { min-width: 0; }
.schedule-note strong { display: block; margin-bottom: 2px; }
.schedule-note p { margin: 0; color: var(--muted); }
.schedule-cell { display: flex; flex-direction: column; gap: 2px; }
.schedule-cell__when { color: var(--scheduled); font-weight: 600; }
.schedule-cell__when--stranded { color: var(--danger); font-weight: 600; }
.schedule-cell__relative { color: var(--muted); font-size: 11px; }

/* --- stats --- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stats--compact { margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--border); padding: 18px 20px; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.stat-value { display: block; font-family: var(--font-display); font-size: 26px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value--small { font-size: 14px; line-height: 1.8; }
.stat-label { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; font-weight: 500; }
.site-cards { display: grid; gap: 12px; }
.site-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-soft); }
.site-card h2 { margin: 0 0 4px; font-size: 16px; }
.site-card p { margin: 0; color: var(--muted); }
.site-card-actions { display: flex; gap: 8px; }
.quick-links {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.quick-links h2 {
  margin: 0;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}
.quick-links ul {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.quick-links li + li { border-top: 1px solid var(--border); }
.quick-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
.quick-links a::after { content: "\203A"; color: var(--muted); font-size: 18px; line-height: 1; }
.quick-links a:hover { background: var(--surface-2); text-decoration: none; }

/* --- email observability --- */
.email-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.email-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.email-chart-card { margin-bottom: 20px; }
.email-chart {
  display: grid;
  grid-template-columns: repeat(14, minmax(34px, 1fr));
  gap: 10px;
  align-items: end;
  min-height: 190px;
}
.email-chart-day {
  display: grid;
  min-width: 0;
  gap: 6px;
  justify-items: center;
  color: var(--muted);
  font-size: 11px;
}
.email-chart-day strong { color: var(--text); font-size: 12px; }
.email-chart-bars {
  width: 100%;
  height: 132px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding: 8px 5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.email-chart-bar {
  display: block;
  width: 8px;
  min-height: 2px;
  border-radius: 999px 999px 2px 2px;
}
.email-chart-bar--sent,
.legend-dot--sent { background: var(--success); }
.email-chart-bar--failed,
.legend-dot--failed { background: var(--danger); }
.email-chart-bar--skipped,
.legend-dot--skipped { background: var(--warning); }
.email-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
.email-chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}
.email-table td { vertical-align: top; }
.email-table td small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }
/* --- connection guide --- */
.connection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.connection-grid > * { min-width: 0; }
.connection-wide { grid-column: 1 / -1; }
.connection-primary { border-color: rgba(62, 196, 126, 0.55); background: rgba(62, 196, 126, 0.08); }
.connection-steps,
.connection-checklist { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text); }
.connection-note { margin: 12px 0 0; color: var(--muted); font-size: 13px; }
.connection-warning { margin: 0 0 12px; color: var(--warning); font-size: 13px; }
.dns-records { table-layout: fixed; }
.dns-records th,
.dns-records td { overflow-wrap: anywhere; }
.dns-records code,
.nameserver-list code { word-break: break-all; }
.nameserver-list { display: grid; gap: 8px; }
.nameserver-list code { display: block; padding: 8px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); }
.card-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.card-toolbar h2 { margin-bottom: 4px; }
.copy-textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* --- modals and JSON import --- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal.hidden { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.45);
}
.modal-header,
.modal-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-footer { border-top: 1px solid var(--border); border-bottom: 0; }
.modal-header h2 { margin: 0 0 4px; font-size: 18px; }
.modal-body { overflow-y: auto; padding: 18px; display: grid; gap: 18px; }
.icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}
.icon-btn:hover { background: var(--surface-3); }
.import-step {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.import-step-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.import-step-header h3 { margin: 0; font-size: 14px; }
.step-number {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
}
.prompt-actions { display: flex; gap: 6px; margin-left: auto; }
.copy-panel { position: relative; }
.copy-panel-btn { position: absolute; top: 8px; right: 8px; }
.prompt-textarea { min-height: 220px; padding-right: 128px; }
.json-input { min-height: 260px; }
.history-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  overflow: hidden;
}
.history-panel-header,
.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.history-row:last-child { border-bottom: 0; }
.history-list { max-height: 210px; overflow-y: auto; color: var(--muted); font-size: 12px; }
.import-message {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
}
.import-message p { margin: 0 0 4px; }
.import-message p:last-child { margin-bottom: 0; }
.import-message-error { border: 1px solid var(--danger); background: rgba(224, 82, 106, 0.1); color: var(--danger); }
.import-message-warning { border: 1px solid var(--warning); background: rgba(224, 179, 77, 0.1); color: var(--warning); }
.import-message-success { border: 1px solid var(--success); background: rgba(62, 196, 126, 0.1); color: var(--success); }

/* --- media library --- */
.upload-form { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; box-shadow: var(--shadow-soft); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.media-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0; padding: 8px; box-shadow: var(--shadow-soft); transition: border-color 150ms ease, box-shadow 150ms ease; }
.media-item:hover { border-color: rgba(var(--primary-rgb), 0.35); box-shadow: var(--shadow-lift); }
.media-item img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; }
.media-item figcaption { display: flex; flex-direction: column; gap: 4px; padding: 6px 0 0; font-size: 11px; color: var(--muted); }
.media-item code { font-size: 10px; word-break: break-all; }
.media-public-url-label { margin-top: 4px; font-weight: 700; color: var(--text); }
.media-public-url-row { display: flex; align-items: stretch; gap: 6px; }
.media-public-url-input { min-width: 0; width: 100%; padding: 7px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }
.media-public-url-row .btn { flex: 0 0 auto; }
.file-icon { height: 140px; background: var(--surface-2); display: grid; place-items: center; border-radius: 4px; color: var(--muted); font-size: 11px; }
.featured-preview { margin-top: 12px; max-width: 280px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.featured-preview img { display: block; width: 100%; height: auto; }

/* --- flash --- */
.flash { position: fixed; top: 72px; right: 16px; padding: 11px 14px 11px 16px; border-radius: var(--radius); display: flex; align-items: center; gap: 12px; z-index: 100; background: var(--ink); color: #fff; box-shadow: var(--shadow-lift); font-weight: 500; border-left: 4px solid var(--success); }
.flash-success { border-left-color: var(--success); }
.flash-error { border-left-color: #f87171; }
.flash-close { background: none; border: 0; color: inherit; cursor: pointer; font-size: 16px; }

.hint { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.empty { color: var(--muted); }

/* --- contacts inbox --- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 24px; }
.tab { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 7px 13px; font-size: 13px; font-weight: 600; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.tab:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.tab-active { color: var(--on-primary); border-color: var(--primary); background: var(--primary); }
.tab-active:hover { color: var(--on-primary); background: var(--primary-hover); }
.tab-count { display: inline-block; margin-left: 6px; padding: 1px 8px; background: var(--surface-2); border-radius: 10px; font-size: 11px; }
.tab-active .tab-count { background: rgba(255,255,255,0.18); color: inherit; }

.contact-detail { display: grid; gap: 20px; }
@media (min-width: 960px) { .contact-detail { grid-template-columns: 2fr 1fr; } }
.contact-detail__main { display: grid; gap: 20px; min-width: 0; }
.contact-detail__side { display: grid; gap: 20px; align-content: start; }
.contact-detail__message { white-space: pre-wrap; word-wrap: break-word; font: inherit; margin: 0; padding: 12px; background: var(--surface-2); border-radius: 6px; line-height: 1.6; }
.card { min-width: 0; background: var(--surface); border: 1px solid var(--border); padding: 20px; border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.card h2 { margin: 0 0 12px; font-size: 16px; }
.card h3 { margin: 0 0 12px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0; color: var(--muted); }
.card-warn { border-color: rgba(180, 83, 9, 0.35); background: rgba(251, 191, 36, 0.09); }
.kv { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; min-width: 0; word-wrap: break-word; }
.kv code.small { font-size: 10px; word-break: break-all; }
.truncate { max-width: 480px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-row { display: grid; gap: 6px; margin-bottom: 14px; }
.form-row > span { font-size: 12px; color: var(--muted); font-weight: 500; }

@media (max-width: 1080px) {
  .admin-user__text { display: none; }
  .site-nav-link svg { display: none; }
}

@media (max-width: 820px) {
  .home-shell { width: min(100% - 24px, 1080px); padding-top: 14px; }
  .home-topbar { align-items: flex-start; flex-direction: column; }
  .home-language { width: 100%; }
  .home-hero { padding: 34px 0 26px; }
  .home-hero h1 { font-size: 32px; }
  .home-intro { font-size: 15px; }
  .home-cards { grid-template-columns: 1fr; }
  .admin-topbar { position: sticky; }
  .admin-topbar__inner,
  .site-nav-section__inner {
    width: min(100% - 24px, 1280px);
  }
  .admin-topbar__inner { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0 6px; }
  .admin-topbar__primary { display: contents; }
  .admin-brand { order: 1; }
  .admin-topbar__meta { order: 2; margin-left: auto; }
  .main-nav { order: 3; width: 100%; padding-bottom: 4px; }
  .main-nav,
  .site-nav { width: 100%; flex-wrap: nowrap; }
  .site-nav-section__inner { flex-wrap: wrap; gap: 0 12px; min-height: 0; padding-top: 10px; }
  .site-context { flex: 1; max-width: none; border-right: 0; padding-right: 0; }
  .site-nav { order: 3; width: 100%; flex: none; }
  .site-nav-link, .site-nav-link.active { min-height: 46px; }
  .content { width: min(100% - 24px, 1280px); padding: 22px 0 42px; }
  .page-header,
  .site-card { align-items: flex-start; flex-direction: column; }
  .page-header h1 { font-size: 23px; }
  .page-actions { justify-content: flex-start; }
  .form-grid,
  .stats,
  .role-grid,
  .permission-row,
  .connection-grid,
  .filter-bar { grid-template-columns: 1fr; }
  .data-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }
  .data-table th,
  .data-table td {
    white-space: nowrap;
  }
  .data-table .empty { white-space: normal; }
  .email-chart { grid-template-columns: repeat(7, minmax(34px, 1fr)); }
  .card-toolbar { flex-direction: column; }
  .modal { align-items: stretch; padding: 10px; }
  .modal-panel { max-height: calc(100vh - 20px); }
  .modal-header,
  .modal-footer,
  .import-step-header { flex-direction: column; align-items: flex-start; }
  .prompt-actions { margin-left: 0; flex-wrap: wrap; }
  .copy-panel-btn { position: static; margin-top: 8px; }
  .prompt-textarea { padding-right: 12px; }
  .site-card-actions,
  .page-actions { flex-wrap: wrap; }
  .markdown-editor-grid { grid-template-columns: 1fr; }
  .markdown-tool-group { border-right: 0; padding-right: 0; }
  .markdown-media-controls { grid-template-columns: 1fr; align-items: start; }
  .markdown-media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .markdown-preview-pane { position: static; max-height: none; min-height: 360px; }
}

/* --- dashboard --- */
.admin-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: end;
  margin-bottom: 28px; padding: 34px 34px 30px; border-radius: 14px; background: #0b0f19; color: #fff;
}
.admin-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 40px 40px;
}
.admin-hero::after {
  content: ""; position: absolute; right: -120px; top: -140px; width: 380px; height: 380px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 92, 28, 0.32), transparent 65%);
}
.admin-hero > * { position: relative; z-index: 1; }
.admin-hero .eyebrow { color: #ff9a6e; }
.admin-hero h1 { margin: 0; color: #fff; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.035em; }
.admin-hero p { margin: 10px 0 0; max-width: 520px; color: #b9c2d4; font-size: 15px; }
.admin-hero__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.hero-stat { padding: 14px 16px; border: 1px solid rgba(255,255,255,0.14); border-radius: var(--radius); background: rgba(255,255,255,0.04); }
.hero-stat strong { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-stat span { display: block; margin-top: 2px; color: #9aa5bb; font-size: 12.5px; }
.section-title { margin: 0 0 14px; font-size: 17px; font-weight: 600; }
.site-summaries { margin-bottom: 28px; }
.site-summaries__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(460px, 100%), 1fr)); gap: 16px; }
.site-summary { display: flex; flex-direction: column; gap: 16px; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.site-summary__head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-summary__head .site-context__badge { width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
.site-summary__title { min-width: 0; }
.site-summary__title h2 { margin: 0; font-size: 17px; font-weight: 600; }
.site-summary__host { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-family: var(--font-mono); font-size: 11.5px; }
.site-summary__host svg { width: 12px; height: 12px; }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kpi-row--short { grid-template-columns: minmax(0, 1fr); max-width: 220px; }
.kpi { padding: 12px 14px; background: var(--surface-2); }
.kpi + .kpi { border-left: 1px solid var(--border); }
.kpi dt { color: var(--muted); font-size: 12px; }
.kpi dd { margin: 3px 0 0; font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.site-summary__next { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 13.5px; }
.site-summary__next svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent-deep); }
.site-summary__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-family: var(--font-body); font-size: 11px; font-weight: 700; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
@media (max-width: 900px) {
  .admin-hero { grid-template-columns: 1fr; padding: 24px 20px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--border); }
}

/* --- shared bits: segmented tabs, chips, toolbar --- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.view-site-link svg { width: 14px; height: 14px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 9px; }
.segmented__item { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 13px; border-radius: 7px; color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.segmented__item svg { width: 15px; height: 15px; }
.segmented__item:hover { color: var(--text); text-decoration: none; }
.segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(11, 15, 25, 0.08), 0 0 0 1px var(--border); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip:hover { border-color: var(--text); text-decoration: none; }
.chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.toolbar__range { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); }
.toolbar__range input { min-height: 32px; padding: 4px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.range-note { margin: 0 0 18px; font-size: 13px; }
.footnote { margin: 24px 0 0; max-width: 860px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

/* --- metrics --- */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.metric__label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.metric__value { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric__foot { min-height: 18px; font-size: 12px; }
.metric:first-child { background: #0b0f19; border-color: #0b0f19; color: #fff; }
.metric:first-child .metric__label { color: #9aa5bb; }
.metric:first-child .metric__value { color: #fff; }
.metric:first-child .delta--up { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.metric:first-child .delta--down { background: rgba(248, 113, 113, 0.16); color: #fca5a5; }
.metric:first-child .delta--flat { background: rgba(255, 255, 255, 0.08); color: #b9c2d4; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta--up { background: rgba(14, 159, 110, 0.1); color: var(--success); }
.delta--down { background: rgba(220, 38, 38, 0.08); color: var(--danger); }
.delta--flat { background: var(--surface-3); color: var(--muted); }

/* --- charts --- */
:root { --chart-bar: #e0490d; }
:root[data-theme="dark"] { --chart-bar: #ee5f24; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --chart-bar: #ee5f24; } }
.chart-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; margin-bottom: 16px; }
.chart-grid > :only-child { grid-column: 1 / -1; }
.chart-card { padding: 18px 20px 14px; }
.bar-chart { margin: 0; }
.bar-chart__title { margin: 0 0 18px; font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.bar-chart__plot { position: relative; height: 200px; margin: 0 0 0 52px; border-bottom: 1px solid var(--border-strong); }
.bar-chart__grid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--border); }
.bar-chart__grid em { position: absolute; right: calc(100% + 8px); top: -8px; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; font-style: normal; white-space: nowrap; }
.bar-chart__cols { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); gap: 2px; align-items: end; }
.bar-chart__col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.bar-chart__col:hover, .bar-chart__col:focus-visible { background: var(--surface-2); border-radius: 4px 4px 0 0; }
.bar-chart__bar { display: block; width: min(100%, 34px); min-width: 2px; background: var(--chart-bar); border-radius: 4px 4px 0 0; }
.bar-chart__col.is-partial .bar-chart__bar { opacity: 0.45; }
.bar-chart__peak { position: absolute; left: 50%; transform: translate(-50%, -4px); margin-bottom: 0; color: var(--text); font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.bar-chart__tip { position: absolute; bottom: calc(100% - 4px); left: 50%; z-index: 5; display: none; transform: translateX(-50%); padding: 7px 10px; background: var(--ink); color: #d5dbe7; border-radius: 6px; box-shadow: var(--shadow-lift); font-size: 12px; line-height: 1.4; white-space: nowrap; pointer-events: none; }
.bar-chart__tip strong { display: block; color: #fff; font-size: 13px; }
.bar-chart__col:hover .bar-chart__tip, .bar-chart__col:focus-visible .bar-chart__tip { display: block; }
.bar-chart__col:hover .bar-chart__peak, .bar-chart__col:focus-visible .bar-chart__peak { visibility: hidden; }
.bar-chart__col:first-child .bar-chart__tip, .bar-chart__col:nth-child(2) .bar-chart__tip { left: 0; transform: none; }
.bar-chart__col:last-child .bar-chart__tip, .bar-chart__col:nth-last-child(2) .bar-chart__tip { left: auto; right: 0; transform: none; }
.bar-chart__axis { display: grid; grid-template-columns: repeat(var(--bars), minmax(0, 1fr)); gap: 2px; margin: 6px 0 0 52px; color: var(--muted); font-family: var(--font-mono); font-size: 10.5px; text-align: center; }
.bar-chart__axis span { overflow: visible; white-space: nowrap; }
.bar-chart__empty { display: flex; align-items: center; justify-content: center; height: 200px; margin: 0; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); }
.bar-chart__table { margin-top: 12px; }
.bar-chart__table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.bar-chart__table .table-wrap { max-height: 280px; overflow: auto; margin-top: 8px; }
.data-table--compact td, .data-table--compact th { padding: 7px 12px; font-size: 12.5px; }

/* --- breakdowns --- */
.breakdown-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.breakdown h2 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.breakdown__table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.breakdown__table th { padding: 0 0 8px; text-align: left; color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-weight: 500; }
.breakdown__table td { padding: 9px 0; border-top: 1px solid var(--border); vertical-align: middle; }
.breakdown__table .num { text-align: right; padding-left: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.breakdown__table td.num small { display: block; color: var(--muted); font-size: 11px; }
.breakdown__name { display: block; font-weight: 500; }
.share-bar { display: block; height: 6px; margin-top: 5px; max-width: 260px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.share-bar > span { display: block; height: 100%; background: var(--chart-bar); border-radius: 999px; }

@media (max-width: 900px) {
  .chart-grid, .breakdown-grid { grid-template-columns: 1fr; }
  .page-header .segmented { align-self: stretch; }
  .metric__value { font-size: 21px; }
}
@media (max-width: 600px) {
  .bar-chart__axis--dense span:nth-child(even) { visibility: hidden; }
  .bar-chart__plot { height: 170px; }
}
:root[data-theme="dark"] .metric:first-child { border-color: rgba(255, 106, 46, 0.45); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .metric:first-child { border-color: rgba(255, 106, 46, 0.45); } }

/* --- agenda --- */
.page-actions .segmented { margin-right: 4px; }
.agenda-ranges { margin-bottom: 12px; }
.agenda-filters { grid-template-columns: repeat(4, minmax(0, 0.8fr)) minmax(0, 1.4fr) auto; }
.callout { margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: 13.5px; }
.callout--warn { border-color: rgba(180, 83, 9, 0.35); background: rgba(251, 191, 36, 0.1); }
.agenda-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 26px; margin: 4px 0 18px; }
.agenda-summary > div { display: flex; align-items: baseline; gap: 8px; }
.agenda-summary dt { color: var(--muted); font-size: 13px; }
.agenda-summary dd { margin: 0; font-family: var(--font-display); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.agenda-summary__note { color: var(--muted); font-size: 12.5px; }
.agenda-day { margin-bottom: 18px; }
.agenda-day__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; padding: 0 4px 8px; }
.agenda-day__head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.agenda-day.is-past .agenda-day__head h2 { color: var(--muted); }
.agenda-day__totals { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.today-pill { display: inline-flex; align-items: center; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-family: var(--font-body); font-size: 11px; font-weight: 700; text-transform: none; vertical-align: 2px; }
.agenda-day.is-today .agenda-list { border-color: rgba(var(--primary-rgb), 0.45); box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.08), var(--shadow-soft); }
.agenda-list { margin: 0; padding: 0; list-style: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-soft); }
.appt { display: grid; grid-template-columns: 74px minmax(0, 1.4fr) minmax(0, 1.2fr) 86px minmax(0, 0.9fr) auto; gap: 14px; align-items: center; padding: 12px 16px; }
.appt + .appt { border-top: 1px solid var(--border); }
.appt:hover { background: var(--surface-2); }
.appt--cancelled .appt__time time, .appt--cancelled .appt__patient, .appt--cancelled .appt__amount { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(90, 100, 116, 0.5); }
.appt__time { display: grid; line-height: 1.2; }
.appt__time time { font-family: var(--font-display); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.appt__time span { color: var(--muted); font-size: 11.5px; }
.appt__main { display: grid; min-width: 0; }
.appt__patient { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.appt__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12.5px; }
.appt__coupon { font-family: var(--font-mono); font-size: 11px; color: var(--accent-deep); }
.appt__contact { display: grid; gap: 2px; min-width: 0; }
.appt__contact a { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--text); font-size: 12.5px; }
.appt__contact a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt__contact svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.appt__contact a:hover svg { color: var(--accent-deep); }
.appt__amount { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.appt__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.appt__actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 90px; }
.appt__actions form { margin: 0; }
.appt__hint { color: var(--muted); font-size: 11.5px; cursor: help; border-bottom: 1px dotted var(--border-strong); }
.confirm-menu { position: relative; }
.confirm-menu > summary { list-style: none; }
.confirm-menu > summary::-webkit-details-marker { display: none; }
.confirm-menu > form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; display: grid; gap: 10px; width: 290px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.confirm-menu > form p { margin: 0; font-size: 13px; line-height: 1.5; }
.back-link { display: inline-block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.back-link::before { content: "\2039  "; }

/* --- new appointment --- */
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
.wizard__step h2, .card .wizard__sub { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 16px; font-weight: 600; }
.card .wizard__sub { margin-top: 8px; font-family: var(--font-display); color: var(--text); }
.wizard__step.is-disabled { opacity: 0.7; }
.step-n { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-family: var(--font-mono); font-size: 12px; }
.day-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.day-switch a[aria-disabled="true"] { pointer-events: none; opacity: 0.4; }
.slot-grid { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px !important; }
.slot { display: block !important; }
.slot input { position: absolute; opacity: 0; pointer-events: none; }
.slot span { display: flex !important; align-items: center; justify-content: center; min-height: 40px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text) !important; font-family: var(--font-display); font-size: 14px !important; font-weight: 600 !important; font-variant-numeric: tabular-nums; cursor: pointer; text-transform: none !important; }
.slot span:hover { border-color: var(--text); }
.slot input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary) !important; }
.slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 1100px) {
  .agenda-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .appt { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "time main amount" "time contact badges" "time actions actions"; row-gap: 6px; }
  .appt__time { grid-area: time; align-self: start; }
  .appt__main { grid-area: main; }
  .appt__contact { grid-area: contact; }
  .appt__amount { grid-area: amount; }
  .appt__badges { grid-area: badges; justify-content: flex-end; }
  .appt__actions { grid-area: actions; justify-content: flex-start; min-width: 0; }
  .appt__actions:empty { display: none; }
  .wizard { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .agenda-filters { grid-template-columns: 1fr 1fr; }
  .agenda-filters__search, .agenda-filters > button { grid-column: 1 / -1; }
  .appt { grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "time main amount" "time contact contact" "time badges actions"; column-gap: 10px; }
  .appt__badges { justify-content: flex-start; }
  .appt__actions { justify-content: flex-end; }
  .confirm-menu > form { left: 0; right: auto; width: min(290px, 80vw); }
}

/* List pages (blog, redirects): search, filters, status chips and pagination. */
.list-filters { grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr)) auto; }
.list-filters--compact { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; }
.list-filters .filter-actions { align-self: end; }
.list-chips { margin: -4px 0 14px; }
.chip__count { color: var(--muted); font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.chip.is-active .chip__count { color: inherit; opacity: .75; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 14px; }
.pagination__summary { margin: 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.pagination__pages { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pagination__page, .pagination__step { display: inline-grid; place-items: center; min-width: 34px; min-height: 34px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; }
.pagination__page:hover, .pagination__step:hover { border-color: var(--text); text-decoration: none; }
.pagination__page.is-current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination__step.is-disabled { color: var(--muted); opacity: .5; }
.pagination__gap { padding: 0 4px; color: var(--muted); }
@media (max-width: 760px) {
  .list-filters, .list-filters--compact { grid-template-columns: minmax(0, 1fr); }
  .pagination { justify-content: center; }
}

/* Booking settings: tabs, list rows that open into a form, weekly hours. */
.settings-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 20px; border-bottom: 1px solid var(--border); }
.settings-tabs__item { display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.settings-tabs__item:hover { color: var(--text); text-decoration: none; }
.settings-tabs__item.is-active { color: var(--text); border-bottom-color: var(--accent); }
.settings-tabs__item .count-pill { background: var(--border); color: var(--text); }
.settings-tabs__item.is-active .count-pill { background: var(--accent); color: #fff; }
.settings-panel[hidden] { display: none; }
.settings-card { padding: 20px 22px; }
.settings-card + .settings-card { margin-top: 16px; }
.settings-card__head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.settings-card__head h2 { margin: 0; }
.settings-card__head p { margin: 4px 0 0; max-width: 62ch; }
.count-pill--wide { height: 26px; padding: 0 10px; background: var(--border); color: var(--text); font-size: 12px; }
.settings-new { position: relative; }
.settings-new > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.settings-new > summary::-webkit-details-marker { display: none; }
.settings-new > summary svg { width: 15px; height: 15px; }
.settings-new[open] > summary { opacity: .7; }
.settings-card__head .settings-new[open] { flex-basis: 100%; order: 3; }
.settings-new__body { margin-top: 12px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); }
.settings-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.settings-row { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr) minmax(0, 1fr) 96px 64px; align-items: center; gap: 12px; padding: 12px 16px; }
.settings-row--assign { grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.2fr) 96px 64px; }
.settings-row--head { padding-top: 9px; padding-bottom: 9px; background: var(--bg); color: var(--muted); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.settings-item { border-top: 1px solid var(--border); }
.settings-list > .settings-item:first-child { border-top: 0; }
.settings-item > summary { list-style: none; cursor: pointer; }
.settings-item > summary::-webkit-details-marker { display: none; }
.settings-item > summary:hover { background: var(--bg); }
.settings-item[open] > summary { background: var(--bg); }
.settings-row__title { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
.settings-row__meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.settings-row__meta svg { width: 14px; height: 14px; flex: none; }
.settings-row__num { font-variant-numeric: tabular-nums; font-weight: 600; }
.settings-row__edit { justify-self: end; color: var(--accent); font-size: 13px; font-weight: 600; }
.settings-item[open] .settings-row__edit { color: var(--muted); }
.settings-item__body { padding: 16px; border-top: 1px dashed var(--border); background: var(--bg); }
.settings-avatar { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--accent); font-size: 11px; font-weight: 700; }
.settings-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; align-items: end; }
.settings-form label { display: grid; gap: 5px; margin: 0; }
.settings-form label > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.settings-form input:not([type="checkbox"]), .settings-form select, .settings-range input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; }
.settings-form__wide { grid-column: 1 / -1; }
.settings-form label.settings-form__check { display: flex; align-items: center; gap: 8px; min-height: 38px; color: var(--text); font-weight: 500; }
.settings-form__check input { width: 17px; height: 17px; accent-color: var(--accent); }
.settings-form__actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.settings-form__advanced > summary { cursor: pointer; color: var(--muted); font-size: 13px; }
.settings-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; margin-top: 10px; }
.settings-group + .settings-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.settings-group__title { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; color: var(--text); font: 600 15px/1.3 var(--font-body); letter-spacing: 0; text-transform: none; }
.settings-group__title .count-pill { background: var(--border); color: var(--text); }
.settings-group__foot { margin-top: 10px; }
.empty-inline { margin: 0; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.settings-people { margin: 0 0 14px; }
.settings-split { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-split .settings-card + .settings-card { margin-top: 0; }
.week-form { display: grid; }
.week-day { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border); }
.week-day:first-of-type { border-top: 0; }
.week-day__name { display: grid; padding-top: 8px; font-weight: 600; }
.week-day__name small { color: var(--muted); font-weight: 500; font-size: 12px; }
.week-day.is-closed .week-day__name { color: var(--muted); }
.week-day__slots { display: grid; gap: 6px; }
.week-slot { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.week-slot input { width: 118px; min-height: 36px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; }
.week-slot.is-empty input { border-style: dashed; background: transparent; color: var(--muted); }
.week-form .settings-form__actions { margin-top: 12px; }
.settings-note { margin: 10px 0 0; font-size: 12px; }
.settings-subhead { margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text); font: 600 14px/1.3 var(--font-body); letter-spacing: 0; text-transform: none; }
.settings-range { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.settings-range label { display: grid; gap: 4px; }
.settings-range label span { color: var(--muted); font-size: 12px; font-weight: 600; }
.settings-range input { width: 150px; }
.blackout-list { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.blackout-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.blackout-list li > span { display: inline-flex; align-items: center; gap: 8px; }
.blackout-list svg { width: 15px; height: 15px; color: var(--muted); }
@media (max-width: 980px) { .settings-split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  .settings-row, .settings-row--assign { grid-template-columns: minmax(0, 1fr) auto; }
  .settings-row--head { display: none; }
  .settings-row > :nth-child(2), .settings-row > :nth-child(3) { grid-column: 1; }
  .week-day { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .week-day__name { padding-top: 0; }
}
.badge-off { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }
.settings-card h3.settings-subhead, .settings-card h3.settings-group__title { font-family: var(--font-body); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text); }

/* Site bar: tabs scroll sideways when they don't fit; setup tools live under "Más". */
.site-nav { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; overscroll-behavior-x: contain; }
.site-nav::-webkit-scrollbar { display: block; height: 4px; }
.site-nav::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.site-more { position: relative; flex: none; align-self: stretch; }
.site-more > summary { list-style: none; cursor: pointer; user-select: none; }
.site-more > summary::-webkit-details-marker { display: none; }
.site-more__chevron { width: 14px !important; height: 14px !important; transition: transform 150ms ease; }
.site-more[open] .site-more__chevron { transform: rotate(180deg); }
.site-more[open] > summary { color: var(--text); }
.site-more__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: grid; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lift); }
.site-more__item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); color: var(--text); font-size: 13.5px; font-weight: 500; }
.site-more__item svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.site-more__item:hover { background: var(--surface-2); text-decoration: none; }
.site-more__item.is-active { background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; }
.site-more__item.is-active svg { color: inherit; }
@media (max-width: 760px) {
  .site-more__menu { right: auto; left: 0; }
}
