:root {
  --bg: #08090a;
  --bg-elevated: #0f1013;
  --card: #17181c;
  --card-hover: #1c1d22;
  --border: rgba(255,255,255,0.09);
  --border-strong: rgba(255,255,255,0.16);
  --accent: #01ff33;
  --accent-dim: rgba(1,255,51,0.14);
  --accent-text: #080808;
  --text: #ffffff;
  --text-muted: #9aa0a6;
  --text-dim: #63666d;
  --error: #ff5c5c;
  --radius: 14px;
  --radius-sm: 9px;
  --font-head: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 15% -5%, rgba(1,255,51,0.10), transparent 60%),
    radial-gradient(500px 350px at 100% 10%, rgba(1,255,51,0.06), transparent 60%);
}

.screen { position: relative; z-index: 1; }
.hidden { display: none !important; }

a { color: var(--accent); }

/* ------------------------------------------------------------ login -- */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  text-align: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.02), 0 30px 80px rgba(1,255,51,0.06), 0 10px 40px rgba(0,0,0,0.5);
}

.login-logo { margin-bottom: 14px; display: flex; justify-content: center; }
.login-logo-img { width: 56px; height: 56px; border-radius: 14px; object-fit: contain; background: #000; }
.login-logo-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 26px;
}

.login-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.02em;
}
.login-subtitle {
  color: var(--accent);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 2px 0 26px;
}

/* ---------------------------------------------------------- topbar --- */
.topbar { border-bottom: 1px solid var(--border); background: rgba(8,9,10,0.85); backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 900px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; background: #000; }
.brand-logo--placeholder { display: flex; align-items: center; justify-content: center; color: var(--accent); font-family: var(--font-head); font-weight: 700; font-size: 18px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title { font-family: var(--font-head); font-weight: 700; font-size: 16px; }
.brand-subtitle { color: var(--accent); font-weight: 600; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }

.topbar-right { display: flex; align-items: center; gap: 10px; }
.env-badge {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--accent); background: var(--accent-dim); border: 1px solid rgba(1,255,51,0.3);
  padding: 5px 10px; border-radius: 20px;
}

.container { max-width: 900px; margin: 0 auto; padding: 28px 20px 70px; }

/* ------------------------------------------------------------- hero -- */
.welcome-hero { margin-bottom: 26px; }
.welcome-hero h1 {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.welcome-hero p { color: var(--text-muted); max-width: 620px; margin: 0; line-height: 1.5; font-size: 14px; }

/* ------------------------------------------------------------ stepper - */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  gap: 6px;
}
.step-item { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 700; font-size: 12px;
  background: var(--bg-elevated); border: 1.5px solid var(--border-strong); color: var(--text-dim);
  transition: all .2s ease;
}
.step-label {
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap;
  transition: color .2s ease;
}
.step-item.active .step-dot { background: var(--accent); border-color: var(--accent); color: var(--accent-text); box-shadow: 0 0 16px rgba(1,255,51,0.4); }
.step-item.active .step-label { color: var(--text); }
.step-item.done .step-dot { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }
.step-item.done .step-label { color: var(--text-muted); }
.step-line { flex: 1; height: 1px; background: var(--border-strong); min-width: 16px; }

/* --------------------------------------------------------- step track - */
.step-track { overflow: hidden; }
/* Carrossel horizontal dos steps: a faixa tem a largura de N telas e cada
   painel ocupa 1/N dela. Esses números precisam bater com TOTAL_STEPS em
   app.js (hoje 3) — se um step for adicionado ou removido e só um dos dois
   lados mudar, os painéis param de alinhar com a janela visível e a tela
   desliza pra um ponto entre dois steps. */
.step-panels {
  display: flex;
  width: 300%;
  transition: transform .38s cubic-bezier(.4,0,.2,1);
}
.step-panel { width: 33.3333%; flex-shrink: 0; padding-right: 4px; }

.step-intro { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 18px; max-width: 560px; }

.step-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 18px;
}

/* -------------------------------------------------- step back arrow --- */
/* Centered, floating back control — replaces the old bottom "Back" text
   button so going back a step reads as a clear, deliberate action tied
   to the content itself rather than a buried footer link.
   This is a SINGLE element living outside .step-track on purpose: the
   track uses overflow:hidden + a transform to slide between panels, and
   any per-panel absolutely-positioned child that pokes past its own
   panel bounds gets clipped (or, worse, bleeds through from the next
   off-screen panel into the visible one). Living outside that subtree
   and being position:fixed sidesteps both problems entirely. */
.step-back-arrow {
  position: fixed;
  top: 50%;
  left: max(14px, calc(50vw - 490px));
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 15;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}
.step-back-arrow svg { width: 18px; height: 18px; }
.step-back-arrow:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: 0 0 18px rgba(1,255,51,0.35);
  transform: translateY(-50%) translateX(-2px);
}

