@import url("https://fonts.bunny.net/css?family=poppins:300,400,500,600,700");

/* ─── Theme tokens ─── */

:root,
:root[data-theme="light"] {
  --color-primary-500: 6 182 212;
  --color-primary-600: 8 145 178;
  --color-primary-700: 14 116 144;
  --color-neutral-0: 255 255 255;
  --color-neutral-50: 248 250 252;
  --color-neutral-100: 241 245 249;
  --color-neutral-200: 226 232 240;
  --color-neutral-300: 203 213 225;
  --color-neutral-400: 148 163 184;
  --color-neutral-500: 100 116 139;
  --color-neutral-600: 71 85 105;
  --color-neutral-700: 51 65 85;
  --color-neutral-800: 30 41 59;
  --color-neutral-900: 15 23 42;
  --color-typography-400: 148 163 184;
  --color-typography-500: 100 116 139;
  --color-typography-600: 71 85 105;
  --color-typography-700: 51 65 85;
  --color-typography-800: 30 41 59;
  --color-typography-900: 15 23 42;
  --color-typography-950: 2 6 23;
  --color-background: 248 250 252;
  --color-background-50: 241 245 249;
  --color-background-100: 226 232 240;
  --color-background-200: 203 213 225;
  --color-success-500: 52 131 82;
  --color-warning-500: 231 120 40;
  --color-error-500: 230 53 53;
  --surface-shadow: 0 3px 10px rgba(38, 38, 38, 0.2);
}

:root[data-theme="dark"] {
  --color-primary-500: 6 182 212;
  --color-primary-600: 8 145 178;
  --color-primary-700: 14 116 144;
  --color-neutral-0: 0 0 0;
  --color-neutral-50: 2 6 23;
  --color-neutral-100: 15 23 42;
  --color-neutral-200: 30 41 59;
  --color-neutral-300: 51 65 85;
  --color-neutral-400: 71 85 105;
  --color-neutral-500: 100 116 139;
  --color-neutral-600: 148 163 184;
  --color-neutral-700: 203 213 225;
  --color-neutral-800: 226 232 240;
  --color-neutral-900: 241 245 249;
  --color-typography-400: 148 163 184;
  --color-typography-500: 100 116 139;
  --color-typography-600: 148 163 184;
  --color-typography-700: 203 213 225;
  --color-typography-800: 226 232 240;
  --color-typography-900: 241 245 249;
  --color-typography-950: 248 250 252;
  --color-background: 2 6 23;
  --color-background-50: 15 23 42;
  --color-background-100: 30 41 59;
  --color-background-200: 51 65 85;
  --color-success-500: 72 151 102;
  --color-warning-500: 251 149 75;
  --color-error-500: 239 68 68;
  --surface-shadow: 0 0 30px rgba(2, 6, 23, 0.35);
}

/* ─── Reset & base ─── */

html,
body,
#root {
  height: 100%;
}

html {
  color-scheme: light dark;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgb(var(--color-primary-500) / 0.14), transparent 40%),
    linear-gradient(180deg, rgb(var(--color-background-50)) 0%, rgb(var(--color-background)) 100%);
  background-attachment: fixed;
  color: rgb(var(--color-typography-950));
  font-family: "Poppins", "Poppins-Regular", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

button,
input,
textarea {
  font: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ═══════════════════════════════════════════════
   CAPTURE PAGE — Full-screen immersive experience
   ═══════════════════════════════════════════════ */

.k-capture {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
  color: rgb(var(--color-typography-950));
}

/* Centered overlay for loading / ready / submitting / done / error */
.k-capture__overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  padding: 32px 24px;
  text-align: center;
  gap: 20px;
}

.k-capture__overlay--scroll {
  justify-content: flex-start;
  padding-top: 48px;
  overflow-y: auto;
  max-width: 440px;
  margin: 0 auto;
}

/* ── Staggered entrance animation ── */

@keyframes k-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.k-anim {
  opacity: 0;
  animation: k-fade-up 0.5s ease-out both;
}
.k-anim--d0 { animation-delay: 0.05s; }
.k-anim--d1 { animation-delay: 0.2s; }
.k-anim--d2 { animation-delay: 0.4s; }
.k-anim--d3 { animation-delay: 0.55s; }
.k-anim--d4 { animation-delay: 0.7s; }
.k-anim--d5 { animation-delay: 0.85s; }
.k-anim--d6 { animation-delay: 1.05s; }

/* ── Ready screen ── */

.k-ready__hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  aspect-ratio: 5 / 5;
}

.k-ready__hero .k-guide-frame {
  position: absolute;
  inset: 0;
  width: auto;
  aspect-ratio: auto;
}

.k-ready__hero::after {
  content: "";
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(var(--color-primary-500) / 0.15), transparent 70%);
  pointer-events: none;
}

.k-ready__hero svg {
  position: relative;
  z-index: 1;
}

.k-ready__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.k-ready__brand-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.k-ready__instructions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
  max-width: 280px;
}

.k-ready__step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font-size: 13px;
  line-height: 20px;
  color: rgb(var(--color-typography-600));
}

.k-ready__step-num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  background: rgb(var(--color-primary-500) / 0.12);
  color: rgb(var(--color-primary-500));
}

.k-ready__btn {
  margin-top: 8px;
  min-width: 200px;
}

.k-capture__status-text {
  font-size: 14px;
  color: rgb(var(--color-typography-500));
  line-height: 22px;
}

.k-capture__result-text {
  font-size: 18px;
  font-weight: 600;
  margin-top: 4px;
}
.k-capture__result-text--pass {
  color: rgb(var(--color-success-500));
}
.k-capture__result-text--fail {
  color: rgb(var(--color-error-500));
}

/* ── Face guide frame (shared between live + decorative) ── */

.k-guide-frame {
  position: relative;
}

.k-guide-corner {
  position: absolute;
  border-color: rgb(var(--color-primary-500));
  border-style: solid;
  border-width: 0;
}
.k-guide-corner--tl { top: 0; left: 0; border-top-width: var(--gw); border-left-width: var(--gw); border-top-left-radius: var(--gr); }
.k-guide-corner--tr { top: 0; right: 0; border-top-width: var(--gw); border-right-width: var(--gw); border-top-right-radius: var(--gr); }
.k-guide-corner--bl { bottom: 0; left: 0; border-bottom-width: var(--gw); border-left-width: var(--gw); border-bottom-left-radius: var(--gr); }
.k-guide-corner--br { bottom: 0; right: 0; border-bottom-width: var(--gw); border-right-width: var(--gw); border-bottom-right-radius: var(--gr); }

/* Large guide for live capture (with shadow cutout) */
.k-guide--live {
  --gw: 3px;
  --gr: 32px;
  width: min(72%, 300px);
  aspect-ratio: 3 / 4;
  border-radius: 32px;
  box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.25);
}
.k-guide--live .k-guide-corner {
  width: 42px;
  height: 42px;
}

/* Small decorative guide icon for overlay screens */
.k-guide--icon {
  --gw: 2.5px;
  --gr: 22px;
  width: 100px;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
}
.k-guide--icon .k-guide-corner {
  width: 26px;
  height: 26px;
}
.k-guide--icon.k-guide--breathing {
  animation: k-breathe 2.8s ease-in-out infinite;
}


/* Result icon (success / fail circle) */
.k-capture__result-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: k-scale-in 0.35s ease-out;
}
.k-capture__result-icon--pass {
  background: rgb(var(--color-success-500) / 0.12);
}
.k-capture__result-icon--fail {
  background: rgb(var(--color-error-500) / 0.12);
}

.k-icon-check {
  width: 26px;
  height: 14px;
  border-left: 3px solid rgb(var(--color-success-500));
  border-bottom: 3px solid rgb(var(--color-success-500));
  transform: rotate(-45deg);
  margin-top: -6px;
}

