/* ================================================================
   SHADER LAB — Design System v3
   Fully dark, achromatic. All richness from the canvas.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

/* ── Tokens ── */
:root {
  --bg:           #111111;
  --surface:      #161616;
  --menu-bg:      #1a1a1a;
  --border:       #2a2a2a;
  --border-hover: #444444;
  --text-primary: #f0f0f0;
  --text-secondary: #888888;
  --text-tertiary: #666666;
  --text-label:    #aaaaaa;
  --error:        #e54545;
  --font-ui:      'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  --radius:       3px;
  --topbar-h:     36px;
  --statusbar-h:  26px;
  --left-w:       240px;
  --right-w:      240px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; overflow: hidden;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font: inherit; color: inherit; background: none; border: none; outline: none; }
select { font: inherit; }
svg { display: block; }

/* ── App Shell ── */
#app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr var(--statusbar-h);
  height: 100vh;
  width: 100vw;
}

/* Statusbar built-by link */
.statusbar-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 11px; color: #444;
}
.statusbar-link {
  color: #555; text-decoration: none;
  margin-left: 4px;
  transition: color 0.1s;
}
.statusbar-link:hover { color: #888; text-decoration: underline; }

/* ── Topbar ── */
.topbar {
  display: flex; flex-direction: column;
  background: var(--menu-bg);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}
.topbar-line {
  display: flex; align-items: center;
  padding: 0 12px;
}
.topbar-line--1 {
  height: 44px;
  border-bottom: 1px solid #222;
  gap: 8px;
}
.topbar-line--2 {
  height: 36px;
  gap: 8px;
  position: relative;
}

/* Line 1 sections */
.topbar-l1-left { display: flex; align-items: center; gap: 8px; }
.topbar-l1-right { display: flex; align-items: center; gap: 10px; }
.topbar-spacer { flex: 1; }

/* App icon */
.app-icon {
  width: 24px; height: 24px;
  border-radius: 3px;
  background: #e0e0e0;
  flex-shrink: 0;
  object-fit: cover;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}

.app-name { font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 700; letter-spacing: -0.06em; color: var(--text-primary); }
.app-beta {
  display: inline-block;
  margin-left: 6px; padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.08em; color: #888;
  background: #1e1e1e; border: 1px solid #2a2a2a;
  border-radius: 2px; line-height: 1.4;
  vertical-align: middle;
}
.app-tagline { font-size: 11px; color: #555; margin-left: 8px; }

/* Share button + Avatar + Help */
.tb-share-btn {
  font-size: 12px; color: #888;
  padding: 4px 8px; border-radius: 3px;
  transition: color 0.1s, background 0.1s, transform 0.08s;
}
.tb-share-btn:hover { color: #e0e0e0; background: #1e1e1e; }
.tb-share-btn:active { transform: scale(0.96); }
.tb-help-btn {
  font-size: 12px; color: #888;
  padding: 4px 8px; border-radius: 3px;
  display: inline-flex; align-items: center; gap: 3px;
  background: transparent; border: none; cursor: pointer;
  transition: color 0.1s, background 0.1s;
}
.tb-help-btn:hover { color: #e0e0e0; background: #1e1e1e; }
.tb-help-btn:hover .tb-caret { color: #888; }
.tb-avatar {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1px solid #333;
  color: #666; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.08s;
}
.tb-avatar::before {
  content: ''; position: absolute; inset: -6px; border-radius: 50%;
}
.tb-avatar:hover { background: #333; border-color: #444; color: #aaa; }
.tb-avatar:active { transform: scale(0.96); }

/* Line 2 filename (center) */
.topbar-l2-center {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 4px;
}
.topbar-file-save { color: #777; }
.topbar-file-save:hover { color: #e0e0e0; }
.topbar-file-wrap {
  display: inline-flex; align-items: baseline;
  font-family: var(--font-mono); font-size: 13px;
}
.topbar-file {
  color: #e0e0e0; font-family: var(--font-mono); font-size: 13px;
  cursor: pointer; border-radius: 3px; padding: 2px 0px 2px 8px;
  transition: color 0.1s, background 0.1s;
}
.topbar-file:hover { color: var(--text-primary); background: #1e1e1e; }
.topbar-file-ext {
  color: #555; font-family: var(--font-mono); font-size: 13px;
  padding: 2px 8px 2px 0; user-select: none;
}
.topbar-file-input {
  color: var(--text-primary); font-family: var(--font-mono); font-size: 13px;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px;
  padding: 1px 6px; outline: none; width: 160px; text-align: center;
}

/* Menu wrap + triggers */
.tb-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.tb-menu-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: #cccccc;
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s, transform 0.08s;
}
.tb-menu-btn:hover { color: #e0e0e0; background: #1e1e1e; }
.tb-menu-btn:active { transform: scale(0.96); }
.tb-caret { color: #555; line-height: 0.1; font-size: 28px; padding-bottom: 5px; }
.tb-menu-btn:hover .tb-caret { color: #888; }
/* Shortcut hint shown inline on a menu button (e.g. Layers ▸ N). */
.tb-btn-sc {
  font-family: var(--font-mono);
  font-size: 10px; color: #555;
  padding: 1px 4px;
  border: 1px solid #2a2a2a; border-radius: 3px;
  margin-left: 2px;
  letter-spacing: 0.02em;
}
.tb-menu-btn:hover .tb-btn-sc { color: #888; border-color: #333; }

/* Export button (filled) */
.tb-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: #0a0a0a;
  background: #e0e0e0;
  padding: 4px 10px;
  border-radius: 3px;
  transition: background 0.1s, transform 0.08s;
}
.tb-export-btn:hover { background: #ffffff; }
.tb-export-btn:active { transform: scale(0.96); }
.tb-caret--dark { color: #555; }

/* Dropdown menu */
.tb-menu {
  position: absolute; top: calc(100% + 4px); left: 0;
  min-width: 180px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 300;
}
.tb-menu--right { left: auto; right: 0; }
.tb-menu.hidden { display: none; }
.tb-menu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 16px;
  font-size: 12px; color: #bbb;
  cursor: pointer; gap: 16px;
  transition: background 0.08s, color 0.08s;
}
.tb-menu-item:hover { background: #222; color: #fff; }
.tb-menu-label { font-size: 12px; }
.tb-menu-sc {
  font-family: var(--font-mono); font-size: 11px;
  color: #555;
}
.tb-menu-soon {
  font-size: 10px; color: #555;
  background: #141414; border: 1px solid #2a2a2a;
  border-radius: 3px; padding: 1px 5px;
  letter-spacing: 0.04em;
}
.tb-menu-item--disabled { color: #444; cursor: default; pointer-events: none; }
.tb-menu-item--disabled:hover { background: transparent; color: #444; }
.tb-menu-divider { height: 1px; background: #222; margin: 4px 0; }

/* Submenu (Presets) */
.tb-menu-item--submenu { position: relative; }
.tb-submenu {
  position: absolute;
  left: calc(100% - 4px); top: -4px;
  min-width: 160px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 4px;
  padding: 4px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  z-index: 310;
}
.tb-submenu.hidden { display: none; }
.tb-menu-item--submenu:hover > .tb-submenu { display: block; }

/* Effects menu (wider, with thumbnails) */
.tb-menu--effects { width: 260px; max-height: calc(100vh - 100px); overflow-y: auto; }
.tb-menu--effects::-webkit-scrollbar { width: 6px; }
.tb-menu--effects::-webkit-scrollbar-track { background: transparent; }
.tb-menu--effects::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 3px; }
.tb-fx-section-label {
  padding: 6px 10px 4px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  color: #666; text-transform: uppercase;
}
.tb-fx-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.tb-fx-item .pop-thumb {
  width: 48px; height: 36px; display: block; border-radius: 8px;
  border: 1px solid #262626; background: #0d0d0d; flex: 0 0 48px;
}
.tb-fx-item .tb-menu-label { flex: 1; }

/* ── Help Menu / Modals ── */
.help-overlay {
  position: fixed; inset: 0; z-index: 1100;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.help-overlay.hidden { display: none; }
.help-dialog {
  background: #111111; border: 1px solid #2a2a2a;
  border-radius: 8px;
  width: 640px; max-width: 90vw; max-height: 86vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.7);
}
.help-dialog--narrow { width: 440px; }
.help-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid #1c1c1c;
}
.help-title {
  font-family: var(--font-mono); font-size: 12px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #aaa;
}
.help-close {
  position: relative;
  background: transparent; border: none; color: #666;
  font-size: 20px; cursor: pointer; line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: color 0.1s, transform 0.08s;
}
.help-close::before {
  content: ''; position: absolute; inset: -10px;
}
.help-close:hover { color: #fff; }
.help-close:active { transform: scale(0.96); }
.help-body { padding: 16px 18px; overflow-y: auto; }
.help-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
}
.help-group { margin-bottom: 18px; }
.help-group-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; color: #555;
  margin-bottom: 8px; text-transform: uppercase;
}
.help-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 12px; color: #bbb;
}
.help-row-label { color: #ccc; }
.help-row-sc {
  font-family: var(--font-mono); font-size: 11px;
  color: #888; background: #1c1c1c;
  border: 1px solid #262626; border-radius: 3px;
  padding: 2px 6px; min-width: 28px; text-align: center;
}

/* Changelog */
.changelog-entry { margin-bottom: 16px; }
.changelog-version {
  font-family: var(--font-mono); font-size: 11px;
  letter-spacing: 0.08em; color: #ccc; margin-bottom: 6px;
  text-transform: uppercase;
}
.changelog-date { color: #555; margin-left: 4px; }
.changelog-list {
  margin: 0; padding-left: 18px;
  font-size: 12px; color: #aaa; line-height: 1.6;
}
.changelog-list li { margin-bottom: 2px; text-wrap: pretty; }

/* About */
.help-about-body { padding: 24px 24px 20px; }
.about-hero {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px;
  padding: 6px 0 4px;
}
.about-icon-big {
  width: 96px; height: 96px;
  border-radius: 18px;
  image-rendering: -webkit-optimize-contrast;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.about-hero-meta {
  display: inline-flex; align-items: center; gap: 8px;
}
.about-hero-meta .app-beta { margin-left: 0; }
.about-hero-meta .about-version {
  font-family: var(--font-mono); font-size: 11px;
  color: #777; letter-spacing: 0.04em;
}

.about-divider {
  height: 1px; background: #1f1f1f;
  margin: 18px -24px;
}

.about-story p {
  font-size: 12.5px; line-height: 1.65;
  color: #bbb;
  margin-bottom: 10px;
  text-wrap: pretty;
}
.about-story p:last-child { margin-bottom: 0; }

.about-section-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.14em; color: #555;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.about-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.about-byline-text { font-size: 12px; color: #888; }
.about-x-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #999;
  background: #161616; border: 1px solid #262626;
  padding: 4px 10px; border-radius: 4px;
  text-decoration: none;
  transition: color 0.1s, background 0.1s, border-color 0.1s;
}
.about-x-link:hover { color: #fff; background: #1e1e1e; border-color: #333; }
.about-x-glyph { font-size: 13px; line-height: 1; }
.about-x-handle { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.01em; }
.about-x-arrow { font-size: 10px; color: #666; }
.about-x-link:hover .about-x-arrow { color: #bbb; }

/* Contact (used in Report-a-bug and inside About GET IN TOUCH) */
.help-contact-body { padding: 20px 22px; }
.help-lede {
  font-size: 12.5px; line-height: 1.6;
  color: #bbb;
  margin-bottom: 14px;
  text-wrap: pretty;
}
.contact-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  background: #161616;
  border: 1px solid #262626;
  border-radius: 4px;
  padding: 8px 10px 8px 12px;
}
.contact-email {
  font-family: var(--font-mono); font-size: 12.5px;
  color: #ddd; user-select: all;
  letter-spacing: 0.01em;
}
.contact-copy-btn {
  font-family: var(--font-mono); font-size: 10.5px;
  color: #888; letter-spacing: 0.08em; text-transform: uppercase;
  background: #1e1e1e; border: 1px solid #2a2a2a;
  padding: 4px 10px; border-radius: 3px;
  cursor: pointer;
  transition: color 0.1s, background 0.1s, border-color 0.1s, transform 0.08s;
}
.contact-copy-btn:hover { color: #fff; background: #262626; border-color: #333; }
.contact-copy-btn:active { transform: scale(0.96); }
.contact-copy-btn.copied { color: #7ec77e; border-color: #2a3a2a; }

/* Line 2 */
.topbar-line--2 { justify-content: space-between; }
.topbar-l2-left { display: flex; align-items: center; gap: 4px; }
.topbar-l2-right { display: flex; align-items: center; gap: 4px; }
.tb2-divider { width: 1px; height: 16px; background: #222; margin: 0 6px; }

.tb2-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: #888;
  padding: 4px 8px;
  border-radius: 3px;
  transition: color 0.1s, background 0.1s, transform 0.08s;
}
.tb2-btn:hover { color: #e0e0e0; background: #1e1e1e; }
.tb2-btn:not(:disabled):active { transform: scale(0.96); }
.tb2-btn:disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.tb2-btn--icon { padding: 4px 7px; min-width: 26px; justify-content: center; }
.tb2-btn--icon #btn-play-glyph { font-size: 10px; line-height: 1; }
.tb2-sc {
  display: inline-flex; align-items: center;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 3px; padding: 1px 5px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: #555;
}
.tb2-btn:hover .tb2-sc { color: #888; border-color: #333; }

/* Legacy aliases (still referenced elsewhere) */
.btn-shortcut,
.ctx-shortcut {
  display: inline-flex; align-items: center;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono); font-size: 11px; line-height: 1;
  color: #555; letter-spacing: 0.02em;
}
.btn-shortcut { margin-left: 6px; }

/* ── App Body ── */
.app-body {
  display: grid;
  grid-template-columns: var(--left-w) 1fr var(--right-w);
  overflow: hidden;
}

/* ── Panels Common ── */
.panel-left, .panel-right {
  background: var(--surface);
  overflow-y: auto;
  overflow-x: hidden;
}
.panel-left { border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.panel-right { border-left: 1px solid var(--border); }

/* Thin scrollbar */
.panel-left::-webkit-scrollbar,
.panel-right::-webkit-scrollbar { width: 3px; }
.panel-left::-webkit-scrollbar-thumb,
.panel-right::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

/* ── Panel Header ── */
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  height: 32px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-label {
  font-size: 9px; font-weight: 500; letter-spacing: 0.1em;
  color: var(--text-secondary); text-transform: uppercase;
}
.btn-add-layer {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 7px;
  font-family: var(--font-mono);
  font-size: 9px; font-weight: 500; letter-spacing: 0.1em;
  line-height: 1; color: var(--text-secondary); text-transform: uppercase;
  background: transparent; border: none; cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.1s, background 0.1s;
}
.btn-add-layer:hover { color: var(--text-primary); background: #252525; }
.btn-add-layer-plus { font-size: 12px; line-height: 1; letter-spacing: 0; }
.btn-add-layer-label { letter-spacing: 0.1em; }

/* ── Layer Stack ── */
.layer-stack { overflow-y: auto; min-height: 0; }

/* ── Layer Row ── */
.layer-row {
  display: flex; align-items: center;
  height: 32px; padding: 0 8px 0 4px;
  gap: 4px;
  cursor: pointer;
  border-left: 2px solid transparent;
  user-select: none;
  position: relative;
}
.layer-row:hover { background: #222222; }
.layer-row.selected { background: #282828; border-left-color: #333333; }
.layer-row.layer-hidden { opacity: 0.4; }
.layer-row.dragging { opacity: 0.4; }
.layer-row.drag-over-top { box-shadow: 0 -1px 0 #555 inset; }
.layer-row.drag-over-bottom { box-shadow: 0 1px 0 #555 inset; }

.drag-handle {
  width: 12px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: grab;
  opacity: 0; transition: opacity 0.1s; flex-shrink: 0;
}
.layer-row:hover .drag-handle { opacity: 1; }

.layer-icon {
  font-size: 10px; color: var(--text-secondary);
  flex-shrink: 0; width: 12px; text-align: center;
}
.layer-icon--effect { color: #555; }

.layer-name-text {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--text-primary);
}
.layer-name-input {
  flex: 1; background: #1a1a1a; border: 1px solid #444;
  padding: 1px 4px; border-radius: 2px; font-size: 11px;
}

.layer-vis-btn {
  position: relative;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: #777; border-radius: 2px; flex-shrink: 0;
  transition: color 0.1s;
}
.layer-vis-btn::before {
  content: ''; position: absolute; inset: -7px;
}
.layer-vis-btn:hover { color: #aaa; }
.layer-vis-btn.on { color: #aaa; }
.layer-row:not(:hover) .layer-vis-btn:not(.on) { opacity: 0; }

.layer-ctx-btn {
  position: relative;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); border-radius: 2px; flex-shrink: 0;
  opacity: 0; transition: opacity 0.1s, color 0.1s, background 0.1s;
}
.layer-ctx-btn::before {
  content: ''; position: absolute; inset: -7px;
}
.layer-row:hover .layer-ctx-btn { opacity: 1; }
.layer-ctx-btn:hover { color: var(--text-primary); background: #2a2a2a; }

/* ── Frame ("Background") row — pinned at bottom of layers panel ── */
/* Uses .layer-row styling so it visually matches a regular layer row.
   The --bg modifier italicizes the name and disables the drag affordance. */
.frame-layer-area {     flex: 1 1 auto; }
.layer-row--bg { cursor: pointer; }
.layer-row--bg .drag-handle { opacity: 0 !important; cursor: default; pointer-events: none; }
.layer-row--bg .layer-name-text { font-style: italic; }

/* ── Canvas Area ── */
.canvas-area {
  background: #111111;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; position: relative;
}
#glcanvas {
  display: block;
  max-width: 100%; max-height: 100%;
}

/* ── Right Panel Layer Header ── */
.rp-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 9px; border-bottom: 1px solid var(--border);
}
.rp-header-icon { font-size: 11px; color: var(--text-secondary); flex-shrink: 0; }
.rp-header-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-header-name {
  font-size: 11px; color: var(--text-primary); font-weight: 400;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border-radius: 2px; padding: 0 2px; margin: 0 -2px;
}
.rp-header-name:hover { background: #1e1e1e; }
.rp-header-name-input {
  font-size: 11px; color: var(--text-primary); font-family: inherit;
  background: #1a1a1a; border: 1px solid #333333; border-radius: 2px;
  padding: 0 2px; outline: none; width: 100%;
}
.rp-header-type { font-size: 9px; color: #777; font-family: var(--font-mono); }

/* ── Right Panel Tabs ── */
.rp-tabs {
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
  background: #131313;
}
.rp-tab {
  flex: 1; appearance: none; background: transparent; border: 0;
  color: var(--text-secondary); font: inherit;
  font-size: 10px; letter-spacing: 0.04em;
  padding: 9px 10px; cursor: pointer;
  border-bottom: 1px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.rp-tab:hover { color: var(--text-primary); background: #181818; }
.rp-tab--active {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}
.rp-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 14px; padding: 0 4px;
  font-size: 9px; line-height: 1; font-family: var(--font-mono);
  color: #aaa; background: #2a2a2a; border-radius: 7px;
}
.rp-tab--active .rp-tab-badge { color: #ddd; background: #383838; }

/* ── Right Panel Zones ── */
.rp-zone { border-bottom: 1px solid var(--border); padding: 12px; }
.rp-zone:last-child { border-bottom: none; }
.rp-zone-label {
  font-size: 9px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--text-secondary); text-transform: uppercase;
  margin-bottom: 10px;
  display: flex; align-items: center;
}
.rp-zone-label > :first-child { flex: 1; min-width: 0; }
.rp-zone-label--toggle { cursor: pointer; user-select: none; }
.rp-zone-label--toggle:hover { color: var(--text-primary); }
.rp-zone-chev {
  margin-left: 8px; font-size: 12px; line-height: 1;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
  display: inline-block;
}
.rp-zone-label--toggle:hover .rp-zone-chev { color: var(--text-primary); }
.rp-zone--collapsed .rp-zone-chev { transform: rotate(-90deg); }
.rp-zone--collapsed .rp-zone-label { margin-bottom: 0; }
.rp-zone--collapsed > *:not(.rp-zone-label) { display: none; }

/* ── Sliders ── */
.ctrl-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px; min-height: 20px;
}
.ctrl-row:last-child { margin-bottom: 0; }
.ctrl-label {
  color: var(--text-label); font-size: 10px;
  width: 80px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Fill-to-the-left slider: the track is a CSS gradient keyed to a
   --fill custom property (0..1) that engine.js keeps in sync with
   slider.value on input. Hover/active thumb brighten; active adds
   dd
   a subtle glow ring. */
.ctrl-slider {
  flex: 1; min-width: 0; height: 24px;
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(to right,
    #666 0%,
    #666 calc(var(--fill, 0) * 100%),
    #2e2e2e calc(var(--fill, 0) * 100%),
    #2e2e2e 100%);
  border-radius: 4px; cursor: pointer; outline: none;
  padding: 0; margin: 0;
}
.ctrl-slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 4px; background: transparent;
}
.ctrl-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 4px; height: 24px; border-radius: 2px;
  background: #f0f0f0; border: none; cursor: pointer;
  margin-top: -10px;  /* centre the 12px thumb on the 4px track */
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
.ctrl-slider:hover::-webkit-slider-thumb { background: #ffffff; }
.ctrl-slider:active::-webkit-slider-thumb,
.ctrl-slider:focus::-webkit-slider-thumb {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}

/* Firefox parity */
.ctrl-slider::-moz-range-track {
  height: 4px; border-radius: 2px; background: transparent;
}
.ctrl-slider::-moz-range-progress {
  height: 4px; border-radius: 2px; background: #666;
}
.ctrl-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #f0f0f0; border: none; cursor: pointer;
  transition: background 0.1s ease, box-shadow 0.1s ease;
}
.ctrl-slider:hover::-moz-range-thumb { background: #ffffff; }
.ctrl-slider:active::-moz-range-thumb,
.ctrl-slider:focus::-moz-range-thumb {
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.1);
}
.ctrl-value {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 30px; flex-shrink: 0; text-align: right; cursor: text;
  padding: 1px 2px; border-radius: 2px; border: 1px solid transparent;
}
.ctrl-value:hover { color: #ccc; background: #1e1e1e; }
.ctrl-value-input {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  min-width: 30px; text-align: right; flex-shrink: 0;
  background: #1a1a1a; border: 1px solid #333333; border-radius: 2px;
  padding: 1px 2px; outline: none; box-sizing: border-box;
}

/* ── Color Swatches ── */
.ctrl-color-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.ctrl-color-row:last-child { margin-bottom: 0; }
.swatch {
  width: 20px; height: 20px; border-radius: 3px;
  border: 1px solid var(--border-hover); cursor: pointer; flex-shrink: 0;
  transition: border-color 0.1s;
}
.swatch:hover { border-color: #666; }
.swatch-hex {
  font-family: var(--font-mono); font-size: 9px; color: var(--text-secondary);
  flex: 1;
}
input.swatch-hex-input {
  background: transparent; border: 1px solid transparent;
  padding: 3px 4px; border-radius: 3px;
  min-width: 0; width: 100%;
  text-transform: uppercase;
  outline: none;
}
input.swatch-hex-input:hover { border-color: var(--border); }
input.swatch-hex-input:focus {
  border-color: #555; background: #0d0d0d; color: var(--text-primary);
}
.color-input-hidden {
  position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0;
}

/* ── iro.js colour popover ── */
.iro-popover {
  position: fixed;
  z-index: 10000;
  width: 184px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.iro-popover .iro-wheel-host { display: flex; justify-content: center; }
.iro-popover-hex {
  width: 100%;
  box-sizing: border-box;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
  font: 11px "JetBrains Mono", ui-monospace, monospace;
  text-align: center;
  padding: 4px 6px;
  border-radius: 3px;
  outline: none;
}
.iro-popover-hex:focus { border-color: #555; }

/* ── Toggle ── */
.ctrl-toggle-row {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.ctrl-toggle-row:last-child { margin-bottom: 0; }
.toggle-wrap { display: flex; gap: 0; }
.toggle-opt {
  padding: 2px 8px; font-size: 10px; cursor: pointer;
  border: 1px solid var(--border); color: var(--text-secondary);
  transition-property: background, color, border-color, transform;
  transition-duration: 0.1s;
}
.toggle-opt:active { transform: scale(0.96); }
.toggle-opt:first-child { border-radius: 20px 0 0 20px; }
.toggle-opt:last-child { border-radius: 0 20px 20px 0; border-left: none; }
.toggle-opt.active { background: #333; color: var(--text-primary); border-color: #555; }
.toggle-opt:hover:not(.active) { background: #222; color: var(--text-primary); }

/* ── Blend Mode Select ── */
.blend-select {
  flex: 1; height: 22px; padding: 0 6px;
  background: #1a1a1a; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-primary); font-size: 10px; cursor: pointer;
  appearance: none;
}
.blend-select:focus { outline: none; border-color: #555; }

/* ── Frame Properties ── */
.frame-dims-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.frame-dim-label { color: var(--text-secondary); font-size: 10px; }
.frame-dim-input {
  width: 54px; height: 22px; padding: 0 4px;
  background: #1a1a1a; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 10px; color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.frame-dim-input:focus { outline: none; border-color: #555; }
.frame-px { color: var(--text-secondary); font-size: 10px; }

.frame-size-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.frame-chip {
  padding: 2px 6px; font-size: 9px; font-family: var(--font-mono);
  border: 1px solid var(--border); border-radius: 2px; color: var(--text-secondary);
  cursor: pointer;
  transition-property: background, color, border-color, transform;
  transition-duration: 0.1s;
}
.frame-chip:hover { border-color: #555; color: var(--text-primary); background: #222; }
.frame-chip:active { transform: scale(0.96); }

.frame-ar-label {
  margin-top: 10px; font-size: 9px; letter-spacing: 0.08em;
  color: var(--text-secondary); text-transform: uppercase;
}
.frame-ar-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.frame-ar-btn {
  padding: 3px 8px; font-size: 10px; font-family: var(--font-mono);
  background: #1a1a1a; border: 1px solid var(--border); border-radius: 2px;
  color: var(--text-secondary); cursor: pointer;
  transition-property: background, color, border-color, transform;
  transition-duration: 0.1s;
}
.frame-ar-btn:hover { border-color: #555; color: var(--text-primary); background: #222; }
.frame-ar-btn:active { transform: scale(0.96); }
.frame-ar-btn.active { border: 1px solid #e0e0e0; color: var(--text-primary); }

/* ── Gradient Stops List ── */
.stops-block { margin-bottom: 12px; }
.stops-preview {
  height: 14px; border-radius: 3px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.stops-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.stop-row {
  display: flex; align-items: center; gap: 6px;
  padding: 2px 0;
  user-select: none; -webkit-user-select: none;
}
.stop-row.dragging { opacity: 0.4; }
.stop-row.drag-over { outline: 1px dashed #555; outline-offset: 2px; border-radius: 3px; }
.stop-drag {
  cursor: grab; color: var(--text-secondary);
  font-size: 10px; line-height: 1;
  padding: 0 2px;
  letter-spacing: -2px;
}
.stop-drag:active { cursor: grabbing; }
.stop-sw {
  width: 28px; height: 28px; border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer; flex: none;
}
.stop-hex {
  flex: 1; min-width: 0;
  background: transparent; border: 1px solid transparent;
  color: var(--text-primary);
  font-family: var(--font-mono); font-size: 10px;
  padding: 3px 4px; border-radius: 3px; outline: none;
  text-transform: uppercase;
}
.stop-hex:hover { border-color: var(--border); }
.stop-hex:focus { border-color: #555; background: #0d0d0d; }
.stop-x {
  width: 18px; height: 18px; border-radius: 3px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.stop-x:hover:not(:disabled) { background: #2a1515; border-color: var(--error); color: var(--error); }
.stop-x:disabled { opacity: 0.3; cursor: not-allowed; }
.stops-add {
  width: 100%; height: 24px; border-radius: 3px;
  background: transparent; border: 1px dashed var(--border);
  color: var(--text-secondary); cursor: pointer;
  font-size: 10px;
}
.stops-add:hover:not(:disabled) { border-color: #555; color: var(--text-primary); }
.stops-add:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Gradient palette presets row ── */
.grad-palettes-row {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.grad-palette {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0;
  cursor: pointer;
  flex: none;
  transition: box-shadow 0.12s ease, transform 0.12s ease;
}
.grad-palette:hover {
  box-shadow: 0 0 0 1px #e0e0e0;
  transform: translateY(-1px);
}

/* ── Duotone strip ── */
.duotone-block {
  margin-bottom: 12px;
}
.duotone-strip {
  position: relative;
  width: 100%; height: 16px;
  border-radius: 3px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  overflow: hidden;
}
.duotone-hist {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  mix-blend-mode: overlay;
  display: block;
}
.duotone-swatches {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px;
}
.duotone-swatch-row {
  flex: 1; min-width: 0;
  margin-bottom: 0 !important;
}
.duotone-swatch-row--right {
  flex-direction: row-reverse;
}
.duotone-swatch-row--right .swatch-hex {
  text-align: right;
}

/* ── Toast ── */
.toast {
  position: fixed;
  left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  color: #e0e0e0;
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--font-mono); font-size: 10px;
  z-index: 2000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.toast.hidden { opacity: 0; display: none; }
.toast.visible { opacity: 1; display: block; }
.toast.toast--error { color: #e54545; border-color: #522; }

/* ── Mesh Gradient Preview + Points ── */
.mg-preview-wrap {
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 10px;
}
.mg-preview-canvas {
  width: 120px; height: 80px; border-radius: 4px;
  display: block; background: #000;
}
.mg-points-zone { margin-bottom: 8px; }
.mg-points-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.mg-points-label {
  font-size: 10px; color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: 0.5px;
}
.mg-points-count { font-size: 11px; color: #555; font-variant-numeric: tabular-nums; }
.mg-colors-list { display: flex; flex-direction: column; }
.mg-color-row { position: relative; }
.mg-color-del {
  background: transparent; border: none; color: var(--text-secondary);
  cursor: pointer; font-size: 14px; line-height: 1;
  padding: 0 4px; margin-left: 2px;
  opacity: 0; transition: opacity 0.1s, color 0.1s;
  flex-shrink: 0;
}
.mg-color-row:hover .mg-color-del { opacity: 1; }
.mg-color-del:hover { color: var(--text-primary); }
.mg-color-add {
  display: block; width: 100%;
  background: transparent; border: 1px dashed var(--border-hover);
  border-radius: var(--radius);
  color: var(--text-secondary); font-size: 10px;
  padding: 6px 8px; margin-top: 4px; cursor: pointer;
  transition-property: color, border-color, background;
  transition-duration: 0.1s;
}
.mg-color-add:hover { color: var(--text-primary); border-color: #666; }

/* ── Image Drop Zone ── */
.img-drop-zone {
  border: 1px dashed var(--border-hover); border-radius: var(--radius);
  padding: 16px 12px; text-align: center; cursor: pointer;
  color: var(--text-secondary); font-size: 10px;
  transition-property: color, border-color, background;
  transition-duration: 0.15s;
  margin-bottom: 8px;
}
.img-drop-zone:hover { border-color: #666; color: var(--text-primary); background: #1e1e1e; }
.img-drop-zone.has-image { border-style: solid; border-color: #444; }
.img-drop-zone-icon { font-size: 16px; margin-bottom: 4px; opacity: 0.5; }
.img-drop-zone--thumb {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; text-align: left;
}
.img-thumb {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: var(--radius); overflow: hidden;
  background: #0a0a0a;
  background-image: linear-gradient(45deg, #1c1c1c 25%, transparent 25%), linear-gradient(-45deg, #1c1c1c 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #1c1c1c 75%), linear-gradient(-45deg, transparent 75%, #1c1c1c 75%);
  background-size: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
  border: 1px solid #2a2a2a;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.img-thumb-name {
  font-size: 10px; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-thumb-action { font-size: 9px; color: var(--text-secondary); }

/* ── Layer Effects Zone ── */
.layer-effects-list { margin-bottom: 6px; }
.le-row {
  display: flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 4px;
  border-radius: var(--radius); cursor: pointer;
}
.le-row:hover { background: #1e1e1e; }
.le-name { flex: 1; font-size: 10px; color: var(--text-secondary); }
.btn-add-effect {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; color: var(--text-secondary); padding: 4px 0;
  transition: color 0.1s;
}
.btn-add-effect:hover { color: var(--text-primary); }

/* ── Statusbar ── */
.statusbar {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px;
  background: var(--bg); border-top: 1px solid var(--border);
  font-size: 11px; font-family: var(--font-mono); color: #333;
  grid-column: 1 / -1;
}
.statusbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.statusbar-right {
  display: flex; align-items: center; gap: 16px;
  font-size: 11px; font-family: var(--font-mono); color: #333;
}
.statusbar-right #status-fps,
.statusbar-right #status-dims { font-variant-numeric: tabular-nums; }

/* ── Preset Gallery Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
  /* backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); */
}
.modal-overlay.hidden { display: none; }
.modal {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  width: 720px;
  max-width: 90vw;
}
/* Welcome header (logo + greeting + section label) */
.welcome-header {
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 8px;
}

@keyframes greetingIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.welcome-logo {
    animation: greetingIn 0.8s ease forwards;
    width: 120px;
    height: 120px;
    border-radius: 16px;
    margin-bottom: 16px;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
        transform: scale(3);
}

.greeting {
    animation: greetingIn 0.8s ease forwards;
    text-align: center;
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.06em;
    color: var(--text-primary);
    margin-bottom: 40px;
    opacity: 0;
    text-wrap: balance;
}
.welcome-section-row {
  animation: greetingIn 1s 0.2s ease forwards;
  opacity: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 18px;
  margin-bottom: 8px;
}
.welcome-section-label {
  font-size: 11px;
  color: #ccc;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.welcome-view-all {
  background: transparent;
  border: none;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #888;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}
.welcome-view-all:hover { color: #fff; }

.preset-gallery {
  animation: greetingIn 1s 0.2s ease forwards;
  opacity: 0;
  display: grid;
  grid-template-columns: repeat(4, 148px);
  gap: 16px 24px;
  justify-content: center;
}

/* ── Preset gallery modal (all 12, no welcome chrome) ── */
.modal--gallery {
  width: 860px;
  max-width: 92vw;
}
.modal--gallery .preset-gallery {
  animation: none;
  opacity: 1;
}
.modal--gallery .preset-card { animation: none; opacity: 1; }

/* Gallery card: thumb wraps the canvas so Remix overlay can sit over
   the thumbnail only (not the label below). */
.preset-card-thumb {
  position: relative;
  width: 148px;
  height: 110px;
  border-radius: 6px;
  overflow: hidden;
}
.preset-card--gallery .preset-card-canvas {
  display: block;
}
.preset-remix-pill {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  background: rgba(255,255,255,0.95);
  color: #0b0b0b;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.45);
}
.preset-card--gallery .preset-card-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.preset-card--gallery:hover .preset-card-thumb::before { opacity: 1; }
.preset-card--gallery:hover .preset-remix-pill {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.gallery-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 14px 2px;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gallery-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: #ccc;
  text-transform: uppercase;
}
.gallery-close {
  position: relative;
  width: 28px; height: 28px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #999;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, transform 0.08s;
}
.gallery-close::before {
  content: ''; position: absolute; inset: -6px;
}
.gallery-close:hover { border-color: #e0e0e0; color: #fff; }
.gallery-close:active { transform: scale(0.96); }
.preset-card {
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
}
.preset-card-canvas {
  width: 148px; height: 110px;
  display: block; border-radius: 6px;
  border: 1px solid #222;
  transition: border-color 0.15s;
  background: #0d0d0d;
}
.preset-card:hover .preset-card-canvas { border-color: #444; }
.preset-card.selected .preset-card-canvas { border-color: #e0e0e0; }
.preset-card-label {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-secondary);
  text-align: center;
  letter-spacing: 0.04em;
}

.blank-card-canvas {
  width: 148px; height: 110px;
  background: #0d0d0d; border-radius: 6px;
  border: 1px solid #222;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s;
}
.preset-card:hover .blank-card-canvas { border-color: #444; }
.preset-card.selected .blank-card-canvas { border-color: #e0e0e0; }
.blank-card-plus {
  font-size: 20px; color: #333;
  line-height: 1;
}

/* ════════════════════════════════════════════════════════════════
   FTUX — 3-slide onboarding modal (redesign)
   ════════════════════════════════════════════════════════════════ */
.ftux-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.ftux-overlay.hidden { display: none; }

/* Skip — outside the modal, fixed top-right of the viewport */
.ftux-skip {
  position: fixed; top: 20px; right: 24px;
  background: none; border: none; padding: 0;
  font-family: var(--font-mono);
  font-size: 12px; color: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: color 0.15s ease;
  z-index: 1001;
}
.ftux-skip:hover { color: rgba(255,255,255,0.8); }

/* Fixed-size shell — never changes between slides */
.ftux-card {
  position: relative;
  width: 680px; height: 460px;
  background: #141414;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* Slides stack — fade only, never moves or resizes */
.ftux-slides {
  position: absolute; inset: 0;
  opacity: 1;
  transition: opacity 0.25s ease;
}
.ftux-slide {
  position: absolute; inset: 0;
}
.ftux-slide.hidden { display: none; }

/* ── Slide 1 — Welcome (two columns) ── */
.ftux-slide--welcome { display: flex; }
.ftux-shader {
  flex: 0 0 33.333%;
  position: relative;
  background: #0d0d0d;
  overflow: hidden;
}
.ftux-shader canvas {
  display: block;
  width: 100%; height: 100%;
}
.ftux-welcome {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 36px;
}
.ftux-logo {
  width: 64px; height: 64px;
  border-radius: 14px;
  margin-bottom: 20px;
  display: block;
  image-rendering: -webkit-optimize-contrast;
}
.ftux-brand {
  font-size: 42px; font-weight: 800;
  color: #ffffff; letter-spacing: -0.08em;
  margin: 0 0 4px;
}
.ftux-tagline {
  font-size: 14px; color: #666; letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.ftux-body {
  font-size: 15px; color: #999; line-height: 1.75;
  margin: 0;
}

/* ── Slide 2 — How it works (horizontal cards) ── */
.ftux-heading {
  font-size: 24px; font-weight: 700; color: #ffffff;
  margin: 0;
}
.ftux-slide--how .ftux-heading { padding: 36px 36px 24px; }
.ftux-cards {
    display: flex;
    gap: 12px;
    padding: 0 24px 24px;
    height: 290px;
}
.ftux-card-item {
    flex: 1;
    background: #1e1e1e;
    border-radius: 12px;
    padding: 28px 22px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 1px 0 rgba(255, 255, 255, 0.06) inset;
    justify-content: flex-end;
}

.ftux-card-icon {
    font-size: 32px;
}

.ftux-card-title {
  font-size: 14px; font-weight: 700; color: #ffffff;
}
.ftux-card-body {
  font-size: 12px; color: #777; line-height: 1.65;
}

/* ── Slide 3 — Preset gallery ── */
.ftux-slide--gallery .ftux-heading { padding: 36px 36px 20px; }
.ftux-gallery {
  animation: none; opacity: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 24px;
  justify-content: initial;
}
.ftux-gallery .preset-card {
  animation: none; opacity: 1;
  gap: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ftux-gallery .preset-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ftux-gallery .preset-card-canvas,
.ftux-gallery .blank-card-canvas {
  width: 100%; height: auto; aspect-ratio: 148 / 110;
  border: none; border-radius: 8px;
  overflow: hidden;
}
.ftux-gallery .preset-card:hover .preset-card-canvas { border: none; }
.ftux-gallery .blank-card-canvas {
  background: #161616;
  border: 1px solid #2a2a2a;
}
.ftux-gallery .preset-card:hover .blank-card-canvas { border-color: #2a2a2a; }
.ftux-gallery .blank-card-plus {
  font-size: 24px; color: #333; line-height: 1;
}
.ftux-gallery .preset-card-label {
  font-size: 11px; color: #666;
  text-align: center; margin-top: 5px;
}
.ftux-skip-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #444;
  cursor: pointer;
  padding: 12px 24px 0;
}
.ftux-skip-label input {
  accent-color: #555;
  cursor: pointer; margin: 0;
}

/* ── Navigation — fixed corners, same on every slide ── */
.ftux-dots {
  position: absolute; left: 20px; bottom: 20px;
  display: flex; align-items: center; gap: 6px;
  z-index: 2;
}
.ftux-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3a3a3a;
  transition: background 0.2s ease, width 0.2s ease, height 0.2s ease;
}
.ftux-dot.is-active {
  width: 10px; height: 10px;
  background: #ffffff;
}
.ftux-nav {
  position: absolute; right: 20px; bottom: 20px;
  display: flex; gap: 8px;
  z-index: 2;
}
.ftux-chevron {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  font-size: 16px; color: #aaa;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, opacity 0.2s ease;
}
.ftux-chevron:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.14);
}
.ftux-chevron.is-hidden {
  opacity: 0; pointer-events: none;
}
/* ── Layer Popover ── */
.layer-popover {
  position: fixed; z-index: 500;
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 6px; padding: 6px;
  width: 340px;
  max-height: calc(100vh - 80px);
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.6);
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}
.layer-popover::-webkit-scrollbar { width: 6px; }
.layer-popover::-webkit-scrollbar-track { background: transparent; }
.layer-popover::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 3px; }
.layer-popover::-webkit-scrollbar-thumb:hover { background: #404040; }
.layer-popover.hidden { display: none; }
.pop-label {
  padding: 6px 8px 4px;
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 500; letter-spacing: 0.1em;
  color: #666; text-transform: uppercase;
}
.pop-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 8px;
    font-size: 12px;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 16px;
    transition: background 0.1s;
    max-width: 64px;
}
.pop-item:hover { background: #252525; }
.pop-item--text { max-width: 400px;}
.pop-item-grid { display: flex; }
.pop-thumb {
  width: 48px; height: 36px;
  display: block; border-radius: 8px;
  /* border: 1px solid #262626; */
  background: #0d0d0d;
  /* flex: 0 0 48px; */
}

.pop-name {
    flex: 1;
    letter-spacing: 0.01em;
    text-align: center;
    font-size: 10px;
    width: 100%;
}
.pop-divider { height: 1px; background: #262626; margin: 6px 4px; }

/* ── Context Menu ── */
.ctx-menu {
  position: fixed; z-index: 600;
  background: #1e1e1e; border: 1px solid #3a3a3a;
  border-radius: var(--radius); padding: 4px 0;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ctx-menu.hidden { display: none; }
.ctx-item {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 5px 12px; font-size: 11px; color: var(--text-primary);
  cursor: pointer; transition: background 0.1s;
}
.ctx-item:hover { background: #282828; }
.ctx-item--danger { color: var(--error); }
.ctx-item--danger:hover { background: #2a1515; }
.ctx-divider { height: 1px; background: var(--border); margin: 4px 0; }
.ctx-label { flex: 1; }

/* ── Confirm Dialog ── */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.confirm-overlay.hidden { display: none; }
.confirm-dialog {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px 24px;
  min-width: 280px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.3);
}
.confirm-title { font-size: 12px; font-weight: 500; margin-bottom: 6px; }
.confirm-subtitle { font-size: 10px; color: var(--text-secondary); margin-bottom: 16px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 6px; }
.confirm-btn {
  height: 26px; padding: 0 12px; border-radius: var(--radius);
  font-size: 11px; cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.08s;
}
.confirm-btn:active { transform: scale(0.96); }
.confirm-btn--cancel {
  background: #222; border: 1px solid var(--border); color: var(--text-secondary);
}
.confirm-btn--cancel:hover { border-color: #555; color: var(--text-primary); }
.confirm-btn--ok {
  background: #333; border: 1px solid #555; color: var(--text-primary);
}
.confirm-btn--ok:hover { background: #3a3a3a; }

/* ── Shape Outline ── */
.canvas-area { position: relative; }
.shape-outline {
  position: absolute;
  border: 1px solid #00E0FF;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 3;
  transform-origin: 50% 50%;
}
.shape-outline.hidden { display: none; }
canvas#glcanvas.shape-target { cursor: grab; }
canvas#glcanvas.shape-dragging { cursor: grabbing; }

/* ── Shape Handles ── */
.sh-handle {
  position: absolute;
  width: 10px; height: 10px;
  background: #0E0E0E;
  border: 1px solid #00E0FF;
  border-radius: 2px;
  pointer-events: auto;
  z-index: 4;
  box-sizing: border-box;
}
.sh-handle[data-h="tl"] { left: -5px;  top: -5px;  cursor: nwse-resize; }
.sh-handle[data-h="tr"] { right: -5px; top: -5px;  cursor: nesw-resize; }
.sh-handle[data-h="bl"] { left: -5px;  bottom: -5px; cursor: nesw-resize; }
.sh-handle[data-h="br"] { right: -5px; bottom: -5px; cursor: nwse-resize; }
.sh-handle[data-h="tm"] { left: 50%; top: -5px; margin-left: -5px; cursor: ns-resize; }
.sh-handle[data-h="bm"] { left: 50%; bottom: -5px; margin-left: -5px; cursor: ns-resize; }
.sh-handle[data-h="lm"] { top: 50%; left: -5px; margin-top: -5px; cursor: ew-resize; }
.sh-handle[data-h="rm"] { top: 50%; right: -5px; margin-top: -5px; cursor: ew-resize; }
.sh-handle--rot {
  position: absolute;
  left: 50%; top: -26px; margin-left: -5px;
  width: 10px; height: 10px;
  background: #00E0FF;
  border: 1px solid #00E0FF;
  border-radius: 50%;
  pointer-events: auto;
  z-index: 4;
  cursor: grab;
}
.sh-handle--rot:active { cursor: grabbing; }
.sh-rot-stem {
  position: absolute;
  left: 50%; top: -16px;
  width: 1px; height: 16px;
  background: #00E0FF;
  margin-left: -0.5px;
  pointer-events: none;
  z-index: 3;
}

/* Fill mode toggle — wider buttons to fit labels */
.fill-mode-toggle .toggle-opt { min-width: 56px; }
.shape-fill { margin-top: 8px; }

/* ── Filename Dialog ── */
.name-overlay {
  position: fixed; inset: 0; z-index: 920;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.name-overlay.hidden { display: none; }
.name-dialog {
  background: #1a1a1a; border: 1px solid #2a2a2a;
  border-radius: 8px; padding: 16px;
  min-width: 320px;
}
.name-title { font-size: 11px; font-weight: 500; color: var(--text-primary); margin-bottom: 10px; letter-spacing: 0.02em; }
.name-input-row {
  display: flex; align-items: stretch; gap: 0;
  background: #0d0d0d; border: 1px solid #2a2a2a; border-radius: 3px;
  margin-bottom: 14px;
}
.name-input-row:focus-within { border-color: #444; }
.name-input {
  flex: 1; min-width: 0;
  background: transparent; border: none; outline: none;
  color: var(--text-primary); font-family: var(--font-mono); font-size: 11px;
  padding: 6px 8px;
}
.name-ext {
  display: inline-flex; align-items: center;
  padding: 0 8px; font-family: var(--font-mono); font-size: 11px;
  color: var(--text-secondary);
  border-left: 1px solid #2a2a2a;
}
.name-actions { display: flex; justify-content: flex-end; gap: 6px; }
.name-btn {
  height: 26px; padding: 0 12px; border-radius: var(--radius);
  font-size: 11px; cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s, transform 0.08s;
}
.name-btn:active { transform: scale(0.96); }
.name-btn--cancel {
  background: #222; border: 1px solid var(--border); color: var(--text-secondary);
}
.name-btn--cancel:hover { border-color: #555; color: var(--text-primary); }
.name-btn--ok {
  background: #333; border: 1px solid #555; color: var(--text-primary);
}
.name-btn--ok:hover { background: #3a3a3a; }

/* ── Per-layer Effects Zone ── */
.ae-zone-head {
  display: flex; justify-content: space-between; align-items: center;
}
.btn-add-effect {
  width: 20px; height: 18px; background: transparent; border: 1px solid #2a2a2a;
  color: var(--text-secondary); font-size: 12px; line-height: 1; cursor: pointer;
  border-radius: 3px; padding: 4px;
}
.btn-add-effect:hover { color: var(--text-primary); background: #252525; }
.ae-list { display: flex; flex-direction: column; gap: 4px; }
.ae-empty { color: var(--text-secondary); font-size: 10px; padding: 4px 0; }
.ae-row { border: 1px solid #222; border-radius: 3px; background: #161616; }
.ae-row.expanded { border-color: #333; }
.ae-head {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer; user-select: none;
}
.ae-head:hover { background: #1b1b1b; }
.ae-eye {
  position: relative;
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-primary); cursor: pointer; border-radius: 2px;
  transition: background 0.1s, color 0.1s;
}
.ae-eye::before {
  content: ''; position: absolute; inset: -8px;
}
.ae-eye:hover { background: #252525; }
.ae-eye.invisible { color: #555; }
.ae-name { flex: 1; font-size: 11px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ae-x {
  position: relative;
  width: 14px; height: 14px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: #555; cursor: pointer; border-radius: 2px;
  transition: background 0.1s, color 0.1s;
}
.ae-x::before {
  content: ''; position: absolute; inset: -8px;
}
.ae-x:hover { color: #d66; background: #2a1a1a; }
.ae-props { padding: 8px 8px 8px 8px; border-top: 1px solid #222; background: #131313; }
.ae-props .ctrl-row:last-child { margin-bottom: 0; }

/* ── Command Palette (Spotlight-style) ── */
.cmd-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh;
}
.cmd-dialog {
  width: 560px; max-width: 92vw;
  background: #151515;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.cmd-search-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid #222;
}
.cmd-search-icon { color: #555; flex-shrink: 0; }
.cmd-search-input {
  flex: 1;
  background: transparent; border: none; outline: none;
  color: #e0e0e0;
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 400;
}
.cmd-search-input::placeholder { color: #555; }
.cmd-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 6px 0;
}
.cmd-list::-webkit-scrollbar { width: 4px; }
.cmd-list::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }
.cmd-group-label {
  font-size: 10px; font-weight: 500;
  color: #555;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 10px 18px 4px;
}
.cmd-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 18px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  gap: 12px;
}
.cmd-item-label { display: flex; align-items: center; gap: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item-hint { font-size: 11px; color: #666; }
.cmd-item-sc {
  font-family: var(--font-mono); font-size: 11px;
  color: #666;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px;
  padding: 1px 6px;
}
.cmd-item.selected {
  background: #222;
  color: #fff;
}
.cmd-item.selected .cmd-item-sc { color: #bbb; border-color: #3a3a3a; }
.cmd-empty {
  padding: 24px 18px;
  text-align: center;
  color: #555;
  font-size: 13px;
}
.cmd-footer {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 18px;
  border-top: 1px solid #222;
  background: #101010;
}
.cmd-hint {
  font-size: 10px; color: #555;
  display: inline-flex; align-items: center; gap: 4px;
}
.cmd-hint kbd {
  display: inline-flex; align-items: center;
  background: #1a1a1a; border: 1px solid #2a2a2a; border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono); font-size: 10px; line-height: 1;
  color: #777;
}

/* ── Brand Panel (left-panel footer) ── */
.brand-panel {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 16px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #111;
}
.brand-howto { display: flex; flex-direction: column; gap: 8px; padding-bottom: 24px; }
.brand-howto-label { font-size: 12px; font-weight: 700; color: #fff; }
.brand-howto-thumb {
  position: relative;
  width: 100%; height: 120px;
  padding: 0; border: none; cursor: pointer;
  border-radius: 6px; overflow: hidden;
  background: #1a1a1a;
  display: block;
  transition: transform 0.15s ease;
}
.brand-howto-thumb:hover { transform: scale(1.015); }
.brand-howto-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.brand-howto-play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}

/* ── Video PIP Popup ── */
.video-popup {
  position: fixed;
  left: 16px;
  bottom: 40px;
  width: 400px; height: 249px;
  background: #0a0a0a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  overflow: hidden;
  display: flex; flex-direction: column;
  transform-origin: top left;
  will-change: transform, opacity;
}
.video-popup.hidden { display: none !important; }
.video-popup-header {
  height: 24px;
  background: #161616;
  cursor: grab;
  user-select: none;
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 4px;
  flex-shrink: 0;
}
.video-popup-header:active { cursor: grabbing; }
.video-popup-close {
  width: 20px; height: 20px;
  background: transparent; border: none; cursor: pointer;
  color: #888; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 3px;
  padding: 0;
}
.video-popup-close:hover { color: #fff; background: #2a2a2a; }
.video-popup-body {
  flex: 1; min-height: 0;
  background: #000;
  position: relative;
}
.video-popup-body iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.brand-row { display: flex; gap: 8px; align-items: center; }
.brand-icon { border-radius: 6px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-name-row { display: flex; gap: 8px; align-items: center; }
.brand-name {
  font-size: 16px; font-weight: 700; color: #fff;
  letter-spacing: -0.07em; line-height: 1;
}
.brand-beta {
  font-size: 9px; font-weight: 500; color: #ccc;
  letter-spacing: 0.04em;
  background: #1e1e1e; border: 1px solid #2a2a2a;
  padding: 1px 5px;
}
.brand-tag {
  font-size: 10px; color: #fff; opacity: 0.65;
  letter-spacing: -0.04em; line-height: 1.2;
}
.brand-links { display: flex; flex-direction: column; }
.brand-link {
  background: transparent; border: none; padding: 0; cursor: pointer;
  text-align: left;
  font-size: 12px; color: #fff; opacity: 0.75;
  letter-spacing: -0.04em; line-height: 18px;
  transition: opacity 0.15s ease;
}
.brand-link:hover { opacity: 1; }

/* ── Brand Panel Popups ── */
.frakt-popup {
  position: fixed;
  bottom: 200px;
  left: 240px;
  width: 260px;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.15s ease;
}
.frakt-popup.hidden { display: none !important; }
.popup-heading {
  font-size: 13px; font-weight: 600; color: #e0e0e0;
  margin: 0 0 8px 0;
}
.popup-body {
  font-size: 12px; color: #888; line-height: 1.6;
  margin: 0 0 16px 0;
}
.popup-link-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #111; border: 1px solid #2a2a2a;
  border-radius: 6px; padding: 8px 10px;
}
.popup-url {
  font-size: 12px; color: #aaa;
  font-family: var(--font-mono);
}
.popup-copy {
  font-size: 11px; color: #e0e0e0;
  background: #2a2a2a; border: none; border-radius: 4px;
  padding: 3px 8px; cursor: pointer;
  flex-shrink: 0;
}
.popup-copy:hover { background: #333; }
.popup-share-block {
  display: flex; flex-direction: column; gap: 10px;
  background: #111; border: 1px solid #2a2a2a;
  border-radius: 6px; padding: 10px;
}
.popup-share-msg {
  font-size: 12px; color: #aaa; line-height: 1.5;
  margin: 0; white-space: pre-line;
}
.popup-share-block .popup-copy { align-self: flex-start; }
.popup-actions { display: flex; flex-direction: column; gap: 8px; }
.popup-contact-row {
  display: flex; align-items: center; gap: 8px;
  background: #111; border: 1px solid #2a2a2a;
  border-radius: 6px; padding: 8px 10px;
}
.popup-contact-label {
  font-size: 11px; color: #555;
  width: 70px; flex-shrink: 0;
}
.popup-contact-value {
  font-size: 12px; color: #aaa;
  font-family: var(--font-mono);
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.popup-contact-link {
  font-size: 12px; color: #888; text-decoration: none;
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
.popup-contact-link:hover { color: #e0e0e0; }

/* ── Utility ── */
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }
