:root {
  --bg:            #fafafa;
  --surface:       #ffffff;
  --surface-alt:   #f4f4f5;
  --border:        #e4e4e7;
  --border-strong: #d4d4d8;
  --ink:           #18181b;
  --ink-soft:      #3f3f46;
  --ink-muted:     #71717a;
  --ink-subtle:    #a1a1aa;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-soft:   #eff6ff;
  --danger:        #dc2626;
  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm:  0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow:     0 1px 3px rgba(24, 24, 27, 0.06), 0 1px 2px rgba(24, 24, 27, 0.04);
  --shadow-md:  0 4px 12px -2px rgba(24, 24, 27, 0.08), 0 2px 4px -1px rgba(24, 24, 27, 0.04);
  --shadow-lg:  0 20px 40px -12px rgba(24, 24, 27, 0.18), 0 8px 16px -8px rgba(24, 24, 27, 0.08);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

/* ============================
   TOP BAR
   ============================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand__mark {
  height: 26px;
  width: auto;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.brand__name {
  font-weight: 600;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand__tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.topbar__search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  height: 36px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.topbar__search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.topbar__search-icon { color: var(--ink-subtle); flex-shrink: 0; }
.topbar__search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
}
.topbar__search input::placeholder { color: var(--ink-subtle); }
.topbar__hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-muted);
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.topbar__meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-muted);
  flex-shrink: 0;
}
.topbar__meta #count {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ============================
   MAIN
   ============================ */
.main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 56px 24px 80px;
}

