/* ═══════════════════════════════════════════
   Chromebook Lookup — OHS Tech Team
   ═══════════════════════════════════════════ */

:root {
  --bg:          #07090a;
  --surface:     rgba(16, 20, 21, 0.78);
  --surface-2:   rgba(28, 33, 35, 0.82);
  --surface-solid: #111516;
  --raise:       rgba(255, 255, 255, 0.045);
  --raise-2:     rgba(255, 255, 255, 0.08);
  --border:      rgba(255, 255, 255, 0.08);
  --border-2:    rgba(255, 255, 255, 0.16);

  --text:   #eef2f1;
  --text-2: #a5b0ae;
  --text-3: #6d7977;

  --accent:      #f58220;
  --accent-2:    #ffab5e;
  --accent-ink:  #1c0e00;
  --accent-soft: rgba(245, 130, 32, 0.14);
  --accent-line: rgba(245, 130, 32, 0.42);

  --ok:   #3dd68c;  --ok-soft:   rgba(61, 214, 140, 0.12);
  --bad:  #ff6b6b;  --bad-soft:  rgba(255, 107, 107, 0.12);
  --warn: #ffc24b;  --warn-soft: rgba(255, 194, 75, 0.12);

  --radius:    18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.35);

  --ease:   cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Consolas, monospace;

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: var(--accent-2); }
code, kbd, .mono { font-family: var(--mono); }
code { font-size: 0.86em; background: var(--raise-2); padding: 1px 6px; border-radius: 6px; }
kbd {
  font-size: 0.72rem; padding: 2px 6px; border-radius: 6px;
  background: var(--raise-2); border: 1px solid var(--border-2); border-bottom-width: 2px;
  color: var(--text-2);
}
b, strong { font-weight: 650; }
.muted { color: var(--text-2); font-size: 0.88rem; }
.accent-text {
  background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
::selection { background: rgba(245, 130, 32, 0.35); }

.i {
  width: 1.15em; height: 1.15em; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ── Background ─────────────────────────────── */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop-img {
  position: absolute; inset: -4%;
  background: url('../assets/tornado-bg.jpg') center 30% / cover no-repeat;
  opacity: 0.42;
  filter: saturate(0.8);
  animation: kenburns 60s ease-in-out infinite alternate;
  transition: opacity 0.8s var(--ease);
}
body[data-screen="scan"] .backdrop-img,
body[data-screen="summary"] .backdrop-img { opacity: 0.16; }
.backdrop-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 9, 10, 0.35) 0%, rgba(7, 9, 10, 0.75) 45%, var(--bg) 85%),
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(7, 9, 10, 0.6) 100%);
}
.backdrop-glow {
  position: absolute; left: 50%; top: -260px; width: 900px; height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(245, 130, 32, 0.16), transparent);
  filter: blur(10px);
  animation: glow 9s ease-in-out infinite alternate;
}

