/* Pills, cards/tiles, rows, the hot zone, chat card, and the token/confirm
   dialogs. Componentised to mirror the mockup 1:1 but wired for live data
   and error states. */

/* ── pills / chips ───────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink2);
  white-space: nowrap;
}

.pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}

.pill.good {
  color: var(--good);
  border-color: transparent;
  background: var(--good-bg);
}
.pill.good .dot {
  background: var(--good);
}
.pill.warn {
  color: var(--warn);
  border-color: transparent;
  background: var(--warn-bg);
}
.pill.warn .dot {
  background: var(--warn);
}
.pill.crit {
  color: var(--crit);
  border-color: transparent;
  background: var(--crit-bg);
}
.pill.crit .dot {
  background: var(--crit);
}
.pill.hot {
  color: var(--hot);
  border-color: transparent;
  background: var(--hot-bg);
}
.pill.hot .dot {
  background: var(--hot);
}

/* ── cards & tiles ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

.tile .lbl {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.tile .big {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 10px 0 4px;
  font-variant-numeric: tabular-nums;
}

.tile .sub {
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.55;
  min-height: 1.55em;
}

.tile .sub .mono {
  color: var(--ink2);
  font-size: 11.5px;
}

.tile.error .big {
  color: var(--crit);
  font-size: 18px;
}

.tile-error-text {
  color: var(--crit);
  font-weight: 650;
}

/* ── rows (containers / pipelines) ──────────────────────────────── */
.rows {
  display: flex;
  flex-direction: column;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 4px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}

.row:first-child {
  border-top: none;
}

.row .name {
  font-weight: 650;
}

.row .meta {
  color: var(--muted);
  font-size: 11.5px;
  margin-left: auto;
  text-align: right;
}

/* ── sparkline (decorative only, see js/render.js) ──────────────── */
.spark {
  margin-top: 10px;
}

.spark svg {
  width: 100%;
  height: 56px;
  display: block;
}

/* ── hot zone ────────────────────────────────────────────────────── */
.hotzone {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}

.hotzone .inner {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lifecycle {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:focus-visible,
.potato-btn:focus-visible {
  outline: 2px solid var(--hot);
  outline-offset: 2px;
}

.btn .k {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.potato-btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  color: var(--hot-ink);
  padding: 12px 24px;
  border-radius: 11px;
  position: relative;
  background: linear-gradient(120deg, #f76b15, #e5484d 85%);
  box-shadow: var(--glow);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}

.potato-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.potato-btn .ring {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  border: 2px solid rgba(255, 255, 255, 0);
  pointer-events: none;
}

.potato-btn.armed {
  animation: simmer 1.1s ease-in-out infinite alternate;
}

@keyframes simmer {
  from {
    box-shadow: 0 0 18px rgba(247, 107, 21, 0.3);
  }
  to {
    box-shadow: 0 0 34px rgba(229, 72, 77, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .potato-btn.armed {
    animation: none;
  }
}

.hotnote {
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.6;
  max-width: 60ch;
}

.hotnote b {
  color: var(--hot);
}

.armbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.armmsg {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  min-height: 1em;
}

.armmsg.lit {
  color: var(--crit);
  font-weight: 700;
}

.pipeline-status {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: var(--ink2);
}

.pipeline-status a {
  color: var(--hot);
}

/* ── chat card ───────────────────────────────────────────────────── */
.chat {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chat .face {
  font-size: 34px;
  line-height: 1;
}

.chat .txt {
  flex: 1;
  min-width: 220px;
}

.chat .txt b {
  font-size: 15.5px;
}

.chat .txt p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--ink2);
  line-height: 1.55;
}

.chat a.btn {
  text-decoration: none;
}

/* ── modal dialogs (token prompt + delete confirmation) ─────────── */
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 40px);
}

dialog::backdrop {
  background: rgba(10, 6, 2, 0.55);
}

.dialog-inner {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dialog-inner h3 {
  margin: 0;
  font-size: 17px;
}

.dialog-inner p {
  margin: 0;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.55;
}

.dialog-inner input[type="text"],
.dialog-inner input[type="password"] {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface2);
  color: var(--ink);
  width: 100%;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-error {
  color: var(--crit);
  font-size: 12.5px;
  min-height: 1.2em;
}

/* ── OIDC sign-in screen (AUTH_MODE=oidc, not signed in) ────────────── */
.login-screen {
  min-height: 100vh;
  /* dvh: iOS Safari's 100vh includes the area behind the toolbar, which
     pushed the sign-in button below the visible fold. dvh tracks the real
     visible height so the card stays centered on screen. */
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  max-width: 380px;
  padding: 40px 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--glow);
}

.login-card .spud {
  width: 60px;
  height: 60px;
  flex: none;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 14px rgba(247, 107, 21, 0.35));
}

.login-card h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 850;
  letter-spacing: -0.015em;
}

.login-card h1 .hotword {
  color: var(--hot);
}

.login-card .eyebrow {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.login-card p {
  margin: 6px 0 4px;
  font-size: 13px;
  color: var(--ink2);
  line-height: 1.55;
}

.login-card .gitlab-btn {
  margin-top: 10px;
  text-decoration: none;
  background: linear-gradient(120deg, #f76b15, #e5484d 85%);
  color: var(--hot-ink);
  border: none;
  box-shadow: var(--glow);
}

.login-card .gitlab-btn:hover {
  filter: brightness(1.06);
}

/* ── small-screen refinements (phones) ─────────────────────────────── */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 22px;
  }
  header {
    padding-top: 18px;
  }
  .wrap {
    padding-bottom: 40px;
  }
  /* The lab-host chip can dominate a narrow header; let it sit below the
     brand at full width instead of crowding the row. */
  .topchips {
    margin-left: 0;
    width: 100%;
  }
}
