/* ============================================================
   TRISKEL PROMPT TOOL — main.css
   Direction : celtique modernisé · OKLCH · Fraunces + Inter
   Light = parchemin/pierre · Dark = anthracite cuivré
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght,SOFT@9..144,400..800,30..100&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  /* Couleurs (DARK par défaut — atelier nocturne) */
  --bg:           oklch(15% 0.012 60);     /* pierre profonde tintée chaud */
  --bg-glow:      oklch(17% 0.018 55);     /* halo subtil */
  --surface:      oklch(20% 0.012 60);     /* surface plate */
  --surface-2:    oklch(24% 0.015 60);     /* surface élevée */
  --surface-3:    oklch(28% 0.018 60);     /* surface très élevée */
  --line:         oklch(32% 0.015 60);     /* trait standard */
  --line-strong:  oklch(42% 0.020 60);     /* trait emphasé */

  --ink:          oklch(94% 0.010 75);     /* corps de texte */
  --ink-soft:     oklch(72% 0.015 70);     /* texte secondaire */
  --ink-muted:    oklch(55% 0.015 65);     /* texte discret */

  --copper:       oklch(70% 0.135 55);     /* cuivre patiné — accent principal */
  --copper-glow:  oklch(78% 0.150 55);     /* cuivre lumineux — hover */
  --copper-mute:  oklch(70% 0.135 55 / 0.14);  /* cuivre tint — fond léger */
  --moss:         oklch(62% 0.085 145);    /* vert mousse — accent secondaire */
  --moss-mute:    oklch(62% 0.085 145 / 0.14);

  --rust:         oklch(58% 0.150 30);     /* rouge oxydé — erreur */
  --gold:         oklch(78% 0.130 85);     /* or pâle — warning */
  --jade:         oklch(72% 0.115 165);    /* jade — succès */

  /* Identité famille (réutilisée par index.php) */
  --fam-communication: oklch(68% 0.130 240);
  --fam-content:       oklch(68% 0.115 165);
  --fam-analysis:      oklch(70% 0.110 220);
  --fam-advice:        oklch(74% 0.135 65);
  --fam-tech:          oklch(68% 0.140 295);
  --fam-media:         oklch(70% 0.140 340);

  /* Géométrie */
  --radius-xs: 4px;
  --radius-s:  6px;
  --radius:    10px;
  --radius-l:  14px;
  --radius-xl: 20px;

  /* Rythme d'espacement (fibo-ish) */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 28px;
  --s-7: 40px;
  --s-8: 64px;
  --s-9: 96px;

  /* Ombres — chaleureuses, pas génériques */
  --shadow-s: 0 1px 2px oklch(0% 0 0 / .35);
  --shadow:   0 8px 32px oklch(0% 0 0 / .42), 0 2px 8px oklch(0% 0 0 / .32);
  --shadow-l: 0 24px 64px oklch(0% 0 0 / .48);

  /* Mouvement */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);              /* ease-out-quart */
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --t-fast: 140ms;
  --t-base: 220ms;
  --t-slow: 380ms;

  /* Typo */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono:    "JetBrains Mono", "SF Mono", Consolas, monospace;
}

/* Light mode — parchemin / pierre claire */
[data-theme="light"] {
  --bg:          oklch(96% 0.008 80);
  --bg-glow:     oklch(94% 0.012 75);
  --surface:     oklch(99% 0.005 80);
  --surface-2:   oklch(96% 0.008 80);
  --surface-3:   oklch(93% 0.010 80);
  --line:        oklch(86% 0.012 75);
  --line-strong: oklch(72% 0.018 70);

  --ink:         oklch(22% 0.018 60);
  --ink-soft:    oklch(42% 0.018 60);
  --ink-muted:   oklch(58% 0.015 60);

  --copper:      oklch(52% 0.140 50);
  --copper-glow: oklch(46% 0.150 45);
  --copper-mute: oklch(52% 0.140 50 / 0.10);
  --moss:        oklch(40% 0.090 145);
  --moss-mute:   oklch(40% 0.090 145 / 0.10);

  --shadow-s: 0 1px 2px oklch(30% 0.02 60 / .12);
  --shadow:   0 8px 28px oklch(30% 0.02 60 / .14), 0 2px 6px oklch(30% 0.02 60 / .08);
  --shadow-l: 0 24px 56px oklch(30% 0.02 60 / .18);
}

