:root {
  --paper: #edf2ee;
  --paper-2: #fbfcf8;
  --paper-3: #ffffff;
  --ink: #0f0d0a;
  --ink-2: #1d1814;
  --muted: #4f5a52;
  --hairline: #c8d2c9;
  --line: #1d1814;
  --cobalt: #1f3fd6;
  --cobalt-soft: #dee3ff;
  --tomato: #e23a23;
  --tomato-soft: #ffd9d0;
  --emerald: #0f6e62;
  --emerald-soft: #d3eee7;
  --plum: #5d3878;
  --plum-soft: #ebdef3;
  --gold: #f1bf3a;
  --gold-soft: #fdebb5;
  --shadow-card: 4px 4px 0 var(--ink);
  --shadow-card-sm: 2px 2px 0 var(--ink);
  --radius: 4px;
  --radius-lg: 8px;
  --mono:
    ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
  --sans:
    "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  line-height: 1.5;
}

button,
textarea,
select,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

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

a:focus-visible,
button:focus-visible,
textarea:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* ----------- Topbar ----------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 60px;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(14px, 3vw, 40px);
  border-bottom: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper-2);
}

.brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--paper-2);
  font-weight: 900;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.brand small {
  display: inline-flex;
  align-items: center;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 250, 240, 0.22);
  color: #c8bda7;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  justify-content: flex-end;
}

.topnav::-webkit-scrollbar {
  display: none;
}

.topnav a {
  display: inline-flex;
  min-height: 36px;
  flex: 0 0 auto;
  align-items: center;
  border-radius: var(--radius);
  padding: 0 12px;
  color: #c8bda7;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.topnav a:hover {
  background: rgba(255, 250, 240, 0.08);
  color: #ffffff;
}

.topnav .topnav-cta {
  margin-left: 8px;
  border: 1.5px solid var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.topnav .topnav-cta:hover {
  background: #ffd35b;
  color: var(--ink);
}

main {
  padding: 18px clamp(12px, 3vw, 40px) 56px;
}

#terms,
#prompt,
#search {
  scroll-margin-top: 86px;
}

/* ----------- Hero strip ----------- */
.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: uppercase;
}

.crumb .crumb-dot {
  display: inline-grid;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tomato);
  box-shadow: 0 0 0 3px var(--tomato-soft);
}

.workbench {
  width: min(1560px, 100%);
  margin: 0 auto;
}

.desk-brief {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 0;
  margin-bottom: 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper-2);
  overflow: hidden;
}

.brief-copy {
  min-width: 0;
  padding: clamp(20px, 2.6vw, 30px) clamp(20px, 2.6vw, 32px) clamp(18px, 2.4vw, 26px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 4px 8px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--ink);
  font-size: 56px;
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

h1 em {
  font-style: normal;
  background: linear-gradient(180deg, transparent 62%, var(--gold) 62%, var(--gold) 92%, transparent 92%);
  padding: 0 4px;
}

.subhead {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 16.5px;
  line-height: 1.5;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--hairline);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.hero-meta strong {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brief-board {
  display: grid;
  grid-template-rows: auto 1fr;
  border-left: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper-2);
}

.brief-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 250, 240, 0.16);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #d9cebd;
}

.brief-board-head span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold);
}

.brief-board-head span:last-child::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.board-list {
  display: grid;
  align-content: center;
  gap: 0;
  padding: 4px 0;
}

.board-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.05fr);
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.board-row + .board-row {
  border-top: 1px dashed rgba(255, 250, 240, 0.14);
}

.board-row .arrow {
  font-family: var(--mono);
  color: var(--tomato);
  font-weight: 800;
}

.board-row span:first-child {
  color: #b9ad95;
  font-size: 13px;
}

.board-row strong {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

/* ----------- Workspace ----------- */
.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(380px, 1.35fr) minmax(290px, 0.85fr);
  align-items: stretch;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  overflow: hidden;
}

.query-panel,
.results-panel,
.prompt-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.query-panel {
  padding: 18px;
  background: var(--ink);
  color: var(--paper-2);
}

.results-panel {
  padding: 18px 16px 18px;
  border-left: 1.5px solid var(--ink);
  border-right: 1.5px solid var(--ink);
  background: var(--paper-2);
}

.prompt-panel {
  padding: 18px;
  background: #f6f8f1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.16);
}

.query-panel .panel-heading {
  border-bottom-color: rgba(255, 250, 240, 0.2);
}

