/* Prompt Atlas — design system
   Themes via [data-theme]; light is the default, dark is opt-in and persisted. */

:root {
  --bg: #f7f9fc;
  --bg-elev: #ffffff;
  --panel: #ffffff;
  --line: #dbe3ee;
  --line-strong: #c3cfe0;
  --text: #0e1a2b;
  --muted: #5b6b82;
  --faint: #8494a8;
  --brand: #15803d;
  --brand-strong: #14532d;
  --brand-soft: #e7f6ec;
  --accent: #0e7490;
  --accent-soft: #e0f2f7;
  --warn: #b45309;
  --danger: #b91c1c;
  --shadow-sm: 0 1px 2px rgba(15, 26, 43, .06), 0 1px 3px rgba(15, 26, 43, .05);
  --shadow-md: 0 4px 12px rgba(15, 26, 43, .08), 0 2px 4px rgba(15, 26, 43, .04);
  --shadow-lg: 0 24px 60px rgba(15, 26, 43, .18);
  --radius: 14px;
  --radius-lg: 20px;
  --wrap: 1180px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #08111f;
  --bg-elev: #0d1a2c;
  --panel: #101f34;
  --line: #26374f;
  --line-strong: #37496a;
  --text: #eef5ff;
  --muted: #a2b4cc;
  --faint: #7f93ad;
  --brand: #bdfa76;
  --brand-strong: #d5ffa4;
  --brand-soft: #17281a;
  --accent: #76e9e5;
  --accent-soft: #12262c;
  --warn: #ffd781;
  --danger: #ffb9a9;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
  --shadow-lg: 0 35px 110px rgba(0, 0, 0, .7);
}

/* Before JS runs, follow the OS preference so there is no theme flash. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #08111f;
    --bg-elev: #0d1a2c;
    --panel: #101f34;
    --line: #26374f;
    --line-strong: #37496a;
    --text: #eef5ff;
    --muted: #a2b4cc;
    --faint: #7f93ad;
    --brand: #bdfa76;
    --brand-strong: #d5ffa4;
    --brand-soft: #17281a;
    --accent: #76e9e5;
    --accent-soft: #12262c;
    --warn: #ffd781;
    --danger: #ffb9a9;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-lg: 0 35px 110px rgba(0, 0, 0, .7);
  }
}

/* Native hidden must override layout classes such as .overlay and .cards. */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.wrap { width: min(var(--wrap), calc(100% - 32px)); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--brand); color: var(--bg-elev); padding: 10px 16px;
  border-radius: 10px; font-weight: 700; transition: top .15s;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  height: var(--header-h); display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: -.02em; }
.brand-logo {
  display: block; width: 58px; height: 33px; object-fit: contain; flex: none;
  border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 16px; }
.brand-sub { font-size: 11px; color: var(--faint); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-link { font-size: 13px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-radius: 9px; }
.nav-link:hover { color: var(--text); background: var(--panel); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 700;
  line-height: 1.2; transition: background .14s, border-color .14s, transform .06s;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--bg-elev); }
