/* ==========================================================================
   Nexiitt Result — assets/components.css
   Reusable pieces of the interface: the hero, the search strip, the category
   grid, panels, feed rows, the deadline radar, the utility strip, and the
   overlays (quick-look sheet, search palette, toast).
   ========================================================================== */

/* --------------------------------------------------------------- buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted-light);
  background: rgba(68, 58, 49, 0.05);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn:hover { border-color: var(--line-strong); color: var(--text); background: rgba(68, 58, 49, 0.09); transform: translateY(-1px); }

.btn.primary {
  border: 0;
  color: #ffffff;
  background: var(--mint);
  box-shadow: 0 9px 25px rgba(194, 65, 12, 0.15);
}

.btn.primary:hover { background: #a8340c; }

.btn.ghost { background: transparent; }

.btn.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 10px; }

.btn.wide { width: 100%; }

.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

.chip.on { border-color: rgba(194, 65, 12, 0.4); color: var(--mint); background: rgba(194, 65, 12, 0.1); }

.chip .n {
  padding: 1px 5px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(68, 58, 49, 0.07);
  font-family: var(--font-num);
  font-size: 8px;
}

.panel.flush { background: transparent; border: 0; }

.panel-body { padding: 19px; }

.panel-body.tight { padding: 12px 19px; }

.panel-foot { padding: 0 19px 19px; }

/* -------------------------------------------------------------- feed rows -- */

.feed-description {
  padding: 0 19px 10px;
  margin-top: -4px;
  color: var(--muted);
  font-size: 11px;
}

.feed-eyebrow .sep { color: rgba(68, 58, 49, 0.2); }

.feed-actions { display: flex; gap: 5px; }

.status-badge.result { color: var(--green); background: rgba(15, 157, 118, 0.11); }

.status-badge.closed { color: var(--muted); background: rgba(68, 58, 49, 0.06); }

.status-badge.plain { color: var(--muted-light); background: rgba(68, 58, 49, 0.07); }

.empty { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 40px 18px; text-align: center; }

.empty .glyph {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--mint);
  background: rgba(194, 65, 12, 0.08);
}

.empty strong { font-size: 12px; font-weight: 800; }

.empty p { max-width: 320px; color: var(--muted); font-size: 10px; line-height: 1.6; }

/* ------------------------------------------------------- row action buttons -- */

.save-btn {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.save-btn:hover { border-color: var(--line-strong); color: var(--text); background: rgba(68, 58, 49, 0.07); }

.save-btn[aria-pressed="true"] { border-color: rgba(194, 65, 12, 0.4); color: var(--mint); background: rgba(194, 65, 12, 0.1); }

.save-btn[aria-pressed="true"] .icon { fill: currentColor; }

.quick-btn {
  display: grid;
  width: 27px;
  height: 27px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.quick-btn:hover { border-color: var(--line-strong); color: var(--mint); background: rgba(194, 65, 12, 0.08); }

.feed-row.is-saved .feed-icon { box-shadow: 0 0 0 1px rgba(194, 65, 12, 0.3); }

/* --------------------------------------------------------- filter / sort -- */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 13px 15px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(68, 58, 49, 0.035);
}

.filter-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 3px;
  color: var(--muted);
  font-family: var(--font-num);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-bar .spacer { flex: 1; }

.result-count { color: var(--muted); font-family: var(--font-num); font-size: 9px; white-space: nowrap; }

.result-count b { color: var(--mint); font-weight: 500; }

/* ------------------------------------------------------------- accordion -- */

.acc { border-bottom: 1px solid var(--line); }

.acc:last-child { border-bottom: 0; }

.acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.acc-head .chev { color: var(--muted); transition: transform 0.2s ease; }

.acc[data-open="true"] .acc-head .chev { color: var(--mint); transform: rotate(180deg); }

.acc-body { display: none; padding: 0 0 15px; color: var(--muted-light); font-size: 11px; line-height: 1.75; }

.acc[data-open="true"] .acc-body { display: block; }

.acc-body p { margin: 0 0 9px; }

.acc-body p:last-child { margin: 0; }

.acc-body a { color: var(--mint); }

/* ------------------------------------------------------------ link rows -- */

.link-list { display: flex; flex-direction: column; gap: 8px; }

.link-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(68, 58, 49, 0.04);
  transition: 0.2s ease;
}

.link-row:hover { border-color: rgba(194, 65, 12, 0.35); background: rgba(194, 65, 12, 0.07); transform: translateX(2px); }

.link-row .icon { color: var(--mint); }

.link-row-copy { min-width: 0; flex: 1; }

.link-row-copy strong { display: block; overflow: hidden; margin-bottom: 3px; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }

.link-row-copy span { display: block; overflow: hidden; color: var(--muted); font-family: var(--font-num); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }

.link-row .go { color: var(--muted); flex: 0 0 auto; }

/* ------------------------------------------------------------- fact grid -- */

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

.fact {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(68, 58, 49, 0.035);
}

.fact dt { margin-bottom: 6px; color: var(--muted); font-family: var(--font-num); font-size: 8px; letter-spacing: 0.08em; text-transform: uppercase; }

.fact dd { margin: 0; font-size: 11px; font-weight: 800; line-height: 1.5; }

.fact dd .sub { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; font-weight: 400; }

.fact.alert { border-color: rgba(255, 164, 18, 0.28); background: rgba(255, 164, 18, 0.07); }

.fact.alert dt { color: var(--yellow-ink); }

.fact.mint { border-color: rgba(194, 65, 12, 0.25); background: rgba(194, 65, 12, 0.07); }

.fact.mint dt { color: var(--mint); }

/* ------------------------------------------------------------ trust note -- */

.trust-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(194, 65, 12, 0.2);
  border-radius: 14px;
  color: var(--muted-light);
  background: rgba(194, 65, 12, 0.06);
  font-size: 10px;
  line-height: 1.65;
}

.trust-note .icon { color: var(--mint); flex: 0 0 auto; margin-top: 1px; }

.trust-note b { color: var(--text); }

.trust-note a { color: var(--mint); }

.trust-note.amber { border-color: rgba(255, 164, 18, 0.24); background: rgba(255, 164, 18, 0.06); }

.trust-note.amber .icon { color: var(--yellow-ink); }

/* ------------------------------------------------------------- overlays -- */

.overlay {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgba(68, 58, 49, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.overlay.open { opacity: 1; pointer-events: auto; }

.sheet {
  width: min(560px, 100%);
  max-height: min(84vh, 720px);
  overflow: auto;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  transform: translateY(14px);
  transition: transform 0.2s ease;
  scrollbar-width: thin;
}

.overlay.open .sheet { transform: translateY(0); }

.sheet-grip { display: none; }

.sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }

.sheet-head-copy { min-width: 0; flex: 1; }

.sheet-head h2 { margin: 0 0 6px; font-size: 14px; font-weight: 800; line-height: 1.4; }

.sheet-head h3 { margin: 0 0 6px; font-size: 14px; font-weight: 800; line-height: 1.4; }

.sheet-head p { margin: 0; color: var(--muted); font-size: 10px; }

.sheet-close {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: 0.2s ease;
}

.sheet-close:hover { border-color: var(--line-strong); color: var(--text); background: var(--panel-soft); }

.sheet-body p { margin: 0 0 11px; color: var(--muted-light); font-size: 11px; line-height: 1.75; }

.sheet-body p:last-child { margin: 0; }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.search-panel {
  width: min(640px, 100%);
  max-height: min(76vh, 620px);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}

.overlay.open .search-panel { transform: translateY(0); }

.search-input-row { display: flex; align-items: center; gap: 11px; padding: 15px 17px; border-bottom: 1px solid var(--line); color: var(--muted); }

.search-input-row input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 13px; }

.search-input-row input::placeholder { color: var(--muted); }

.search-input-row .esc { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-family: var(--font-num); font-size: 8px; }

.search-meta { padding: 9px 17px; border-bottom: 1px solid var(--line); color: var(--muted); font-family: var(--font-num); font-size: 8px; letter-spacing: 0.06em; text-transform: uppercase; }

