:root {
  --bg: #f2f2f2;
  --panel: #ffffff;
  --ink: #191919;
  --muted: #6a6a6a;
  --line: #d9d9d9;
  --accent: #f59a00;
  --accent-strong: #cf7900;
  --danger: #a62929;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.08);
  --radius: 22px;
  --font-heading: "Shell", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-body: "Avenir Next", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { background: transparent; }
html { height: auto; min-height: 0; }
body { margin: 0; color: var(--ink); font-family: var(--font-body); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes rise-fade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes viewer-shell-enter {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.page-loader { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-content: start; padding-top: clamp(32px, 8vh, 96px); background: transparent; transition: opacity 280ms ease, visibility 280ms ease; }
.page-loader[hidden] { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-mark { display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 999px; background: rgba(255,255,255,0.92); box-shadow: var(--shadow); color: var(--muted); }
.page-loader-dot { width: 12px; height: 12px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 0 rgba(245,154,0,0.3); animation: pulse 1.2s ease-in-out infinite; }
.page-loader-text { letter-spacing: 0.02em; }

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,154,0,0.3); }
  50% { transform: scale(1.15); box-shadow: 0 0 0 10px rgba(245,154,0,0); }
}

.app-shell, .admin-shell { width: min(1440px, calc(100vw - 40px)); margin: 0 auto; padding: 32px 0 60px; }
.app-shell { opacity: 1; transition: opacity 260ms ease; }
.gallery-body .app-shell { width: 100vw; max-width: none; }
.gallery-body.is-loading .app-shell { opacity: 0.2; }
.gallery-body.is-compact .app-shell { width: 100vw; max-width: none; padding-top: 18px; }
.gallery-body.is-compact .hero { margin-bottom: 18px; }
.gallery-body.is-compact .hero-copy { max-width: none; font-size: 0.98rem; }
.hero { display: block; margin-bottom: 18px; }
.hero-brand { display: grid; gap: 8px; }
.hero h1 { margin: 0; font: 400 clamp(2.4rem, 4vw, 4.5rem)/0.95 var(--font-heading); letter-spacing: -0.04em; }
.hero-copy { max-width: 56ch; color: var(--muted); font-size: 1.05rem; line-height: 1.6; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 0.82rem; letter-spacing: 0.16em; text-transform: uppercase; }
.gallery-controls { display: grid; grid-template-columns: minmax(320px, 1fr) auto; gap: 16px; align-items: stretch; margin-bottom: 20px; }
.search-panel { display: grid; align-content: space-between; gap: 14px; min-height: 180px; padding: 18px 20px; border-radius: 24px; background: rgba(255,255,255,0.72); box-shadow: var(--shadow); }
.search-panel-copy { display: grid; gap: 6px; }
.search-panel-note { margin: 0; color: var(--muted); line-height: 1.5; max-width: 36ch; }
.visual-filter { display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; padding: 14px 18px; border-radius: 24px; background: rgba(255,255,255,0.72); box-shadow: var(--shadow); }
.visual-filter-copy { display: grid; gap: 6px; align-items: center; min-width: 0; }
.visual-filter-label { margin: 0; color: var(--accent); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.visual-filter-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 0; }
.color-wheel-panel { display: grid; place-items: center; }
.color-wheel { position: relative; width: 152px; height: 152px; border: 0; border-radius: 999px; padding: 0; cursor: crosshair; background:
  radial-gradient(circle at center, rgba(255,255,255,0.96) 0 27px, transparent 28px),
  conic-gradient(
    #ff3b30 0deg,
    #ff8f00 26deg,
    #ffd100 52deg,
    #ffe45d 76deg,
    #d9e94a 104deg,
    #1db954 120deg,
    #00b894 165deg,
    #00cfe8 190deg,
    #0984e3 220deg,
    #4b5bdc 250deg,
    #6c5ce7 280deg,
    #d63384 315deg,
    #ff3b30 360deg
  );
  box-shadow: inset 0 0 0 10px rgba(255,255,255,0.96), 0 16px 40px rgba(0,0,0,0.14);
}
.color-wheel-core { position: absolute; inset: 38px; border-radius: 999px; background: rgba(255,255,255,0.96); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04); }
.color-wheel-indicator { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 999px; border: 3px solid #ffffff; background: transparent !important; box-shadow: 0 6px 14px rgba(0,0,0,0.24), inset 0 0 0 1px rgba(0,0,0,0.12); opacity: 0; pointer-events: none; transition: opacity 120ms ease; }
.admin-toolbar { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.gallery-controls input, .editor-form input, .editor-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.92); padding: 14px 16px; }
.admin-status { margin: 0 0 20px; padding: 14px 16px; border-radius: 16px; background: rgba(255,255,255,0.95); box-shadow: var(--shadow); }
.admin-status[data-tone="warn"] { border-left: 4px solid #c88a12; }
.admin-status[data-tone="success"] { border-left: 4px solid #1d8c53; }
.admin-status[data-tone="error"] { border-left: 4px solid #a62929; }
.admin-status[data-tone="info"] { border-left: 4px solid var(--accent); }
.family-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.family-chip, .ghost-button, .danger-button, .editor-form button, .color-card-button { border: 0; }
.family-chip, .ghost-button, .editor-form button, .danger-button { border-radius: 999px; padding: 10px 16px; background: var(--panel); box-shadow: var(--shadow); cursor: pointer; }
.family-chip.is-active, .editor-form button { background: var(--accent); color: white; }
.ghost-button { background: white; color: var(--ink); }
.danger-button { background: var(--danger); color: white; }
.gallery-grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); align-content: start; }
.gallery-grid.is-loading { pointer-events: none; min-height: 1080px; }
.gallery-pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 20px; }
.pagination-status { margin: 0; min-width: 120px; text-align: center; color: var(--muted); }
.empty-state { margin: 6px 0 0; color: var(--muted); }
.color-card { min-height: 100%; opacity: 0; transform: translateY(12px); animation: rise-fade 380ms ease forwards; animation-delay: calc(var(--stagger, 0) * 34ms); }
.color-card-button { width: 100%; display: block; background: #ffffff; border: 1px solid #ffffff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; text-align: left; padding: 0; color: var(--ink); -webkit-text-fill-color: var(--ink); appearance: none; -webkit-appearance: none; }
.image-frame { position: relative; aspect-ratio: 1 / 1; background: #ffffff; border-bottom: 1px solid #ffffff; padding: 0; overflow: hidden; border-radius: 8px; }
.image-frame.is-loading::after,
.dialog-image-button.is-loading::after,
.dialog-image-stage.is-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.72) 48%, rgba(255,255,255,0) 100%); animation: shimmer 1.25s linear infinite; }
.image-frame.is-loading::before,
.dialog-image-button.is-loading::before,
.dialog-image-stage.is-loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #ececec 0%, #f4f4f4 100%); }
.card-image { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; background: #ffffff; opacity: 0; transform: scale(0.985); transition: opacity 220ms ease, transform 220ms ease; position: relative; z-index: 1; }
.card-hover-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; background: #ffffff; opacity: 0; transform: scale(1.02); transition: opacity 260ms ease, transform 260ms ease; }
.card-image.is-loaded,
.dialog-image.is-loaded,
.dialog-expanded-image.is-loaded { opacity: 1; transform: scale(1); }
.card-copy { padding: 18px 18px 20px; }
.card-family { margin: 0 0 8px; color: var(--accent); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.card-title { margin: 0 0 10px; font: 600 1.35rem/1.15 var(--font-heading); color: var(--ink); -webkit-text-fill-color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-description { margin: 0; color: var(--muted); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.gallery-body.has-viewer-open { overflow: hidden; }
.color-dialog { position: fixed; inset: 0; z-index: 40; background: linear-gradient(180deg, rgba(17,17,17,0.28), rgba(17,17,17,0.42)); backdrop-filter: blur(14px) saturate(1.05); }
.color-dialog[hidden] { display: none !important; }
.viewer-shell { position: absolute; left: 50%; top: var(--viewer-top, 24px); transform: translateX(-50%); width: var(--viewer-width, min(1080px, calc(100vw - 72px))); height: var(--viewer-height, 460px); max-height: calc(100dvh - 24px); border-radius: 30px; border: 1px solid rgba(255,255,255,0.38); box-shadow: 0 34px 100px rgba(0,0,0,0.3); overflow: hidden; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,247,247,0.96)); display: grid; grid-template-rows: auto auto minmax(0, 1fr); padding: 20px 20px 0; animation: viewer-shell-enter 260ms ease; }
.color-dialog.is-image-mode .viewer-shell { grid-template-rows: auto minmax(0, 1fr); }
.dialog-header { display: flex; justify-content: space-between; gap: 16px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid rgba(25,25,25,0.08); }
.dialog-header h2 { margin: 0; font: 500 clamp(1.8rem, 3vw, 3rem)/1 var(--font-heading); }
.dialog-header .ghost-button { background: rgba(255,255,255,0.84); box-shadow: inset 0 0 0 1px rgba(25,25,25,0.06); }
.dialog-description { color: var(--muted); line-height: 1.55; margin: 14px 0 0; max-width: 72ch; max-height: 4.7em; overflow: hidden; position: relative; }
.dialog-description:not(.is-empty)::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6em; background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.98)); pointer-events: none; }
.viewer-stage { display: grid; min-height: 0; padding-top: 16px; }
.dialog-gallery-view, .dialog-image-view { display: grid; min-height: 0; height: 100%; }
.dialog-gallery-view[hidden], .dialog-image-view[hidden] { display: none !important; }
.dialog-gallery-view { grid-template-rows: minmax(0, 1fr) auto; gap: 14px; }
.dialog-image-view { grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; }
.dialog-images { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, max-content); align-content: start; justify-items: stretch; min-height: 0; overflow: auto; padding: 4px 2px 6px; }
.dialog-pagination { margin: 0; min-height: 62px; padding: 14px 6px 18px; display: flex; align-items: center; justify-content: center; gap: 14px; border-top: 1px solid rgba(25,25,25,0.06); background: linear-gradient(180deg, rgba(255,255,255,0.2), rgba(255,255,255,0.78)); }
.dialog-pagination .ghost-button { min-width: 112px; }
.dialog-pagination.is-inactive { visibility: hidden; pointer-events: none; }
.dialog-image-card { margin: 0; align-self: start; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,247,247,0.96)); border-radius: 20px; overflow: hidden; border: 1px solid rgba(255,255,255,0.95); box-shadow: 0 18px 40px rgba(0,0,0,0.08); opacity: 0; transform: translateY(10px); animation: rise-fade 320ms ease forwards; animation-delay: calc(var(--stagger, 0) * 26ms); display: grid; grid-template-rows: auto minmax(2.9em, auto); }
.dialog-image-card.has-no-caption { grid-template-rows: auto; }
.dialog-image-button { position: relative; display: block; width: 100%; padding: 10px; background: transparent; cursor: zoom-in; border: 0; outline: 0; appearance: none; -webkit-appearance: none; border-radius: 20px; overflow: hidden; box-shadow: none; }
.dialog-image { aspect-ratio: 5 / 4; width: 100%; height: auto; object-fit: cover; object-position: center center; background: #ffffff; border-radius: 12px; opacity: 0; transform: scale(0.99); transition: opacity 220ms ease, transform 220ms ease; position: relative; z-index: 1; }
.dialog-caption { padding: 0 12px 12px; color: var(--muted); font-size: 0.9rem; line-height: 1.45; background: transparent; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dialog-image-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-image-toolbar .ghost-button { background: rgba(255,255,255,0.84); box-shadow: inset 0 0 0 1px rgba(25,25,25,0.06); }
.dialog-image-stage { position: relative; min-height: 0; border-radius: 24px; background: radial-gradient(circle at top, rgba(84,84,84,0.22), rgba(17,17,17,0.9)); overflow: hidden; padding: 18px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08); }
.dialog-image-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.dialog-image-track::-webkit-scrollbar { display: none; }
.dialog-image-slide { flex: 0 0 100%; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 8px; scroll-snap-align: center; }
.dialog-expanded-image { width: 100%; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; object-position: center center; opacity: 0; transform: scale(0.985); transition: opacity 220ms ease, transform 220ms ease; position: relative; z-index: 1; user-select: none; -webkit-user-drag: none; }
.dialog-expanded-caption { margin: 0 auto 6px; color: rgba(255,255,255,0.86); line-height: 1.5; text-align: center; max-width: 70ch; }
.color-dialog.is-image-mode .dialog-expanded-caption:empty { display: none; }
.color-dialog.is-mobile-viewer { border-radius: 24px; }
.color-dialog.is-mobile-viewer .viewer-shell { padding: 14px 14px 0; border-radius: 28px; }
.color-dialog.is-mobile-viewer .dialog-header { padding-bottom: 12px; }
.color-dialog.is-mobile-viewer .dialog-gallery-view { gap: 10px; }
.color-dialog.is-mobile-viewer .dialog-image-view { grid-template-rows: auto minmax(0, 1fr) auto; align-content: start; gap: 10px; }
.color-dialog.is-mobile-viewer .dialog-images { grid-template-columns: 1fr; gap: 12px; padding-bottom: 4px; }
.color-dialog.is-mobile-viewer .dialog-image-card { border-radius: 22px; }
.color-dialog.is-mobile-viewer .dialog-image { aspect-ratio: 4 / 3; }
.color-dialog.is-mobile-viewer .dialog-image-stage { align-items: center; justify-content: center; padding: 12px; border-radius: 22px; }
.color-dialog.is-mobile-viewer .dialog-expanded-image { width: 100%; height: auto; max-height: min(52vh, 420px); object-fit: contain; object-position: center center; }
.color-dialog.is-mobile-viewer .dialog-expanded-caption { margin-bottom: 6px; font-size: 0.9rem; }
.color-dialog.is-mobile-viewer.is-image-mode .viewer-stage { padding-top: 8px; }
.back-to-top { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: 46px; height: 46px; border: 0; border-radius: 999px; background: rgba(245, 154, 0, 0.96); color: #ffffff; box-shadow: 0 16px 36px rgba(0,0,0,0.18); font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 20; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 160ms ease, transform 160ms ease; }
.back-to-top.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }

@media (max-width: 980px) and (min-width: 751px) {
  .dialog-images { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dialog-gallery-view { grid-template-rows: minmax(0, 1fr) 52px; }
  .dialog-pagination { min-height: 52px; gap: 10px; }
  .dialog-pagination .ghost-button { min-width: 96px; }
}

@media (hover: hover) and (pointer: fine) and (min-width: 901px) {
  .image-frame.has-hover-preview .card-image {
    transition: opacity 280ms ease, transform 280ms ease;
  }

  .image-frame.has-hover-preview .card-hover-image {
    z-index: 2;
  }

  .color-card-button:hover .image-frame.has-hover-preview .card-image,
  .color-card-button:focus-visible .image-frame.has-hover-preview .card-image {
    opacity: 0;
    transform: scale(0.992);
  }

  .color-card-button:hover .image-frame.has-hover-preview .card-hover-image.is-loaded,
  .color-card-button:focus-visible .image-frame.has-hover-preview .card-hover-image.is-loaded {
    opacity: 1;
    transform: scale(1);
  }
}

.admin-layout { display: grid; gap: 20px; grid-template-columns: 1.1fr 1fr; }
.panel { background: rgba(255,255,255,0.96); border-radius: 24px; box-shadow: var(--shadow); padding: 20px; }
.span-2 { grid-column: 1 / -1; }
.panel-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 18px; }
.panel-header h2 { margin: 0; font-size: 1.25rem; }
.panel-search { width: min(240px, 100%); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; background: white; }
.panel-note { margin: 0 0 16px; color: var(--muted); line-height: 1.5; }
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
  padding: 12px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(24, 28, 34, 0.08);
  box-shadow: 0 16px 38px rgba(22, 28, 35, 0.06);
  backdrop-filter: blur(12px) saturate(1.04);
  -webkit-backdrop-filter: blur(12px) saturate(1.04);
}

