/* html-hub v19 — Ofload design system
 * --------------------------------------------------------------
 *   Brand tokens
 *   Typography
 *   Layout primitives
 *   Topbar
 *   Page header
 *   Buttons
 *   Forms
 *   Cards + tables + chips + badges
 *   Tabs (manage views)
 *   Opt-in collapsible section cards
 *   Live preview toggle (Content tab)
 *   Draggable page list
 *   Version history rows
 *   Activity / dashboard accent helpers
 *   Flash + legacy utility rules that older templates still reference
 * -------------------------------------------------------------- */

:root {
  /* Ofload brand colours */
  --ofload-navy: #010A26;
  --ofload-orange: #F05637;
  --ofload-orange-hover: #C0441B;
  --ofload-ice: #EBF2F4;
  --ofload-forest: #AAC3BC;
  --success: #24847C;

  --navy-80: rgba(1, 10, 38, 0.80);
  --navy-60: rgba(1, 10, 38, 0.60);
  --navy-40: rgba(1, 10, 38, 0.40);

  --text-heading: #010A26;
  --text-body:    #1F2944;
  --text-muted:   rgba(1, 10, 38, 0.58);

  --border-default: #E3E8EE;
  --border-strong:  #C7CFDA;

  --elev-1: 0 1px 2px  rgba(1, 10, 38, 0.06);
  --elev-2: 0 4px 12px rgba(1, 10, 38, 0.08);
  --elev-3: 0 10px 30px rgba(1, 10, 38, 0.12);
  --elev-4: 0 20px 44px rgba(1, 10, 38, 0.16);

  --radius-card:  15px;
  --radius-field: 10px;

  --dur-fast: 150ms;
  --ease-standard: cubic-bezier(.2, .8, .2, 1);

  /* Single typeface for everything — body + display use Inter with
     different weights to build hierarchy. Keeps the geometric, refined
     feel of the Claude/Ofload mock without a serif switch. */
  --font-body:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  /* Back-compat with older template rules. */
  --accent: var(--ofload-orange);
  --fg:     var(--text-heading);
  --muted:  var(--text-muted);
  --border: var(--border-default);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-body);
  background: var(--ofload-ice);
  min-height: 100vh;
}

a  { color: var(--ofload-orange); text-decoration: none; }
a:hover { color: var(--ofload-orange-hover); }

code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #F3F0EE;
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-heading);
  letter-spacing: -0.01em;
  margin: 0 0 0.6em;
}
h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 22px; line-height: 1.25; font-weight: 600; }
h3 { font-size: 17px; line-height: 1.3;  font-weight: 600; }

p { margin: 0 0 0.8em; }
p:last-child { margin-bottom: 0; }

.muted { color: var(--text-muted); }
.row { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 0.8rem; }
.stack > label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 13px; color: var(--text-heading); font-weight: 500; }
.inline { display: inline; }

/* ---------- Layout ---------- */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 96px;
}
.container.wide { max-width: 1280px; }

/* ---------- Topbar ---------- */
.topbar {
  background: var(--ofload-navy);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; gap: 20px;
}
.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none;
  color: inherit;
}
.brand:hover { color: inherit; }
.logo-wordmark {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.04em;
  color: #fff;
}
.logo-wordmark span { color: var(--ofload-orange); }
.brand-divider { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.18); }
.brand-product {
  font-size: 14px; font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}
.nav-spacer { flex: 1; }

.nav-links { display: flex; align-items: center; gap: 4px; height: 64px; }
.nav-links a {
  color: rgba(255, 255, 255, 0.72); text-decoration: none;
  padding: 0 14px; height: 100%;
  display: inline-flex; align-items: center;
  font-size: 14px; font-weight: 500;
  position: relative;
  transition: color var(--dur-fast) var(--ease-standard);
}
.nav-links a:hover { color: #fff; }
.nav-links a.is-active { color: #fff; }
.nav-links a.is-active::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 0;
  height: 2px; background: var(--ofload-orange);
  border-radius: 2px 2px 0 0;
}

.nav-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, 0.18); margin: 0 8px; }

.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  transition: all var(--dur-fast) var(--ease-standard);
  cursor: default;
}
.user-chip:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.1); }
.user-chip .user-name { font-size: 14px; font-weight: 600; color: #fff; line-height: 1; }
.avatar, .avatar-img {
  width: 30px; height: 30px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ofload-orange); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  object-fit: cover;
  flex-shrink: 0;
}
.avatar-img { background: transparent; }

