/* Lookup page (public flagship) plus shared form styling for payouts and
   login. Extends style.css: the ticket-gate wallet input, the departure
   ledger, and the threshold service banners live here. */

.lookup-card { padding: 20px 22px; --card-line: var(--accent); }

.lookup-form label {
  display: block;
  font-family: var(--font-sign);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 9px;
}
.lookup-form .input-row {
  display: flex; gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.lookup-form input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  background: var(--bg-inset);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 13px;
  transition: border-color 0.15s;
}
.lookup-form input::placeholder { color: var(--fg-dim); }
.lookup-form input:focus { border-color: var(--accent); }
.lookup-form .form-error {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--red);
  font-size: 12.5px;
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--red-soft);
  border: 1px solid rgba(255, 84, 112, 0.45);
}
.lookup-form .form-error::before {
  content: "";
  width: 8px; height: 8px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask-image: var(--gl-cross); mask-image: var(--gl-cross);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}

/* Connect Klever: secondary signage plate so the primary stays primary. */
.lookup-form .connect-btn, .connect-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg-muted);
  font-family: var(--font-sign);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  flex: 0 0 auto;
  transition: color 0.15s, border-color 0.15s;
}
.lookup-form .connect-btn:hover:not(:disabled), .connect-btn:hover:not(:disabled) {
  color: var(--fg);
  border-color: #45454f;
}
/* display:inline-flex would otherwise defeat the UA [hidden] rule that both
   wallet flows use to hide this button once a wallet is connected. */
.connect-btn[hidden] { display: none; }
.lookup-form .connect-btn:disabled, .connect-btn:disabled {
  opacity: 0.5;
  cursor: progress;
}
.connect-btn .connect-icon {
  width: 16px; height: 16px;
  border-radius: 3px;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0;
}
.connect-btn .connect-icon::after { content: "K"; }
.connect-status {
  font-size: 12px;
  margin: 11px 0 0;
  color: var(--fg-dim);
}
.connect-status[data-kind="ok"]  { color: var(--green); }
.connect-status[data-kind="err"] { color: var(--red); }
.lookup-form .hint {
  font-size: 12px; color: var(--fg-dim);
  margin: 12px 0 0; line-height: 1.6;
  max-width: 68ch;
}