.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(24, 28, 34, 0.1);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(31, 38, 47, 0.06);
}

.site-nav-link.is-current {
  background: linear-gradient(135deg, #1b222b, #49515a);
  color: #fff;
  border-color: rgba(24, 28, 34, 0.16);
}

.gallery-body.is-embedded .site-nav,
.gallery-body.is-compact .site-nav {
  display: none;
}

.editor-form { display: grid; gap: 14px; }
.editor-form label { display: grid; gap: 8px; color: var(--muted); font-size: 0.95rem; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inline-form { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.upload-form { margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form button { height: fit-content; }
.admin-color-list, .admin-image-list { display: grid; gap: 10px; }
.admin-item { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: #fafafa; display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.admin-item.is-active, .admin-color-item.is-active { border-color: var(--accent); background: rgba(245, 154, 0, 0.08); }
.admin-item button { padding: 8px 12px; border-radius: 999px; background: white; box-shadow: none; border: 1px solid var(--line); cursor: pointer; }
.admin-item-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.admin-item-copy h3 { margin: 0 0 4px; font-size: 1rem; }
.admin-item-copy p { margin: 0; color: var(--muted); font-size: 0.92rem; }

@media (max-width: 900px) {
  .admin-layout, .inline-form, .visual-filter { grid-template-columns: 1fr; }
  .admin-toolbar { justify-content: flex-start; }
  .color-wheel-panel { justify-content: start; }
}

@media (max-width: 720px) {
  .site-nav {
    margin: 14px 0 18px;
    padding: 10px;
    gap: 8px;
  }

  .site-nav-link {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.92rem;
  }
}

.fv-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 154, 0, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(13, 151, 166, 0.12), transparent 22%),
    linear-gradient(180deg, #f5f1ea 0%, #efeae2 100%);
}

.fv-shell {
  width: min(1460px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.fv-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 360px);
  gap: 18px;
  margin-bottom: 18px;
}

.fv-hero-copy,
.fv-status-card,
.fv-panel,
.fv-prompt-card,
.fv-output-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 64px rgba(46, 31, 11, 0.08);
  backdrop-filter: blur(18px);
}

.fv-hero-copy,
.fv-status-card,
.fv-panel {
  border-radius: 28px;
  padding: 24px;
}

.fv-kicker,
.fv-panel-kicker,
.fv-status-label,
.fv-preview-label,
.fv-search-label {
  margin: 0 0 10px;
  color: #b56a00;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fv-title {
  margin: 0 0 10px;
  font: 500 clamp(2.6rem, 5vw, 4.8rem)/0.94 var(--font-heading);
  letter-spacing: -0.05em;
}

.fv-subtitle,
.fv-note,
.fv-status-text,
.fv-color-finish,
.fv-preset-meta,
.fv-color-family {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.fv-status-card {
  align-content: start;
  display: grid;
}

.fv-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.fv-panel {
  display: grid;
  gap: 18px;
}

.fv-panel-output {
  position: sticky;
  top: 18px;
}

.fv-panel-head h2 {
  margin: 0;
  font: 500 clamp(1.4rem, 2vw, 2.1rem)/1.05 var(--font-heading);
}

.fv-source-toggle,
.fv-family-row,
.fv-actions,
.fv-output-head,
.fv-preview-head {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.fv-toggle,
.fv-family-chip,
.fv-generate,
.fv-preset-card,
.fv-color-card {
  border: 0;
  cursor: pointer;
}

.fv-toggle,
.fv-family-chip {
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.fv-toggle.is-active,
.fv-family-chip.is-active {
  background: var(--accent);
  color: #fff;
}

.fv-preset-grid,
.fv-color-grid,
.fv-output-grid {
  display: grid;
  gap: 12px;
}

.fv-preset-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fv-color-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 720px;
  overflow: auto;
  padding-right: 4px;
}

.fv-preset-card,
.fv-color-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
  text-align: left;
}

.fv-preset-card.is-active,
.fv-color-card.is-active {
  outline: 2px solid rgba(245, 154, 0, 0.75);
  box-shadow: 0 22px 44px rgba(245, 154, 0, 0.18);
}

.fv-preset-media,
.fv-color-swatch,
.fv-image-frame {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #e5e2dc, #f7f5f1);
}

.fv-preset-media {
  aspect-ratio: 4 / 3;
}

.fv-color-swatch {
  aspect-ratio: 1 / 1;
}

.fv-image-frame {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
}

.fv-preset-image,
.fv-color-image,
.fv-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fv-color-image {
  object-fit: contain;
}

.fv-preset-title,
.fv-color-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.fv-color-copy,
.fv-preset-copy {
  display: grid;
  gap: 4px;
}

.fv-search input,
.fv-upload input {
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
}

.fv-upload {
  display: block;
  padding: 16px;
  border: 1px dashed rgba(181, 106, 0, 0.35);
  border-radius: 20px;
  background: rgba(255, 249, 240, 0.85);
}

.fv-upload-copy,
.fv-selected-summary {
  color: var(--ink);
  font-weight: 600;
}

.fv-generate {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59a00, #cf7900);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 18px 44px rgba(207, 121, 0, 0.24);
}

.fv-generate:disabled {
  opacity: 0.56;
  cursor: wait;
}

.fv-output-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fv-output-card,
.fv-prompt-card {
  border-radius: 24px;
  padding: 16px;
}

.fv-prompt-preview {
  margin: 0;
  white-space: pre-wrap;
  font: 0.92rem/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #3d3b39;
}

@media (max-width: 1180px) {
  .fv-grid {
    grid-template-columns: 1fr;
  }

  .fv-panel-output {
    position: static;
  }

  .fv-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .fv-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 14px;
  }

  .fv-panel,
  .fv-hero-copy,
  .fv-status-card {
    padding: 18px;
    border-radius: 22px;
  }

  .fv-preset-grid,
  .fv-color-grid,
  .fv-output-grid {
    grid-template-columns: 1fr;
  }
}

.admin-shell-v2 { width: min(1440px, calc(100vw - 32px)); }
.admin-hero-v2 { grid-template-columns: 1.4fr 1fr; align-items: center; }
.admin-page-nav { margin-bottom: 20px; }
.admin-page-nav-header { margin-bottom: 14px; }
.admin-page-nav-header .panel-note { margin-bottom: 0; }
.admin-page-nav-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.admin-page-link {
  display: grid;
  gap: 6px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at top right, rgba(30, 151, 166, 0.08), transparent 34%),
    rgba(255,255,255,0.9);
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}
.admin-page-link:hover,
.admin-page-link:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(13, 151, 166, 0.26);
  box-shadow: 0 20px 32px rgba(28, 34, 42, 0.11);
}
.admin-page-link strong {
  font-size: 1rem;
  line-height: 1.15;
}
.admin-page-link span {
  color: var(--muted);
  line-height: 1.45;
}
.admin-page-link .eyebrow { margin: 0; }
.admin-page-link.is-current {
  border-color: rgba(13, 151, 166, 0.34);
  background:
    radial-gradient(circle at top right, rgba(30, 151, 166, 0.14), transparent 38%),
    rgba(255,255,255,0.96);
}
.admin-workspace { display: grid; grid-template-columns: minmax(320px, 520px) minmax(420px, 1fr); gap: 22px; align-items: start; }
.board-panel { min-height: 70vh; }
.detail-panel { min-height: 0; }
.family-board-grid { display: grid; gap: 18px; }
.family-board { border: 1px solid var(--line); border-radius: 22px; padding: 16px; background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,247,247,0.96)); }
.family-board-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 14px; }
.family-board-header h3 { margin: 0; font: 600 1.1rem/1.1 var(--font-heading); }
.family-board-list { display: grid; gap: 12px; min-height: 32px; }
.admin-color-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; border: 1px solid var(--line); border-radius: 18px; padding: 10px; background: white; box-shadow: var(--shadow); }
.admin-color-card.is-selected { border-color: var(--accent); box-shadow: 0 18px 50px rgba(245, 154, 0, 0.18); }
.admin-color-card.is-hidden { opacity: 0.62; }
.admin-color-card.is-dragging { opacity: 0.28; }
.admin-color-placeholder { min-height: 104px; border: 2px dashed var(--accent); border-radius: 18px; background: rgba(245, 154, 0, 0.08); }
.admin-color-card-button { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; padding: 0; background: transparent; border: 0; text-align: left; cursor: pointer; }
.admin-color-card-thumb { aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, #e2e2e2, #f4f4f4); }
.admin-color-card-image { width: 100%; height: 100%; object-fit: cover; }
.admin-color-card-copy { min-width: 0; }
.admin-color-card-title { margin: 0 0 6px; font-size: 1rem; }
.admin-color-card-meta { margin: 0; color: var(--muted); font-size: 0.9rem; }
.admin-color-card-actions { display: grid; gap: 8px; align-content: start; }
.drag-pill { display: inline-flex; justify-content: center; padding: 8px 10px; border-radius: 999px; background: #fff1d6; color: var(--accent-strong); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
.detail-panel {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
  overflow: auto;
  scrollbar-gutter: stable;
}
.empty-detail { display: grid; place-items: center; min-height: 180px; padding: 12px 8px 8px; text-align: center; color: var(--muted); }
.empty-detail[hidden], #colorWorkspace[hidden] { display: none !important; }
.empty-detail h2 { margin: 0 0 8px; color: var(--ink); font-size: 1.5rem; }
.empty-detail p { margin: 0; max-width: 34ch; }
.detail-header { display: grid; grid-template-columns: 160px 1fr; gap: 14px; align-items: start; margin-bottom: 16px; }
.detail-cover { border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, #d9d9d9, #f4f4f4); aspect-ratio: 1 / 1; }
.detail-cover img { width: 100%; height: 100%; object-fit: contain; }
.detail-meta { display: grid; gap: 8px; }
.detail-meta .eyebrow { margin: 0 0 2px; }
.detail-meta h2 { margin: 0; font: 500 clamp(1.45rem, 1.8vw, 2.15rem)/1 var(--font-heading); }
.detail-meta .panel-note { margin: 0; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-card-form { margin-bottom: 22px; }
.cover-dropzone { margin-bottom: 2px; }
.editor-form .admin-toggle,
.admin-toggle {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}
.editor-form .admin-toggle input[type="checkbox"],
.admin-toggle input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 18px;
  accent-color: var(--accent);
}
.admin-toggle-inline {
  padding-top: 4px;
  align-items: flex-start;
  line-height: 1.35;
}
.advanced-panel { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: rgba(247,247,247,0.92); }
.admin-manual-picker { display: grid; gap: 10px; margin-top: 12px; }
.admin-manual-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.admin-manual-picker-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.admin-manual-picker-value { font-size: 0.9rem; font-weight: 700; color: var(--ink); }
.admin-manual-picker-source { margin: -2px 0 0; color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.admin-card-form .admin-manual-picker-stage {
  display: block;
  min-height: 128px;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}
.admin-card-form .admin-manual-picker-field {
  position: relative;
  display: block;
  width: 100%;
  height: 128px;
  border: 0;
  border-radius: 18px;
  padding: 0;
  cursor: crosshair;
  color: transparent;
  -webkit-text-fill-color: transparent;
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.24) 28%, rgba(255,255,255,0) 52%, rgba(0,0,0,0.16) 72%, rgba(0,0,0,1) 100%),
    linear-gradient(180deg, #ffffff 0%, #000000 100%) left / 14% 100% no-repeat,
    linear-gradient(90deg,
      #ff3f33 0%,
      #ffb648 16%,
      #f2eb5d 25%,
      #57dc66 40%,
      #2fd3cb 54%,
      #4d8cff 68%,
      #7d5cff 82%,
      #ff3f33 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.44), 0 14px 28px rgba(30, 34, 40, 0.12);
}
.admin-card-form .admin-manual-picker-field[data-enabled="false"] {
  opacity: 0.72;
}
.admin-card-form .admin-manual-picker-field:focus-visible {
  outline: 3px solid rgba(77, 140, 255, 0.34);
  outline-offset: 2px;
}
.admin-card-form .admin-manual-picker-indicator {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.94);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(20, 24, 29, 0.2);
  pointer-events: none;
}
.advanced-panel summary { cursor: pointer; font-weight: 600; }
.advanced-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-top: 12px; }
.image-manager { border-top: 1px solid var(--line); padding-top: 18px; }
.image-manager-header { align-items: start; }
.image-manager-actions { justify-content: flex-end; }
.image-dropzone { border: 2px dashed #f2c57a; border-radius: 22px; background: linear-gradient(180deg, rgba(245,154,0,0.06), rgba(255,255,255,0.96)); padding: 26px 20px; text-align: center; cursor: pointer; margin-bottom: 18px; }
.image-dropzone strong { display: block; margin-bottom: 6px; font-size: 1.05rem; }
.image-dropzone p { margin: 0; color: var(--muted); }
.image-dropzone.is-over { border-color: var(--accent); background: linear-gradient(180deg, rgba(245,154,0,0.12), rgba(255,255,255,0.98)); }
.image-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.hidden-image-grid { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.image-tile { position: relative; border: 1px solid var(--line); border-radius: 18px; background: white; overflow: hidden; box-shadow: var(--shadow); }
.image-tile.is-selected { border-color: var(--accent); box-shadow: 0 18px 46px rgba(245, 154, 0, 0.16); }
.image-tile.is-bulk-selected { border-color: var(--accent); box-shadow: 0 18px 46px rgba(245, 154, 0, 0.16); }
.image-tile.is-hidden { opacity: 0.6; }
.image-tile.is-dragging { opacity: 0.22; }
.image-placeholder { border: 2px dashed var(--accent); background: rgba(245, 154, 0, 0.08); min-height: 214px; }
.image-tile-select {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255,255,255,0.94);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.image-tile-select input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.image-tile-select input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.image-tile-button { width: 100%; padding: 0; border: 0; background: linear-gradient(180deg, #ececec, #f8f8f8); cursor: pointer; }
.image-tile-image { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; padding: 8px; }
.image-tile-copy { display: grid; gap: 10px; padding: 10px 12px 12px; }
.image-tile-caption { margin: 0; color: var(--muted); font-size: 0.9rem; line-height: 1.4; min-height: 2.4em; }
.image-tile-toggle { justify-content: flex-start; font-size: 0.82rem; }
.image-tile-toggle span { font-weight: 600; color: var(--ink); }
.image-tile-toggle input[type="checkbox"] { margin-top: 1px; }
.image-selection-summary { align-self: center; color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.image-inspector { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 18px; }
.image-inspector-layout { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.image-inspector-preview { border-radius: 20px; overflow: hidden; background: linear-gradient(180deg, #ececec, #f7f7f7); }
.image-inspector-preview img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; }

.vizadmin-shell { width: min(1320px, calc(100vw - 32px)); }
.vizadmin-workspace { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.9fr); gap: 22px; align-items: start; }
.vizadmin-toolbar { justify-content: flex-end; }
.vizadmin-main-panel,
.vizadmin-side-panel { min-height: 0; }
.vizadmin-form { display: grid; gap: 18px; }
.vizadmin-field-grid { margin-top: 0; }
.vizadmin-provider-panel { display: grid; gap: 12px; }
.vizadmin-provider-panel > strong { display: block; margin: 0; }
.vizadmin-form textarea { min-height: 120px; resize: vertical; }
.vizadmin-inline-note {
  margin: 0;
  padding-top: 2px;
  line-height: 1.45;
  min-height: 1.45em;
}
.vizadmin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.vizadmin-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 14px; }
.vizadmin-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  color: var(--ink);
}
.vizadmin-badge-muted { color: var(--muted); }
.vizadmin-estimate-warning { display: grid; gap: 6px; margin-bottom: 14px; }
.vizadmin-estimate-warning strong,
.vizadmin-notes strong { color: var(--ink); }
.vizadmin-estimate-warning p,
.vizadmin-notes p { margin: 0; color: var(--muted); line-height: 1.5; }
.vizadmin-estimate-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.vizadmin-estimate-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,246,246,0.96));
  box-shadow: var(--shadow);
}
.vizadmin-estimate-label {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}
.vizadmin-estimate-total {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.1;
}
.vizadmin-estimate-breakdown {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}
.vizadmin-limit-reset-panel {
  grid-column: 1 / -1;
  margin-top: 8px;
}
.vizadmin-limit-reset-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
}
.vizadmin-limit-reset-form label {
  flex: 1;
  min-width: 280px;
  margin: 0;
}
.vizadmin-limit-reset-form input {
  width: 100%;
  margin-top: 6px;
}
.vizadmin-limit-reset-form button {
  margin-bottom: 0;
}
.vizadmin-reset-status {
  margin-top: 10px;
}
.vizadmin-estimate-total {
  margin: 0;
  font: 600 clamp(1.6rem, 2vw, 2.3rem)/1 var(--font-heading);
  color: var(--ink);
}
.vizadmin-estimate-breakdown {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.vizadmin-notes { display: grid; gap: 8px; margin-top: 16px; }

@media (max-width: 1100px) {
  .admin-workspace { grid-template-columns: 1fr; }
  .vizadmin-workspace { grid-template-columns: 1fr; }
  .admin-page-nav-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-panel {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 750px) {
  .app-shell { width: min(100vw - 20px, 640px); padding: 18px 0 44px; }
  .hero { gap: 14px; margin-bottom: 14px; }
  .hero-brand { gap: 6px; }
  .eyebrow { margin-bottom: 6px; font-size: 0.72rem; letter-spacing: 0.14em; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .hero-copy { font-size: 0.92rem; line-height: 1.45; }
  .gallery-controls { gap: 8px; grid-template-columns: 1fr; margin-bottom: 14px; }
  .search-panel { min-height: 0; padding: 12px; gap: 10px; border-radius: 20px; }
  .search-panel-note { font-size: 0.88rem; line-height: 1.35; }
  .gallery-controls input { padding: 12px 14px; border-radius: 12px; }
  .visual-filter { grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-bottom: 12px; padding: 10px 12px; border-radius: 20px; }
  .visual-filter-copy { align-self: center; gap: 4px; }
  .visual-filter-label { font-size: 0.64rem; letter-spacing: 0.1em; }
  .visual-filter-actions { margin-top: 0; gap: 8px; }
  .visual-filter-actions .ghost-button { padding: 9px 12px; font-size: 0.88rem; }
  .color-wheel-panel { justify-content: end; }
  .color-wheel { width: 112px; height: 112px; box-shadow: inset 0 0 0 8px rgba(255,255,255,0.96), 0 12px 28px rgba(0,0,0,0.12); }
  .color-wheel-core { inset: 28px; }
  .color-wheel-indicator { width: 16px; height: 16px; margin: -8px 0 0 -8px; }
  .family-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; align-items: stretch; }
  .family-chip { width: 100%; min-height: 54px; height: 100%; padding: 9px 10px; white-space: normal; text-align: center; line-height: 1.2; box-shadow: 0 10px 24px rgba(0,0,0,0.08); display: flex; align-items: center; justify-content: center; }
  .ghost-button { padding: 9px 13px; white-space: nowrap; }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .gallery-grid.is-loading { min-height: 1260px; }
  .gallery-pagination { gap: 10px; margin-top: 14px; }
  .gallery-pagination .ghost-button { min-width: 104px; }
  .pagination-status { min-width: 88px; font-size: 0.88rem; }
  .card-copy { padding: 12px 12px 14px; }
  .card-family { margin-bottom: 6px; font-size: 0.68rem; }
  .card-title { margin-bottom: 6px; font-size: 1rem; }
  .card-description { -webkit-line-clamp: 2; font-size: 0.88rem; line-height: 1.4; }
  .viewer-shell { width: calc(100vw - 8px); max-height: calc(100dvh - 12px); top: var(--viewer-top, 10px); }
  .dialog-header { gap: 10px; }
  .dialog-header h2 { font-size: 1.4rem; }
  .dialog-description { font-size: 0.88rem; line-height: 1.38; }
  .dialog-images { grid-template-columns: 1fr; gap: 12px; }
  .dialog-gallery-view { grid-template-rows: minmax(0, 1fr) auto; }
  .dialog-pagination { min-height: 48px; gap: 8px; padding: 10px 2px 14px; }
  .dialog-pagination .ghost-button { min-width: 92px; padding: 8px 12px; }
  .dialog-image-button { padding: 8px; border-radius: 16px; }
  .dialog-image { aspect-ratio: 4 / 3; border-radius: 10px; }
  .dialog-caption { padding: 0 10px 10px; font-size: 0.84rem; line-height: 1.35; }
  .dialog-image-toolbar { align-items: center; justify-content: flex-start; }
  .dialog-image-stage { padding: 10px; }
  .back-to-top { display: grid; place-items: center; }
  .admin-hero-v2, .detail-header, .image-inspector-layout, .admin-color-card-button { grid-template-columns: 1fr; }
  .admin-toolbar { justify-content: flex-start; }
  .admin-page-nav-grid { grid-template-columns: 1fr; }
  .vizadmin-shell { width: min(100vw - 20px, 720px); }
  .vizadmin-estimate-grid { grid-template-columns: 1fr; }
  .vizadmin-actions { flex-direction: column; align-items: stretch; }
}

@media (min-width: 751px) {
  .dialog-gallery-view { grid-template-rows: minmax(0, 1fr) auto; }
  .dialog-images { overflow: hidden; }
  .dialog-image-button { padding: 8px; }
  .dialog-image { aspect-ratio: 16 / 11; }
  .back-to-top { display: none !important; }
}

.skeleton-card { border-radius: var(--radius); overflow: hidden; background: #ffffff; box-shadow: var(--shadow); }
.skeleton-image { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: linear-gradient(180deg, #ececec 0%, #f4f4f4 100%); }
.skeleton-copy { display: grid; gap: 10px; padding: 18px; }
.skeleton-line { position: relative; height: 12px; border-radius: 999px; overflow: hidden; background: linear-gradient(180deg, #ececec 0%, #f4f4f4 100%); }
.skeleton-line.is-short { width: 54%; }

.fv-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 0% 0%, rgba(212, 176, 129, 0.24), transparent 28%),
    radial-gradient(circle at 100% 0%, rgba(155, 167, 187, 0.24), transparent 24%),
    linear-gradient(180deg, #f7f3ec 0%, #eee7dd 46%, #e8e1d8 100%);
  color: #181512;
}

.fv-body.fv-gate-open {
  overflow: hidden;
}

.fv-entry-gate {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(244, 171, 35, 0.16), rgba(244, 171, 35, 0) 34%),
    rgba(12, 10, 8, 0.56);
  backdrop-filter: blur(18px) saturate(1.05);
}

.fv-entry-gate[hidden] {
  display: none !important;
}

.fv-entry-card {
  width: min(640px, calc(100vw - 32px));
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(255,255,255,0.82));
  box-shadow: 0 36px 90px rgba(23, 16, 9, 0.22);
}

.fv-brand-mark {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
}

.fv-brand-mark-entry {
  width: min(320px, 72%);
}

.fv-brand-mark-header {
  width: min(260px, 46vw);
  margin-bottom: 2px;
}

.fv-entry-title {
  margin: -6px 0 0;
  font: 500 clamp(1.8rem, 3vw, 3rem)/0.96 var(--font-heading);
  letter-spacing: -0.05em;
}

.fv-entry-copy {
  display: grid;
  gap: 12px;
  color: #615850;
  line-height: 1.55;
}

.fv-entry-copy p {
  margin: 0;
}

.fv-entry-button {
  justify-self: start;
}

.fv-shell {
  width: min(1920px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 18px 0 22px;
}

.fv-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-bottom: 10px;
}

.fv-hero-copy,
.fv-panel,
.fv-stage-panel {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: linear-gradient(180deg, rgba(255,255,255,0.82), rgba(255,255,255,0.64));
  box-shadow: 0 30px 80px rgba(47, 31, 12, 0.09);
  backdrop-filter: blur(20px) saturate(1.08);
}

.fv-hero-copy::before,
.fv-panel::before,
.fv-stage-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.42), rgba(255,255,255,0));
  pointer-events: none;
}

.fv-hero-copy,
.fv-panel {
  padding: 16px 22px;
}

.fv-kicker,
.fv-panel-kicker,
.fv-preview-label,
.fv-search-label {
  margin: 0 0 10px;
  color: #9b6120;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.fv-title {
  margin: 0 0 6px;
  font: 500 clamp(2rem, 3.1vw, 3.4rem)/0.98 var(--font-heading);
  letter-spacing: -0.06em;
  max-width: none;
  white-space: nowrap;
}

.fv-subtitle,
.fv-stage-note,
.fv-source-caption,
.fv-color-family,
.fv-color-finish,
.fv-preset-meta {
  margin: 0;
  color: #675f58;
  line-height: 1.35;
}

.fv-studio {
  display: grid;
  gap: 14px;
  min-height: 0;
}

.fv-desktop-nav {
  display: none;
  gap: 10px;
  align-items: center;
}

.fv-progress-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.fv-progress-card {
  border: 0;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 24px;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 20px 40px rgba(26, 20, 15, 0.06);
  cursor: pointer;
  text-align: left;
  color: #231d18;
}

.fv-progress-card.is-selected,
.fv-progress-card.is-ready {
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,243,238,0.86));
  box-shadow: 0 22px 48px rgba(26, 20, 15, 0.09);
}

.fv-progress-card-preview {
  grid-template-columns: minmax(0, 1fr);
}

.fv-progress-thumb {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #ebe6df, #f8f5f1);
  border: 1px solid rgba(255,255,255,0.92);
}

.fv-progress-thumb img[hidden] {
  display: none;
}

.fv-progress-thumb-finish {
  padding: 4px;
}

.fv-progress-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.fv-progress-step {
  margin: 0;
  color: #9b6120;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.fv-progress-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.15;
}

.fv-workspace {
  min-height: 0;
  display: grid;
}

.fv-workspace-panel {
  display: none !important;
  min-height: 0;
}

.fv-workspace-panel.is-active {
  display: grid !important;
}

.fv-desktop-nav-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  box-shadow: 0 14px 26px rgba(22, 18, 13, 0.05);
  color: #231d18;
  cursor: pointer;
  font-weight: 700;
}

