/* Toolboxd — "projection booth" design system.
   Dark, poster-forward, referencing Letterboxd's accent trio. Bespoke CSS (no
   framework) for a distinctive, non-templated look. Colour encodes tool
   category: green=Decide, blue=Discover, orange=Compare. */

:root {
  --ink: #0e1417;
  --ink-2: #111a1f;
  --panel: #18222a;
  --panel-2: #1f2b34;
  --line: #2b3942;
  --text: #e9eff3;
  --muted: #8da0ad;
  --muted-2: #5f7280;

  --green: #00e054;
  --blue: #40bcf4;
  --orange: #ff8000;
  --accent: var(--green);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 10px;
  --maxw: 1140px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.accent-green { --accent: var(--green); }
.accent-blue { --accent: var(--blue); }
.accent-orange { --accent: var(--orange); }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Full-height column so the footer hugs the bottom on short pages. */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1 0 auto; width: 100%; }
.site-footer { flex-shrink: 0; width: 100%; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.01em; margin: 0; }
.muted { color: var(--muted); }

/* Mono utility label — the "equipment" voice. */
.mono-label {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Three-dot brand mark. */
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 0.5em; height: 0.5em; border-radius: 50%; display: block; }
.dots i:nth-child(1) { background: var(--green); }
.dots i:nth-child(2) { background: var(--blue); }
.dots i:nth-child(3) { background: var(--orange); }

/* ---- Header / nav ---- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap;
  padding: 0.85rem 1.4rem;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand .dots i { width: 9px; height: 9px; }
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; }
.site-nav { display: flex; align-items: center; }

/* Tools dropdown — scales as tools are added; thumbnails show each at a glance. */
.nav-menu { position: relative; }
.nav-menu > summary {
  list-style: none; cursor: pointer;
  font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.45rem 0.95rem;
  display: inline-flex; align-items: center; gap: 0.45rem;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary:hover { border-color: var(--muted); }
.nav-menu .caret { transition: transform 0.15s; font-size: 0.7em; }
.nav-menu[open] .caret { transform: rotate(180deg); }
.nav-panel {
  position: absolute; right: 0; top: calc(100% + 0.6rem); width: min(92vw, 400px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 1rem; display: grid; gap: 1.1rem; z-index: 30;
}
.nav-group { display: grid; gap: 0.3rem; }
.nav-group > .mono-label { padding-left: 0.25rem; margin-bottom: 0.1rem; }
.nav-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem; border-radius: 10px; color: var(--text); }
.nav-item:hover { background: var(--panel-2); text-decoration: none; }
.nav-thumb {
  width: 56px; height: 38px; border-radius: 6px; flex: 0 0 auto;
  background-size: cover; background-position: center; border-left: 3px solid var(--accent);
}
.nav-item-text { display: flex; flex-direction: column; line-height: 1.25; }
.nav-item-name { font-weight: 600; font-size: 0.92rem; }
.nav-item-tag { color: var(--muted); font-size: 0.78rem; }

.site-main { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.4rem 5rem; }

/* ---- Hero: drifting poster marquee ---- */
.hero {
  position: relative; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); margin-bottom: 3rem;
  background: var(--ink-2); min-height: 460px;
  display: flex; align-items: center;
}
.reel-stack {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; gap: 14px; opacity: 0.5;
}
.reel { display: flex; gap: 14px; width: max-content; will-change: transform; }
.reel img {
  height: 190px; width: auto; aspect-ratio: 2/3; object-fit: cover;
  border-radius: 6px; flex: 0 0 auto;
}
.reel-a { animation: drift-left 90s linear infinite; }
.reel-b { animation: drift-right 90s linear infinite; }
@keyframes drift-left { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes drift-right { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.hero-overlay {
  position: relative; z-index: 2; width: 100%;
  padding: 3rem 1.5rem; text-align: center;
  background: radial-gradient(120% 100% at 50% 50%,
      color-mix(in srgb, var(--ink) 78%, transparent) 0%,
      color-mix(in srgb, var(--ink) 92%, transparent) 70%);
}
.hero-overlay h1 {
  font-size: clamp(3rem, 9vw, 6rem); font-weight: 800;
  display: inline-flex; align-items: center; gap: 0.4em; margin: 0.4rem 0;
}
.hero-overlay h1 .dots i { width: 0.28em; height: 0.28em; }
.hero-sub { max-width: 38rem; margin: 0.6rem auto 1.6rem; color: var(--muted); font-size: 1.05rem; }
.hero-cta {
  display: inline-block; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.12em; font-size: 0.78rem; color: var(--ink);
  background: var(--green); padding: 0.75rem 1.4rem; border-radius: 999px; font-weight: 600;
}
.hero-cta:hover { text-decoration: none; filter: brightness(1.08); }

/* ---- Tool grid ---- */
.tool-kind { color: var(--accent); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.tool-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); transition: transform 0.16s ease, border-color 0.16s ease;
}
.tool-card:hover {
  transform: translateY(-4px); text-decoration: none;
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
.tool-scene {
  position: relative; display: block; height: 180px;
  background-size: cover; background-position: center;
  border-bottom: 3px solid var(--accent);
}
.tool-scene::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--ink) 25%, transparent) 0%,
      color-mix(in srgb, var(--panel) 90%, transparent) 100%);
}
.tool-scene .tool-kind {
  position: absolute; z-index: 1; top: 0.75rem; left: 0.85rem;
  background: var(--accent); color: var(--ink); padding: 0.22rem 0.6rem; border-radius: 999px;
}
.tool-card-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.1rem 1.3rem 1.5rem; }
.tool-card h2 { font-size: 1.2rem; font-weight: 700; }
.tool-card p { color: var(--muted); font-size: 0.92rem; margin: 0; }
.tool-go {
  position: absolute; bottom: 1.2rem; right: 1.3rem; color: var(--accent);
  font-size: 1.2rem; opacity: 0; transform: translateX(-4px); transition: 0.16s;
}
.tool-card:hover .tool-go { opacity: 1; transform: translateX(0); }

