/* =========================================================
   BASE — token màu, kiểu chữ, nút, ô nhập, hộp thoại, thông báo
   Dùng chung cho trang khách (index.html) và trang quản trị (admin.html)
   ========================================================= */

:root {
  /* Màu chủ đạo: được ghi đè bởi Cài đặt > Màu chủ đạo */
  --accent-l: #2f54eb;
  --accent-d: #7b93ff;
  --accent2-l: #7c4ddb;
  --accent2-d: #a98bff;
  --on-accent-l: #ffffff;

  --bg: #f3f5fa;
  --bg-2: #eaeef6;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #edf0f7;
  --ink: #131a2c;
  --ink-2: #3b4460;
  --muted: #6a7390;
  --line: #e0e5ef;
  --line-2: #cfd6e4;
  --accent: var(--accent-l);
  --accent2: var(--accent2-l);
  --on-accent: var(--on-accent-l);
  --price: #e0452b;
  --ok: #15a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --star: #f5a524;
  --blob-op: .42;

  --accent-soft: color-mix(in srgb, var(--accent) 11%, var(--surface));
  --accent-line: color-mix(in srgb, var(--accent) 38%, var(--line));
  --grad: linear-gradient(135deg, var(--accent), var(--accent2));
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);

  --shadow-sm: 0 1px 2px rgba(19, 26, 44, .06);
  --shadow: 0 1px 2px rgba(19, 26, 44, .05), 0 8px 24px -6px rgba(19, 26, 44, .09);
  --shadow-lg: 0 2px 6px rgba(19, 26, 44, .06), 0 28px 64px -12px rgba(19, 26, 44, .22);

  /* Bo góc thống nhất */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-pill: 999px;

  --ease: cubic-bezier(.22, .8, .24, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0f1c;
    --bg-2: #0f1426;
    --surface: #131a2b;
    --surface-2: #182036;
    --surface-3: #1f2841;
    --ink: #e8ecf7;
    --ink-2: #c1c8dc;
    --muted: #8c95b0;
    --line: #252e48;
    --line-2: #323c5a;
    --accent: var(--accent-d);
    --accent2: var(--accent2-d);
    --on-accent: #0b0f1c;
    --price: #ff7a5e;
    --ok: #46d38a;
    --warn: #fbbf24;
    --danger: #f87171;
    --blob-op: .22;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -6px rgba(0, 0, 0, .45);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 28px 64px -12px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0f1c;
  --bg-2: #0f1426;
  --surface: #131a2b;
  --surface-2: #182036;
  --surface-3: #1f2841;
  --ink: #e8ecf7;
  --ink-2: #c1c8dc;
  --muted: #8c95b0;
  --line: #252e48;
  --line-2: #323c5a;
  --accent: var(--accent-d);
  --accent2: var(--accent2-d);
  --on-accent: #0b0f1c;
  --price: #ff7a5e;
  --ok: #46d38a;
  --warn: #fbbf24;
  --danger: #f87171;
  --blob-op: .22;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -6px rgba(0, 0, 0, .45);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .35), 0 28px 64px -12px rgba(0, 0, 0, .6);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