.fv-desktop-nav-button.is-active {
  background: linear-gradient(135deg, #1f1b18, #544638);
  color: #f7f3ee;
}

.fv-top-row {
  display: grid;
  grid-template-columns: minmax(380px, 450px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.fv-vehicle-panel {
  min-height: 100%;
}

.fv-panel {
  display: grid;
  gap: 14px;
}

.fv-panel-head h2,
.fv-stage-head h2 {
  margin: 0;
  font: 500 clamp(1.4rem, 2vw, 2.4rem)/1.02 var(--font-heading);
  letter-spacing: -0.04em;
}

.fv-source-toggle,
.fv-family-row,
.fv-stage-head,
.fv-stage-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.fv-source-toggle,
.fv-family-row {
  justify-content: flex-start;
}

.fv-toggle,
.fv-family-chip,
.fv-preset-card,
.fv-color-card,
.fv-generate,
.fv-download,
.fv-secondary-button,
.fv-clear-upload {
  border: 0;
  text-decoration: none;
}

.fv-toggle,
.fv-family-chip,
.fv-secondary-button,
.fv-clear-upload {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border-radius: 999px;
  background: rgba(255,255,255,0.88);
  box-shadow: 0 14px 26px rgba(22, 18, 13, 0.05);
  color: #231d18;
  cursor: pointer;
}

.fv-secondary-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.fv-toggle.is-active,
.fv-family-chip.is-active {
  background: linear-gradient(135deg, #1f1b18, #544638);
  color: #f7f3ee;
}

.fv-search input {
  width: 100%;
  border: 1px solid rgba(66, 55, 44, 0.1);
  border-radius: 18px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.fv-upload {
  display: grid;
  gap: 8px;
  padding: 22px;
  border-radius: 24px;
  border: 1px dashed rgba(131, 88, 33, 0.28);
  background:
    radial-gradient(circle at top right, rgba(245,154,0,0.1), transparent 26%),
    linear-gradient(180deg, rgba(255,250,242,0.96), rgba(255,255,255,0.78));
}

.fv-upload input {
  width: 100%;
  margin-top: 4px;
}

.fv-upload-copy,
.fv-selected-summary {
  color: #181512;
  font-weight: 700;
}

.fv-upload-note {
  color: #6d655e;
  font-size: 0.95rem;
  line-height: 1.5;
}

.fv-clear-upload {
  justify-self: start;
}

.fv-preset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
}

.fv-color-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-height: 780px;
  overflow: auto;
  padding-right: 4px;
}

.fv-preset-card,
.fv-color-card {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 22px;
  cursor: pointer;
  background: rgba(255,255,255,0.78);
  box-shadow: 0 18px 34px rgba(26, 20, 15, 0.06);
  text-align: left;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  border: 1px solid rgba(255,255,255,0.92);
}

.fv-preset-card:hover,
.fv-color-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 44px rgba(26, 20, 15, 0.1);
}

.fv-preset-card.is-active,
.fv-color-card.is-active {
  border-color: rgba(37, 28, 20, 0.86);
  box-shadow: 0 24px 54px rgba(34, 25, 17, 0.16);
}

.fv-preset-media,
.fv-color-swatch,
.fv-stage-image-frame,
.fv-finish-spotlight {
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #ebe6df, #f8f5f1);
}

.fv-preset-media {
  aspect-ratio: 4 / 3;
}

.fv-color-swatch {
  aspect-ratio: 1 / 1;
}

.fv-preset-image,
.fv-color-image,
.fv-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fv-image-contain,
.fv-color-image {
  object-fit: contain;
}

.fv-preset-copy,
.fv-color-copy {
  display: grid;
  gap: 4px;
}

.fv-preset-title,
.fv-color-title {
  margin: 0;
  font-weight: 700;
  color: #16120f;
}

.fv-preset-meta[hidden],
.fv-color-finish[hidden] {
  display: none;
}

.fv-preset-meta {
  color: #7a726a;
  font-size: 0.9rem;
}

.fv-stage-panel {
  padding: 18px;
}

.fv-stage-head {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.fv-stage-copy {
  display: grid;
  gap: 6px;
}

.fv-stage-actions {
  justify-content: flex-end;
}

.fv-generate,
.fv-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
}

.fv-generate {
  cursor: pointer;
  color: #f9f5ef;
  background: linear-gradient(135deg, #1d1813, #6a553e);
  box-shadow: 0 20px 44px rgba(34, 27, 20, 0.24);
}

.fv-generate:disabled {
  opacity: 0.58;
  cursor: wait;
}

.fv-download {
  background: rgba(255,255,255,0.82);
  color: #221b15;
  box-shadow: 0 14px 28px rgba(26,20,15,0.08);
}

.fv-stage-canvas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: stretch;
  min-height: 0;
}

.fv-stage-main,
.fv-stage-rail {
  min-width: 0;
}

.fv-stage-rail {
  display: grid;
  gap: 14px;
}

.fv-finish-band {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.72);
  background:
    radial-gradient(circle at top right, rgba(245, 154, 0, 0.12), transparent 18%),
    radial-gradient(circle at 20% 0%, rgba(130, 184, 205, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,255,255,0.68));
  box-shadow: 0 30px 80px rgba(47, 31, 12, 0.09);
  backdrop-filter: blur(20px) saturate(1.08);
}

.fv-finish-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 120px);
  pointer-events: none;
}

