/* Search Lab — shared styles for the builder, keyword reference, and translator.
   Complements styles.css and uses its custom properties, so these pages inherit
   the site's light theme rather than fighting it. */

.lab-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

.lab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.lab-nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 2px solid var(--primary);
  color: var(--primary-dark);
  background: var(--card);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}
.lab-nav a:hover { background: #e6fffb; }
.lab-nav a[aria-current="page"] { background: var(--primary); color: #fff; }

.lab-intro { color: var(--muted); margin: 0 0 1.5rem; line-height: 1.6; }
.lab-intro a { color: var(--primary-dark); }

/* ── Input ───────────────────────────────────────────────────────────────── */

.lab-field { position: relative; }

.lab-input {
  width: 100%;
  box-sizing: border-box;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 1rem;
  line-height: 1.5;
  padding: 0.85rem 2.6rem 0.85rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  resize: vertical;
  min-height: 3.5rem;
}
.lab-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.lab-input.is-valid   { border-color: var(--success); }
.lab-input.is-invalid { border-color: var(--danger); }

.lab-status-icon {
  position: absolute;
  top: 0.9rem;
  right: 0.85rem;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1;
}
.lab-input.is-valid   ~ .lab-status-icon { color: #15803d; }
.lab-input.is-invalid ~ .lab-status-icon { color: var(--danger-dark); }

/* ── Result panels ───────────────────────────────────────────────────────── */

.lab-readout {
  margin-top: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: #f0fdfa;
  border-left: 4px solid var(--primary);
  line-height: 1.6;
}
.lab-readout--error { border-left-color: var(--danger); background: #fef2f2; }

.lab-readout-label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.lab-readout-body { color: var(--ink); font-weight: 600; }

/* The offending fragment of an invalid string, so the error is locatable. */
.lab-error-context {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0.5rem 0 0;
  color: var(--ink);
}
.lab-error-context mark {
  background: var(--danger);
  color: #fff;
  border-radius: 2px;
  padding: 0 2px;
}

.lab-meta { margin-top: 0.6rem; font-size: 0.85rem; color: var(--muted); }
.lab-meta.is-over { color: var(--danger-dark); font-weight: 700; }

/* ── Actions ─────────────────────────────────────────────────────────────── */

.lab-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; align-items: center; }

.lab-btn {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  display: inline-block;
}
.lab-btn:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); }
.lab-btn:disabled { opacity: .45; cursor: not-allowed; }
.lab-btn--ghost { background: var(--card); color: var(--primary-dark); }
.lab-btn--ghost:hover:not(:disabled) { background: #e6fffb; }

/* ── Examples ────────────────────────────────────────────────────────────── */

.lab-examples { margin-top: 1.75rem; }
.lab-examples h2 { font-size: 1rem; margin: 0 0 .6rem; color: var(--ink); }
.lab-example-list { display: flex; flex-wrap: wrap; gap: .5rem; }
.lab-example {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: .85rem;
  padding: .4rem .7rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
}
.lab-example:hover { border-color: var(--primary); color: var(--primary-dark); }

/* ── Premium funnel card ─────────────────────────────────────────────────── */

.lab-premium {
  margin-top: 2rem;
  padding: 1.15rem 1.3rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
}
.lab-premium h2 { margin: 0 0 .45rem; font-size: 1.05rem; color: #fff; }
.lab-premium p { margin: 0 0 .9rem; color: #ccfbf1; line-height: 1.55; }
.lab-premium .lab-btn { background: #fff; color: var(--primary-dark); border-color: #fff; }
.lab-premium .lab-btn:hover { background: #e6fffb; border-color: #e6fffb; }
.lab-premium .lab-btn--ghost { background: transparent; color: #fff; border-color: #fff; }
.lab-premium .lab-btn--ghost:hover { background: rgba(255,255,255,.15); }

/* ── Reference table ─────────────────────────────────────────────────────── */

.lab-controls {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  margin-bottom: 1.25rem;
}
.lab-search, .lab-select {
  font: inherit;
  padding: .55rem .7rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.lab-search { flex: 1 1 14rem; }
.lab-search:focus, .lab-select:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }

.lab-group { margin-bottom: 1.75rem; }
.lab-group h2 {
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 .5rem; padding-bottom: .35rem;
  border-bottom: 2px solid var(--line);
}

/* Single term column plus the expand toggle — the language switcher decides which
   language that column shows, so there is no permanent English column. */
.kw-row {
  display: grid;
  grid-template-columns: 1fr 2.5rem;
  gap: .75rem;
  align-items: center;
  padding: .6rem .4rem;
  border-bottom: 1px solid var(--line);
}
.kw-row:hover { background: #f0fdfa; }
.kw-term {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--primary-dark);
  font-weight: 600;
  word-break: break-word;
}
.kw-local { color: var(--ink); word-break: break-word; }
.kw-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1rem; padding: .25rem;
}
.kw-toggle:hover { color: var(--primary-dark); }

.kw-all {
  padding: .8rem .7rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.kw-all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: .45rem .9rem;
}
.kw-all-item { font-size: .88rem; color: var(--ink); }
.kw-all-code {
  color: var(--muted); font-size: .72rem; text-transform: uppercase;
  margin-right: .4rem; font-weight: 700;
}

.lab-empty { color: var(--muted); padding: 1.5rem 0; }

/* ── Translator ──────────────────────────────────────────────────────────── */

.tr-langs { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.tr-lang-field { display: flex; flex-direction: column; gap: .3rem; }
.tr-lang-field label {
  font-size: .72rem; letter-spacing: .09em; text-transform: uppercase;
  font-weight: 800; color: var(--muted);
}
.tr-swap {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius-sm);
  color: var(--primary-dark); cursor: pointer; padding: .5rem .75rem; font-size: 1rem;
}
.tr-swap:hover { background: #e6fffb; border-color: var(--primary); }

.tr-output {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 1rem;
  padding: .6rem .1rem 0;
  color: var(--ink);
  min-height: 1.6rem;
  white-space: pre-wrap;
  word-break: break-all;
  font-weight: 600;
}

.tr-warn {
  margin-top: .75rem;
  padding: .7rem .95rem;
  border-radius: var(--radius-sm);
  background: var(--warning-light);
  border-left: 4px solid var(--warning-border);
  color: #7c4a03;
  font-size: .9rem;
  line-height: 1.5;
}

/* ── Downloads ───────────────────────────────────────────────────────────── */

.lab-downloads { margin-top: 2.25rem; }
.lab-downloads h2 { font-size: 1rem; color: var(--ink); margin: 0 0 .5rem; }
.lab-dl-list { list-style: none; padding: 0; margin: 0; }
.lab-dl-list li { padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.lab-dl-list a { color: var(--primary-dark); font-weight: 700; }
.lab-dl-note { color: var(--muted); font-size: .85rem; margin-top: .85rem; line-height: 1.6; }
.lab-dl-note a { color: var(--primary-dark); }

@media (max-width: 560px) {
  .kw-row { grid-template-columns: 1fr 2rem; gap: .5rem; font-size: .92rem; }
  .lab-main { padding: 1rem .75rem 2.5rem; }
}

/* ── Term autocomplete ───────────────────────────────────────────────────── */

.lab-ac {
  position: absolute;
  z-index: 40;
  left: 0;
  right: 0;
  top: 100%;
  margin: .25rem 0 0;
  padding: 0;
  list-style: none;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-drop);
}

.lab-ac-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: .75rem;
  padding: .5rem .7rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.lab-ac-item:last-child { border-bottom: none; }
.lab-ac-item:hover,
.lab-ac-item.is-active { background: #f0fdfa; }

.lab-ac-term {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  color: var(--primary-dark);
  font-weight: 600;
  word-break: break-word;
}

.lab-ac-kind {
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Header language switcher ────────────────────────────────────────────── */

.site-header { position: relative; }






@media (max-width: 560px) {
}
