/* ============================================================
   prompt-library — style.css
   Dark, sharp, technical. Green accent. No gradients.
   Mobile first: base styles target phones, @media widens up.
   ============================================================ */

/* ---- tokens ---- */
:root {
  --bg:         #0a0a0a;
  --bg-1:       #101010;
  --bg-2:       #161616;
  --bg-3:       #1c1c1c;
  --border:     #1f1f1f;
  --border-2:   #2a2a2a;
  --text:       #e6e6e6;
  --text-dim:   #9a9a9a;
  --text-faint: #5a5a5a;
  --accent:     #00ff88;
  --accent-dim: #00cc6e;
  --accent-soft: rgba(0, 255, 136, 0.08);
  --accent-edge: rgba(0, 255, 136, 0.28);
  --danger:     #ff3b3b;
  --warn:       #ffb020;
  --radius:     2px;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* surface tokens used for hardcoded backgrounds */
  --bg-header:  rgba(10, 10, 10, 0.88);
  --bg-footer:  rgba(10, 10, 10, 0.60);
  --overlay:    rgba(0, 0, 0, 0.78);
  --dot-color:  rgba(255, 255, 255, 0.025);
  /* Simple Icons are fetched as near-white SVGs; this filter normalizes
     them to the current text colour. Overridden in the light theme. */
  --logo-filter: brightness(0) invert(0.9);
}

/* ---- light theme overrides ---- */
[data-theme="light"] {
  --bg:         #f4f4f4;
  --bg-1:       #ffffff;
  --bg-2:       #ebebeb;
  --bg-3:       #e0e0e0;
  --border:     #dedede;
  --border-2:   #cccccc;
  --text:       #111111;
  --text-dim:   #505050;
  --text-faint: #909090;
  --accent:     #008844;
  --accent-dim: #006633;
  --accent-soft: rgba(0, 136, 68, 0.10);
  --accent-edge: rgba(0, 136, 68, 0.30);
  --bg-header:  rgba(244, 244, 244, 0.94);
  --bg-footer:  rgba(244, 244, 244, 0.94);
  --overlay:    rgba(0, 0, 0, 0.55);
  --dot-color:  rgba(0, 0, 0, 0.055);
  /* Flip to near-black so logos read on the light background. */
  --logo-filter: brightness(0) invert(0.1);
}

/* ---- reset ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  /* subtle dot grid — keeps the flat technical feel, adds depth */
  background-image:
    radial-gradient(circle at 1px 1px, var(--dot-color) 1px, transparent 0);
  background-size: 28px 28px;
  background-attachment: fixed;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-header);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.site-header nav { display: none; }
@media (min-width: 860px) { .site-header nav { display: flex; } }

/* ---- desktop nav dropdown ---- */
.nav-dropdown { position: relative; }
.nav-dropdown::after {
  content: ''; position: absolute;
  top: 100%; left: 0; right: 0; height: 14px;
}
.nav-dd-btn {
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim); cursor: pointer;
  background: none; border: none; padding: 0;
  display: flex; align-items: center; gap: 5px;
  transition: color 0.12s;
}
.nav-dd-btn:hover { color: var(--text); }
.nav-dd-btn.child-active { color: var(--accent); }
.nav-dd-caret { font-size: 7px; transition: transform 0.15s; display: inline-block; }
.nav-dropdown.open .nav-dd-caret { transform: rotate(180deg); }
.nav-dd-menu {
  display: none;
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); padding: 6px 0;
  min-width: 148px; z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.nav-dropdown.open .nav-dd-menu { display: block; }
@media (hover: hover) {
  .nav-dropdown:hover .nav-dd-menu { display: block; }
  .nav-dropdown:hover .nav-dd-caret { transform: rotate(180deg); }
}
.nav-dd-item {
  display: block; padding: 8px 16px;
  font-family: var(--mono); font-size: 12px;
  color: var(--text-dim); text-decoration: none;
  transition: color 0.12s, background 0.12s;
  white-space: nowrap;
}
.nav-dd-item:hover { color: var(--text); background: var(--bg-3); text-decoration: none; }
.nav-dd-item.current { color: var(--accent); }

/* ---- mobile drawer group label ---- */
.drawer-group-label {
  font-family: var(--mono); font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--text-faint); padding: 10px 12px 4px;
}

