/* Fish compatibility checker.
   Built on the tokens in styles.css (--brand, --card, --border, --radius...).
   Green is reserved for the semantic "compatible" state, per the site's palette
   note -- it is never used as a brand colour here. */

.compat-shell { margin: 1.5rem 0 2.5rem; }

/* ------------------------------------------------------------- pickers */
.compat-pickers {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.15rem 1.25rem;
}
.compat-picker { position: relative; min-width: 0; }
.compat-picker-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
.compat-input {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.compat-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.compat-vs {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 0.72rem;
  user-select: none;
}

.compat-suggest {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0; right: 0;
  margin: 0; padding: 0.25rem;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
  max-height: 17rem;
  overflow-y: auto;
}
.compat-suggest-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.compat-suggest-item.is-active,
.compat-suggest-item:hover { background: var(--brand-light); }
.compat-suggest-name { font-weight: 600; }
.compat-suggest-meta { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }

/* ------------------------------------------------------------ empty state */
.compat-empty {
  margin-top: 1.25rem;
  padding: 1.6rem 1.25rem 1.75rem;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
}
.compat-empty-title { margin: 0 0 0.3rem; font-weight: 700; font-size: 1.05rem; }
.compat-empty-text { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }
.compat-examples { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }

/* ------------------------------------------------------------------ chips */
.compat-chip {
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--brand-strong);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.compat-chip:hover { border-color: var(--brand); background: var(--brand-light); }
.compat-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.compat-chip.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.compat-chip-quiet { color: var(--muted); }

/* ----------------------------------------------------------------- cards */
.compat-card {
  margin-top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.35rem 1.5rem;
}

/* --------------------------------------------------------------- verdict */
.compat-result { border-top: 4px solid var(--border); }
.compat-result-good { border-top-color: #16a34a; }
.compat-result-care { border-top-color: #d97706; }
.compat-result-no   { border-top-color: #dc2626; }

.compat-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-bottom: 0.35rem;
}
.compat-verdict {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.8rem 0.35rem 0.6rem;
  border-radius: 999px;
}
.compat-verdict-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; }
.compat-verdict-good { background: #dcfce7; color: #14532d; }
.compat-verdict-good .compat-verdict-dot { background: #16a34a; }
.compat-verdict-care { background: #fef3c7; color: #78350f; }
.compat-verdict-care .compat-verdict-dot { background: #d97706; }
.compat-verdict-no { background: #fee2e2; color: #7f1d1d; }
.compat-verdict-no .compat-verdict-dot { background: #dc2626; }

.compat-result-pair {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.32rem;
  line-height: 1.25;
}
.compat-result-lead { margin: 0 0 1rem; color: var(--muted); font-size: 0.95rem; }

/* ----------------------------------------------------------------- notes */
.compat-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.compat-note {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.7rem;
  align-items: start;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius);
  background: #f8fafc;
  border: 1px solid var(--border);
}
.compat-note-icon {
  width: 1.15rem; height: 1.15rem;
  border-radius: 50%;
  margin-top: 0.12rem;
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700; color: #fff;
}
.compat-note-ok   { background: #f0fdf4; border-color: #bbf7d0; }
.compat-note-ok   .compat-note-icon { background: #16a34a; }
.compat-note-ok   .compat-note-icon::after { content: "\2713"; }
.compat-note-warn { background: #fffbeb; border-color: #fde68a; }
.compat-note-warn .compat-note-icon { background: #d97706; }
.compat-note-warn .compat-note-icon::after { content: "!"; }
.compat-note-bad  { background: #fef2f2; border-color: #fecaca; }
.compat-note-bad  .compat-note-icon { background: #dc2626; }
.compat-note-bad  .compat-note-icon::after { content: "\2715"; }

.compat-note-title { margin: 0 0 0.15rem; font-weight: 700; font-size: 0.95rem; }
.compat-note-detail { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--muted); }

.compat-result-links { margin: 1.1rem 0 0; font-size: 0.92rem; color: var(--muted); }
.compat-result-links a { color: var(--brand); font-weight: 600; }

/* ----------------------------------------------------------- size view */
/* For a life-size tool, horizontal space is the product. The article column is
   ~880px; a 35 cm oscar needs 1323px. So this one card escapes the container and
   takes the viewport width, less a gutter that stays clear of the scrollbar. */
.compat-size {
  width: calc(100vw - 2.5rem);
  max-width: 1700px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

.compat-size-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}
.compat-size-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.3rem;
}
.compat-scale-badge {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
}
.compat-scale-badge.is-exact {
  color: #14532d;
  background: #dcfce7;
  border-color: #bbf7d0;
}

.compat-stage {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, rgba(148, 163, 184, 0.12) 1px, transparent 1px) 0 0 / 37.795px 100%,
    #fbfdff;
  padding: 1.1rem 0.75rem 0.9rem;
  overflow: hidden;
}
/* Nothing fits a 1 m arowana. Rather than only ever shrinking it, let the stage
   scroll at true scale -- swiping the length of the fish is the point. */
.compat-stage.is-scrolling { overflow-x: auto; overflow-y: hidden; }
.compat-stage.is-scrolling .compat-fish-holder,
.compat-stage.is-scrolling .compat-scalebar { width: max-content; }
.compat-fish-row { margin-bottom: 1.1rem; }
.compat-fish-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.compat-fish-name { font-weight: 700; font-size: 0.97rem; }
.compat-fish-size { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.compat-fish-holder { display: block; line-height: 0; }

.compat-fish { display: block; overflow: visible; }
.compat-fish-a path { fill: #0e7490; }
.compat-fish-b path { fill: #64748b; }
.compat-fish path { stroke: none; }

.compat-refcard {
  border: 2px dashed #94a3b8;
  border-radius: 4px;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #eef2f7 6px, #eef2f7 12px);
}
.compat-ref-row .compat-fish-name { color: var(--muted); }

.compat-scalebar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
}
.compat-scalebar-tick {
  height: 0.55rem;
  border: 1px solid #64748b;
  border-top: none;
  flex: none;
}
.compat-scalebar-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.compat-ratio {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.compat-size-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.95rem;
}
.compat-scale-note {
  flex-basis: 100%;
  margin: 0.3rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ------------------------------------------------------------ calibration */
.compat-modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 23, 42, 0.55);
  display: grid; place-items: center;
  padding: 1rem;
}
.compat-modal {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 34rem; width: 100%;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.3);
  max-height: 90vh; overflow-y: auto;
}
.compat-modal-title { margin: 0 0 0.5rem; font-family: var(--font-display); font-size: 1.3rem; }
.compat-modal-text { margin: 0 0 1.1rem; color: var(--muted); font-size: 0.93rem; line-height: 1.55; }
.compat-cal-preview {
  display: grid; place-items: center;
  padding: 1.2rem 0.5rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
.compat-cal-card {
  border: 2px solid var(--brand);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.10), rgba(14, 116, 144, 0.03));
  flex: none;
}
.compat-cal-slider { width: 100%; margin: 1.1rem 0 0.4rem; accent-color: var(--brand); }
.compat-cal-readout {
  margin: 0 0 1.1rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.compat-modal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.compat-noscript { padding: 1rem; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); }
.compat-prose { margin-top: 2.5rem; }

/* ---------------------------------------------------------------- mobile */
@media (max-width: 720px) {
  .compat-pickers { grid-template-columns: 1fr; gap: 0.75rem; padding: 1rem; }
  .compat-vs { display: none; }
  .compat-card { padding: 1.1rem 0.95rem 1.25rem; }
  .compat-result-pair { font-size: 1.15rem; }
  .compat-size-head { align-items: flex-start; flex-direction: column; }
  .compat-stage { padding: 0.9rem 0.6rem 0.8rem; }
  .compat-note { grid-template-columns: 1.2rem 1fr; gap: 0.6rem; padding: 0.65rem 0.7rem; }
  .compat-note-detail { font-size: 0.89rem; }
}

@media (prefers-reduced-motion: reduce) {
  .compat-input, .compat-chip { transition: none; }
}

/* Neutral species notes: shown for context, deliberately not styled as a
   caution because they do not change the verdict. */
.compat-note-info { background: #f8fafc; border-color: var(--border); }
.compat-note-info .compat-note-icon { background: #94a3b8; }
.compat-note-info .compat-note-icon::after { content: "i"; font-style: italic; }