/* ── Buttons ────────────────────────────────── */
button { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 11px;
  font-size: 0.9rem; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; background: none; cursor: pointer; text-decoration: none;
  transition: transform 0.18s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.25s, opacity 0.2s, color 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible, .chip:focus-visible, .recent-chip:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.btn-primary {
  color: var(--accent-ink);
  background: linear-gradient(180deg, #ff9a45, var(--accent));
  box-shadow: 0 8px 24px -10px rgba(245, 130, 32, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px -10px rgba(245, 130, 32, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary .i { transition: transform 0.25s var(--ease); }
.btn-primary:hover:not(:disabled) .i { transform: translateX(2px); }

.btn-ghost { background: var(--raise); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: var(--raise-2); border-color: var(--border-2); }
.btn-ghost.danger:hover { color: var(--bad); border-color: rgba(255, 107, 107, 0.4); background: var(--bad-soft); }
.btn-ghost.copied { color: var(--ok); border-color: rgba(61, 214, 140, 0.4); background: var(--ok-soft); }

.btn-danger { background: #e5484d; color: #fff; }
.btn-danger:hover { background: #f2555a; }

.btn-agi { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-2); }
.btn-agi:hover:not(:disabled) { background: rgba(245, 130, 32, 0.24); border-color: var(--accent); color: #ffc796; }
.btn-agi.opened { background: var(--ok-soft); border-color: rgba(61, 214, 140, 0.4); color: var(--ok); }

.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 13px; }
.btn-sm { padding: 7px 12px; font-size: 0.82rem; border-radius: 9px; gap: 6px; }
.btn-xs { padding: 4px 9px; font-size: 0.75rem; border-radius: 7px; gap: 5px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid transparent; color: var(--text-2); cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.18s var(--ease);
}
.icon-btn:hover { background: var(--raise-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.xs .i { width: 0.95em; height: 0.95em; }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; padding: 4px 2px; cursor: pointer;
  color: var(--text-2); font-size: 0.82rem; font-weight: 500;
  transition: color 0.2s;
}
.link-btn:hover { color: var(--accent-2); }
.link-btn .i { transition: transform 0.3s var(--ease); }
.link-btn.open .i { transform: rotate(180deg); }

/* ── Top bar ────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 3vw, 28px);
  background: rgba(7, 9, 10, 0.62);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex; align-items: center; gap: 12px;
  background: none; border: none; padding: 0; cursor: pointer; text-align: left; border-radius: 12px;
}
.brand-logo {
  width: 40px; height: 40px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(245, 130, 32, 0.4), 0 4px 14px rgba(245, 130, 32, 0.25);
  transition: transform 0.4s var(--spring);
}
.brand:hover .brand-logo { transform: rotate(-12deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 750; font-size: 1rem; letter-spacing: -0.01em; }
.brand-sub { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ok);
  box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.6);
  animation: live 2s infinite;
}
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
/* Little dot on "Auto-fill setup": green = installed, amber = update waiting */
#guide-btn { position: relative; }
#guide-btn:is(.is-ready, .needs-update)::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ok); box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(61, 214, 140, 0.8); animation: mark-pop 0.4s var(--spring);
}
#guide-btn.needs-update::after { background: var(--warn); box-shadow: 0 0 0 2px var(--bg), 0 0 8px rgba(255, 194, 75, 0.8); }

/* ── Layout ─────────────────────────────────── */
main { max-width: 1240px; margin: 0 auto; padding: 28px clamp(16px, 3vw, 28px) 96px; }
.screen-enter { animation: screen-enter 0.5s var(--ease); }

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.card-icon {
  flex-shrink: 0; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.card-icon .i { width: 1.3em; height: 1.3em; }
.card-title { font-size: 1.12rem; font-weight: 700; }
.card-sub { color: var(--text-2); font-size: 0.88rem; margin-top: 3px; }

/* ═══════════ START ═══════════ */
.start-wrap { max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }

.hero { text-align: center; padding: 12px 0 4px; }
.hero > * { animation: fade-up 0.7s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: 0.06s; }
.hero > :nth-child(3) { animation-delay: 0.12s; }
.hero > :nth-child(4) { animation-delay: 0.18s; }
.hero .hero-badge {
  position: relative; display: inline-block; vertical-align: top;
  animation: fade-up 0.7s var(--ease) both, float 6s ease-in-out 0.7s infinite;
}
.hero-badge::before, .hero-badge::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.hero-badge::before {   /* a bright streak chasing round the seal */
  inset: -9px;
  background: conic-gradient(from 0deg, transparent 0 58%, rgba(245, 130, 32, 0.15) 70%, rgba(255, 171, 94, 0.95) 88%, transparent 89%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  mask: radial-gradient(closest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px));
  animation: spin 3.6s linear infinite;
}
.hero-badge::after { inset: -17px; border: 1px dashed rgba(245, 130, 32, 0.22); animation: spin 22s linear infinite reverse; }
.hero-logo {
  display: block; width: 84px; height: 84px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(245, 130, 32, 0.45), 0 0 60px rgba(245, 130, 32, 0.35);
}
.eyebrow {
  margin-top: 18px;
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.hero-title { margin-top: 20px; font-size: clamp(2rem, 5.4vw, 3.15rem); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.hero-sub { margin: 14px auto 0; max-width: 500px; color: var(--text-2); font-size: 1.02rem; }

/* Resume banner */
.resume-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(61, 214, 140, 0.12), rgba(61, 214, 140, 0.04));
  border: 1px solid rgba(61, 214, 140, 0.28);
  animation: pop-in 0.45s var(--spring);
}
.resume-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: var(--ok-soft); color: var(--ok); }
.resume-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.resume-text span { color: var(--text-2); font-size: 0.85rem; }
.resume-actions { display: flex; gap: 8px; }

/* Stepper */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 0.84rem; font-weight: 600; transition: color 0.3s; }
.step-dot {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 0.78rem; background: var(--raise-2); border: 1px solid var(--border-2);
  transition: all 0.35s var(--spring);
}
.step.active { color: var(--text); }
.step.active .step-dot { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: scale(1.1); box-shadow: 0 0 0 5px var(--accent-soft); }
.step.done { color: var(--text-2); }
.step.done .step-dot { background: var(--ok); border-color: var(--ok); color: #04170d; }
.step-dot .i { width: 14px; height: 14px; stroke-width: 3.2; animation: mark-pop 0.4s var(--spring); }
.step-line { width: 44px; height: 2px; border-radius: 2px; background: var(--border-2); position: relative; overflow: hidden; }
.step-line::after { content: ''; position: absolute; inset: 0; background: var(--ok); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease); }
.step-line.done::after { transform: scaleX(1); }

/* Link inputs */
.link-list { display: flex; flex-direction: column; gap: 10px; }
.link-row {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 4px;
  padding: 4px 6px 4px 14px; border-radius: 13px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-2);
  transition: border-color 0.2s, box-shadow 0.25s, background 0.2s;
}
.link-row:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(0, 0, 0, 0.5); }
.link-row.valid { border-color: rgba(61, 214, 140, 0.45); }
.link-row.valid:focus-within { box-shadow: 0 0 0 4px var(--ok-soft); border-color: var(--ok); }
.link-row.invalid { border-color: rgba(255, 194, 75, 0.5); }
.link-row.removing { animation: collapse 0.2s var(--ease) forwards; }
.link-icon { color: var(--text-3); display: grid; }
.link-row:focus-within .link-icon { color: var(--accent); }
.link-input {
  width: 100%; min-width: 0; padding: 12px 8px;
  background: none; border: none; outline: none; color: var(--text);
  font: inherit; font-size: 0.95rem;
}
.link-input::placeholder { color: var(--text-3); }
.link-state { display: grid; width: 22px; }
.link-row.valid .link-state { color: var(--ok); animation: mark-pop 0.35s var(--spring); }
.link-row.invalid .link-state { color: var(--warn); }

.needs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.needs-label { font-size: 0.84rem; font-weight: 600; color: var(--text-2); }
.needs .col-chip { font-size: 0.8rem; padding: 4px 10px 4px 8px; }
.needs-note { margin: 8px 0 16px; font-size: 0.8rem; color: var(--text-3); }
.needs-note b { color: var(--text-2); font-weight: 600; }
.connect-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

.recent { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.recent-label { font-size: 0.78rem; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.recent-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  background: var(--raise); border: 1px solid var(--border-2); color: var(--text); font-size: 0.85rem; font-weight: 550;
  transition: all 0.2s var(--ease);
}
.recent-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-chip .i:first-child { color: var(--ok); }
.recent-chip .i:last-child { color: var(--text-3); transition: transform 0.25s var(--ease), color 0.2s; }
.recent-chip:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.recent-chip:hover .i:last-child { transform: translateX(3px); color: var(--accent); }

.share-help { margin-top: 18px; border-radius: var(--radius-sm); background: var(--raise); border: 1px solid var(--border); }
.share-help summary {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; list-style: none;
  font-size: 0.86rem; font-weight: 550; color: var(--text-2); transition: color 0.2s;
}
.share-help summary::-webkit-details-marker { display: none; }
.share-help summary:hover, .share-help[open] summary { color: var(--text); }
.share-help ol { margin: 0; padding: 0 14px 0 34px; color: var(--text-2); font-size: 0.88rem; }
.share-help li { margin: 4px 0; }
.howto { padding: 2px 14px 10px; }
.howto-video {
  display: block; width: 100%; aspect-ratio: 1000 / 644; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--border-2); background: #0b0d0e;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, 0.8);
}
.howto-video.in-error { margin: 10px 0 4px; }
.howto-video.in-guide { margin-top: 12px; }
.howto-video.howto-strip { aspect-ratio: 1000 / 174; }
.guide-body .howto-steps { margin: 8px 0 0; padding-left: 22px; color: var(--text-2); font-size: 0.88rem; }
.guide-body .howto-steps b { color: var(--text); }
.howto-steps li { padding: 3px 8px; margin: 2px 0 2px -8px; border-radius: 8px; transition: background 0.3s, color 0.3s; }
.howto-steps li.playing { background: var(--accent-soft); color: var(--text); }
.howto-steps li.playing::marker { color: var(--accent); font-weight: 700; }
.share-help li b { color: var(--text); }
.share-help p { padding: 8px 14px 14px; font-size: 0.8rem; }
.share-help[open] ol, .share-help[open] p, .share-help[open] .howto { animation: fade-up 0.35s var(--ease); }

.or-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--text-3); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 20px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px dashed var(--border-2); background: rgba(0, 0, 0, 0.2);
  transition: border-color 0.2s, background 0.2s, transform 0.25s var(--ease);
}
.dropzone:hover { border-color: var(--text-3); background: rgba(255, 255, 255, 0.03); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone-icon { width: 26px; height: 26px; color: var(--text-3); margin-bottom: 4px; transition: transform 0.3s var(--spring), color 0.2s; }
.dropzone:hover .dropzone-icon, .dropzone.over .dropzone-icon { transform: translateY(-3px); color: var(--accent); }
.dropzone-title { font-weight: 600; font-size: 0.92rem; }
.dropzone-title u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.dropzone-sub { color: var(--text-3); font-size: 0.8rem; }

/* Check card */
.check-card .card-icon { position: relative; }
.check-card .card-icon .tornado { width: 34px; height: 34px; }
.check-card.is-ok .card-icon { background: var(--ok-soft); color: var(--ok); border-color: rgba(61, 214, 140, 0.4); box-shadow: 0 0 24px -4px rgba(61, 214, 140, 0.45); }
.check-card.is-fail .card-icon { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 107, 107, 0.4); }

/* Thin progress line along the top edge, with a glowing head */
.check-progress {
  position: absolute; top: -1px; left: 24px; right: 24px; height: 2px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.06); transition: opacity 0.6s 1s;
}
.check-progress i {
  position: relative; display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(245, 130, 32, 0.8);
  transition: width 0.6s var(--ease), background 0.3s, box-shadow 0.3s;
}
.check-progress i::after {
  content: ''; position: absolute; right: -6px; top: -4px; width: 14px; height: 10px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 230, 200, 0.95), transparent);
}
.check-card.is-ok .check-progress { opacity: 0; }
.check-card.is-ok .check-progress i { background: var(--ok); box-shadow: 0 0 10px rgba(61, 214, 140, 0.8); }
.check-card.is-fail .check-progress i { background: var(--bad); box-shadow: 0 0 10px rgba(255, 107, 107, 0.8); }
.check-card:is(.is-ok, .is-fail) .check-progress i::after { display: none; }

/* Little sparks that fly off the tick when the sheet connects */
.sparks { position: absolute; inset: 0; pointer-events: none; }
.sparks i {
  position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%;
  background: var(--ok); opacity: 0;
  animation: spark 0.75s var(--ease) 0.05s both;
}
.sparks i:nth-child(even) { background: var(--accent-2); width: 4px; height: 4px; margin: -2px; }
@keyframes spark {
  0% { opacity: 1; transform: rotate(calc(var(--k) * 45deg)) translateY(-10px) scale(1); }
  100% { opacity: 0; transform: rotate(calc(var(--k) * 45deg)) translateY(-36px) scale(0.3); }
}

