/* ── Variables ───────────────────────────────────── */
:root {
  --bg:          #0a0a0f;
  --bg2:         #0e0e16;
  --surface:     #13131d;
  --surface2:    #1a1a28;
  --border:      #1e1e2e;
  --border2:     #2a2a3e;
  --text:        #e2e2f0;
  --muted:       #7070a0;
  --muted2:      #50508a;
  --accent:      #6366f1;
  --accent-h:    #818cf8;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --ok:          #4ade80;
  --err:         #f87171;
  --font-mono:   'JetBrains Mono', ui-monospace, monospace;
  --pane-split:  50%;
}

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

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Editor layout ───────────────────────────────── */
.editor-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Editor nav / topbar ─────────────────────────── */
.editor-nav {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 50px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 12px;
}

.editor-nav-left  { display: flex; align-items: center; gap: 10px; }
.editor-nav-right { display: flex; align-items: center; gap: 6px; }

.nav-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav-sep {
  width: 1px;
  height: 20px;
  background: var(--border2);
  flex-shrink: 0;
}
.nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  margin: 0 2px;
}

.theme-cluster {
  display: flex;
  align-items: center;
  gap: 2px;
}

.theme-select {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  height: 30px;
  padding: 0 22px 0 8px;
  border-radius: 7px;
  cursor: pointer;
  outline: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='%237070a0' stroke-width='1.4'><path d='m2 4 3 3 3-3'/></svg>");
  background-repeat: no-repeat;
  background-position: right 6px center;
  transition: background-color 0.1s, border-color 0.1s;
  min-width: 90px;
}
.theme-select:hover { background-color: var(--surface2); border-color: var(--border2); }
.theme-select:focus { border-color: var(--accent); }
.theme-select option { background: var(--surface); color: var(--text); }

.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.nav-icon-btn:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }

.nav-ghost {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}
.nav-ghost:hover { background: var(--surface2); color: var(--text); }

.nav-primary {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 14px;
  border-radius: 7px;
  background: var(--accent);
  border: none;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, transform 0.08s;
}
.nav-primary:hover { background: var(--accent-h); }
.nav-primary:active { transform: scale(0.97); }

.user-widget { display: inline-flex; align-items: center; gap: 6px; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 500;
  max-width: 160px;
  transition: border-color 0.1s;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip img { border-radius: 50%; flex-shrink: 0; background: var(--border2); }
.user-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Status toast ────────────────────────────────── */
.status-toast {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 300;
  background: var(--surface);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 9px 14px;
  border-radius: 9px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: none;
  max-width: 60ch;
}
.status-toast.show   { opacity: 1; transform: translateY(0); }
.status-toast.ok  { color: var(--ok);  border-color: rgba(74,222,128,0.3); }
.status-toast.err { color: var(--err); border-color: rgba(248,113,113,0.4); }

/* ── Workspace ───────────────────────────────────── */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: var(--pane-split) 3px 1fr;
  min-height: 0;
  overflow: hidden;
}

/* ── Pane ────────────────────────────────────────── */
.ws-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.pane-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 38px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pane-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.pane-title svg { opacity: 0.5; }

.pane-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 5px;
}

.pane-bar-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pane-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  animation: pulse-dot 2.4s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* Tabs inside pane bar */
.pane-tabs {
  display: flex;
  gap: 0;
  flex: 1;
}
.pane-tab {
  height: 38px;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.1s, border-color 0.1s;
}
.pane-tab:hover { color: var(--text); }
.pane-tab.active { color: var(--text); border-bottom-color: var(--accent); }

/* Pane views */
.pane-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.pane-view[hidden] { display: none; }

/* ── Editor pane ─────────────────────────────────── */
.editor-pane { background: var(--bg); }
.editor-pane .CodeMirror {
  flex: 1;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
}
.editor-pane .CodeMirror-gutters {
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.editor-pane .CodeMirror-linenumber { color: var(--muted2); }
.editor-pane .CodeMirror-cursor { border-left-color: var(--accent-h); }

/* Thin scrollbars */
.editor-pane .CodeMirror-scroll { scrollbar-color: var(--border2) transparent; scrollbar-width: thin; }
.editor-pane .CodeMirror-scroll::-webkit-scrollbar { width: 8px; height: 8px; background: transparent; }
.editor-pane .CodeMirror-scroll::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; border: 2px solid var(--bg); }