/* ── Reset / base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(ellipse 1100px 600px at 12% -10%, var(--bg-glow), transparent 70%),
    radial-gradient(ellipse 900px 500px at 100% 110%, var(--copper-mute), transparent 75%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv11";
  transition: background-color var(--t-base) var(--ease-out), color var(--t-base) var(--ease-out);
}

a { color: var(--copper); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--copper-glow); }

::selection { background: var(--copper-mute); color: var(--ink); }

/* ── Typo display ─────────────────────────────────────────── */
.t-display {
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "opsz" 144, "SOFT" 50;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.t-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ── Layout ───────────────────────────────────────────────── */
.shell { max-width: 1240px; margin: 0 auto; padding: 0 var(--s-5); }
@media (max-width: 720px) { .shell { padding: 0 var(--s-4); } }

/* ── Top Nav ──────────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
}
.topnav-inner {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: 64px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 var(--s-5);
}
@media (max-width: 720px) {
  .topnav-inner { padding: 0 var(--s-4); height: 58px; }
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 30, "SOFT" 30;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
  transition: color var(--t-fast) var(--ease-out);
}
.nav-brand .triskel-mark {
  width: 28px; height: 28px;
  color: var(--copper);
  transition: color var(--t-base) var(--ease-out), transform var(--t-slow) var(--ease-out);
  display: block;
}
.nav-brand:hover .triskel-mark {
  color: var(--copper-glow);
  transform: rotate(60deg);
}
.nav-brand-name { display: inline-flex; align-items: baseline; gap: 8px; }
.nav-brand-mark-text { color: var(--copper); }
.nav-brand-suffix {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-left: 1px solid var(--line);
  padding-left: 10px;
}
@media (max-width: 600px) {
  .nav-brand-suffix { display: none; }
}

.nav-breadcrumb {
  display: flex; align-items: center; gap: var(--s-2);
  color: var(--ink-soft); font-size: 13px;
  flex: 1; min-width: 0;
}
.nav-breadcrumb .sep { color: var(--ink-muted); }
.nav-breadcrumb .current {
  color: var(--ink); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-actions {
  display: flex; align-items: center; gap: var(--s-2);
  margin-left: auto;
}

.nav-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-out);
}
.nav-pill:hover {
  border-color: var(--copper);
  color: var(--ink);
  background: var(--surface-2);
}
.nav-pill .nav-pill-badge {
  background: var(--copper);
  color: oklch(98% 0.005 80);
  font-weight: 700;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  line-height: 1.5;
}

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: all var(--t-fast) var(--ease-out);
}
.theme-toggle:hover {
  border-color: var(--copper);
  color: var(--copper);
  transform: rotate(20deg);
}

/* ── Hero (accueil) ───────────────────────────────────────── */
.hero {
  padding: var(--s-9) var(--s-5) var(--s-7);
  text-align: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute; left: 50%; top: 32px;
  width: 1px; height: 36px;
  background: linear-gradient(to bottom, transparent, var(--copper), transparent);
  opacity: .65;
  transform: translateX(-50%);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.hero-eyebrow::before, .hero-eyebrow::after {
  content: "";
  width: 24px; height: 1px;
  background: var(--line-strong);
}
.hero h1 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 60;
  font-weight: 500;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0 0 var(--s-4) 0;
}
.hero h1 em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 100;
  color: var(--copper);
}
.hero p {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Hero compact — utilisé sur l'accueil sous la search bar */
.hero.hero-mini {
  padding: var(--s-3) var(--s-5) var(--s-4);
}
.hero.hero-mini::before { display: none; }
.hero-title-mini {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50;
  font-weight: 500;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  margin: 0;
  display: inline-block;
}
.hero-title-mini em {
  font-style: italic;
  font-variation-settings: "opsz" 60, "SOFT" 90;
  color: var(--copper);
  font-weight: 500;
}
.hero-tagline {
  color: var(--ink-muted);
  font-size: 0.85rem;
  max-width: 620px;
  margin: 4px auto 0;
  line-height: 1.5;
}

/* ── Search bar ───────────────────────────────────────────── */
.search-bar-wrap {
  max-width: 720px;
  margin: var(--s-5) auto var(--s-3);
  padding: 0 var(--s-5);
}
.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 4px 4px 4px var(--s-5);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.search-bar:focus-within {
  border-color: var(--copper);
  box-shadow: 0 0 0 4px var(--copper-mute);
}
.search-bar svg.search-icon {
  width: 18px; height: 18px; color: var(--ink-muted);
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 12px;
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink);
  outline: none;
}
.search-bar input::placeholder { color: var(--ink-muted); }
.search-kbd {
  display: inline-flex; align-items: center; justify-content: center;
  height: 26px; min-width: 26px; padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface-2);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  margin-right: 6px;
  pointer-events: none;
}
.search-clear {
  display: none;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--surface-2);
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  align-items: center; justify-content: center;
  margin-right: 4px;
}
.search-clear:hover { color: var(--copper); }
.search-bar.has-value .search-clear { display: inline-flex; }
.search-bar.has-value .search-kbd { display: none; }