.search-results { max-height: 380px; overflow: auto; padding: 7px; scrollbar-width: thin; }

.search-foot { display: flex; gap: 14px; padding: 11px 17px; border-top: 1px solid var(--line); color: var(--muted); font-family: var(--font-num); font-size: 8px; }

.search-foot kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 5px; background: rgba(68, 58, 49, 0.05); font-family: inherit; }

.search-hit { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 12px; }

.search-hit:hover, .search-hit.cursor { background: rgba(68, 58, 49, 0.07); }

.search-hit .hm { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--mint); }

.search-hit .hb { min-width: 0; }

.search-hit .ht { display: block; overflow: hidden; margin-bottom: 3px; font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }

.search-hit .hs { display: block; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }

.search-hit mark { color: var(--mint); background: transparent; }

.search-hit > .icon { margin-left: auto; color: var(--muted); flex: 0 0 auto; }

/* The kind chips the palette injects once its index has resolved. */
.search-filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 11px 16px; border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------- skeleton -- */

.skel-wrap { display: flex; flex-direction: column; gap: 10px; }

.skel { border-radius: 10px; background: linear-gradient(90deg, rgba(68, 58, 49, 0.05), rgba(68, 58, 49, 0.11), rgba(68, 58, 49, 0.05)); background-size: 200% 100%; animation: skel 1.3s linear infinite; }

.skel-line { height: 11px; }

.skel-line.short { width: 55%; }

.skel-icon { border-radius: 13px; }

@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ----------------------------------------------------------------- toast -- */

/* The host is emitted by the page shell; the chunks only ever append to it. */
.toast-wrap {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 9px;
  max-width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }

.toast-msg { flex: 1; min-width: 0; }

.toast-act {
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--mint);
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  font-weight: 800;
  flex: 0 0 auto;
}

.toast.error { border-color: rgba(255, 133, 133, 0.3); }

.toast.error .icon { color: var(--red); }

.toast.ok .icon { color: var(--mint); }

/* --------------------------------------------------------- offline strip -- */

.net-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 133, 133, 0.28);
  border-radius: 14px;
  color: var(--muted-light);
  background: rgba(255, 133, 133, 0.07);
  font-size: 10px;
}

/* An author-level `display` beats the UA `[hidden]` rule, so say it here. */
.net-banner[hidden] { display: none; }

.net-banner .icon { color: var(--red); flex: 0 0 auto; }

/* ------------------------------------------------------------- utilities -- */

/* A theme flip is only pretty if every element transitions its colours at
   once. `.retheme` is added for ~450ms by the toggle and removed after, so a
   slow device cannot leave the page permanently in transition mode. */
.retheme, .retheme * {
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease !important;
}

.row { display: flex; align-items: center; gap: 8px; }

.row.wrap, .wrap { flex-wrap: wrap; }

.row.top { align-items: flex-start; }

.stack { display: flex; flex-direction: column; gap: 8px; }

.grow { min-width: 0; flex: 1; }

.gap-4 { gap: 4px; }

.gap-6 { gap: 6px; }

.gap-8 { gap: 8px; }

.gap-10 { gap: 10px; }

.gap-14 { gap: 14px; }

.small { font-size: 10px; line-height: 1.65; }

.muted { color: var(--muted); }

.mono { font-family: var(--font-num); }

.text-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--text);
  background: var(--panel-soft);
  font-size: 11px;
}

[data-theme="dark"] .text-input { background: rgba(0, 0, 0, 0.22); }

.text-input:focus-visible { border-color: var(--mint); outline: none; }

.text-input::placeholder { color: var(--muted); }

.field { display: block; }

.field-label { display: block; margin-bottom: 7px; font-size: 10px; font-weight: 800; }

/* ------------------------------------------------------------ responsive -- */

@media (max-width: 1180px) {
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1.35fr) minmax(230px, 0.65fr); }
}

@media (max-width: 680px) {
  .facts { grid-template-columns: 1fr; }

  .toast-wrap { right: 16px; bottom: 16px; left: 16px; align-items: stretch; max-width: none; }

  .overlay { padding: 12px; }

  .sheet { padding: 18px; }}