.k-icon-x {
  position: relative;
  width: 22px;
  height: 22px;
}
.k-icon-x::before,
.k-icon-x::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgb(var(--color-error-500));
  border-radius: 2px;
}
.k-icon-x::before { transform: translateY(-50%) rotate(45deg); }
.k-icon-x::after { transform: translateY(-50%) rotate(-45deg); }

@keyframes k-breathe {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.06); }
}

@keyframes k-scale-in {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Live camera viewport — fills the entire k-capture container */
.k-capture--live {
  position: relative;
  overflow: hidden;
  background: #000;
}

.k-capture__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}
.k-capture__video--ready {
  opacity: 1;
}
.k-capture__video--hidden {
  opacity: 0;
}

.k-capture__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: rgb(var(--color-typography-400));
  z-index: 1;
}

.k-capture__guide-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
  z-index: 2;
}

/* No-face state — toggled via direct DOM manipulation, not React state */
.k-guide--live .k-guide-corner {
  transition: border-color 0.3s ease;
}
.k-capture--no-face .k-guide-corner {
  border-color: rgb(var(--color-error-500));
}

.k-capture__no-face-label {
  font-size: 13px;
  font-weight: 500;
  color: rgb(255 255 255 / 0.85);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.k-capture--no-face .k-capture__no-face-label {
  opacity: 1;
}

/* HUD — instruction + dots overlaying the camera at the bottom */
.k-capture__hud {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
  pointer-events: none;
  z-index: 3;
}

.k-capture__instruction {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.6);
}

.k-capture__dots {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.k-capture__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.3);
  transition: background-color 0.3s ease, transform 0.3s ease;
}
.k-capture__dot--done {
  background: rgb(var(--color-primary-500));
}
.k-capture__dot--active {
  background: rgb(var(--color-primary-500));
  animation: k-pulse 1.2s ease-in-out infinite;
}

@keyframes k-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.65; }
}

/* Error state sections */
.k-capture__error-section {
  width: 100%;
  text-align: left;
  margin-top: 16px;
}

.k-capture__diagnostics-pre {
  margin-top: 8px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 17px;
  color: rgb(var(--color-typography-600));
  background: rgb(var(--color-neutral-100) / 0.5);
  border-radius: 12px;
  padding: 12px;
}
:root[data-theme="dark"] .k-capture__diagnostics-pre {
  background: rgb(var(--color-neutral-200) / 0.5);
}

/* ═══════════════════════════════════════
   SHARED LAYOUT — Test page
   ═══════════════════════════════════════ */

.k-page-frame {
  min-height: 100%;
  padding: 24px 16px;
  color: rgb(var(--color-typography-950));
}
@media (min-width: 768px) {
  .k-page-frame {
    padding: 24px 32px;
  }
}

.k-page-frame__inner {
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - 48px);
  width: 100%;
  max-width: 72rem;
}

/* ─── Surface card ─── */

.k-surface {
  border-radius: 24px;
  border: 1px solid rgb(var(--color-neutral-200) / 0.8);
  background: rgb(var(--color-neutral-0) / 0.82);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--surface-shadow);
  padding: 20px;
}
:root[data-theme="dark"] .k-surface {
  border-color: rgb(var(--color-neutral-200) / 0.35);
  background: rgb(var(--color-neutral-100) / 0.82);
}
@media (min-width: 768px) {
  .k-surface {
    padding: 28px;
  }
}

/* ─── Badge ─── */

.k-badge {
  display: inline-block;
  border-radius: 9999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.k-badge--success {
  background: rgb(var(--color-success-500) / 0.15);
  color: rgb(var(--color-success-500));
}
.k-badge--error {
  background: rgb(var(--color-error-500) / 0.15);
  color: rgb(var(--color-error-500));
}
.k-badge--info {
  background: rgb(var(--color-primary-500) / 0.12);
  color: rgb(var(--color-primary-600));
}

/* ─── Typography ─── */

.k-label {
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--color-typography-500));
}
.k-label--xs {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgb(var(--color-typography-400));
}
.k-label--strong {
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--color-typography-700));
}

