/* Components: header, buttons, forms, cards, states, dial, feed, Ask, footer. */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 50;
  background: rgba(13, 21, 36, 0.92);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(169, 180, 202, 0.14);
  color: var(--night-text);
}
.site-header__bar {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  height: var(--header-h);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  flex: none;
}
.brand svg { width: 34px; height: 34px; }
.brand__ai { color: var(--amber); }
.nav { margin-left: auto; display: none; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  color: var(--night-text);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}
@media (min-width: 1020px) and (max-width: 1180px) { .nav a { padding: 8px 8px; } }
.nav a:hover { background: rgba(255, 255, 255, 0.07); color: #fff; }
.nav a[aria-current="page"] { color: var(--amber); }
.site-header .site-header__cta { display: none; }
@media (min-width: 560px) { .site-header .site-header__cta { display: inline-flex; margin-left: auto; } .site-header .menu-btn { margin-left: 0; } }
.menu-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--dusk-2);
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: var(--fs-sm);
}
.menu-btn__bars { width: 18px; height: 12px; position: relative; }
.menu-btn__bars::before, .menu-btn__bars::after, .menu-btn__bars span {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t-med) var(--ease-out), opacity var(--t-fast);
}
.menu-btn__bars::before { top: 0; }
.menu-btn__bars span { top: 5px; }
.menu-btn__bars::after { bottom: 0; }
.menu-btn[aria-expanded="true"] .menu-btn__bars::before { transform: translateY(5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bars::after { transform: translateY(-5px) rotate(-45deg); }
.menu-btn[aria-expanded="true"] .menu-btn__bars span { opacity: 0; }
@media (min-width: 1020px) {
  .nav { display: block; }
  .site-header .site-header__cta { margin-left: 0; }
  .menu-btn { display: none; }
}

/* Mobile sheet menu */
.sheet {
  position: fixed;
  inset: calc(var(--header-h) + env(safe-area-inset-top, 0px)) 0 0 0;
  z-index: 49;
  background: var(--ink);
  color: var(--night-text);
  padding: var(--s-5) var(--gutter-r) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)) var(--gutter-l);
  overflow-y: auto;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.sheet.is-open { opacity: 1; transform: none; }
.sheet__group + .sheet__group { margin-top: var(--s-5); }
.sheet__label { font-size: var(--fs-xs); letter-spacing: 0.09em; text-transform: uppercase; color: var(--night-muted); margin: 0 0 var(--s-2); font-weight: 600; }
.sheet ul { list-style: none; margin: 0; padding: 0; }
.sheet a:not(.btn) {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(169, 180, 202, 0.14);
}
.sheet a:not(.btn)::after { content: "\2192"; color: var(--amber); font-family: var(--font-text); }
.sheet .btn { width: 100%; margin-top: var(--s-5); }
body.has-sheet { overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ink);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  min-height: 46px;
  padding: 0 1.25rem;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--fs-sm);
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-med) var(--ease-out), background var(--t-fast), color var(--t-fast);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); text-decoration: none; }
.btn:active { transform: translateY(0) scale(0.98); box-shadow: none; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--amber { --btn-bg: var(--amber); --btn-fg: var(--ink); }
.btn--amber:hover { box-shadow: var(--glow-amber); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: rgba(13, 21, 36, 0.25); }
.btn--ghost:hover { background: rgba(13, 21, 36, 0.05); box-shadow: none; }
.band--night .btn--ghost, .band--dusk .btn--ghost, .band--sky .btn--ghost, .page-hero .btn--ghost, .hero .btn--ghost, .site-header .btn--ghost, .sheet .btn--ghost {
  --btn-fg: #fff; border-color: rgba(233, 237, 245, 0.35);
}
.band--sky .card .btn--ghost { --btn-fg: var(--ink); border-color: rgba(13, 21, 36, 0.25); }
.band--amber .btn--amber { --btn-bg: var(--ink); --btn-fg: #fff; }
.band--amber .btn--amber:hover { box-shadow: var(--shadow-2); }
.btn--sm { min-height: 38px; padding: 0 0.9rem; font-size: var(--fs-xs); }
.btn--lg { min-height: 54px; padding: 0 1.6rem; font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn .spinner { display: none; }
.btn.is-busy .spinner { display: inline-block; }
.spinner {
  width: 1em; height: 1em;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  font-weight: 600;
  text-decoration: none;
  color: inherit;
}
.link-arrow span { transition: transform var(--t-med) var(--ease-out); }
.link-arrow:hover span { transform: translateX(3px); }
.link-arrow:hover { text-decoration: underline; }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .label, fieldset legend {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
}
.field__hint { font-size: var(--fs-xs); color: var(--slate-2); }
.input, .select, .textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 1rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #7A8399; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible {
  border-color: var(--ink);
  outline: 3px solid var(--amber);
  outline-offset: 0;
  box-shadow: none;
}
.input[aria-invalid="true"] { border-color: var(--coral-ink); }
.field__error { font-size: var(--fs-xs); color: var(--coral-ink); font-weight: 500; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.form-grid {
  display: grid;
  gap: var(--s-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}
.form-grid .span-all { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; margin-top: var(--s-5); }
/* Checkout security check (Turnstile). The box reserves the widget's 65px height so nothing jumps when it renders. */
.captcha { margin-block: var(--s-3); max-width: 100%; }
.captcha__label { margin: 0 0 var(--s-2); color: var(--slate-2); font-weight: 600; }
.captcha__box { min-height: 65px; max-width: 100%; }
.captcha__box iframe { max-width: 100%; }
.captcha__status:empty { display: none; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: var(--fs-sm); }
.check-row input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--ink); flex: none; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* URL bar: input and button joined. Stacks on phones. */
.urlbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 600px;
}
.urlbar .input { min-height: 54px; font-size: 1.05rem; }
.urlbar .btn { min-height: 54px; font-size: 1rem; }
@media (min-width: 560px) {
  .urlbar {
    flex-direction: row;
    gap: 0;
    padding: 6px;
    background: #fff;
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-2);
    border: 1px solid var(--sand);
  }
  .urlbar .input { border: 0; min-height: 48px; background: transparent; border-radius: var(--r-pill); padding-left: 18px; }
  .urlbar .input:focus-visible { outline-offset: -2px; }
  .urlbar .btn { min-height: 48px; flex: none; }
}

/* Segmented control (radio pills) */
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--sand); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.seg input:checked + label { background: var(--ink); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Cards ---------- */
.card {
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  padding: var(--s-5);
  min-width: 0;
}
.card--flat { box-shadow: none; }
.card--night { background: var(--dusk); border-color: var(--dusk-2); color: var(--night-text); }
.card--night :is(h2, h3, h4, strong) { color: #fff; }
.card__title { font-size: var(--fs-lg); margin-bottom: var(--s-2); }
.card--link { position: relative; transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med) var(--ease-out); }
.card--link:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card--link a.card__cover::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card--link a.card__cover { text-decoration: none; }
.card--link a.card__cover:hover { text-decoration: underline; }

/* ---------- Status ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  background: var(--sand);
  color: var(--ink);
  white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill--pass { background: #DDF3E6; color: var(--green-ink); }
.pill--warn { background: #FCEBC8; color: var(--amber-ink); }
.pill--fail { background: #FADCD5; color: var(--coral-ink); }
.pill--info { background: #E3E8F2; color: var(--dusk); }
.pill--lit { background: var(--amber); color: var(--ink); }
.pill--lit::before { background: var(--ink); }
.pill--plain::before { display: none; }
/* Disclosure for listings our team added free (and same-owner businesses). Never hidden. */
.pill--disclose { background: var(--amber-tint); color: var(--amber-ink); border: 1px solid var(--amber); white-space: normal; }
.pill--disclose::before { display: none; }
.listing__disclose { margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--amber-ink); }

