/* ═══════════════════════════════════════════
   GENERATOR PAGE  (ruler, name-keychain)
═══════════════════════════════════════════ */

/* ── Full-page layout ── */
.gen-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: 0;
  box-sizing: border-box;
  overflow: hidden;
  background: #1a1a1a;
}

/* ── Topbar (breadcrumb + title + actions) ── */
.gen-topbar {
  flex-shrink: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: #242424;
  gap: 1rem;
}

.gen-topbar .theme-toggle { display: none; }

.gen-topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.gen-back {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: .4rem .5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color .2s, color .2s;
  flex-shrink: 0;
}
.gen-back:hover { border-color: var(--accent); color: var(--text); }

/* ── Print Tips Accordion ── */
.sb-accordion {
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sb-accord-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  gap: .5rem;
}

.sb-accord-head:hover { color: var(--accent-light); }

.accord-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform .25s ease;
}

.sb-accordion.open .accord-chevron {
  transform: rotate(180deg);
}

.sb-accord-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}

.sb-accordion.open .sb-accord-body {
  max-height: 500px;
}

.sb-tip-text {
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.55;
  padding: 0 1.5rem .85rem;
}

.sb-tip-text + .sb-tip-text { padding-top: 0; margin-top: -.25rem; }

/* ── Sidebar action footer ── */
.sb-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #242424;
  position: sticky;
  bottom: 0;
  margin-top: auto;
}

.sb-actions .sb-generate-btn {
  flex: 1;
  justify-content: center;
}

.gen-btn-icon {
  padding: .55rem .7rem;
  min-width: 40px;
  justify-content: center;
}

.gen-topbar-title {
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gen-topbar-sub {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  display: none;
}

.gen-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-shrink: 0;
}

/* ── Buttons ── */
.gen-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1rem;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .18s, transform .14s, opacity .18s;
  font-family: inherit;
  white-space: nowrap;
}
.gen-btn:disabled { opacity: .38; cursor: not-allowed; }

.gen-btn-primary {
  background: var(--accent);
  color: #fff;
}
.gen-btn-primary:not(:disabled):hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.gen-btn-ghost {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}
.gen-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(130,46,245,.06);
}

/* ── Main split ── */
.gen-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   LEFT COLUMN  — info card + sidebar stacked
═══════════════════════════════════════════ */
.gen-left {
  width: 414px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin: 0.75rem 0 0.75rem 0.75rem;
  gap: 0.75rem;
  min-height: 0;
}

/* ── Info card ── */
.gen-info-card {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #242424;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
  transition: flex-grow .25s ease, flex-basis .25s ease;
}

.gen-info-card.collapsed {
  flex: 0 0 44px;
  padding: 0.6rem 1.25rem;
}

.gen-info-card.collapsed .gi-header,
.gen-info-card.collapsed .gi-stats {
  display: none;
}

.gi-collapsed-name {
  display: none;
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 40px;
}

.gen-info-card.collapsed .gi-collapsed-name {
  display: block;
}

.gi-collapse-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.gi-collapse-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.gi-collapse-btn svg {
  transition: transform .25s ease;
}

.gen-info-card.collapsed .gi-collapse-btn svg {
  transform: rotate(180deg);
}

.gi-header {
  display: flex;
  align-items: stretch;
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
}

.gi-thumb {
  height: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: linear-gradient(135deg, #333, #2a2a2a);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  overflow: hidden;
}

.gi-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* phones: the card has no fixed height there, so "height: 100%" let the picture grow to
   its own size (about 1500 px) and push the page sideways */
@media (max-width: 900px) {
  .gi-thumb { height: 88px; width: 88px; }
  /* the sidebar's desktop width (414 px) made phone pages wider than the screen */
  .gen-left { width: auto; min-width: 0; max-width: 100%; }
  body .vp-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100% - 24px); }
}

.gi-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
  min-height: 0;
}

