/* Filth Hub — Bloomberg-style terminal theme */
:root {
  --bg: #050709;
  --bg-elev: #0a0e13;
  --panel: #0d1218;
  --panel2: #121920;
  --panel3: #171f28;
  --border: #1c2633;
  --border-bright: #2a3a4d;
  --text: #e6edf5;
  --muted: #7a8a9e;
  --dim: #556274;
  --amber: #f5a623;
  --amber-dim: rgba(245, 166, 35, 0.14);
  --amber-line: rgba(245, 166, 35, 0.35);
  --full: #00d68f;
  --full-bg: rgba(0, 214, 143, 0.12);
  --full-edge: #00d68f;
  --close: #ffb020;
  --close-bg: rgba(255, 176, 32, 0.12);
  --close-edge: #ffb020;
  --unusual: #4da3ff;
  --unusual-bg: rgba(77, 163, 255, 0.12);
  --unusual-edge: #4da3ff;
  --earn: #ff6b4a;
  --earn-bg: rgba(255, 107, 74, 0.14);
  --bull: #c084fc;
  --bull-bg: rgba(192, 132, 252, 0.12);
  --danger: #ff4d6a;
  --radius: 6px;
  --radius-lg: 8px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --glow-amber: 0 0 24px rgba(245, 166, 35, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background-image:
    radial-gradient(ellipse 80% 40% at 50% -10%, rgba(245, 166, 35, 0.05), transparent 55%),
    linear-gradient(180deg, #070a0e 0%, var(--bg) 40%);
  background-attachment: fixed;
}

.app {
  max-width: 860px;
  margin: 0 auto;
  padding: 10px 12px 80px;
}

/* —— Terminal header —— */
.top {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  box-shadow: var(--glow-amber);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.logo {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--bg);
  background: var(--amber);
  border-radius: 4px;
  letter-spacing: -0.02em;
}

.brand-text { min-width: 0; }

h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.top-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}

.muted {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--border);
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.85;
}

.pill-dim { background: var(--panel2); color: var(--muted); }
.pill-live {
  background: var(--full-bg);
  color: var(--full);
  border-color: rgba(0, 214, 143, 0.4);
}
.pill-live::before { box-shadow: 0 0 6px var(--full); }
.pill-err {
  background: rgba(255, 77, 106, 0.12);
  color: var(--danger);
  border-color: rgba(255, 77, 106, 0.4);
}

/* —— Bullseye strip —— */
.bullseye {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px 10px;
  margin-bottom: 8px;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--bull);
  margin-bottom: 7px;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }

.chip {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 3px;
  background: var(--bull-bg);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: #e9d5ff;
  letter-spacing: 0.02em;
}

.chip.hit {
  background: var(--full-bg);
  border-color: rgba(0, 214, 143, 0.45);
  color: var(--full);
}

/* —— Filters —— */
.filters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters::-webkit-scrollbar { display: none; }

.filter {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  border-radius: 3px;
  padding: 6px 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.filter span {
  margin-left: 4px;
  opacity: 0.7;
  font-size: 0.65rem;
  color: var(--amber);
}

.filter.active {
  color: var(--bg);
  border-color: var(--amber);
  background: var(--amber);
}

.filter.active span { color: var(--bg); opacity: 0.75; }

.filter[data-filter="FULL_MATCH"].active {
  background: var(--full);
  border-color: var(--full);
  color: #04140e;
}
.filter[data-filter="CLOSE_MISS"].active {
  background: var(--close);
  border-color: var(--close);
  color: #1a1200;
}
.filter[data-filter="UNUSUAL"].active {
  background: var(--unusual);
  border-color: var(--unusual);
  color: #041018;
}

/* —— Session day picker —— */
.day-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 6px 2px;
}

.day-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  flex: 0 0 auto;
}

.day-select {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-color: #000;
  color: #fff;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 7px 28px 7px 10px;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--amber) 50%),
    linear-gradient(135deg, var(--amber) 50%, transparent 50%);
  background-position: calc(100% - 14px) 55%, calc(100% - 9px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color-scheme: dark;
}

.day-select option {
  background-color: #000;
  color: #fff;
}

.day-select:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 1px;
}

/* —— Dense tape stream —— */
.stream {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 11px 9px;
  border-left-width: 3px;
  border-left-style: solid;
  position: relative;
}

.card.FULL_MATCH {
  border-left-color: var(--full-edge);
  box-shadow: inset 0 0 0 1px rgba(0, 214, 143, 0.04);
}
.card.CLOSE_MISS {
  border-left-color: var(--close-edge);
  box-shadow: inset 0 0 0 1px rgba(255, 176, 32, 0.04);
}
.card.UNUSUAL {
  border-left-color: var(--unusual-edge);
  box-shadow: inset 0 0 0 1px rgba(77, 163, 255, 0.04);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 4px;
}

/* High-contrast tags */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}

.tag.FULL_MATCH {
  background: var(--full);
  color: #04140e;
}
.tag.CLOSE_MISS {
  background: var(--close);
  color: #1a1200;
}
.tag.UNUSUAL {
  background: var(--unusual);
  color: #041018;
}

.ticker {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  vertical-align: middle;
  color: var(--text);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}

.badge {
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 2px;
  border: 1px solid transparent;
}

.badge-earn {
  background: var(--earn-bg);
  color: var(--earn);
  border-color: rgba(255, 107, 74, 0.4);
}
.badge-bull {
  background: var(--bull-bg);
  color: var(--bull);
  border-color: rgba(192, 132, 252, 0.4);
}

.blurb {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0 0 7px;
  line-height: 1.35;
}

.row {
  font-size: 0.76rem;
  line-height: 1.4;
  margin: 0 0 2px;
  word-break: break-word;
}

