/* ═══════════════════════════════════════════════════════════════
   HyperChicken — Shared Design System
   Fonts: Cormorant Garamond (headings) + DM Sans (body)
   ═══════════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* ── Design Tokens ────────────────────────────────────────────── */
:root {
  /* Color palette — light theme defaults */
  --ink:            #1a1a2e;
  --ink-light:      #4a4a5a;
  --ink-muted:      #8a8a9a;
  --gold:           #c9a84c;
  --gold-hover:     #b8963e;
  --gold-light:     rgba(201, 168, 76, 0.06);
  --gold-muted:     rgba(201, 168, 76, 0.08);
  --parchment:      #ffffff;
  --parchment-dark: #f5f5f5;
  --white:          #ffffff;
  --bg:             #ffffff;
  --hc-bg-page:     #ffffff;
  --hc-bg-sidebar:  #fafafa;
  --hc-text-primary: #1a1a2e;
  --hc-text-secondary: #8a8a9a;
  --hc-accent-text: #c9a84c;
  --success:        #28a745;
  --success-light:  rgba(40, 167, 69, 0.10);
  --warning:        #ffc107;
  --warning-light:  rgba(255, 193, 7, 0.10);
  --danger:         #dc3545;
  --danger-light:   rgba(220, 53, 69, 0.10);
  --info:           #17a2b8;
  --info-light:     rgba(23, 162, 184, 0.10);
  --crimson:        #8b1a1a;
  --emerald:        #1a6b3d;
  --border:         #e8e8ec;
  --border-solid:   #e8e8ec;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
  --shadow-md:  0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg:  0 4px 24px rgba(0,0,0,0.12);
  --shadow-xl:  0 8px 40px rgba(0,0,0,0.16);

  /* Radius */
  --radius:     4px;
  --radius-md:  6px;
  --radius-lg:  8px;
  --radius-xl:  12px;

  /* Sidebar */
  --sidebar-width:     240px;
  --sidebar-collapsed: 0px;

  /* Header */
  --header-height: 52px;

  /* Typography */
  --font-sans:  'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-mono:  'SF Mono', 'Fira Code', monospace;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--hc-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── App Shell ────────────────────────────────────────────────── */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.app-layout,
.main-layout,
.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────── */
header,
.app-header {
  height: var(--header-height);
  background: var(--white);
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  flex-shrink: 0;
  z-index: 200;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-logo {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.015em;
}
.header-logo:hover { color: var(--gold); }
.header-logo em { font-style: normal; color: var(--gold); }
.header-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.header-user {
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.help-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--ink-muted); transition: all 0.2s;
  text-decoration: none;
}
.help-btn:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.header-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  padding: 0.35rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.header-menu-btn:hover { background: rgba(0,0,0,0.04); color: var(--ink); }
.header-btn {
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-muted);
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.header-btn:hover { background: rgba(0,0,0,0.04); color: var(--ink); border-color: var(--ink-muted); }
.header-btn.gold { background: var(--gold); color: white; border-color: var(--gold); }
.header-btn.gold:hover { background: var(--gold-hover); border-color: var(--gold-hover); }

/* Header utility classes used across pages */
.sidebar-toggle {
  background: none;
  border: none;
  color: var(--ink-muted);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sidebar-toggle:hover { background: rgba(0,0,0,0.04); }
.sidebar-toggle svg { width: 20px; height: 20px; display: block; }
.logo {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}
.logo:hover { color: var(--gold-light); }
.header-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}
#userInfo { font-size: 0.875rem; opacity: 0.8; }

/* ── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--hc-bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  transition: width 0.2s, transform 0.2s;
  z-index: 100;
}
.sidebar.collapsed { width: 0; overflow: hidden; }
.sidebar-logo {
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.sidebar-logo-text {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.sidebar-logo-text span { color: var(--gold); }
.sidebar-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  padding: 1rem 1.25rem 0.4rem;
}
.sidebar-nav { flex: 1; padding: 0.35rem 0; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-muted);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  transition: all 0.15s;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
  font-family: var(--font-sans);
}
.nav-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--ink);
}
.nav-item.active {
  background: var(--gold-muted);
  color: var(--gold);
  border-left-color: var(--gold);
  font-weight: 500;
}
.nav-item .nav-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-item.active .nav-icon { opacity: 1; }

/* SVG icons inside .icon spans (sidebar nav) */
.nav-item .icon svg,
.nav-item .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.nav-item .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 0.35rem 0;
  flex-shrink: 0;
}
.nav-item.danger { color: rgba(220,53,69,0.7); }
.nav-item.danger:hover { color: #dc3545; background: rgba(220,53,69,0.08); }

/* ── Main Content ─────────────────────────────────────────────── */
.main-content,
.content {
  flex: 1;
  overflow-y: auto;
  min-width: 0;
  padding: 2rem;
}
.page-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem;
}
.page-body.narrow { max-width: 760px; }
.page-body.wide { max-width: 1400px; }