.card-subtitle { font-family: var(--font-head); font-size: 13px; font-weight: 700; margin: 0 0 10px; }
.section-divider { height: 1px; background: var(--border); margin: 20px 0; }
.field-label-standalone { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 10px; }

/* ---------------------------------------------------------- review --- */
.review-grid { display: flex; flex-direction: column; gap: 0; }
.review-row {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}
.review-row:last-child { border-bottom: none; }
.review-row .review-key { color: var(--text-muted); flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.review-row .review-value { color: var(--text); text-align: right; font-weight: 600; word-break: break-word; }
/* Wraps a review value together with an info-icon that qualifies it (e.g.
   the Word count value + its "approximate" disclaimer icon), so the icon
   sits right next to the number it explains instead of next to the label
   on the opposite side of the row. */
.review-value-group { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }

/* Small "ⓘ" next to a review-row key (currently just Word count) that
   reveals a tooltip-style panel on hover/focus — used for caveats that
   matter but shouldn't be a permanently-visible paragraph under the
   whole grid (easy to skim past when it's that far from the number it
   qualifies). Keyboard-focusable (tabindex) so it's not mouse-only. */
.info-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  color: var(--text-dim);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: help;
}
.info-icon:hover, .info-icon:focus { color: var(--accent); border-color: var(--accent); outline: none; }
.info-tooltip {
  position: absolute;
  z-index: 20;
  right: 0;
  left: auto;
  bottom: calc(100% + 8px);
  transform: translateY(4px);
  width: 260px;
  max-width: min(260px, 80vw);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
}
.info-icon:hover .info-tooltip, .info-icon:focus .info-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ------------------------------------------------------------- cards - */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
}
.card-title {
  font-family: var(--font-head);
  margin: 0 0 16px;
  font-size: 15px;
  font-weight: 700;
}

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
/* Ocupa a linha toda de um .grid-2 (usado pelo Workflow Steps, que
   costuma acumular mais chips que os campos de locale). */
.field-full { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: var(--text-muted); }

input[type="text"], input[type="password"] {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  width: 100%;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
}
input::placeholder { color: var(--text-dim); }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }

/* Standalone single-value dropdown (currently just Source Locale) —
   same box treatment as a text input, but with a real <select> so the
   value has to come from the actual language catalog instead of being
   typed by hand. */
select.select-field {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  width: 100%;
  background: var(--bg-elevated);
  color: var(--text);
  font-family: var(--font-body);
  cursor: pointer;
}
select.select-field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
select.select-field option { color: #14151a; background: #ffffff; }

.hint { font-size: 11px; color: var(--text-dim); }

.input-with-action { display: flex; gap: 6px; }
.input-with-action input { flex: 1; }

/* ------------------------------------------------------ multiselect --- */
/* Chip-based multi-select for Workflows / Target Locales (see
   createMultiSelect in app.js) — replaces a free-text comma-separated
   field where a typo only surfaces once wxrks rejects the call. */
.multiselect {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}
.multiselect:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.multiselect-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.multiselect-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.multiselect-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.multiselect-chip-remove:hover { background: rgba(1,255,51,0.25); }
/* Campo de busca do combobox (ver createMultiSelect em app.js). Substituiu
   o <select> nativo + o controle separado de "Other… (type manually)": com
   centenas de idiomas, a lista nativa virava uma rolagem interminável e a
   pessoa desistia e digitava o código na mão. Aqui a lista abre no foco e
   filtra conforme se digita, então dá pra clicar OU buscar. */
.combo-search {
  position: relative;
  flex: 1;
  min-width: 150px;
}
.combo-search input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 12.5px;
  padding: 4px 2px;
  outline: none;
}
.combo-search input::placeholder { color: var(--text-dim); }
/* A lista é filha do .combo-search (position:relative) e não do
   .multiselect, pra ancorar no campo de busca mesmo quando os chips
   empurram o campo pra uma segunda linha. */
.combo-search .autocomplete-list {
  top: calc(100% + 6px);
  left: 0;
  right: 0;
}
/* Opção "Use “xxx”" — o escape hatch pra um código que não está no
   catálogo. Fica visualmente distinta pra não ser confundida com um item
   real da lista, já que aceitar texto cru é o caminho mais arriscado. */
.combo-custom-item { border-top: 1px solid var(--border); }
.combo-custom-item .org-name { color: var(--accent); }

/* ----------------------------------------------------------- buttons - */
.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-head);
  cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 24px rgba(1,255,51,0.35); transform: translateY(-1px); }
