/* StartupRadar — same design system as HH Radar, violet accent */
:root {
  --bg: 246 245 242; --panel: 255 255 255; --raised: 239 237 234;
  --ink: 26 24 32; --muted: 95 92 108; --faint: 142 139 155; --line: 26 24 32;
  --accent: 109 40 217; --accent-ink: 255 255 255; --accent-soft: 237 233 254;
  --good: 21 128 61; --warn: 180 83 9; --bad: 190 18 60; --info: 3 105 161;
  --line-a: .11; --shadow: 0 1px 2px rgb(26 24 32 / .06), 0 8px 24px -12px rgb(26 24 32 / .14);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: 13 12 18; --panel: 20 19 27; --raised: 29 27 38;
    --ink: 233 231 240; --muted: 155 151 170; --faint: 104 100 120; --line: 233 231 240;
    --accent: 196 181 253; --accent-ink: 28 16 60; --accent-soft: 44 33 82;
    --good: 134 239 172; --warn: 252 211 77; --bad: 253 164 175; --info: 125 211 252;
    --line-a: .09; --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 12px 32px -16px rgb(0 0 0 / .65);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: 13 12 18; --panel: 20 19 27; --raised: 29 27 38;
  --ink: 233 231 240; --muted: 155 151 170; --faint: 104 100 120; --line: 233 231 240;
  --accent: 196 181 253; --accent-ink: 28 16 60; --accent-soft: 44 33 82;
  --good: 134 239 172; --warn: 252 211 77; --bad: 253 164 175; --info: 125 211 252;
  --line-a: .09; --shadow: 0 1px 0 rgb(255 255 255 / .03) inset, 0 12px 32px -16px rgb(0 0 0 / .65);
  color-scheme: dark;
}

body { background: rgb(var(--bg)); color: rgb(var(--ink)); font-feature-settings: "ss01", "cv11"; }
.num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.hairline { border-color: rgb(var(--line) / var(--line-a)); }
.panel { background: rgb(var(--panel)); border: 1px solid rgb(var(--line) / var(--line-a)); border-radius: 18px; box-shadow: var(--shadow); }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgb(var(--faint)); font-weight: 600; }
.grid-bg {
  background-image:
    radial-gradient(circle at 0 0, rgb(var(--accent) / .08), transparent 40rem),
    linear-gradient(rgb(var(--line) / .035) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--line) / .035) 1px, transparent 1px);
  background-size: auto, 32px 32px, 32px 32px;
}
.ic { width: 1em; height: 1em; display: inline-block; flex: none; vertical-align: -0.125em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .45rem; height: 34px; padding: 0 .8rem; border-radius: 10px;
       font-size: 13px; font-weight: 500; color: rgb(var(--ink)); background: rgb(var(--raised));
       border: 1px solid rgb(var(--line) / var(--line-a)); transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap; cursor: pointer; }