.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.check { position: relative; display: flex; gap: 12px; padding: 10px 12px; border-radius: 11px; transition: background 0.3s; }
.check.running { background: var(--raise); }
.check-mark {
  flex-shrink: 0; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%; margin-top: 1px;
  background: var(--raise-2); color: var(--text-2);
}
.check.running .check-mark { background: var(--accent-soft); }
.check-mark .tornado { width: 19px; height: 19px; }
.check-mark .i { width: 14px; height: 14px; stroke-width: 3; }
.check.ok .check-mark { background: var(--ok); color: #04170d; }
.check.warn .check-mark { background: var(--warn); color: #241800; }
.check.fail .check-mark { background: var(--bad); color: #2a0505; }
.check-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.check-text { font-weight: 600; font-size: 0.92rem; }
.check-detail { color: var(--text-2); font-size: 0.84rem; display: flex; flex-wrap: wrap; gap: 6px; }
.check-detail:empty { display: none; }
.check.fail .check-detail { color: #ff9a9a; }
.check-detail .doc-name { color: var(--text); font-weight: 600; }
.check-detail .ready-num { color: var(--ok); font-weight: 750; font-variant-numeric: tabular-nums; }

/* Tabs branch off the spreadsheet's line: a trunk under its tick, an elbow into each tab */
.check.has-tree::before {
  content: ''; position: absolute; left: 23.25px; top: 38px; bottom: 37px;
  border-left: 1.5px solid var(--border-2);
  transform-origin: top; animation: grow-down 0.4s var(--ease);
}
.tab-tree { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tab-row {
  position: relative; display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px 0 6px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.28); border: 1px solid var(--border); font-size: 0.86rem;
  transition: border-color 0.35s, background-color 0.35s, opacity 0.35s;
  animation: slide-in 0.35s var(--ease) both; animation-delay: calc(var(--k, 0) * 90ms);
}
.tab-row::before {
  content: ''; position: absolute; left: -25px; width: 18px; top: 50%;
  border-top: 1.5px solid var(--border-2); transition: border-color 0.4s;
}
.tab-row:last-child::before {
  top: calc(50% - 8px); height: 8px; border-top: 0;
  border-left: 1.5px solid var(--border-2); border-bottom: 1.5px solid var(--border-2); border-bottom-left-radius: 8px;
}
.tab-row.ok::before { border-color: rgba(61, 214, 140, 0.5); }
.tab-row.running {
  border-color: var(--accent-line);
  background-image: linear-gradient(100deg, transparent 35%, rgba(245, 130, 32, 0.16) 50%, transparent 65%);
  background-size: 250% 100%; background-repeat: no-repeat;
  animation: slide-in 0.35s var(--ease) both, sheen 1.3s linear infinite;
  animation-delay: calc(var(--k, 0) * 90ms), 0s;
}
.tab-row.queued { opacity: 0.6; }
.tab-row.queued .tab-ico { background: var(--raise-2); color: var(--text-3); }
.tab-row.ok { border-color: rgba(61, 214, 140, 0.26); }
.tab-row.fail { border-color: rgba(255, 107, 107, 0.4); background-color: var(--bad-soft); }
.tab-ico {
  flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: var(--accent-soft); color: var(--text-2);
}
.tab-ico .tornado { width: 20px; height: 20px; }
.tab-ico .i { width: 15px; height: 15px; animation: mark-pop 0.4s var(--spring); }
.tab-row.ok .tab-ico { background: var(--ok-soft); color: var(--ok); }
.tab-row.skip .tab-ico { background: var(--warn-soft); color: var(--warn); }
.tab-row.fail .tab-ico { background: var(--bad-soft); color: var(--bad); }
.tab-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-state { display: inline-flex; align-items: baseline; gap: 5px; color: var(--text-3); font-size: 0.82rem; white-space: nowrap; }
.tab-state b { color: var(--text); font-weight: 750; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.tab-row.ok .tab-state { color: var(--text-2); animation: fade-up 0.35s var(--ease); }
.tab-row.skip .tab-state { color: var(--warn); }
.tab-row.fail .tab-state { color: #ff9a9a; }

/* "Loading..." with dots that tick along */
.dots { display: inline-block; width: 1.1em; text-align: left; }
.dots::after { content: ''; animation: dots 1.2s steps(1) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }

.col-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px; border-radius: 999px; font-size: 0.78rem; font-weight: 600;
  animation: pop-in 0.3s var(--spring) both;
}
.col-chip:nth-child(2) { animation-delay: 0.05s; }
.col-chip:nth-child(3) { animation-delay: 0.1s; }
.col-chip:nth-child(4) { animation-delay: 0.15s; }
.col-chip:nth-child(5) { animation-delay: 0.2s; }
.col-chip .i { width: 12px; height: 12px; stroke-width: 3; }
.col-chip em { font-style: normal; font-weight: 500; opacity: 0.7; }
.col-chip.has { background: var(--ok-soft); color: var(--ok); }
.col-chip.missing { background: var(--raise-2); color: var(--text-3); }

.preview { margin-top: 16px; animation: fade-up 0.4s var(--ease) 0.1s both; }
.preview-label { font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 8px; }
.preview-table {
  display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  border: 1px solid var(--border); border-radius: 11px; overflow: hidden; font-size: 0.82rem;
}
.preview-table > span { padding: 8px 12px; border-top: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.preview-table > .ph { border-top: none; background: var(--raise); color: var(--text-3); font-weight: 650; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; }
.preview-table > .mono { color: var(--text); animation: fade-up 0.35s var(--ease) both; animation-delay: calc(0.25s + var(--r, 0) * 0.08s); }

.error-box {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px;
  background: var(--bad-soft); border: 1px solid rgba(255, 107, 107, 0.25);
  color: var(--text); font-size: 0.9rem;
  animation: fade-up 0.35s var(--ease);
}
.error-box ol { margin: 8px 0; padding-left: 20px; }
.error-box li { margin: 3px 0; }
.found-headers { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 0.82rem; color: var(--text-2); }

.check-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; flex-wrap: wrap; }


/* ═══════════ SCAN ═══════════ */
.scan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.scan-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* Scan card: a title, one big quiet input, and a footer line about the sheet */
.scanner-card {
  --pad: 24px;
  padding: var(--pad) var(--pad) 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px), var(--surface);
  transition: border-color 0.35s, box-shadow 0.35s;
}
.scanner-card:has(.scanner-input:focus) { border-color: rgba(245, 130, 32, 0.22); }
.scanner-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.scanner-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.scanner-title label { cursor: text; }
.scanner-hint { display: block; margin-top: 3px; font-size: 0.85rem; color: var(--text-3); }

/* "Scanner ready" only while the box has the cursor — a scan typed anywhere else is lost */
.scan-status { flex-shrink: 0; font-size: 0.78rem; font-weight: 550; color: var(--text-3); padding-bottom: 2px; }
.scan-status > span { display: inline-flex; align-items: center; gap: 7px; }
.scan-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.scan-status kbd { padding: 0 5px; font-size: 0.68rem; }
.scan-status .ss-ready { display: none; color: var(--ok); }
.scan-status .ss-ready i { background: var(--ok); animation: live 1.6s infinite; }
.scanner-card:has(.scanner-input:focus) .scan-status .ss-ready { display: inline-flex; animation: fade-up 0.25s var(--ease); }
.scanner-card:has(.scanner-input:focus) .scan-status .ss-idle { display: none; }

.scanner { position: relative; }
.scanner-ico {
  position: absolute; left: 21px; top: 50%; transform: translateY(-50%);
  display: grid; color: var(--text-3); pointer-events: none; transition: color 0.25s;
}
.scanner-ico .i { width: 22px; height: 22px; }
.scanner:focus-within .scanner-ico { color: var(--accent); }
.scanner-input {
  width: 100%; height: 70px; padding: 0 76px 0 58px;
  font-family: var(--mono); font-size: clamp(1.25rem, 2.4vw, 1.55rem); font-weight: 600; letter-spacing: 0.03em;
  color: var(--text); background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-2); border-radius: 16px; outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 -16px 32px -24px rgba(0, 0, 0, 0.7);
  transition: border-color 0.2s, box-shadow 0.3s, background 0.2s;
}
.scanner-input::placeholder { color: rgba(255, 255, 255, 0.2); font-weight: 500; }
.scanner-input:hover:not(:focus) { border-color: rgba(255, 255, 255, 0.22); }
.scanner-input:focus {
  border-color: rgba(245, 130, 32, 0.75); background: rgba(255, 255, 255, 0.045);
  box-shadow: 0 0 0 4px rgba(245, 130, 32, 0.12), 0 10px 34px -14px rgba(245, 130, 32, 0.45);
}
/* Enter key on the right: quiet until there's something to look up */
.scanner-go {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--border-2); background: var(--raise-2); color: var(--text-3);
  transition: background 0.25s, color 0.2s, border-color 0.2s, box-shadow 0.3s, transform 0.18s var(--ease);
}
.scanner-go .i { width: 18px; height: 18px; stroke-width: 2.2; }
.scanner-go:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.24); }
.scanner-go:active { transform: translateY(-50%) scale(0.93); }
.scanner-go:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.scanner.has-value .scanner-go {
  color: var(--accent-ink); border-color: transparent;
  background: linear-gradient(180deg, #ff9a45, var(--accent));
  box-shadow: 0 6px 18px -6px rgba(245, 130, 32, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* A flash of light across the box on every lookup: green found, red not */
.scanner-sweep { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; pointer-events: none; }
.scanner-sweep::before {
  content: ''; position: absolute; top: 0; bottom: 0; left: -35%; width: 35%; opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(61, 214, 140, 0.3), transparent);
}
.scanner.swept-bad .scanner-sweep::before { background: linear-gradient(90deg, transparent, rgba(255, 107, 107, 0.3), transparent); }
.scanner:is(.swept, .swept-bad) .scanner-sweep::before { animation: sweep 0.6s var(--ease); }
@keyframes sweep { from { left: -35%; opacity: 1; } to { left: 100%; opacity: 1; } }

/* Footer: the sheet you're scanning against */
.source-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap;
  margin: 20px calc(var(--pad) * -1) 0; padding: 13px var(--pad);
  border-top: 1px solid var(--border); border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px);
  background: rgba(0, 0, 0, 0.2); font-size: 0.8rem; color: var(--text-3);
}
.src-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.src-dot { flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.src-name { color: var(--text-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.src-tabs { display: inline-flex; flex-wrap: wrap; gap: 4px 0; }
.src-tab { white-space: nowrap; animation: fade-up 0.35s var(--ease) both; }
.src-tab b { color: var(--text-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.src-tab + .src-tab::before { content: '·'; margin: 0 9px; color: var(--text-3); opacity: 0.6; }
.src-side { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.src-time { white-space: nowrap; }
.src-side .icon-btn { color: var(--text-3); }
.src-side .icon-btn:hover .i { transform: rotate(180deg); }
.src-side .icon-btn .i { transition: transform 0.4s var(--ease); }
.src-side .icon-btn .tornado { width: 16px; height: 16px; }

/* Result */
.result-card { overflow: hidden; }
.result-card.found { border-color: rgba(61, 214, 140, 0.3); }
.result-card.found::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--ok), rgba(61, 214, 140, 0.1));
}
.result-card.missing { border-color: rgba(255, 107, 107, 0.3); }
.result-card.missing::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--bad), rgba(255, 107, 107, 0.1));
}
.result-card.logged { animation: fly-out 0.4s var(--ease) forwards; }
.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 8px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700;
}
.badge .i { width: 14px; height: 14px; stroke-width: 3; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.result-card.choose { border-color: rgba(255, 194, 75, 0.35); }
.result-card.choose::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 3px;
  background: linear-gradient(90deg, var(--warn), rgba(255, 194, 75, 0.1));
}
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border-2);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--spring);
  animation: slide-in 0.35s var(--ease) both;
}
.choice:nth-child(2) { animation-delay: 0.06s; } .choice:nth-child(3) { animation-delay: 0.12s; }
.choice:hover, .choice:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; transform: translateX(3px); }
.choice > .i { color: var(--text-3); margin-left: auto; transition: color 0.2s, transform 0.2s; }
.choice:hover > .i, .choice:focus-visible > .i { color: var(--accent); transform: translateX(2px); }
.choice-key {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; flex-shrink: 0;
  background: var(--raise-2); font-weight: 800; font-size: 0.85rem; color: var(--text-2);
}
.choice-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.choice-sn { font-size: 1.1rem; font-weight: 700; }
.choice-src { font-size: 0.78rem; color: var(--text-3); }
.choice-tip { margin-top: 12px; font-size: 0.8rem; color: var(--text-3); }
.result-src { font-size: 0.78rem; color: var(--text-3); }
/* Match: one slim row — tick, OBE, serial, where it came from */
.result-card.found { padding: 13px 16px; }
.match-row { display: flex; align-items: center; gap: 12px; }
.match-ok { flex-shrink: 0; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); animation: mark-pop 0.4s var(--spring); }
.match-ok .i { width: 15px; height: 15px; stroke-width: 3; }
.match-ids { flex: 1; min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; }
.match-obe { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.02em; }
.match-sn { font-size: 1rem; color: var(--text-2); letter-spacing: 0.02em; overflow-wrap: anywhere; }
.match-src { flex-shrink: 0; font-size: 0.76rem; color: var(--text-3); white-space: nowrap; }
.result-card.found .dup-note { margin-top: 12px; }
.result-msg { font-size: 1rem; }
.tips { margin: 10px 0 0; padding-left: 18px; color: var(--text-2); font-size: 0.86rem; }
.dup-note {
  display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start;
  margin-top: 14px; padding: 14px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(255, 194, 75, 0.14), rgba(255, 194, 75, 0.04));
  border: 1px solid rgba(255, 194, 75, 0.35);
  animation: pop-in 0.35s var(--spring);
}
.dup-icon {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 194, 75, 0.18); color: var(--warn);
}
.dup-body { min-width: 0; }
.dup-title { display: block; color: #ffd98a; font-size: 0.95rem; font-weight: 700; }
.dup-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0 12px; }
.dup-tags .mini-tag { font-size: 0.78rem; padding: 3px 9px; }
.dup-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dup-update { background: var(--warn); color: #241800; }
.dup-update:hover { filter: brightness(1.08); }
.dup-hint { margin-top: 9px; font-size: 0.8rem; color: var(--text-3); }
.dup-hint b { color: var(--text-2); }
.dup-note.editing { background: linear-gradient(135deg, rgba(245, 130, 32, 0.14), rgba(245, 130, 32, 0.04)); border-color: var(--accent-line); }
.dup-note.editing .dup-icon { background: var(--accent-soft); color: var(--accent); }
.dup-note.editing .dup-title { color: var(--accent-2); }

/* Issue picker */
.issue-card { padding: 18px 20px; }
.issue-card.leaving { animation: fade-out 0.3s var(--ease) forwards; }
.issue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.issue-title { font-size: 1.05rem; font-weight: 700; }
.issue-count { font-size: 0.78rem; color: var(--text-3); font-weight: 600; transition: color 0.2s; }
.issue-count.full { color: var(--accent); }
.issue-picked { display: flex; flex-wrap: wrap; gap: 8px; }
.issue-picked:not(:empty) { margin-bottom: 12px; }
.pick {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 6px 5px 6px; border-radius: 10px; font-weight: 650; font-size: 0.88rem;
  background: hsl(var(--hue) 75% 55% / 0.18); border: 1px solid hsl(var(--hue) 75% 60% / 0.45); color: hsl(var(--hue) 90% 82%);
}
.pick-num {
  display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  background: hsl(var(--hue) 75% 60%); color: #0b0b0b; font-size: 0.72rem; font-weight: 800;
}
.pick button {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px;
  background: none; border: none; color: inherit; opacity: 0.7; cursor: pointer; transition: opacity 0.2s, background 0.2s;
}
.pick button:hover { opacity: 1; background: rgba(0, 0, 0, 0.25); }
.pick button .i { width: 13px; height: 13px; }
.issue-search {
  display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.4); border: 1.5px solid var(--border-2); color: var(--text-3);
  transition: border-color 0.2s, box-shadow 0.25s;
}
.issue-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); color: var(--accent); }
.issue-search input { flex: 1; min-width: 0; padding: 13px 0; background: none; border: none; outline: none; font: inherit; font-size: 0.98rem; color: var(--text); }
.issue-search input::placeholder { color: var(--text-3); }
.issue-grid { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; padding: 2px; }
.tier-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin-bottom: 7px; }
.tier-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.issue-none { padding: 14px; text-align: center; color: var(--text-3); font-size: 0.88rem; border: 1px dashed var(--border-2); border-radius: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 9px; cursor: pointer;
  font-size: 0.85rem; font-weight: 550; color: var(--text);
  background: var(--raise); border: 1px solid var(--border);
  transition: background 0.18s, border-color 0.18s, transform 0.2s var(--spring), box-shadow 0.2s;
  animation: chip-in 0.25s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 12ms);   /* chips ripple in one after another */
}
.chip::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); opacity: 0.85; }
.chip:hover { background: var(--raise-2); border-color: var(--border-2); transform: translateY(-1px); }
.chip.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip.picked { background: hsl(var(--hue) 75% 55% / 0.2); border-color: hsl(var(--hue) 75% 60% / 0.55); color: hsl(var(--hue) 90% 85%); }
.chip.picked::before { display: none; }
.chip-num {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px;
  background: hsl(var(--hue) 75% 60%); color: #0b0b0b; font-size: 0.7rem; font-weight: 800;
}
.local-tag {
  flex-shrink: 0; padding: 1px 8px; border-radius: 999px; font-size: 0.7rem; font-weight: 650;
  background: var(--raise-2); color: var(--text-3); white-space: nowrap;
}
.btn-primary.opened { background: var(--ok-soft); color: var(--ok); box-shadow: none; border-color: rgba(61, 214, 140, 0.4); }
.issue-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.kbd-hints { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-3); }
.kbd-hints kbd:not(:first-child) { margin-left: 8px; }
.issue-foot-btns { display: flex; gap: 8px; margin-left: auto; }