.filter-chips {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  max-width: 1100px;
  margin: 0 auto var(--s-3);
  padding: 0 var(--s-5);
  justify-content: center;
}
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.filter-chip:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}
.filter-chip[aria-pressed="true"] {
  border-color: var(--copper);
  background: var(--copper-mute);
  color: var(--copper-glow);
}
.filter-chip-dot {
  width: 8px; height: 8px;
  border-radius: 999px;
  background: currentColor;
  opacity: .85;
}

/* ── Families layout ──────────────────────────────────────── */
.families {
  max-width: 1240px;
  margin: var(--s-4) auto var(--s-9);
  padding: 0 var(--s-5);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s-4);
}

.family {
  --fam-color: var(--copper);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--s-5) var(--s-5) var(--s-4);
  position: relative;
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}
.family::before {
  content: "";
  position: absolute; top: 0; left: var(--s-5); right: var(--s-5);
  height: 2px;
  background: var(--fam-color);
  border-radius: 0 0 2px 2px;
  opacity: .85;
}
.family:hover {
  border-color: var(--line-strong);
}

.family[data-family="communication"] { --fam-color: var(--fam-communication); }
.family[data-family="content"]       { --fam-color: var(--fam-content); }
.family[data-family="analysis"]      { --fam-color: var(--fam-analysis); }
.family[data-family="advice"]        { --fam-color: var(--fam-advice); }
.family[data-family="tech"]          { --fam-color: var(--fam-tech); }
.family[data-family="media"]         { --fam-color: var(--fam-media); }

.family-head {
  display: flex; align-items: baseline; gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s-3);
}
.family-name {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 50;
  font-weight: 500;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}
.family-icon {
  font-size: 1.1rem;
  filter: saturate(0.85);
}
.family-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tools-list { list-style: none; margin: 0; padding: 0; }
.tool-item {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: 10px 0;
  border-bottom: 1px dashed transparent;
}
.tool-item + .tool-item { border-top: 1px solid color-mix(in oklch, var(--line) 60%, transparent); }
.tool-link {
  display: flex; align-items: center; gap: var(--s-3);
  flex: 1;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  min-width: 0;
  transition: color var(--t-fast) var(--ease-out);
}
.tool-link:hover { color: var(--copper); }
.tool-emoji {
  width: 22px;
  text-align: center;
  font-size: 14px;
  filter: saturate(0.9);
  flex-shrink: 0;
}
.tool-name {
  flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-new {
  background: var(--copper-mute);
  color: var(--copper-glow);
  border: 1px solid color-mix(in oklch, var(--copper) 35%, transparent);
}
.badge-wip {
  background: oklch(from var(--gold) l c h / 0.16);
  color: var(--gold);
  border: 1px solid oklch(from var(--gold) l c h / 0.30);
}
.badge-en {
  background: var(--moss-mute);
  color: var(--moss);
  border: 1px solid color-mix(in oklch, var(--moss) 35%, transparent);
}
.tool-disabled .tool-name { color: var(--ink-muted); }
.tool-disabled .tool-emoji { opacity: .5; }

.no-results {
  text-align: center;
  padding: var(--s-8) var(--s-5);
  color: var(--ink-muted);
  font-size: 14px;
  display: none;
}
.no-results-emoji { font-size: 2.5rem; margin-bottom: var(--s-3); opacity: .55; }

/* ── Tool banner ──────────────────────────────────────────── */
.tool-banner {
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 600px 200px at 12% 0%, var(--copper-mute), transparent 65%),
    var(--surface);
  padding: var(--s-6) var(--s-5);
}
.tool-banner-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--s-5);
}
.tool-banner-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
}
.tool-banner-text { flex: 1; min-width: 0; }
.tool-banner-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 100, "SOFT" 50;
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.15;
}
.tool-banner-desc {
  color: var(--ink-soft);
  font-size: 14px;
  margin-top: 4px;
  line-height: 1.5;
}
.tool-banner-family {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
@media (max-width: 720px) {
  .tool-banner-family { display: none; }
}

/* ── Tool page layout ─────────────────────────────────────── */
.tool-page {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s-5);
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--s-5) var(--s-5) var(--s-8);
}
@media (max-width: 980px) {
  .tool-page { grid-template-columns: 1fr; }
}

.panel-head {
  display: flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.panel-eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
}
.panel-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Form card ────────────────────────────────────────────── */
.form-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--s-5);
}