html.no-scroll { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
h1, h2, h3, h4 { text-wrap: balance; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.ic { flex: none; display: block; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
  transition: background-color .45s var(--ease), border-color .45s var(--ease), color .45s var(--ease), fill .45s, stroke .45s !important;
}

/* Thanh cuộn mảnh */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Tiện ích ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.ml-auto { margin-left: auto; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: .02em; }
kbd {
  font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 6px; border-radius: 6px;
  background: var(--surface-3); color: var(--muted);
  border: 1px solid var(--line); border-bottom-width: 2px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

/* Biểu tượng game (chữ viết tắt trên nền màu) */
.av {
  --c: var(--accent);
  width: 36px; height: 36px; flex: none;
  display: inline-grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--c);
  background-image: linear-gradient(135deg, rgba(255,255,255,.22), rgba(255,255,255,0) 60%);
  color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.av.xs { width: 22px; height: 22px; font-size: 9.5px; border-radius: 6px; }
.av.sm { width: 28px; height: 28px; font-size: 10.5px; border-radius: 7px; }
.av.lg { width: 56px; height: 56px; font-size: 18px; border-radius: var(--r); }
.av.ph-av { background: var(--surface-3); color: var(--muted); box-shadow: none; }

.logo-mark {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--r);
  background: var(--accent); background-image: var(--grad); color: var(--on-accent);
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  transition: transform .5s var(--spring);
}
.logo-mark.sm { width: 32px; height: 32px; border-radius: 10px; }

/* ---------- Nút ---------- */
.btn {
  --h: 42px;
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 16px;
  border-radius: var(--r); border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; font-size: 14px; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .2s, border-color .2s, box-shadow .25s, color .2s, filter .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn-primary {
  background: var(--accent); background-image: var(--grad); color: var(--on-accent);
  box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--accent) 80%, transparent);
}
.btn-primary:hover { background: var(--accent); background-image: var(--grad); filter: brightness(1.07); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn-soft { background: var(--accent-soft); color: var(--accent); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 18%, var(--surface)); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.08); }
.btn-ghost.danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }
.btn-lg { --h: 50px; padding: 0 22px; font-size: 15px; }
.btn-icon { width: var(--h); padding: 0; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 2px; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 600;
  transition: color .2s;
}
.link-btn:hover { color: var(--accent); }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.ripple {
  position: absolute; z-index: -1; border-radius: 50%;
  background: currentColor; opacity: .18; pointer-events: none;
  transform: scale(0); animation: ripple .6s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- Nhãn ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  height: 21px; padding: 0 8px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  white-space: nowrap; vertical-align: middle;
}
.badge-hot { background: color-mix(in srgb, var(--price) 13%, var(--surface)); color: var(--price); }
.badge-new { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.badge-sale { position: relative; overflow: hidden; background: var(--price); color: #fff; }
.badge-sale::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.55) 50%, transparent 80%);
  transform: translateX(-120%); animation: shimmer 2.8s ease-in-out infinite;
}
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
@keyframes shimmer { 0%, 55% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* ---------- Ô nhập ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .opt-l { font-style: normal; font-weight: 500; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); }
.hint.warn { color: var(--warn); }
.err { font-size: 12.5px; color: var(--danger); min-height: 0; }
.err:empty { display: none; }
.input, .select, .textarea {
  width: 100%; min-width: 0;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; font-size: 14px; line-height: 1.4;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line-2)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.invalid, .select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); animation: shake .35s; }
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93ad' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.select:disabled { opacity: .55; cursor: not-allowed; }
.textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.input-suffix { position: relative; }
.input-suffix .input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.input-suffix > span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; pointer-events: none; }

/* Công tắc bật/tắt */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; vertical-align: middle; }
.switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--line-2); transition: background-color .25s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: transform .35s var(--spring);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 42px; }

/* Ô tích */
.check { position: relative; display: inline-grid; place-items: center; width: 18px; height: 18px; flex: none; vertical-align: middle; }
.check input { position: absolute; inset: -4px; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.check span { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--line-2); background: var(--surface); transition: .2s; display: grid; place-items: center; }
.check span::after { content: ""; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); margin-top: -2px; transition: transform .25s var(--spring); }
.check input:checked + span { background: var(--accent); border-color: var(--accent); }
.check input:checked + span::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check-row .check { margin-top: 2px; }

/* Nút chọn dạng phân đoạn */
.seg { position: relative; display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--surface-3); }
.seg button {
  position: relative; z-index: 1;
  border: 0; background: none; cursor: pointer;
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: color .2s, background-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.seg.has-pill button.on { background: none; box-shadow: none; }
.seg .pill { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: 0; border-radius: 6px; background: var(--surface); box-shadow: var(--shadow-sm); transition: left .35s var(--ease), width .35s var(--ease); }
.seg.full { display: flex; }
.seg.full button { flex: 1; }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Nút radio tròn */
.radio { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; transition: border-color .25s; }
.radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transform: scale(0); transition: transform .35s var(--spring); }
.radio.on, [aria-pressed="true"] > .radio { border-color: var(--accent); }
.radio.on::after, [aria-pressed="true"] > .radio::after { transform: scale(1); }