/* ---------- States: skeleton, notice, empty, toast ---------- */
.skel {
  position: relative;
  overflow: hidden;
  background: var(--mist);
  border-radius: var(--r-sm);
  min-height: 14px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: shimmer 1.3s infinite;
}
.band--night .skel, .band--dusk .skel, .card--night .skel { background: var(--dusk-2); }
.band--night .skel::after, .card--night .skel::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 14px; margin-bottom: 10px; }
.skel-line--short { width: 55%; }
.skel-line--mid { width: 78%; }
.skel-block { height: 120px; border-radius: var(--r-lg); }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: #E9EEF7;
  color: var(--dusk);
  border: 1px solid #CDD6E6;
  font-size: var(--fs-sm);
}
.notice::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  margin-top: 6px;
  border-radius: 50%;
  background: currentColor;
}
.notice strong { color: inherit; }
.notice--warn { background: #FFF3D9; color: var(--warn-ink); border-color: #F3D9A0; }
.notice--error { background: #FCE6E1; color: var(--coral-ink); border-color: #F1C1B6; }
.notice--ok { background: #E1F4E9; color: var(--green-ink); border-color: #BFE5CE; }
.notice--offline { background: var(--mist); color: var(--slate); border-color: #D5DCE6; }
.notice--offline::before { background: transparent; border: 2px solid currentColor; }
.band--night .notice--offline, .card--night .notice--offline { background: rgba(255,255,255,0.05); color: var(--night-text); border-color: var(--dusk-2); }

.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: var(--s-3);
  padding: var(--s-6) var(--s-4);
  color: var(--slate-2);
}
.empty svg { width: 120px; height: auto; }
.empty h3 { margin: 0; font-size: var(--fs-md); }
.empty p { max-width: 36ch; font-size: var(--fs-sm); margin: 0; }
.band--night .empty, .card--night .empty { color: var(--night-muted); }

.toast-region {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  transform: translateX(-50%);
  z-index: 80;
  display: grid;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  font-size: var(--fs-sm);
  border-left: 4px solid var(--amber);
  animation: toast-in var(--t-med) var(--ease-out);
}
.toast--error { border-left-color: var(--coral); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Score dial ---------- */
.dial { position: relative; width: min(100%, 220px); aspect-ratio: 1; margin-inline: auto; }
.dial svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial__track { fill: none; stroke: var(--sand); stroke-width: 14; }
.dial__value { fill: none; stroke: var(--amber); stroke-width: 14; stroke-linecap: round; }
.dial--night .dial__track { stroke: var(--dusk-2); }
.dial__center {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.dial__num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 2rem + 2vw, 3.6rem);
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.dial--night .dial__num { color: #fff; }
.dial__of { font-size: var(--fs-xs); color: var(--slate-2); margin-top: 4px; }
.dial--night .dial__of { color: var(--night-muted); }
.dial__grade {
  justify-self: center;
  margin-top: 8px;
  min-width: 36px;
  padding: 2px 10px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--amber);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.dial--night .dial__grade { background: var(--amber); color: var(--ink); }

/* ---------- Agent feed: a modern old-school terminal ---------- */
/* Panel (.term / .feed-panel): window chrome, phosphor text, CSS-only scanlines. */
.term, .feed-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  border-radius: 14px;
  background: var(--term-bg);
  color: var(--term-soft);
  border: 1px solid rgba(61, 255, 143, 0.22);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 18px 50px rgba(4, 20, 12, 0.3), 0 0 40px rgba(61, 255, 143, 0.08);
  font-family: var(--font-term);
  font-size: 0.875rem;
  line-height: 1.55;
}
.feed-panel { min-height: 300px; }
.term::after, .feed-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(61, 255, 143, 0.035) 0 1px, transparent 1px 3px),
    radial-gradient(120% 90% at 50% 0%, rgba(61, 255, 143, 0.07), transparent 70%);
}
.term :is(h2, h3, h4, strong), .feed-panel :is(h2, h3, h4, strong) { color: var(--term-text); }
.term__bar, .feed-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 10px 14px;
  background: var(--term-bar);
  border-bottom: 1px solid var(--term-line);
}
.term__bar::before, .feed-panel__head::before {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  margin-right: 32px;
  border-radius: 50%;
  background: #FF6B5A;
  box-shadow: 16px 0 0 #FFB627, 32px 0 0 #3DFF8F;
  opacity: 0.85;
}
.term__title {
  font-size: 0.78rem;
  color: var(--term-dim);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.feed-panel__title, .term__heading {
  margin: 0;
  padding: 14px 16px 4px;
  font-family: var(--font-term);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
  text-shadow: 0 0 8px rgba(61, 255, 143, 0.35);
}
.feed-panel__title::before, .term__heading::before { content: "$ "; color: var(--term-dim); }
.feed-panel [data-feed] { padding: 6px 16px 16px; }
.term__body { padding: 6px 16px 16px; }

.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.feed__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: baseline;
  padding: 8px 0;
  border-bottom: 1px dashed var(--term-line);
}
.feed__item::before { content: ">"; color: var(--term-dim); grid-column: 1; grid-row: 1; }
.feed__item > .feed__kind { grid-column: 2; grid-row: 1; justify-self: start; }
.feed__item > .feed__what { grid-column: 2 / -1; grid-row: 2; }
.feed__item > .feed__when { grid-column: 3; grid-row: 1; }
.feed__kind {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--term-text);
}
.feed__kind::before { content: "["; color: var(--term-dim); }
.feed__kind::after { content: "]"; color: var(--term-dim); }
.feed__what { min-width: 0; overflow-wrap: anywhere; color: var(--term-soft); }
.feed__what strong { color: var(--term-text); font-weight: 600; text-shadow: 0 0 8px rgba(61, 255, 143, 0.3); }
.feed__what a { color: var(--term-found); text-decoration-color: rgba(255, 182, 39, 0.5); text-shadow: 0 0 10px rgba(255, 182, 39, 0.3); }
.feed__what a:hover { color: #FFD27A; }
.feed__when { color: var(--term-dim); font-size: 0.75rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Blinking block cursor after the last line. */
.feed::after, .term__cursor, .term .empty::after, .feed-panel .empty::after {
  content: "";
  display: block;
  width: 0.6em;
  height: 1.15em;
  background: var(--term-text);
  box-shadow: 0 0 8px rgba(61, 255, 143, 0.6);
  animation: term-blink 1.05s steps(1, end) infinite;
}
.feed::after { margin-top: 10px; }
@keyframes term-blink { 50% { opacity: 0; } }
/* New rows type in from the left, then the green flash settles. */
.feed__item.is-new { animation: term-type 900ms steps(28, end) both, term-flash 1.6s ease-out both; }
@keyframes term-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes term-flash { from { background: rgba(61, 255, 143, 0.1); } to { background: transparent; } }

/* States inside the terminal */
.term .empty, .feed-panel .empty { color: var(--term-soft); padding: var(--s-5) var(--s-3); }
.term .empty h3, .feed-panel .empty h3 { color: var(--term-text); font-family: var(--font-term); font-size: 0.95rem; letter-spacing: 0; }
.term .empty h3::before, .feed-panel .empty h3::before { content: "> "; color: var(--term-dim); }
.term .empty p, .feed-panel .empty p { font-size: 0.85rem; }
.term .empty svg, .feed-panel .empty svg { width: 96px; }
.term .skel, .feed-panel .skel { background: rgba(61, 255, 143, 0.1); }
.term .skel::after, .feed-panel .skel::after { background: linear-gradient(90deg, transparent, rgba(61, 255, 143, 0.12), transparent); }
.term .notice, .feed-panel .notice { background: rgba(61, 255, 143, 0.05); color: var(--term-soft); border-color: var(--term-line); font-family: var(--font-term); }
.term .notice--error, .feed-panel .notice--error { color: #FFB4A6; border-color: rgba(255, 138, 115, 0.35); background: rgba(255, 138, 115, 0.06); }
.term .notice--warn, .feed-panel .notice--warn { color: var(--amber); border-color: rgba(255, 182, 39, 0.35); background: rgba(255, 182, 39, 0.06); }
.term a:not(.btn), .feed-panel a:not(.btn) { color: var(--term-found); }

/* Terminal tables (dashboard agent activity) */
.term table { font-size: 0.8125rem; }
.term th { color: var(--term-dim); font-weight: 600; text-transform: lowercase; border-bottom: 1px solid var(--term-line); }
.term td { color: var(--term-soft); border-bottom: 1px dashed var(--term-line); }
.term td:first-child { color: var(--term-dim); white-space: nowrap; }
.term td .pill { background: transparent; color: var(--term-text); padding: 0; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.term td .pill::before { content: "["; display: inline; width: auto; height: auto; border-radius: 0; background: none; color: var(--term-dim); }
.term td .pill::after { content: "]"; color: var(--term-dim); }

.feed-status { display: inline-flex; align-items: center; gap: 8px; font-size: 0.75rem; color: var(--term-dim); font-family: var(--font-term); white-space: nowrap; }
.feed-status__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--term-dim); }
.feed-status.is-live { color: var(--term-text); }
.feed-status.is-live .feed-status__dot { background: var(--term-text); box-shadow: 0 0 0 0 rgba(61, 255, 143, 0.6); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(61, 255, 143, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 255, 143, 0); } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--paper);
  border: 1px solid var(--sand);
  border-radius: var(--r-lg);
  padding: 0 var(--s-5);
  transition: box-shadow var(--t-med);
}
.faq details[open] { box-shadow: var(--shadow-1); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: var(--s-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--sand);
  font-family: var(--font-text);
  transition: transform var(--t-med) var(--ease-out), background var(--t-fast);
}
.faq details[open] summary::after { transform: rotate(45deg); background: var(--amber); }
.faq details > div { padding-bottom: 18px; max-width: 68ch; }