.fv-finish-band-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 14px;
  align-items: end;
}

.fv-finish-band-copy {
  display: grid;
  gap: 6px;
}

.fv-finish-band-tools {
  display: grid;
  gap: 12px;
  align-items: end;
}

.fv-finish-band .fv-search {
  display: grid;
  gap: 8px;
}

.fv-stage-image-frame {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.9);
}

.fv-stage-image-frame-result {
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.72), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #d9d4ce, #f6f2ed);
}

.fv-stage-image-frame-source {
  aspect-ratio: 1 / 1;
}

.fv-image-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

#resultImage {
  width: auto;
  height: auto;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  object-fit: contain;
  object-position: center;
}

.fv-stage-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  padding: 28px;
  text-align: center;
  background: linear-gradient(180deg, rgba(248,245,240,0.68), rgba(248,245,240,0.88));
  z-index: 2;
}

.fv-result-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  background: linear-gradient(180deg, rgba(34, 29, 24, 0.2), rgba(34, 29, 24, 0.32));
  backdrop-filter: blur(10px);
  z-index: 8;
}

.fv-result-loading-inner {
  width: min(420px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,243,238,0.88));
  box-shadow: 0 24px 60px rgba(24, 18, 13, 0.18);
  text-align: center;
}

.fv-spinner {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 3px solid rgba(100, 81, 61, 0.18);
  border-top-color: #5e4a38;
  animation: fv-spin 0.9s linear infinite;
}

.fv-result-loading-title {
  margin: 0;
  font: 500 1.35rem/1.05 var(--font-heading);
  letter-spacing: -0.03em;
}

.fv-result-loading-copy {
  margin: 0;
  color: #6f665f;
  line-height: 1.5;
}

@keyframes fv-spin {
  to { transform: rotate(360deg); }
}

.fv-stage-placeholder-title {
  margin: 0 0 8px;
  font: 500 clamp(1.4rem, 2vw, 2.3rem)/1.02 var(--font-heading);
  letter-spacing: -0.04em;
}

.fv-stage-placeholder-copy {
  max-width: 28ch;
  margin: 0;
  color: #6d655e;
  line-height: 1.55;
}

.fv-source-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.62);
}

.fv-source-card-button {
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.fv-source-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fv-finish-spotlight {
  aspect-ratio: 1 / 1;
  padding: 10px;
}

.fv-source-caption {
  font-size: 0.95rem;
}

.fv-family-row {
  gap: 12px;
  padding-bottom: 2px;
}

.fv-color-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  max-height: min(40vh, 720px);
  overflow: auto;
  padding: 6px 6px 6px 0;
  align-content: start;
}

.fv-color-card {
  gap: 10px;
  padding: 10px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.95), rgba(247,243,238,0.92));
}

.fv-color-card.is-active {
  border-color: rgba(37, 28, 20, 0.92);
  box-shadow: 0 26px 56px rgba(34, 25, 17, 0.18);
}

.fv-color-swatch {
  aspect-ratio: 1 / 1;
  padding: 8px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.88), rgba(255,255,255,0) 40%),
    linear-gradient(180deg, #f0ece6, #faf7f3);
}

.fv-color-copy {
  gap: 3px;
}

.fv-color-family {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9b6120;
}

.fv-color-title {
  font-size: 0.96rem;
}

.fv-color-finish {
  font-size: 0.84rem;
  line-height: 1.35;
}

.fv-selected-summary {
  justify-self: end;
  width: fit-content;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(255,255,255,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 16px 32px rgba(28,22,16,0.06);
}

.fv-mobile-nav {
  display: none;
}

@media (min-width: 721px) {
  .fv-body {
    overflow: hidden;
  }

  .fv-shell {
    height: 100dvh;
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fv-studio {
    overflow: hidden;
    min-height: 0;
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fv-desktop-nav {
    display: inline-flex;
    justify-self: start;
    align-self: start;
  }

  .fv-workspace,
  .fv-stage,
  .fv-stage-panel,
  .fv-stage-canvas,
  .fv-stage-main,
  .fv-stage-rail,
  .fv-vehicle-panel,
  .fv-source-panel,
  .fv-finish-band,
  .fv-workspace-panel {
    min-height: 0;
  }

  .fv-workspace-panel[data-panel="car"] {
    width: min(1260px, 100%);
    justify-self: center;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .fv-workspace-panel[data-panel="preview"] {
    width: 100%;
  }

  .fv-workspace-panel[data-panel="finish"] {
    width: 100%;
  }

  .fv-vehicle-panel,
  .fv-stage-panel,
  .fv-finish-band {
    overflow: hidden;
  }

  .fv-stage-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
  }

  .fv-workspace-panel[data-panel="preview"] .fv-stage-panel {
    width: min(1760px, 100%);
    justify-self: stretch;
  }

  .fv-workspace-panel[data-panel="finish"] .fv-finish-band {
    height: 100%;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .fv-stage-main {
    display: grid;
  }

  .fv-stage-rail {
    align-content: start;
    padding-right: 4px;
  }

  .fv-source-panel,
  .fv-preset-grid,
  .fv-color-grid,
  .fv-stage-rail {
    overflow: auto;
  }

  .fv-preset-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .fv-color-grid {
    max-height: none;
    height: 100%;
  }
}

@media (max-width: 1240px) {
  .fv-top-row {
    grid-template-columns: 1fr;
  }

  .fv-stage-canvas {
    grid-template-columns: 1fr;
  }

  .fv-stage-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .fv-stage-image-frame-result {
    min-height: 560px;
  }

  .fv-finish-band-head {
    grid-template-columns: 1fr;
  }

  .fv-color-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .fv-hero {
    grid-template-columns: 1fr;
  }

  .fv-preset-grid,
  .fv-color-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .fv-body {
    overflow: hidden;
  }

  .fv-shell {
    width: 100vw;
    min-height: 100dvh;
    padding: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fv-hero {
    margin: 0;
    padding: 10px 10px 0;
  }

  .fv-hero-copy {
    border-radius: 22px;
    padding: 12px 14px;
  }

  .fv-brand-mark-header {
    width: min(180px, 46vw);
    margin-bottom: 0;
  }

  .fv-title {
    max-width: none;
    margin-bottom: 2px;
    font-size: clamp(1.35rem, 5.8vw, 1.9rem);
    white-space: normal;
  }

  .fv-subtitle {
    font-size: 0.84rem;
    line-height: 1.28;
  }

  .fv-studio {
    min-height: 0;
    padding: 10px 10px 88px;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .fv-desktop-nav {
    display: none;
  }

  .fv-workspace {
    min-height: 0;
    overflow: hidden;
  }

  .fv-progress-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow-x: auto;
    padding: 0 2px 2px;
    scrollbar-width: none;
  }

  .fv-progress-strip::-webkit-scrollbar {
    display: none;
  }

  .fv-progress-card {
    min-height: 64px;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
    border-radius: 20px;
  }

  .fv-progress-card-preview {
    grid-template-columns: minmax(0, 1fr);
  }

  .fv-progress-thumb {
    width: 44px;
    height: 44px;
    border-radius: 14px;
  }

  .fv-progress-step {
    font-size: 0.62rem;
  }

  .fv-progress-title {
    font-size: 0.88rem;
  }

  .fv-panel,
  .fv-stage-panel,
  .fv-finish-band {
    border-radius: 24px;
    padding: 14px;
    min-height: 0;
    overflow: hidden;
  }

  .fv-panel-head,
  .fv-stage-head,
  .fv-finish-band-head {
    gap: 10px;
  }

  .fv-panel-head h2,
  .fv-stage-head h2,
  .fv-finish-band-head h2 {
    font-size: 1.15rem;
  }

  .fv-vehicle-panel,
  .fv-stage-panel,
  .fv-finish-band {
    grid-template-rows: auto auto minmax(0, 1fr);
    min-height: 0;
  }

  .fv-source-panel,
  .fv-preset-grid,
  .fv-color-grid {
    min-height: 0;
    overflow: auto;
    padding-bottom: 18px;
  }

  .fv-preset-grid,
  .fv-color-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .fv-source-toggle {
    flex-wrap: nowrap;
    width: 100%;
  }

  .fv-toggle,
  .fv-secondary-button,
  .fv-clear-upload,
  .fv-generate,
  .fv-download {
    min-height: 46px;
  }

  .fv-stage-panel {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fv-stage-head,
  .fv-stage-actions {
    align-items: stretch;
  }

  .fv-stage-actions {
    width: 100%;
  }

  .fv-generate,
  .fv-download {
    width: 100%;
  }

  .fv-stage-canvas {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .fv-stage-main {
    min-height: 0;
  }

  .fv-stage-image-frame-result {
    min-height: min(38vh, 320px);
  }

  .fv-stage-rail {
    display: none;
  }

  .fv-source-card {
    padding: 10px;
    gap: 8px;
  }

  .fv-source-caption {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  .fv-finish-band-head {
    grid-template-columns: 1fr;
  }

  .fv-finish-band-tools,
  .fv-selected-summary {
    justify-self: stretch;
  }

  .fv-selected-summary {
    width: auto;
  }

  .fv-family-row {
    flex-wrap: nowrap;
    overflow: auto;
    padding-bottom: 0;
  }

  .fv-mobile-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 25;
    padding: 10px;
    border-radius: 24px;
    background: rgba(247, 243, 236, 0.92);
    box-shadow: 0 22px 50px rgba(22, 18, 13, 0.14);
    backdrop-filter: blur(18px) saturate(1.04);
  }

  .fv-workspace-panel.is-active {
    height: 100%;
  }

  .fv-panel,
  .fv-stage-panel,
  .fv-finish-band,
  .fv-source-panel,
  .fv-preset-grid,
  .fv-color-grid {
    overscroll-behavior: contain;
  }

  .fv-source-panel,
  .fv-color-grid {
    padding-bottom: max(132px, calc(48px + env(safe-area-inset-bottom)));
    scroll-padding-bottom: max(132px, calc(48px + env(safe-area-inset-bottom)));
  }

  .fv-mobile-nav-button {
    min-height: 52px;
    border: 0;
    border-radius: 18px;
    background: rgba(255,255,255,0.86);
    color: #221b15;
    font-weight: 700;
    box-shadow: 0 14px 26px rgba(26, 20, 15, 0.08);
  }

  .fv-mobile-nav-button.is-active {
    background: linear-gradient(135deg, #1f1b18, #544638);
    color: #f7f3ee;
  }

  .fv-entry-gate {
    padding: 16px;
  }

  .fv-entry-card {
    width: min(100vw - 24px, 100%);
    padding: 20px;
    gap: 14px;
    border-radius: 24px;
  }

  .fv-brand-mark-entry {
    width: min(220px, 78%);
  }

  .fv-entry-button {
    justify-self: stretch;
    width: 100%;
  }
}
.skeleton-image::after,
.skeleton-line::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.72) 48%, rgba(255,255,255,0) 100%); animation: shimmer 1.25s linear infinite; }

/* Gallery redesign overrides */

.gallery-body {
  --gallery-bg: #0c1119;
  --gallery-bg-strong: #111824;
  --gallery-panel: rgba(15, 22, 33, 0.86);
  --gallery-panel-strong: linear-gradient(180deg, rgba(18, 27, 40, 0.98), rgba(11, 17, 27, 0.98));
  --gallery-panel-soft: rgba(24, 34, 48, 0.82);
  --gallery-panel-elevated: rgba(30, 42, 58, 0.94);
  --gallery-ink: #f3f5f8;
  --gallery-muted: #93a0b2;
  --gallery-accent: #f2a53c;
  --gallery-accent-strong: #ffbf67;
  --gallery-line: rgba(255, 255, 255, 0.08);
  --gallery-shadow: 0 24px 72px rgba(0, 0, 0, 0.36);
  --gallery-shadow-strong: 0 34px 100px rgba(0, 0, 0, 0.52);
  color: var(--gallery-ink);
  background: transparent;
}

.gallery-body .app-shell {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 32px 0 68px;
}

.gallery-body.is-compact .app-shell {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding-top: 18px;
}

.gallery-body.is-compact {
  min-height: 2000px;
  height: 2000px;
  overflow: hidden;
}

.gallery-body.is-compact .app-shell {
  min-height: 2000px;
  height: 2000px;
  overflow: hidden;
}

.gallery-body .hero {
  margin-bottom: 24px;
}

.gallery-body .hero-brand > div {
  padding: 28px 30px 32px;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(242, 165, 60, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(17, 25, 37, 0.98), rgba(8, 13, 22, 0.99));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255,255,255,0.1);
}

.gallery-body .eyebrow,
.gallery-body .card-family,
.gallery-body .visual-filter-label {
  color: var(--gallery-accent);
}

.gallery-body .hero h1 {
  color: var(--gallery-ink);
  font-weight: 500;
  letter-spacing: -0.05em;
}

.gallery-body .hero-copy,
.gallery-body .search-panel-note,
.gallery-body .card-description,
.gallery-body .pagination-status,
.gallery-body .dialog-description,
.gallery-body .dialog-caption,
.gallery-body .dialog-expanded-caption {
  color: var(--gallery-muted);
}

.gallery-body .hero-copy,
.gallery-body .search-panel-note {
  color: #c2ccda;
}

.gallery-body .gallery-controls {
  gap: 18px;
  grid-template-columns: minmax(340px, 1.05fr) minmax(320px, 0.95fr);
}

.gallery-body .search-panel,
.gallery-body .visual-filter {
  min-height: 0;
  border-radius: 30px;
  padding: 22px 24px;
  background:
    linear-gradient(180deg, rgba(16, 24, 36, 0.97), rgba(9, 14, 22, 0.98));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255,255,255,0.1);
}

.gallery-body .gallery-controls input {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.98), rgba(8, 13, 22, 0.98));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
  color: #f7f9fc;
  padding: 15px 17px;
}

.gallery-body .gallery-controls input::placeholder {
  color: rgba(180, 192, 208, 0.68);
}

.gallery-body .ghost-button,
.gallery-body .family-chip {
  border: 0;
  background: linear-gradient(180deg, rgba(27, 38, 53, 0.96), rgba(17, 24, 35, 0.96));
  color: var(--gallery-ink);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255,255,255,0.08);
}

