/* ── Dark Ops Console ─────────────────────────────────────── */
:root {
  --bg:            #0f1117;
  --surface:       #1a1d27;
  --surface-raised:#222636;
  --border:        #272a38;
  --text:          #dde1ed;
  --text-muted:    #6b7280;
  --accent:        #7c6af7;
  --accent-hover:  #9d8fff;
  --danger:        #f87171;
  --success:       #34d399;
  --warning:       #fbbf24;
  --font-ui:       'Inter', sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  /* Override Pico dark variables */
  --pico-background-color:       var(--bg);
  --pico-card-background-color:  var(--surface);
  --pico-border-color:           var(--border);
  --pico-color:                  var(--text);
  --pico-muted-color:            var(--text-muted);
  --pico-primary:                var(--accent);
  --pico-primary-hover:          var(--accent-hover);
  --pico-font-family:            var(--font-ui);
  --pico-code-font-family:       var(--font-mono);
}

/* ── Base ─────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
}

h1, h2, h3 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}

h1 { font-size: 1.35rem; margin-bottom: 1.25rem; }
h2 { font-size: 1rem; margin-top: 2rem; margin-bottom: 0.75rem; }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ── Nav ──────────────────────────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin-bottom: 2rem;
}

.app-header nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
}

.app-header nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--accent) !important;
  text-decoration: none;
  letter-spacing: 0.03em;
}

.nav-logo:hover { color: var(--accent-hover) !important; }

.app-header nav a:not(.nav-logo):not(.nav-new-btn) {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s;
}

.app-header nav a:not(.nav-logo):not(.nav-new-btn):hover {
  color: var(--text);
}

/* ── Nav: New Script button + user dropdown ──────────────── */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-new-btn {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff !important;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.28rem 0.65rem;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s;
}

.nav-new-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 12px rgba(124, 106, 247, 0.35);
}

.nav-user-menu {
  position: relative;
}

.nav-user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 400;
  cursor: pointer;
  padding: 0.3rem 0.1rem;
  text-decoration: none;
  transition: color 0.15s;
}

.nav-user-trigger:hover {
  color: var(--text);
  text-decoration: underline;
}

.nav-avatar {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 140px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  z-index: 100;
  padding: 0.35rem 0;
}

.nav-dropdown a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}

.nav-dropdown a:hover {
  background: rgba(124, 106, 247, 0.1);
  color: var(--accent);
}

/* ── Buttons ──────────────────────────────────────────────── */
button, [role="button"] {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.8rem;
  border-radius: 6px;
  padding: 0.45rem 1rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

button[type="submit"]:not(.secondary),
[role="button"]:not(.secondary) {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

button[type="submit"]:not(.secondary):hover,
[role="button"]:not(.secondary):hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

button.secondary, [role="button"].secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

button.secondary:hover, [role="button"].secondary:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ── Page header (title + action buttons) ─────────────────── */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header h1 { margin-bottom: 0; }

.page-header .actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Table ────────────────────────────────────────────────── */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

thead tr {
  background: var(--surface-raised);
}

thead th {
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

tbody tr:last-child { border-bottom: none; }

tbody tr:nth-child(even) { background: var(--surface); }
tbody tr:nth-child(odd)  { background: var(--bg); }

tbody tr:hover { background: var(--surface-raised); }

td {
  padding: 0.65rem 1rem;
  color: var(--text);
}

td a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

td a:hover { color: var(--accent-hover); }

/* runtime pill */
td .runtime-pill {
  display: inline-block;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ── Forms ────────────────────────────────────────────────── */
label {
  display: block;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  margin-top: 0.3rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 106, 247, 0.2);
}

textarea {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  resize: vertical;
}

input[type="checkbox"] {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

fieldset {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

legend {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 0.4rem;
}

/* ── Metadata grid (dl) ───────────────────────────────────── */
.meta-grid dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.meta-grid dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: center;
}

.meta-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  align-self: center;
}

/* ── Code block ───────────────────────────────────────────── */
.code-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.code-block code {
  display: block;
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
}

/* fallback for plain pre code */
pre code {
  display: block;
  overflow-x: auto;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.65;
  border-radius: 6px;
}

/* ── Status badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-pending  { color: var(--text-muted); }
.badge-queued   { color: #60a5fa; }
.badge-building { color: var(--warning); }
.badge-pushed   { color: #38bdf8; }
.badge-indexing { color: #c084fc; }
.badge-done     { color: var(--success); }
.badge-failed   { color: var(--danger); }
.badge-cancelled              { color: var(--text-muted); }
.badge-cancellation_requested { color: var(--warning); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-muted);
}

.empty-state a { color: var(--accent); }

/* ── 2-column form layout ─────────────────────────────────── */
.form-2col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
}
.form-editor { display: flex; flex-direction: column; gap: 1rem; }
.form-sidebar { display: flex; flex-direction: column; gap: 1rem; }
.form-sidebar input[type="text"],
.form-sidebar select { font-family: var(--font-mono); }
.form-editor textarea { flex: 1; min-height: 480px; resize: vertical; }
.form-sidebar fieldset { margin-bottom: 0; }
.form-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
@media (max-width: 720px) {
  .form-2col { grid-template-columns: 1fr; }
}

/* ── Small button ─────────────────────────────────────────── */
.btn-sm {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

/* ── Icon-only button ─────────────────────────────────────── */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  transition: color 0.15s;
}
.btn-icon:hover { color: var(--accent); }

/* slug heading + icon inline */
.slug-title {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap;
  align-items: center !important;
  gap: 0.5rem;
}
.slug-title h1 {
  margin: 0;
  line-height: 1;
  font-family: var(--font-mono);
  color: var(--accent);
}
.slug-title input[type="text"],
.slug-title .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border: 1px solid var(--border);
  box-sizing: border-box;
  height: 1.75rem;
  margin-top: 0;
}

.slug-title .btn-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: auto 0;
}

