/* Urban Parallax — Admin Styles */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700&family=Source+Sans+3:wght@400;600&family=JetBrains+Mono:wght@400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

:root {
  --bg:     #F5F3EE;
  --ink:    #1A1A1A;
  --muted:  #888;
  --accent: #C4553A;
  --slate:  #4A6670;
  --border: #D9D5CC;
  --panel:  #FFFFFF;

  --font-heading: 'Barlow Condensed', Arial Narrow, sans-serif;
  --font-body:    'Source Sans 3', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', monospace;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Auth Gate ──────────────────────────────────────────────────────────── */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.4s ease;
}

.auth-gate.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ─── Image upload button ────────────────────────────────────────────────── */
.image-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.image-input-group input[type="text"] { flex: 1; }
.upload-btn {
  flex-shrink: 0;
  padding: 7px 12px;
  background: var(--slate);
  color: #fff;
  font-size: 12px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.upload-btn:hover { background: var(--ink); }
.upload-file-input { display: none; }

/* ─── Netlify publish section ────────────────────────────────────────────── */
.netlify-setup {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.netlify-setup h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}
.netlify-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}
.netlify-hint a { color: var(--accent); }

/* ── Extra media upload slots ─────────────────────────────────────────────── */
.extra-media-section {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.extra-media-label {
  font-size: 12px;
  margin-bottom: 10px;
}
.extra-media-label strong { color: var(--ink); }

.extra-media-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.em-slot {
  width: 76px;
  height: 76px;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

/* Empty slot — the "+" button */
.em-slot--empty {
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}
.em-slot--empty:hover { border-color: var(--accent); }

.em-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  line-height: 1.35;
  transition: color 0.15s;
}
.em-slot--empty:hover .em-add-btn { color: var(--accent); }
.em-file-input { display: none; }

/* Filled slot */
.em-slot--filled {
  border: 1px solid var(--border);
  background: #e8e4dc;
}
.em-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.em-thumb--video {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a1a;
  color: rgba(255,255,255,0.8);
  font-size: 22px;
}
.em-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  padding: 3px 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.em-type-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.6);
  margin-right: 3px;
}
.em-name {
  font-size: 9px;
  color: rgba(255,255,255,0.85);
}
.em-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,0.65);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}
.em-slot--filled:hover .em-remove { opacity: 1; }
.em-remove:hover { background: var(--accent); }

.backup-folder-label {
  font-size: 13px;
  font-family: var(--font-mono, monospace);
  padding: 4px 10px;
  border-radius: 4px;
}
.backup-folder-label--none { color: var(--muted); }
.backup-folder-label--warn { color: #9a6800; background: #fff8e6; }
.backup-folder-label:not(.backup-folder-label--none):not(.backup-folder-label--warn) {
  color: #2a7a4a; background: #e8f5ee;
}

.status--success { color: #2a7a4a; }
.status--error   { color: var(--accent); }

.auth-box {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 48px 56px;
  text-align: center;
  width: 320px;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2em;
  margin-bottom: 6px;
}

.auth-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 28px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-form input {
  border: 1px solid var(--border);
  padding: 10px 14px;
  background: var(--bg);
  font-size: 14px;
  outline: none;
  width: 100%;
}
.auth-form input:focus { border-color: var(--accent); }

.auth-form button {
  background: var(--ink);
  color: #fff;
  padding: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-form button:hover { background: var(--accent); }

.auth-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-top: 10px;
}
.auth-sent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888;
  line-height: 1.6;
  margin-top: 16px;
  letter-spacing: 0.05em;
}

/* ─── Login page (split panel) ───────────────────────────────────────────── */
body.login-page {
  background: #0D0D0D;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-wrap {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 840px;
  min-height: 480px;
  border-radius: 3px;
  overflow: hidden;
  background: #F5F3EE;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55);
}

.login-left {
  flex: 1.1;
  position: relative;
  background: linear-gradient(145deg, #0D0D0D 0%, #1C0C08 60%, #2A1205 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 52px 44px;
}

.login-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.login-blob--1 {
  width: 320px;
  height: 320px;
  top: -70px;
  left: -70px;
  background: radial-gradient(circle, rgba(196,85,58,0.20) 0%, transparent 70%);
  filter: blur(40px);
}
.login-blob--2 {
  width: 200px;
  height: 200px;
  bottom: -50px;
  right: 30px;
  background: radial-gradient(circle, rgba(196,85,58,0.13) 0%, transparent 70%);
  filter: blur(32px);
}

.login-divider {
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(196,85,58,0.6) 40%, rgba(196,85,58,0.6) 60%, transparent);
}

.login-left-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-mark {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
}
.login-rect {
  display: block;
  width: 10px;
}
.login-rect--a {
  height: 26px;
  background: #FFFFFF;
}
.login-rect--b {
  height: 26px;
  background: #C4553A;
  margin-top: 9px;
}

.login-wordmark {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-wordmark-name {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #FFFFFF;
  line-height: 1;
}
.login-wordmark-rule {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.12);
}
.login-wordmark-tagline {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
}

.login-right {
  flex: 1;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 52px 44px;
}

.login-form-wrap {
  width: 100%;
  max-width: 260px;
}

.login-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-bottom: 6px;
}

