/* check.captain.works — shadcn/ui-flavoured tokens, light + dark */
:root {
  --background: 0 0% 100%;
  --foreground: 240 10% 3.9%;
  --card: 0 0% 100%;
  --muted: 240 4.8% 95.9%;
  --muted-foreground: 240 3.8% 46.1%;
  --border: 240 5.9% 90%;
  --primary: 240 5.9% 10%;
  --primary-foreground: 0 0% 98%;
  --ring: 240 5% 64.9%;
  --ok: 142 71% 35%;
  --warn: 38 92% 45%;
  --bad: 0 72% 51%;
  --radius: 0.5rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    --card: 240 10% 5.5%;
    --muted: 240 3.7% 15.9%;
    --muted-foreground: 240 5% 64.9%;
    --border: 240 3.7% 15.9%;
    --primary: 0 0% 98%;
    --primary-foreground: 240 5.9% 10%;
    --ring: 240 4.9% 83.9%;
    --ok: 142 60% 50%;
    --warn: 38 90% 60%;
    --bad: 0 80% 65%;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font: 15px/1.5 -apple-system, "Segoe UI", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.muted { color: hsl(var(--muted-foreground)); }
.wrap { max-width: 56rem; margin: 0 auto; padding: 0 1rem; }

.topbar { border-bottom: 1px solid hsl(var(--border)); position: sticky; top: 0; background: hsl(var(--background) / 0.9); backdrop-filter: blur(8px); z-index: 2; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { font-size: 1.25rem; line-height: 1; }
.expect { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; flex: 0 1 auto; min-width: 0; }
.expect label { color: hsl(var(--muted-foreground)); white-space: nowrap; }
.expect .label-short { display: none; }
.expect input {
  width: 3.5rem; min-height: 2.25rem; text-align: center; text-transform: uppercase;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius); background: hsl(var(--card)); color: inherit; font: inherit;
}
.expect input:focus-visible, .btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.card {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  box-shadow: 0 1px 2px hsl(240 10% 3.9% / 0.05); padding: 1rem;
}

.overall { display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0 1rem; flex-wrap: wrap; }
.overall-icon { width: 3rem; height: 3rem; border-radius: 999px; display: grid; place-items: center; flex: 0 0 auto; background: hsl(var(--muted)); }
.overall-icon .ico { width: 1.5rem; height: 1.5rem; }
.overall-text { flex: 1 1 14rem; min-width: 0; }
.overall h1 { font-size: 1.125rem; margin: 0 0 0.125rem; }
.overall p { margin: 0; color: hsl(var(--muted-foreground)); }
.overall.ok .overall-icon { background: hsl(var(--ok) / 0.15); color: hsl(var(--ok)); }
.overall.warn .overall-icon { background: hsl(var(--warn) / 0.15); color: hsl(var(--warn)); }
.overall.bad .overall-icon { background: hsl(var(--bad) / 0.15); color: hsl(var(--bad)); }
.overall.pending .overall-icon { color: hsl(var(--muted-foreground)); }
.overall.pending .ico { animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.overall-actions { flex: 0 0 auto; }

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 1rem;
  border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer;
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
}
.btn-outline { background: hsl(var(--card)); color: inherit; border-color: hsl(var(--border)); }
.btn-outline:hover { background: hsl(var(--muted)); }
.btn:disabled { opacity: 0.5; cursor: default; }
.ico { width: 1.1rem; height: 1.1rem; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 0.75rem; }
.check { display: flex; flex-direction: column; gap: 0.5rem; }
.check-head { display: flex; align-items: center; gap: 0.5rem; }
.check-head h2 { font-size: 0.95rem; margin: 0; flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; font-weight: 600; padding: 0.15rem 0.5rem;
  border-radius: 999px; border: 1px solid hsl(var(--border)); background: hsl(var(--muted)); color: hsl(var(--muted-foreground));
}
.badge .ico { width: 0.85rem; height: 0.85rem; }
.badge.ok { color: hsl(var(--ok)); border-color: hsl(var(--ok) / 0.4); background: hsl(var(--ok) / 0.1); }
.badge.warn { color: hsl(var(--warn)); border-color: hsl(var(--warn) / 0.4); background: hsl(var(--warn) / 0.1); }
.badge.bad { color: hsl(var(--bad)); border-color: hsl(var(--bad) / 0.4); background: hsl(var(--bad) / 0.1); }
.badge.pending .ico { animation: spin 1.2s linear infinite; }
.check-body { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.75rem; font-size: 0.875rem; }
.check-body dt { color: hsl(var(--muted-foreground)); white-space: nowrap; }
.check-body dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.check-note { font-size: 0.85rem; color: hsl(var(--muted-foreground)); margin: 0; border-top: 1px solid hsl(var(--border)); padding-top: 0.5rem; }
.check.bad .check-note, .check.warn .check-note { color: inherit; }

.report { margin-top: 0.75rem; }
.report-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-size: 0.875rem; }
.report-row code { background: hsl(var(--muted)); padding: 0.1rem 0.4rem; border-radius: 0.25rem; }

.raw { margin-top: 0.75rem; }
.raw summary { cursor: pointer; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.raw pre { margin: 0.75rem 0 0; overflow-x: auto; font-size: 0.75rem; line-height: 1.4; }

.foot { padding: 1.5rem 1rem 2rem; font-size: 0.8rem; }

@media (max-width: 480px) {
  .topbar-inner { min-height: 3.25rem; }
  .brand-name { font-size: 0.9rem; }
  .expect .label-long { display: none; }
  .expect .label-short { display: inline; }
  .overall h1 { font-size: 1rem; }
}