.k-heading-lg {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.025em;
}
.k-heading-md {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.k-text {
  font-size: 13px;
  line-height: 21px;
  color: rgb(var(--color-typography-500));
}
.k-text--secondary {
  color: rgb(var(--color-typography-600));
}
.k-text--bold {
  font-weight: 600;
}
.k-text--error {
  color: rgb(var(--color-error-500));
}
.k-text--success {
  color: rgb(var(--color-success-500));
}
.k-text--break {
  word-break: break-all;
}

/* ─── Buttons ─── */

.k-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}
.k-btn:active {
  transform: scale(0.97);
}

.k-btn--primary {
  background: rgb(var(--color-primary-500));
  color: #fff;
}
.k-btn--primary:hover {
  background: rgb(var(--color-primary-600));
}

.k-btn--secondary {
  border: 1px solid rgb(var(--color-neutral-200));
  background: rgb(var(--color-neutral-0) / 0.7);
  color: rgb(var(--color-typography-900));
}
:root[data-theme="dark"] .k-btn--secondary {
  background: rgb(var(--color-neutral-100) / 0.7);
}
.k-btn--secondary:hover {
  transform: translateY(-1px);
}

.k-btn--sm {
  padding: 6px 14px;
  font-size: 12px;
}

.k-btn--full {
  width: 100%;
}

/* ─── Device selector (capture error state) ─── */

.k-device-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.k-device-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 14px;
  border: 1px solid rgb(var(--color-neutral-200) / 0.8);
  background: rgb(var(--color-neutral-0) / 0.7);
  padding: 10px 14px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.k-device-btn:hover {
  background: rgb(var(--color-neutral-0) / 0.9);
}
:root[data-theme="dark"] .k-device-btn {
  background: rgb(var(--color-neutral-100) / 0.7);
}
:root[data-theme="dark"] .k-device-btn:hover {
  background: rgb(var(--color-neutral-100) / 0.9);
}

.k-device-btn__name {
  font-weight: 500;
  color: rgb(var(--color-typography-800));
}

.k-device-btn__type {
  font-size: 11px;
  color: rgb(var(--color-typography-500));
}

/* ─── QR ─── */

.k-qr {
  display: flex;
  justify-content: center;
  border-radius: 20px;
  background: #fff;
  padding: 16px;
}

/* ─── Selfie ─── */

.k-selfie__img {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  display: block;
}
.k-selfie__img--short {
  height: 180px;
}

/* ═══════════════════════════
   TEST LAB DEBUG PAGE
   ═══════════════════════════ */

.k-lab {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

/* Toolbar */
.k-lab__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgb(var(--color-neutral-200) / 0.5);
  margin-bottom: 20px;
}

.k-lab__title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.k-lab__title span {
  color: rgb(var(--color-typography-400));
  font-weight: 400;
  margin-left: 6px;
}

/* Empty state */
.k-lab__empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgb(var(--color-typography-400));
  font-size: 13px;
}

/* Session header bar */
.k-lab__session {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgb(var(--color-neutral-200) / 0.5);
  background: rgb(var(--color-background-50) / 0.5);
  margin-bottom: 16px;
}

.k-lab__session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.k-lab__session-id {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 13px;
  font-weight: 500;
  color: rgb(var(--color-typography-900));
  letter-spacing: -0.02em;
}

/* Status dot */
.k-lab__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.k-lab__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--color-neutral-400));
  flex-shrink: 0;
}
.k-lab__status-dot--active {
  background: rgb(var(--color-primary-500));
  animation: k-pulse 1.2s ease-in-out infinite;
}
.k-lab__status-dot--pass {
  background: rgb(var(--color-success-500));
}
.k-lab__status-dot--fail {
  background: rgb(var(--color-error-500));
}

