/* ============================================================
   FrameWall - visual identity v3
   Modern, minimal, professional. Near-black/charcoal surfaces,
   thin borders instead of shadows, one restrained accent color,
   quick hover/focus transitions only - no glass, blur, or glow.
   ============================================================ */

:root {
  --bg: #0E0E11;
  --surface: #17171B;
  --surface-raised: #1E1E23;
  --border: rgba(255, 255, 255, 0.10);
  --border-strong: rgba(255, 255, 255, 0.22);
  --text: #F2F2F3;
  --text-dim: #9B9BA3;
  --text-faint: #6B6B72;

  --danger: #E5484D;
  --danger-soft: rgba(229, 72, 77, 0.14);

  /* Primary buttons are solid near-white, not colored. */
  --btn-primary-bg: #F2F2F3;
  --btn-primary-bg-hover: #DADADC;
  --btn-primary-text: #101013;

  --radius-s: 4px;
  --radius-m: 6px;
  --radius-l: 8px;

  --transition-fast: 0.15s ease;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.55;
  min-height: 100vh;
  font-size: 16px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--text); color: #0E0E11; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- Corner brackets (subtle, neutral, hover-only) ---------- */

.brackets {
  position: relative;
}
.brackets::before,
.brackets::after,
.brackets .bl,
.brackets .br {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--border-strong);
  opacity: 0;
  transition: opacity var(--transition-fast);
  pointer-events: none;
}
.brackets::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.brackets::after   { top: -1px; right: -1px; border-left: none; border-bottom: none; }
.brackets .bl      { bottom: -1px; left: -1px; border-right: none; border-top: none; }
.brackets .br      { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.brackets:hover::before,
.brackets:hover::after,
.brackets:hover .bl,
.brackets:hover .br,
.brackets.brackets-active::before,
.brackets.brackets-active::after,
.brackets.brackets-active .bl,
.brackets.brackets-active .br {
  opacity: 1;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 18px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-actions { display: flex; gap: 10px; align-items: center; }

.main-nav {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 3px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-dim);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: calc(var(--radius-m) - 3px);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.nav-link:hover { color: var(--text); background: var(--surface-raised); }
.nav-link.active { background: var(--surface-raised); color: var(--text); }

.account-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 6px 8px 6px 6px;
  font-size: 0.85rem;
  color: var(--text);
  max-width: 100%;
}

.account-badge > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

.account-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}

.account-badge button {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 50%;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.account-badge button:hover { color: var(--text); background: var(--surface-raised); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast), opacity var(--transition-fast);
  white-space: nowrap;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
}
.btn-primary:hover { background: var(--btn-primary-bg-hover); }

.btn-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface); border-color: var(--text-faint); }

.btn-subtle {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-dim);
}
.btn-subtle:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-raised); }

.btn-icon { padding: 10px 14px; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }

/* ---------- Hero ---------- */

.hero {
  padding: 64px 0 52px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
}

.hero h1 {
  font-weight: 700;
  font-size: clamp(2.3rem, 4.4vw, 3.4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  max-width: 14ch;
}

.hero p {
  font-size: 1.05rem;
  color: var(--text-dim);
  max-width: 44ch;
  margin: 0 0 30px;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hero viewfinder */

.viewfinder {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-l);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.viewfinder::before, .viewfinder::after, .viewfinder .bl, .viewfinder .br {
  opacity: 1;
  width: 20px;
  height: 20px;
}

.viewfinder-stage {
  position: absolute;
  inset: 24px;
  border-radius: var(--radius-m);
  overflow: hidden;
}

.viewfinder-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.viewfinder-stage img.active { opacity: 1; }

.viewfinder-caption {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.viewfinder-caption strong { color: var(--text); font-weight: 600; }

/* ---------- Section headers ---------- */

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 8px 0 26px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.section-head p {
  color: var(--text-faint);
  margin: 4px 0 0;
  font-size: 0.92rem;
}

.gallery-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.search-field {
  position: relative;
  min-width: 220px;
}

.search-field svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.search-field input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 9px 14px 9px 36px;
  color: var(--text);
  font-size: 0.88rem;
  transition: border-color var(--transition-fast);
}

.search-field input:focus { border-color: var(--text-faint); outline: none; }
.search-field input::placeholder { color: var(--text-faint); }

.sort-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 9px 32px 9px 14px;
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239B9BA3' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.sort-select:focus { border-color: var(--text-faint); outline: none; }

/* ---------- Category chips ---------- */

.category-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -6px 0 22px;
}

.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  border-radius: var(--radius-s);
  padding: 7px 14px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.chip span { color: var(--text-faint); margin-left: 3px; }

.chip:hover { border-color: var(--border-strong); color: var(--text); }

.chip.active {
  background: var(--surface-raised);
  border-color: var(--text-faint);
  color: var(--text);
}

.category-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: var(--radius-s);
  z-index: 2;
}

