* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --white: #ffffff;
  --off-white: #f7f9fc;
  --cloud: #eef2f8;
  --ink: #000000;        /* deepest black */
  --navy: #0a0a0a;       /* Ontic black */
  --navy-2: #333333;     /* mid dark grey */
  --navy-soft: rgba(0, 0, 0, 0.06);
  --orange: #ff7a1a;
  --orange-2: #ff9648;
  --orange-soft: rgba(255, 122, 26, 0.12);
  --border: rgba(0, 0, 0, 0.10);
  --border-strong: rgba(0, 0, 0, 0.20);
  --text: #0a0a0a;
  --text-dim: #566482;
  --text-invert: #ffffff;
  --danger: #d94848;
  --ok: #10a37f;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08), 0 12px 32px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10), 0 24px 60px rgba(0, 0, 0, 0.10);
  --shadow-orange: 0 8px 22px rgba(255, 122, 26, 0.32), 0 2px 6px rgba(255, 122, 26, 0.28);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  display: grid;
  grid-template-columns: 280px 1fr;
  overflow: hidden;
  background: var(--off-white);
  position: relative;
  -webkit-font-smoothing: antialiased;
}
body.no-auth { display: block; }
body.no-auth .authed-only { display: none !important; }
body.no-auth .auth-view { display: flex; }
body:not(.no-auth) .auth-view { display: none; }

/* ── Auth screen ──────────────────────────────── */
.auth-view {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.auth-tabs {
  display: flex;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.auth-tab.active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}
.auth-form.hidden { display: none; }
.auth-note {
  margin-top: 20px;
  padding: 12px 14px;
  background: var(--navy-soft);
  border-radius: 10px;
  color: var(--navy);
  font-size: 12.5px;
  line-height: 1.5;
}

/* Ambient background: soft orange + navy blobs behind glass surfaces */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #ffb27a 0%, rgba(255,178,122,0) 70%);
  top: -140px; right: -120px;
}
body::after {
  width: 640px; height: 640px;
  background: radial-gradient(circle, rgba(0,0,0,0.06) 0%, rgba(0,0,0,0) 70%);
  bottom: -220px; left: 100px;
}
body > * { position: relative; z-index: 1; }

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  background: linear-gradient(180deg, var(--navy) 0%, var(--ink) 100%);
  color: var(--text-invert);
  padding: 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(255,122,26,0.18) 0%, rgba(255,122,26,0) 45%),
    radial-gradient(circle at 80% 90%, rgba(255,150,72,0.12) 0%, rgba(255,150,72,0) 40%);
  pointer-events: none;
}
.sidebar > * { position: relative; }

.brand { display: flex; gap: 12px; align-items: center; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.brand-mark img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 4px;
  display: block;
}
.brand-name { font-weight: 600; letter-spacing: -0.01em; font-size: 15px; }
.brand-sub { color: rgba(255,255,255,0.6); font-size: 12px; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.nav-btn {
  background: transparent; color: rgba(255,255,255,0.7);
  border: 1px solid transparent;
  padding: 11px 14px; border-radius: 10px;
  text-align: left; font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  transition: all 0.18s ease;
}
.nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.nav-btn.hidden { display: none; }
.nav-btn.active {
  background: rgba(255,255,255,0.09);
  color: #fff;
  border-color: rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.tip {
  margin-top: auto;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  padding: 14px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
}
.tip b { color: #fff; }

/* Sidebar user strip */
.user-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  gap: 8px;
}
.user-email {
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.btn-ghost.tiny {
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.14);
}
.btn-ghost.tiny:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

/* Page head row (title + actions) */
.page-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
}
.page-head-row h1 { margin-bottom: 6px; }
.page-head-row p { margin-bottom: 0; }
.page-head-actions { display: flex; gap: 10px; }

/* Projects gallery */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.project-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card .p-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.project-card .p-meta {
  font-size: 12px;
  color: var(--text-dim);
}
.project-card .p-tags {
  display: flex; gap: 6px; margin-top: 6px;
}
.project-card .p-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--navy-soft);
  color: var(--navy);
}
.project-card .p-tag.live {
  background: rgba(16, 163, 127, 0.12);
  color: var(--ok);
}
.project-card .p-tag.live::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ok);
}
.project-card .p-delete {
  position: absolute;
  top: 12px; right: 12px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(11, 26, 53, 0.06);
  color: var(--text-dim);
  border: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease;
  font-size: 14px;
}
.project-card:hover .p-delete { opacity: 1; }
.project-card .p-delete:hover { background: var(--danger); color: #fff; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state.hidden { display: none; }
.empty-icon { font-size: 44px; opacity: 0.4; margin-bottom: 12px; }
.empty-title { font-size: 18px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.empty-sub { font-size: 14px; }

/* ── Main ────────────────────────────────────────────── */
.main { padding: 36px 44px; overflow: auto; }
.page-head h1 {
  font-size: 30px;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 700;
}
.page-head p { color: var(--text-dim); margin-bottom: 28px; font-size: 15px; }

.view.hidden { display: none; }

.grid {
  display: grid;
  grid-template-columns: minmax(380px, 500px) 1fr;
  gap: 22px;
  height: calc(100vh - 170px);
}

/* Glass cards */
.card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: auto;
  box-shadow: var(--shadow-md);
}
.card.narrow { max-width: 580px; }
.preview-card {
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
}

.label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 18px 0 8px;
}
.label:first-child { margin-top: 0; }