.empty-card { padding: 34px 24px; text-align: center; }
.empty-card h2 {
  font-family: var(--font-sign);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.empty-card::before {
  content: "";
  display: block;
  width: 18px; height: 18px;
  margin: 0 auto 14px;
  background: var(--fg-dim);
  -webkit-mask-image: var(--gl-hollow); mask-image: var(--gl-hollow);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.empty-card code {
  background: var(--bg-inset);
  padding: 2px 6px;
  border: 1px solid var(--line-soft);
  font-size: 11px;
  word-break: break-all;
}

/* Legacy totals block (kept for compatibility). */
.totals { display: flex; gap: 24px; align-items: stretch; flex-wrap: wrap; }
.total-block { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; line-height: 1.2; }
.total-block .t-label {
  font-family: var(--font-sign);
  font-size: 9px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.18em;
}
.total-block .t-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
}

/* Departure ledger extras on top of the shared tables. */
.month-table a {
  color: var(--fg-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
.month-table a:hover { color: var(--fg); }
.month-table .hash {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--fg-muted);
}
.month-table tr.ineligible { background: rgba(255, 84, 112, 0.04); }
.month-table tr.ineligible td { color: var(--fg-dim); }
.month-table tr.ineligible td:first-child { color: var(--fg-muted); }

/* Threshold banners: service notice with a label plate. */
.banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  border: 1px solid var(--line);
}
.banner strong {
  font-family: var(--font-sign);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 10px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.banner strong::before {
  content: "";
  width: 7px; height: 7px;
  background: currentColor;
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
}
.banner-ineligible {
  background: var(--red-soft);
  border-color: rgba(255, 84, 112, 0.45);
}
.banner-ineligible strong { background: var(--red); color: var(--ink-on-plate); }
.banner-ineligible strong::before {
  -webkit-mask-image: var(--gl-cross); mask-image: var(--gl-cross);
}
.banner-ineligible span { color: var(--fg); }
.banner-mixed {
  background: var(--amber-soft);
  border-color: rgba(255, 179, 71, 0.45);
}
.banner-mixed strong { background: var(--amber); color: var(--ink-on-plate); }
.banner-mixed strong::before {
  -webkit-mask-image: var(--gl-diamond); mask-image: var(--gl-diamond);
}
.banner-mixed span { color: var(--fg-muted); }

.panel.monthly { border-top: 1px solid var(--line); overflow-x: auto; }
/* Narrow screens: the ledger scrolls sideways; say so instead of hiding it. */
@media (max-width: 640px) {
  .panel.monthly h3 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .panel.monthly h3::after {
    content: "scroll";
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    letter-spacing: 0.18em;
    color: var(--fg-dim);
    padding: 3px 18px 3px 7px;
    border: 1px solid var(--line-soft);
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8"><path fill="%2385858f" d="M1.5 0.8 7 4 1.5 7.2z"/></svg>');
    background-repeat: no-repeat;
    background-size: 7px 7px;
    background-position: right 6px center;
  }
}

/* The total readout on the boards. */
.score-total {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.15;
  color: #ff8dff;
}
.detail-zoe .score-total, .score-total.score-zoe { color: #7fe4f5; }
.score-best { color: var(--fg); }

/* Token result boards on the lookup. */
.result-head { padding: 13px 22px; margin-bottom: 0; }
.result-cards {
  padding: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-soft);
}
.result-charts { padding: 0; border-bottom: 1px solid var(--line-soft); }
.result-charts .chart-grid { border: none; }
.banner-inset { margin: 14px 22px; }
.detail-kunai.token-card { --card-line: var(--accent); }
.detail-zoe.token-card { --card-line: var(--cyan); }

/* Board update: rows cascade in once when results land. */
@media (prefers-reduced-motion: no-preference) {
  .board-settle .month-table tbody tr {
    animation: row-arrive 0.22s ease-out backwards;
  }
  .board-settle .month-table tbody tr:nth-child(1) { animation-delay: 0.03s; }
  .board-settle .month-table tbody tr:nth-child(2) { animation-delay: 0.06s; }
  .board-settle .month-table tbody tr:nth-child(3) { animation-delay: 0.09s; }
  .board-settle .month-table tbody tr:nth-child(4) { animation-delay: 0.12s; }
  .board-settle .month-table tbody tr:nth-child(5) { animation-delay: 0.15s; }
  .board-settle .month-table tbody tr:nth-child(6) { animation-delay: 0.18s; }
  .board-settle .month-table tbody tr:nth-child(7) { animation-delay: 0.21s; }
  .board-settle .month-table tbody tr:nth-child(8) { animation-delay: 0.24s; }
  .board-settle .month-table tbody tr:nth-child(n+9) { animation-delay: 0.27s; }
}
@keyframes row-arrive {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 820px) {
  .totals { gap: 14px; }
  .total-block { align-items: flex-start; }
}

@media (max-width: 480px) {
  .banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
  }
  .lookup-form .input-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .lookup-form input,
  .lookup-form button,
  .lookup-form .connect-btn {
    flex: 0 0 auto;
    width: 100%;
  }
  .lookup-form input {
    min-width: 0;
    padding: 12px 13px;
    /* 16px keeps iOS Safari and the Telegram in-app webview from
       auto-zooming the viewport on focus. */
    font-size: 16px;
    text-overflow: ellipsis;
  }
  .lookup-form button,
  .lookup-form .connect-btn {
    justify-content: center;
    text-align: center;
  }
  .lookup-card { padding: 16px 14px; }
  .lookup-form label { margin-bottom: 7px; }
  .lookup-form .hint { margin-top: 10px; font-size: 11px; }
  .score-total { font-size: 21px; }
  .result-head { padding: 12px 14px; }
  .banner-inset { margin: 12px 14px; }
  .totals { gap: 12px; }
  .total-block .t-value { font-size: 14px; }
}