.btn-finish {
  flex-shrink: 0; padding: 16px 26px; border-radius: 14px; font-size: 1.05rem; font-weight: 800;
  color: #03170c; background: linear-gradient(180deg, #6af0ae, var(--ok));
  box-shadow: 0 10px 28px -10px rgba(61, 214, 140, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-finish:hover { transform: translateY(-1px); box-shadow: 0 14px 34px -10px rgba(61, 214, 140, 1), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
.btn-finish .i { width: 20px; height: 20px; stroke-width: 3; }
.btn-finish { position: relative; overflow: hidden; }
.btn-finish::after {   /* a soft shine that sweeps across now and then */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-130%); animation: shine 4s ease-in-out 1.2s infinite;
}
@keyframes shine { 0%, 65% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }

/* Floating session dock */
.dock {
  position: fixed; left: 50%; bottom: 20px; z-index: 60;
  width: min(880px, calc(100vw - 32px));
  transform: translate(-50%, 150%); opacity: 0;
  transition: transform 0.55s var(--spring), opacity 0.3s var(--ease);
}
.dock.open { transform: translate(-50%, 0); opacity: 1; }
.dock-inner {
  display: flex; align-items: center; gap: 16px; padding: 12px 12px 12px 20px;
  border-radius: 22px; background: rgba(14, 18, 19, 0.86);
  backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--border-2);
  box-shadow: 0 26px 60px -18px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(61, 214, 140, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.dock-count { display: flex; flex-direction: column; line-height: 1.05; flex-shrink: 0; }
.dock-count strong { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; display: inline-block; }
.dock-count span { font-size: 0.68rem; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.dock-groups {
  display: flex; gap: 6px; flex: 1; min-width: 0; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
}
.dock-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 5px 5px 5px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;
  background: var(--raise); border: 1px solid var(--border);
}
.dock-chip i { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); box-shadow: 0 0 8px hsl(var(--hue) 75% 60% / 0.7); }
.dock-chip b { padding: 0 7px; border-radius: 999px; font-size: 0.74rem; background: hsl(var(--hue) 75% 55% / 0.2); color: hsl(var(--hue) 90% 82%); }
.dock-chip.pop { animation: mark-pop 0.5s var(--spring); border-color: hsl(var(--hue) 75% 60% / 0.6); }
.dock-time { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 0.8rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.dock-time .i { width: 14px; height: 14px; }
.dock .btn-finish { flex-shrink: 0; padding: 14px 22px; font-size: 1rem; }
.show-sm { display: none; }
body.has-dock main { padding-bottom: 140px; }
body.has-dock .toasts { bottom: 112px; }
/* While picking a repair the dock steps aside so it never covers the Log button */
body.picking .dock.open { transform: translate(-50%, 150%); opacity: 0; pointer-events: none; }
body.picking .toasts { bottom: 16px; }
/* On the scan screen pop-ups keep clear of the repair picker: bottom-right under the
   session panel when there are two columns, top of the screen when there's one */
@media (min-width: 981px) {
  body[data-screen="scan"] .toasts { left: auto; right: clamp(16px, 3vw, 28px); transform: none; align-items: flex-end; max-width: 390px; }
}
@media (max-width: 980px) {
  body.picking .toasts { top: 78px; bottom: auto; }
}
.issue-card { scroll-margin: 16px; }
body.has-dock .session-card { max-height: calc(100vh - 230px); }
.reopen-btn { margin-top: 16px; animation: fade-up 0.5s var(--ease) 0.4s both; }

/* Session panel */
.session-card { position: sticky; top: 88px; display: flex; flex-direction: column; max-height: calc(100vh - 110px); padding: 0; overflow: hidden; }
.session-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.session-title { font-size: 1.02rem; font-weight: 700; }
.session-sub { font-size: 0.8rem; color: var(--text-3); }
/* Main-repair counters: Hinge 3 · Screen 4 … */
.session-groups {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px;
  border-bottom: 1px solid var(--border); background: rgba(0, 0, 0, 0.16);
}
.sg-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 3px 3px 9px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; color: var(--text-2); white-space: nowrap;
  background: var(--raise); border: 1px solid var(--border); transition: border-color 0.3s;
}
.sg-chip i { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); box-shadow: 0 0 8px hsl(var(--hue) 75% 60% / 0.6); }
.sg-chip b {
  min-width: 22px; padding: 0 6px; border-radius: 999px; text-align: center; font-size: 0.72rem; font-variant-numeric: tabular-nums;
  background: hsl(var(--hue) 75% 55% / 0.2); color: hsl(var(--hue) 90% 82%);
}
.sg-chip.pop { border-color: hsl(var(--hue) 75% 60% / 0.6); animation: mark-pop 0.5s var(--spring); }
.sg-chip.pop b { animation: bump-kf 0.5s var(--spring) 0.1s; }
.session-body { flex: 1; overflow-y: auto; padding: 12px; overscroll-behavior: contain; }

.group-dot { flex-shrink: 0; width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); box-shadow: 0 0 10px hsl(var(--hue) 75% 60% / 0.6); }
.claim-list { list-style: none; margin: 0; padding: 0; }
/* Newest on top. Left edge in the main repair's colour; repairs on a second line */
.claim-row {
  position: relative;
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto auto;
  grid-template-areas: "num ids time rm" ". tags tags tags";
  align-items: center; column-gap: 10px; row-gap: 6px;
  padding: 10px 4px 10px 12px; border-radius: 10px; font-size: 0.82rem;
  transition: background 0.2s;
}
.claim-row::before {
  content: ''; position: absolute; left: 2px; top: 11px; bottom: 11px; width: 3px; border-radius: 3px;
  background: hsl(var(--hue) 75% 60%); opacity: 0.85;
}
.claim-row + .claim-row { box-shadow: 0 -1px 0 var(--border); }
.claim-row:hover { background: var(--raise); }
.cr-num { grid-area: num; color: var(--text-3); font-size: 0.72rem; font-weight: 650; font-variant-numeric: tabular-nums; text-align: right; }
.cr-ids { grid-area: ids; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cr-obe { flex-shrink: 0; font-weight: 700; }
.cr-sn { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-time { grid-area: time; color: var(--text-3); font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.cr-remove { grid-area: rm; }
.cr-issues { grid-area: tags; display: flex; flex-wrap: wrap; gap: 5px; }
.cr-main, .cr-extra { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 6px; font-size: 0.74rem; font-weight: 650; }
.cr-main { background: hsl(var(--hue) 75% 55% / 0.16); color: hsl(var(--hue) 90% 80%); }
.cr-main i { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); }
.cr-extra { background: var(--raise); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; }
/* Remove: always-visible trash, then an inline "Remove …? Remove / Keep" over the row */
.cr-remove {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid transparent; color: var(--text-3);
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}
.cr-remove .i { width: 15px; height: 15px; }
.cr-remove:hover, .cr-remove:focus-visible { color: var(--bad); background: var(--bad-soft); border-color: rgba(255, 107, 107, 0.3); outline: none; }
.cr-confirm {
  position: absolute; inset: 0; z-index: 1;
  display: none; align-items: center; justify-content: flex-end; gap: 8px; padding: 0 8px 0 12px;
  border-radius: 8px; background: rgba(46, 18, 18, 0.96); border: 1px solid rgba(255, 107, 107, 0.4);
  font-size: 0.82rem; color: #ffb4b4;
}
.cr-confirm > span { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-confirm b { color: #fff; font-family: var(--mono); }
.claim-row.confirming .cr-confirm { display: flex; animation: pop-in 0.2s var(--ease); }
.cr-yes, .cr-no { border-radius: 7px; padding: 4px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer; border: 1px solid transparent; }
.cr-yes { background: #e5484d; color: #fff; }
.cr-yes:hover { background: #f2555a; }
.cr-no { background: rgba(255, 255, 255, 0.08); color: var(--text); border-color: var(--border-2); }
.cr-no:hover { background: rgba(255, 255, 255, 0.14); }
.mini-tag { font-size: 0.7rem; font-weight: 650; padding: 1px 7px; border-radius: 6px; background: hsl(var(--hue) 75% 55% / 0.16); color: hsl(var(--hue) 90% 80%); }
.claim-row.new { animation: row-in 0.55s var(--spring), row-flash 1.6s var(--ease); }
.claim-row.removing { animation: collapse 0.24s var(--ease) forwards; }

.panel-empty { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; padding: 22px 8px 28px; color: var(--text-3); font-size: 0.84rem; }
.panel-empty p { max-width: 260px; }
.panel-empty strong { display: block; margin-bottom: 3px; color: var(--text); font-size: 0.95rem; }
/* Placeholder rows that shimmer where logged Chromebooks will appear */
.ghost-rows { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ghost-row {
  display: grid; grid-template-columns: 0.9fr 1.1fr 38px; gap: 12px; align-items: center;
  padding: 11px 12px; border-radius: 10px; border: 1px dashed var(--border-2);
  animation: fade-up 0.4s var(--ease) both;
}
.ghost-row:nth-child(1) { border-color: var(--accent-line); background: rgba(245, 130, 32, 0.05); animation: fade-up 0.4s var(--ease) both, ghost-next 2.4s ease-in-out 0.6s infinite; }
.ghost-row:nth-child(2) { opacity: 0.55; animation-delay: 0.08s; }
.ghost-row:nth-child(3) { opacity: 0.25; animation-delay: 0.16s; }
.ghost-row i {
  height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--raise-2) 40%, rgba(255, 255, 255, 0.17) 50%, var(--raise-2) 60%) 0 0 / 250% 100% no-repeat, var(--raise-2);
  animation: sheen 1.8s linear infinite;
}
.ghost-row i:nth-child(2) { width: 85%; animation-delay: 0.1s; }
.ghost-row i:nth-child(3) { animation-delay: 0.2s; }
.ghost-row:nth-child(1) i:first-child { background-color: var(--accent-soft); }
@keyframes ghost-next { 50% { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(245, 130, 32, 0.08); } }

/* ═══════════ SUMMARY ═══════════ */
.summary-wrap { max-width: 660px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.summary-hero { text-align: center; padding: 10px 0 0; }
.done-mark {
  position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto; border-radius: 50%;
  background: var(--ok-soft); border: 1px solid rgba(61, 214, 140, 0.35); color: var(--ok);
  animation: pop-in 0.45s var(--spring) both;
}
.done-mark .i { width: 24px; height: 24px; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.45s var(--ease) 0.25s forwards; }
.done-mark::after { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--ok); animation: ring 1.3s var(--ease) 0.3s both; }
.summary-hero h1 { margin-top: 16px; font-size: clamp(1.6rem, 3.6vw, 2.1rem); font-weight: 750; letter-spacing: -0.03em; animation: fade-up 0.5s var(--ease) 0.1s both; }
.summary-hero p { margin-top: 4px; animation: fade-up 0.5s var(--ease) 0.15s both; }

.sum-stats { display: flex; justify-content: center; margin: 4px 0 10px; animation: fade-up 0.5s var(--ease) 0.2s both; }
.sum-stats > div { display: flex; flex-direction: column; align-items: center; padding: 2px 28px; }
.sum-stats > div + div { border-left: 1px solid var(--border-2); }
.stat-num { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 0.78rem; color: var(--text-3); }

.sum-card { padding: 0; overflow: hidden; animation: fade-up 0.5s var(--ease) 0.25s both; }
.sum-card-body { padding: 22px 22px 20px; }
.sum-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sum-card h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.015em; }
.sum-card-head p { margin-top: 3px; font-size: 0.86rem; color: var(--text-3); }
.sum-count { flex-shrink: 0; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; color: var(--text-2); background: var(--raise); border: 1px solid var(--border); font-variant-numeric: tabular-nums; }

/* One thin bar split by main repair, then a pill per group */
.mix-bar { display: flex; gap: 3px; height: 6px; margin-top: 18px; border-radius: 99px; overflow: hidden; animation: mix-in 0.9s var(--ease) 0.35s both; }
.mix-bar i { flex: var(--n) 1 0; min-width: 6px; background: hsl(var(--hue) 62% 58%); }
@keyframes mix-in { from { clip-path: inset(0 100% 0 0 round 99px); } to { clip-path: inset(0 0 0 0 round 99px); } }
.mix-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.mix-legend li {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 5px 5px 11px; border-radius: 999px;
  font-size: 0.84rem; font-weight: 600; color: hsl(var(--hue) 70% 82%);
  background: hsl(var(--hue) 70% 55% / 0.09); border: 1px solid hsl(var(--hue) 70% 60% / 0.22);
  animation: chip-in 0.35s var(--spring) both; animation-delay: calc(0.35s + var(--d, 0) * 50ms);
}
.mix-legend li > i { width: 7px; height: 7px; border-radius: 50%; background: hsl(var(--hue) 75% 60%); }
.mix-legend b {
  min-width: 22px; padding: 1px 7px; border-radius: 999px; text-align: center; font-size: 0.76rem; font-variant-numeric: tabular-nums;
  background: hsl(var(--hue) 70% 55% / 0.18); color: hsl(var(--hue) 85% 86%);
}

/* Footer strip, like the scan card's: auto-fill status on the left, Send on the right */
.sum-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 14px 22px; border-top: 1px solid var(--border); background: rgba(0, 0, 0, 0.2);
}
.sum-card-foot .btn-primary { padding: 11px 18px; box-shadow: 0 6px 18px -8px rgba(245, 130, 32, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.sum-card-foot .btn-primary:hover:not(:disabled) { box-shadow: 0 10px 24px -8px rgba(245, 130, 32, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); }

/* Is the auto-fill ready? One quiet line beside Send */
.af-note { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.84rem; color: var(--text-2); }
.af-note i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.af-note.ok i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.af-note.warn i { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.af-note.missing i { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.af-note :is(button, a) {
  padding: 0; border: 0; background: none; cursor: pointer; text-decoration: none;
  font: inherit; font-weight: 650; color: var(--accent-2);
}
.af-note :is(button, a):hover { text-decoration: underline; text-underline-offset: 3px; }

/* Copy / download: a quiet row under the card instead of another box */
.sum-export { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 0 2px; animation: fade-up 0.5s var(--ease) 0.3s both; }
.sum-export-label { margin-right: 4px; font-size: 0.8rem; font-weight: 600; color: var(--text-3); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 10px; cursor: pointer;
  font: inherit; font-size: 0.84rem; font-weight: 550; color: var(--text-2);
  background: transparent; border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-btn .i { width: 15px; height: 15px; }
.chip-btn:hover { background: var(--raise); color: var(--text); border-color: var(--border-2); }
.chip-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip-btn.copied { color: var(--ok); background: var(--ok-soft); border-color: rgba(61, 214, 140, 0.35); }
.chip-btn.copied .i { stroke-width: 3; }
.sum-csv { margin-left: auto; }

.summary-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 2px 0; animation: fade-up 0.5s var(--ease) 0.35s both; }

.hist-group {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border);
}
.sg-label { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-count { color: var(--text-3); font-size: 0.82rem; white-space: nowrap; }

/* One-time "set up auto-fill" pop-up */
.setup-modal { max-width: 440px; padding: 30px 26px 20px; text-align: center; }
.setup-art {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
  background: linear-gradient(160deg, #2a1a0c, #151819); border: 1px solid var(--accent-line);
  box-shadow: 0 14px 34px -12px rgba(245, 130, 32, 0.6);
}
.setup-art .tornado { width: 40px; height: 40px; }
.setup-modal h2 { font-size: 1.3rem; letter-spacing: -0.02em; }
.setup-modal > p { max-width: 320px; margin: 6px auto 20px; }
.setup-choices { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.setup-choice {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  font: inherit; text-align: left; color: var(--text); background: var(--raise); border: 1px solid var(--border-2);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}
.overlay.open .setup-choice { animation: fade-up 0.4s var(--ease) both; }
.overlay.open .setup-choice:nth-child(2) { animation-delay: 0.06s; }
.setup-choice:hover, .setup-choice:focus-visible { outline: none; border-color: var(--accent-line); background: var(--accent-soft); transform: translateY(-1px); }
.sc-icon { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--raise-2); color: var(--accent-2); }
.sc-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sc-text strong { font-size: 0.98rem; }
.sc-text span { font-size: 0.82rem; color: var(--text-3); }
.setup-choice > .i:last-child { color: var(--text-3); transition: transform 0.2s var(--ease), color 0.2s; }
.setup-choice:hover > .i:last-child { color: var(--accent); transform: translateX(3px); }
.setup-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

/* ═══════════ OVERLAYS ═══════════ */
.overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(3, 4, 5, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity 0.25s var(--ease);
}
.overlay.open { opacity: 1; }
.modal {
  position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 28px; border-radius: 22px;
  background: var(--surface-solid); border: 1px solid var(--border-2);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.9);
  transform: translateY(18px) scale(0.97); transition: transform 0.35s var(--spring);
}
.overlay.open .modal { transform: none; }
.modal-sm { max-width: 420px; }
.modal-sm h2 { font-size: 1.15rem; margin-bottom: 8px; }
.modal-wide { max-width: 720px; }
.modal-x { position: absolute; top: 16px; right: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

.drawer-overlay { justify-content: flex-end; padding: 0; }
.drawer {
  width: min(460px, 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--surface-solid); border-left: 1px solid var(--border-2);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
  transform: translateX(100%); transition: transform 0.4s var(--ease);
}
.overlay.open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 22px 16px; border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px; }

.hist {
  border-radius: 14px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.02); margin-bottom: 10px;
  animation: slide-in 0.35s var(--ease) both; animation-delay: calc(0.1s + var(--d) * 40ms);
  transition: border-color 0.2s, background 0.2s;
}
.hist[open] { border-color: var(--border-2); background: rgba(255, 255, 255, 0.035); }
.hist summary { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer; list-style: none; }
.hist summary::-webkit-details-marker { display: none; }
.hist-date { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hist-date .muted { font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-count { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; font-size: 0.82rem; }
.hist-chevron { color: var(--text-3); transition: transform 0.3s var(--ease); }
.hist[open] .hist-chevron { transform: rotate(180deg); }
.hist-body { display: flex; flex-direction: column; gap: 6px; padding: 0 12px 14px; animation: fade-up 0.3s var(--ease); }
.hist-group { padding: 8px 8px 8px 12px; font-size: 0.86rem; }
.hist-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

/* Guide */
.guide-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; }
.guide-status .i { width: 14px; height: 14px; stroke-width: 3; }
.guide-status.installed { background: var(--ok-soft); color: var(--ok); }
.guide-status.outdated { background: var(--warn-soft); color: var(--warn); }
.guide-hero { display: flex; gap: 16px; align-items: center; padding-right: 40px; margin-bottom: 24px; }
.guide-hero h2 { font-size: 1.35rem; margin-bottom: 4px; }
.guide-badge {
  flex-shrink: 0; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px;
  background: linear-gradient(140deg, #ffa75a, var(--accent)); color: var(--accent-ink);
  box-shadow: 0 10px 30px -8px rgba(245, 130, 32, 0.7);
}
.guide-badge .i { width: 26px; height: 26px; fill: currentColor; stroke-width: 1.5; }
.overlay.open .guide-badge { animation: wiggle 0.8s var(--spring) 0.2s; }
.guide-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 22px;
  border-radius: 13px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border);
}
.guide-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 9px 10px; border: none; border-radius: 10px; background: none; cursor: pointer;
  font-weight: 650; font-size: 0.86rem; color: var(--text-2); transition: background 0.2s, color 0.2s;
}
.guide-tab .gt-title { display: inline-flex; align-items: center; gap: 7px; }
.guide-tab { position: relative; }

/* Hover / keyboard-focus explanation under each method */
.gt-tip {
  position: absolute; top: calc(100% + 10px); left: 50%; z-index: 5;
  width: max-content; max-width: min(300px, 80vw);
  padding: 10px 12px; border-radius: 11px;
  background: #1c2224; border: 1px solid var(--border-2);
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.8);
  color: var(--text-2); font-size: 0.8rem; font-weight: 500; line-height: 1.45; text-align: left; white-space: normal;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 0.18s var(--ease), transform 0.22s var(--ease), visibility 0.18s;
}
.gt-tip::before {
  content: ''; position: absolute; top: -6px; left: 50%; width: 10px; height: 10px;
  background: inherit; border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2);
  transform: translateX(-50%) rotate(45deg);
}
.gt-tip b { color: var(--accent-2); }
.guide-tab:hover .gt-tip, .guide-tab:focus-visible .gt-tip {
  opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0.15s;
}
.guide-tab .muted { font-size: 0.74rem; font-weight: 500; }
.guide-tab:hover { color: var(--text); }
.guide-tab.active { background: var(--raise-2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); }
.guide-tab.active .i { color: var(--accent); }
.bookmarklet {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #ff9a45, var(--accent)); color: var(--accent-ink);
  font-weight: 800; font-size: 0.9rem; text-decoration: none; cursor: grab;
  box-shadow: 0 8px 22px -8px rgba(245, 130, 32, 0.9);
  animation: float 3s ease-in-out infinite;
}
.bookmarklet:active { cursor: grabbing; }
.guide-how {
  margin-top: 4px; padding: 16px 18px; border-radius: 14px;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
}
.guide-how h3 { font-size: 0.95rem; margin-bottom: 6px; }
.guide-how ol { margin: 0 0 8px; padding-left: 20px; color: var(--text-2); font-size: 0.88rem; }
.guide-how li { margin: 4px 0; }
.guide-how b { color: var(--text); }
.guide-how b.fill-word { color: var(--accent-2); }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.guide-step { position: relative; display: flex; gap: 16px; padding-bottom: 22px; }
.guide-step:not(:last-child)::before {
  content: ''; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px;
  background: linear-gradient(var(--accent-line), var(--border));
}
.overlay.open .guide-step { animation: fade-up 0.45s var(--ease) both; }
.overlay.open .guide-step:nth-child(1) { animation-delay: 0.08s; }
.overlay.open .guide-step:nth-child(2) { animation-delay: 0.16s; }
.overlay.open .guide-step:nth-child(3) { animation-delay: 0.24s; }
.overlay.open .guide-step:nth-child(4) { animation-delay: 0.32s; }
.guide-num {
  flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent-soft); border: 1.5px solid var(--accent); color: var(--accent-2); font-weight: 800; font-size: 0.88rem;
}
.guide-body { flex: 1; min-width: 0; padding-top: 4px; }
.guide-body h3 { font-size: 1rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.guide-body p { color: var(--text-2); font-size: 0.9rem; }
.guide-body p + p { margin-top: 6px; }
.guide-body p b { color: var(--text); }
.guide-body p b.fill-word { color: var(--accent-2); }
.guide-body > .btn { margin-top: 10px; }
.tag { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--raise-2); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.guide-btns { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ── Toasts ─────────────────────────────────── */
.toasts {
  position: fixed; left: 50%; bottom: 22px; z-index: 200; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  position: relative; overflow: hidden; pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px 11px 14px; border-radius: 14px; max-width: 100%;
  background: rgba(24, 29, 31, 0.94); border: 1px solid var(--border-2);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font-size: 0.88rem; font-weight: 550;
  animation: toast-in 0.4s var(--spring);
}
.toast.leaving { animation: toast-out 0.25s var(--ease) forwards; }
.toast > .i { color: var(--text-2); }
.toast-ok > .i { color: var(--ok); }
.toast-error > .i { color: var(--bad); }
.toast-warn > .i { color: var(--warn); }
.toast-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-action {
  margin-left: 4px; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  background: var(--accent-soft); border: 1px solid var(--accent-line); color: var(--accent-2); font-weight: 700; font-size: 0.8rem;
}
.toast-action:hover { background: rgba(245, 130, 32, 0.25); }
.toast-timer { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--border-2); transform-origin: left; animation: timer linear forwards; }
.toast-ok .toast-timer { background: rgba(61, 214, 140, 0.5); }

/* ── Tornado loader ─────────────────────────── */
/* Rings sway like a funnel (lower = wider swing) while dashes race round each
   one, faster near the tip. A few bits of debris orbit; dust puffs at the base. */
.tornado {
  display: block; width: 1em; height: 1em; overflow: visible; flex-shrink: 0;
  --tw-top: var(--accent-2); --tw-bottom: var(--accent);
}
.tornado .tw-ring {
  --sway: calc(0.8px + var(--i) * 0.7px);
  animation: tw-sway 1.7s ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -0.24s);
}
.tornado ellipse { fill: none; stroke-linecap: round; }
.tornado .tw-ghost { stroke: var(--tw-bottom); stroke-width: 1.4; opacity: 0.2; }
.tornado .tw-streak {
  stroke: color-mix(in srgb, var(--tw-bottom) calc(var(--i) * 16%), var(--tw-top));
  stroke-width: 2.6; stroke-dasharray: 30 12 16 42;
  animation: tw-spin calc(1.15s - var(--i) * 0.09s) linear infinite;
  animation-delay: calc(var(--i) * -0.17s);   /* each ring a little behind the one above: a twist */
}
.tornado .tw-bit {
  fill: var(--tw-top); transform-box: fill-box; transform-origin: center;
  animation: tw-orbit 1.3s linear infinite; animation-delay: calc(var(--d) * -0.43s);
}
.tornado .tw-bit:nth-child(1) { --r: 15px; }
.tornado .tw-bit:nth-child(2) { --r: 12px; }
.tornado .tw-bit:nth-child(3) { --r: 9px; }
.tornado .tw-dust {
  fill: var(--tw-bottom); opacity: 0.25; transform-box: fill-box; transform-origin: center;
  animation: tw-dust 0.9s ease-in-out infinite alternate;
}
.tornado.sm .tw-ghost, .tornado.sm .tw-bit, .tornado.sm .tw-dust { display: none; }
.tornado.sm .tw-streak { stroke-width: 3.8; stroke-dasharray: 44 12 26 18; }
/* On orange or green buttons the tornado goes dark so it shows up */
.btn-primary .tornado, .btn-finish .tornado { --tw-top: rgba(28, 14, 0, 0.75); --tw-bottom: var(--accent-ink); width: 20px; height: 20px; }
.btn-finish .tornado { --tw-top: rgba(3, 23, 12, 0.7); --tw-bottom: #03170c; }
.btn .tornado, .link-btn .tornado { width: 18px; height: 18px; }

@keyframes tw-sway { from { transform: translateX(calc(var(--sway) * -1)); } to { transform: translateX(var(--sway)); } }
@keyframes tw-spin { to { stroke-dashoffset: -100; } }
@keyframes tw-dust { from { transform: scaleX(0.7); opacity: 0.12; } to { transform: scaleX(1.2); opacity: 0.35; } }
/* Round the ring: right → front → left → behind (dim and small when behind) */
@keyframes tw-orbit {
  0%    { transform: translate(var(--r), 0) scale(0.75); opacity: 0.55; }
  12.5% { transform: translate(calc(var(--r) * 0.71), 1.8px) scale(1); opacity: 0.9; }
  25%   { transform: translate(0, 2.5px) scale(1.15); opacity: 1; }
  37.5% { transform: translate(calc(var(--r) * -0.71), 1.8px) scale(1); opacity: 0.9; }
  50%   { transform: translate(calc(var(--r) * -1), 0) scale(0.75); opacity: 0.55; }
  62.5% { transform: translate(calc(var(--r) * -0.71), -1.8px) scale(0.5); opacity: 0.25; }
  75%   { transform: translate(0, -2.5px) scale(0.4); opacity: 0.1; }
  87.5% { transform: translate(calc(var(--r) * 0.71), -1.8px) scale(0.5); opacity: 0.25; }
  100%  { transform: translate(var(--r), 0) scale(0.75); opacity: 0.55; }
}

/* Clip still downloading → tornado over the poster */
.howto-frame { position: relative; }
.howto-loading {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: rgba(7, 9, 10, 0.45); border-radius: 10px; opacity: 0; transition: opacity 0.3s;
}
.howto-loading .tornado { width: 46px; height: 46px; filter: drop-shadow(0 0 12px rgba(245, 130, 32, 0.5)); }
.howto-frame.loading .howto-loading { opacity: 1; }

/* Button busy states */
.btn.launching, .btn-finish.busy { pointer-events: none; }
.btn.launching:disabled, .btn-finish.busy:disabled { opacity: 1; }
.btn.launching { animation: launch-glow 1.4s ease-in-out; }
@keyframes launch-glow { 50% { box-shadow: 0 0 0 6px var(--accent-soft), 0 12px 36px -8px rgba(245, 130, 32, 0.9); } }
.btn-primary.ready-pulse { animation: ready-pulse 1.5s var(--ease) 0.5s 2; }
@keyframes ready-pulse {
  0%   { box-shadow: 0 8px 24px -10px rgba(245, 130, 32, 0.8), 0 0 0 0 rgba(245, 130, 32, 0.55); }
  100% { box-shadow: 0 8px 24px -10px rgba(245, 130, 32, 0.8), 0 0 0 16px rgba(245, 130, 32, 0); }
}

/* ── Splash ─────────────────────────────────── */
.splash {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  background: radial-gradient(55% 45% at 50% 46%, rgba(245, 130, 32, 0.16), transparent 70%), var(--bg);
  transition: opacity 0.6s var(--ease) 0.1s, visibility 0.6s 0.1s;
}
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.splash .tornado {
  width: 104px; height: 104px; filter: drop-shadow(0 0 22px rgba(245, 130, 32, 0.5));
  animation: splash-in 0.7s var(--spring) both;
}
.splash-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; animation: fade-up 0.6s var(--ease) 0.2s both; }
.splash.out { opacity: 0; visibility: hidden; }
.splash.out .tornado { animation: splash-whoosh 0.6s var(--ease) forwards; }
.splash.out .splash-name { animation: fade-out 0.4s var(--ease) forwards; }
.no-splash .splash { display: none; }
@keyframes splash-in { from { opacity: 0; transform: scale(0.4) rotate(-25deg); } }
@keyframes splash-whoosh { to { opacity: 0; transform: translateY(-40px) scale(1.35); filter: blur(8px); } }

/* ═══════════ ANIMATIONS ═══════════ */
@keyframes screen-enter { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade-out { to { opacity: 0; transform: translateY(8px) scale(0.98); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.95); } }
@keyframes chip-in { from { opacity: 0; transform: scale(0.9); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-10px); } }
@keyframes mark-pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.08) translate(-1%, 1%); } }
@keyframes glow { from { opacity: 0.7; transform: translateX(-50%) scale(1); } to { opacity: 1; transform: translateX(-50%) scale(1.15); } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0.6); } 70% { box-shadow: 0 0 0 8px rgba(61, 214, 140, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); } }
@keyframes beam { 0% { background-position: -40% 0; } 100% { background-position: 140% 0; } }
@keyframes scan-line { 0%, 100% { top: 18%; } 50% { top: 78%; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } }
.rise-in { animation: rise-in 0.45s var(--spring); }
.rise-in-late { animation: rise-in 0.45s var(--spring) 0.07s both; }
.pop-in { animation: pop-in 0.35s var(--spring); }
.slide-in { animation: slide-in 0.35s var(--ease); }
.fade-up { animation: fade-up 0.35s var(--ease); }
.mark-pop { animation: mark-pop 0.4s var(--spring); }
@keyframes shake-kf { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }
.shake { animation: shake-kf 0.45s var(--ease); }
@keyframes nudge-kf { 0%, 100% { transform: none; } 30% { transform: translateY(-3px); } 60% { transform: translateY(2px); } }
.nudge { animation: nudge-kf 0.35s var(--ease); }
@keyframes success-kf { 0% { box-shadow: var(--shadow), 0 0 0 0 rgba(61, 214, 140, 0.55); } 100% { box-shadow: var(--shadow), 0 0 0 18px rgba(61, 214, 140, 0); } }
.success-pulse { animation: success-kf 0.7s var(--ease); }
@keyframes bump-kf { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
.bump { animation: bump-kf 0.4s var(--spring); }
@keyframes fly-out { to { opacity: 0; transform: translateX(40px) scale(0.96); } }
@keyframes row-in { from { opacity: 0; transform: translateY(-8px) scale(0.97); } }
@keyframes row-flash { 0% { background: rgba(61, 214, 140, 0.25); } 100% { background: transparent; } }
@keyframes collapse { to { opacity: 0; transform: translateX(16px); max-height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.95); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes burst-in { 0% { transform: scale(0); } 100% { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes ring { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes grow-down { from { transform: scaleY(0); } }
@keyframes sheen { from { background-position: 130% 0; } to { background-position: -130% 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } 75% { transform: rotate(-4deg); } }

@media (prefers-reduced-motion: reduce) {
  .splash { display: none; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 980px) {
  .scan-grid { grid-template-columns: 1fr; }
  .session-card { position: static; max-height: none; }
  .session-body { max-height: none; }
}

@media (max-width: 680px) {
  body { font-size: 14.5px; }
  .hide-sm, .brand-sub { display: none; }
  .show-sm { display: inline; }
  .dock { bottom: 12px; width: calc(100vw - 24px); }
  .dock-inner { gap: 12px; padding: 10px 10px 10px 16px; }
  .dock-groups, .dock-time { display: none; }
  .dock .btn-finish { margin-left: auto; padding: 13px 20px; }
  .topbar { gap: 10px; }
  .topbar .btn { padding: 9px 11px; }
  .card { padding: 18px; }
  .stepper .step-label { display: none; }
  .step-line { width: 56px; }
  .resume-banner { flex-wrap: wrap; }
  .resume-actions { width: 100%; justify-content: flex-end; }
  .kbd-hints, .scan-status { display: none; }
  .scanner-card { --pad: 18px; padding: 18px 18px 0; }
  .session-card { padding: 0; }
  .scanner-input { height: 62px; padding: 0 62px 0 48px; font-size: 1.08rem; }
  .scanner-ico { left: 17px; }
  .scanner-ico .i { width: 20px; height: 20px; }
  .scanner-go { right: 10px; width: 40px; height: 40px; }
  .src-side { margin-left: 0; }
  .issue-foot-btns { width: 100%; }
  .issue-foot-btns .btn { flex: 1; }
  .sum-stats > div { padding: 2px 16px; }
  .stat-num { font-size: 1.25rem; }
  .sum-card-body { padding: 18px; }
  .sum-card-foot { padding: 14px 18px; }
  .sum-card-foot .btn-primary { width: 100%; }
  .sum-export-label { width: 100%; }
  .sum-csv { margin-left: 0; }
  .summary-actions { flex-direction: column-reverse; }
  .summary-actions .btn { width: 100%; }
  .check-actions .btn { flex: 1; }
  .check-detail .col-chip { display: inline-block; border-radius: 10px; padding: 5px 10px; }
  .check-detail .col-chip .i { vertical-align: -1px; margin-right: 4px; }
  .check-detail .col-chip em { margin-left: 4px; }
  .modal { padding: 22px; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 0.92rem; }
  .connect-row .btn { flex: 1; }
}