.gallery-body .ghost-button:hover,
.gallery-body .family-chip:hover,
.gallery-body .color-card-button:hover {
  transform: translateY(-1px);
}

.gallery-body .ghost-button:focus-visible,
.gallery-body .family-chip:focus-visible,
.gallery-body .color-card-button:focus-visible,
.gallery-body .dialog-image-button:focus-visible {
  outline: 2px solid rgba(183, 119, 34, 0.6);
  outline-offset: 2px;
}

.gallery-body .family-chip.is-active,
.gallery-body .dialog-pagination .ghost-button:not(:disabled):hover,
.gallery-body .dialog-image-pagination .ghost-button:not(:disabled):hover {
  background: linear-gradient(180deg, rgba(38, 50, 67, 0.98), rgba(20, 28, 39, 0.98));
  color: #fff3dc;
  border-color: rgba(242, 165, 60, 0.55);
  box-shadow: inset 0 0 0 1px rgba(255, 191, 103, 0.18), 0 12px 30px rgba(0, 0, 0, 0.28);
}

.gallery-body .search-panel-copy,
.gallery-body .visual-filter-copy {
  gap: 8px;
}

.gallery-body .visual-filter-label,
.gallery-body .eyebrow {
  color: #ffbf67;
}

.gallery-body .color-wheel-panel {
  padding: 12px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.06), rgba(7,11,17,0.98) 72%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 18px 40px rgba(0,0,0,0.34);
}

.gallery-body .color-wheel {
  background:
    radial-gradient(circle at center, rgba(7,11,17,0.98) 0 27px, transparent 28px),
    conic-gradient(
      #ff3b30 0deg,
      #ff8f00 26deg,
      #ffd100 52deg,
      #ffe45d 76deg,
      #d9e94a 104deg,
      #1db954 120deg,
      #00b894 165deg,
      #00cfe8 190deg,
      #0984e3 220deg,
      #4b5bdc 250deg,
      #6c5ce7 280deg,
      #d63384 315deg,
      #ff3b30 360deg
    );
  box-shadow: inset 0 0 0 10px rgba(7,11,17,0.98), 0 18px 42px rgba(0,0,0,0.34);
}

.gallery-body .color-wheel-core {
  background: rgba(7,11,17,0.98);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.gallery-body .color-wheel-indicator {
  border-color: rgba(255,255,255,0.92);
  box-shadow: 0 8px 18px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(0,0,0,0.18);
}

.gallery-body .family-chips {
  margin-bottom: 22px;
  gap: 12px;
}

.gallery-body .gallery-grid {
  gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

@media (min-width: 751px) {
  .gallery-body .app-shell,
  .gallery-body.is-compact .app-shell {
    width: 100vw;
    margin: 0;
    padding-left: 25px;
    padding-right: 25px;
  }

  .gallery-body.is-compact .gallery-grid {
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    justify-content: start;
  }
}

.gallery-body.is-compact .color-card {
  opacity: 1;
  transform: none;
  animation: none;
}

.gallery-body.has-viewer-open {
  overflow: visible;
}

.gallery-body .color-dialog {
  position: relative;
  inset: auto;
  z-index: auto;
  margin: 8px 0 22px;
  background: transparent;
  backdrop-filter: none;
  overflow-anchor: none;
}

.gallery-body .viewer-shell {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 24px 24px 22px;
  border-radius: 34px;
  background: var(--gallery-panel-strong);
  box-shadow: 0 24px 80px rgba(49, 31, 8, 0.12);
  display: grid;
  grid-template-rows: auto auto minmax(0, auto);
  overflow-anchor: none;
}

.gallery-body .viewer-stage {
  display: grid;
  gap: 14px;
}

.gallery-body .dialog-gallery-view {
  grid-template-rows: minmax(0, auto) auto;
}

.gallery-body .dialog-images {
  overflow: visible;
}

.gallery-body .dialog-image-view {
  grid-template-rows: auto auto auto;
}

.gallery-body .dialog-image-stage {
  min-height: clamp(320px, 52vw, 720px);
}

.gallery-body .dialog-image-track {
  min-height: inherit;
}

.gallery-body .dialog-image-slide {
  min-height: clamp(300px, 50vw, 680px);
}

.gallery-body .dialog-expanded-caption {
  margin-top: 6px;
}

.gallery-body.is-compact .color-dialog {
  margin-bottom: 18px;
}

.gallery-body.is-compact .viewer-shell {
  border-radius: 28px;
  padding: 18px 16px 18px;
}

.gallery-body.is-compact .dialog-header {
  padding-bottom: 10px;
}

.gallery-body.is-compact .dialog-images {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gallery-body.is-compact .dialog-pagination {
  padding-top: 10px;
}

.gallery-body.is-compact .dialog-image-stage {
  min-height: clamp(260px, 46vw, 520px);
}

@media (max-width: 750px) {
  .gallery-body .color-dialog {
    margin: 8px 0 26px;
  }

  .gallery-body .viewer-shell {
    padding: 16px 14px 18px;
    border-radius: 28px;
  }

  .gallery-body .dialog-images {
    grid-template-columns: 1fr;
  }

  .gallery-body .dialog-image-stage {
    min-height: 300px;
  }

  .gallery-body .dialog-image-slide {
    min-height: 280px;
  }

  .gallery-body.is-compact .dialog-images {
    grid-template-columns: 1fr;
  }
}

.gallery-body .color-card-button {
  border: 0;
  border-radius: 28px;
  background: var(--gallery-panel-strong);
  box-shadow: var(--gallery-shadow);
  border: 1px solid var(--gallery-line);
  overflow: clip;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.gallery-body .color-card-button:hover,
.gallery-body .color-card-button:focus-visible {
  box-shadow: 0 28px 76px rgba(0, 0, 0, 0.44);
}

.gallery-body .image-frame {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.12), transparent 58%),
    linear-gradient(180deg, rgba(40, 54, 74, 0.94), rgba(18, 27, 40, 0.98));
  border-bottom: 0;
  padding: 16px;
  border-radius: 28px 28px 18px 18px;
}

.gallery-body .card-image,
.gallery-body .card-hover-image {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(241, 245, 250, 0.92), rgba(198, 209, 221, 0.86));
  filter: brightness(1.07) contrast(1.04) saturate(1.03);
}

.gallery-body .card-copy {
  padding: 18px 20px 22px;
  background: linear-gradient(180deg, rgba(12, 18, 28, 0.12), rgba(8, 13, 22, 0.48));
}

.gallery-body .card-title {
  margin-bottom: 8px;
  font: 600 1.28rem/1.02 var(--font-heading);
  color: #fbfcfe;
  -webkit-text-fill-color: #fbfcfe;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.26);
}

.gallery-body .card-description {
  color: #b7c1ce;
  -webkit-text-fill-color: #b7c1ce;
}

.gallery-body .card-family {
  color: var(--gallery-accent-strong);
  -webkit-text-fill-color: var(--gallery-accent-strong);
}

.gallery-body .color-dialog {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: transparent;
  backdrop-filter: blur(24px);
}

.gallery-body .viewer-shell {
  position: absolute;
  left: 50%;
  top: var(--viewer-top, 32px);
  transform: translateX(-50%);
  width: var(--viewer-width, min(1280px, calc(100vw - 88px)));
  height: var(--viewer-height, 760px);
  max-height: none;
  padding: 24px 24px 20px;
  border: 0;
  border-radius: 36px;
  background: var(--gallery-panel-strong);
  box-shadow: var(--gallery-shadow-strong);
  overflow: hidden;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 1px solid rgba(255,255,255,0.08);
}

.gallery-body .viewer-shell::before {
  display: none;
}

.gallery-body .dialog-header {
  align-items: start;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 0;
}

.gallery-body .dialog-header-copy {
  min-width: 0;
}

.gallery-body .dialog-header h2 {
  margin-top: 2px;
  font: 500 clamp(2rem, 3.3vw, 3.4rem)/0.96 var(--font-heading);
  letter-spacing: -0.05em;
}

.gallery-body .dialog-meta {
  margin: 10px 0 0;
  color: rgba(147, 160, 178, 0.92);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.gallery-body .dialog-header-actions {
  display: flex;
  justify-content: flex-end;
}

.gallery-body .dialog-header .ghost-button,
.gallery-body .dialog-image-toolbar .ghost-button {
  background: rgba(20, 29, 41, 0.9);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.gallery-body .dialog-description {
  margin: 0 0 18px;
  max-width: 72ch;
  max-height: none;
  overflow: visible;
}

.gallery-body .dialog-description:not(.is-empty)::after {
  display: none;
}

.gallery-body .viewer-stage {
  min-height: 0;
  padding-top: 0;
}

.gallery-body .dialog-gallery-view,
.gallery-body .dialog-image-view {
  height: 100%;
}

.gallery-body .dialog-gallery-view {
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 18px;
}

.gallery-body .dialog-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  overflow: auto;
  padding: 4px 2px 2px;
}

.gallery-body .dialog-image-card {
  display: grid;
  grid-template-rows: auto minmax(3.2em, auto);
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(28, 39, 53, 0.92);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.06);
}

.gallery-body .dialog-image-card.has-no-caption {
  grid-template-rows: auto;
}

.gallery-body .dialog-image-button {
  padding: 10px;
  border-radius: 24px;
  background: transparent;
  cursor: zoom-in;
}

.gallery-body .dialog-image {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  object-fit: cover;
  background: linear-gradient(180deg, rgba(241, 245, 250, 0.92), rgba(198, 209, 221, 0.86));
  filter: brightness(1.07) contrast(1.04) saturate(1.03);
}

.gallery-body .dialog-caption {
  padding: 0 14px 14px;
  min-height: 3.2em;
  font-size: 0.9rem;
}

.gallery-body .dialog-pagination {
  min-height: 68px;
  padding: 14px 4px 2px;
  border-top: 0;
  background: transparent;
}

.gallery-body .dialog-pagination.is-inactive {
  display: none;
}

.gallery-body .dialog-image-view {
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
}

.gallery-body .dialog-image-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.gallery-body .dialog-image-pagination {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gallery-body .dialog-image-status {
  min-width: 56px;
  font-weight: 600;
  color: var(--gallery-ink);
}

.gallery-body .dialog-image-stage {
  padding: 20px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 56%),
    linear-gradient(180deg, rgba(26, 37, 52, 0.98), rgba(9, 14, 22, 0.98));
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.08);
}

.gallery-body .dialog-image-slide {
  padding: 0 12px;
}

.gallery-body .dialog-expanded-image {
  max-width: 100%;
  max-height: 100%;
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  background: linear-gradient(180deg, rgba(241, 245, 250, 0.94), rgba(198, 209, 221, 0.88));
  filter: brightness(1.07) contrast(1.04) saturate(1.03);
}

.gallery-body .dialog-expanded-caption {
  margin: 0;
  padding: 0 8px;
  text-align: left;
  color: rgba(203, 211, 221, 0.78);
}