/* Sections collapsibles */
.field-section {
  border-top: 1px solid var(--line);
  padding-top: var(--s-4);
  margin-top: var(--s-4);
}
.field-section:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}
.field-section-toggle {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  width: 100%;
  background: transparent;
  border: none;
  padding: 0;
  margin-bottom: var(--s-3);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  letter-spacing: -0.005em;
}
.field-section-toggle:hover { color: var(--copper); }
.field-section-toggle .chev {
  width: 14px; height: 14px;
  color: var(--ink-muted);
  transition: transform var(--t-fast) var(--ease-out);
  flex-shrink: 0;
}
.field-section[data-collapsed="true"] .chev { transform: rotate(-90deg); }
.field-section-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: var(--radius-s);
  background: var(--copper-mute);
  color: var(--copper-glow);
  font-size: 12px;
  flex-shrink: 0;
}
.field-section-desc {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
  margin-left: auto;
  text-transform: none;
  letter-spacing: 0;
}
.field-section-body { display: block; }
.field-section[data-collapsed="true"] .field-section-body { display: none; }

/* ── Form groups ──────────────────────────────────────────── */
.form-group { margin-bottom: var(--s-4); }
.form-group:last-of-type { margin-bottom: 0; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.form-group .field-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: -2px;
  margin-bottom: 6px;
  line-height: 1.45;
}
.form-group .required-star { color: var(--rust); margin-left: 3px; }

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder { color: var(--ink-muted); }
.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 3px var(--copper-mute);
}

.form-group textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
  font-family: var(--font-body);
}
.form-group textarea.tall  { min-height: 160px; }
.form-group textarea.short { min-height: 70px; }

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2398907a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
.form-group select[multiple] {
  appearance: auto;
  background-image: none;
  height: auto;
  min-height: 110px;
  padding: 6px;
}
.form-group select[multiple] option {
  padding: 6px 10px;
  border-radius: 4px;
  margin-bottom: 1px;
}
.form-group select[multiple] option:checked {
  background: var(--copper);
  color: oklch(98% 0.005 80);
}
.multiselect-hint {
  font-size: 11px; color: var(--ink-muted); margin-top: 6px;
  font-style: italic;
}

/* Radio chips */
.radio-group { display: flex; flex-wrap: wrap; gap: 6px; }
.radio-option { display: none; }
.radio-label {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.radio-label:hover { color: var(--ink); border-color: var(--line-strong); }
.radio-option:checked + .radio-label {
  border-color: var(--copper);
  background: var(--copper-mute);
  color: var(--copper-glow);
  font-weight: 500;
}

/* Checkbox unique */
.checkbox-label {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}
.checkbox-label input {
  width: 16px; height: 16px;
  accent-color: var(--copper);
  cursor: pointer;
}

/* Chips (textarea_with_chips) */
.chips-container { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--t-fast) var(--ease-out);
}
.chip:hover {
  border-color: var(--copper);
  color: var(--copper);
  background: var(--copper-mute);
}
.chip.active {
  border-color: var(--copper);
  background: var(--copper-mute);
  color: var(--copper-glow);
  font-weight: 500;
}

/* Checkbox group */
.checkbox-group-container { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.checkbox-group-item {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}
.checkbox-group-item:hover { border-color: var(--line-strong); color: var(--ink); }
.checkbox-group-item:has(input:checked) {
  border-color: var(--copper);
  background: var(--copper-mute);
  color: var(--copper-glow);
}
.checkbox-group-item input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--copper);
  cursor: pointer;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--copper);
  color: oklch(98% 0.005 80);
  border-color: var(--copper);
  box-shadow: 0 1px 2px oklch(0% 0 0 / .25);
}
.btn-primary:hover {
  background: var(--copper-glow);
  border-color: var(--copper-glow);
  color: oklch(99% 0.005 80);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--ink);
  border-color: var(--line);
}
.btn-secondary:hover {
  border-color: var(--copper);
  color: var(--copper);
}
.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.form-actions {
  position: sticky;
  bottom: 0;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
  background: linear-gradient(to top, var(--surface) 70%, transparent);
}
.form-actions .btn-primary { flex: 1; justify-content: center; padding: 12px 20px; }
.form-saved-indicator {
  display: none;
  align-items: center; gap: 6px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-muted);
  font-style: italic;
}
.form-saved-indicator.is-active { display: inline-flex; }

/* Keyboard hint inline */
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; min-width: 18px;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: color-mix(in oklch, var(--surface-2) 70%, transparent);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  margin: 0 2px;
}