.panel-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel-title strong {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.match-count,
.sort-note {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.query-panel .match-count {
  color: #d9cebd;
}

.field-label,
legend {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.query-panel .field-label,
.query-panel legend {
  color: #c4b89f;
}

textarea,
select,
input {
  width: 100%;
  min-width: 0;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  color: var(--ink);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

textarea {
  min-height: 156px;
  padding: 14px;
  resize: vertical;
  line-height: 1.5;
  font-size: 15px;
}

textarea:focus,
select:focus,
input:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px var(--cobalt-soft);
}

select {
  height: 42px;
  padding: 0 12px;
}

input {
  min-height: 42px;
  padding: 0 12px;
}

.examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.examples-label {
  display: block;
  width: 100%;
  margin-bottom: 2px;
  color: #c4b89f;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.filters {
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.segment-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ----------- Buttons ----------- */
.domain-button,
.ghost-button,
.secondary-button,
.primary-button,
.icon-button,
.feedback-button,
.add-button,
.primary-link,
.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  border-radius: var(--radius);
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
  transition: transform 120ms ease, background-color 120ms ease,
    border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.domain-button,
.ghost-button,
.secondary-button,
.feedback-button,
.secondary-link {
  border: 1.5px solid var(--ink);
  background: var(--paper-3);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
}

.query-panel .domain-button,
.query-panel .ghost-button,
.query-panel .secondary-button {
  border-color: rgba(255, 250, 240, 0.24);
  background: #221c16;
  color: var(--paper-2);
}

.query-panel .domain-button:hover,
.query-panel .ghost-button:hover,
.query-panel .secondary-button:hover {
  border-color: var(--gold);
  background: #2c2418;
  color: var(--gold);
}

.domain-button {
  min-width: 72px;
  padding: 0 11px;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.domain-button[aria-pressed="true"] {
  border-color: var(--gold) !important;
  background: var(--gold) !important;
  color: var(--ink) !important;
}

.ghost-button {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.primary-button,
.primary-link,
.add-button {
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper-2);
  padding: 0 14px;
  font-size: 13px;
}

.query-panel .primary-button {
  border-color: var(--gold);
  background: var(--gold);
  color: var(--ink);
}

.primary-button:hover,
.primary-link:hover,
.add-button:hover {
  background: var(--cobalt);
  border-color: var(--cobalt);
  color: #ffffff;
  transform: translateY(-1px);
}

.query-panel .primary-button:hover {
  background: #ffd35b;
  border-color: #ffd35b;
  color: var(--ink);
  transform: translateY(-1px);
}

.secondary-button:hover,
.ghost-button:hover,
.secondary-link:hover,
.icon-button:hover {
  border-color: var(--cobalt);
  background: var(--cobalt-soft);
  color: var(--ink);
}

.feedback-button:hover {
  border-color: var(--emerald);
  background: var(--emerald-soft);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 1.5px solid var(--ink);
  background: var(--paper-3);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.actions .primary-button {
  flex: 1 1 180px;
}

/* ----------- Results: lenses, summary, top keywords ----------- */
.intent-lenses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.intent-lenses:empty {
  display: none;
}

.lens {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--paper-3);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lens::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cobalt);
}

.translation-summary {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--cobalt);
  border-radius: var(--radius);
  background: var(--cobalt-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.translation-summary:empty {
  display: none;
}

.translation-summary strong {
  font-family: var(--mono);
  font-weight: 800;
}

.top-keywords {
  display: none;
  margin-bottom: 14px;
  padding: 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  box-shadow: var(--shadow-card-sm);
}

.top-keywords.is-visible {
  display: grid;
  gap: 10px;
}

.top-keyword-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.top-keyword-header strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--ink);
}

.top-keyword-header strong::before {
  content: "★";
  color: var(--tomato);
}

.top-keyword-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.keyword-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--gold-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

/* ----------- Term cards ----------- */
.results-list {
  display: grid;
  gap: 10px;
}

.term-card {
  display: grid;
  gap: 10px;
  padding: 14px 14px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  box-shadow: var(--shadow-card-sm);
  position: relative;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.term-card::before {
  content: "";
  position: absolute;
  left: -1.5px;
  top: -1.5px;
  bottom: -1.5px;
  width: 6px;
  border-radius: var(--radius) 0 0 var(--radius);
  background: var(--muted);
}

.term-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.term-card.is-priority {
  background: #fffdf0;
}

.term-card[data-domain="image"]::before {
  background: var(--cobalt);
}
.term-card[data-domain="systems"]::before {
  background: var(--tomato);
}
.term-card[data-domain="product"]::before {
  background: var(--emerald);
}
.term-card[data-domain="writing"]::before {
  background: var(--plum);
}
.term-card[data-domain="research"]::before {
  background: var(--gold);
}

.term-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.term-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.term-meta span:first-child {
  color: var(--ink);
}

.term-meta span:first-child::before {
  content: "▸ ";
  color: var(--tomato);
}

.term-card h3 {
  font-size: 19px;
  letter-spacing: 0;
}

.fit-score {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 96px;
  padding: 6px 9px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.fit-score[data-fit="strong"] {
  background: var(--emerald);
  color: #ffffff;
  border-color: var(--emerald);
}

.fit-score[data-fit="useful"] {
  background: var(--gold);
}

.fit-score[data-fit="adjacent"] {
  background: var(--paper-2);
  color: var(--muted);
}

.term-card p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.5;
}

.plain-meaning {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-left: 3px solid var(--hairline);
  background: var(--paper-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.plain-meaning strong {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.plain-meaning span {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.45;
}

.matched-because {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--emerald);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.matched-because::before {
  content: "✓";
  font-weight: 900;
}

.field-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.term-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  background: rgba(241, 191, 58, 0.06);
}

.phrase {
  display: block;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.add-button {
  flex: 0 0 auto;
  min-height: 36px;
  font-size: 12px;
  padding: 0 12px;
}

.add-button[aria-pressed="true"] {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.add-button[aria-pressed="true"]::before {
  content: "✓ ";
  font-weight: 900;
}

.term-details {
  border-top: 1px dashed var(--hairline);
  padding-top: 8px;
}

.term-details summary {
  cursor: pointer;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.term-details[open] {
  display: grid;
  gap: 10px;
}

.feedback-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feedback-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.feedback-button[aria-pressed="true"] {
  border-color: var(--emerald);
  background: var(--emerald-soft);
  color: var(--emerald);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

/* ----------- Selected tray ----------- */
.selected-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 40px;
  margin-bottom: 14px;
  padding: 10px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
}

.selected-terms:empty::before {
  content: "Empty prompt — add terms from the middle column.";
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 4px 0 10px;
  border: 1.5px solid var(--emerald);
  border-radius: 999px;
  background: var(--emerald-soft);
  color: var(--emerald);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.selected-chip button {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 110, 98, 0.12);
  color: inherit;
  font-weight: 900;
  font-size: 11px;
  line-height: 1;
}

.selected-chip button:hover {
  background: rgba(15, 110, 98, 0.24);
}

#prompt-output {
  min-height: 224px;
  margin-top: 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}

.copy-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--emerald);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.missing-term {
  margin-top: 14px;
  padding: 14px;
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--gold-soft);
}

.missing-term .field-label {
  color: var(--ink);
}

.missing-term-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.prompt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 14px;
}

.prompt-actions .primary-button,
.prompt-actions .secondary-button {
  width: 100%;
}

/* ----------- Empty state ----------- */
.empty-state {
  display: grid;
  gap: 10px;
  padding: 24px 18px;
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  color: var(--muted);
  line-height: 1.45;
}

.empty-state strong {
  color: var(--ink);
  font-size: 15px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ----------- Marketing sections ----------- */
.content-section,
.proof-section {
  width: min(1180px, 100%);
  margin: 56px auto 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 22px;
}

.section-heading h2 {
  font-size: 38px;
  letter-spacing: 0;
  line-height: 1.05;
}

.section-heading p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.55;
}

.proof-grid,
.pack-grid,
.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.proof-card,
.pack-card,
.faq-grid details,
.step-list li,
.glossary-grid article {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--paper-3);
  padding: 20px;
  box-shadow: var(--shadow-card);
  transition: transform 120ms ease;
}

.proof-card:hover,
.pack-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--ink);
}

/* Proof: before/after */
.proof-card {
  display: grid;
  gap: 10px;
}

.proof-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.proof-tag.before {
  background: var(--tomato-soft);
  border-color: var(--tomato);
  color: var(--tomato);
}

.proof-tag.after {
  background: var(--emerald-soft);
  border-color: var(--emerald);
  color: var(--emerald);
}

.proof-tag.payload {
  background: var(--gold-soft);
  border-color: var(--ink);
}

.proof-card .proof-label {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.proof-card .proof-text {
  margin: 0;
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.5;
}

.proof-card .proof-text.mono {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ----------- Pack cards ----------- */
.pack-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pack-card {
  display: grid;
  gap: 10px;
  padding: 18px 18px 16px;
  position: relative;
}

.pack-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--hairline);
}

.pack-codename {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.pack-codename b {
  color: var(--ink);
}

.pack-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.pack-card[data-pack="image"] .pack-badge {
  background: var(--cobalt);
  color: #fff;
}
.pack-card[data-pack="systems"] .pack-badge {
  background: var(--tomato);
  color: #fff;
}
.pack-card[data-pack="product"] .pack-badge {
  background: var(--emerald);
  color: #fff;
}
.pack-card[data-pack="research"] .pack-badge {
  background: var(--gold);
  color: var(--ink);
}
.pack-card[data-pack="writing"] .pack-badge {
  background: var(--plum);
  color: #fff;
}
.pack-card[data-pack="atlas"] .pack-badge {
  background: var(--ink);
  color: var(--gold);
}

.pack-card h3 {
  font-size: 22px;
  letter-spacing: 0;
}

.pack-card h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 120ms ease;
}

.pack-card h3 a:hover {
  border-bottom-color: var(--ink);
}

.pack-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.5;
}

.pack-card ul {
  display: grid;
  gap: 4px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.pack-card ul li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
}

.pack-card ul li::before {
  content: "↳";
  color: var(--tomato);
  font-weight: 900;
}

.pack-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px dashed var(--hairline);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.pack-card-foot a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid var(--gold);
}