.gallery-body .back-to-top {
  background: linear-gradient(180deg, #f2a53c, #cd7f1c);
  color: #0b1119;
}

@media (min-width: 1280px) {
  .gallery-body .dialog-images {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) and (min-width: 751px) {
  .gallery-body .viewer-shell {
    width: var(--viewer-width, min(1120px, calc(100vw - 44px)));
    padding: 22px 20px 18px;
    border-radius: 30px;
  }

  .gallery-body .dialog-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-body .dialog-header h2 {
    font-size: clamp(1.8rem, 4.2vw, 2.8rem);
  }
}

@media (max-width: 750px) {
  .gallery-body .app-shell,
  .gallery-body.is-compact .app-shell {
    width: 100vw;
    margin: 0;
    padding: 10px 10px 34px;
  }

  .gallery-body.is-compact .hero {
    margin-bottom: 14px;
  }

  .gallery-body .hero-brand > div,
  .gallery-body .search-panel,
  .gallery-body .visual-filter {
    border-radius: 24px;
    padding: 16px;
  }

  .gallery-body .gallery-controls {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .gallery-body .family-chips {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-body.is-compact .family-chips {
    margin-bottom: 10px;
  }

  .gallery-body .gallery-grid {
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-body .color-card-button {
    border-radius: 22px;
  }

  .gallery-body .image-frame {
    aspect-ratio: 1 / 1;
    padding: 10px;
    border-radius: 22px 22px 14px 14px;
  }

  .gallery-body .card-copy {
    padding: 12px 12px 14px;
  }

  .gallery-body.is-compact .card-copy {
    padding: 10px 10px 12px;
  }

  .gallery-body.is-compact .card-title {
    font-size: 0.98rem;
  }

  .gallery-body.is-compact .card-description {
    font-size: 0.82rem;
    line-height: 1.34;
  }

  .gallery-body .viewer-shell {
    left: 50%;
    width: var(--viewer-width, calc(100vw - 12px));
    padding: 14px 12px 12px;
    border-radius: 26px;
  }

  .gallery-body .dialog-header {
    gap: 10px;
    padding-bottom: 12px;
  }

  .gallery-body .dialog-header h2 {
    font-size: 1.75rem;
  }

  .gallery-body .dialog-meta {
    margin-top: 6px;
    font-size: 0.82rem;
  }

  .gallery-body .dialog-description {
    margin-bottom: 12px;
    font-size: 0.88rem;
  }

  .gallery-body .dialog-gallery-view {
    gap: 10px;
  }

  .gallery-body .dialog-images {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gallery-body .dialog-image-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .gallery-body .dialog-image-pagination {
    justify-content: space-between;
  }

  .gallery-body .dialog-image-view {
    grid-template-rows: minmax(0, 1fr) auto auto;
    gap: 10px;
  }

  .gallery-body .dialog-image-stage {
    order: 1;
  }

  .gallery-body .dialog-image-toolbar {
    order: 2;
  }

  .gallery-body .dialog-expanded-caption {
    order: 3;
  }

  .gallery-body .dialog-image-stage {
    padding: 10px;
    border-radius: 22px;
  }

  .gallery-body .dialog-expanded-image {
    border-radius: 18px;
  }

  .gallery-body.is-compact .color-dialog.is-mobile-viewer {
    position: absolute;
    min-height: 100%;
  }
}

/* Rebuilt embedded gallery theme */
.gallery-body {
  --gallery-surface-0: rgba(255, 251, 246, 0.96);
  --gallery-surface-1: linear-gradient(180deg, rgba(250, 244, 236, 0.98), rgba(244, 236, 226, 0.98));
  --gallery-surface-2: linear-gradient(180deg, rgba(244, 236, 225, 0.98), rgba(236, 226, 213, 0.98));
  --gallery-surface-3: rgba(255, 255, 255, 0.86);
  --gallery-stage: linear-gradient(180deg, rgba(236, 229, 220, 0.98), rgba(226, 216, 201, 0.98));
  --gallery-ink: #211912;
  --gallery-muted: #6d6153;
  --gallery-soft: #8f8374;
  --gallery-accent: #b67727;
  --gallery-accent-soft: #f0c98f;
  --gallery-line: rgba(84, 61, 34, 0.12);
  --gallery-shadow: 0 18px 54px rgba(99, 69, 33, 0.12);
  --gallery-shadow-strong: 0 26px 80px rgba(86, 58, 27, 0.18);
  color: var(--gallery-ink);
}

.gallery-body .hero-brand > div {
  background:
    radial-gradient(circle at top right, rgba(255, 240, 214, 0.86), transparent 30%),
    linear-gradient(180deg, rgba(250, 244, 236, 0.98), rgba(242, 234, 224, 0.98));
  border: 1px solid var(--gallery-line);
  box-shadow: var(--gallery-shadow);
}

.gallery-body .hero h1,
.gallery-body .dialog-header h2,
.gallery-body .card-title {
  color: var(--gallery-ink);
  -webkit-text-fill-color: var(--gallery-ink);
  text-shadow: none;
}

.gallery-body .eyebrow,
.gallery-body .visual-filter-label,
.gallery-body .card-family,
.gallery-body .dialog-family {
  color: var(--gallery-accent);
  -webkit-text-fill-color: var(--gallery-accent);
}

.gallery-body .hero-copy,
.gallery-body .search-panel-note,
.gallery-body .card-description,
.gallery-body .pagination-status,
.gallery-body .dialog-description,
.gallery-body .dialog-caption,
.gallery-body .dialog-expanded-caption,
.gallery-body .dialog-meta {
  color: var(--gallery-muted);
  -webkit-text-fill-color: var(--gallery-muted);
}

.gallery-body .search-panel,
.gallery-body .visual-filter {
  background: var(--gallery-surface-1);
  border: 1px solid var(--gallery-line);
  box-shadow: var(--gallery-shadow);
}

.gallery-body .gallery-controls input {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(84, 61, 34, 0.1);
  color: var(--gallery-ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.gallery-body .gallery-controls input::placeholder {
  color: rgba(109, 97, 83, 0.68);
}

.gallery-body .ghost-button,
.gallery-body .family-chip {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244, 237, 228, 0.96));
  color: var(--gallery-ink);
  border: 1px solid rgba(84, 61, 34, 0.09);
  box-shadow: 0 8px 20px rgba(97, 71, 38, 0.08);
}

.gallery-body .ghost-button:hover,
.gallery-body .family-chip:hover,
.gallery-body .color-card-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(97, 71, 38, 0.12);
}

.gallery-body .family-chip.is-active,
.gallery-body .dialog-pagination .ghost-button:not(:disabled):hover,
.gallery-body .dialog-image-pagination .ghost-button:not(:disabled):hover {
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.98), rgba(245, 233, 214, 0.98));
  color: #7c4c11;
  border-color: rgba(182, 119, 39, 0.35);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 143, 0.55), 0 10px 24px rgba(120, 84, 39, 0.1);
}

.gallery-body .color-wheel-panel {
  padding: 14px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(255,255,255,0.8), rgba(239, 229, 216, 0.98) 72%);
  box-shadow: inset 0 0 0 1px rgba(84, 61, 34, 0.08), 0 16px 34px rgba(97, 71, 38, 0.12);
}

.gallery-body .color-wheel {
  background:
    radial-gradient(circle at center, rgba(37, 29, 23, 0.96) 0 27px, transparent 28px),
    conic-gradient(
      #ff4f3a 0deg,
      #ff9f1c 28deg,
      #ffd54a 58deg,
      #e5ef60 92deg,
      #63c85a 126deg,
      #00c2a8 170deg,
      #22c7ff 202deg,
      #3f7dff 234deg,
      #745cff 272deg,
      #cf52b9 316deg,
      #ff4f3a 360deg
    );
  box-shadow: inset 0 0 0 10px rgba(37, 29, 23, 0.96), 0 16px 40px rgba(97, 71, 38, 0.18);
}

.gallery-body .color-wheel-core {
  background: rgba(37, 29, 23, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.gallery-body .color-wheel-indicator {
  border-color: #fff8ef;
  box-shadow: 0 7px 16px rgba(90, 58, 23, 0.26), inset 0 0 0 1px rgba(0,0,0,0.14);
}

.gallery-body .color-card-button {
  background: var(--gallery-surface-0);
  border: 1px solid rgba(84, 61, 34, 0.08);
  box-shadow: var(--gallery-shadow);
}

.gallery-body .image-frame {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.78), transparent 58%),
    linear-gradient(180deg, rgba(232, 224, 214, 0.98), rgba(224, 214, 201, 0.98));
}

.gallery-body .card-image,
.gallery-body .card-hover-image,
.gallery-body .dialog-image,
.gallery-body .dialog-expanded-image {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(236, 229, 220, 0.92));
  filter: contrast(1.02) saturate(1.02);
}

.gallery-body .card-copy {
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0));
}

.gallery-body .viewer-shell {
  background: linear-gradient(180deg, rgba(250, 244, 236, 0.985), rgba(241, 232, 220, 0.985));
  border: 1px solid rgba(84, 61, 34, 0.1);
  box-shadow: var(--gallery-shadow-strong);
}

.gallery-body .dialog-header .ghost-button,
.gallery-body .dialog-image-toolbar .ghost-button {
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(243, 236, 227, 0.96));
  box-shadow: 0 8px 22px rgba(97, 71, 38, 0.08);
}

.gallery-body .dialog-image-card {
  background: rgba(247, 240, 231, 0.96);
  border: 1px solid rgba(84, 61, 34, 0.1);
}

.gallery-body .dialog-image-stage {
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.08), transparent 48%),
    linear-gradient(180deg, rgba(122, 111, 98, 0.99), rgba(92, 82, 72, 0.99));
  border: 1px solid rgba(61, 45, 27, 0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.gallery-body .dialog-expanded-image {
  background: transparent;
  box-shadow: 0 20px 44px rgba(45, 31, 18, 0.24);
  opacity: 1;
  transform: none;
}

.gallery-body .dialog-expanded-caption {
  color: var(--gallery-soft);
  -webkit-text-fill-color: var(--gallery-soft);
}

.gallery-body .back-to-top {
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245, 235, 220, 0.98));
  color: #7c4c11;
  border: 1px solid rgba(182, 119, 39, 0.22);
  box-shadow: 0 16px 34px rgba(97, 71, 38, 0.14);
}

@media (max-width: 750px) {
  .gallery-body .hero-brand > div,
  .gallery-body .search-panel,
  .gallery-body .visual-filter {
    border-radius: 24px;
  }

  .gallery-body .ghost-button,
  .gallery-body .family-chip {
    box-shadow: 0 8px 18px rgba(97, 71, 38, 0.08);
  }
}

/* Ground-up embedded gallery rewrite */
.gallery-body {
  --cb-bg: transparent;
  --cb-surface: rgba(248, 248, 247, 0.92);
  --cb-surface-strong: rgba(255, 255, 255, 0.96);
  --cb-surface-soft: rgba(239, 240, 241, 0.78);
  --cb-line: rgba(45, 48, 54, 0.12);
  --cb-line-strong: rgba(45, 48, 54, 0.2);
  --cb-ink: #1d2024;
  --cb-soft-ink: #555d66;
  --cb-muted: #8d96a1;
  --cb-accent: #5f5d5a;
  --cb-accent-soft: rgba(95, 93, 90, 0.12);
  --cb-shadow-lg: 0 26px 60px rgba(22, 26, 32, 0.11);
  --cb-shadow-md: 0 18px 36px rgba(22, 26, 32, 0.08);
  --cb-shadow-sm: 0 10px 24px rgba(22, 26, 32, 0.06);
  --cb-radius-xl: 32px;
  --cb-radius-lg: 24px;
  --cb-radius-md: 18px;
  --cb-desktop-side: 30px;
  --cb-mobile-side: 10px;
  background: transparent;
  color: var(--cb-ink);
}

.gallery-body .app-shell {
  width: 100vw;
  max-width: none;
  margin: 0;
  padding: 0;
}

.gallery-body [hidden] {
  display: none !important;
}

.gallery-body.is-loading .app-shell {
  opacity: 0.25;
}

.gallery-body .cb-shell {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: clamp(14px, 1.25vw, 20px);
  padding: clamp(14px, 1.5vw, 30px);
  background: transparent;
}

.gallery-body.is-compact .cb-shell {
  height: 2000px;
  min-height: 2000px;
  max-height: 2000px;
  overflow: hidden;
  align-content: start;
}

.gallery-body.is-compact .cb-stage {
  align-content: start;
}

.gallery-body.is-compact .cb-panel-browse {
  height: auto;
  align-self: start;
}

@media (min-width: 751px) {
  .gallery-body.is-compact .cb-chipbar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gallery-body.is-compact .cb-chipbar-actions {
    min-height: 64px;
    justify-content: flex-start;
    align-items: center;
  }

  .gallery-body.is-compact #browsePaginationDesktopSlot {
    min-height: 64px;
  }

  .gallery-body.is-compact #browsePaginationMobileSlot,
  .gallery-body.is-compact .cb-wheel-actions {
    min-height: 0;
  }
}

.gallery-body .cb-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas:
    "hero hero"
    "controls wheel"
    "chipbar chipbar"
    "meta meta";
  gap: 12px;
  align-content: start;
  align-items: start;
  min-width: 0;
}

.gallery-body .cb-hero {
  display: block;
  grid-area: hero;
  min-width: 0;
}

.gallery-body .cb-hero-main,
.gallery-body .cb-control-card,
.gallery-body .cb-panel {
  border-radius: var(--cb-radius-xl);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244, 245, 246, 0.92));
  border: 1px solid var(--cb-line);
  box-shadow: var(--cb-shadow-lg);
  min-width: 0;
}

.gallery-body .cb-hero-main {
  padding: 24px 28px 22px;
}