.btn-primary:disabled { background: #24262b; color: var(--text-dim); cursor: not-allowed; }
.btn-block { width: 100%; margin-top: 6px; }
.btn-run { width: 100%; padding: 15px; font-size: 15px; margin-bottom: 18px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.row-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; margin-bottom: 4px; flex-wrap: wrap; }

.status-text { font-size: 13px; color: var(--text-muted); min-height: 16px; }
.status-text.ok { color: var(--accent); }
.status-text.error { color: var(--error); }

/* Linha do status do arquivo + o botão de remover, que fica encostado à
   direita pra não empurrar o texto de status nem parecer parte dele. */
.file-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Botão discreto em forma de link — usado no "Remove file", uma ação
   secundária que não deve competir visualmente com o Continue. */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--text-dim);
  text-decoration: underline;
  cursor: pointer;
  flex-shrink: 0;
}
.link-btn:hover, .link-btn:focus { color: var(--error); outline: none; }

.link-toggle { font-size: 12px; text-decoration: none; cursor: pointer; margin-top: 2px; display: inline-block; }
.link-toggle:hover { text-decoration: underline; }

/* --------------------------------------------------------- env toggle - */
.env-toggle { display: flex; gap: 6px; background: var(--bg-elevated); padding: 4px; border-radius: 10px; margin-bottom: 20px; }
.env-btn {
  flex: 1;
  border: none; background: transparent; color: var(--text-muted);
  padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: var(--font-body);
}
.env-btn.active { background: var(--accent); color: var(--accent-text); }

/* --------------------------------------------------------- autocomplete */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--card-hover);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 20;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.autocomplete-list.hidden { display: none; }
.autocomplete-item { padding: 9px 12px; cursor: pointer; font-size: 13px; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--accent-dim); }
.autocomplete-item .org-name { font-weight: 600; }
.autocomplete-item .org-parent { color: var(--text-muted); font-size: 11px; }
.autocomplete-empty { padding: 10px 12px; color: var(--text-muted); font-size: 13px; }

/* -------------------------------------------------------- mode pills - */
.mode-pills { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.mode-pill {
  flex: 1;
  min-width: 220px;
  text-align: left;
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 11px;
  padding: 13px 15px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-head);
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mode-pill small { font-weight: 500; font-family: var(--font-body); color: var(--text-muted); font-size: 11px; }
.mode-pill.active { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.mode-pill.active small { color: var(--accent); opacity: .75; }

/* --------------------------------------------------------- drop zone - */
.drop-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--bg-elevated);
}
.drop-zone:hover, .drop-zone.dragover { border-color: var(--accent); background: var(--accent-dim); }
.drop-zone-text { display: flex; flex-direction: column; gap: 4px; }
.drop-zone-text strong { font-size: 14px; font-family: var(--font-head); }
.drop-zone-text span { font-size: 12px; color: var(--text-muted); }

/* ------------------------------------------------------- scan animation */
.scan-card { display: flex; justify-content: center; margin-top: 20px; }
.scanner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 6px 0;
  text-align: center;
}

.scanner-rings {
  position: relative;
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(1,255,51,0.08), transparent 70%);
}
.scanner-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(1,255,51,0.25);
}
.ring1 { inset: 0; animation: pulse-ring 2.4s ease-out infinite; }
.ring2 { inset: 18px; animation: pulse-ring 2.4s ease-out infinite; animation-delay: .6s; }
.ring3 { inset: 36px; animation: pulse-ring 2.4s ease-out infinite; animation-delay: 1.2s; }

.scanner-sweep {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(1,255,51,0.85), rgba(1,255,51,0) 35%);
  animation: spin 1.6s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%);
  mask: radial-gradient(circle, transparent 52%, #000 53%);
}