.input {
  width: 100%;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input::placeholder { color: #9aa5bd; }
.input:hover { border-color: var(--border-strong); }
.input:focus {
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 4px var(--orange-soft);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23566482' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}
.chip:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}
.chip.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-orange);
}

/* Dropzone */
.dropzone {
  margin-top: 4px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255,255,255,0.5);
  padding: 26px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--orange);
  background: var(--orange-soft);
  transform: translateY(-1px);
}
.dz-inner { color: var(--text-dim); font-size: 14px; }
.dz-icon {
  width: 40px; height: 40px; margin: 0 auto 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 500;
  box-shadow: var(--shadow-orange);
}
.dz-hint { font-size: 12px; margin-top: 4px; color: var(--text-dim); }
.linky { color: var(--orange); text-decoration: none; cursor: pointer; font-weight: 500; }
.linky:hover { text-decoration: underline; }

.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.thumb {
  position: relative;
  width: 84px; height: 84px;
  border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(11, 26, 53, 0.75);
  color: #fff; border: 0;
  font-size: 14px; line-height: 20px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.thumb .rm:hover { background: var(--danger); }

/* ── Buttons — glass ─────────────────────────────────── */
.btn-primary, .btn-secondary, .btn-ghost {
  display: inline-block;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: -0.005em;
}

/* Primary — orange glass */
.btn-primary {
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(135deg, var(--orange) 0%, var(--orange-2) 100%);
  box-shadow:
    var(--shadow-orange),
    inset 0 1px 0 rgba(255,255,255,0.5),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  margin-top: 22px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
}
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.35), rgba(255,255,255,0) 40%);
  opacity: 0; transition: opacity 0.2s;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow:
    0 12px 28px rgba(255, 122, 26, 0.42),
    0 4px 8px rgba(255, 122, 26, 0.32),
    inset 0 1px 0 rgba(255,255,255,0.55);
}
.btn-primary:hover:not(:disabled)::after { opacity: 1; }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* Secondary — dark blue glass */
.btn-secondary {
  color: var(--navy);
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.55) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255,255,255,0.9);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--navy-2);
  color: var(--navy-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.9);
}
.btn-secondary:active:not(:disabled) { transform: translateY(0); }
.btn-secondary:disabled, .btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

/* Ghost — transparent glass */
.btn-ghost {
  background: rgba(255,255,255,0.35);
  color: var(--text-dim);
  border: 1px solid transparent;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn-ghost:hover:not(:disabled) {
  color: var(--navy);
  background: rgba(255,255,255,0.7);
  border-color: var(--border);
}

.status { margin-top: 14px; font-size: 13px; color: var(--text-dim); min-height: 18px; }
.status.err { color: var(--danger); }
.status.ok { color: var(--ok); }
.hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.hint .linky { color: var(--navy-2); }

/* Preview */
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.65));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.preview-title {
  font-size: 12px; color: var(--navy);
  font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase;
}
.preview-actions { display: flex; gap: 10px; }
.preview-actions .btn-secondary, .preview-actions .btn-ghost {
  padding: 8px 14px; font-size: 13px; margin: 0;
}