[data-theme="dark"] .btn.primary { color: #0b1a10; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.sm { padding: 7px 10px; font-size: 12px; }
.btn.icon { padding: 8px; width: 36px; height: 36px; }
.btn[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.chip {
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 700;
}
.chip:hover { color: var(--text); border-color: var(--brand); }
.chip[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero-inner { max-width: 780px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--panel);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 700;
  color: var(--muted); letter-spacing: .01em;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.hero h1 {
  font-size: clamp(38px, 6.4vw, 74px); line-height: 1.02; letter-spacing: -.045em;
  margin: 22px 0 16px; font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(92deg, var(--brand), var(--accent) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lede { font-size: 17px; color: var(--muted); max-width: 620px; margin: 0 0 26px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.stat {
  border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius);
  padding: 14px 18px; min-width: 150px; box-shadow: var(--shadow-sm);
}
.stat strong { display: block; font-size: 26px; letter-spacing: -.03em; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 12.5px; }

/* ---------- Hero category browser ---------- */
.category-browser { margin-top: 34px; }
.category-title { font-size: 21px; letter-spacing: -.02em; margin: 0 0 4px; font-weight: 800; }
.category-sub { font-size: 13.5px; color: var(--muted); margin: 0 0 14px; }
.category-links { display: flex; flex-wrap: wrap; gap: 9px; }
.category-link {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text);
  border-radius: 12px; padding: 10px 13px; font-size: 13px; font-weight: 700;
  transition: border-color .14s, background .14s, color .14s;
}
.category-link span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.category-link:hover, .category-link:focus-visible { border-color: var(--brand); }
.category-link.active { background: var(--brand); border-color: var(--brand); color: var(--bg-elev); }
[data-theme="dark"] .category-link.active { color: #0b1a10; }
.category-link.active span { color: inherit; opacity: .8; }

/* ---------- Toolbar ---------- */
.library-head { margin-top: 20px; }
.section-title { font-size: 27px; letter-spacing: -.03em; margin: 0 0 4px; font-weight: 800; }
.section-title.spaced { margin-top: 40px; }
.section-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

.toolbar {
  position: sticky; top: var(--header-h); z-index: 30;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
  padding: 12px 0; margin-bottom: 8px;
}
.toolbar-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.search-wrap { position: relative; flex: 1 1 260px; min-width: 200px; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search {
  width: 100%; background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 11px; padding: 11px 14px 11px 38px; outline: 0;
}
.search:focus { border-color: var(--brand); }
select.control {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 11px;
  padding: 10px 12px; max-width: 220px; font-size: 13px; font-weight: 600;
}
.view-tabs { display: flex; gap: 6px; }
.result-meta { color: var(--muted); font-size: 13px; margin: 14px 0 4px; }
.active-filter { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 13px; color: var(--muted); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; margin-top: 16px; }
.card {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: var(--radius-lg);
  padding: 20px; min-height: 250px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.card:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-icon { font-size: 22px; line-height: 1; }
.card-tags { display: flex; align-items: center; gap: 6px; }
.tag {
  font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 3px 7px;
}
.card h3 { font-size: 18px; line-height: 1.28; letter-spacing: -.02em; margin: 2px 0 0; }
.card .byline { font-size: 12px; color: var(--muted); }
.card .excerpt {
  font-size: 13.5px; color: var(--muted); flex: 1; margin: 4px 0 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.card-actions .btn { flex: 0 1 auto; }
.star { margin-left: auto; }

/* ---------- Source rows ---------- */
.source-rows { display: grid; gap: 10px; margin-top: 16px; }
.source-row {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 14px;
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.source-num { font-size: 20px; font-weight: 800; color: var(--faint); font-variant-numeric: tabular-nums; }
.source-row h3 { margin: 0 0 6px; font-size: 16px; }
.source-row p { margin: 4px 0; font-size: 12.5px; color: var(--muted); }
.source-url { color: var(--accent); word-break: break-all; font-size: 12px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.source-actions { display: flex; flex-direction: column; gap: 7px; align-items: stretch; }
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; border: 1px solid var(--line-strong); color: var(--accent); }
.badge.partial { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.badge.unavailable { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

/* ---------- States ---------- */
.empty, .loading { grid-column: 1 / -1; text-align: center; padding: 56px 20px; color: var(--muted); }
.skeleton {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px;
  min-height: 250px; background: var(--bg-elev); overflow: hidden; position: relative;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--line) 60%, transparent), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.more-wrap { display: flex; justify-content: center; margin: 28px 0 60px; }

/* ---------- Guide / info panel ---------- */
.info-panel {
  border: 1px solid var(--line); background: var(--bg-elev); border-radius: var(--radius-lg);
  padding: 26px; margin: 48px 0; box-shadow: var(--shadow-sm);
}
.info-panel h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.02em; }
.info-panel p { font-size: 13.5px; color: var(--muted); margin: 0 0 12px; max-width: 78ch; }
.info-panel .btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--muted); font-size: 12.5px; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }

/* ---------- Modal ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(6, 12, 22, .62);
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(6px);
}
.modal {
  width: min(780px, 100%); max-height: 90vh; overflow: auto;
  background: var(--bg-elev); border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); padding: 26px; box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.modal h2 { font-size: 26px; letter-spacing: -.03em; margin: 6px 0 0; line-height: 1.2; }
.modal .meta { font-size: 11.5px; color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.close-btn {
  flex: none; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); font-size: 20px; line-height: 1; display: grid; place-items: center;
}
.label { color: var(--brand); font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; margin: 22px 0 8px; }
.promptbox {
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 2;
  background: color-mix(in srgb, var(--panel) 60%, var(--bg)); border: 1px solid var(--line);
  padding: 16px; border-radius: 12px; font-size: 14px; line-height: 1.75; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.attribution { font-size: 13px; color: var(--muted); }
.act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sample-image { margin: 0; }
.sample-image img { display: block; width: 100%; height: auto; max-height: 62vh; object-fit: contain; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.sample-image figcaption { font-size: 12px; color: var(--faint); margin-top: 8px; }
textarea {
  width: 100%; min-height: 130px; padding: 14px; background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 12px; resize: vertical; font-family: inherit;
}
details summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 4px 0; }
.detail-list { display: grid; gap: 8px; margin-top: 12px; }
.detail-list .btn { text-align: left; justify-content: flex-start; }
.note-block { margin-top: 16px; }
.saved-text { margin-top: 24px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 90;
  background: var(--text); color: var(--bg-elev); border-radius: 11px;
  padding: 13px 18px; font-weight: 700; font-size: 13.5px;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(8px);
  transition: opacity .18s, transform .18s; pointer-events: none;
}
.toast.visible { opacity: 1; transform: translateY(0); }

/* ---------- Standalone SEO page ---------- */
.seo-page { padding: 40px 0 60px; }
.breadcrumb { font-size: 13px; color: var(--faint); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--text); }
.seo-page h1 { font-size: clamp(28px, 4.5vw, 42px); letter-spacing: -.035em; margin: 8px 0 12px; line-height: 1.1; }
.seo-lede { color: var(--muted); font-size: 16px; max-width: 68ch; }
.related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

@media (max-width: 720px) {
  .source-row { grid-template-columns: 34px 1fr; }
  .source-actions { grid-column: 2; flex-direction: row; flex-wrap: wrap; }
  .hero { padding: 40px 0 24px; }
  .modal { padding: 20px; }
  .cards { grid-template-columns: 1fr; }
  .category-links { gap: 7px; }
  .category-link { font-size: 12px; padding: 9px 11px; }
  .brand-logo { width: 46px; height: 27px; }
}
@media (max-width: 480px) {
  .brand-sub { display: none; }
  .stat { min-width: 0; flex: 1 1 40%; }
}

/* ---------- Prompt Atlas v2 ---------- */
.v2-bottom-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-inner { max-width: 1000px; }
.hero-search {
  display:flex; align-items:center; gap:12px; margin: 4px 0 22px;
  padding: 8px 10px 8px 18px; border: 1px solid var(--line-strong);
  border-radius: 16px; background: var(--bg-elev);
  box-shadow: var(--shadow-md);
}
.hero-search svg { flex:none; color:var(--brand); }
.hero-search input {
  background:transparent; border:0; outline:0; width:100%; font-size:16px;
  padding:12px 2px; min-width:0;
}
.hero-search .btn { white-space:nowrap; }
.v2-quick-nav { display:grid; grid-template-columns:repeat(3,1fr); gap:14px; margin: 26px 0 4px; }
.v2-nav-card {
  display:block; border: 1px solid var(--line); border-radius:16px;
  padding:20px; background:var(--panel); box-shadow:var(--shadow-sm);
  transition: box-shadow .15s, border-color .15s, transform .15s;
}
.v2-nav-card:hover { border-color:var(--brand); box-shadow:var(--shadow-md); transform:translateY(-2px); }
.v2-nav-card strong { display:block; font-size:17px; margin:7px 0 3px; }
.v2-nav-card span { display:block; color:var(--muted); font-size:13px; }
.v2-nav-symbol { font-size:26px; }
.category-more { margin-top:13px; }
.category-more summary { cursor:pointer; color:var(--brand); font-size:13px; font-weight:800; width:max-content; padding:9px 2px; }
.category-more .category-links { margin-top:8px; }
.v2-page-head { max-width:760px; margin: 0 0 30px; }
.v2-page-head p { color: var(--muted); font-size:16px; }
.v2-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(270px,1fr)); gap:16px; margin-top:24px; }
.v2-content-card { background:var(--bg-elev); border:1px solid var(--line); border-radius:18px; padding:22px; }
.v2-content-card h2 { font-size:19px; margin:0 0 10px; }
.v2-content-card h3 { font-size:15px; margin: 18px 0 4px; }
.v2-content-card p,.v2-content-card li { color: var(--muted); font-size:14px; }
.v2-content-card ol { padding-left:20px; }
.v2-content-card .chip { display:inline-block; margin-top:10px; }
.v2-eyebrow { color:var(--brand); font-weight:800; font-size:12px; text-transform:uppercase; letter-spacing:.09em; }
.builder-layout { display:grid; grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); gap:20px; align-items:start; }
.builder-panel { padding:23px; background:var(--bg-elev); border:1px solid var(--line); border-radius:18px; }
.builder-panel h2 { margin: 0 0 16px; font-size:19px; }
.builder-field { display:block; margin:14px 0; }
.builder-field span { display:block; font-size:13px; font-weight:750; margin-bottom:5px; }
.builder-field textarea, .builder-panel select {
  width:100%; background:var(--panel); border:1px solid var(--line-strong);
  border-radius:10px; padding:10px 12px; outline:0;
}
.builder-field textarea:focus, .builder-panel select:focus { border-color:var(--brand); }
.builder-panel .promptbox { max-height:650px; overflow:auto; }
.v2-helper { color:var(--muted); font-size:13px; }
@media(max-width:850px) {
  .header-actions { gap:3px; }
  .header-actions .nav-link { padding:8px 6px; font-size:12px; }
}
@media(max-width:720px) {
  .v2-quick-nav { grid-template-columns:1fr; gap:10px; }
  .v2-nav-card { padding:15px; }
  .builder-layout { grid-template-columns:1fr; }
  .hero-search { flex-wrap:wrap; }
  .hero-search input { flex:1; }
  .hero-search .btn { flex:1 1 100%; }
}
@media(max-width:480px) {
  .header-actions .nav-link[href="/#library"], .header-actions .nav-link[href="/workflows/"] { display:none; }
  .header-actions .nav-link { font-size:11px; }
  .brand-logo { width:38px; height:25px; }
}

/* Version 3: discovery, learning and device-local template editors. */
.group-browser { display:grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap:11px; margin-bottom:24px; }
.group-filter { display:flex; flex-direction:column; align-items:flex-start; gap:6px; border:1px solid var(--line);
  border-radius:15px; padding:15px; background:var(--bg-elev); text-align:left; box-shadow:var(--shadow-sm);
  min-height:120px; transition: border-color .15s, transform .15s; }
.group-filter:hover { border-color:var(--brand); transform:translateY(-1px); }
.group-filter:focus-visible { outline:2px solid var(--brand); outline-offset:2px; }
.group-filter[aria-pressed="true"] { border-color:var(--brand); background:var(--brand-soft); }
.group-filter span { font-size:23px; }
.group-filter strong { font-size:13px; line-height:1.35; }
.group-filter small { color:var(--muted); font-size:11px; }
.v3-meta { color:var(--muted); font-size:12px; line-height:1.55; margin:4px 0 8px; }
.v3-learn-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(290px,1fr)); gap:17px; }
.v3-learn-grid .v2-content-card { display:flex; flex-direction:column; align-items:flex-start; gap:4px; }
.v3-learn-grid .v2-content-card h2 a:hover { color:var(--brand); }
.v3-learn-grid .v2-content-card .chip { margin-top:auto; }
.v3-article { max-width:930px; }
.v3-lesson { padding:8px 0 14px; border-bottom:1px solid var(--line); max-width:76ch; }
.v3-lesson h2 { font-size:21px; margin:16px 0 6px; }
.v3-lesson p { color:var(--muted); margin:4px 0 12px; }
.v3-example-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:28px 0; }
.v3-bad-example,.v3-good-example { padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--panel); min-width:0; }
.v3-example-grid h2 { font-size:17px; margin:0 0 12px; }
.v3-example-grid pre { white-space:pre-wrap; overflow-wrap:anywhere; font-family:inherit; font-size:14px; line-height:1.6; }
.v3-good-example { border-color:var(--brand); }
.v3-good-example .btn { margin-top:10px; }
.v3-takeaway,.v3-workflow-outcome { background:var(--brand-soft); border:1px solid var(--line);
  border-radius:14px; padding:16px 20px; margin:25px 0; }