.pack-card-foot a:hover {
  border-bottom-color: var(--cobalt);
  color: var(--cobalt);
}

.pack-card-wide {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  gap: 16px 28px;
  align-items: start;
}

.pack-card-wide .pack-card-head,
.pack-card-wide h3,
.pack-card-wide > p {
  grid-column: 1;
}

.pack-card-wide ul {
  grid-row: 1 / span 3;
  grid-column: 2;
  margin-top: 0;
}

.pack-card-wide .pack-card-foot {
  grid-column: 1 / -1;
}

/* ----------- Steps ----------- */
.step-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-list li {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px 20px;
}

.step-list li > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: var(--muted);
}

.step-list li > span::before {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-2);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  content: attr(data-step);
}

.step-list li p {
  color: var(--ink-2);
}

/* ----------- FAQ ----------- */
.faq-grid details {
  padding: 18px 20px;
}

.faq-grid summary {
  cursor: pointer;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.faq-grid summary::-webkit-details-marker {
  display: none;
}

.faq-grid summary::after {
  content: "+";
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--muted);
}

.faq-grid details[open] summary::after {
  content: "−";
  color: var(--tomato);
}

.faq-grid details[open] {
  background: var(--paper-2);
}

.faq-grid p {
  margin: 10px 0 0;
  color: var(--ink-2);
}