.login-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-form input {
  border: 1px solid var(--border);
  padding: 11px 14px;
  background: var(--bg);
  font-size: 14px;
  outline: none;
  width: 100%;
  border-radius: 2px;
}
.login-form input:focus { border-color: var(--accent); }

.login-form button {
  background: var(--ink);
  color: #fff;
  padding: 11px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 2px;
}
.login-form button:hover { background: var(--accent); }

.login-error {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.1em;
  margin-top: 10px;
}

.login-sent {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888;
  line-height: 1.6;
  letter-spacing: 0.05em;
}

/* ─── Admin UI ───────────────────────────────────────────────────────────── */
.admin-ui { display: flex; flex-direction: column; min-height: 100vh; }
.admin-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }

/* ─── Desktop sidebar (hidden on mobile) ─────────────────────────────────── */
.admin-sidebar { display: none; }

@media (min-width: 1024px) {
  .admin-ui {
    flex-direction: row;
    align-items: stretch;
  }

  .admin-sidebar {
    display: flex;
    flex-direction: column;
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
    background: var(--ink);
    color: #fff;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
  }

  /* Hide mobile header and tabs — sidebar takes over */
  .admin-header,
  .admin-tabs { display: none !important; }

  /* Sidebar logo area */
  .sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
  }
  .sidebar-mark {
    display: flex;
    align-items: flex-start;
    gap: 3px;
    flex-shrink: 0;
  }
  .sidebar-rect {
    display: block;
    width: 6px;
  }
  .sidebar-rect--a { height: 16px; background: #fff; }
  .sidebar-rect--b { height: 16px; background: var(--accent); margin-top: 5px; }
  .sidebar-wordmark { display: flex; flex-direction: column; gap: 2px; }
  .sidebar-name {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1;
  }
  .sidebar-tagline {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.25);
    text-transform: uppercase;
  }

  /* Nav */
  .sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 16px 0;
    flex: 1;
  }
  .sidebar-ni {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    cursor: pointer;
    text-align: left;
    transition: color 0.15s, background 0.15s;
  }
  .sidebar-ni:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); }
  .sidebar-ni--active { color: #fff; background: rgba(255,255,255,0.07); }
  .sidebar-ni--new { color: var(--accent); opacity: 0.85; }
  .sidebar-ni--new:hover { opacity: 1; }
  .sidebar-ni-badge {
    margin-left: auto;
    background: rgba(232,144,10,0.25);
    color: #e8900a;
    font-size: 9px;
    padding: 1px 6px;
    border-radius: 10px;
  }

  /* User section */
  .sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .sidebar-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
  }
  .sidebar-uname {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.7);
    margin-bottom: 2px;
  }
  .sidebar-logout {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.2);
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
  }
  .sidebar-logout:hover { color: rgba(255,255,255,0.6); }
}