.gi-name {
  font-size: .95rem;
  font-weight: 800;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gi-desc {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  /* line count is set at runtime (clampInfoDesc) so the text fills the
     remaining height and only ellipsizes when it truly overflows. */
  -webkit-line-clamp: var(--desc-lines, 2);
  -webkit-box-orient: vertical;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.gi-stats {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.gi-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

.gi-stat svg { opacity: .7; }

/* ── Sidebar ── */
.gen-sidebar {
  flex: 3;
  min-height: 0;
  background: #242424;
  border-radius: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Wider, more visible scrollbar */
.gen-sidebar::-webkit-scrollbar { width: 15px; }
.gen-sidebar::-webkit-scrollbar-track {
  background: #242424;
  border-radius: 12px;
  margin: 6px 0;
}
.gen-sidebar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 6px;
  border: 3px solid #242424;
}
.gen-sidebar::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Section header inside sidebar (non-collapsible) */
.sb-section-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 1rem 1.5rem .6rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .25rem;
}
.sb-section-head:first-child { margin-top: 0; }
.sb-section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: .25rem;
}

.sb-body { padding: 0 1.5rem; }

.ctrl-note {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.45;
  margin: -.5rem 0 .85rem;
}

/* ── Controls ── */
.ctrl {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1rem;
}
.ctrl:last-child { margin-bottom: .25rem; }

.ctrl label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
}
.ctrl label .val {
  font-variant-numeric: tabular-nums;
  color: var(--accent-light);
  font-weight: 700;
}

/* Text inputs & selects */
.ctrl input[type="text"],
.ctrl input[type="number"],
.ctrl select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: .7rem 1rem;
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
  appearance: none;
}
.ctrl input:focus,
.ctrl select:focus {
  border-color: var(--accent);
}
.ctrl select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239696AE' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  background-color: var(--surface);
  padding-right: 2.5rem;
  cursor: pointer;
}
.ctrl select option { background: var(--surface); }

/* ── Range Slider ── */
.ctrl input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 100px;
  border: none;
  padding: 0;
  cursor: pointer;
  outline: none;
}
.ctrl input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2.5px solid var(--bg-deep);
  transition: transform .15s;
}
.ctrl input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.ctrl input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  border: 2.5px solid var(--bg-deep);
}
.ctrl input[type="range"]:focus::-webkit-slider-thumb {
}

/* Slider track */
.ctrl input[type="range"] {
  background: var(--border);
}

/* ── Toggle switch ── */
.ctrl-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 0;
  cursor: pointer;
  user-select: none;
  margin-bottom: .25rem;
}
.ctrl-toggle span { font-size: .95rem; color: var(--text); font-weight: 500; }

.toggle-switch {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform .2s;
}
.toggle-switch.on { background: var(--accent); }
.toggle-switch.on::after { transform: translateX(18px); }

/* ── Radio group ── */
.radio-group { display: flex; gap: .5rem; }
.radio-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .65rem 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  transition: border-color .15s, color .15s, background .15s;
  user-select: none;
}
.radio-btn input { display: none; }
.radio-btn.active,
.radio-btn:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(130,46,245,.1);
}
/* `.ctrl label` sets justify-content:space-between (for slider name+value
   rows) and outranks `.radio-btn`, which left-aligned the button labels.
   Re-center them with a more specific selector. */
.ctrl label.radio-btn { justify-content: center; }

/* ── Color picker ── */
.color-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
.color-ctrl { display: flex; flex-direction: column; gap: .35rem; }
.color-ctrl label { font-size: .77rem; font-weight: 600; color: var(--muted); }

.color-btn {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .75rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  transition: border-color .2s;
}
.color-btn:hover { border-color: var(--accent); }
.color-btn span {
  font-size: .78rem;
  color: var(--muted);
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
}
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.1);
  flex-shrink: 0;
}
input[type="color"] { opacity: 0; position: absolute; pointer-events: none; }

/* Name keychain colour palette */
.nk-palette-label { font-size: .77rem; font-weight: 600; color: var(--muted); margin-bottom: .45rem; }
.nk-palette-group { margin-bottom: .5rem; }
.nk-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.nk-color-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 2px solid rgba(255,255,255,.08);
  cursor: pointer;
  padding: 0;
  transition: transform .15s, border-color .15s;
  outline: none;
}
.nk-color-btn:hover { transform: scale(1.15); border-color: rgba(255,255,255,.4); }
.nk-color-btn.active {
  border-color: #fff;
  transform: scale(1.1);
}
.nk-print-tip {
  margin-top: .75rem;
  padding: .65rem .85rem;
  background: rgba(130,46,245,.08);
  border: 1px solid rgba(130,46,245,.2);
  border-radius: 9px;
  font-size: .79rem;
  color: var(--muted);
  line-height: 1.55;
}
.nk-info { font-size: .8rem; color: var(--muted); line-height: 1.6; }