/* ---------- Gallery grid ---------- */

.frame-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 22px;
}

.frame-card {
  text-decoration: none;
  color: var(--text);
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.frame-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.frame-photo {
  position: relative;
  aspect-ratio: 1;
  background: var(--surface-raised);
}

.frame-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.frame-caption { padding: 16px 18px 18px; }

.frame-caption h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.frame-caption p {
  font-size: 0.86rem;
  color: var(--text-dim);
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.frame-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-faint);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.frame-meta .creator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frame-meta .uses {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.frame-meta .uses .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text);
}

.creator-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 700;
  flex-shrink: 0;
}

.empty-board, .no-results {
  text-align: center;
  padding: 70px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: var(--radius-m);
  grid-column: 1 / -1;
}

.empty-board h3, .no-results h3 {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.no-results { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 80px;
  padding: 28px 0 50px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer a:hover { color: var(--text-dim); }

/* ---------- Toasts ---------- */

#toastRoot {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-m);
  font-size: 0.86rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(6px);
  animation: toast-in 0.18s ease forwards;
}

.toast.leaving { animation: toast-out 0.15s ease forwards; }
.toast .toast-icon { color: var(--text); flex-shrink: 0; }
.toast.toast-error .toast-icon { color: var(--danger); }

@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* ---------- Login modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 30px;
  max-width: 360px;
  width: 100%;
}

.modal-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.modal-lede {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0 0 22px;
  line-height: 1.5;
}

.login-disabled-note {
  color: var(--text-faint);
  font-size: 0.78rem;
  text-align: center;
  margin: -2px 0 12px;
}

/* ---------- Attribution / login-aware note on the upload form ---------- */

.attribution-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

/* ---------- Forms (create page) ---------- */

.form-shell {
  max-width: 640px;
  margin: 48px auto 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 42px;
}

.form-shell h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}

.form-shell > p.lede {
  color: var(--text-dim);
  margin: 0 0 32px;
}

.field { margin-bottom: 22px; }

.field-label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

.char-count {
  font-size: 0.76rem;
  color: var(--text-faint);
}

.char-count.near-limit { color: var(--danger); }

.field .hint {
  font-weight: 400;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 6px;
}

.field input[type="text"],
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 12px 14px;
  color: var(--text);
  font-size: 0.96rem;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.field input[type="text"]:focus,
.field textarea:focus {
  border-color: var(--text-faint);
  outline: none;
}

.file-drop {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-m);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.file-drop:hover, .file-drop.drag {
  border-color: var(--text-faint);
  background: var(--surface-raised);
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-drop-preview {
  max-height: 160px;
  margin: 0 auto 12px;
  border-radius: var(--radius-s);
}

.file-drop strong { color: var(--text); }
.file-drop .icon { color: var(--text-faint); margin-bottom: 8px; }

.shape-choice { display: flex; gap: 12px; }

.shape-choice label {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-dim);
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}

.shape-choice input { display: none; }

.shape-choice label:has(input:checked) {
  background: var(--surface-raised);
  border-color: var(--text-faint);
  color: var(--text);
}

.form-msg {
  padding: 13px 16px;
  border-radius: var(--radius-m);
  margin-bottom: 22px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-msg.error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
}

.form-msg.success {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
}

/* ---------- Custom slug field ---------- */

.slug-field {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  overflow: hidden;
  background: var(--bg);
}

.slug-field:focus-within { border-color: var(--text-faint); }

.slug-prefix {
  padding: 12px 0 12px 14px;
  color: var(--text-faint);
  font-size: 0.88rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.slug-field input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  padding: 12px 14px 12px 4px;
  color: var(--text);
  font-size: 0.96rem;
}
.slug-field input:focus { outline: none; }

/* ---------- Photo filter presets ---------- */

.filter-presets {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 18px;
}

.filter-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-faint);
  font-size: 0.72rem;
  cursor: pointer;
  flex-shrink: 0;
}

.filter-swatch:hover { color: var(--text-dim); }
.filter-swatch.active { color: var(--text); }

.swatch {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-s);
  border: 2px solid var(--border);
  display: block;
}

.filter-swatch.active .swatch { border-color: var(--text); }

