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

:root {
  --bg: #050507;
  --surface: #0e0e12;
  --surface2: #16161c;
  --border: #242430;
  --border-hover: #38384a;
  --text: #f0eeeb;
  --text2: #b0aeb8;
  --text3: #6a6878;
  --gold: #d4b48a;
  --gold-dim: rgba(212, 180, 138, 0.12);
  --sage: #8fd4a0;
  --sage-dim: rgba(143, 212, 160, 0.1);
  --steel: #7eaad6;
  --steel-dim: rgba(126, 170, 214, 0.1);
  --terracotta: #d4907e;
  --terra-dim: rgba(212, 144, 126, 0.1);
  --conf-high: #8fd4a0;
  --conf-med: #d4b48a;
  --conf-low: #d4907e;
  --purple: #b89ad6;
  --font-serif: "Instrument Serif", Georgia, serif;
  --font-sans: "DM Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", monospace;
  --radius: 12px;
}

html {
  font-size: 16px;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  color-scheme: inherit;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  min-height: 100dvh;
  overflow-x: hidden;
}
::selection {
  background: rgba(212, 180, 138, 0.25);
  color: var(--text);
}

/* Layout */
.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--sage),
    var(--gold),
    var(--terracotta)
  );
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 200;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 12px rgba(212, 180, 138, 0.3);
}

/* Autosave */
.autosave {
  position: fixed;
  top: 14px;
  right: 18px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text3);
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 201;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.autosave.show {
  opacity: 1;
}
.autosave .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 6px var(--sage);
}

/* === HERO === */
.hero {
  text-align: center;
  padding: 3rem 0 2.5rem;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 0.5rem;
}
.hero h1 .fw {
  color: var(--sage);
  text-shadow: 0 0 30px rgba(143, 212, 160, 0.15);
}
.hero h1 .rv {
  color: var(--terracotta);
  text-shadow: 0 0 30px rgba(212, 144, 126, 0.15);
}
.hero p {
  color: var(--text2);
  font-size: 1rem;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}
.hero .kbd-hint {
  margin-top: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text3);
}
.hero .kbd-hint kbd {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.5em;
  font-size: 0.62rem;
  color: var(--text2);
}

/* Collapsible concept */
.concept-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  padding: 1.25rem 0;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
  user-select: none;
}
.concept-toggle:hover {
  color: var(--text2);
}
.concept-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.concept-toggle.open svg {
  transform: rotate(180deg);
}
.concept-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.concept-body.open {
  max-height: 220px;
}
.concept {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  padding: 0.5rem 0 1.5rem;
}
.concept-card {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s;
}
.concept-card:hover {
  border-color: var(--border-hover);
}
.concept-card h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}
.concept-card.forward h3 {
  color: var(--sage);
}
.concept-card.reverse h3 {
  color: var(--terracotta);
}
.concept-card p {
  color: var(--text2);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* === SECTIONS === */
.section {
  margin: 2rem 0;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text3);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-label .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.section-label .dot.gold {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold-dim);
}
.section-label .dot.sage {
  background: var(--sage);
  box-shadow: 0 0 8px var(--sage-dim);
}
.section-label .dot.terracotta {
  background: var(--terracotta);
  box-shadow: 0 0 8px var(--terra-dim);
}
.section-label .dot.steel {
  background: var(--steel);
  box-shadow: 0 0 8px var(--steel-dim);
}
.section-label .count {
  margin-left: auto;
  font-size: 0.65rem;
  color: var(--text3);
}

/* === INPUTS === */
textarea,
input[type="text"] {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 1rem 1.25rem;
  resize: none;
  outline: none;
  transition:
    border-color 0.25s,
    box-shadow 0.25s;
  line-height: 1.65;
}
textarea:focus,
input[type="text"]:focus {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px var(--gold-dim),
    0 0 20px rgba(212, 180, 138, 0.06);
}
textarea::placeholder,
input::placeholder {
  color: var(--text3);
}
textarea {
  min-height: 72px;
  field-sizing: content;
}

/* === STEPS === */
.steps {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 0.6rem;
}
.step-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0;
  position: relative;
  transition:
    opacity 0.2s,
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.step-row.dragging {
  opacity: 0.35;
  transform: scale(0.96);
}
.step-row.drag-over::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 36px;
  right: 36px;
  height: 2px;
  border-radius: 1px;
}
.step-row.drag-over.forward-step::before {
  background: var(--sage);
}
.step-row.drag-over.reverse-step::before {
  background: var(--terracotta);
}
.step-row.completed {
  opacity: 0.45;
}
.step-row.completed input {
  text-decoration: line-through;
  color: var(--text3);
}

.drag-handle {
  width: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5px;
  cursor: grab;
  padding: 4px 0;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.step-row:hover .drag-handle {
  opacity: 0.6;
}
.drag-handle span {
  width: 12px;
  height: 1.5px;
  background: var(--text3);
  border-radius: 1px;
}
.drag-handle:active {
  cursor: grabbing;
}

.step-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid var(--border-hover);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-check:hover {
  border-color: var(--sage);
  background: rgba(143, 212, 160, 0.06);
}
.step-check.checked {
  border-color: var(--sage);
  background: var(--sage);
}
.step-check.checked svg {
  opacity: 1;
}
.step-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.15s;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text3);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
}
.step-row input {
  flex: 1;
  padding: 0.65rem 1rem;
  font-size: 0.92rem;
  border-radius: 10px;
}