/* Layer badges */
.layer-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.layer-badge {
  padding: .28rem .65rem;
  border-radius: 6px;
  font-size: .73rem;
  font-weight: 700;
  border: 1px solid;
  cursor: pointer;
  transition: background .15s;
  user-select: none;
}
.layer-badge.base { border-color: #5c9af5; color: #5c9af5; }
.layer-badge.base.on { background: #5c9af5; color: #fff; }
.layer-badge.top { border-color: var(--accent); color: var(--accent); }
.layer-badge.top.on { background: var(--accent); color: #fff; }

/* ═══════════════════════════════════════════
   VIEWPORT
═══════════════════════════════════════════ */
.gen-viewport {
  flex: 1;
  min-width: 0;
  position: relative;
  background: #191919;
  overflow: hidden;
}

#viewport-container { position: absolute; inset: 0; }
#viewport-container canvas { display: block; width: 100% !important; height: 100% !important; }

/* Toolbar (top-right of canvas) */
.viewport-toolbar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 10;
}
.vp-btn {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .22rem;
  cursor: pointer;
  color: rgba(255,255,255,.75);
  transition: border-color .2s, color .2s, background .2s;
  backdrop-filter: blur(6px);
}
.vp-btn-label {
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}
.vp-btn:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  background: rgba(130,46,245,.14);
}

/* zoom buttons (js/viewport-zoom.js) */
.vp-zoom .vp-zoom-sign { font-size: .8rem; letter-spacing: 0; }
/* phones: the short 3D view has no room for them, and pinch zooms anyway */
@media (max-width: 900px) { .vp-zoom { display: none; } }

.vp-btn.vp-btn-off {
  opacity: 0.38;
}

/* Loading overlay */
.gen-loading {
  position: absolute;
  inset: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  z-index: 50;
  transition: opacity .3s;
}
.gen-loading.hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 44px; height: 44px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gen-loading p { font-size: .86rem; color: var(--muted); font-weight: 500; }

/* Hint bar */
.vp-hint {
  position: absolute;
  bottom: .85rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(71,70,71,.9);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .32rem 1rem;
  font-size: .73rem;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .5s;
}

/* ═══════════════════════════════════════════
   BELOW-GENERATOR CONTENT AREA
═══════════════════════════════════════════ */

/* Info section */
.gen-info-section {
  background: var(--bg);
  border-top: 1px solid var(--glass-border);
  padding: 4rem 3rem;
}
.gen-info-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.gen-info-main h2 {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 1rem;
}
.gen-info-main p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
}
.gen-info-main strong { color: var(--text); }

/* Print tips list */
.gen-tips {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.gen-tip {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .85rem 1rem;
}
.gen-tip-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: .1rem;
}
.gen-tip-text { font-size: .84rem; color: var(--muted); line-height: 1.6; }
.gen-tip-text strong { color: var(--text); display: block; margin-bottom: .15rem; }

/* Other generators strip */
.gen-other-section {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 3.5rem 3rem;
}
.gen-other-inner { max-width: 1400px; margin: 0 auto; }
.gen-other-inner h3 {
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.gen-other-inner h3::before { content: ''; width: 20px; height: 2px; background: var(--gold); border-radius: 2px; }

.gen-other-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.gen-other-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .2s;
}
.gen-other-card:hover {
  border-color: rgba(130,46,245,.4);
  transform: translateY(-2px);
}
.gen-other-card.soon { opacity: .45; pointer-events: none; }

.gen-other-emoji { font-size: 1.8rem; flex-shrink: 0; }
.gen-other-emoji-img { width: 2.4rem; height: 2.4rem; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.gen-other-info {}
.gen-other-title { font-size: .88rem; font-weight: 800; margin-bottom: .15rem; }
.gen-other-desc { font-size: .75rem; color: var(--muted); line-height: 1.4; }
.gen-other-badge {
  display: inline-block;
  margin-top: .25rem;
  background: var(--accent);
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  padding: .15rem .5rem;
  border-radius: 100px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.gen-other-badge.soon { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }

/* FAQ on generator page */
.gen-faq-section {
  background: var(--bg);
  border-top: 1px solid var(--glass-border);
  padding: 3.5rem 3rem;
}
.gen-faq-inner { max-width: 800px; margin: 0 auto; }
.gen-faq-inner h3 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 1.25rem;
}

/* SEO prose / long-form content section */
.gen-seo-section {
  background: var(--bg-deep);
  border-top: 1px solid var(--glass-border);
  padding: 3.5rem 3rem;
}
.gen-seo-inner { max-width: 820px; margin: 0 auto; }
.gen-seo-inner h1, .gen-seo-inner h2 {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -.04em;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.gen-seo-inner h3 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 2rem 0 .65rem;
}
.gen-seo-inner p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 1rem;
  font-size: .98rem;
}
.gen-seo-inner ul {
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 1rem 1.1rem;
  font-size: .98rem;
}
.gen-seo-inner li { margin-bottom: .4rem; }
.gen-seo-inner strong { color: var(--text); font-weight: 700; }
.gen-seo-inner a { color: var(--accent-light, #a97bff); text-decoration: none; }
.gen-seo-inner a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  .gen-body { flex-direction: column; overflow: visible; }
  .gen-page { height: auto; overflow: visible; }

  .gen-sidebar {
    width: 100%;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .gen-viewport {
    height: 55vw;
    min-height: 280px;
    flex: none;
  }

  .gen-info-inner { grid-template-columns: 1fr; gap: 2rem; }
  .gen-info-section { padding: 3rem 1.5rem; }
  .gen-other-section { padding: 2.5rem 1.5rem; }
  .gen-faq-section { padding: 2.5rem 1.5rem; }
  .gen-seo-section { padding: 2.5rem 1.5rem; }
}

@media (max-width: 600px) {
  .gen-topbar { padding: 0 1rem; }
  .gen-topbar-title { font-size: .85rem; }
  .gen-btn span { display: none; }
  .gen-btn { padding: .5rem .65rem; }
}

/* ── Global scrollbar (wider) ── */
html::-webkit-scrollbar { width: 8px; }
html::-webkit-scrollbar-track { background: var(--bg-deep); }
html::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
  border: 2px solid var(--bg-deep);
}
html::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ═══════════════════════════════════════════
   KEYCAP — 3×3 character grid
═══════════════════════════════════════════ */
.kc-key-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: .5rem;
}
.kc-key-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: .4rem .3rem;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: 9px;
  transition: opacity .2s, border-color .2s;
}
.kc-key-cell.inactive {
  opacity: .35;
  border-color: var(--border);
}
.kc-key-label {
  font-size: .68rem;
  color: var(--muted);
  font-weight: 600;
}
.kc-key-input {
  width: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 1.4rem;
  line-height: 1.4;
  color: var(--text);
  outline: none;
  padding: 0;
}
.kc-key-input::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════
   CHRISTMAS — template picker
═══════════════════════════════════════════ */
.xmas-tmpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: .5rem;
}
.xmas-tmpl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: .4rem;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  color: var(--muted);
}
.xmas-tmpl:hover { border-color: var(--accent); transform: translateY(-2px); }
.xmas-tmpl.active { border-color: var(--accent); background: rgba(130,46,245,.1); color: var(--text); }
.xmas-tmpl img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border-radius: 7px;
  background: #0c0c0c;
}
.xmas-tmpl span { font-size: .72rem; font-weight: 600; }

.xmas-color-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .5rem;
}
.xmas-color-row label { font-size: .8rem; color: var(--muted); font-weight: 600; flex: 1; }

/* ═══════════════════════════════════════════
   IMAGE → STL — upload zone
═══════════════════════════════════════════ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 1.1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
}
.upload-zone:hover, .upload-zone.dragging {
  border-color: var(--accent);
  background: rgba(130,46,245,.08);
}
.upload-zone svg { color: var(--muted); margin-bottom: .4rem; }
.upload-zone-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.upload-zone-sub { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.bw-preview {
  display: block;
  margin: .7rem auto 0;
  max-width: 120px;
  max-height: 120px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background:
    linear-gradient(45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(-45deg, #2a2a2a 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2a2a2a 75%),
    linear-gradient(-45deg, transparent 75%, #2a2a2a 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0;
}
.file-name-row { font-size: .75rem; color: var(--muted); margin-top: .5rem; word-break: break-all; }

/* ═══════════════════════════════════════════
   SHADOW CUBE — three image slots
═══════════════════════════════════════════ */
.shadow-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: .5rem;
}
.shadow-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.shadow-slot .slot-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  border: 1.5px dashed var(--border);
  background: #f4f4f4 center/contain no-repeat;
  transition: border-color .15s, transform .15s;
}
.shadow-slot:hover .slot-thumb { border-color: var(--accent); transform: translateY(-2px); }
.shadow-slot.filled .slot-thumb { border-style: solid; border-color: var(--accent); }
.shadow-slot .slot-label { font-size: .7rem; font-weight: 600; color: var(--muted); }
.shadow-slot .slot-axis { font-size: .62rem; color: var(--muted2); }

/* ═══════════════════════════════════════════
   GENERATOR — LIGHT THEME OVERRIDES
   (removed — generator pages are always dark)
═══════════════════════════════════════════ */