/* ── Output panel ─────────────────────────────────────────── */
.output-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  overflow: hidden;
}
.output-card.has-result {
  border-color: color-mix(in oklch, var(--copper) 38%, var(--line));
}
.output-card-header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in oklch, var(--surface-2) 60%, transparent);
}
.output-status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--ink-soft);
  flex: 1;
}
.output-status-dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--ink-muted);
}
.output-card.has-result .output-status-dot {
  background: var(--jade);
  box-shadow: 0 0 0 4px oklch(from var(--jade) l c h / 0.18);
}
.output-card.has-result .output-status { color: var(--ink); }
.output-actions { display: flex; gap: 6px; }

.output-body {
  flex: 1;
  padding: var(--s-5);
  display: flex; flex-direction: column;
}
.output-empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1;
  min-height: 200px;
  color: var(--ink-muted);
  text-align: center;
  gap: var(--s-3);
}
.output-empty-mark {
  width: 56px; height: 56px;
  color: color-mix(in oklch, var(--copper) 55%, var(--ink-muted));
  opacity: .55;
  animation: drift 8s var(--ease-out) infinite alternate;
}
@keyframes drift {
  from { transform: rotate(-6deg); opacity: .42; }
  to   { transform: rotate(6deg);  opacity: .60; }
}
.output-empty p {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 60, "SOFT" 80;
  font-style: italic;
  font-size: 1rem;
  margin: 0;
  color: var(--ink-muted);
  max-width: 280px;
  line-height: 1.5;
}
.output-empty p strong {
  font-style: normal;
  font-variation-settings: "opsz" 60, "SOFT" 50;
  color: var(--ink-soft);
}

.output-prompt {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s-5);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 540px;
  overflow-y: auto;
  flex: 1;
}

/* ── Tips card ────────────────────────────────────────────── */
.tips-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: var(--s-5);
}
.tips-card h4 {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-muted);
  margin: 0 0 var(--s-3);
}
.tip {
  display: flex; gap: 10px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  border-top: 1px solid var(--line);
}
.tip:first-of-type { border-top: none; padding-top: 0; }
.tip-icon { flex-shrink: 0; line-height: 1.4; }

.tips-card.is-warn {
  border-color: color-mix(in oklch, var(--gold) 30%, var(--line));
  background: color-mix(in oklch, var(--gold) 6%, var(--surface));
}
.tips-card.is-warn h4 { color: var(--gold); }

/* ── Toast ────────────────────────────────────────────────── */
#toast {
  position: fixed;
  left: 50%;
  bottom: var(--s-5);
  transform: translateX(-50%) translateY(8px);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: all var(--t-base) var(--ease-out);
  pointer-events: none;
  z-index: 999;
  display: inline-flex; align-items: center; gap: 8px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.is-error { border-color: var(--rust); color: var(--rust); }
#toast.is-success { border-color: var(--jade); color: var(--ink); }
#toast::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--jade);
  box-shadow: 0 0 0 3px oklch(from var(--jade) l c h / 0.18);
}
#toast.is-error::before { background: var(--rust); box-shadow: 0 0 0 3px oklch(from var(--rust) l c h / 0.18); }

/* ── WIP state ────────────────────────────────────────────── */
.wip-state {
  text-align: center;
  padding: var(--s-9) var(--s-5);
  color: var(--ink-soft);
  max-width: 520px;
  margin: 0 auto;
}
.wip-state .wip-icon { font-size: 3rem; margin-bottom: var(--s-4); opacity: .65; }
.wip-state h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 100, "SOFT" 60;
  font-weight: 500;
  font-size: 1.6rem;
  margin: 0 0 var(--s-2);
  color: var(--ink);
}

/* ── Footer ───────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: var(--s-8);
  padding: var(--s-6) var(--s-5);
  background: color-mix(in oklch, var(--surface) 50%, transparent);
}
.site-footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4);
  font-size: 12px;
  color: var(--ink-muted);
}
.site-footer-mark {
  width: 18px; height: 18px;
  color: var(--copper);
}
.site-footer-shortcuts {
  margin-left: auto;
  display: inline-flex; gap: var(--s-4);
  flex-wrap: wrap;
}
.site-footer-shortcut {
  display: inline-flex; align-items: center; gap: 6px;
}
@media (max-width: 600px) {
  .site-footer-shortcuts { width: 100%; margin-left: 0; }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--ink-muted); }

/* ── Reduced motion ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .output-empty-mark { animation: none; }
}

/* ── Focus visible (keyboard a11y) ────────────────────────── */
:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 2px;
  border-radius: 3px;
}
.btn:focus-visible, .nav-pill:focus-visible, .theme-toggle:focus-visible,
.filter-chip:focus-visible, .chip:focus-visible {
  outline-offset: 3px;
}