/* ---- hamburger button ---- */
.nav-burger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.12s;
}
.nav-burger:hover { border-color: var(--accent-edge); }
.nav-burger span {
  display: block;
  width: 14px;
  height: 1.5px;
  background: var(--text-dim);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav-burger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }
@media (min-width: 860px) { .nav-burger { display: none; } }

/* ---- mobile drawer ---- */
.nav-drawer {
  display: none;
  position: fixed;
  top: 53px;
  left: 0; right: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  z-index: 19;
  padding: 10px 14px 14px;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-drawer.open { display: flex; }
@media (min-width: 860px) { .nav-drawer { display: none !important; } }
.nav-drawer a {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 0.12s, background 0.12s;
}
.nav-drawer a:hover { color: var(--text); background: var(--bg-2); text-decoration: none; }
.nav-drawer a.active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-edge); }
.logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.logo .caret { color: var(--accent); margin-right: 4px; }
.logo .tilde { color: var(--text-faint); margin: 0 6px 0 4px; }
.logo .sub   { color: var(--text-dim); font-weight: 400; }
.count-pill {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 5px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  position: relative;
  box-shadow: 0 0 0 0 var(--accent-soft);
}
.count-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.count-pill .num { color: var(--accent); font-weight: 600; }
.count-pill .label { color: var(--text-dim); margin-left: 4px; }

/* ---- avatar chip (header profile link) ---- */
.avatar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: 99px;
  padding: 4px 12px 4px 4px;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.avatar-chip:hover {
  border-color: var(--accent-edge);
  background: var(--bg-3);
}
.avatar-chip .av-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
}
.avatar-chip .av-handle {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.03em;
}
@media (max-width: 480px) { .avatar-chip .av-handle { display: none; } }

/* ---- theme toggle ---- */
.theme-toggle {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  color: var(--text-faint);
  font-size: 15px;
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-edge);
  background: var(--bg-3);
}

/* ---- hero ---- */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 68px 18px 20px;
  position: relative;
}
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.hero .eyebrow .dot {
  width: 5px; height: 5px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--accent);
}
.hero .eyebrow .sep { color: var(--text-faint); }
.hero h1 {
  font-family: var(--mono);
  font-size: 34px;
  line-height: 1.12;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
  color: var(--text);
  font-weight: 600;
}
.hero h1 .accent { color: var(--accent); }
.hero h1 .cursor {
  display: inline-block;
  width: 10px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -3px;
  margin-left: 6px;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.hero p.lede {
  margin: 0 0 22px;
  color: var(--text-dim);
  font-size: 16px;
  max-width: 640px;
}
.hero .statline {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-2);
}
.hero .statline .k { color: var(--text-faint); }
.hero .statline .v { color: var(--text-dim); }
.hero .statline .v strong { color: var(--accent); font-weight: 600; }
.hero .kbd-hint {
  margin-left: auto;
  color: var(--text-faint);
}
.hero .kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: var(--radius);
  margin: 0 2px;
}
@media (min-width: 720px) {
  .hero { padding: 84px 18px 24px; }
  .hero h1 { font-size: 48px; }
  .hero p.lede { font-size: 17px; }
}

/* ---- controls (search + filters) ---- */
.controls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 18px 24px;
  display: grid;
  gap: 14px;
}
.search-wrap {
  position: relative;
}
.search-wrap::before {
  content: "/";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-family: var(--mono);
  pointer-events: none;
  font-size: 14px;
}
.search-wrap::after {
  content: "press / to focus";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
  pointer-events: none;
  opacity: 0.8;
  display: none;
}
@media (min-width: 720px) { .search-wrap::after { display: block; } }
.search-wrap:focus-within::after { opacity: 0; }
.search-input {
  width: 100%;
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 14px 14px 32px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-input::placeholder { color: var(--text-faint); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-edge);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.filter-row .label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
}
.chip {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  background: var(--bg-1);
  border: 1px solid var(--border);
  padding: 6px 11px;
  border-radius: var(--radius);
  transition: all 0.12s ease;
  white-space: nowrap;
  position: relative;
}
.chip:hover { border-color: var(--border-2); color: var(--text); }
.chip.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.chip .count {
  color: var(--text-faint);
  margin-left: 6px;
  font-size: 11px;
}
.chip.active .count { color: var(--accent-dim); }