/* ═══════════════════════════════════════════
   SECRET QR — plate A / plate B / backlit preview
═══════════════════════════════════════════ */
.sq-preview {
  position: absolute;
  left: 1rem;
  bottom: 3.2rem;
  display: flex;
  gap: .6rem;
  padding: .6rem;
  background: rgba(20,20,20,.82);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  backdrop-filter: blur(6px);
  z-index: 10;
}
.sq-preview figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.sq-preview canvas {
  width: 120px;
  height: 120px;
  image-rendering: pixelated;
  border-radius: 6px;
  display: block;
}
.sq-preview figcaption {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
}
.sq-preview .sq-plus { align-self: center; color: rgba(255,255,255,.5); font-weight: 800; margin-bottom: 1rem; }
.sq-preview .sq-result canvas { box-shadow: 0 0 18px rgba(255,220,150,.28); }
.sq-thumb {
  display: block;
  margin: .7rem auto 0;
  max-width: 110px;
  max-height: 110px;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ctrl-note.sq-warn { color: #f5a524; }
.sq-shuffle { width: 100%; justify-content: center; margin-top: .25rem; }
.sq-preview[hidden], .sq-thumb[hidden], .sq-block[hidden] { display: none; }

@media (max-width: 900px) {
  .sq-preview { left: .5rem; bottom: .5rem; gap: .35rem; padding: .4rem; }
  .sq-preview canvas { width: 72px; height: 72px; }
  .sq-preview .sq-plus { display: none; }
}

/* Secret QR — download menus (Plate A / Plate B / Both) */
.sq-dl { position: relative; }
.sq-dl-caret { transition: transform .18s; opacity: .85; }
.sq-dl.open .sq-dl-caret { transform: rotate(180deg); }
.sq-dl-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 190px;
  display: none;
  flex-direction: column;
  padding: .35rem;
  background: #242424;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  z-index: 100;
}
.sq-dl.open .sq-dl-menu { display: flex; }
.sq-dl-menu button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .1rem;
  width: 100%;
  padding: .5rem .7rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.sq-dl-menu button:hover, .sq-dl-menu button:focus-visible { background: rgba(130,46,245,.18); outline: none; }
.sq-dl-menu strong { font-size: .84rem; font-weight: 700; }
.sq-dl-menu small { font-size: .7rem; color: var(--muted); }

/* ═══════════════════════════════════════════
   DESKTOP APP PROMO (js/desktop-app.js)
═══════════════════════════════════════════ */

/* ── Thin strip under the info card ── */
.da-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .6rem .9rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245,175,46,.13), rgba(245,175,46,.05));
  border: 1px solid rgba(245,175,46,.28);
  color: var(--gold);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.da-strip:hover {
  background: linear-gradient(135deg, rgba(245,175,46,.22), rgba(245,175,46,.09));
  border-color: rgba(245,175,46,.5);
  transform: translateY(-1px);
}
.da-strip-icon { display: flex; opacity: .9; }
.da-strip-text { flex: 1; }
.da-strip-arrow { display: flex; transition: transform .2s ease; }
.da-strip:hover .da-strip-arrow { transform: translateX(3px); }

/* ── Full card above the sidebar actions ── */
.da-card {
  margin: .5rem 1.25rem 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(245,175,46,.10), rgba(245,175,46,.03));
  border: 1px solid rgba(245,175,46,.25);
}
.da-card-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-bottom: .7rem;
}
.da-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 9px;
  background: var(--gold-dim);
  color: var(--gold);
}
.da-card-titles { min-width: 0; }
.da-card-title {
  font-size: .88rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}
.da-card-sub {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: .15rem;
}
.da-card-perks {
  list-style: none;
  margin: 0 0 .85rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.da-card-perks li {
  position: relative;
  padding-left: 1.05rem;
  font-size: .78rem;
  line-height: 1.4;
  color: var(--muted);
}
.da-card-perks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .45rem;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.da-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1rem;
  border-radius: 10px;
  background: var(--gold);
  color: #1c1c1c;
  font-size: .85rem;
  font-weight: 800;
  text-decoration: none;
  transition: filter .2s ease, transform .15s ease, box-shadow .2s ease;
}
.da-card-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--glow-gold);
}
.da-card-btn svg { transition: transform .2s ease; }
.da-card-btn:hover svg { transform: translateX(3px); }
.da-card-note {
  margin-top: .5rem;
  text-align: center;
  font-size: .68rem;
  color: var(--gray);
}

@media (max-width: 1000px) {
  .da-strip { margin: 0 .75rem; }
}