.k-lab__session-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.k-lab__challenge {
  margin-top: 8px;
  font-size: 12px;
  color: rgb(var(--color-typography-500));
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

/* Body grid: sidebar + feed */
.k-lab__body {
  display: grid;
  gap: 16px;
}
@media (min-width: 768px) {
  .k-lab__body {
    grid-template-columns: 200px 1fr;
  }
}

/* Sidebar: QR + URLs */
.k-lab__sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.k-lab__qr {
  display: flex;
  justify-content: center;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
}

.k-lab__url {
  font-size: 11px;
}
.k-lab__url-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgb(var(--color-typography-400));
  margin-bottom: 3px;
}
.k-lab__url-value {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  line-height: 16px;
  word-break: break-all;
}
.k-lab__url-value a {
  color: rgb(var(--color-primary-500));
  text-decoration: none;
}
.k-lab__url-value a:hover {
  text-decoration: underline;
}

/* Feed: result + telemetry timeline */
.k-lab__feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

/* Telemetry scroll container */
.k-lab__timeline {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: 420px;
  overflow: hidden;
}
@media (min-width: 768px) {
  .k-lab__timeline {
    max-height: 520px;
  }
}

.k-lab__timeline-scroll {
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgb(var(--color-neutral-300)) transparent;
}
.k-lab__timeline-scroll::-webkit-scrollbar {
  width: 4px;
}
.k-lab__timeline-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.k-lab__timeline-scroll::-webkit-scrollbar-thumb {
  background: rgb(var(--color-neutral-300));
  border-radius: 4px;
}
:root[data-theme="dark"] .k-lab__timeline-scroll::-webkit-scrollbar-thumb {
  background: rgb(var(--color-neutral-400));
}

/* Result panel */
.k-lab__result {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgb(var(--color-neutral-200) / 0.5);
  background: rgb(var(--color-background-50) / 0.5);
}

.k-lab__result-verdict {
  font-size: 13px;
  font-weight: 600;
}

.k-lab__result-meta {
  margin-top: 4px;
  font-size: 12px;
  color: rgb(var(--color-typography-500));
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.k-lab__result-selfie {
  margin-top: 10px;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

/* Telemetry timeline */
.k-lab__timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgb(var(--color-neutral-200) / 0.4);
}

.k-lab__timeline-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgb(var(--color-typography-400));
}

.k-lab__timeline-count {
  font-size: 11px;
  color: rgb(var(--color-typography-400));
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

.k-lab__event {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid rgb(var(--color-neutral-200) / 0.25);
  font-size: 12px;
}

.k-lab__event-time {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  color: rgb(var(--color-typography-400));
  white-space: nowrap;
}

.k-lab__event-type {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 500;
  color: rgb(var(--color-typography-800));
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.k-lab__event-phase {
  font-size: 10px;
  color: rgb(var(--color-typography-400));
  white-space: nowrap;
}

.k-lab__event-payload {
  grid-column: 1 / -1;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 10px;
  line-height: 15px;
  color: rgb(var(--color-typography-500));
  white-space: pre-wrap;
  word-break: break-word;
  padding: 6px 8px;
  background: rgb(var(--color-neutral-100) / 0.5);
  border-radius: 8px;
  margin-top: 2px;
}
:root[data-theme="dark"] .k-lab__event-payload {
  background: rgb(var(--color-neutral-200) / 0.3);
}

.k-lab__no-events {
  font-size: 12px;
  color: rgb(var(--color-typography-400));
  padding: 12px 0;
}

/* ═══════════════════════════
   UTILITIES
   ═══════════════════════════ */

.k-stack-sm > * + * { margin-top: 6px; }
.k-stack > * + * { margin-top: 10px; }
.k-stack-md > * + * { margin-top: 14px; }
.k-stack-lg > * + * { margin-top: 20px; }

.k-mt-1 { margin-top: 4px; }
.k-mt-2 { margin-top: 8px; }
.k-mt-3 { margin-top: 12px; }
.k-mt-4 { margin-top: 16px; }
.k-mt-5 { margin-top: 20px; }
.k-mt-6 { margin-top: 24px; }
.k-mt-8 { margin-top: 32px; }

.k-flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.k-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.k-event-count {
  font-size: 11px;
  color: rgb(var(--color-typography-400));
}

.k-divider {
  height: 1px;
  background: rgb(var(--color-neutral-200) / 0.6);
  margin: 16px 0;
}