/* ── Show page layout ────────────────────────────────────── */
.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.header-tags {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.header-tags .runtime-pill {
  display: inline-block;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* ── Hero banner ─────────────────────────────────────────── */
.show-hero {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.show-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
}

.show-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
}

.show-breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.show-title {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0;
}

.show-description-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.show-updated {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.5rem;
}

.meta-sep {
  color: var(--border);
}

/* ── Hero URL rows ───────────────────────────────────────── */
.show-hero-urls {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  border-top: 1px solid var(--border);
  padding: 0.65rem 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.hero-url-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.hero-url-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.hero-url-group-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.62rem;
  color: var(--accent);
  margin-bottom: 0.1rem;
}

.hero-url-help {
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 0.1rem;
}

.hero-url-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.65rem;
  min-width: 7rem;
}

.hero-url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text);
  text-decoration: none;
}

.hero-url-link:hover {
  color: var(--accent);
}

.hero-url-row code {
  font-size: 0.72rem;
}

.hero-url-group-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hero-url-info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s;
}

.hero-url-info-btn:hover {
  opacity: 1;
}

.hero-url-info-btn svg {
  width: 0.85rem;
  height: 0.85rem;
}

.icon-external {
  width: 0.8rem;
  height: 0.8rem;
  flex-shrink: 0;
  opacity: 0.5;
}

.hero-url-link:hover .icon-external {
  opacity: 1;
}

/* ── Consistent action buttons ───────────────────────────── */
.show-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.show-actions form {
  display: inline-flex;
  align-items: center;
}

.show-actions button,
.show-actions [role="button"] {
  padding: 0.3rem 0.75rem;
  font-size: 0.72rem;
  margin: 0;
  line-height: 1;
  text-decoration: none;
  box-sizing: border-box;
}

/* ── Tab styles ──────────────────────────────────────────── */
.show-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.show-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}

.show-tab:hover {
  color: var(--text);
}

.show-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

[x-cloak] { display: none !important; }