/* ── Page Header ──────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1rem;
}
.page-header-left {}
.page-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}
.page-subtitle {
  font-size: 0.875rem;
  color: var(--ink-muted);
  margin-top: 0.3rem;
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}
.breadcrumb-link { color: var(--gold); text-decoration: none; }
.breadcrumb-link:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border-solid); }
.page-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

/* ── Cards ────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 1.5rem; }
.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.card-footer {
  padding: 0.9rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--parchment);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Buttons ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: var(--font-sans);
  cursor: pointer;
  border: 1px solid var(--border-solid);
  background: var(--white);
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  line-height: 1;
}
.btn:hover {
  background: var(--parchment);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn-primary {
  background: var(--gold);
  color: white;
  border-color: var(--gold);
}
.btn-primary:hover {
  background: var(--gold-hover);
  border-color: var(--gold-hover);
  box-shadow: 0 3px 10px rgba(201,162,39,0.35);
}
.btn-secondary {
  background: transparent;
  color: var(--gold);
  border-color: var(--gold);
}
.btn-secondary:hover { background: var(--gold-muted); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-muted);
}
.btn-ghost:hover { background: var(--parchment-dark); color: var(--ink); border-color: var(--border-solid); }
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(220,53,69,0.35);
}
.btn-danger:hover { background: var(--danger-light); }
.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
}
.btn-success:hover { background: #218838; border-color: #218838; box-shadow: 0 3px 10px rgba(40,167,69,0.3); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-xl { padding: 1rem 2rem; font-size: 1.05rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; }
.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem;
  color: var(--ink-muted);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--parchment-dark); color: var(--ink); }

/* ── Forms ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}
.form-hint { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.3rem; }
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-solid);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--ink);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.12);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--ink-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-select { cursor: pointer; }
.input-group { display: flex; gap: 0; }
.input-group .form-input { border-radius: var(--radius) 0 0 var(--radius); }
.input-group .btn { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }

/* ── Badges / Tags ────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
}
.badge-gold    { background: var(--gold-light); color: #7a5f00; }
.badge-success { background: var(--success-light); color: #155724; }
.badge-danger  { background: var(--danger-light); color: #721c24; }
.badge-warning { background: var(--warning-light); color: #856404; }
.badge-info    { background: var(--info-light); color: #0c5460; }
.badge-muted   { background: var(--parchment-dark); color: var(--ink-muted); }
.badge-count {
  background: var(--gold);
  color: white;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 0.7rem;
}

/* ── Tables ───────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: var(--parchment-dark); }
th {
  padding: 0.7rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--parchment); }
tbody tr:hover { background: var(--gold-light); }

/* ── Progress ─────────────────────────────────────────────────── */
.progress-wrap {
  background: var(--parchment-dark);
  border-radius: 100px;
  overflow: hidden;
  height: 6px;
}
.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 100px;
  transition: width 0.3s ease;
}
.progress-bar.success { background: var(--success); }
.progress-label { font-size: 0.78rem; color: var(--ink-muted); margin-top: 0.3rem; }