.v3-takeaway h2 { font-size:17px; margin:0 0 5px; }
.v3-takeaway p { margin:0; }
.v3-actions { display:flex; flex-wrap:wrap; gap:10px; margin:18px 0; }
.v3-steps { list-style:none; counter-reset:steps; padding:0; display:grid; gap:14px; }
.v3-steps > li { counter-increment:steps; position:relative; padding:22px 22px 22px 70px;
  background:var(--bg-elev); border:1px solid var(--line); border-radius:16px; }
.v3-steps > li::before { content:counter(steps); position:absolute; left:20px; top:23px;
  background:var(--brand-soft); color:var(--brand); border-radius:50%; font-weight:800;
  display:grid; place-items:center; width:34px; height:34px; }
.v3-steps h2 { font-size:19px; margin:0 0 8px; }
.v3-steps p { margin:0 0 10px; color:var(--muted); }
.v3-steps a { color:var(--brand); text-decoration:underline; font-weight:700; font-size:14px; }
.template-editor { margin:24px 0; background:var(--bg-elev); border:1px solid var(--line); border-radius:18px; padding:22px; }
.template-editor h2,.template-editor h3 { font-size:19px; margin:0 0 9px; }
.template-editor h3 { margin-top:20px; font-size:16px; }
.template-inputs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.template-label { display:block; margin:12px 0; font-weight:700; font-size:13px; }
.template-label input,.template-label textarea { margin-top:6px; width:100%; min-width:0;
  color:var(--text); background:var(--panel); border:1px solid var(--line-strong);
  border-radius:9px; padding:11px; font-weight:400; outline:0; }
.template-label input:focus,.template-label textarea:focus { border-color:var(--brand); }
.template-preview { max-height:380px; overflow:auto; }
.toolbar-row select.control { max-width:175px; }
@media(max-width:1100px) { .group-browser { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media(max-width:720px) { .group-browser { grid-template-columns:repeat(2,minmax(0,1fr)); }
 .v3-example-grid,.template-inputs { grid-template-columns:1fr; }
 .v3-steps > li { padding:20px 18px 20px 58px; }
 .v3-steps > li::before { left:12px; top:20px; }
 .toolbar-row select.control { max-width:none; flex:1 1 42%; }
}
@media(max-width:400px) { .group-browser { grid-template-columns:1fr; }
 .group-filter { min-height:unset; } }