/* ---------- Ask: floating button + panel ---------- */
.ask-fab {
  position: fixed;
  right: calc(16px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 20px 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 182, 39, 0.5);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(13, 21, 36, 0.35);
  transition: transform var(--t-med) var(--ease-out), box-shadow var(--t-med);
}
.ask-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(13, 21, 36, 0.45), 0 0 0 4px rgba(255, 182, 39, 0.18); }
.ask-fab svg { width: 28px; height: 28px; }
.ask-fab[aria-expanded="true"] { opacity: 0; pointer-events: none; }

.ask-backdrop {
  position: fixed;
  inset: 0;
  z-index: 74;
  background: rgba(13, 21, 36, 0.45);
  opacity: 0;
  transition: opacity var(--t-med);
}
.ask-backdrop.is-open { opacity: 1; }
.ask-panel {
  position: fixed;
  z-index: 75;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  top: calc(12px + env(safe-area-inset-top, 0px) + 48px);
  display: flex;
  flex-direction: column;
  background: var(--bg-alt);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(13, 21, 36, 0.45);
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(0.98);
  transform-origin: bottom right;
  transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out);
}
.ask-panel.is-open { opacity: 1; transform: none; }
@media (min-width: 640px) {
  .ask-panel { left: auto; top: auto; width: min(420px, calc(100vw - 24px)); height: min(680px, calc(100vh - 40px)); }
}
.ask-panel__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--ink);
  color: #fff;
}
.ask-panel__head h2 { font-size: 1.1rem; color: #fff; margin: 0; }
.ask-panel__head p { margin: 0; font-size: var(--fs-xs); color: var(--night-muted); }
.ask-panel__head .icon-btn { margin-left: auto; }
.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--dusk-2);
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }
.ask-panel .ask { flex: 1; min-height: 0; }