.admin-header {
  background: var(--ink);
  color: #fff;
  padding: 14px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.admin-logo {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: #aaa;
  text-decoration: none;
  transition: color 0.15s;
}
.admin-logo:hover { color: #fff; }

.admin-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.admin-tabs {
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  gap: 0;
}

.admin-tab {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover { color: var(--ink); }
.admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ─── Panel ──────────────────────────────────────────────────────────────── */
.admin-panel { display: none; }
.admin-panel.active { display: block; }

.admin-form-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.admin-section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.admin-subsection {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--slate);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.admin-hint {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.admin-hint code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  padding: 1px 5px;
}

.admin-empty {
  color: var(--muted);
  font-style: italic;
  padding: 20px 0;
}

/* ─── Form Fields ────────────────────────────────────────────────────────── */
.admin-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 120px;
}

.admin-field--wide { flex: 2; min-width: 200px; }

.admin-field label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
}

.admin-field input,
.admin-field select,
.admin-field textarea {
  border: 1px solid var(--border);
  padding: 8px 11px;
  background: var(--panel);
  font-size: 14px;
  outline: none;
  width: 100%;
  resize: vertical;
}
.admin-field input:focus,
.admin-field select:focus,
.admin-field textarea:focus {
  border-color: var(--accent);
}

/* ─── Quick-Facts Editor ─────────────────────────────────────────────────── */
.qf-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.qf-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.qf-row input {
  flex: 1;
  border: 1px solid var(--border);
  padding: 7px 10px;
  background: var(--panel);
  font-size: 14px;
  outline: none;
}
.qf-row input:focus { border-color: var(--accent); }

.qf-row-sep {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--border);
  flex-shrink: 0;
}

.qf-remove {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  background: none;
  border: none;
  transition: color 0.15s;
}
.qf-remove:hover { color: var(--accent); }

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.admin-btn {
  padding: 10px 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.admin-btn--ghost {
  background: none;
  color: var(--ink);
  border-color: var(--border);
}
.admin-btn--ghost:hover { border-color: var(--ink); }

.admin-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.admin-btn--primary:hover { background: #a8442e; border-color: #a8442e; }

.admin-btn--publish {
  background: #2a7a4a;
  border-color: #2a7a4a;
  color: #fff;
}
.admin-btn--publish:hover { background: #1f5c38; border-color: #1f5c38; }

.admin-btn--sm { padding: 7px 16px; font-size: 9px; }

.admin-btn--danger {
  color: #c44;
  border-color: #c44;
}
.admin-btn--danger:hover { background: #c44; color: #fff; }

.admin-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.admin-actions {
  display: flex;
  gap: 12px;
  margin-top: 36px;
  flex-wrap: wrap;
}

.export-status {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--slate);
  margin-top: 12px;
  letter-spacing: 0.1em;
}

/* ─── Reorder list ───────────────────────────────────────────────────────── */
.reorder-list {
  border: 1px solid var(--border);
  background: var(--panel);
  min-height: 80px;
  padding: 8px;
  margin: 20px 0;
}

.reorder-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid transparent;
  cursor: grab;
  user-select: none;
  background: var(--panel);
  transition: background 0.1s;
}
.reorder-item:hover { background: var(--bg); }
.reorder-item.dragging { opacity: 0.5; border-color: var(--accent); }

.reorder-handle {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--border);
}

.reorder-order {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  width: 24px;
  text-align: center;
}

.reorder-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.reorder-date {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
}

/* ─── Admin logout ───────────────────────────────────────────────────────── */
#admin-logout {
  margin-left: auto;
  font-size: 9px;
  padding: 6px 14px;
  border-color: #555;
  color: #aaa;
}
#admin-logout:hover { border-color: #fff; color: #fff; }