.preview-frame {
  position: relative; flex: 1;
  background: #fff;
  border-top: 1px solid var(--border);
}
#preview { width: 100%; height: 100%; border: 0; background: #fff; display: block; }
.preview-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-dim); background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
  gap: 12px; font-size: 14px;
}
.pe-icon {
  font-size: 44px; opacity: 0.35;
  filter: grayscale(0.4);
}
.preview-empty.hidden { display: none; }

/* Label overlay */
.label-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  display: none;
  z-index: 5;
}
.label-overlay.on { display: block; }
.label-box {
  position: absolute;
  border: 2px dashed rgba(255, 122, 26, 0.85);
  border-radius: 6px;
  background: rgba(255, 122, 26, 0.05);
  pointer-events: none;
  box-sizing: border-box;
}
.label-chip {
  position: absolute;
  background: var(--navy);
  color: #fff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(11, 26, 53, 0.28);
  font-family: 'Inter', -apple-system, sans-serif;
  transform: translateY(-100%);
  margin-top: -4px;
}
.label-chip::after {
  content: '';
  position: absolute;
  left: 12px; bottom: -5px;
  width: 8px; height: 8px;
  background: var(--navy);
  transform: rotate(45deg);
}

/* Preview tools bar */
.preview-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.labels-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.7);
  color: var(--navy);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}
.labels-toggle:hover:not(:disabled) { border-color: var(--orange); color: var(--orange); }
.labels-toggle:disabled { opacity: 0.4; cursor: not-allowed; }
.labels-toggle.active {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-orange);
}
.lt-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}
.labels-toggle.active .lt-dot { opacity: 1; background: #fff; }
.lt-hint { font-size: 12px; color: var(--text-dim); flex: 1; }

/* "optional" tag next to labels */
.opt {
  font-weight: 500;
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-left: 6px;
  padding: 2px 6px;
  background: var(--navy-soft);
  border-radius: 4px;
}

/* Reviews panel: appears when the toggle is on, faded when off */
.reviews-panel {
  margin-top: 4px;
  padding: 16px;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: opacity 0.2s ease;
}
.reviews-panel.disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.4);
}
.review-slot {
  padding: 12px;
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
}
.review-slot:last-child { margin-bottom: 0; }
.review-slot-head {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--text-dim); text-transform: uppercase;
  margin-bottom: 8px;
}
.review-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 8px;
  margin-bottom: 8px;
}
.review-slot .input { padding: 8px 10px; font-size: 13px; }
.review-slot textarea.input { min-height: 60px; resize: vertical; }

/* Segment toggle (Upload / Stock) */
.segment {
  display: flex;
  background: rgba(255,255,255,0.5);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 10px;
}
.seg-btn {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
}
.seg-btn:hover { color: var(--navy); }
.seg-btn.active {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--shadow-sm);
}

.stock-note {
  padding: 14px 16px;
  background: var(--orange-soft);
  border: 1px solid rgba(255,122,26,0.25);
  border-radius: 12px;
  color: var(--navy);
  font-size: 13px;
  line-height: 1.5;
}
.stock-note.hidden, #photo-upload-block.hidden { display: none; }

/* Small dropzone (logo) */
.dropzone-sm { padding: 16px; }
.dz-icon-sm { width: 32px; height: 32px; font-size: 18px; margin-bottom: 6px; }

/* Action bar (publish / request changes) */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.7));
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.action-bar.hidden { display: none; }
.ab-msg { color: var(--navy); font-size: 14px; font-weight: 500; }
.ab-actions { display: flex; gap: 10px; }
.btn-primary-inline {
  margin-top: 0 !important;
  width: auto !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
}

/* Revise bar */
.revise-bar {
  padding: 18px 20px;
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.revise-bar.hidden { display: none; }
.revise-bar .label { margin-top: 0; }
.rb-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 12px;
}