.nav-logout {
  color: rgba(255, 255, 255, 0.65);
  background: transparent; border: 0;
  padding: 0 12px; height: 32px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all var(--dur-fast) var(--ease-standard);
}
.nav-logout:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

.nav-signin {
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--ofload-orange);
  font-weight: 600;
}
.nav-signin:hover { background: var(--ofload-orange-hover); color: #fff; }

/* ---------- Flash ---------- */
.flash {
  max-width: 1280px; margin: 20px auto -8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px; font-weight: 500;
}
.flash-success { background: rgba(36, 132, 124, 0.12); color: #166A64; border: 1px solid rgba(36, 132, 124, 0.28); }
.flash-error   { background: rgba(240, 86, 55, 0.10); color: var(--ofload-orange-hover); border: 1px solid rgba(240, 86, 55, 0.28); }

/* ---------- Page header (top of each page inside .container) ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; margin-bottom: 32px; flex-wrap: wrap;
}
.page-head h1 { margin: 0 0 6px; }
.page-head .sub { font-size: 15px; color: var(--text-muted); margin: 0; }
.head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
button, .button { font-family: inherit; }
button, input, select, textarea { font-family: var(--font-body); }

.btn, button[type="submit"], .button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-field);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.005em;
  border: 0;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg, button[type="submit"] svg { width: 16px; height: 16px; stroke-width: 2.25; }

.btn.primary, button[type="submit"].primary, button.primary, .button.primary {
  background: var(--ofload-orange); color: #fff;
  box-shadow: var(--elev-1);
}
.btn.primary:hover, button.primary:hover {
  background: var(--ofload-orange-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(240, 86, 55, 0.25);
}
.btn.primary:active, button.primary:active { transform: translateY(0); }

.btn:not(.primary):not(.danger), button[type="submit"]:not(.primary):not(.danger) {
  background: #fff;
  color: var(--text-heading);
  border: 1px solid var(--border-default);
}
.btn:not(.primary):not(.danger):hover,
button[type="submit"]:not(.primary):not(.danger):hover {
  border-color: var(--border-strong);
  background: #F8FAFB;
}

.btn.danger, button.danger {
  background: var(--ofload-orange); color: #fff;
}
.btn.danger:hover, button.danger:hover { background: var(--ofload-orange-hover); }

.linklike {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; padding: 0;
  color: var(--ofload-orange);
  font-size: inherit; font-weight: 500; cursor: pointer;
  text-decoration: none;
}
.linklike:hover { color: var(--ofload-orange-hover); text-decoration: underline; }
.linklike.danger { color: #A42E10; }
.linklike.danger:hover { color: #6B1A08; }

/* ---------- Forms ---------- */
input[type="text"], input[type="password"], input[type="email"], input[type="search"],
input:not([type]), textarea, select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-field);
  background: #fff;
  font-size: 14px;
  color: var(--text-heading);
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
  outline: none;
}
input[type="file"] {
  padding: 8px;
  border: 1px dashed var(--border-strong);
  background: #fff;
  border-radius: var(--radius-field);
  font-size: 13px; width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--ofload-orange);
  box-shadow: 0 0 0 3px rgba(240, 86, 55, 0.18);
}
textarea { min-height: 72px; resize: vertical; line-height: 1.5; }

label.radio, label.checkbox {
  display: flex; align-items: center; gap: 0.55rem;
  font-size: 14px; color: var(--text-heading); font-weight: 500;
  cursor: pointer;
}
label.radio input, label.checkbox input { accent-color: var(--ofload-orange); }
label.radio strong, label.checkbox strong { font-weight: 600; }

fieldset {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 14px 18px;
  margin: 0;
}
fieldset legend {
  padding: 0 8px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
}