.row .k {
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 5px;
}

.row.mono {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
}

.row.gates {
  color: var(--text);
}

.row.gates .k {
  color: var(--amber);
}

.catalysts {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.catalysts .cat-label {
  display: block;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.catalysts .cat-body {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.catalysts.earn-hl {
  background: var(--earn-bg);
  border-left-color: var(--earn);
  border-color: rgba(255, 107, 74, 0.35);
}

.catalysts.earn-hl .cat-label {
  color: var(--earn);
}

.earn-mark {
  display: inline-block;
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--earn);
  letter-spacing: 0.06em;
}

.card-foot {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.empty {
  text-align: center;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  padding: 32px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* —— Fixed footer —— */
.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  background: rgba(5, 7, 9, 0.94);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.03em;
  max-width: 860px;
  margin: 0 auto;
}

.install {
  border: 1px solid var(--amber-line);
  background: var(--amber-dim);
  color: var(--amber);
  border-radius: 3px;
  padding: 5px 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.hidden { display: none !important; }

@media (min-width: 700px) {
  .app { padding-top: 16px; padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 1.05rem; }
  .card { padding: 11px 13px 10px; }
}

/* —— Bullseye detail page —— */
a.bull-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--bull);
  cursor: pointer;
}
a.bull-link:hover,
a.bull-link:focus-visible { color: #e9d5ff; }
a.bull-link .chev { font-size: 0.9rem; opacity: 0.75; }

a.chip {
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}
a.chip:hover,
a.chip:focus-visible { filter: brightness(1.2); }

a.back-link {
  text-decoration: none;
  color: inherit;
}
a.back-link:hover { color: var(--amber); }

.score-def {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius);
  padding: 10px 12px 12px;
  margin-bottom: 10px;
  box-shadow: var(--glow-amber);
}

.score-steps {
  margin: 0 0 8px;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.45;
}
.score-steps li { margin-bottom: 3px; }
.score-steps strong {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--amber);
}

.score-note {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  line-height: 1.4;
}

.bull-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 20px;
}

.bull-card {
  display: flex;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  border-left: 3px solid var(--bull);
  scroll-margin-top: 10px;
}

.bull-card.flash {
  box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.55);
}

.bull-num {
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--bull);
  background: var(--bull-bg);
  border: 1px solid rgba(192, 132, 252, 0.3);
  border-radius: 3px;
  padding: 3px 7px;
  height: fit-content;
  letter-spacing: 0.04em;
}

.bull-body { flex: 1; min-width: 0; }

.bull-body h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
}

.bull-name {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: var(--font);
}

.bull-body .blurb { margin-bottom: 6px; }

.bull-body .why {
  margin: 7px 0 0;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  line-height: 1.4;
}

.foot-static {
  position: static;
  max-width: none;
  margin: 16px -12px 0;
  border-radius: 0;
}

.bull-sections {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.bull-sec {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
}

.bull-sec-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  padding: 1px 6px;
  border-radius: 2px;
}

.bull-sec.flag .bull-sec-label {
  background: var(--unusual-bg);
  color: var(--unusual);
}
.bull-sec.news .bull-sec-label {
  background: var(--close-bg);
  color: var(--close);
}
.bull-sec.move .bull-sec-label {
  background: var(--full-bg);
  color: var(--full);
}

.bull-sec p {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text);
}

.bull-sec p.unk {
  color: var(--muted);
  font-style: italic;
}

a.filter-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* —— Feed cards as tappable links —— */
a.card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  -webkit-tap-highlight-color: transparent;
}
a.card-link:focus-visible .card {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
a.card-link:active .card {
  filter: brightness(1.06);
}
.card.card-tap {
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
a.card-link:hover .card {
  border-color: var(--border-bright);
  box-shadow: 0 0 0 1px rgba(245, 166, 35, 0.12);
}
.badge-open {
  background: transparent;
  color: var(--dim);
  border-color: transparent;
  font-size: 0.9rem;
  padding: 0 2px;
  line-height: 1;
}
.tap-hint {
  color: var(--amber);
  opacity: 0.75;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.58rem;
}

/* —— Card detail page —— */
.detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 12px;
}
.detail-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  border-left-width: 3px;
  border-left-style: solid;
  box-shadow: var(--glow-amber);
}
.detail-card.FULL_MATCH { border-left-color: var(--full-edge); }
.detail-card.CLOSE_MISS { border-left-color: var(--close-edge); }
.detail-card.UNUSUAL { border-left-color: var(--unusual-edge); }

.detail-blurb {
  font-size: 0.88rem;
  color: var(--text);
  margin-bottom: 12px;
}

.detail-sec {
  margin-top: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  padding: 10px 12px 12px;
}
.detail-sec.insight-sec {
  border-left-color: var(--amber);
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.06);
}
.detail-sec-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
}
.detail-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detail-kv {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 8px;
  align-items: start;
  font-size: 0.8rem;
  line-height: 1.35;
}
.detail-kv .dk {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  padding-top: 1px;
}
.detail-kv .dv {
  color: var(--text);
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.76rem;
}
.insight-body p {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text);
}
.insight-body p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-family: var(--mono);
}
.detail-id {
  margin: 14px 0 0;
  font-size: 0.62rem;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

@media (max-width: 420px) {
  .detail-kv {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .detail-kv .dk { padding-top: 0; }
  .detail-card { padding: 12px 11px 14px; }
}

.install.notify-on {
  border-color: rgba(80, 200, 120, 0.45);
  background: rgba(80, 200, 120, 0.12);
  color: #6ee7a0;
}
.install.notify-denied {
  border-color: rgba(200, 80, 80, 0.4);
  background: rgba(200, 80, 80, 0.1);
  color: #f0a0a0;
}
.foot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