/* Auto-deploy checkbox */
.check {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--navy);
  font-weight: 500;
}
.check input {
  width: 18px; height: 18px;
  accent-color: var(--orange);
  cursor: pointer;
}

/* Setup screen */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 4px;
  letter-spacing: -0.005em;
}
code {
  background: var(--navy-soft);
  padding: 1px 6px; border-radius: 4px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  color: var(--navy);
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
}
.pill::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor;
}
.pill-ok   { background: rgba(16, 163, 127, 0.12); color: var(--ok); border-color: rgba(16, 163, 127, 0.25); }
.pill-warn { background: rgba(255, 122, 26, 0.12); color: var(--orange); border-color: rgba(255, 122, 26, 0.25); }
.pill-err  { background: rgba(217, 72, 72, 0.12); color: var(--danger); border-color: rgba(217, 72, 72, 0.25); }

.log {
  margin-top: 14px;
  background: var(--ink);
  color: #cfd8ea;
  padding: 12px 14px;
  border-radius: 10px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.log.hidden { display: none; }

/* Live banner (site is live on the web) */
.live-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(16,163,127,0.10), rgba(16,163,127,0.04));
  border-bottom: 1px solid var(--border);
}
.live-banner.hidden { display: none; }
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(16,163,127,0.2);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(16,163,127,0.2); }
  50%      { box-shadow: 0 0 0 8px rgba(16,163,127,0.05); }
}
.live-body { flex: 1; min-width: 0; }
.live-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ok); font-weight: 700;
}
.live-url {
  display: block;
  color: var(--navy);
  font-weight: 600; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
  margin-top: 2px;
  cursor: pointer;
}
.live-url:hover { color: var(--orange); }
.live-actions { display: flex; gap: 8px; }
.live-actions .btn-secondary, .live-actions .btn-ghost {
  padding: 8px 14px; font-size: 13px; margin: 0;
}

/* ── Projects dashboard sections ────────────── */
.section-header {
  margin: 32px 0 14px;
}
.section-h {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}
.section-h-sub {
  color: var(--text-dim);
  font-size: 13px;
}

/* Quick stats strip */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}
.stat-lbl {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Checklist card */
.checklist-card {
  background: linear-gradient(135deg, rgba(0,0,0,0.94) 0%, rgba(20,20,20,0.94) 100%);
  color: #fff;
  border-radius: 18px;
  padding: 22px 24px;
  margin-bottom: 26px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.checklist-card::before {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(255,122,26,0.35) 0%, rgba(255,122,26,0) 65%);
  pointer-events: none;
}
.checklist-card.done { opacity: 0.7; }
.checklist-card.done::before { display: none; }
.checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}
.checklist-card .section-title { color: #fff; }
.checklist-sub { color: rgba(255,255,255,0.6); font-size: 13px; margin-top: 2px; }
.checklist-progress {
  font-size: 20px;
  font-weight: 700;
  color: var(--orange-2);
  letter-spacing: -0.02em;
}
.checklist-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  position: relative;
}
.chk-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s;
}
.chk-item.done { opacity: 0.55; }
.chk-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s;
  position: relative;
}
.chk-item.done .chk-dot {
  background: var(--orange);
  border-color: var(--orange);
}
.chk-item.done .chk-dot::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.chk-title { font-size: 13.5px; font-weight: 600; color: #fff; }
.chk-item.done .chk-title { text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.4); }
.chk-sub { font-size: 11.5px; color: rgba(255,255,255,0.55); margin-top: 2px; line-height: 1.4; }

/* Templates grid */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}
.template-card {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
  box-shadow: var(--shadow-sm);
}
.template-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--orange);
}
.template-icon {
  font-size: 26px;
  margin-bottom: 8px;
  line-height: 1;
}
.template-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.005em;
}
.template-tagline {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Recent activity feed */
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass-bg-strong);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink);
  transition: transform 0.1s;
  cursor: pointer;
}
.activity-item:hover { transform: translateX(2px); border-color: var(--orange); }
.activity-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(255, 122, 26, 0.12);
  color: var(--orange);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.activity-icon.publish { background: rgba(16, 163, 127, 0.12); color: var(--ok); }