/* ---------- Cards ---------- */
.card, .card.compact {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin: 0 0 16px;
}
.card.compact { padding: 16px 18px; }
.card.danger  { border-color: rgba(240, 86, 55, 0.25); background: #FFF9F6; }

.section-card {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  margin: 0 0 16px;
  overflow: hidden;
}
.section-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 20px;
  font-size: 15px; font-weight: 600;
  color: var(--text-heading);
  display: flex; align-items: center; gap: 10px;
  user-select: none;
  background: #FAFBFC;
  transition: background var(--dur-fast) var(--ease-standard);
}
.section-card > summary:hover { background: #F3F5F8; }
.section-card > summary::-webkit-details-marker { display: none; }
.section-card > summary::before {
  content: "›";
  font-size: 18px;
  color: var(--navy-60);
  transition: transform var(--dur-fast) var(--ease-standard);
  display: inline-block; line-height: 1;
}
.section-card[open] > summary::before { transform: rotate(90deg); }
.section-card[open] > summary { border-bottom: 1px solid var(--border-default); }
.section-card > .section-body { padding: 18px 20px; }
.section-card .section-count {
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
  color: var(--text-muted);
  background: #EDF0F4;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ---------- Tables ---------- */
table.list, table.sites {
  width: 100%; border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  overflow: hidden;
  table-layout: auto;
}
table.list th, table.list td, table.sites th, table.sites td {
  text-align: left;
  padding: 14px 20px;
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}
table.list thead th, table.sites thead th {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  background: #FAFBFC;
  border-bottom: 1px solid var(--border-default);
}
table.list tbody tr, table.sites tbody tr {
  border-bottom: 1px solid var(--border-default);
  transition: background var(--dur-fast) var(--ease-standard);
}
table.list tbody tr:last-child, table.sites tbody tr:last-child { border-bottom: 0; }
table.list tbody tr:hover, table.sites tbody tr:hover { background: rgba(235, 242, 244, 0.45); }
table.list td code, table.list th code { white-space: normal; word-break: break-all; background: transparent; padding: 0; }

/* --- Sortable column headers --- */
table.sites th.sortable {
  cursor: pointer;
  position: relative;
  padding-right: 28px; /* room for the sort-indicator arrow */
  user-select: none;
  transition: color var(--dur-fast) var(--ease-standard);
}
table.sites th.sortable:hover { color: var(--text-heading); }
table.sites th.sortable::after {
  content: "↕";
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 10px; opacity: 0.35;
  transition: opacity var(--dur-fast) var(--ease-standard);
}
table.sites th.sortable:hover::after { opacity: 0.7; }
table.sites th.sortable[data-sort-dir="asc"]::after  { content: "▲"; opacity: 1; color: var(--ofload-orange); }
table.sites th.sortable[data-sort-dir="desc"]::after { content: "▼"; opacity: 1; color: var(--ofload-orange); }

/* --- Resizable column grip (lives on the right edge of each <th>) --- */
/* Every table that ships a resize grip keeps table-layout: auto so
   the browser can grow columns to fit content when the user hasn't
   manually dragged them. Once they drag, an explicit th width wins. */
table.list th, table.sites th {
  position: relative;
}
.col-resize-grip {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 6px;
  cursor: col-resize;
  user-select: none;
  touch-action: none;
  z-index: 1;
  transition: background var(--dur-fast) var(--ease-standard);
}
.col-resize-grip::before {
  content: "";
  position: absolute;
  top: 20%; bottom: 20%; right: 2px;
  width: 2px;
  background: var(--border-default);
  border-radius: 1px;
}
.col-resize-grip:hover::before,
.col-resize-grip.is-active::before { background: var(--ofload-orange); }
body.col-resizing { cursor: col-resize !important; user-select: none; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-dot { width: 6px; height: 6px; border-radius: 999px; }
.badge-allowlist { background: rgba(36, 132, 124, 0.14); color: #1A6963; }
.badge-allowlist .badge-dot { background: var(--success); }
.badge-workspace { background: rgba(1, 10, 38, 0.06); color: var(--text-heading); }
.badge-workspace .badge-dot { background: var(--ofload-navy); }
.badge-password, .badge-public { background: rgba(240, 86, 55, 0.10); color: var(--ofload-orange-hover); }
.badge-password .badge-dot, .badge-public .badge-dot { background: var(--ofload-orange); }

/* ---------- Summary stat tiles ---------- */
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 32px;
}
@media (max-width: 900px) { .summary { grid-template-columns: 1fr; } }
.stat-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color var(--dur-fast) var(--ease-standard),
              box-shadow var(--dur-fast) var(--ease-standard);
  background: #fff;
}
.stat-card:hover { box-shadow: var(--elev-1); }
.stat-label {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.stat-label svg { width: 14px; height: 14px; stroke-width: 2; color: var(--navy-60); }
.stat-value {
  font-size: 40px; line-height: 1.1;
  color: var(--text-heading); font-weight: 600;
  letter-spacing: -0.025em;
  margin-top: 2px;
}
.stat-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.stat-meta strong { color: var(--text-heading); font-weight: 600; }
.stat-meta strong.up   { color: var(--success); }
.stat-meta strong.down { color: var(--ofload-orange-hover); }

/* Colorways — Active sites (navy), Unique viewers (orange), Page views (forest). */
.stat-card.accent-navy {
  background: var(--ofload-navy);
  border-color: var(--ofload-navy);
  color: #fff;
}
.stat-card.accent-navy .stat-label       { color: rgba(255, 255, 255, 0.6); }
.stat-card.accent-navy .stat-label svg   { color: var(--ofload-orange); }
.stat-card.accent-navy .stat-value       { color: #fff; }
.stat-card.accent-navy .stat-meta        { color: rgba(255, 255, 255, 0.65); }
.stat-card.accent-navy .stat-meta strong { color: var(--ofload-orange); }

.stat-card.accent-orange {
  background: var(--ofload-orange);
  border-color: var(--ofload-orange);
  color: #fff;
}
.stat-card.accent-orange .stat-label       { color: rgba(255, 255, 255, 0.85); }
.stat-card.accent-orange .stat-label svg   { color: #fff; }
.stat-card.accent-orange .stat-value       { color: #fff; }
.stat-card.accent-orange .stat-meta        { color: rgba(255, 255, 255, 0.85); }
.stat-card.accent-orange .stat-meta strong { color: #fff; }

.stat-card.accent-forest {
  background: var(--ofload-forest);
  border-color: transparent;
  color: var(--text-heading);
}
.stat-card.accent-forest .stat-label       { color: rgba(1, 10, 38, 0.72); }
.stat-card.accent-forest .stat-label svg   { color: #1F5A52; }
.stat-card.accent-forest .stat-value       { color: var(--text-heading); }
.stat-card.accent-forest .stat-meta        { color: rgba(1, 10, 38, 0.65); }
.stat-card.accent-forest .stat-meta strong.up   { color: #1A6963; }
.stat-card.accent-forest .stat-meta strong.down { color: #8A3B1E; }

/* ---------- Dashboard site list ---------- */
.site-name { display: flex; align-items: center; gap: 14px; }
.site-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--ofload-ice);
  display: flex; align-items: center; justify-content: center;
  color: var(--ofload-navy);
  flex-shrink: 0;
  font-size: 16px; font-weight: 700;
}
.site-icon-ice    { background: var(--ofload-ice); color: var(--ofload-navy); }
.site-icon-orange { background: rgba(240, 86, 55, 0.10); color: var(--ofload-orange); }
.site-icon-forest { background: rgba(170, 195, 188, 0.35); color: #1F5A52; }
.site-icon-navy   { background: rgba(1, 10, 38, 0.08);  color: var(--ofload-navy); }
.site-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
  display: block; line-height: 1.3;
}
.site-title:hover { color: var(--ofload-orange); text-decoration: none; }
.site-path { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.url-cell {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--navy-60);
  word-break: break-all;
}
.url-cell .url-host { color: var(--navy-40); }
.url-cell .url-slug { color: var(--text-heading); font-weight: 500; }

.updated { font-size: 13.5px; color: var(--text-heading); line-height: 1.3; }
.updated .rel { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: transparent; border: 0;
  color: var(--navy-60);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-standard);
}
.action-btn:hover { background: var(--ofload-ice); color: var(--text-heading); }
.action-btn svg { width: 16px; height: 16px; stroke-width: 2; }

.open-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 600;
  color: var(--ofload-orange);
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-standard);
}
.row-actions { white-space: nowrap; }
.open-link:hover { background: rgba(240, 86, 55, 0.08); color: var(--ofload-orange-hover); text-decoration: none; }
.open-link svg { width: 14px; height: 14px; stroke-width: 2.25; transition: transform var(--dur-fast) var(--ease-standard); }
.open-link:hover svg { transform: translate(2px, -2px); }

/* ---------- Tabs (manage views) ---------- */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-default);
  margin: 0 0 20px;
  overflow-x: auto;
  background: transparent;
}
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 12px 18px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-standard);
}
.tabs button:hover { color: var(--text-heading); background: transparent; border-color: transparent; box-shadow: none; transform: none; }
.tabs button.active {
  color: var(--ofload-orange);
  border-bottom-color: var(--ofload-orange);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.tabs-spacer { flex: 1; }
.tabs .help-btn {
  background: #fff;
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 6px 14px;
  height: 32px;
  font-size: 13px; font-weight: 600;
  color: var(--text-heading);
  cursor: pointer;
  align-self: center;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-standard);
}
.tabs .help-btn:hover {
  background: var(--ofload-orange);
  color: #fff;
  border-color: var(--ofload-orange);
}

/* ---------- Two-column helper ---------- */
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ---------- Compact manage header strip ---------- */
.manage-header {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: baseline; justify-content: space-between;
  margin: 0 0 16px;
}
.manage-header h1 { margin: 0; font-size: 32px; }
.manage-header .url-bar {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; color: var(--text-muted);
}

/* ---------- Live preview toggle ---------- */
.preview-toggle {
  margin: 0 0 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: #fff;
}
.preview-toggle > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex; align-items: baseline; gap: 10px;
  user-select: none;
}
.preview-toggle > summary::-webkit-details-marker { display: none; }
.preview-chevron { color: var(--navy-60); transition: transform var(--dur-fast) var(--ease-standard); display: inline-block; }
.preview-toggle[open] .preview-chevron { transform: rotate(90deg); }
.preview-label { font-weight: 600; color: var(--text-heading); font-size: 15px; }
.preview-hint { font-size: 13px; }
.preview-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.preview-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.preview-frame-inline {
  width: 100%; height: 720px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: #fff;
}
@media (max-width: 700px) { .preview-frame-inline { height: 520px; } }

