.ui-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.ui-card-title {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.ui-card-value {
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ui-btn {
  height: 34px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
}

.ui-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: 999px;
  border: 1px solid var(--border2);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(23, 35, 58, 0.7);
}

.ui-badge.is-excellent {
  color: var(--tier-excellent);
  border-color: rgba(var(--tier-excellent-rgb), 0.45);
}

.ui-badge.is-good {
  color: var(--tier-good);
  border-color: rgba(var(--tier-good-rgb), 0.45);
}

.ui-badge.is-hold {
  color: var(--tier-hold);
  border-color: rgba(var(--tier-hold-rgb), 0.45);
}

.ui-badge.is-weak {
  color: var(--tier-weak);
  border-color: rgba(var(--tier-weak-rgb), 0.45);
}

.ui-badge.is-avoid {
  color: var(--tier-avoid);
  border-color: rgba(var(--tier-avoid-rgb), 0.45);
}

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

.table-shell {
  width: 100%;
}


/* ============================================================
   Shared scaffold (DSH-10) — patterns extracted from page CSS
   files where they appeared identically across 3+ pages.
   Pages can still override these via more-specific selectors.
   ============================================================ */

/* ── Outer wrapper (used by 6+ page templates) ────────────────────── */
.outer {
  padding-bottom: 80px;
}

/* ── Hero kicker / subtitle (4+ pages) ────────────────────────────── */
.hero-kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand);   /* pages can override with their own accent */
}
.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.hero-sub strong { color: var(--text); }
.hero-sub .mono  { font-family: var(--mono); }

/* ── Empty state (3+ pages) ───────────────────────────────────────── */
.empty {
  margin: 10px 0;
  text-align: center;
  border: 1px dashed var(--border2);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(17, 26, 43, 0.42);
  padding: 26px 14px;
  font-size: 13px;
}
.empty.small {
  margin: 10px;
  padding: 16px 10px;
  font-size: 12px;
}

/* ── Outline button — canonical version of `+ Write Article` /
   `account-btn` style. Use `.qf-btn` for new code; existing
   page-specific button classes (.btn-write, .account-btn) are
   left in place to avoid touching every template. ──────────────── */
.qf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: transparent;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.qf-btn:hover { background: rgba(77, 139, 255, 0.1); }
.qf-btn:disabled { opacity: 0.45; cursor: default; }

.qf-btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}
.qf-btn-danger:hover { background: rgba(239, 68, 68, 0.1); }

.qf-btn-secondary {
  border-color: var(--border2);
  color: var(--text);
}
.qf-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text);
}

/* ─────────────────────────────────────────────────────────────────────
   Ask AI floating assistant (AI-1)
   ───────────────────────────────────────────────────────────────────── */
/* Modal */
.ask-ai-modal[hidden] { display: none !important; }
.ask-ai-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}
.ask-ai-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
}
.ask-ai-modal-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1080px, calc(100vw - 44px));
  max-width: calc(100vw - 44px);
  height: min(78vh, 760px);
  max-height: calc(100vh - 44px);
  background:
    radial-gradient(560px 280px at 0% -20%, var(--brand-glow-soft), transparent 55%),
    linear-gradient(180deg, var(--surface2) 0%, var(--bg) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-mid);
  overflow: hidden;
}
.ask-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
}
.ask-ai-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}
.ask-ai-title {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  font-family: var(--sans);
}
.ask-ai-close {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.ask-ai-close:hover {
  color: var(--text);
  background: var(--surface2);
  border-color: var(--border2);
}

.ask-ai-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ask-ai-empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 24px 8px;
}
.ask-msg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 96%;
}
.ask-msg-user { align-self: flex-end; align-items: flex-end; }
.ask-msg-ai   { align-self: flex-start; align-items: flex-start; }
.ask-msg-who {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.ask-msg-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.58;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.ask-msg-user .ask-msg-body {
  background: rgba(77, 139, 255, 0.08);
  border-color: rgba(77, 139, 255, 0.40);
  color: var(--text);
}
.ask-table-wrap {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}
.ask-table-title {
  padding: 9px 10px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--brand);
}
.ask-table-subtitle {
  padding: 0 10px 8px;
  font-size: 10px;
  color: var(--muted);
}
.ask-table-scroll {
  overflow-x: auto;
}
.ask-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 12px;
}
.ask-table th,
.ask-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.ask-table thead th {
  background: rgba(255,255,255,.02);
  color: var(--muted);
  font-weight: 700;
  border-top: 0;
}
.ask-table tbody td {
  color: var(--text);
}

.ask-ai-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.ask-ai-input {
  flex: 1 1 0;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  min-height: 66px;
  resize: none;
  outline: none;
  font-family: var(--sans);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ask-ai-input::placeholder { color: var(--muted); }
.ask-ai-input:focus {
  border-color: rgba(77, 139, 255, 0.62);
  box-shadow: var(--focus-ring);
}
.ask-ai-send {
  height: 40px;
  min-width: 108px;
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 10px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.ask-ai-send:hover:not(:disabled) {
  background: rgba(77, 139, 255, 0.1);
}
.ask-ai-send:disabled {
  opacity: .45;
  cursor: default;
}

.ask-ai-foot {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  padding: 6px 12px 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

/* Typing indicator */
.ask-typing-body { display: flex; align-items: center; gap: 4px; padding: 10px 14px; min-width: 48px; }
.ask-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 50%; background: var(--muted);
  animation: ask-bounce 1.1s ease-in-out infinite;
}
.ask-dot:nth-child(2) { animation-delay: .18s; }
.ask-dot:nth-child(3) { animation-delay: .36s; }
@keyframes ask-bounce {
  0%,80%,100% { transform: translateY(0); opacity: .35; }
  40%          { transform: translateY(-5px); opacity: 1; }
}

/* Formatted AI reply */
.ask-msg-body strong { font-weight: 650; color: var(--text); }
.ask-msg-body em { font-style: italic; opacity: .9; }
.ask-msg-body ul, .ask-msg-body ol { margin: 4px 0 4px 16px; padding: 0; }
.ask-msg-body li { margin-bottom: 2px; }

@media (max-width: 640px) {
  .ask-ai-modal { padding: 0; }
  .ask-ai-modal-panel {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    border: 0;
  }
}

/* ── Watchlist star button (reusable across screener/run tables) ──── */
.wl-star-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color .15s;
  flex-shrink: 0;
  vertical-align: middle;
}
.wl-star-btn:hover { color: var(--brand); }
.wl-star-btn.is-watched { color: var(--brand); }
.wl-star-btn.is-watched .wl-star-icon {
  fill: var(--brand);
  stroke: var(--brand);
}

/* Sidebar watchlist count badge */
.sidebar-wl-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 700;
  color: var(--brand);
  background: transparent;
  border: 1px solid var(--brand);
  border-radius: 9px;
  margin-left: auto;
}