/* Light variant */
body.cm-light .editor-pane,
body.cm-light .editor-pane .CodeMirror,
body.cm-light .editor-pane .CodeMirror-gutters { background: #f8f8fc; color: #1c1c30; }
body.cm-light .editor-pane .CodeMirror-gutters { border-right-color: #e0e0ec; }
body.cm-light .editor-pane .CodeMirror-scroll { scrollbar-color: #d0d0e0 transparent; }
body.cm-light .editor-pane .CodeMirror-scroll::-webkit-scrollbar-thumb { background: #d0d0e0; border-color: #f8f8fc; }

/* ── Preview pane ────────────────────────────────── */
.preview-pane { background: var(--surface); }

#view-preview { background: #fff; }
#view-preview iframe { width: 100%; height: 100%; border: 0; flex: 1; }

/* YAML source view */
.pane-yaml-view {
  background: var(--bg);
  overflow: auto;
  scrollbar-color: var(--border2) transparent;
  scrollbar-width: thin;
}
.pane-yaml-view::-webkit-scrollbar { width: 8px; background: transparent; }
.pane-yaml-view::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; border: 2px solid var(--bg); }

#yaml-pre {
  padding: 20px 24px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
  tab-size: 2;
}

/* ── Splitter ────────────────────────────────────── */
.ws-splitter {
  background: var(--border);
  cursor: col-resize;
  position: relative;
  transition: background 0.12s;
  z-index: 1;
}
.ws-splitter:hover, .ws-splitter.dragging { background: var(--accent); }

body.dragging { cursor: col-resize; user-select: none; }
body.dragging iframe { pointer-events: none; }

/* ── Gallery modal ───────────────────────────────── */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gallery-modal[hidden] { display: none; }

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 10, 0.72);
  backdrop-filter: blur(6px);
  cursor: pointer;
}

.gallery-panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 16px;
  width: min(1200px, 95vw);
  height: min(820px, 90vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 32px 80px -12px rgba(0,0,0,0.65), 0 0 0 1px rgba(99,102,241,0.06);
}

.gallery-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.gallery-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.gallery-search-wrap {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  position: relative;
}
.gallery-search-wrap svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
#gallery-search {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 7px 42px 7px 30px;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s;
}
#gallery-search:focus { border-color: var(--accent); }
#gallery-search::placeholder { color: var(--muted2); }
.gallery-search-wrap kbd {
  position: absolute;
  right: 9px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
}
.gallery-count { font-family: var(--font-mono); font-size: 11px; color: var(--muted2); margin-left: auto; }
.gallery-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.gallery-close:hover { background: var(--surface); color: var(--text); border-color: var(--border2); }

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  align-content: start;
  scrollbar-color: var(--border2) transparent;
  scrollbar-width: thin;
}
.gallery-grid::-webkit-scrollbar { width: 8px; }
.gallery-grid::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

.gallery-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.gallery-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(99,102,241,0.14); }
.gallery-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.gallery-card.active::after {
  content: 'active';
  position: absolute;
  top: 8px; right: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 4px;
}
.gallery-card { position: relative; }

.gallery-thumb {
  width: 100%;
  aspect-ratio: 210/297;
  background: #fff;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.gallery-thumb iframe {
  position: absolute;
  top: 0; left: 0;
  width: 800px; height: 1131px;
  border: 0;
  transform: scale(0.32);
  transform-origin: top left;
  pointer-events: none;
}
.gallery-thumb-cover { position: absolute; inset: 0; z-index: 1; }

.gallery-card-body {
  padding: 11px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gallery-card-name { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.gallery-card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--muted2); }

.gallery-empty { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--muted); }

.gallery-loader {
  position: absolute;
  inset: 50px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(19,19,29,0.9);
  backdrop-filter: blur(2px);
  z-index: 5;
  pointer-events: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.gallery-loader[hidden] { display: none; }

.gallery-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: gallSpin 0.65s linear infinite;
}
@keyframes gallSpin { to { transform: rotate(360deg); } }

/* ── YAML source view syntax colours ─────────────── */
.hl-comment { color: var(--muted2); }
.hl-key     { color: #818cf8; }
.hl-str     { color: #86efac; }

/* ── Share modal ─────────────────────────────────── */
.share-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.share-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,5,10,0.72); backdrop-filter: blur(6px); cursor: pointer;
}
.share-panel {
  position: relative; background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; width: min(440px, 95vw);
  box-shadow: 0 24px 64px rgba(0,0,0,0.55); overflow: hidden;
}
.share-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.share-title { font-size: 14px; font-weight: 600; }
.share-close {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: background .1s, color .1s;
}
.share-close:hover { background: var(--surface2); color: var(--text); border-color: var(--border2); }
.share-section { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.share-label { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: 8px; }
.share-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 0; cursor: pointer; color: var(--text); font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.share-label-row input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.share-fmt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-fmt {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-radius: 8px; border: 1px solid var(--border2); background: var(--bg);
  color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color .1s, color .1s, background .1s;
}
.share-fmt:hover { border-color: var(--accent); color: var(--text); }
.share-fmt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-h); }
.share-pw-row { margin-top: 10px; }
.share-pw-input {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border2);
  border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 13px; outline: none;
  transition: border-color .12s;
}
.share-pw-input:focus { border-color: var(--accent); }
.share-pw-hint { font-size: 11.5px; color: var(--muted2); margin-top: 6px; }
.share-actions { padding: 14px 16px; }
.share-actions .nav-primary { width: 100%; justify-content: center; height: 36px; }
.share-result { margin-top: 10px; font-size: 12.5px; font-family: var(--font-mono); padding: 8px 10px; border-radius: 7px; }
.share-result-ok  { color: var(--ok);  background: rgba(74,222,128,.08);  border: 1px solid rgba(74,222,128,.2);  }
.share-result-err { color: var(--err); background: rgba(248,113,113,.08); border: 1px solid rgba(248,113,113,.2); }