/* ─── Browse tab ─────────────────────────────────────────────────────────── */
.browse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* Sticky "Save & Go Live" bar — shown when there are unsaved changes */
.browse-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #1e3a2a;
  border: 1px solid #2a7a4a;
  border-radius: 4px;
  transition: opacity 0.2s;
}
.browse-save-bar--hidden {
  display: none;
}
#browse-save-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #6ecf96;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#btn-browse-save {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Status message shown below save bar */
#browse-status {
  margin-bottom: 12px;
  min-height: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.browse-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Awaiting-pair banner */
.browse-awaiting-banner {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a06010;
  background: #FFF8F2;
  border: 1px solid rgba(196,130,10,0.18);
  border-bottom: none;
  padding: 8px 14px;
}

/* Card row */
.browse-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top: none;
  cursor: pointer;
  transition: background 0.12s;
  position: relative;
}
.browse-list .browse-card:first-of-type { border-top: 1px solid var(--border); }
.browse-card:hover { background: #faf9f6; }

/* Split thumbnail */
.browse-thumb {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  width: 72px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg);
}
.browse-thumb-half {
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}
.browse-thumb-div {
  background: rgba(26,26,26,0.15);
}
.browse-thumb-div--awaiting {
  background: rgba(196,130,10,0.35);
}

.browse-card-body {
  flex: 1;
  min-width: 0;
}

.browse-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browse-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
}