/* ── Step Indicator ───────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-solid);
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step.active .step-num { border-color: var(--gold); background: var(--gold); color: white; }
.step.done .step-num { border-color: var(--success); background: var(--success); color: white; }
.step-label { font-size: 0.82rem; font-weight: 500; color: var(--ink-muted); }
.step.active .step-label { color: var(--ink); font-weight: 600; }
.step.done .step-label { color: var(--success); }
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--border-solid);
  margin: 0 0.5rem;
  max-width: 60px;
}
.step.done + .step-connector { background: var(--success); }

/* ── Skeleton Loaders ─────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--parchment-dark) 25%, var(--parchment) 50%, var(--parchment-dark) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text.lg { height: 20px; }
.skeleton-text.sm { height: 10px; }

/* ── Modals ───────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal.modal-sm { max-width: 420px; }
.modal.modal-lg { max-width: 800px; }
.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
}
.modal-body { padding: 1.5rem; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* ── Dropzone ─────────────────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border-solid);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--parchment);
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--gold);
  background: var(--gold-light);
}
.dropzone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.6; }
.dropzone-title { font-size: 0.95rem; font-weight: 500; color: var(--ink); margin-bottom: 0.25rem; }
.dropzone-sub { font-size: 0.82rem; color: var(--ink-muted); }

/* ── File Preview Card ────────────────────────────────────────── */
.file-preview-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.file-preview-icon { font-size: 1.6rem; flex-shrink: 0; }
.file-preview-info { flex: 1; min-width: 0; }
.file-preview-name { font-size: 0.875rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-preview-meta { font-size: 0.78rem; color: var(--ink-muted); margin-top: 2px; }

/* ── Filter Pills ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.filter-pill {
  padding: 0.3rem 0.8rem;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-solid);
  background: var(--white);
  color: var(--ink-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--gold); color: var(--gold); }
.filter-pill.active {
  background: var(--gold);
  border-color: var(--gold);
  color: white;
}
.filter-search {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-solid);
  border-radius: 100px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--white);
  flex: 1;
  max-width: 200px;
  min-width: 120px;
}
.filter-search:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201,162,39,0.12);
}

/* ── Alert / Toast ────────────────────────────────────────────── */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  border: 1px solid transparent;
}
.alert-success { background: var(--success-light); border-color: rgba(40,167,69,0.25); color: #155724; }
.alert-danger  { background: var(--danger-light);  border-color: rgba(220,53,69,0.25);  color: #721c24; }
.alert-warning { background: var(--warning-light); border-color: rgba(255,193,7,0.35);  color: #856404; }
.alert-info    { background: var(--info-light);    border-color: rgba(23,162,184,0.25); color: #0c5460; }

/* ── Spinner ──────────────────────────────────────────────────── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  flex-shrink: 0;
}
.spinner.dark { border-color: rgba(0,0,0,0.15); border-top-color: var(--gold); }
.spinner.lg { width: 24px; height: 24px; border-width: 3px; }

/* ── Empty State ──────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--ink-muted);
}
.empty-state-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 0.4rem;
}
.empty-state-body { font-size: 0.875rem; max-width: 340px; margin: 0 auto 1.25rem; }

/* ── Utilities ────────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-muted { color: var(--ink-muted); }
.text-gold { color: var(--gold); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-serif { font-family: var(--font-serif); }
.text-mono { font-family: var(--font-mono); }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.72rem; }
.text-lg { font-size: 1rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-sm { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.6rem;
}

/* ── Diff Colors ──────────────────────────────────────────────── */
.diff-del {
  color: #c0392b;
  background: rgba(192,57,43,0.08);
  text-decoration: line-through;
  border-radius: 2px;
}
.diff-ins {
  color: #2563eb;
  background: rgba(37,99,235,0.08);
  text-decoration: underline;
  border-radius: 2px;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { position: fixed; top: 0; left: 0; height: 100%; transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .page-body { padding: 1rem; }
  .page-header { flex-direction: column; }
  .page-header-actions { width: 100%; }
  .steps { flex-wrap: wrap; }
}

/* ── Dark Mode ───────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --hc-bg-page:     #0f0f1a;
    --bg:             #0f0f1a;
    --hc-bg-sidebar:  #13132a;
    --parchment:      #0f0f1a;
    --parchment-dark: #1a1a2e;
    --white:          #1a1a2e;
    --hc-text-primary: #e8e8ec;
    --hc-text-secondary: #6b6b80;
    --ink:            #e8e8ec;
    --ink-light:      #b0b0c0;
    --ink-muted:      #6b6b80;
    --border:         #2a2a3e;
    --border-solid:   #2a2a3e;
    --gold-light:     rgba(201, 168, 76, 0.1);
    --gold-muted:     rgba(201, 168, 76, 0.12);
  }
}

/* ── HyperChicken Popup Pattern ────────────────────────── */
.hc-popup {
  position: fixed;
  background: var(--bg, #fff);
  border: 1px solid var(--border, #e8e8ec);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  padding: 4px;
  z-index: 10001;
  min-width: 160px;
  max-width: 280px;
  max-height: 320px;
  overflow-y: auto;
}
.hc-popup::-webkit-scrollbar { width: 4px; }
.hc-popup::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 2px; }

.hc-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  color: var(--text, #1a1a2e);
  border-radius: 6px;
  text-align: left;
  transition: background 0.1s;
  white-space: nowrap;
}
.hc-popup-item:hover {
  background: rgba(201, 168, 76, 0.06);
}
.hc-popup-item.active {
  color: var(--gold, #c9a84c);
  background: rgba(201, 168, 76, 0.06);
}
.hc-popup-item.danger { color: #dc2626; }
.hc-popup-item.danger:hover { background: rgba(220, 38, 38, 0.06); }
.hc-popup-item:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.hc-popup-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-secondary, #8a8a9a);
}
.hc-popup-item:hover .hc-popup-icon { color: var(--text, #1a1a2e); }
.hc-popup-item.danger .hc-popup-icon { color: #dc2626; }

.hc-popup-divider {
  height: 1px;
  background: var(--border, #e8e8ec);
  margin: 4px 0;
}

.hc-popup-label {
  padding: 6px 12px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #8a8a9a);
}

/* With description */
.hc-popup-item-desc {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hc-popup-item-desc .popup-title {
  font-size: 13px;
  font-weight: 500;
}
.hc-popup-item-desc .popup-desc {
  font-size: 11px;
  color: var(--text-secondary, #8a8a9a);
  white-space: normal;
}

/* Checkable items */
.hc-popup-item .popup-check {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border, #e8e8ec);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.hc-popup-item.checked .popup-check {
  background: var(--gold, #c9a84c);
  border-color: var(--gold, #c9a84c);
  color: white;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .hc-popup {
    background: var(--bg, #0f0f1a);
    border-color: var(--border, #2a2a3e);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  }
}