/* ── Dashboard ───────────────────────────────────── */
.dash-main { padding: 32px; max-width: 900px; margin: 0 auto; overflow-y: auto; height: calc(100vh - 50px); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dash-empty { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 80px 20px; color: var(--muted); }
.dash-empty p { font-size: 14px; }
.dash-card {
  background: var(--surface); border: 1px solid var(--border2); border-radius: 12px; padding: 16px;
  display: flex; flex-direction: column; gap: 12px; transition: border-color .15s;
}
.dash-card:hover { border-color: var(--accent); }
.dash-card-body { display: flex; flex-direction: column; gap: 4px; }
.dash-card-name { font-size: 14px; font-weight: 600; color: var(--text); }
.dash-card-date { font-size: 11.5px; color: var(--muted2); font-family: var(--font-mono); }
.dash-card-actions { display: flex; gap: 6px; }
.btn-sm {
  height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border2);
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; transition: border-color .1s, color .1s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--text); }
.btn-sm-share { color: var(--accent); border-color: var(--accent-soft); }
.btn-sm-danger:hover { border-color: var(--err); color: var(--err); }

/* ── Login page ──────────────────────────────────── */
.login-shell {
  display: grid; place-items: center; min-height: 100vh;
  background: var(--bg);
}
.login-card {
  width: min(400px, 92vw); padding: 40px 36px;
  background: var(--surface); border: 1px solid var(--border2); border-radius: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 0;
  box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}
.login-brand { margin-bottom: 24px; }
.login-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.login-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 28px; text-align: center; }
.login-providers { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.login-provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 42px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border2);
  color: var(--text); font: inherit; font-size: 14px; font-weight: 500;
  text-decoration: none; cursor: pointer; transition: border-color .1s, background .1s;
}
.login-provider-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.login-no-providers { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.6; }
.login-no-providers code { font-family: var(--font-mono); font-size: 11.5px; background: var(--bg); padding: 1px 5px; border-radius: 4px; }
.login-skip { font-size: 13px; color: var(--muted2); text-decoration: none; }
.login-skip:hover { color: var(--text); }

/* ── Password overlay (view page) ────────────────── */
.pw-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(5,5,10,0.85); backdrop-filter: blur(8px);
  display: grid; place-items: center;
}
.pw-overlay[hidden] { display: none; }
.pw-panel {
  width: min(360px, 90vw); background: var(--surface); border: 1px solid var(--border2);
  border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.pw-label { font-size: 14px; font-weight: 600; color: var(--text); text-align: center; }
.pw-input {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border2);
  border-radius: 8px; padding: 10px 14px; font: inherit; font-size: 14px; outline: none;
  transition: border-color .12s;
}
.pw-input:focus { border-color: var(--accent); }
.pw-error { font-size: 12.5px; color: var(--err); text-align: center; }
.pw-error[hidden] { display: none; }

/* ── Landing page ──────────────────────────────────── */
.landing {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.landing-layout { display: block; }

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px 80px;
}

.hero-logo { width: 80px; height: 80px; margin-bottom: 24px; }

.hero-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.hero-tagline {
  font-size: 18px;
  color: var(--muted);
  max-width: 420px;
  margin-bottom: 32px;
  line-height: 1.5;
}

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

.btn-primary {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s, transform 0.08s;
}
.btn-primary:hover { background: var(--accent-h); }
.btn-primary:active { transform: scale(0.97); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 24px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.1s, background 0.1s;
}
.btn-ghost:hover { border-color: var(--accent); background: var(--accent-soft); }

.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.feature {
  text-align: left;
}

.feature h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.feature p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
}

.code-sample {
  max-width: 500px;
  margin: 0 auto 60px;
  padding: 0 20px;
}

.code-sample pre {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  text-align: left;
}

.code-sample code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.6;
}

.landing-footer {
  padding: 24px;
  text-align: center;
  color: var(--muted2);
  font-size: 13px;
}

.landing-footer a {
  color: var(--muted);
  text-decoration: none;
}
.landing-footer a:hover { color: var(--text); }

.landing-footer .sep { margin: 0 8px; }

@media (max-width: 640px) {
  .hero-title { font-size: 32px; }
  .features { grid-template-columns: 1fr; text-align: center; }
}

/* ── Gallery card loading stub ───────────────────── */
.gallery-card-stub .gallery-thumb-loading {
  display: grid; place-items: center; background: var(--bg2);
}

/* ── Mobile ───────────────────────────────────────── */
@media (max-width: 760px) {
  .editor-nav { padding: 0 12px; }
  .nav-ghost:not(#btn-download) { display: none; }
  .nav-divider { display: none; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: var(--pane-split) 3px 1fr;
  }
  .ws-splitter { cursor: row-resize; }
}