.browse-status {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
}
.browse-status--published { background: #e6f4ec; color: #2a7a4a; }
.browse-status--awaiting  { background: #fff3e0; color: #a06010; }
.browse-status--draft     { background: #f5f0e8; color: #8a6a2a; }

.browse-card-date {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* Delete button — visible on hover */
.browse-card-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s, border-color 0.15s;
}
.browse-card:hover .browse-card-delete { opacity: 1; }
.browse-card-delete:hover { color: var(--accent); border-color: var(--accent); }

/* FAB — new comparison, mobile only */
.browse-fab {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(196,85,58,0.45);
  z-index: 100;
  transition: background 0.15s;
}
.browse-fab:hover { background: #b04030; }

/* ─── Wizard ─────────────────────────────────────────────────────────────── */
.wiz-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 100px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.wiz-hidden-field { display: none !important; }

/* Step indicator */
.wiz-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 0 28px;
}
.wiz-ind-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: default;
}
.wiz-ind-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
  display: block;
}
.wiz-ind-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s;
}
.wiz-ind-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  min-width: 32px;
  max-width: 64px;
  margin-bottom: 18px;
  transition: background 0.2s;
}
.wiz-ind-active .wiz-ind-dot   { background: var(--accent); }
.wiz-ind-active .wiz-ind-label { color: var(--accent); }
.wiz-ind-done   .wiz-ind-dot   { background: #2a7a4a; }
.wiz-ind-done   .wiz-ind-label { color: #2a7a4a; }
.wiz-ind-line--done { background: #2a7a4a; }

/* Step panes */
.wiz-pane { display: none; flex-direction: column; gap: 16px; }
.wiz-pane.active { display: flex; }

.wiz-step-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}

/* Step-1 photo split */
.wiz-photo-split {
  display: grid;
  grid-template-columns: 1fr 3px 1fr;
  height: 260px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg);
}
.wiz-photo-side {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wiz-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  pointer-events: none;
}
.wiz-photo-placeholder span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wiz-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.wiz-photo-overlay {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: rgba(255,255,255,0.85);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.wiz-photo-side:hover .wiz-photo-overlay { opacity: 1; }
.wiz-photo-divider {
  background: var(--accent);
  opacity: 0.45;
}

/* Thumb strip (steps 2 & 3) */
.wiz-thumb-strip {
  display: grid;
  grid-template-columns: 1fr 2px 1fr;
  height: 52px;
  border-radius: 2px;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}
.wiz-thumb-half {
  background-size: cover;
  background-position: center;
  background-color: var(--bg);
}
.wiz-thumb-divider { background: rgba(196,85,58,0.4); }

.wiz-field-group { display: flex; flex-direction: column; gap: 12px; }

/* Step-3 side tabs */
.wiz-side-tabs {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.wiz-side-tab {
  flex: 1;
  padding: 8px;
  background: var(--bg);
  border: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.wiz-side-tab + .wiz-side-tab { border-left: 1px solid var(--border); }
.wiz-side-tab.is-active {
  background: var(--ink);
  color: #fff;
}

/* Step-4 extra media columns */
.wiz-extra-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.wiz-extra-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

/* Wizard action bar */
.wiz-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
}
.wiz-actions-right { display: flex; gap: 8px; }

/* ─── Editor tab (legacy stubs kept for compatibility) ────────────────────── */
.admin-form-wide {
  max-width: 1400px;
}

.editor-topbar {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.admin-field--xl { flex: 3; min-width: 240px; }

.admin-hint-inline {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.editor-intro-field {
  margin-bottom: 28px;
}

.editor-cities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}

.editor-city {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.editor-city-head {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  padding: 10px 0 10px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--accent);
}

/* Image row: input + thumbnail side by side */
.editor-image-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.editor-image-row .admin-field { flex: 1; }

.editor-image-preview {
  width: 120px;
  height: 60px;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 22px; /* align with input (after label) */
}

.editor-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-placeholder {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--border);
  letter-spacing: 0.1em;
  text-align: center;
}

/* Body row: textarea left, preview right */
.editor-body-row {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
}

.editor-body-row .admin-field {
  flex: 1;
}

.editor-body-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.editor-preview-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 5px;
}

.body-preview-content {
  flex: 1;
  border: 1px solid var(--border);
  padding: 10px 14px;
  background: var(--bg);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  overflow-y: auto;
  max-height: 400px;
  min-height: 120px;
}

.body-preview-content h1,
.body-preview-content h2,
.body-preview-content h3 {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  margin: 0.8em 0 0.4em;
}

.body-preview-content p { margin-bottom: 0.8em; }

.preview-empty {
  color: var(--border);
  font-style: italic;
  font-size: 12px;
}

/* Advanced collapsible */
.editor-advanced {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  margin-bottom: 24px;
}

.editor-advanced-toggle {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--slate);
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
}

.editor-advanced-toggle:hover { color: var(--ink); }

.editor-advanced-inner {
  padding-top: 20px;
}

.editor-actions {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

/* ─── Publish tab ────────────────────────────────────────────────────────── */
.publish-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 36px;
  max-width: 600px;
}

.publish-step {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.publish-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  flex-shrink: 0;
}

.publish-step strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.publish-step p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.publish-step code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg);
  padding: 2px 6px;
  border: 1px solid var(--border);
}

/* ── Auto-managed fields (always hidden — slug + status) ─────────────────── */
.editor-auto-field { display: none !important; }

/* Tab-aware field visibility rules removed — wizard handles side visibility explicitly */

/* ── City tabs (mobile only) ─────────────────────────────────────────────── */
/* In wizard, city-tabs are always visible (step 2 body text) */
.city-tabs { display: flex; margin-bottom: 0; }

.city-tab {
  flex: 1;
  padding: 11px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.city-tab:first-child { border-radius: 6px 0 0 0; border-right: none; }
.city-tab:last-child  { border-radius: 0 6px 0 0; }
.city-tab.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── Browse cards — mobile ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Show FAB, hide desktop new-comparison button */
  .browse-fab { display: flex; align-items: center; justify-content: center; }
  #btn-new    { display: none; }

  /* Card adjustments */
  .browse-card {
    gap: 10px;
    padding: 10px 12px;
  }

  .browse-thumb {
    width: 56px;
    height: 36px;
  }

  /* Delete always visible on mobile (no hover state) */
  .browse-card-delete { opacity: 1; }

  .browse-card-body {
    flex: 1;
    min-width: 0;
  }

  .browse-card-title {
    font-size: 15px;
    white-space: normal;
    line-height: 1.25;
    margin-bottom: 3px;
  }

  .browse-card-meta {
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 9px;
  }

  /* Browse header — keep as row (btn-new hidden, FAB used instead) */
  .browse-header {
    align-items: center;
  }
}