/* ---- Tool page: two-pane console ---- */
.tool-header {
  position: relative; margin-bottom: 2rem; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  background-size: cover; background-position: center; min-height: 300px;
  display: flex; align-items: flex-end;
}
.tool-header::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg,
      color-mix(in srgb, var(--ink) 30%, transparent) 0%,
      color-mix(in srgb, var(--ink) 88%, transparent) 100%);
}
.tool-header-inner { position: relative; z-index: 1; padding: 1.6rem 1.8rem; }
.tool-header .tool-kind { color: var(--accent); }
.tool-header h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; margin: 0.3rem 0; }
.tool-header p { color: var(--text); opacity: 0.88; margin: 0; max-width: 44rem; }

.workbench { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 2.2rem; align-items: start; }

.tool-form {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; display: flex; flex-direction: column; gap: 1.1rem;
  position: sticky; top: 5.5rem;
}
.tool-form label { display: flex; flex-direction: column; gap: 0.4rem; }
.tool-form > label > span:first-child,
.tool-form label:not(.checkbox) { font-family: var(--mono); }
.tool-form label:not(.checkbox) {
  font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.tool-form label.checkbox { flex-direction: row; align-items: center; gap: 0.55rem; font-size: 0.9rem; color: var(--text); }
.tool-form input[type=text], .tool-form input[type=number], .tool-form select {
  width: 100%; min-width: 0; box-sizing: border-box; appearance: none;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 0.62rem 0.7rem; font-family: var(--body); font-size: 0.95rem;
  text-transform: none; letter-spacing: normal; transition: border-color 0.12s, box-shadow 0.12s;
}
.tool-form input::placeholder { color: var(--muted-2); }
.tool-form input:hover, .tool-form select:hover { border-color: var(--muted-2); }
.tool-form input:focus, .tool-form select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.tool-form input[type=checkbox], .tool-form input[type=radio] { accent-color: var(--accent); width: 1rem; height: 1rem; }
.tool-form select[multiple] { padding: 0.3rem; height: auto; }
.tool-form select[multiple] option { padding: 0.3rem 0.45rem; border-radius: 4px; }
/* Grid children need min-width:0 so wide inputs don't blow past the cell. */
.tool-form .two-up, .tool-form #username-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.tool-form .two-up > label, .tool-form #username-rows > label { min-width: 0; }
.range { display: flex; align-items: center; gap: 0.45rem; }
.range::before { content: none; }
.range input { width: 100%; }
fieldset.modes { border: 1px solid var(--line); border-radius: 7px; padding: 0.7rem 0.85rem; display: flex; flex-direction: column; gap: 0.5rem; }
fieldset.modes legend { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding: 0 0.35rem; }
fieldset.modes label.checkbox { font-size: 0.85rem; }
.hint, small.hint { color: var(--muted-2); font-size: 0.78rem; font-family: var(--mono); letter-spacing: 0.02em; }
.link-button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0; text-align: left; font: inherit; font-size: 0.85rem; }

button[type=submit] {
  position: relative; background: var(--accent); color: var(--ink); font-weight: 600;
  font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.78rem;
  border: none; border-radius: 8px; padding: 0.8rem 1rem; cursor: pointer;
}
button[type=submit]:hover { filter: brightness(1.08); }
button[type=submit]:disabled { opacity: 0.55; cursor: progress; }