.activity-body { flex: 1; min-width: 0; }
.activity-title { font-weight: 500; color: var(--ink); }
.activity-time { color: var(--text-dim); font-size: 12px; margin-top: 2px; }

/* Usage chart card */
.usage-chart-card { grid-column: 1 / -1; }
.usage-chart-wrap {
  height: 100px;
  margin: 16px 0 12px;
  position: relative;
}
#usage-sparkline {
  width: 100%; height: 100%;
  display: block;
}
.usage-chart-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-dim);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.usage-chart-peak { color: var(--orange); font-weight: 600; }

/* Danger zone card */
.danger-card {
  border-color: rgba(217, 72, 72, 0.28);
  background: linear-gradient(135deg, rgba(217, 72, 72, 0.04), rgba(217, 72, 72, 0.01));
}
.danger-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.danger-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(217, 72, 72, 0.14);
  color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.btn-danger-inline {
  background: linear-gradient(135deg, #d94848, #b83a3a);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(217, 72, 72, 0.32), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: transform 0.1s, box-shadow 0.15s;
}
.btn-danger-inline:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(217, 72, 72, 0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}


/* ── Nav icons (in sidebar buttons) ─────────── */
.nav-btn { display: flex; align-items: center; gap: 10px; }
.nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  transition: color 0.15s;
}
.nav-btn:hover .nav-icon,
.nav-btn.active .nav-icon { color: var(--orange-2); }

/* ── Account page ───────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: start;
}
.account-grid .sub-card { grid-column: 1 / -1; }

.account-field {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.account-field:last-child { border-bottom: 0; padding-bottom: 0; }
.af-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.af-value {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
}

/* Subscription card */
.sub-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.75));
}
.sub-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.sub-badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.sub-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--shadow-orange);
}
.sub-badge.pro {
  background: linear-gradient(135deg, #111, #000);
  box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.12);
}
.sub-desc { color: var(--text-dim); font-size: 13.5px; margin-top: 2px; }
.sub-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px 16px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
}
.sub-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
}
.sub-feature::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: rgba(255, 122, 26, 0.14);
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
}
.usage-item {
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
.usage-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.usage-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.usage-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.usage-cap {
  font-size: 12.5px;
  color: var(--text-dim);
}
.usage-bar {
  height: 6px;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s ease;
}

/* ══════════════════════════════════════════════════════
   IN-APP MODAL
   ══════════════════════════════════════════════════════ */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalIn 0.18s cubic-bezier(0.2, 0.9, 0.2, 1);
}
.modal-root.hidden { display: none; }
@keyframes modalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.modal-card {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255,255,255,0.9);
  padding: 32px 28px 24px;
  text-align: center;
  animation: modalCardIn 0.24s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes modalCardIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow:
    var(--shadow-orange),
    inset 0 1px 0 rgba(255,255,255,0.5);
}
.modal-icon.danger {
  background: linear-gradient(135deg, #d94848, #b83a3a);
  box-shadow: 0 8px 22px rgba(217, 72, 72, 0.32), inset 0 1px 0 rgba(255,255,255,0.4);
}
.modal-icon.info {
  background: linear-gradient(135deg, #111, #000);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255,255,255,0.15);
}
.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.015em;
  margin-bottom: 8px;
}
.modal-body {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 24px;
}
.modal-body strong { color: var(--ink); font-weight: 600; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.modal-actions button {
  flex: 1;
  max-width: 200px;
  border: 0;
  border-radius: 12px;
  padding: 13px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.1s, box-shadow 0.15s, opacity 0.15s;
}
.modal-actions button:hover { transform: translateY(-1px); }
.modal-actions button:active { transform: translateY(0); }
.modal-btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff;
  box-shadow: var(--shadow-orange), inset 0 1px 0 rgba(255,255,255,0.35);
}
.modal-btn-danger {
  background: linear-gradient(135deg, #d94848, #b83a3a);
  color: #fff;
  box-shadow: 0 6px 18px rgba(217, 72, 72, 0.35), inset 0 1px 0 rgba(255,255,255,0.25);
}
.modal-btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: var(--ink);
  border: 1px solid var(--border);
}
.modal-btn-secondary:hover { background: rgba(0, 0, 0, 0.08); }

/* ══════════════════════════════════════════════════════
   TOAST (small non-blocking notice)
   ══════════════════════════════════════════════════════ */
.toast-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(0, 0, 0, 0.94);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255,255,255,0.06);
  animation: toastIn 0.22s cubic-bezier(0.2, 0.9, 0.2, 1);
  max-width: 340px;
  pointer-events: auto;
  border-left: 3px solid var(--orange);
}
.toast.ok    { border-left-color: var(--ok); }
.toast.err   { border-left-color: var(--danger); }
.toast.exit  { animation: toastOut 0.22s ease forwards; }
@keyframes toastIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes toastOut {
  to { transform: translateX(20px); opacity: 0; }
}