/* ---------- Thông báo nổi (toast) ---------- */
.toasts {
  position: fixed; z-index: 400; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 10px;
  border-radius: var(--r);
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  animation: toastIn .45s var(--spring);
}
.toast .ic { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--ok); color: #fff; }
.toast.t-err .ic { background: var(--danger); }
.toast.t-info .ic { background: var(--accent); color: var(--on-accent); }
.toast .t-act { margin-left: 6px; border: 0; cursor: pointer; background: color-mix(in srgb, var(--bg) 16%, transparent); color: var(--bg); font-weight: 700; font-size: 13px; padding: 6px 10px; border-radius: var(--r-sm); }
.toast .t-act:hover { background: color-mix(in srgb, var(--bg) 26%, transparent); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Hộp thoại & ngăn kéo ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(8, 12, 24, .48);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  opacity: 0; transition: opacity .28s var(--ease);
}
.overlay.show { opacity: 1; }
.overlay.top { align-items: flex-start; padding-top: max(16px, 9vh); }
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(.97);
  transition: transform .4s var(--spring);
}
.overlay.show .modal { transform: none; }
.overlay.side { justify-content: flex-end; align-items: stretch; padding: 0; }
.drawer {
  width: min(520px, 100%); height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  border-radius: var(--r-lg) 0 0 var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateX(48px); opacity: .6;
  transition: transform .45s var(--ease), opacity .3s;
}
.drawer.wide { width: min(620px, 100%); }
.overlay.show .drawer { transform: none; opacity: 1; }
.dr-h, .md-h { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.dr-h h3, .md-h h3 { margin: 0; font-size: 17px; flex: 1; }
.dr-b { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.md-b { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.dr-f, .md-f { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--surface-2); }
.md-f { border-radius: 0 0 var(--r-lg) var(--r-lg); padding-bottom: 14px; }
.dr-f .spacer { flex: 1; }
@media (max-width: 560px) { .drawer, .drawer.wide { border-radius: 0; border-left: 0; } }

.confirm .cf-body { display: flex; gap: 14px; padding: 22px 22px 18px; }
.confirm h3 { margin: 2px 0 6px; font-size: 17px; }
.confirm p { margin: 0; color: var(--ink-2); font-size: 14px; }
.cf-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: var(--r); background: var(--accent-soft); color: var(--accent); }
.cf-ic.danger { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }
.cf-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

/* ---------- Trạng thái trống ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 16px; color: var(--muted); }
.empty .ic { color: var(--line-2); margin-bottom: 4px; }
.empty b { color: var(--ink); font-size: 15px; }
.empty p { margin: 0 0 6px; max-width: 42ch; }

/* ---------- Hình nền mờ chuyển động ---------- */
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: var(--blob-op); pointer-events: none; will-change: transform; animation: drift 20s ease-in-out infinite alternate; }
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.08); }
  100% { transform: translate(-30px, 10px) scale(.95); }
}

/* ---------- Hiệu ứng dùng chung ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(3px); } 30%, 50%, 70% { transform: translateX(-5px); } 40%, 60% { transform: translateX(5px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes spinIn { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }
.spin-in { animation: spinIn .45s var(--spring); }
.shake { animation: shake .45s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- Biểu tượng kênh liên hệ ---------- */
.ch-ic {
  flex: none; display: inline-grid; place-items: center;
  border-radius: 28%;
  background: var(--chbg);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 4px 10px -4px rgba(0,0,0,.35);
}
.ch-txt { font-weight: 800; letter-spacing: -.02em; line-height: 1; color: #fff; }

/* ---------- Hộp thoại lớn căn giữa màn hình ---------- */
.modal.big {
  width: min(720px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  max-height: calc(100dvh - 32px);
}
.modal.big .dr-b { overflow-y: auto; flex: 1; }
.modal.big .dr-f { border-radius: 0 0 var(--r-lg) var(--r-lg); padding-bottom: 14px; }
.modal.big.narrow { width: min(540px, 100%); }

/* ---------- Bộ 3 nút gạt (chỉ bật được 1) ---------- */
.modes { display: flex; flex-wrap: wrap; gap: 8px; }
.mode {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 12px 7px 8px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface-2);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.mode:hover { border-color: var(--line-2); }
.mode.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--ink); }
.mode .switch { width: 36px; height: 20px; pointer-events: none; }
.mode .switch span::after { width: 14px; height: 14px; }
.mode .switch input:checked + span::after { transform: translateX(16px); }
.mode-note { font-size: 12.5px; color: var(--muted); }
.textarea.is-default { background: var(--surface-2); color: var(--muted); }
.textarea.is-none { background: var(--surface-2); }