/* Shared Ask component (panel and /ask/ page) */
.ask { display: flex; flex-direction: column; min-height: 0; background: var(--bg-alt); }
.ask__modes { padding: 12px 16px 0; }
.ask__log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}
.ask__intro { color: var(--slate); font-size: var(--fs-sm); }
.ask__intro strong { display: block; font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 4px; }
.ask__msg {
  max-width: 88%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.ask__msg p { margin: 0 0 0.6em; }
.ask__msg p:last-child { margin: 0; }
.ask__msg--user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.ask__msg--bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--sand); color: var(--slate); border-bottom-left-radius: 6px; }
.ask__msg--bot.is-typing::after {
  content: "";
  display: inline-block;
  width: 8px; height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--amber);
  animation: caret 0.9s steps(2) infinite;
}
@keyframes caret { 50% { opacity: 0; } }
.ask__msg--note { align-self: stretch; max-width: none; }
.ask__chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 10px; }
.chip {
  border: 1px solid #C9D1DD;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-pill);
  padding: 8px 12px;
  font-size: var(--fs-xs);
  font-weight: 500;
  text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.chip:hover { background: var(--bg-alt); border-color: var(--ink); transform: translateY(-1px); }
.ask__form { display: flex; gap: 8px; padding: 10px 16px 4px; border-top: 1px solid var(--sand); background: var(--paper); }
.ask__form .textarea { min-height: 46px; max-height: 140px; resize: none; padding-top: 11px; }
.ask__send { flex: none; min-height: 46px; width: 46px; padding: 0; }
.ask__foot { padding: 2px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--paper); font-size: 0.75rem; color: var(--slate-2); display: flex; justify-content: space-between; gap: 8px; }
.ask__foot button { background: none; border: 0; padding: 0; color: var(--slate-2); text-decoration: underline; font-size: inherit; }
.ask-cards { display: grid; gap: 8px; align-self: stretch; }
.ask-card {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: #fff;
  border: 1px solid var(--sand);
  border-left: 4px solid var(--amber);
  font-size: var(--fs-sm);
  animation: toast-in var(--t-med) var(--ease-out);
}
.ask-card__title { font-weight: 600; color: var(--ink); }
.ask-card__meta { color: var(--slate-2); font-size: var(--fs-xs); }
.ask-card a { font-weight: 600; font-size: var(--fs-xs); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--night-muted);
  padding-block: var(--s-7) calc(var(--s-6) + 70px);
  font-size: var(--fs-sm);
}
.site-footer a { color: var(--night-text); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid;
  gap: var(--s-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
}
.footer-grid h2 {
  font-family: var(--font-text);
  font-size: var(--fs-xs);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--night-muted);
  margin-bottom: var(--s-3);
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-brand p { margin-top: var(--s-3); max-width: 30ch; }
.footer-legal {
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--dusk-2);
  display: grid;
  gap: var(--s-3);
  font-size: var(--fs-xs);
}
.footer-legal p { max-width: 90ch; }

/* ---------- Reveal on scroll (JS adds .rv-pending only to items below the fold) ---------- */
.rv-pending { opacity: 0; transform: translateY(18px); }
.rv-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .rv-pending { opacity: 1; transform: none; }
  .feed::after, .term__cursor, .term .empty::after, .feed-panel .empty::after { animation: none; }
  .feed__item.is-new { animation: none; clip-path: none; }
}