.filters { border: 1px solid var(--line); border-radius: 8px; background: var(--ink-2); padding: 0.7rem 0.85rem; }
.filters > summary { cursor: pointer; font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); list-style: none; }
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::before { content: "▸"; color: var(--accent); display: inline-block; width: 1.1em; }
.filters[open] > summary::before { content: "▾"; }
.filters[open] { padding-bottom: 1rem; }
.filters-body { display: flex; flex-direction: column; gap: 1.4rem; margin-top: 1.2rem; }
.filter-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }
.filter-select { min-width: 0; }
.filter-select select { width: 100%; }

/* Dual-handle range slider */
.rangeslider { display: flex; flex-direction: column; gap: 0.6rem; }
.rs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; }
.rs-label { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.rs-sub { display: block; margin-top: 3px; font-family: var(--body); font-size: 0.66rem; letter-spacing: normal; text-transform: none; color: var(--muted-2); font-weight: 400; }
.rs-readout { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); white-space: nowrap; }
.rs-track { position: relative; height: 22px; }
.rs-track::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  height: 5px; border-radius: 3px; background: var(--line);
}
.rs-fill { position: absolute; top: 50%; transform: translateY(-50%); height: 5px; border-radius: 3px; background: var(--accent); }
.rs-track input[type=range] {
  position: absolute; left: 0; top: 0; width: 100%; height: 22px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.rs-track input[type=range]:focus { outline: none; }
.rs-track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: pointer;
  width: 18px; height: 18px; border-radius: 50%; background: var(--accent);
  border: 2px solid var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.rs-track input[type=range]::-moz-range-thumb {
  pointer-events: auto; cursor: pointer; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--ink);
}
.rs-track input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); }
.filters-body label { gap: 0.3rem; }

/* ---- Results bay ---- */
.results-bay { min-height: 240px; }
.results-bay > #results:empty::before {
  content: "Results appear here."; display: block; color: var(--muted-2);
  font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em;
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem; text-align: center;
}
#results h2, #results h3 { margin: 1.8rem 0 0.9rem; font-weight: 700; }
#results h2:first-child, #results h3:first-child { margin-top: 0; }
#results { transition: opacity 0.18s ease; }
#results.htmx-swapping { opacity: 0; }

.htmx-indicator { display: none; margin-bottom: 1rem; color: var(--muted); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.05em; }
.htmx-request .htmx-indicator, .htmx-indicator.htmx-request { display: block; }
.htmx-indicator::before { content: "● "; color: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }

.alert { background: color-mix(in srgb, var(--orange) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--orange) 45%, var(--line)); color: #ffe0c2; padding: 0.85rem 1rem; border-radius: 8px; font-size: 0.95rem; }
.note { color: var(--green); }

/* ---- Poster grid (contact sheet) ---- */
.poster-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.85rem; }
.poster-cell { display: flex; flex-direction: column; gap: 0.4rem; }
.poster img, .poster-fallback {
  width: 100%; aspect-ratio: 2/3; object-fit: cover; border-radius: 7px;
  background: var(--panel-2); display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  font-size: 0.7rem; color: var(--muted); text-align: center; padding: 0.4rem;
}
.poster:hover img { transform: scale(1.04); box-shadow: var(--shadow); border-color: var(--accent); }
.poster-title { font-size: 0.8rem; line-height: 1.3; }
.poster-caption { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); font-weight: 600; }

/* ---- Film detail (random picker) ---- */
.film-detail {
  display: grid; grid-template-columns: 240px 1fr; gap: 1.8rem; margin-bottom: 2.2rem;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 1.5rem;
}
.film-detail-poster { width: 100%; border-radius: 8px; }
.film-detail-body h2 { font-size: 1.7rem; font-weight: 800; }
.film-detail-body .muted { font-family: var(--mono); font-size: 0.85rem; }
.tagline { font-style: italic; color: var(--blue); font-size: 1.05rem; }
.links { font-family: var(--mono); font-size: 0.8rem; letter-spacing: 0.04em; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { text-align: left; padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); }
.data-table th { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.data-table td:nth-child(n+2) { font-family: var(--mono); }
.data-table td:first-child { font-family: var(--body); }
.data-table tr.all-match { background: color-mix(in srgb, var(--green) 10%, transparent); }

/* ---- Users ---- */
.user-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.user-chip { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; color: var(--text); text-align: center; }
.user-chip img { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); transition: border-color 0.14s; }
.user-chip:hover { text-decoration: none; }
.user-chip:hover img { border-color: var(--accent); }
.user-chip span { font-size: 0.85rem; }