.btn:hover { border-color: rgb(var(--line) / .25); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .chip:focus-visible, .seg a:focus-visible, .seg button:focus-visible, .field:focus { outline: 2px solid rgb(var(--accent) / .6); outline-offset: 2px; }
.btn .ic { width: 15px; height: 15px; }
.btn-icon { width: 34px; padding: 0; justify-content: center; }
.btn-primary { background: rgb(var(--accent)); color: rgb(var(--accent-ink)); border-color: transparent; font-weight: 600; }
.btn-primary:hover { filter: brightness(1.06); border-color: transparent; }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgb(var(--raised)); }
.btn-danger { color: rgb(var(--bad)); }
.btn.is-fav { color: rgb(var(--bad)); border-color: rgb(var(--bad) / .35); background: rgb(var(--bad) / .08); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn-lg { height: 40px; padding: 0 1rem; }

/* Fields */
.field { height: 36px; width: 100%; padding: 0 .75rem; border-radius: 10px; font-size: 13.5px; color: rgb(var(--ink));
         background: rgb(var(--bg)); border: 1px solid rgb(var(--line) / var(--line-a)); font-family: inherit; }
.field::placeholder { color: rgb(var(--faint)); }
select.field { padding-right: 2rem; }
textarea.field { height: auto; padding: .7rem .8rem; line-height: 1.55; }
.label { display: block; font-size: 12px; color: rgb(var(--muted)); margin-bottom: .3rem; }

/* Chips, tags, sources */
.chip { display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .7rem; border-radius: 999px; font-size: 12.5px;
        color: rgb(var(--muted)); border: 1px solid rgb(var(--line) / var(--line-a)); background: rgb(var(--panel)); white-space: nowrap; transition: all .15s; cursor: pointer; }
.chip:hover { color: rgb(var(--ink)); border-color: rgb(var(--line) / .25); }
.chip.is-on { color: rgb(var(--ink)); background: rgb(var(--accent-soft)); border-color: rgb(var(--accent) / .55); }
.chip .num { font-size: 11px; color: rgb(var(--faint)); }
.tag { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 6px; font-size: 11.5px; line-height: 1.4;
       color: rgb(var(--muted)); background: rgb(var(--raised)); }
.tag-accent { color: rgb(var(--ink)); background: rgb(var(--accent-soft)); }
.tag-good { color: rgb(var(--good)); background: rgb(var(--good) / .1); }
.tag-new { color: rgb(var(--warn)); background: rgb(var(--warn) / .1); }
.tag .ic { width: 11px; height: 11px; }
.src { --sc: var(--faint); font-family: "JetBrains Mono", monospace; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
       padding: .1rem .4rem; border-radius: 5px; border: 1px solid rgb(var(--sc) / .4); color: rgb(var(--sc)); white-space: nowrap; }
.src-trustmrr    { --sc: var(--accent); }
.src-producthunt { --sc: 218 85 47; }
.src-hackernews  { --sc: 255 102 0; }
.src-ycombinator { --sc: var(--warn); }
.src-techcrunch  { --sc: var(--good); }
.src-betalist    { --sc: var(--info); }

/* Monogram avatar, tinted by source */
.mono { --sc: var(--faint); flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
        font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 14px; letter-spacing: -.02em;
        color: rgb(var(--sc)); background: rgb(var(--sc) / .1); border: 1px solid rgb(var(--sc) / .28); text-transform: uppercase; }
.mono-trustmrr    { --sc: var(--accent); }
.mono-producthunt { --sc: 218 85 47; }
.mono-hackernews  { --sc: 255 102 0; }
.mono-ycombinator { --sc: var(--warn); }
.mono-techcrunch  { --sc: var(--good); }
.mono-betalist    { --sc: var(--info); }
.mono-lg { width: 64px; height: 64px; border-radius: 16px; font-size: 20px; }

/* Segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: rgb(var(--raised)); border: 1px solid rgb(var(--line) / var(--line-a)); }
.seg a, .seg button { display: inline-flex; align-items: center; gap: .4rem; height: 30px; padding: 0 .75rem; border-radius: 9px; font-size: 13px;
                      color: rgb(var(--muted)); white-space: nowrap; cursor: pointer; background: none; border: 0; font-family: inherit; }
.seg a:hover, .seg button:hover { color: rgb(var(--ink)); }
.seg .is-on { background: rgb(var(--panel)); color: rgb(var(--ink)); box-shadow: var(--shadow); font-weight: 500; }
.seg .num { font-size: 11px; color: rgb(var(--faint)); }

/* Startup card */
.scard { position: relative; transition: border-color .15s, transform .25s, opacity .25s; }
.scard:hover { border-color: rgb(var(--line) / .22); }
.scard.is-viewed .stitle { color: rgb(var(--muted)); }
.stitle:hover { color: rgb(var(--accent)); }
.scard.is-leaving { opacity: 0; transform: translateX(16px); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.up { color: rgb(var(--good)); }
.down { color: rgb(var(--bad)); }

/* Stat tiles & bars */
.bar { height: 6px; border-radius: 999px; overflow: hidden; background: rgb(var(--line) / .08); }
.bar > span { display: block; height: 100%; border-radius: 999px; background: rgb(var(--sc, var(--accent))); }

/* AI sections */
.sec-ico { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
           color: rgb(var(--accent)); background: rgb(var(--accent-soft)); }
.sec-ico .ic { width: 15px; height: 15px; }
.sec-body { white-space: pre-wrap; }
.verdict { border-color: rgb(var(--accent) / .45) !important; background: linear-gradient(135deg, rgb(var(--accent) / .09), transparent 60%), rgb(var(--panel)); }

/* Nav */
.nav a { display: flex; align-items: center; gap: .7rem; height: 38px; padding: 0 .75rem; border-radius: 10px; font-size: 14px; color: rgb(var(--muted)); white-space: nowrap; }
.nav a:hover { color: rgb(var(--ink)); background: rgb(var(--raised)); }
.nav a.is-on { color: rgb(var(--ink)); background: rgb(var(--raised)); font-weight: 500; }
.nav a .ic { width: 16px; height: 16px; opacity: .7; }
.nav a.is-on .ic { color: rgb(var(--accent)); opacity: 1; }
.nav .nav-count { margin-left: auto; font-size: 11px; color: rgb(var(--faint)); }

/* Status dots */
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: rgb(var(--faint)); }
.dot-ok { background: rgb(var(--good)); box-shadow: 0 0 8px rgb(var(--good) / .6); }
.dot-err { background: rgb(var(--bad)); box-shadow: 0 0 8px rgb(var(--bad) / .6); }
.dot-busy { background: rgb(var(--warn)); animation: pulse 1.6s ease-in-out infinite; }
.dot-new { background: rgb(var(--warn)); box-shadow: 0 0 8px rgb(var(--warn) / .55); }

.sweep { transform-origin: 16px 16px; animation: sweep 4s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(var(--accent)); border-top-color: transparent; animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .sweep, .dot-busy, .spinner { animation: none; } }

.htmx-indicator { display: none !important; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-flex !important; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
::selection { background: rgb(var(--accent) / .35); }

/* Demo-only bits */
.demo-strip { background: rgb(var(--accent-soft)); border: 1px solid rgb(var(--accent) / .35); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; pointer-events: none; z-index: 60;
         max-width: calc(100vw - 32px); padding: .65rem 1rem; border-radius: 12px; font-size: 13px;
         background: rgb(var(--ink)); color: rgb(var(--bg)); box-shadow: var(--shadow); transition: opacity .2s, transform .2s; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