/* Mobile: modal fills width nicely, toast anchors bottom-center */
@media (max-width: 600px) {
  .modal-root { padding: 16px; }
  .modal-card { padding: 26px 20px 20px; border-radius: 18px; }
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions button { max-width: 100%; }
  .toast-root { left: 16px; right: 16px; bottom: 16px; align-items: center; }
  .toast { max-width: 100%; width: 100%; }
}

/* Subtle scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(18, 39, 90, 0.15);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(18, 39, 90, 0.28); background-clip: padding-box; }

/* ══════════════════════════════════════════════════════
   WEB — BOTTOM NAV BAR (mobile only, hidden on desktop)
   ══════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-around;
  gap: 4px;
}
.bn-btn {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 12px;
  min-width: 56px;
  transition: color 0.15s;
}
.bn-btn.hidden { display: none; }
.bn-icon { font-size: 20px; line-height: 1; }
.bn-lbl { font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.bn-btn.active { color: var(--orange-2); }
.bn-btn.active .bn-icon { filter: drop-shadow(0 0 8px rgba(255, 122, 26, 0.6)); }
.bn-fab {
  background: linear-gradient(135deg, var(--orange), var(--orange-2));
  color: #fff !important;
  width: 52px; height: 52px;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 6px 22px rgba(255, 122, 26, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  margin-top: -18px;
  min-width: 0;
}
.bn-plus { font-size: 26px; font-weight: 300; line-height: 1; }
body.no-auth .bottom-nav { display: none !important; }

/* ══════════════════════════════════════════════════════
   WEB MOBILE — swap sidebar for bottom nav (≤ 900px)
   ══════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body:not(.no-auth) {
    grid-template-columns: 1fr;
    overflow: auto;
    height: auto;
    min-height: 100vh;
  }
  body::before, body::after { display: none; }
  html, body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
  body { touch-action: manipulation; }

  .sidebar { display: none; }
  .bottom-nav { display: flex; }

  .main {
    padding: 18px 14px calc(90px + env(safe-area-inset-bottom));
    overflow: visible;
  }

  /* Page heading + rows */
  .page-head h1 { font-size: 22px; letter-spacing: -0.015em; }
  .page-head p { font-size: 13px; margin-bottom: 14px; }
  .page-head-row { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  .page-head-actions { flex-wrap: wrap; gap: 8px; }
  /* Hide the "+ New site" header buttons on mobile — the FAB replaces them */
  #new-project-btn, #new-project-btn-2 { display: none; }

  /* Cards fit width */
  .grid { grid-template-columns: 1fr; height: auto; gap: 14px; }
  .card { padding: 16px; border-radius: 16px; }
  .card.narrow { max-width: 100%; }

  .setup-grid, .account-grid { grid-template-columns: 1fr; gap: 14px; }

  /* Auth screen */
  .auth-view { padding: 24px 16px; min-height: 100vh; align-items: center; }
  .auth-card { padding: 24px 20px; max-width: 100%; border-radius: 20px; }
  .auth-tabs { padding: 3px; }
  .auth-tab { padding: 10px 8px; font-size: 13px; }

  /* Projects grid → single column */
  .projects-grid { grid-template-columns: 1fr; gap: 12px; }
  .project-card .p-delete { opacity: 0.7; } /* always visible on touch */

  /* Templates → 2-up on phones */
  .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .template-card { padding: 14px; }
  .template-icon { font-size: 22px; }
  .template-name { font-size: 13.5px; }
  .template-tagline { font-size: 11.5px; }

  /* Checklist */
  .checklist-card { padding: 18px; margin-bottom: 22px; }
  .checklist-items { grid-template-columns: 1fr; gap: 8px; }
  .chk-title { font-size: 13px; }
  .chk-sub { font-size: 11.5px; }
  .checklist-progress { font-size: 18px; }

  /* Stats strip */
  .stats-strip { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
  .stat { padding: 12px 10px; }
  .stat-num { font-size: 22px; }
  .stat-lbl { font-size: 10px; }

  /* Preview iframe */
  .preview-card { min-height: 0; }
  .preview-frame { height: 60vh; min-height: 380px; }
  .preview-head { padding: 12px 14px; }

  /* Action bar buttons stack full-width */
  .action-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
  .ab-msg { font-size: 13px; }
  .ab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ab-actions .btn-primary-inline, .ab-actions .btn-secondary {
    width: 100% !important; margin: 0 !important;
  }

  /* Revise */
  .revise-bar { padding: 14px; }
  .rb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .rb-actions .btn-ghost, .rb-actions .btn-primary-inline {
    width: 100% !important; margin: 0 !important;
  }

  /* Live banner wraps */
  .live-banner { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .live-body { flex: 1 1 100%; order: 2; }
  .live-actions { order: 3; flex: 1 1 100%; }
  .live-actions .btn-secondary, .live-actions .btn-ghost { flex: 1; }

  /* Chips scroll horizontally */
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; -webkit-overflow-scrolling: touch; }
  .chip { flex-shrink: 0; }

  /* Segment + dropzones */
  .segment { padding: 3px; }
  .seg-btn { padding: 9px 10px; font-size: 12.5px; }
  .dropzone { padding: 18px; }
  .dropzone-sm { padding: 12px; }

  /* Photo thumbs */
  .thumb { width: 68px; height: 68px; }

  /* Inputs — 16px prevents iOS zoom-on-focus */
  .input { font-size: 16px; padding: 12px 14px; border-radius: 10px; }
  .textarea { min-height: 90px; }

  /* Buttons */
  .btn-primary { padding: 14px 20px; font-size: 15px; }
  .btn-secondary, .btn-ghost { padding: 11px 14px; font-size: 13.5px; }

  /* Modal on mobile → SHEET style (slides from bottom) */
  .modal-root { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    width: 100%;
    border-radius: 22px 22px 0 0;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
    animation: sheetIn 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
  }
  @keyframes sheetIn {
    from { transform: translateY(100%); opacity: 0.8; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .modal-card::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 999px;
    margin: -8px auto 12px;
  }
  .modal-actions { flex-direction: column-reverse; gap: 8px; }
  .modal-actions button { max-width: 100%; padding: 15px 20px; font-size: 15px; }

  /* Reviews */
  .reviews-panel { padding: 12px; }
  .review-slot { padding: 10px; }
  .review-row { grid-template-columns: 1fr; gap: 8px; }

  /* Preview tools */
  .preview-tools { padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .lt-hint { font-size: 11.5px; flex: 1 1 100%; order: 2; }

  /* Sub card + subscription usage tiles */
  .sub-header { flex-direction: column; align-items: stretch; gap: 12px; }
  .usage-grid { grid-template-columns: 1fr; }

  /* Danger card icon+text stacks nicely */
  .danger-head { align-items: center; }
}

/* Extra tight for iPhone SE class (≤ 380px) */
@media (max-width: 380px) {
  .page-head h1 { font-size: 20px; }
  .stats-strip { gap: 6px; }
  .stat { padding: 10px 8px; }
  .stat-num { font-size: 20px; }
  .stat-lbl { font-size: 9.5px; }
  .templates-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .template-card { padding: 12px; }
  .preview-frame { height: 55vh; min-height: 340px; }
  .thumb { width: 60px; height: 60px; }
  .bn-lbl { font-size: 10px; }
  .bn-btn { padding: 6px 6px; min-width: 48px; }
  .bn-fab { width: 48px; height: 48px; margin-top: -16px; }
}