/* complexity chips — tinted to match card badges */
.chip[data-complexity="beginner"]              { color: #9cd89c; border-color: #1a3a1a; }
.chip[data-complexity="beginner"]:hover        { border-color: #2a5a2a; }
.chip[data-complexity="beginner"].active       { color: #9cd89c; border-color: #9cd89c; background: rgba(156, 216, 156, 0.08); }
.chip[data-complexity="intermediate"]          { color: #f5d580; border-color: #3a2e1a; }
.chip[data-complexity="intermediate"]:hover    { border-color: #5a4a2a; }
.chip[data-complexity="intermediate"].active   { color: #f5d580; border-color: #f5d580; background: rgba(245, 213, 128, 0.08); }
.chip[data-complexity="advanced"]             { color: #ff8a8a; border-color: #3a1a1a; }
.chip[data-complexity="advanced"]:hover       { border-color: #5a2a2a; }
.chip[data-complexity="advanced"].active      { color: #ff8a8a; border-color: #ff8a8a; background: rgba(255, 138, 138, 0.08); }

/* ---- card grid ---- */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 18px 80px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 640px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
  width: 100%;
  gap: 10px;
  min-height: 200px;
  position: relative;
  overflow: hidden;
}
/* thin accent rail on the left — reveals on hover/focus */
.card::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.18s ease;
}
.card:hover,
.card:focus-visible {
  border-color: var(--accent-edge);
  background: var(--bg-2);
}
.card:hover::before,
.card:focus-visible::before { transform: scaleY(1); }
.card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-head-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-cat {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-id {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  padding-right: 8px;
  border-right: 1px solid var(--border-2);
}
.badge {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  color: var(--text-dim);
}
.badge.beginner     { color: #9cd89c; border-color: #1a3a1a; }
.badge.intermediate { color: #f5d580; border-color: #3a2e1a; }
.badge.advanced     { color: #ff8a8a; border-color: #3a1a1a; }

.card h3 {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
}
.card:hover h3 { color: var(--accent); }
.card .purpose {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0;
  flex: 1;
}
.card-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.card-copy {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 6px 10px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s ease;
  line-height: 1;
  min-height: 28px;
}
.card-copy svg { width: 12px; height: 12px; }
.card-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.card-copy.copied {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
.bookmark-btn {
  flex-shrink: 0;
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  padding: 6px 8px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.12s ease;
  min-height: 28px;
  line-height: 1;
}
.bookmark-btn svg { width: 13px; height: 13px; display: block; }
.bookmark-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.bookmark-btn.saved { color: var(--accent); border-color: var(--accent); }
.card-share {
  flex-shrink: 0;
  color: var(--text-faint);
  background: var(--bg-2);
  border: 1px solid var(--border-2, var(--border));
  padding: 6px 7px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  min-height: 28px;
  cursor: pointer;
}
.card-share svg { width: 13px; height: 13px; }
.card-share:hover {
  color: var(--text-dim);
  border-color: var(--text-faint);
  background: var(--bg-3, var(--bg-2));
}
.tag, .model-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--bg-2);
}
.model-pill { color: var(--accent); border-color: var(--accent-edge); }

/* ---- empty state ---- */
.empty {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 18px 80px;
  text-align: center;
  color: var(--text-faint);
  font-family: var(--mono);
}
.empty strong { color: var(--text-dim); display: block; margin-bottom: 6px; }

/* ---- modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  max-width: 820px;
  width: 100%;
  margin: 30px 0;
  padding: 0;
  position: relative;
  animation: modalIn 0.18s ease-out;
}
.modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-head {
  position: sticky;
  top: 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  padding: 20px 22px 14px;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  z-index: 1;
}
.modal-head .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  align-items: center;
}
.modal-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.modal-close {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 18px;
  padding: 4px 10px;
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  line-height: 1;
  flex-shrink: 0;
  transition: all 0.12s ease;
}
.modal-close:hover { color: var(--accent); border-color: var(--accent); }

.modal-body { padding: 20px 22px 28px; }
.modal-body h4 {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-body h4::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 1px;
  background: var(--accent);
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 6px; color: var(--text); font-size: 14.5px; }
.modal-body .purpose { color: var(--text-dim); font-size: 15px; margin-bottom: 4px; }

.prompt-block {
  position: relative;
  background: #050505;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 8px 0 4px;
  overflow: hidden;
}
.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #0a0a0a;
}
.prompt-toolbar::before {
  content: "system_prompt";
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-right: auto;
}
.prompt-block pre {
  margin: 0;
  padding: 14px 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #d0e8d0;
  max-height: 440px;
  overflow-y: auto;
}
.copy-btn {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-edge);
  padding: 5px 10px;
  border-radius: var(--radius);
  transition: all 0.12s ease;
  white-space: nowrap;
  cursor: pointer;
}
.copy-btn:hover { background: var(--accent); color: var(--bg); }
.copy-btn.copied { background: var(--accent); color: var(--bg); }

.meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 18px;
  font-size: 13.5px;
}
@media (min-width: 560px) { .meta-grid { grid-template-columns: auto 1fr; } }
.meta-grid dt {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  padding-top: 2px;
}
.meta-grid dd { margin: 0; color: var(--text); }
.meta-grid dd .model-pill,
.meta-grid dd .tag {
  margin-right: 4px;
  display: inline-block;
  margin-bottom: 4px;
}

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 18px 36px;
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 13px;
  background: var(--bg-footer);
}
.site-footer .inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--accent); }
.site-footer .cta {
  color: var(--accent);
  border: 1px solid var(--accent-edge);
  padding: 7px 12px;
  border-radius: var(--radius);
  text-decoration: none !important;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: all 0.12s ease;
}
.site-footer .cta:hover { background: var(--accent-soft); }
.footer-copy {
  max-width: 1200px;
  margin: 14px auto 0;
  padding: 12px 18px 0;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.footer-copy a { color: var(--text-faint); }
.footer-copy a:hover { color: var(--accent); }

/* ---- toast ---- */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent);
  color: var(--bg);
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---- scrollbar polish ---- */
.prompt-block pre::-webkit-scrollbar { width: 8px; }
.prompt-block pre::-webkit-scrollbar-track { background: transparent; }
.prompt-block pre::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
.prompt-block pre::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ---- variable slots panel ---- */
.vars-panel {
  margin: 0 0 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.vars-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.vars-panel-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}
.vars-reset {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.vars-reset:hover { text-decoration: underline; }
.vars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}
.var-field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.var-field input,
.var-field select {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 8px;
  box-sizing: border-box;
  transition: border-color 0.12s;
}
.var-field input:focus,
.var-field select:focus { outline: none; border-color: var(--accent); }
.var-field input::placeholder { color: var(--text-faint); }

/* ---- shared: section divider, rating, comments (item detail pages) ---- */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 40px 0 24px; }
.section-divider span {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-faint); white-space: nowrap;
}
.section-divider hr { flex: 1; height: 1px; border: none; background: var(--border); margin: 0; }

.rating-widget { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rating-stars { display: flex; gap: 4px; }
.rating-star {
  font-size: 20px; line-height: 1; cursor: pointer;
  color: var(--border); background: none; border: none; padding: 3px;
  transition: color 80ms;
}
.rating-star.lit { color: var(--accent); }
.rating-count { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }

.comments-section { display: flex; flex-direction: column; gap: 12px; }
.comment-list { display: flex; flex-direction: column; gap: 10px; }
.comment-item {
  background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
}
.comment-meta { font-family: var(--mono); font-size: 9px; color: var(--text-faint); margin-bottom: 5px; }
.comment-body { font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.comment-input-row { display: flex; gap: 8px; }
.comment-input {
  flex: 1; background: var(--bg-1); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 9px 12px;
  font-family: var(--sans); font-size: 13px; color: var(--text);
  outline: none; transition: border-color 120ms;
}
.comment-input:focus { border-color: var(--text-faint); }
.comment-input::placeholder { color: var(--text-faint); }
.comment-submit {
  font-family: var(--mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent); background: var(--accent-soft);
  border: 1px solid var(--accent-edge); border-radius: var(--radius);
  padding: 9px 16px; cursor: pointer; white-space: nowrap;
  transition: background 120ms, color 120ms;
}
.comment-submit:hover { background: var(--accent); color: var(--bg); }
.comments-empty {
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  padding: 16px 0; text-align: center;
}

/* ---- reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
  }
}