.scanner-core {
  position: absolute;
  inset: 40px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.scanner-icon { width: 26px; height: 26px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse-ring {
  0%   { transform: scale(0.7); opacity: 0; }
  40%  { opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.scanner-info { display: flex; flex-direction: column; align-items: center; max-width: 460px; }
.scanner-step {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.scanner-phase {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 6px;
  min-height: 20px;
}
.scanner-count { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.scanner-count span { color: var(--accent); font-weight: 700; font-family: var(--font-head); font-size: 15px; }

.scanner-stream {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 60px;
  width: 100%;
}
.scanner-stream-line {
  opacity: 0;
  transform: translateY(4px);
  animation: stream-in .35s ease forwards;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 420px;
  text-align: center;
}
.scanner-stream-line.newest { color: var(--accent); }
@keyframes stream-in { to { opacity: 1; transform: translateY(0); } }

/* ------------------------------------------------------ progress bars - */
/* Shared by the ingestion (scan) card and the Review & Send run flow —
   real byte-based progress instead of an indefinite spinner, since both
   phases can take a while on large client zips. */
.progress-bar-wrap { width: 100%; max-width: 460px; margin: 4px auto 10px; }
.progress-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .25s ease;
}
.progress-bar-label {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

/* ---------------------------------------------------------- ext chips - */
/* Each extension is now a stacked item (checkbox row + optional
   expandable file list below it) rather than a flat wrapped grid of
   pills — needed room to fit the per-file breakdown underneath. */
.ext-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
/* No per-item entrance animation here on purpose — it used to be a
   staggered chip-in (opacity/transform, delayed by item index), but for
   zips with a lot of different extensions that stagger visibly read as
   the whole list "blinking" for several seconds after the scan finished
   instead of a quick reveal. A list that's simply there the instant
   it's rendered has no timing for anything to go wrong with. */
.ext-item {}
.ext-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 12px;
  padding: 9px 13px;
  font-size: 13px;
  user-select: none;
}
.ext-pill.checked { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.ext-pill .ext-name { font-weight: 600; }

/* Inline confirmation that shows next to the extension name once its
   pill is fully checked AND it has at least one duplicate group — makes
   it explicit that "checked" here means "one copy per duplicate group",
   not literally every file, since that's easy to misread as the select
   -all having only half-worked. */
.ext-dup-note {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent);
  white-space: nowrap;
}

/* Fully custom-rendered checkbox (appearance:none + our own fill/check-
   mark/dash drawn via ::after). Driven by explicit .is-checked /
   .is-indeterminate CLASSES we toggle ourselves in JS (refreshExtGridUI)
   — NOT the native :checked/:indeterminate CSS pseudo-classes. Reason:
   our checkboxes are checked/unchecked entirely PROGRAMMATICALLY (the
   click handler calls preventDefault() and decides the next state from
   our own 3-way cycle, not the browser's default toggle — see
   cycleExtensionSelection in app.js). In that flow, some browsers don't
   repaint a :checked/:indeterminate-based style immediately — the box
   would only visually catch up after some LATER unrelated style
   recalculation (e.g. clicking a different checkbox), which read as
   "it only turns green after I click something else". A plain class
   toggle via classList has no such ambiguity — it's always reflected
   synchronously, every time, regardless of how the underlying .checked
   property was set. The real .checked/.indeterminate IDL properties are
   still set alongside the classes (for accessibility/semantics), just
   no longer relied on for the visual. */
.ext-pill input[type="checkbox"],
.file-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: background .12s ease, border-color .12s ease;
}
.ext-pill input[type="checkbox"].is-checked,
.file-row input[type="checkbox"].is-checked {
  background: var(--accent);
  border-color: var(--accent);
}
.ext-pill input[type="checkbox"].is-checked::after,
.file-row input[type="checkbox"].is-checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 8px;
  border: solid var(--accent-text);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.ext-pill input[type="checkbox"].is-indeterminate {
  background: var(--accent-dim);
  border-color: var(--accent);
}
.ext-pill input[type="checkbox"].is-indeterminate::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 8px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Little balloon next to each extension showing how many files of that
   type were found in the zip — helps size up what you're about to send
   before even reaching the review step. Clicking it expands the
   per-file list instead of toggling selection (that's the checkbox's
   job), so it gets its own cursor/hover treatment. */
.ext-count {
  margin-left: auto;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 700;
  text-align: center;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
}
.ext-count:hover { border-color: var(--accent); color: var(--accent); }
.ext-pill.checked .ext-count {
  background: rgba(1,255,51,0.22);
  color: var(--accent);
  border-color: transparent;
}

.ext-chevron {
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  flex-shrink: 0;
  width: 14px;
  text-align: center;
}
.ext-pill.checked .ext-chevron { color: var(--accent); opacity: .7; }

/* Automated actions taken during the scan (e.g. auto-unlocking a
   password-protected PPTX) — shown so they're never silent. */
.scan-notes-box { margin: 10px 0 4px; display: flex; flex-direction: column; gap: 4px; }
.scan-note {
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(1,255,51,0.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

/* Per-file breakdown — shown once the count/chevron is clicked. Indented
   under its extension's pill so the hierarchy (extension -> files) reads
   clearly at a glance. */
.ext-files {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 2px 14px;
  padding-left: 14px;
  border-left: 1.5px solid var(--border);
}
.file-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}
.file-row:hover { background: var(--bg-elevated); }
.file-row.checked { color: var(--accent); }
.file-row .file-path {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.file-row.checked .file-path { color: var(--accent); }
.file-row .file-words {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}
.file-duplicate-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 1;
  color: #ffb454;
  background: rgba(255, 180, 84, 0.14);
  border: 1px solid rgba(255, 180, 84, 0.3);
  border-radius: 999px;
  cursor: default;
}

/* ------------------------------------------------------------- log --- */
.log-box {
  background: #000000;
  color: #baffc9;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
  padding: 14px;
  min-height: 160px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  border: 1px solid var(--border);
}
.log-line-error { color: var(--error); }

/* ------------------------------------------------------------ toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 13.5px;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  z-index: 100;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
  white-space: pre-line;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-left-color: var(--error); }