/* ----------- Glossary / term pages ----------- */
.legal-page,
.glossary-page,
.intent-page,
.term-page {
  max-width: 1080px;
}

.legal-page h1,
.glossary-page h1,
.intent-page h1,
.term-page h1 {
  font-size: 54px;
  line-height: 1;
  letter-spacing: 0;
}

.legal-page h2,
.glossary-page h2,
.intent-page h2,
.term-page h2 {
  margin-top: 24px;
  font-size: 26px;
}

.legal-page p,
.glossary-page p,
.intent-page p,
.term-page p {
  color: var(--ink-2);
  line-height: 1.6;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}

.glossary-grid article {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.glossary-grid article h2 {
  font-size: 18px;
  margin-top: 0;
}

.glossary-grid article p {
  margin: 0;
}

.glossary-grid .phrase {
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.index-actions,
.quick-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.quick-jumps {
  margin: 22px 0 32px;
  padding: 12px;
  border: 1.5px dashed var(--hairline);
  border-radius: var(--radius);
  background: var(--paper-2);
}

.quick-jumps a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper-3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.quick-jumps a:hover {
  background: var(--gold);
}

.term-index-group {
  margin-top: 36px;
  scroll-margin-top: 92px;
}

.term-index-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: end;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--ink);
}

.term-index-heading .eyebrow {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.term-index-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.term-index-card {
  display: grid;
  gap: 8px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  padding: 16px;
  box-shadow: var(--shadow-card-sm);
}

.term-index-card h3 {
  font-size: 18px;
}

.term-index-card h3 a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.term-index-card h3 a:hover {
  border-bottom-color: var(--cobalt);
  color: var(--cobalt);
}

.term-index-meta,
.term-index-related {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}

.term-index-related {
  font-size: 12px;
}

.term-index-card .phrase,
.term-index-card p {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-2);
}