/* Confidence bars */
.conf-bar {
  width: 5px;
  height: 28px;
  border-radius: 3px;
  flex-shrink: 0;
  transition:
    background 0.3s,
    box-shadow 0.3s;
  cursor: pointer;
  position: relative;
}
.conf-bar.high {
  background: var(--conf-high);
  box-shadow: 0 0 8px rgba(143, 212, 160, 0.3);
}
.conf-bar.med {
  background: var(--conf-med);
  box-shadow: 0 0 8px rgba(212, 180, 138, 0.3);
}
.conf-bar.low {
  background: var(--conf-low);
  box-shadow: 0 0 8px rgba(212, 144, 126, 0.3);
}
.conf-bar.none {
  background: var(--border);
}
.conf-bar::after {
  content: attr(data-label);
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--text2);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.conf-bar:hover::after {
  opacity: 1;
}

.step-row .remove-btn {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
}
.step-row:hover .remove-btn {
  opacity: 0.6;
}
.step-row .remove-btn:hover {
  opacity: 1;
  border-color: var(--border);
  color: var(--terracotta);
}

.add-step {
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 0.6rem 1rem;
  background: transparent;
  color: var(--text3);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.5rem;
}
.add-step:hover {
  border-color: var(--text3);
  color: var(--text2);
  background: var(--surface);
}

/* === AI BUTTON === */
.ai-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin: 2rem 0;
}
.ai-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--gold);
  background: linear-gradient(135deg, var(--gold-dim), transparent);
  color: var(--gold);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}
.ai-btn:hover {
  background: var(--gold-dim);
  box-shadow:
    0 0 30px rgba(212, 180, 138, 0.15),
    0 0 60px rgba(212, 180, 138, 0.05);
}
.ai-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ai-btn svg {
  width: 18px;
  height: 18px;
}
.ai-btn .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: none;
}
.ai-btn.loading .spinner {
  display: block;
}
.ai-btn.loading svg:not(.spinner) {
  display: none;
}
.ai-hint {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.5;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === CANVAS VIS === */
.vis-container {
  position: relative;
  margin: 2rem 0;
  height: 180px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  overflow: hidden;
}
.vis-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.vis-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  pointer-events: none;
  font-weight: 500;
}
.vis-label.left {
  top: 14px;
  left: 18px;
  color: var(--sage);
}
.vis-label.right {
  top: 14px;
  right: 18px;
  color: var(--terracotta);
}
.vis-label.center {
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold);
}
.vis-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(212, 180, 138, 0.4);
}
.vis-pulse::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  animation: pulse-ring 2s ease-out infinite;
}
@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  100% {
    transform: scale(3.5);
    opacity: 0;
  }
}

/* Confidence legend */
.conf-legend {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin: 0.75rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text3);
}
.conf-legend span {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.conf-legend .bar {
  width: 4px;
  height: 14px;
  border-radius: 2px;
}
.conf-legend .bar.h {
  background: var(--conf-high);
}
.conf-legend .bar.m {
  background: var(--conf-med);
}
.conf-legend .bar.l {
  background: var(--conf-low);
}

/* === CONVERGENCE === */
.convergence {
  margin: 2.5rem 0;
  padding: 2rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(
    135deg,
    rgba(143, 212, 160, 0.04),
    rgba(212, 144, 126, 0.04)
  );
  border: 1px solid var(--border);
  position: relative;
}
.convergence::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 2rem;
  right: 2rem;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--sage),
    var(--gold),
    var(--terracotta)
  );
  opacity: 0.25;
  border-radius: 1px;
}
.convergence h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.convergence .sub {
  text-align: center;
  color: var(--text2);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

/* === INSIGHTS === */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.insight-card {
  padding: 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.25s;
}
.insight-card:focus-within {
  border-color: var(--steel);
}
.insight-card h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text3);
  margin-bottom: 0.5rem;
}

/* === BUTTONS === */
.actions {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  margin: 2.5rem 0 1.5rem;
  flex-wrap: wrap;
}
.btn {
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  border: 1px solid var(--border);
}
.btn:active {
  transform: scale(0.96);
}
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.saved-item:focus-visible,
.template-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--gold);
  color: var(--bg);
  border-color: var(--gold);
  font-weight: 600;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(212, 180, 138, 0.2);
}
.btn-secondary {
  background: transparent;
  color: var(--text2);
}
.btn-secondary:hover {
  border-color: var(--text3);
  color: var(--text);
}
.btn-ghost {
  background: transparent;
  color: var(--text3);
  border: none;
  font-size: 0.78rem;
  opacity: 0.6;
}
.btn-ghost:hover {
  color: var(--terracotta);
  opacity: 1;
}
.btn-publish {
  background: transparent;
  color: var(--gold);
  border-color: rgba(212, 180, 138, 0.3);
}
.btn-publish:hover {
  background: var(--gold-dim);
  border-color: var(--gold);
  box-shadow: 0 0 20px var(--gold-dim);
}
.btn-share-results {
  background: transparent;
  color: var(--steel);
  border-color: rgba(126, 170, 214, 0.3);
}
.btn-share-results:hover {
  background: var(--steel-dim);
  border-color: var(--steel);
  box-shadow: 0 0 20px var(--steel-dim);
}
.btn-export-img {
  background: transparent;
  color: var(--text3);
  border-color: var(--border);
  opacity: 0.7;
}
.btn-export-img:hover {
  border-color: var(--sage);
  color: var(--sage);
  opacity: 1;
}