.gallery-body .cb-kicker,
.gallery-body .cb-control-label,
.gallery-body .cb-card-family,
.gallery-body .cb-detail-family,
.gallery-body .cb-example-index {
  margin: 0;
  color: var(--cb-accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gallery-body .cb-title,
.gallery-body .cb-detail-title,
.gallery-body .cb-card-title {
  margin: 0;
  color: var(--cb-ink);
  font-family: var(--font-heading);
  letter-spacing: -0.045em;
}

.gallery-body .cb-title {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.94;
  margin-top: 8px;
}

.gallery-body .cb-subtitle,
.gallery-body .cb-control-copy,
.gallery-body .cb-results,
.gallery-body .cb-layout,
.gallery-body .cb-card-description,
.gallery-body .cb-detail-description,
.gallery-body .cb-detail-meta,
.gallery-body .cb-example-caption,
.gallery-body .cb-image-caption,
.gallery-body .cb-pagination-status {
  margin: 0;
  color: var(--cb-soft-ink);
  line-height: 1.56;
}

.gallery-body .cb-hero-main {
  display: grid;
  gap: 10px;
}

.gallery-body .cb-controls {
  display: grid;
  grid-area: controls;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: start;
  align-self: start;
  min-width: 0;
}

.gallery-body .cb-control-card {
  display: grid;
  gap: 14px;
  padding: 18px 22px;
}

.gallery-body .cb-control-search {
  align-content: start;
}

.gallery-body .cb-control-wheel {
  grid-area: wheel;
  align-content: start;
  align-self: start;
}

.gallery-body .cb-control-head {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gallery-body .cb-search {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.gallery-body .cb-search-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #525b65;
}

.gallery-body .cb-search-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 16px;
  border: 2px solid rgba(45, 48, 54, 0.14);
  border-radius: 18px;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 14px 28px rgba(24, 28, 33, 0.08), inset 0 1px 0 rgba(255,255,255,0.75);
}

.gallery-body .cb-search-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(33, 37, 43, 0.06);
  color: #2f343a;
  font-size: 1rem;
}

.gallery-body .cb-search input {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: var(--cb-ink);
  font-size: 1rem;
  font-weight: 600;
  box-shadow: none;
}

.gallery-body .cb-search input::placeholder {
  color: #7f8994;
}

.gallery-body .cb-search-shell:focus-within {
  border-color: rgba(38, 44, 52, 0.26);
  box-shadow: 0 16px 34px rgba(24, 28, 33, 0.12), 0 0 0 4px rgba(34, 39, 46, 0.06);
}

.gallery-body .cb-wheel-stage {
  display: block;
  min-height: 128px;
  padding: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.gallery-body .cb-wheel {
  position: relative;
  display: block;
  width: 100%;
  height: 128px;
  border: 0;
  border-radius: 18px;
  padding: 0;
  cursor: crosshair;
  background:
    linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.24) 28%, rgba(255,255,255,0) 52%, rgba(0,0,0,0.16) 72%, rgba(0,0,0,1) 100%),
    linear-gradient(180deg, #ffffff 0%, #000000 100%) left / 14% 100% no-repeat,
    linear-gradient(90deg,
      #ff3f33 0%,
      #ffb648 16%,
      #f2eb5d 25%,
      #57dc66 40%,
      #2fd3cb 54%,
      #4d8cff 68%,
      #7d5cff 82%,
      #ff3f33 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.44), 0 14px 28px rgba(30, 34, 40, 0.12);
}

.gallery-body .cb-wheel-core {
  display: none;
}

.gallery-body .cb-wheel-indicator {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.94);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(20, 24, 29, 0.2);
  opacity: 0;
  pointer-events: none;
}

.gallery-body .cb-chipbar,
.gallery-body .cb-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  min-width: 0;
}

.gallery-body .cb-chipbar {
  grid-area: chipbar;
}

.gallery-body .cb-chipbar-actions,
.gallery-body .cb-wheel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-body .cb-wheel-actions {
  justify-content: space-between;
}

.gallery-body .cb-pagination-slot {
  display: flex;
  min-height: 0;
}

.gallery-body .cb-meta {
  grid-area: meta;
  padding-top: 2px;
  align-items: stretch;
  justify-content: flex-start;
}

.gallery-body .cb-results,
.gallery-body .cb-layout {
  flex: 0 1 100%;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(244, 246, 248, 0.9));
  border: 1px solid rgba(45, 48, 54, 0.08);
  box-shadow: 0 10px 24px rgba(26, 30, 35, 0.04);
}

.gallery-body .cb-chiprow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.gallery-body .cb-chip,
.gallery-body .cb-button,
.gallery-body .cb-back {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.gallery-body .cb-chip,
.gallery-body .cb-button-subtle,
.gallery-body .cb-back {
  background: rgba(255,255,255,0.82);
  color: var(--cb-ink);
  border: 1px solid rgba(45, 48, 54, 0.12);
  box-shadow: var(--cb-shadow-sm);
}

.gallery-body .cb-chip,
.gallery-body .cb-button {
  padding: 11px 16px;
}

.gallery-body .cb-chip {
  font-weight: 650;
  letter-spacing: 0.01em;
}

.gallery-body .cb-chip.is-active {
  background: rgba(232, 233, 235, 0.98);
  border-color: rgba(95, 93, 90, 0.22);
  color: #2e2d2b;
  box-shadow: inset 0 0 0 1px rgba(95, 93, 90, 0.08), 0 6px 14px rgba(40, 38, 35, 0.05);
}

.gallery-body .cb-chip:hover,
.gallery-body .cb-button:hover,
.gallery-body .cb-back:hover,
.gallery-body .cb-card-button:hover,
.gallery-body .cb-example-button:hover {
  transform: translateY(-1px);
}

.gallery-body .cb-chip:focus-visible,
.gallery-body .cb-button:focus-visible,
.gallery-body .cb-back:focus-visible,
.gallery-body .cb-card-button:focus-visible,
.gallery-body .cb-example-button:focus-visible,
.gallery-body .cb-wheel:focus-visible {
  outline: 2px solid rgba(95, 93, 90, 0.34);
  outline-offset: 3px;
}

.gallery-body .cb-search input:focus-visible {
  outline: none;
}

.gallery-body .cb-stage {
  min-height: 0;
  min-width: 0;
}

.gallery-body .cb-panel {
  min-height: 0;
  height: 100%;
  padding: 22px;
}

.gallery-body .cb-panel-browse {
  display: grid;
  grid-template-rows: auto auto;
  gap: 18px;
  align-content: start;
}

.gallery-body .cb-browse-footer {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding-top: 6px;
}

.gallery-body .cb-panel-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
}

.gallery-body .cb-grid {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(var(--cb-browse-columns, 4), minmax(0, 1fr));
  gap: 16px;
  align-content: start;
  grid-auto-rows: max-content;
}

.gallery-body .cb-card,
.gallery-body .cb-example-card {
  min-width: 0;
  align-self: start;
}

.gallery-body .cb-card {
  container-type: inline-size;
}

.gallery-body .cb-example-card {
  align-self: stretch;
  height: 100%;
}

.gallery-body .cb-card-button,
.gallery-body .cb-example-button {
  width: 100%;
  height: auto;
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243, 245, 247, 0.98));
  border: 1px solid rgba(45, 48, 54, 0.1);
  border-radius: 22px;
  box-shadow: var(--cb-shadow-md);
  color: var(--cb-ink);
  position: relative;
}

.gallery-body .cb-card-button {
  grid-template-rows: auto minmax(62px, auto);
  align-content: start;
}

.gallery-body .cb-card-media,
.gallery-body .cb-example-media,
.gallery-body .cb-detail-cover {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.94), rgba(230, 234, 239, 0.92));
}

.gallery-body .cb-card-media {
  border-radius: 20px 20px 16px 16px;
  margin: 10px 10px 0;
  aspect-ratio: 1 / 1;
}

.gallery-body .cb-card-media::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border-radius: 999px;
  border: 2px solid rgba(65, 71, 79, 0.16);
  border-top-color: rgba(65, 71, 79, 0.7);
  animation: cb-card-spin 0.8s linear infinite;
  z-index: 2;
}

.gallery-body .cb-card-media.is-loaded::after {
  display: none;
}

.gallery-body .cb-card-image,
.gallery-body .cb-card-hover,
.gallery-body .cb-example-image,
.gallery-body .cb-detail-cover-image,
.gallery-body .cb-focused-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-body .cb-card-image,
.gallery-body .cb-card-hover,
.gallery-body .cb-example-image {
  object-fit: cover;
  object-position: center center;
}

.gallery-body .cb-detail-cover-image,
.gallery-body .cb-focused-image {
  object-fit: contain;
  object-position: center center;
}

.gallery-body .cb-card-image,
.gallery-body .cb-card-hover {
  position: absolute;
  inset: 0;
}

.gallery-body .cb-card-image,
.gallery-body .cb-example-image,
.gallery-body .cb-detail-cover-image,
.gallery-body .cb-focused-image {
  transform: scale(0.985);
}

.gallery-body .cb-card-hover {
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
}

@keyframes cb-card-spin {
  to {
    transform: rotate(360deg);
  }
}

.gallery-body .cb-card-media.is-loaded .cb-card-image,
.gallery-body .cb-example-media.is-loaded .cb-example-image,
.gallery-body .cb-detail-cover-image.is-loaded,
.gallery-body .cb-focused-image.is-loaded {
  opacity: 1;
  transform: scale(1);
}

.gallery-body .cb-card-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 12px 14px 14px;
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.985), rgba(244, 246, 248, 0.985));
  border-top: 1px solid rgba(45, 48, 54, 0.08);
  position: relative;
  z-index: 2;
}

.gallery-body .cb-card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gallery-body .cb-card-title {
  font-size: 1.08rem;
  line-height: 1.02;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@container (min-width: 170px) {
  .gallery-body .cb-card-title {
    font-size: 1.1rem;
  }
}

@container (min-width: 190px) {
  .gallery-body .cb-card-title {
    font-size: 1.14rem;
  }
}

@container (min-width: 220px) {
  .gallery-body .cb-card-title {
    font-size: 1.2rem;
  }
}

@container (min-width: 250px) {
  .gallery-body .cb-card-title {
    font-size: 1.26rem;
  }
}

@container (min-width: 290px) {
  .gallery-body .cb-card-title {
    font-size: 1.34rem;
  }
}

.gallery-body .cb-pagination {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 0;
  margin: 0;
}

.gallery-body .cb-browse-pagination {
  padding: 8px 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(243,245,247,0.97));
  border: 1px solid rgba(45, 48, 54, 0.08);
  box-shadow: 0 14px 30px rgba(26, 30, 35, 0.06);
}

.gallery-body .cb-pagination-status {
  min-width: 120px;
  text-align: center;
  margin: 0;
  font-weight: 650;
  color: var(--cb-ink);
}

.gallery-body .cb-browse-hint {
  margin: 0;
  text-align: center;
  font-size: 0.94rem;
  line-height: 1.35;
  color: var(--cb-soft-ink);
}

.gallery-body .cb-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  min-height: 100%;
  padding: 40px;
  text-align: center;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244, 246, 248, 0.94));
  border: 1px dashed rgba(45, 48, 54, 0.18);
}

.gallery-body .cb-empty h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2vw, 2.2rem);
  letter-spacing: -0.03em;
}

.gallery-body .cb-empty p {
  margin: 0;
  max-width: 40ch;
  color: var(--cb-soft-ink);
}

.gallery-body .cb-detail-top {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 20px;
  align-items: start;
}

.gallery-body .cb-detail-copy {
  display: grid;
  align-content: start;
  gap: 8px;
}

.gallery-body .cb-back {
  justify-self: start;
  padding: 10px 15px;
}

.gallery-body .cb-detail-title {
  font-size: clamp(2.1rem, 3vw, 3.3rem);
  line-height: 0.95;
}

.gallery-body .cb-detail-meta {
  font-size: 1rem;
}

.gallery-body .cb-detail-description {
  max-width: 60ch;
}

.gallery-body .cb-detail-cover {
  height: clamp(148px, 12vw, 210px);
  min-height: 148px;
  padding: 12px;
  border-radius: 28px;
  border: 1px solid var(--cb-line);
  box-shadow: var(--cb-shadow-md);
}

.gallery-body .cb-detail-cover-image {
  border-radius: 18px;
}

.gallery-body .cb-detail-gallery,
.gallery-body .cb-detail-image {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto;
  gap: 12px;
}

.gallery-body .cb-example-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cb-example-columns, 3), minmax(0, 1fr));
  grid-template-rows: repeat(var(--cb-example-rows, 2), minmax(0, 1fr));
  gap: 12px;
}

.gallery-body .cb-example-button {
  height: 100%;
  grid-template-rows: minmax(0, 1fr) auto;
}

.gallery-body .cb-example-media {
  border-radius: 20px 20px 16px 16px;
  margin: 10px 10px 0;
  aspect-ratio: 5 / 4;
}

.gallery-body .cb-example-copy {
  display: grid;
  gap: 8px;
  padding: 14px 14px 16px;
}

.gallery-body .cb-example-caption {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-body .cb-detail-image {
  grid-template-rows: auto auto auto;
  align-content: start;
}

.gallery-body .cb-image-well {
  --cb-image-well-pad: 16px;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: var(--cb-image-well-pad) 0;
  overflow: hidden;
  background: transparent;
}

.gallery-body .cb-image-stage {
  width: fit-content;
  max-width: min(100%, 980px);
  max-height: 100%;
  display: grid;
  place-items: center;
  justify-self: center;
  padding: clamp(10px, 1vw, 16px);
  border-radius: 30px;
  background:
    radial-gradient(circle at top, rgba(255,255,255,0.64), rgba(255,255,255,0.08) 42%, rgba(255,255,255,0) 72%),
    linear-gradient(180deg, rgba(215, 220, 227, 0.96), rgba(175, 181, 190, 0.98));
  border: 1px solid rgba(56, 61, 68, 0.14);
  box-shadow:
    0 28px 56px rgba(20, 24, 29, 0.14),
    inset 0 1px 0 rgba(255,255,255,0.3);
}

.gallery-body .cb-focused-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 940px);
  max-height: min(44vh, 520px);
  border-radius: 20px;
  object-position: center center;
  box-shadow: 0 22px 48px rgba(22, 26, 32, 0.2);
}

.gallery-body .cb-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gallery-body .cb-image-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gallery-body .cb-image-caption {
  max-width: 72ch;
}

@media (min-width: 2200px) {
  .gallery-body .cb-panel-detail {
    gap: 12px;
  }

  .gallery-body .cb-detail-top {
    grid-template-columns: minmax(0, 1.15fr) 300px;
    gap: 14px;
    align-items: start;
  }

  .gallery-body .cb-detail-copy {
    gap: 8px;
  }

  .gallery-body .cb-detail-title {
    font-size: clamp(2rem, 2.2vw, 2.8rem);
  }

  .gallery-body .cb-detail-description {
    max-width: 44ch;
  }

  .gallery-body .cb-detail-cover {
    min-height: 160px;
    padding: 12px;
  }

  .gallery-body .cb-example-grid {
    gap: 14px;
  }

  .gallery-body .cb-panel-detail.is-image-mode .cb-detail-top {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .gallery-body .cb-panel-detail.is-image-mode .cb-detail-cover {
    min-height: 120px;
    max-height: 150px;
  }

  .gallery-body .cb-panel-detail.is-image-mode .cb-detail-description {
    max-width: 36ch;
  }

  .gallery-body .cb-panel-detail.is-image-mode .cb-image-well {
    padding: 12px;
  }

  .gallery-body .cb-image-stage {
    padding: 16px;
    border-radius: 28px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .gallery-body .cb-card-button:hover .cb-card-hover.is-loaded,
  .gallery-body .cb-card-button:focus-visible .cb-card-hover.is-loaded {
    opacity: 1;
    transform: scale(1);
  }

  .gallery-body .cb-card-button:hover .cb-card-image,
  .gallery-body .cb-card-button:focus-visible .cb-card-image {
    opacity: 0;
  }
}

@media (max-width: 999px) {
  .gallery-body .cb-detail-top {
    grid-template-columns: 1fr;
  }

  .gallery-body .cb-detail-cover {
    min-height: 180px;
  }
}

@media (max-width: 999px) and (min-width: 751px) {
  .gallery-body .cb-shell {
    padding: 18px;
  }

  .gallery-body .cb-top {
    grid-template-columns: minmax(0, 1fr) 228px;
    gap: 10px;
  }

  .gallery-body .cb-hero-main,
  .gallery-body .cb-control-card,
  .gallery-body .cb-panel {
    border-radius: 24px;
  }

  .gallery-body .cb-hero-main,
  .gallery-body .cb-control-card {
    padding: 16px 18px;
  }

  .gallery-body .cb-chipbar {
    gap: 10px;
  }

  .gallery-body .cb-chip {
    padding: 10px 14px;
    font-size: 0.88rem;
  }
}

@media (max-width: 750px) {
  .gallery-body .cb-shell {
    padding: 10px;
    gap: 10px;
  }

  .gallery-body .cb-pagination {
    min-height: 54px;
    gap: 10px;
    padding-top: 0;
  }

  .gallery-body .cb-browse-footer {
    gap: 8px;
    padding-top: 2px;
  }

  .gallery-body .cb-pagination .cb-button {
    min-width: 86px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 10px 24px rgba(30, 34, 40, 0.08);
  }

  .gallery-body .cb-pagination-status {
    min-width: 92px;
    font-size: 0.9rem;
  }

  .gallery-body .cb-browse-hint {
    font-size: 0.88rem;
  }

  .gallery-body .cb-top {
    grid-template-columns: 1fr;
    grid-template-areas:
      "controls"
      "chipbar"
      "wheel"
      "meta";
  }

  .gallery-body .cb-hero {
    display: none;
  }

  .gallery-body .cb-chipbar-actions {
    display: none;
  }

  .gallery-body .cb-meta {
    display: none;
  }

  .gallery-body .cb-wheel-actions {
    align-items: stretch;
  }

  .gallery-body .cb-wheel-actions .cb-button,
  .gallery-body .cb-wheel-actions .cb-pagination {
    flex: 1 1 0;
  }

  .gallery-body .cb-wheel-actions .cb-pagination {
    justify-content: flex-end;
  }

  .gallery-body .cb-wheel-actions .cb-pagination .cb-button {
    min-width: 72px;
  }

  .gallery-body .cb-wheel-actions .cb-pagination-status {
    min-width: 74px;
  }

  .gallery-body .cb-hero-main,
  .gallery-body .cb-control-card,
  .gallery-body .cb-panel {
    border-radius: 24px;
  }

  .gallery-body .cb-hero-main,
  .gallery-body .cb-control-card,
  .gallery-body .cb-panel {
    padding-left: 16px;
    padding-right: 16px;
  }

  .gallery-body .cb-hero-main,
  .gallery-body .cb-control-card {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .gallery-body .cb-title {
    font-size: clamp(2.2rem, 10vw, 3.4rem);
  }

  .gallery-body .cb-controls {
    gap: 0;
  }

  .gallery-body .cb-control-search {
    gap: 10px;
  }

  .gallery-body .cb-control-head {
    gap: 2px;
  }

  .gallery-body .cb-control-search .cb-control-copy,
  .gallery-body .cb-search-label {
    display: none;
  }

  .gallery-body .cb-search input {
    min-height: 46px;
    padding: 0 14px;
    border-radius: 16px;
  }

  .gallery-body .cb-chipbar {
    gap: 10px;
    align-items: stretch;
  }

  .gallery-body .cb-chiprow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    margin: 0;
    padding: 0;
  }

  .gallery-body .cb-chip {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.76rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 7px 18px rgba(22, 26, 32, 0.05);
  }

  .gallery-body .cb-wheel-stage {
    min-height: 138px;
  }

  .gallery-body .cb-wheel {
    height: 138px;
  }

  .gallery-body .cb-grid,
  .gallery-body .cb-example-grid {
    gap: 12px;
  }

  .gallery-body .cb-card-button,
  .gallery-body .cb-example-button {
    border-radius: 18px;
  }

  .gallery-body .cb-card-media,
  .gallery-body .cb-example-media {
    margin: 8px 8px 0;
    border-radius: 16px 16px 12px 12px;
  }

  .gallery-body .cb-card-media {
    aspect-ratio: 1 / 1;
  }

  .gallery-body .cb-card-copy,
  .gallery-body .cb-example-copy {
    padding: 12px;
  }

  .gallery-body .cb-card-button {
    grid-template-rows: auto minmax(84px, 1fr);
  }

  .gallery-body .cb-card-title {
    font-size: 1.15rem;
  }

  .gallery-body .cb-panel {
    padding: 14px;
  }

  .gallery-body .cb-detail-top {
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 12px;
    align-items: start;
  }

  .gallery-body .cb-detail-title {
    font-size: 2rem;
  }

  .gallery-body .cb-detail-cover {
    min-height: auto;
    padding: 10px;
    border-radius: 18px;
  }

  .gallery-body .cb-detail-cover-image {
    aspect-ratio: 1 / 1;
  }

  .gallery-body .cb-detail-gallery .cb-example-grid {
    gap: 10px;
  }

  .gallery-body .cb-detail-gallery .cb-example-button {
    grid-template-columns: 118px minmax(0, 1fr);
    grid-template-rows: 1fr;
    align-items: stretch;
  }

  .gallery-body .cb-detail-gallery .cb-example-media {
    aspect-ratio: 1 / 1;
    margin: 8px 0 8px 8px;
    border-radius: 14px;
  }

  .gallery-body .cb-detail-gallery .cb-example-copy {
    align-content: center;
    padding: 12px 12px 12px 8px;
  }

  .gallery-body .cb-detail-image {
    grid-template-rows: minmax(0, 1fr) auto auto;
  }

  .gallery-body .cb-image-well {
    --cb-image-well-pad: 14px;
    padding: 14px;
  }

  .gallery-body .cb-image-stage {
    padding: 12px;
    border-radius: 22px;
  }

  .gallery-body .cb-focused-image {
    max-height: min(56vh, 520px);
    border-radius: 16px;
  }

  .gallery-body .cb-image-toolbar,
  .gallery-body .cb-image-nav {
    justify-content: flex-start;
  }
}

@media (max-width: 599px) {
  .gallery-body .cb-card-button {
    aspect-ratio: auto;
    grid-template-rows: auto minmax(84px, 1fr);
  }

  .gallery-body .cb-card-media {
    margin: 8px 8px 0;
    border-radius: 16px 16px 12px 12px;
    height: auto;
  }

  .gallery-body .cb-card-copy {
    gap: 6px;
    padding: 12px;
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    border-top: 1px solid rgba(45, 48, 54, 0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.985), rgba(244, 246, 248, 0.985));
  }

  .gallery-body .cb-card-topline {
    gap: 8px;
  }

  .gallery-body .cb-card-family,
  .gallery-body .cb-card-title {
    color: var(--cb-ink);
    -webkit-text-fill-color: var(--cb-ink);
  }

  .gallery-body .cb-card-title {
    font-size: 1.1rem;
    line-height: 1.02;
    text-shadow: none;
  }
}

@media (max-width: 359px) {
  .gallery-body .cb-shell {
    padding: 8px;
    gap: 8px;
  }

  .gallery-body .cb-control-card,
  .gallery-body .cb-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .gallery-body .cb-control-card {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .gallery-body .cb-chiprow {
    gap: 6px;
  }

  .gallery-body .cb-chip {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 0.7rem;
  }

  .gallery-body .cb-wheel-stage {
    min-height: 116px;
  }

  .gallery-body .cb-wheel {
    height: 116px;
  }

  .gallery-body .cb-grid {
    gap: 8px;
  }

  .gallery-body .cb-card-media {
    aspect-ratio: 1 / 0.84;
  }

  .gallery-body .cb-card-copy {
    gap: 4px;
    padding: 8px;
  }

  .gallery-body .cb-card-title {
    font-size: 1rem;
  }
}

/* ─── Admin base (light) ────────────────────────────────────────────────────── */
body.admin-body {
  background: var(--bg, #f2f2f2);
  color: var(--ink, #191919);
}

/* ─── Admin dark theme ──────────────────────────────────────────────────────── */
body.admin-body.is-dark {
  --bg:           #111111;
  --panel:        #1c1c1e;
  --ink:          #f0f0f0;
  --muted:        #8a8a8a;
  --line:         #2e2e2e;
  --shadow:       0 18px 48px rgba(0, 0, 0, 0.5);
  background:     #111111;
  color:          #f0f0f0;
}
body.admin-body.is-dark .hero h1  { color: #f0f0f0; }
body.admin-body.is-dark .hero-copy { color: #8a8a8a; }
body.admin-body.is-dark .eyebrow  { color: var(--accent); }
body.admin-body.is-dark .ghost-button {
  background: #252525;
  color: #f0f0f0;
  border: 1px solid #3a3a3a;
  box-shadow: none;
}
body.admin-body.is-dark .ghost-button:hover,
body.admin-body.is-dark .ghost-button:focus-visible {
  background: #2e2e2e;
  border-color: #484848;
}
body.admin-body.is-dark .ghost-button:disabled { opacity: 0.38; }
body.admin-body.is-dark .danger-button {
  background: #3a1010;
  color: #f87171;
  border: 1px solid #5a1f1f;
  box-shadow: none;
}
body.admin-body.is-dark .panel-search {
  background: #1e1e1e;
  border-color: #3a3a3a;
  color: #f0f0f0;
}
body.admin-body.is-dark .panel-search::placeholder { color: #606060; }
body.admin-body.is-dark .admin-status {
  background: #1c1c1e;
  color: #f0f0f0;
  box-shadow: none;
  border: 1px solid #2e2e2e;
}
body.admin-body.is-dark .admin-page-link {
  background: #1c1c1e;
  border-color: #2e2e2e;
  box-shadow: none;
}
body.admin-body.is-dark .admin-page-link:hover,
body.admin-body.is-dark .admin-page-link:focus-visible {
  background: #252525;
  border-color: #3a3a3a;
  box-shadow: none;
}
body.admin-body.is-dark .admin-page-link.is-current {
  background: #1c1c1e;
  border-color: var(--accent);
}
body.admin-body.is-dark .admin-page-link span { color: #8a8a8a; }
body.admin-body.is-dark .panel {
  background: #1c1c1e;
  box-shadow: none;
  border: 1px solid #2e2e2e;
}
body.admin-body.is-dark .family-board {
  background: #1c1c1e;
  border-color: #2e2e2e;
  box-shadow: none;
}
body.admin-body.is-dark .admin-color-card {
  background: #252525;
  border-color: #333333;
  box-shadow: none;
}
body.admin-body.is-dark .admin-color-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245,154,0,0.22);
}
body.admin-body.is-dark .admin-color-card-thumb { background: #333333; }
body.admin-body.is-dark .admin-color-card-title { color: #f0f0f0; }
body.admin-body.is-dark .admin-color-card-meta  { color: #8a8a8a; }
body.admin-body.is-dark .drag-pill { background: #2e2211; color: var(--accent); }
body.admin-body.is-dark .detail-cover { background: #2a2a2a; }
body.admin-body.is-dark .empty-detail h2 { color: #f0f0f0; }
body.admin-body.is-dark .detail-actions .ghost-button,
body.admin-body.is-dark .image-manager .ghost-button,
body.admin-body.is-dark .family-board-header .ghost-button {
  background: #252525;
  border-color: #3a3a3a;
  color: #f0f0f0;
}
body.admin-body.is-dark .editor-form input,
body.admin-body.is-dark .editor-form textarea,
body.admin-body.is-dark .editor-form select {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #f0f0f0;
}
body.admin-body.is-dark .editor-form input::placeholder,
body.admin-body.is-dark .editor-form textarea::placeholder { color: #555555; }
body.admin-body.is-dark .editor-form label { color: #8a8a8a; }
body.admin-body.is-dark .gallery-controls input {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #f0f0f0;
}
body.admin-body.is-dark .advanced-panel {
  background: #181818;
  border-color: #2e2e2e;
}
body.admin-body.is-dark .cover-dropzone,
body.admin-body.is-dark .image-dropzone {
  background: #181818;
  border-color: #3a2800;
}
body.admin-body.is-dark .image-dropzone p { color: #8a8a8a; }
body.admin-body.is-dark .image-tile {
  background: #1e1e1e;
  border-color: #333333;
  box-shadow: none;
}
body.admin-body.is-dark .image-tile.is-selected,
body.admin-body.is-dark .image-tile.is-bulk-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(245,154,0,0.22);
}
body.admin-body.is-dark .image-tile-button { background: #252525; }
body.admin-body.is-dark .image-tile-select { background: rgba(30,30,30,0.92); }
body.admin-body.is-dark .image-tile-toggle span { color: #f0f0f0; }
body.admin-body.is-dark .image-tile-caption { color: #8a8a8a; }
body.admin-body.is-dark .image-inspector { border-color: #2e2e2e; }
body.admin-body.is-dark .image-inspector-preview { background: #252525; }
body.admin-body.is-dark .image-manager { border-color: #2e2e2e; }
body.admin-body.is-dark .hidden-image-grid { border-color: #2e2e2e; }
body.admin-body.is-dark .vizadmin-form input,
body.admin-body.is-dark .vizadmin-form textarea,
body.admin-body.is-dark .vizadmin-form select {
  background: #1a1a1a;
  border-color: #3a3a3a;
  color: #f0f0f0;
}