/* ---------- Site structure mini-tree ---------- */
.site-tree {
  list-style: none; padding: 0; margin: 0 0 8px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: #FAFBFC;
  overflow: hidden;
}
.site-tree > li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  border-top: 1px solid #EBEFF3;
}
.site-tree > li:first-child { border-top: 0; }
.tree-home { background: rgba(240, 86, 55, 0.06); font-weight: 500; }
.tree-home-none { background: #fff; color: var(--text-muted); }
.tree-icon { font-size: 16px; flex-shrink: 0; }
.tree-branch { color: var(--navy-40); font-family: ui-monospace, monospace; flex-shrink: 0; }
.tree-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.tree-hint { font-size: 12px; text-align: right; }
.tree-page.tree-effective { background: #FEF8E6; }
.tree-page.tree-hidden { opacity: 0.55; text-decoration: line-through; }
.tree-badge {
  background: #FCD34D; color: #78350F;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  white-space: nowrap;
}
.tree-badge-hidden { background: #E5E7EB; color: #374151; }

/* ---------- Draggable page list ---------- */
.page-list { list-style: none; padding: 0; margin: 8px 0 0; }
.page-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-card);
  background: #fff;
  margin-bottom: 8px;
  cursor: grab;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.page-row:hover { border-color: var(--border-strong); box-shadow: var(--elev-1); }
.page-row.dragging { opacity: 0.4; }
.page-row.drop-above { border-top: 2px solid var(--ofload-orange); }
.page-row.is-home { border-color: var(--ofload-orange); background: rgba(240, 86, 55, 0.03); }
.page-row.is-hidden { background: #F7F8FA; opacity: 0.8; }
.page-row.is-hidden .page-title strong { text-decoration: line-through; }
.page-grip { color: var(--navy-40); font-size: 1.05rem; cursor: grab; user-select: none; padding: 0 4px; }
.page-row:active .page-grip { cursor: grabbing; }
.page-info { flex: 1; min-width: 0; }
.page-title { font-size: 14px; }
.page-actions { display: flex; gap: 12px; align-items: center; flex-shrink: 0; font-size: 13px; }
.home-pill {
  background: var(--ofload-orange); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
  margin-right: 6px; display: inline-block; vertical-align: middle;
  letter-spacing: 0.02em;
}
.hidden-pill {
  background: #E5E7EB; color: #374151;
  font-size: 11px; font-weight: 600;
  padding: 2px 10px; border-radius: 999px;
  margin-left: 6px; display: inline-block; vertical-align: middle;
}

/* ---------- Version history rows ---------- */
.version-row { padding: 12px 0; border-top: 1px solid var(--border-default); }
.version-row:first-child { border-top: 0; padding-top: 0; }
.version-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px; flex-wrap: wrap;
}

/* ---------- Files list ---------- */
ul.files {
  list-style: none; padding: 0; margin: 6px 0 0;
  display: flex; flex-direction: column; gap: 4px;
}
ul.files li {
  font-size: 13px;
  padding: 6px 10px;
  background: #FAFBFC;
  border: 1px solid var(--border-default);
  border-radius: 6px;
}
ul.files code { background: transparent; padding: 0; }

/* ---------- Dashboard empty state ---------- */
.empty-state {
  text-align: center;
  padding: 64px 32px;
  background: #fff;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
}
.empty-state h2 { margin: 0 0 10px; font-size: 22px; }
.empty-state p  { color: var(--text-muted); margin: 0 0 18px; }

/* ---------- Wide container tweaks for manage-grid (legacy) ---------- */
.manage-grid { display: block; } /* v18.3+ dropped the sticky preview sidebar */