/* ── Section title (replaces .show-main h2) ──────────────── */
.show-section-title {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.show-section-title:first-child { margin-top: 0; }

/* ── Detail line (entrypoint / run params) ───────────────── */
.show-detail-line {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0.5rem 0;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.show-detail-line dt {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.show-detail-line dd {
  margin: 0;
  margin-right: 1rem;
}

.show-detail-line dd code {
  font-size: 0.72rem;
  color: var(--text);
}

/* ── Source 2-column layout ──────────────────────────────── */
.source-2col {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.25rem;
  align-items: start;
}

.source-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}

.source-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 0.75rem;
  margin: 0;
  font-size: 0.78rem;
}

.source-details dt {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.source-details dd {
  margin: 0;
}

.source-details dd code {
  font-size: 0.78rem;
  color: var(--text);
  word-break: break-all;
}

.not-set { color: var(--text-muted); font-size: 0.72rem; font-style: italic; }

@media (max-width: 768px) {
  .source-2col { grid-template-columns: 1fr; }
}

/* ── Terminal Quick Start card ────────────────────────────── */
.show-terminal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}

.show-terminal .terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.terminal-title {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.terminal-commands {
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.terminal-line .t-prompt {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

.terminal-cmd {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.btn-copy {
  flex-shrink: 0;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 768px) {
  .show-hero-top {
    flex-direction: column;
  }
  .show-hero-urls {
    flex-direction: column;
    align-items: flex-start;
  }
  .meta-sep { display: none; }
}

/* ── Info banner ──────────────────────────────────────────── */
.info-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.info-banner code {
  background: rgba(124, 106, 247, 0.1);
  color: var(--accent);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* ── Script new page ─────────────────────────────────────── */
.script-new-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--pico-background-color, #fff);
  padding-top: 0.5rem;
}

.script-new-top button {
  width: auto;
  font-size: 0.75rem;
  padding: 0.35rem 1rem;
  border-radius: 5px;
  letter-spacing: 0.03em;
}

#autosave-status {
  font-size: 0.8rem;
  color: var(--pico-muted-color, #7b8794);
  font-style: italic;
}

.desc-meta-row {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.5rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.desc-meta-row label {
  margin-bottom: 0;
}

.desc-meta-row input[type="text"] {
  font-family: var(--font-ui);
}

@media (max-width: 720px) {
  .desc-meta-row { grid-template-columns: 1fr; }
}

/* ── Button toggle group ─────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.btn-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.btn-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-toggle.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-toggle.active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.meta-field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.meta-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* ── Slug card ───────────────────────────────────────────── */
.slug-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.slug-card .slug-title h1 {
  font-size: 1.1rem;
}

.slug-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover), transparent);
}

.slug-card-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.slug-card-urls {
  border-top: 1px solid var(--border);
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
}

.slug-card-urls code {
  font-size: 0.7rem;
}

/* ── Misc ─────────────────────────────────────────────────── */
small { color: var(--text-muted); font-size: 0.8rem; }

p { color: var(--text); }

/* ── Account page (vertical tabs) ────────────────────────── */
.account-layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.account-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 160px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding-right: 1.5rem;
}

.account-tab {
  background: none;
  border: none;
  border-left: 2px solid transparent;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.account-tab:hover {
  color: var(--text);
  background: rgba(124, 106, 247, 0.05);
}

.account-tab.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

.account-content {
  flex: 1;
  min-width: 0;
}

.account-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.6rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
}

.account-dl dt {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  align-self: center;
}

.account-dl dd {
  margin: 0;
  color: var(--text);
  align-self: center;
}

.account-dl dd code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent);
}

.account-slug-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 0.4rem;
}

.account-content form button {
  width: auto;
  justify-content: center;
  text-align: center;
  font-size: 0.78rem;
  padding: 0.4rem 1.1rem;
}

@media (max-width: 600px) {
  .account-layout {
    flex-direction: column;
    gap: 1rem;
  }
  .account-sidebar {
    flex-direction: row;
    min-width: 0;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding-right: 0;
    padding-bottom: 0.5rem;
    gap: 0;
  }
  .account-tab {
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.45rem 0.75rem;
  }
  .account-tab.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

/* ── Landing ──────────────────────────────────────────────── */
.landing-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

.landing-dotgrid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(124,106,247,0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
}

/* nav */
.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 2.5rem;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.landing-nav .nav-logo {
  font-size: 1.15rem;
}

.landing-nav-actions {
  display: flex;
  gap: 0.6rem;
}

/* hero */
.landing-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3rem;
  padding: 4rem 2.5rem;
  position: relative;
  z-index: 1;
  min-height: 0;
}

.landing-hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.landing-headline {
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text);
  margin: 0;
}

.landing-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.landing-sub code {
  color: var(--accent);
  background: rgba(124,106,247,0.1);
  padding: 0.1em 0.4em;
  border-radius: 4px;
}

.landing-cta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* terminal */
.landing-terminal-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-glow {
  position: absolute;
  width: 340px;
  height: 260px;
  background: radial-gradient(ellipse, rgba(124,106,247,0.28) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
}

.landing-terminal {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.45);
}

