/* Dashboard components (tokens, header, cards and pills live in site.css). */

.ico, .sico { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico { width: 1.05em; height: 1.05em; vertical-align: -0.17em; flex: none; display: inline-block; overflow: visible; }

/* the header's tabs: plain links, the current one in bold (DevSwarm style) */
.site-header nav a { display: inline-flex; align-items: center; gap: 6px; }
.site-header nav .ico { color: var(--muted); }
.site-header nav a[aria-current="page"] .ico { color: var(--action); }
.mode-pill { font-size: 13px; }
.header-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 2px; border-radius: var(--pill); background: var(--critical); color: #fff; font-size: 12px; font-weight: 600; }

/* page title per tab */
.page-hero { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 28px; }
.page-hero h1 { font-size: clamp(34px, 4.6vw, 48px); line-height: 1.08; letter-spacing: -0.035em; }
.page-hero p { margin: 0; max-width: 680px; color: var(--muted); font-size: 21px; line-height: 1.45; }
.readonly-note { display: block; margin: 0 0 20px; padding: 14px 18px; border-radius: 16px; background: var(--running-bg); color: var(--ink-2); font-size: 15px; }
.readonly-note b { color: var(--ink); }

/* numbers for the last 24 hours */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { display: flex; flex-direction: column; padding: 22px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi .l { order: -1; color: var(--muted); font-size: 14px; font-weight: 600; }
.kpi .n { margin-top: 6px; font-size: 44px; line-height: 1.05; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.kpi.ok .n { color: var(--good); } .kpi.warn .n { color: var(--serious); } .kpi.bad .n { color: var(--critical); }

/* a tab's main card */
section.card { padding: 24px 28px; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.card-head h2 { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; }
.card-head h2 .ico { color: var(--action); }
.card-head .muted { font-size: 15px; }
h3 { margin: 32px 0 12px; font-size: 21px; letter-spacing: -0.02em; }
.empty { margin: 0; padding: 40px 12px; color: var(--muted); text-align: center; }

.live-dot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: var(--pill); background: var(--surface-2); color: var(--muted); font-size: 13px; font-weight: 500; }
.live-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-dot.on { background: var(--good-bg); color: var(--good); }
.live-dot.on::before { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 -8px; }
table.feed { width: 100%; border-collapse: collapse; font-size: 15px; }
.feed th { padding: 12px; border-bottom: 1px solid var(--hairline); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; white-space: nowrap; }
.feed td { padding: 11px 12px; border-bottom: 1px solid var(--hairline); vertical-align: top; white-space: nowrap; }
.feed tbody tr:last-child td { border-bottom: 0; }
.feed td.mono, .feed .mono { font-size: 13.5px; }
.feed td.target { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.feed .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.row.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: var(--running-bg); } to { background: transparent; } }

/* status pills */
.badge { display: inline-flex; align-items: center; padding: 3px 11px; border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.badge.ok { background: var(--good-bg); color: var(--good); }
.badge.warn { background: var(--serious-bg); color: var(--serious); }
.badge.bad { background: var(--critical-bg); color: var(--critical); }
.badge.err, .badge.muted { background: var(--surface-2); color: var(--muted); }
.badge.pending { background: var(--pending-bg); color: var(--pending); }

/* approval and detection cards: a list inside the card, split by hairlines */
.approval, .detection { padding: 22px 0; border-bottom: 1px solid var(--hairline); }
.approval:first-child, .detection:first-child { padding-top: 4px; }
.approval:last-child, .detection:last-child { border-bottom: 0; padding-bottom: 4px; }
.approval header, .detection header { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.approval header strong, .detection header strong { font-size: 18px; }
.approval header .muted, .detection header .muted { font-size: 14px; }
.reason { margin: 8px 0; color: var(--ink-2); font-size: 15px; }
pre.args { margin: 10px 0; padding: 14px 16px; max-height: 280px; overflow: auto; border-radius: 12px; background: var(--code); font: 13px/1.6 var(--mono); }
.findings { margin: 10px 0; padding: 0; list-style: none; }
.findings li, .finding { margin: 10px 0; font-size: 15px; }
.finding { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.finding .evidence, .findings .evidence { flex-basis: 100%; }
.evidence { margin: 6px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--code); font: 13px/1.6 var(--mono); overflow-wrap: anywhere; }
mark { background: var(--mark); color: inherit; border-radius: 4px; padding: 0 2px; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.actions input { flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 10px 16px; border: 1px solid var(--baseline); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.actions input:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px var(--focus); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 22px; border: 0; border-radius: var(--pill); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn.ok { background: var(--action); color: #fff; }
.btn.ok:hover { background: var(--action-hover); }
.btn.bad { background: var(--critical-bg); color: var(--critical); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--focus); }
.signin-hint { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 13px; }

/* rug-pull diff: dark panel, approved vs current */
.diff { margin: 12px 0; padding: 14px 0; overflow-x: auto; border-radius: 16px; background: var(--feature); color: #e5e5ea; font: 13px/1.7 var(--mono); }
.diff-head, .diff-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 20px; padding: 0 20px; }
.diff-head span { padding-bottom: 6px; color: #8e8e93; font: 600 13px var(--sans); }
.diff-row code { padding: 0 6px; margin: 0 -6px; border-radius: 4px; background: none; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.7em; }
.diff-row.change code:first-child, .diff-row.del code:first-child { color: #ffb3ad; background: rgba(255, 69, 58, 0.18); }
.diff-row.change code:last-child, .diff-row.add code:last-child { color: #a6f4b5; background: rgba(48, 209, 88, 0.16); }

/* usage */
.usage-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.usage { margin: 0; padding: 20px 22px; border-radius: 18px; background: var(--surface-2); }
.usage figcaption { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-size: 15px; }
.usage figcaption strong { font-size: 17px; }
.usage svg { display: block; width: 100%; height: 96px; margin-top: 12px; }
.bar-ok { fill: var(--action); } .bar-bad { fill: var(--critical); } .axis { stroke: var(--baseline); }
.axis-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.t-bad { color: var(--critical); } .t-warn { color: var(--serious); }

/* landing page */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; align-items: center; padding: 48px 52px; overflow: hidden; }
.home-hero h1 { font-size: clamp(36px, 4.6vw, 54px); line-height: 1.04; letter-spacing: -0.045em; }
.home-hero h1 span { color: var(--muted); }
.home-hero p.lead { margin: 16px 0 0; color: var(--muted); font-size: 19px; line-height: 1.45; }
.home-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 26px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 24px; border-radius: var(--pill); background: var(--action); color: #fff; font-size: 17px; font-weight: 500; }
.button:hover { background: var(--action-hover); text-decoration: none; }
.link-chevron { display: inline-flex; align-items: center; gap: 6px; font-size: 17px; }
.link-chevron::after { content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
.showcase-card { padding: 22px 24px 16px; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px var(--hairline), 0 30px 60px rgba(0, 0, 0, 0.12); transform: rotate(-1.5deg); transition: transform 0.3s ease; color: inherit; display: block; }
a.showcase-card:hover { transform: rotate(0) translateY(-2px); text-decoration: none; }
.showcase-card .row-line { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--hairline); font-size: 15px; }
.showcase-card .row-line:first-of-type { border-top: 0; }
.showcase-card .mono { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.threats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.threats a { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 24px; color: inherit; }
.threats a:hover { text-decoration: none; transform: translateY(-2px); }
.threats a { transition: transform 0.15s ease; }
.threat-tag { align-self: flex-start; }
.threats strong { font-size: 17px; letter-spacing: -0.015em; }
.threats p { margin: 0; color: var(--muted); font-size: 15px; }

@media (max-width: 720px) {
  section.card { padding: 20px 18px; }
  .page-hero p { font-size: 18px; }
  .home-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 28px 20px; }
  .showcase-card { transform: none; }
  .diff-head, .diff-row { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .row.fresh, .live-dot.on::before { animation: none; }
  .showcase-card, .threats a { transition: none; }
}
.section-note { margin: -6px 0 12px; color: var(--muted); font-size: 15px; }