/* === SHARE MODAL === */
.share-preview {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}
.share-preview canvas {
  width: 100%;
  display: block;
}
.share-text-preview {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text2);
  line-height: 1.6;
  margin-bottom: 1.25rem;
  white-space: pre-wrap;
}
.share-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.share-plat {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.share-plat:hover {
  border-color: var(--border-hover);
  background: var(--surface2);
  transform: translateY(-1px);
}
.share-plat svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.share-plat .plat-name {
  font-weight: 600;
}

/* === PUBLISHED VIEW === */
.published-banner {
  display: none;
  text-align: center;
  padding: 1.25rem;
  margin: -0.5rem 0 2rem;
  border-radius: var(--radius);
  background: var(--gold-dim);
  border: 1px solid rgba(212, 180, 138, 0.2);
  font-size: 0.88rem;
  color: var(--gold);
}
.published-banner a {
  color: var(--text);
  text-decoration: underline;
  margin-left: 0.5rem;
  font-weight: 500;
}
body.published .published-banner {
  display: block;
}
body.published textarea,
body.published input[type="text"] {
  pointer-events: none;
  opacity: 0.9;
  border-color: transparent;
}
body.published .add-step,
body.published .remove-btn,
body.published .drag-handle,
body.published .step-check,
body.published .conf-bar,
body.published .ai-row,
body.published .actions,
body.published .tabs,
body.published .tab-content,
body.published .concept-toggle,
body.published footer {
  display: none;
}
body.published .hero {
  padding-bottom: 1.5rem;
}
body.published .hero::after {
  display: none;
}

/* === TABS === */
.tabs {
  display: flex;
  gap: 0;
  margin: 3rem 0 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  padding: 0.7rem 1.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab.active {
  color: var(--text);
  border-bottom-color: var(--gold);
}
.tab:hover:not(.active) {
  color: var(--text2);
}
.tab-content {
  display: none;
  padding-top: 1.25rem;
}
.tab-content.active {
  display: block;
}

/* === SAVED SESSIONS === */
.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.saved-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  gap: 0.75rem;
}
.saved-item:hover {
  border-color: var(--border-hover);
  background: var(--surface2);
  transform: translateY(-1px);
}
.saved-item .meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.saved-item .title {
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.saved-item .date {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text3);
}
.saved-item .step-count {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text3);
  flex-shrink: 0;
}
.saved-item .delete {
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 0.9rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.saved-item:hover .delete {
  opacity: 1;
}
.saved-item .delete:hover {
  color: var(--terracotta);
}
.empty-state {
  color: var(--text3);
  font-size: 0.85rem;
  text-align: center;
  padding: 2rem;
}

/* === TEMPLATES === */
.template-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.template-card {
  padding: 1.2rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.25s;
}
.template-card:hover {
  border-color: var(--gold);
  background: var(--surface2);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.template-card h4 {
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.3rem;
  font-weight: 600;
}
.template-card p {
  font-size: 0.78rem;
  color: var(--text3);
  line-height: 1.5;
}

/* === MODALS === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  backdrop-filter: blur(6px);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.active .modal {
  transform: none;
}
.modal h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text);
}
.modal pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text2);
  white-space: pre-wrap;
  line-height: 1.65;
}
.modal .actions {
  margin: 1.5rem 0 0;
}
.og-preview {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
}
.og-preview canvas {
  width: 100%;
  display: block;
}

/* === TOAST === */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 1.4rem;
  font-size: 0.85rem;
  color: var(--text);
  z-index: 300;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text3);
  font-size: 0.68rem;
  font-family: var(--font-mono);
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}
.ai-shimmer {
  animation: shimmer 1.5s ease infinite;
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--surface2) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .concept,
  .insight-grid,
  .template-grid,
  .share-platforms {
    grid-template-columns: 1fr;
  }
  .app {
    padding: 1.5rem 1.25rem 4rem;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero p {
    font-size: 0.9rem;
  }
  .vis-container {
    height: 140px;
  }
  .drag-handle,
  .step-row .remove-btn {
    opacity: 0.5;
  }
  .ai-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions {
    gap: 0.5rem;
  }
  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
}

/* Export dropdown */
.export-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  z-index: 100;
  min-width: 150px;
}
.export-menu.show {
  display: block;
}
.export-menu button {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: transparent;
  border: none;
  color: var(--text2);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.export-menu button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}