.terminal-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0.6rem 0.9rem;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--border);
}

.chrome-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.chrome-red    { background: #ff5f57; }
.chrome-yellow { background: #febc2e; }
.chrome-green  { background: #28c840; }

.terminal-body {
  margin: 0;
  padding: 1rem 1.25rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--text);
  background: none;
  border: none;
  white-space: pre-wrap;
  overflow-x: hidden;
}

.t-prompt { color: var(--accent); font-weight: 500; }
.t-arrow  { color: var(--accent); }
.t-accent { color: var(--success); }
.t-muted  { color: var(--text-muted); }

.terminal-cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* login buttons */
.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border-radius: 6px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.login-btn:hover { opacity: 0.88; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }

.login-btn-github {
  background: #24292f;
  color: #fff;
  border: 1px solid #444c56;
}

.login-btn-google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
}

/* footer */
.landing-footer {
  text-align: center;
  padding: 0.9rem 2.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

/* ── How it works ─────────────────────────────────────────── */
.landing-section {
  position: relative;
  z-index: 1;
  padding: 3.5rem 2.5rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.landing-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 2rem;
  text-align: center;
}

/* how it works steps */
.landing-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.landing-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  position: relative;
}

.landing-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
  margin-bottom: 0.75rem;
}

.landing-step h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.landing-step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── What you skip ───────────────────────────────────────── */
.landing-workflow {
  margin-bottom: 2rem;
}

.landing-workflow-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0;
}

.landing-workflow-row + .landing-workflow-row {
  border-top: 1px solid var(--border);
}

.landing-workflow-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 9rem;
  flex-shrink: 0;
}

.landing-workflow-chain {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.7;
}

.landing-workflow-chain .wf-arrow {
  color: var(--text-muted);
  margin: 0 0.15rem;
}

.landing-workflow-chain.chain-emage {
  color: var(--accent);
}

/* comparison table */
.landing-comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.landing-comparison-table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.landing-comparison-table thead th:not(:first-child) {
  text-align: center;
}

.landing-comparison-table tbody td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.landing-comparison-table tbody td:not(:first-child) {
  text-align: center;
}

.landing-comparison-table tbody tr:last-child td {
  border-bottom: none;
}

.cmp-yes {
  color: var(--text-muted);
}

.cmp-no {
  color: var(--success);
  font-weight: 500;
}

.cmp-manual {
  color: var(--text-muted);
}

.cmp-auto {
  color: var(--success);
  font-weight: 500;
}

.cmp-often {
  color: var(--text-muted);
}

.cmp-never {
  color: var(--success);
  font-weight: 500;
}

.landing-comparison-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 1.25rem;
  text-align: center;
  font-style: italic;
}

/* ── What emage is for ───────────────────────────────────── */
.landing-for-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.landing-for-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
}

.landing-for-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.landing-for-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
}

.landing-for-card code {
  color: var(--accent);
  background: rgba(124,106,247,0.1);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.78rem;
}

/* ── Trigger groups ──────────────────────────────────────── */
.trigger-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.trigger-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.6rem 1rem;
  background: var(--surface-raised);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.trigger-header:hover {
  background: var(--surface);
}

.trigger-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}

.trigger-time {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.trigger-logs-link {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.trigger-logs-link:hover {
  color: var(--accent-hover);
}

.trigger-jobs .table-wrap {
  border: none;
  border-radius: 0;
}

.trigger-id {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--surface);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.trigger-jobs table {
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}

/* Build logs */
.build-logs-page { margin-top: 1.5rem; }
.build-logs-meta { margin-bottom: 1.5rem; }
.build-logs-pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  max-height: 70vh;
  overflow-y: auto;
}
.build-logs-back { margin-top: 1.5rem; }

@media (max-width: 768px) {
  .landing-hero {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem;
    gap: 1.5rem;
  }
  .landing-nav {
    padding: 0.9rem 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .landing-nav-actions { display: none; }
  .landing-headline { font-size: clamp(2rem, 8vw, 2.8rem); }
  .landing-section { padding: 2.5rem 1.25rem; }
  .landing-steps { grid-template-columns: 1fr; }
  .landing-for-cards { grid-template-columns: 1fr; }
  .landing-workflow-row { flex-direction: column; gap: 0.25rem; }
  .landing-workflow-label { min-width: auto; }
}