/* ── Mobile breakpoint ────────────────────────────────────────────────────── */
@media (max-width: 767px) {

  /* Tighter overall padding */
  .admin-form-wrap {
    padding: 16px 12px 80px;
  }

  /* Header / nav */
  .header-inner { padding: 0 12px; }

  /* Stack every row — one field per line */
  .editor-topbar,
  .admin-row {
    flex-direction: column;
    gap: 12px;
  }

  /* Every field takes full width */
  .admin-field,
  .admin-field--wide,
  .admin-field--xl {
    flex: none;
    min-width: 0;
    width: 100%;
  }

  /* Inputs large enough to prevent iOS auto-zoom */
  .admin-field input,
  .admin-field select,
  .admin-field textarea {
    font-size: 16px;
    padding: 10px 12px;
  }

  /* City tabs visible on mobile */
  .city-tabs { display: flex; margin-bottom: 0; }

  /* Cities: single column, tabbed */
  .editor-cities {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .editor-city {
    display: none;
    border-top: 2px solid var(--accent);
    padding-top: 16px;
  }
  .editor-city.is-active { display: flex; }

  /* Stack body text + preview (preview below textarea) */
  .editor-body-row {
    flex-direction: column;
  }
  .editor-body-row .admin-field,
  .editor-body-row > div {
    width: 100%;
  }

  /* Stack image row */
  .editor-image-row {
    flex-direction: column;
  }
  .editor-image-preview {
    width: 100%;
    height: 100px;
    margin-top: 0;
  }

  /* Quick facts rows */
  .qf-row { flex-direction: column; gap: 4px; }
  .qf-sep { display: none; }

  /* Extra media slots — slightly bigger on mobile */
  .em-slot { width: 70px; height: 70px; }

  /* Buttons full-width */
  .admin-actions {
    flex-direction: column;
  }
  .admin-btn { width: 100%; text-align: center; }

  /* Editor save bar */
  .editor-actions {
    position: sticky;
    bottom: 0;
    background: var(--panel);
    border-top: 1px solid var(--border);
    padding: 12px;
    margin: 0 -12px;
    z-index: 10;
    flex-direction: row;
    gap: 8px;
  }
  .editor-actions .admin-btn { width: auto; flex: 1; }

  /* ── Prevent iOS Safari zoom on focus (requires font-size ≥ 16px) ── */
  .admin-field input,
  .admin-field select,
  .admin-field textarea,
  .auth-form input,
  .qf-row input {
    font-size: 16px !important;
  }

  /* Date input: constrain width so it never overflows */
  input[type="date"] {
    width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
  }

  /* Unpublish/Delete action row — stack on very narrow screens */
  .browse-card-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .browse-card-actions .admin-btn {
    width: auto;
    flex: 1 1 auto;
  }

  /* Login page — mobile: stack vertically */
  body.login-page {
    padding: 0;
    align-items: stretch;
  }
  .login-wrap {
    flex-direction: column;
    min-height: 100vh;
    border-radius: 0;
    max-width: none;
    box-shadow: none;
  }
  .login-left {
    flex: none;
    padding: 32px 28px 24px;
  }
  .login-left-content {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }
  .login-divider {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(196,85,58,0.6) 40%, rgba(196,85,58,0.6) 60%, transparent);
  }
  .login-right {
    flex: 1;
    padding: 36px 28px;
    align-items: flex-start;
  }
  .login-form input,
  .login-form button { font-size: 16px !important; }
}