/* ---- Compatibility ---- */
.compat-users { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.8rem; }
.compat-user { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; color: var(--text); padding: 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.compat-user:hover { text-decoration: none; border-color: var(--accent); }
.compat-user img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.compat-user .muted { font-family: var(--mono); font-size: 0.78rem; }
.compat-overlap { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; text-align: center; margin: 1.2rem 0; }
.compat-overlap > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 0.8rem; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; }
.compat-overlap .big { display: block; font-family: var(--display); font-size: 2.6rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; text-transform: none; margin-bottom: 0.2rem; }

/* ---- Explain / details blocks ---- */
.explain, details.explain { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.explain > summary { cursor: pointer; font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.explain-block { margin: 1.2rem 0; }
.explain-block h3 { font-size: 1.1rem; }

/* ---- Footer ---- */
.site-footer { max-width: var(--maxw); margin: 0 auto; padding: 2.5rem 1.4rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }
.site-footer a { color: var(--blue); }
.site-footer .freshness { color: var(--text); font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.04em; }
.site-footer .freshness .mono-label { color: var(--accent); }
.site-footer .disclaimer { color: var(--muted-2); margin-top: 0.6rem; }

/* ---- Responsive ---- */
@media (max-width: 880px) {
  .workbench { grid-template-columns: 1fr; }
  .tool-form { position: static; }
  .poster-grid { grid-template-columns: repeat(4, 1fr); }
  .user-grid { grid-template-columns: repeat(3, 1fr); }
  .film-detail { grid-template-columns: 1fr; }
  .film-detail-poster { max-width: 240px; }
}
@media (max-width: 520px) {
  .poster-grid, .user-grid { grid-template-columns: repeat(2, 1fr); }
  .compat-users, .filters-body, .tool-form .two-up, .tool-form #username-rows { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .reel-a, .reel-b { animation: none; }
  .htmx-indicator::before { animation: none; }
  #results { transition: none; }
  * { scroll-behavior: auto; }
}

/* ---- Tokenized multi-select (tag chips) ---- */
.tagselect { display: flex; flex-direction: column; gap: 0.55rem; min-width: 0; }
.ts-control {
  display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.4rem 0.5rem; cursor: text;
}
.ts-control:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ts-chips { display: contents; }
.ts-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--text); border-radius: 999px; padding: 0.15rem 0.25rem 0.15rem 0.6rem; font-size: 0.82rem;
}
.ts-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.05rem; line-height: 1; padding: 0 0.15rem; }
.ts-x:hover { color: var(--text); }
.tool-form .tagselect .ts-input {
  flex: 1; min-width: 110px; width: auto; background: none; border: none;
  box-shadow: none; padding: 0.3rem; color: var(--text); font-family: var(--body); font-size: 0.92rem;
}
.tool-form .tagselect .ts-input:focus { outline: none; box-shadow: none; }

/* ---- Contextual refresh bar (replaces the old refresh checkbox) ---- */
.refresh-bar { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1.2rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.refresh-link {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.06em;
  border-radius: 999px; padding: 0.3rem 0.7rem; cursor: pointer;
}
.refresh-link:hover { color: var(--text); border-color: var(--accent); }

/* ---- Number stepper (custom +/- in place of native spinners) ---- */
.stepper { display: flex; align-items: stretch; background: var(--ink-2); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.tool-form .stepper input[type=number] {
  flex: 1; min-width: 0; border: none; background: none; box-shadow: none; border-radius: 0;
  padding: 0.62rem 0.7rem; font-size: 0.95rem;
}
.stepper input[type=number] { -moz-appearance: textfield; }
.stepper input[type=number]::-webkit-outer-spin-button,
.stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button {
  width: 42px; border: none; border-left: 1px solid var(--line); background: transparent;
  color: var(--accent); font-size: 1.3rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background 0.12s;
}
.stepper button:hover { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.stepper button:active { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ---- Typeahead / suggestion dropdowns (films + tag-select) ---- */
.typeahead, .tagselect { position: relative; }
.ta-suggestions, .ts-suggestions {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  max-height: 260px; overflow-y: auto; box-shadow: var(--shadow);
}
.ta-suggestions:empty, .ts-suggestions:empty { display: none; }
.suggestion {
  display: block; width: 100%; text-align: left; background: none; border: none;
  color: var(--text); padding: 0.55rem 0.7rem; cursor: pointer; font: inherit; font-size: 0.92rem;
}
.suggestion:hover { background: var(--panel-2); }
.suggestion-empty { padding: 0.55rem 0.7rem; color: var(--muted); font-size: 0.85rem; }