.hero {
  margin-bottom: 40px;
  max-width: 780px;
}
.hero__title {
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 12px;
}
.hero__subtitle {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.hero__subtitle-line { display: block; }
.hero__subtitle-keep { white-space: nowrap; }
.hero__stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--ink-muted);
}
.hero__stats strong {
  color: var(--ink-soft);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ============================
   GRID OF CARDS
   ============================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  min-height: 220px;
  outline: none;
  animation: fade-in 0.4s ease-out backwards;
}
.card:hover,
.card:focus-visible {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  overflow: hidden;
  flex-shrink: 0;
}
.card__icon--letter { background: var(--ink-muted); }
.card__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card__category {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.card__name {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.3;
}
.card__tagline {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.card__version {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
}
.card__date {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* ============================
   BUTTONS
   ============================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.05s;
  text-decoration: none;
  white-space: nowrap;
  outline: none;
}
.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}
.btn:active { transform: translateY(0.5px); }
.btn:disabled,
.btn.is-loading {
  opacity: 0.65;
  cursor: progress;
  pointer-events: none;
}

.btn--primary {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
}
.btn--primary:hover { background: var(--accent); border-color: var(--accent); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn--ghost:hover { border-color: var(--border-strong); background: var(--surface-alt); }

.btn--sm {
  font-size: 12px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
}

/* [hidden] phải thắng display:inline-flex của .btn (đặc hiệu cao hơn .btn) */
.btn[hidden] { display: none; }

/* ============================
   MODAL chi tiết (.modal__*) — panel trượt vào từ phải
   ============================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}
.modal[hidden] { display: none; }

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, 0.45);
  backdrop-filter: blur(2px);
  animation: fade 0.25s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal__sheet {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(420px, 38vw, 560px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -20px 0 40px -12px rgba(24, 24, 27, 0.18);
  overflow-y: auto;
  animation: slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

@keyframes slide-in {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(0); }
}

.modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  z-index: 3;
}
.modal__close:hover {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--ink);
}

.modal__head {
  padding: 28px 28px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.modal__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.modal__icon--letter { background: var(--ink-muted); }
.modal__icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal__head-text { min-width: 0; padding-right: 36px; }

.modal__category {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal__name {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 6px;
}
.modal__tagline {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.55;
}

.modal__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}

.modal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.modal__meta span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.modal__meta b {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.modal__meta i {
  font-style: normal;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  font-family: var(--mono);
}

.modal__body { padding: 8px 28px 28px; }

.modal__section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.modal__section:last-child { border-bottom: none; }
.modal__section[hidden] { display: none; }

.modal__section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.modal__section p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.history {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.history th,
.history td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.history thead th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background: var(--surface-alt);
}
.history tbody tr:last-child td { border-bottom: none; }
.history td:first-child {
  font-family: var(--mono);
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  width: 100px;
}
.history td:nth-child(2) {
  color: var(--ink-muted);
  white-space: nowrap;
  width: 130px;
  font-variant-numeric: tabular-nums;
}
.history td:last-child { color: var(--ink-soft); }

/* ============================
   EMPTY
   ============================ */
.empty {
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 6px;
}
.empty__hint {
  font-size: 13px;
  color: var(--ink-muted);
}

/* ============================
   FOOTER
   ============================ */
.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.footer__label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.footer code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--ink-soft);
}
.footer em {
  font-style: normal;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 760px) {
  .topbar__inner { padding: 10px 16px; gap: 12px; }
  .brand__tag { display: none; }
  .topbar__meta { display: none; }

  .main { padding: 32px 16px 56px; }
  .hero__title { font-size: 24px; }
  .hero__subtitle { font-size: 14px; }
  .hero__subtitle-keep { display: inline; white-space: normal; }

  .grid { grid-template-columns: 1fr; }

  .modal__sheet {
    width: 100%;
    border-left: none;
  }
  .modal__head {
    padding: 22px 22px 16px;
    flex-direction: column;
    gap: 14px;
  }
  .modal__head-text { padding-right: 36px; }
  .modal__bar {
    padding: 14px 22px;
    flex-direction: column;
    align-items: flex-start;
  }
  .modal__meta { gap: 18px; }
  .modal__body { padding: 4px 22px 22px; }

  .footer__inner { grid-template-columns: 1fr; gap: 22px; padding: 24px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================
   SYNC BAR (tự cập nhật)
   ============================ */
.sync {
  max-width: 1200px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.sync__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.sync__status {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  min-width: 0;
}
.sync__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--ink-subtle);
}
.sync__dot[data-state="off"]  { background: var(--ink-subtle); }
.sync__dot[data-state="warn"] { background: #f59e0b; }
.sync__dot[data-state="ok"]   { background: #16a34a; }
.sync__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.sync__hint {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.sync__hint b { color: var(--ink-soft); font-weight: 600; }

/* ============================
   TOAST
   ============================ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  z-index: 300;
  max-width: min(92vw, 460px);
  padding: 11px 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast--show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast[data-kind="ok"]    { background: #15803d; }
.toast[data-kind="error"] { background: var(--danger); }

/* ============================
   WIZARD (hướng dẫn cài đặt)
   ============================ */
.wizard {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.wizard[hidden] { display: none; }
.wizard__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade 0.2s ease-out;
}
.wizard__sheet {
  position: relative;
  width: min(640px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden; /* sheet không cuộn; chỉ .wizard__steps cuộn → header + nút × đứng yên */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: pop-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes pop-in {
  0%   { opacity: 0; transform: translateY(8px) scale(0.99); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.wizard__head {
  flex: none;
  padding: 26px 28px 12px;
}
.wizard__title {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.wizard__sub {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}
.wizard__sub b { color: var(--ink-soft); font-weight: 600; }

.wizard__steps {
  flex: 1 1 auto;
  min-height: 0;            /* cho phép flex child co lại để cuộn */
  overflow-y: auto;
  overscroll-behavior: contain;  /* không cuộn lan ra trang nền */
  scroll-behavior: smooth;
  padding: 16px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* thanh cuộn mảnh, đồng bộ tông màu */
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.wizard__steps::-webkit-scrollbar { width: 12px; }
.wizard__steps::-webkit-scrollbar-track { background: transparent; }
.wizard__steps::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
  border: 4px solid var(--surface);  /* viền trùng nền → thumb trông mảnh, có đệm */
  background-clip: padding-box;
}
.wizard__steps::-webkit-scrollbar-thumb:hover {
  background: var(--ink-subtle);
  background-clip: padding-box;
}
.wstep {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.wstep.is-done { background: #f0fdf4; border-color: #bbf7d0; }
.wstep__marker {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}
.wstep.is-done .wstep__marker { background: #16a34a; font-size: 0; }
.wstep.is-done .wstep__marker::after { content: '✓'; font-size: 14px; }
.wstep__body { flex: 1; min-width: 0; }
.wstep__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}
.wstep__desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.wstep__desc:last-child { margin-bottom: 0; }
.wstep__desc code,
.wz-copyrow code,
.wz-folders__label code,
.wz-folders__list code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  color: var(--ink);
}
.wstep b { color: var(--ink); font-weight: 600; }
.wstep__done-text {
  margin-top: 10px;
  font-size: 13px;
  color: #15803d;
  font-weight: 500;
}
.wstep__done-text[hidden] { display: none; }

.wz-copyrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
}
.wz-copyrow code {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
}

.wz-guide {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 11px;
  margin-bottom: 14px;
}
.wz-guide li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.wz-guide__n {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mock công tắc Developer mode (trạng thái bật) */
.wz-toggle {
  display: inline-flex;
  align-items: center;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--accent);
  padding: 2px;
  flex: none;
}
.wz-toggle__knob {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  margin-left: auto;
}
/* Mock nút Load unpacked */
.wz-fakebtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  background: var(--surface);
  white-space: nowrap;
}

.wz-folders {
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.wz-folders__label {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.wz-folders__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 168px;
  overflow-y: auto;
}
.wz-folders__list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-muted);
  padding: 2px 0;
}
.wz-folders__list code { flex: none; }
.wz-folders__list li.is-bridge { font-weight: 600; color: var(--ink-soft); }
.wz-folders__list li.is-bridge code { color: var(--accent); border-color: var(--accent); }
/* Dấu tích cho extension đã Load unpacked (Bridge báo qua `installed`) */
.wz-folders__list li .wz-folder-check {
  margin-left: auto;
  flex: none;
  width: 16px;
  text-align: center;
  font-weight: 700;
  color: #15803d;
}
.wz-folders__list li.is-loaded { color: #15803d; }
.wz-folders__list li.is-loaded .wz-folder-check::after { content: "✓"; }

.wstep__check {
  font-size: 13px;
  font-weight: 500;
  margin-top: 10px;
}
.wstep__check[data-kind="ok"]   { color: #15803d; }
.wstep__check[data-kind="warn"] { color: #b45309; }
.wz-final {
  margin-top: 12px !important;
  padding: 12px 14px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
  color: #15803d !important;
}
.wz-final[hidden] { display: none; }

@media (max-width: 760px) {
  .wizard { padding: 0; align-items: flex-end; }
  .wizard__sheet {
    max-height: 92vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .wizard__head { padding: 22px 20px 6px; }
  .wizard__steps { padding: 14px 20px 22px; }
}

/* ============================
   DIALOG cảnh báo (thay alert)
   ============================ */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.dialog[hidden] { display: none; }
.dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(24, 24, 27, 0.5);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fade 0.15s ease-out;
}
.dialog__sheet {
  position: relative;
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  animation: pop-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.dialog__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}
.dialog__title::before {
  content: '⚠';
  font-size: 16px;
  color: #b45309;
}
.dialog__msg {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  white-space: pre-line;
}
.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}