.term-index-card .phrase {
  padding: 8px 10px;
  border-left: 3px solid var(--gold);
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 12.5px;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ----------- Intent / Term pages ----------- */
.intent-block {
  margin-top: 30px;
}

.intent-block h2 {
  margin-bottom: 14px;
}

.intent-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.intent-card {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper-3);
  padding: 18px;
  box-shadow: var(--shadow-card-sm);
}

.intent-card h3 {
  margin-bottom: 8px;
}

.intent-card p {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.55;
}

.term-trigger-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.term-trigger-list li {
  padding: 8px 12px;
  border: 1px dashed var(--hairline);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink-2);
}

.term-trigger-list li::before {
  content: "“";
  color: var(--tomato);
  font-weight: 900;
  margin-right: 4px;
}

.term-trigger-list li::after {
  content: "”";
  color: var(--tomato);
  font-weight: 900;
  margin-left: 4px;
}

.term-prompt-box {
  padding: 16px 18px;
  border: 1.5px solid var(--ink);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  background: var(--paper-3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
}

/* ----------- Footer ----------- */
.site-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 56px auto 0;
  padding: 26px clamp(12px, 3vw, 40px);
  border-top: 1.5px solid var(--ink);
  background: var(--ink);
  color: #c8bda7;
}

.site-footer-brand {
  display: grid;
  gap: 4px;
}

.site-footer-brand strong {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--paper-2);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
}

.site-footer-brand strong::before {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 4px;
  background: var(--gold);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  content: "ET";
}

.site-footer-brand p {
  margin: 0;
  color: #b1a78f;
  font-size: 13px;
  line-height: 1.5;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  justify-content: flex-end;
}

.site-footer a {
  color: #d9cebd;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--gold);
}

/* ----------- Responsive ----------- */
@media (max-width: 1200px) {
  .desk-brief,
  .workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-board {
    border-top: 1.5px solid var(--ink);
    border-left: 0;
  }

  .results-panel {
    border: 0;
    border-top: 1.5px solid var(--ink);
    border-bottom: 1.5px solid var(--ink);
  }

  .pack-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
  }

  .topnav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  main {
    padding-top: 8px;
  }

  .desk-brief {
    margin-bottom: 10px;
  }

  .brief-board {
    display: none;
  }

  .brief-copy {
    padding: 14px;
  }

  .brief-copy .crumb {
    display: none;
  }

  .hero-meta {
    display: none;
  }

  h1 {
    max-width: none;
    font-size: 28px;
    line-height: 1.06;
  }

  .subhead {
    margin-top: 10px;
    font-size: 14.5px;
    line-height: 1.42;
  }

  textarea {
    min-height: 124px;
  }

  .query-panel,
  .prompt-panel,
  .results-panel {
    padding: 14px;
  }

  .intent-lenses {
    display: none;
  }

  .top-keywords.is-visible {
    position: sticky;
    top: 140px;
    z-index: 5;
    box-shadow: 0 10px 24px rgba(15, 13, 10, 0.16);
  }

  .proof-grid,
  .pack-grid,
  .step-list,
  .faq-grid,
  .glossary-grid,
  .term-index-grid,
  .intent-card-grid,
  .pack-card-wide {
    grid-template-columns: 1fr;
  }

  .pack-card-wide .pack-card-head,
  .pack-card-wide h3,
  .pack-card-wide > p,
  .pack-card-wide ul,
  .pack-card-wide .pack-card-foot {
    grid-column: auto;
    grid-row: auto;
  }

  .term-index-heading {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding-inline: 12px;
  }

  .brand small {
    display: none;
  }

  main {
    padding-inline: 10px;
  }

  .panel-heading,
  .term-topline,
  .top-keyword-header {
    align-items: stretch;
    flex-direction: column;
  }

  .fit-score {
    align-self: flex-start;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    min-width: 0;
    width: 100%;
  }

  .term-actions {
    grid-template-columns: 1fr;
  }

  .add-button {
    width: 100%;
  }

  .domain-button,
  .ghost-button,
  .secondary-button,
  .primary-button {
    flex: 1 1 auto;
  }

  .prompt-actions,
  .missing-term-row {
    grid-template-columns: 1fr;
  }
}