.swatch-none { background: linear-gradient(135deg, #6b7280, #9ca3af); }
.swatch-grayscale { background: linear-gradient(135deg, #888, #ccc); }
.swatch-sepia { background: linear-gradient(135deg, #a9793f, #e3c08d); }
.swatch-vintage { background: linear-gradient(135deg, #8a6b4f, #c9a876); }
.swatch-cool { background: linear-gradient(135deg, #4f7bc9, #9fd8e6); }
.swatch-warm { background: linear-gradient(135deg, #e08a3f, #f4c26b); }
.swatch-vivid { background: linear-gradient(135deg, #d1385c, #e0a020); }

/* ---------- Editor page ---------- */

.editor-shell {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 30px;
  margin: 34px 0 90px;
  align-items: start;
}

.editor-stage {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 26px;
}

.canvas-holder {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface-raised);
  touch-action: none;
}

.canvas-holder::before, .canvas-holder::after, .canvas-holder .bl, .canvas-holder .br {
  opacity: 1;
  z-index: 5;
}

.canvas-holder.focused::before,
.canvas-holder.focused::after,
.canvas-holder.focused .bl,
.canvas-holder.focused .br {
  border-color: var(--text);
}

.canvas-holder canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

.canvas-holder canvas:active { cursor: grabbing; }

.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.canvas-hint {
  color: var(--text-faint);
  font-size: 0.82rem;
  margin: 0;
}

.canvas-hint kbd {
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
  font-family: inherit;
}

.editor-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 28px;
  position: sticky;
  top: 88px;
}

.editor-panel h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
}

.editor-panel .by {
  font-size: 0.84rem;
  color: var(--text-faint);
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.editor-panel .by .dot {
  width: 4px; height: 4px; border-radius: 50%; background: var(--text-faint);
}

.editor-panel .desc {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin: 0 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.upload-cta {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-m);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 22px;
  position: relative;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  display: block;
}

.upload-cta:hover { border-color: var(--text-faint); background: var(--surface-raised); }

.upload-cta input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-cta .icon { color: var(--text-faint); margin-bottom: 6px; }
.upload-cta strong { color: var(--text); }

.control { margin-bottom: 18px; }

.control-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.control-row .val { color: var(--text-dim); font-weight: 500; font-variant-numeric: tabular-nums; }

.control input[type="range"] {
  width: 100%;
  accent-color: var(--text);
}

.toggle-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.icon-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color var(--transition-fast), color var(--transition-fast);
}

.icon-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.icon-toggle.active { border-color: var(--text-faint); color: var(--text); background: var(--surface-raised); }

.editor-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
}

.editor-actions-row { display: flex; gap: 10px; }
.editor-actions-row .btn { flex: 1; }

.editor-disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Admin panel ---------- */

.admin-table {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
}

.admin-row {
  display: grid;
  grid-template-columns: 2.2fr 1.2fr 1fr 0.6fr 0.7fr 0.8fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}

.admin-row > span:not(.admin-frame-cell) {
  text-align: center;
}

.admin-row-actions {
  display: flex;
  justify-content: center;
}

.admin-row:last-child { border-bottom: none; }

.admin-row-head {
  background: var(--surface);
  color: var(--text-faint);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.admin-frame-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.admin-frame-cell img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: var(--radius-s);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-frame-cell span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-frame-cell strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-frame-cell a {
  font-size: 0.76rem;
  color: var(--text-faint);
  text-decoration: none;
}
.admin-frame-cell a:hover { color: var(--text-dim); text-decoration: underline; }

.status-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--radius-s);
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border);
}

.status-live { color: var(--text-dim); }
.status-hidden { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.admin-row-actions form {
  display: flex;
  gap: 6px;
}

.admin-delete-btn {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.admin-delete-btn:hover { background: var(--danger-soft); }

@media (max-width: 900px) {
  .admin-row { grid-template-columns: 1fr; gap: 6px; padding: 16px; }
  .admin-row-head { display: none; }
  .admin-row > span:not(.admin-frame-cell) {
    text-align: left;
  }
  .admin-row-actions { justify-content: flex-start; }
  .admin-row > span:not(.admin-frame-cell)::before {
    content: attr(data-label) ": ";
    color: var(--text-faint);
  }
}

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; }
  .viewfinder { max-width: 340px; margin: 0 auto; }
  .editor-shell { grid-template-columns: 1fr; }
  .editor-panel { position: static; }
  .form-shell { padding: 26px; margin: 24px 16px 60px; }
  .section-head { align-items: flex-start; }
}

@media (max-width: 460px) {
  .editor-actions-row { flex-direction: column; }
  .toggle-row { flex-direction: column; }
  .admin-row-actions form { flex-wrap: wrap; }
}
