:root {
  --bg: #0b1015;
  --bg-soft: #111820;
  --surface: rgba(20, 29, 37, .92);
  --surface-solid: #141d25;
  --surface-2: #1b2630;
  --surface-3: #24313c;
  --border: rgba(176, 199, 211, .14);
  --border-strong: rgba(176, 199, 211, .25);
  --text: #f4f1e8;
  --text-soft: #c7d0d4;
  --muted: #83929a;
  --accent: #ffb547;
  --accent-strong: #f39521;
  --accent-ink: #241607;
  --cyan: #6ed7cf;
  --danger: #ff716c;
  --success: #65d58b;
  --warn: #ffd166;
  --shadow: 0 24px 70px rgba(0, 0, 0, .34);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 264px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(110, 215, 207, .10), transparent 30%),
    radial-gradient(circle at 92% 8%, rgba(255, 181, 71, .10), transparent 28%),
    linear-gradient(145deg, #090e12 0%, var(--bg) 55%, #0f171d 100%);
  color: var(--text);
  font-family: "Avenir Next", "SF Pro Text", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.8), transparent 82%);
}

button, input, textarea, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* Login */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 18% 14%, rgba(110, 215, 207, .13), transparent 34%),
    radial-gradient(circle at 85% 90%, rgba(255, 181, 71, .12), transparent 32%),
    #090e12;
}
.login-overlay.hidden { display: none; }
.login-shell {
  width: min(420px, 100%);
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  background: rgba(13, 20, 26, .88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  animation: rise .55s cubic-bezier(.2,.8,.2,1) both;
}
.login-brand {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(140deg, rgba(110, 215, 207, .12), rgba(255, 181, 71, .06)),
    repeating-linear-gradient(135deg, transparent 0 18px, rgba(255,255,255,.022) 18px 19px);
  border-bottom: 1px solid var(--border);
}
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: #0b1217;
  box-shadow: 0 12px 30px rgba(243,149,33,.18);
}
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-name { font-weight: 800; letter-spacing: -.02em; }
.brand-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.login-panel { padding: 28px; display: flex; align-items: center; }
.login-box { width: 100%; }
.login-box h2 { margin: 0 0 18px; font-size: 25px; letter-spacing: -.035em; }
.input-shell { position: relative; }
.input-shell .input-label { display: block; margin-bottom: 8px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.login-box input,
.form-group input,
.form-group textarea,
.search-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(6, 11, 15, .68);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.login-box input { height: 52px; padding: 0 15px; font-size: 16px; }
.login-box input:focus,
.form-group input:focus,
.form-group textarea:focus,
.search-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(110,215,207,.09); background: #0b1217; }
.btn-login {
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(243,149,33,.19);
  transition: transform .2s, filter .2s;
}
.btn-login:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-login:disabled { cursor: wait; filter: saturate(.5); transform: none; }
.login-error { min-height: 0; margin-top: 10px; color: var(--danger); font-size: 13px; opacity: 0; transform: translateY(-4px); transition: .2s; }
.login-error.show { opacity: 1; transform: none; }
.login-footnote { display: none; }

/* App shell */
.app-content { display: none; min-height: 100vh; }
.app-content.show { display: block; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 110;
  width: var(--sidebar);
  padding: 26px 18px 20px;
  display: flex;
  flex-direction: column;
  background: rgba(11, 17, 22, .9);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px);
}
.sidebar .brand-lockup { padding: 0 8px 22px; }
.nav-label { padding: 14px 10px 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.nav-list { display: grid; gap: 5px; }
.tab {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: background .18s, color .18s, border-color .18s, transform .18s;
}
.tab:hover { color: var(--text); background: rgba(255,255,255,.035); transform: translateX(2px); }
.tab.active { color: var(--text); border-color: rgba(255,181,71,.24); background: linear-gradient(90deg, rgba(255,181,71,.16), rgba(255,181,71,.045)); }
.tab-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 12px;
  letter-spacing: -.03em;
}
.tab.active .tab-icon { background: var(--accent); color: var(--accent-ink); }
.sidebar-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--border); }
.live-status { display: flex; align-items: center; gap: 8px; color: var(--text-soft); font-size: 12px; font-weight: 700; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 5px rgba(101,213,139,.1); }
.sidebar-meta { margin: 9px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.btn-logout {
  width: 100%;
  height: 39px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.btn-logout:hover { border-color: rgba(255,113,108,.35); color: var(--danger); }

.workspace { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 72px;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: rgba(11, 16, 21, .76);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.topbar-copy .eyebrow { display: none; }
.topbar-copy h1 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.topbar-copy p { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.version-badge {
  height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  background: var(--surface);
  color: var(--cyan);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
}
.btn-publish, .btn-add, .btn-save, .btn-cancel, .btn-sm {
  border: 0;
  cursor: pointer;
  transition: transform .18s, filter .18s, background .18s, color .18s, border-color .18s;
}
.btn-publish {
  height: 42px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 26px rgba(243,149,33,.16);
}
.btn-publish:hover, .btn-add:hover, .btn-save:hover { transform: translateY(-2px); filter: brightness(1.05); }
.mobile-tabs, .mobile-menu, .mobile-menu-btn { display: none; }

/* Nút icon dùng chung (tải ảnh…) */
.icon-btn { width: 30px; height: 30px; display: inline-grid; place-items: center; flex: 0 0 auto; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; transition: border-color .16s, color .16s, background .16s; }
.icon-btn:hover { border-color: var(--cyan); background: rgba(110,215,207,.1); color: var(--cyan); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn svg { width: 15px; height: 15px; }
.skin-card-actions { position: absolute; top: 9px; right: 9px; display: flex; gap: 5px; opacity: 0; transition: opacity .16s; }
.skin-card:hover .skin-card-actions, .skin-card:focus-within .skin-card-actions { opacity: 1; }
@media (hover: none) { .skin-card-actions { opacity: 1; } }

.content { width: min(1280px, 100%); margin: 0 auto; padding: 28px 30px 56px; }
.section { display: none; }
.section.active { display: block; animation: sectionIn .3s ease both; }

/* Overview */
.overview-hero {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  margin-bottom: 18px;
  padding: 32px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr);
  align-items: end;
  gap: 24px;
  border: 1px solid rgba(255,181,71,.2);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 84% 20%, rgba(255,181,71,.18), transparent 29%),
    linear-gradient(135deg, rgba(110,215,207,.08), rgba(255,181,71,.08)),
    var(--surface-solid);
  box-shadow: var(--shadow);
}
.overview-hero::after {
  content: "11";
  position: absolute;
  right: -6px;
  bottom: -48px;
  color: rgba(255,255,255,.035);
  font-family: "Avenir Next Condensed", "Avenir Next", sans-serif;
  font-size: 240px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.12em;
}
.overview-hero h2 { max-width: 660px; margin: 9px 0 10px; font-size: clamp(28px, 4vw, 46px); line-height: 1.04; letter-spacing: -.055em; }
.overview-hero p { max-width: 650px; margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.7; }
.hero-status { position: relative; z-index: 1; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(7,12,16,.55); }
.hero-status-row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.hero-status-row:last-child { border-bottom: 0; }
.hero-status-row span { color: var(--muted); }
.hero-status-row strong { color: var(--text); text-align: right; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  transition: transform .2s, border-color .2s, background .2s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(110,215,207,.28); background: var(--surface-2); }
.stat-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-arrow { color: var(--cyan); font-size: 14px; }
.stat-value { margin-top: 10px; font-family: "Avenir Next Condensed", "Avenir Next", sans-serif; font-size: 32px; font-weight: 900; letter-spacing: -.04em; }
.method { min-width: 43px; font-weight: 900; }
.method.get { color: var(--success); }
.method.post { color: var(--warn); }
.method.write { color: var(--cyan); }

/* Sections and tables */
.section-head { margin-bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-title h2 { margin: 4px 0 4px; font-size: 25px; letter-spacing: -.04em; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.count-badge { display: inline-flex; min-width: 28px; height: 23px; margin-left: 6px; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--cyan); font-size: 11px; vertical-align: middle; }
.count-badge[hidden] { display: none; }
.section-tools { display: flex; align-items: center; gap: 9px; }
.search-wrap { position: relative; width: min(280px, 32vw); }
.search-wrap::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 16px; }
.search-input { height: 42px; padding: 0 13px 0 36px; font-size: 13px; }
.btn-add { height: 42px; padding: 0 15px; border-radius: 11px; background: var(--cyan); color: #061714; font-size: 13px; font-weight: 900; white-space: nowrap; }
.table-shell { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: 0 16px 45px rgba(0,0,0,.14); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { padding: 12px 15px; background: rgba(255,255,255,.025); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.data-table thead th:first-child { width: 84px; }
.data-table thead th:nth-last-child(2) { width: 150px; }
.data-table thead th:last-child { width: 150px; text-align: right; }
.data-table tbody tr { cursor: grab; user-select: none; transition: background .16s; }
.data-table tbody tr:hover { background: rgba(110,215,207,.035); }
.data-table tbody td { padding: 13px 15px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: 13px; vertical-align: middle; }
.data-table tbody td.item-name { color: var(--text); font-weight: 700; }
.row-index { display: flex; align-items: center; gap: 7px; color: var(--muted); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11px; }
.drag-handle { width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 8px; background: var(--surface-2); color: var(--muted); cursor: grab; touch-action: none; }
.drag-handle:hover { color: var(--text); background: var(--surface-3); }
.id-code { display: inline-flex; padding: 4px 8px; border: 1px solid var(--border); border-radius: 7px; background: rgba(5,10,13,.45); color: var(--cyan); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11px; }
.actions { display: flex; justify-content: flex-end; gap: 7px; }
.btn-sm { min-height: 32px; padding: 0 11px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); font-size: 11px; font-weight: 800; }
.btn-edit:hover { border-color: rgba(110,215,207,.3); color: var(--cyan); }
.btn-del { background: rgba(255,113,108,.07); color: var(--danger); }
.btn-del:hover { border-color: rgba(255,113,108,.3); background: rgba(255,113,108,.12); }
.data-table tbody tr.dragging { opacity: .45; background: rgba(255,181,71,.1); }
.data-table tbody tr.drag-over { box-shadow: inset 0 3px 0 var(--accent); }
.empty-state { padding: 38px 20px !important; color: var(--muted) !important; text-align: center; cursor: default; }

.exc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.exc-card { min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.exc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.exc-hero { color: var(--text); font-size: 14px; font-weight: 900; }
.exc-count { color: var(--muted); font-size: 10px; font-weight: 800; }
.exc-skins { display: grid; gap: 7px; margin-top: 10px; }
.skin-row { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; }
.skin-thumb { width: 42px; height: 42px; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); }
.skin-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; }
.skin-thumb-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font: 700 10px ui-monospace, monospace; }
.skin-copy { min-width: 0; }
.skin-name { overflow: hidden; color: var(--text-soft); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.skin-meta { margin-top: 3px; color: var(--muted); font: 10px ui-monospace, "SFMono-Regular", Menlo, monospace; }
.skin-row-actions { display: flex; gap: 5px; }
.skin-row-actions .btn-sm { min-height: 29px; padding: 0 8px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 11px; }
.hero-filter { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.hero-filter input { width: 14px; height: 14px; accent-color: var(--cyan); }
.hero-card { min-width: 0; display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: center; gap: 11px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color .16s, background .16s, transform .16s; }
.hero-card:hover { border-color: var(--cyan); background: rgba(110,215,207,.07); transform: translateY(-1px); }
.hero-avatar { width: 54px; height: 54px; display: block; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-2); }
.hero-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 15%; }
.hero-avatar-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--muted); font: 700 10px ui-monospace, monospace; }
.hero-copy { min-width: 0; display: block; }
.hero-name { display: block; overflow: hidden; color: var(--text); font-size: 14px; font-weight: 900; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.hero-meta { display: flex; align-items: center; gap: 7px; margin-top: 5px; color: var(--muted); font: 10px ui-monospace, monospace; }
.hero-skin-badge { display: inline-flex; height: 19px; padding: 0 7px; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--cyan); font-size: 10px; font-weight: 800; }
.hero-skin-summary { margin-bottom: 12px; color: var(--muted); font-size: 11.5px; }
.hero-card.no-art { background: rgba(15,23,29,.5); }
.hero-card.no-art .hero-avatar { border-style: dashed; }
.hero-card.no-art .hero-name { color: var(--text-soft); }
.hero-modal-actions { display: flex; gap: 8px; margin-bottom: 13px; }
.hero-modal-actions .skin-modal-open { flex: 1 1 auto; width: auto; min-height: 40px; margin-bottom: 0; }
.hero-modal-actions .skin-modal-all { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 11px; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.hero-modal-actions .skin-modal-all svg { width: 15px; height: 15px; }
.hero-skin-grid .skin-picker-card { grid-template-columns: 40px minmax(0, 1fr) auto; cursor: default; }
.hero-skin-grid .skin-picker-card:hover { border-color: var(--border); background: var(--surface-2); }

/* ===== Danh sách skin (tab xem nhanh) ===== */
.skin-browser-tools { flex-wrap: wrap; justify-content: flex-end; }
.skin-browser-select { height: 42px; max-width: 230px; padding: 0 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); color: var(--text); font: 600 13px inherit; cursor: pointer; }
.skin-browser-select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(110,215,207,.09); }
.skin-browser-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px 12px; color: var(--muted); font-size: 11.5px; }
.skin-browser-bar strong { color: var(--text-soft); }
.skin-browser-pager { display: flex; align-items: center; gap: 8px; }
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 10px; }
.skin-card { position: relative; min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); align-items: center; gap: 11px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.skin-card-avatar { width: 56px; height: 56px; display: block; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface-2); }
.skin-card-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 15%; }
.skin-card-body { min-width: 0; }
.skin-card-hero { overflow: hidden; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .02em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.skin-card-name { overflow: hidden; margin-top: 3px; color: var(--text); font-size: 12.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.skin-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 5px; }
.skin-tag { display: inline-flex; height: 18px; padding: 0 6px; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 600 9.5px ui-monospace, monospace; }
.skin-tag.warn { border-color: rgba(255,181,71,.32); background: rgba(255,181,71,.1); color: #ffb547; }
.skin-tag.danger { border-color: rgba(255,113,108,.38); background: rgba(255,113,108,.12); color: var(--danger); }
.skin-card.no-art { background: rgba(15,23,29,.5); }
.skin-card.no-art .skin-card-avatar { border-style: dashed; }
.skin-card.no-art .skin-card-name { color: var(--muted); }
.skin-modal-open { width: 100%; min-height: 38px; margin-bottom: 13px; border-radius: 11px; font-size: 12px; font-weight: 800; cursor: pointer; }
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 9px; }
.chip { min-width: 0; padding: 9px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.chip .skin-thumb { width: 42px; height: 42px; }
.chip-main { min-width: 0; }
.chip-key { display: block; color: var(--muted); font: 10px ui-monospace, "SFMono-Regular", Menlo, monospace; }
.chip-info { display: block; overflow: hidden; margin-top: 3px; color: var(--text-soft); font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.chip .x { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid rgba(255,113,108,.18); border-radius: 8px; background: rgba(255,113,108,.07); color: var(--danger); cursor: pointer; font-size: 16px; }
.format-note { margin: -4px 0 14px; color: var(--muted); font-size: 11px; }
.skin-config-tools { display: flex; gap: 7px; flex-wrap: wrap; }
.btn-import { height: 42px; padding: 0 13px; border: 1px solid rgba(110,215,207,.26); border-radius: 11px; background: rgba(110,215,207,.08); color: var(--cyan); font-size: 12px; font-weight: 900; white-space: nowrap; }
.btn-import:hover { border-color: var(--cyan); background: rgba(110,215,207,.14); }
.skin-picker-search { margin-bottom: 12px; }
.skin-picker-grid { max-height: min(58vh, 510px); overflow: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding-right: 2px; }
.skin-picker-card { min-width: 0; display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; }
.skin-picker-card:hover, .skin-picker-card.selected { border-color: var(--cyan); background: rgba(110,215,207,.12); }
.skin-picker-card.selected { box-shadow: inset 0 0 0 1px rgba(110,215,207,.24); }
.skin-picker-card.existing { opacity: .52; cursor: not-allowed; }
.skin-picker-card .skin-thumb { width: 40px; height: 40px; }
.skin-picker-copy { min-width: 0; }
.skin-picker-name { overflow: hidden; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.skin-picker-meta { margin-top: 3px; color: var(--muted); font: 9px ui-monospace, monospace; }
.skin-picker-empty { grid-column: 1 / -1; padding: 26px 10px; color: var(--muted); font-size: 11px; text-align: center; }
.skin-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 11px; color: var(--muted); font-size: 11px; }

/* CDN dump tool */
.dump-console { overflow: hidden; border: 1px solid rgba(110,215,207,.2); border-radius: var(--radius-lg); background: linear-gradient(145deg, rgba(110,215,207,.06), transparent 42%), var(--surface); box-shadow: 0 18px 52px rgba(0,0,0,.18); }
.dump-controls { padding: 22px; display: grid; grid-template-columns: minmax(220px, .72fr) minmax(300px, 1.28fr); gap: 18px; border-bottom: 1px solid var(--border); }
.dump-source { padding: 5px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; border: 1px solid var(--border); border-radius: 13px; background: rgba(5,10,13,.42); }
.dump-source button { min-height: 42px; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; }
.dump-source button.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(243,149,33,.14); }
.dump-help { margin: 11px 2px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.dump-help code { color: var(--cyan); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.dump-input-label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.dump-id-input { width: 100%; min-height: 82px; padding: 11px 13px; border: 1px solid var(--border-strong); border-radius: 12px; background: rgba(6,11,15,.68); color: var(--text); outline: none; resize: vertical; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; line-height: 1.55; }
.dump-id-input:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(110,215,207,.09); }
.dump-runner { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 8px; }
.dump-run, .dump-secondary { min-height: 40px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: 12px; font-weight: 900; }
.dump-run { border: 0; background: var(--cyan); color: #061714; }
.dump-run:disabled { cursor: wait; opacity: .62; }
.dump-secondary { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft); }
.dump-secondary:hover { border-color: rgba(110,215,207,.3); color: var(--cyan); }
.dump-results-head { min-height: 60px; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: rgba(5,10,13,.24); }
.dump-summary { color: var(--muted); font-size: 12px; }
.dump-summary strong { color: var(--text); }
.dump-grid { padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 11px; }
.dump-empty { grid-column: 1 / -1; min-height: 190px; display: grid; place-items: center; padding: 26px; color: var(--muted); font-size: 12px; text-align: center; }
.dump-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: rgba(10,16,21,.76); }
.dump-card.missing { opacity: .62; }
.dump-preview { position: relative; aspect-ratio: 16 / 8.5; display: grid; place-items: center; overflow: hidden; background-color: #0c141a; background-image: linear-gradient(45deg, rgba(255,255,255,.035) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.035) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.035) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.035) 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; border-bottom: 1px solid var(--border); }
.dump-preview img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.dump-preview-label { position: absolute; top: 9px; left: 9px; padding: 4px 7px; border-radius: 7px; background: rgba(5,10,13,.78); color: var(--cyan); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 10px; font-weight: 800; backdrop-filter: blur(8px); }
.dump-missing { color: var(--muted); font-size: 11px; font-weight: 800; }
.dump-card-body { padding: 13px; }
.dump-name { min-height: 36px; color: var(--text); font-size: 13px; font-weight: 800; line-height: 1.38; }
.dump-name.unnamed { color: var(--muted); font-style: italic; font-weight: 600; }
.dump-catalog { margin-top: 5px; color: var(--cyan); font-size: 10px; line-height: 1.4; }
.dump-name-source { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dump-name-source.verified { border-color: rgba(50, 211, 153, .35); color: var(--green); }
.dump-meta { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.dump-ok { color: var(--success); }
.dump-no { color: var(--danger); }
.dump-new { color: var(--accent); }
.dump-card-actions { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dump-card-actions button, .dump-card-actions a { min-height: 36px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 10px; font-weight: 900; text-decoration: none; }
.dump-card-actions button:hover, .dump-card-actions a:hover { border-color: rgba(110,215,207,.3); color: var(--cyan); }

/* Runtime catalog */
.runtime-hero { position: relative; overflow: hidden; padding: 17px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .8fr); gap: 14px; border: 1px solid rgba(110,215,207,.22); border-radius: var(--radius-lg); background: linear-gradient(125deg, rgba(110,215,207,.1), transparent 44%), linear-gradient(315deg, rgba(255,181,71,.08), transparent 40%), rgba(15,23,29,.92); box-shadow: 0 22px 60px rgba(0,0,0,.2); }
.runtime-hero::after { content: "RUNTIME"; position: absolute; right: -18px; bottom: -30px; color: rgba(255,255,255,.025); font-family: "Avenir Next Condensed", "Avenir Next", sans-serif; font-size: 104px; font-weight: 900; letter-spacing: -.08em; pointer-events: none; }
.runtime-hero-copy { position: relative; z-index: 1; }
.runtime-status-line { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.runtime-status-chip { min-height: 28px; padding: 0 9px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgba(101,213,139,.26); border-radius: 999px; background: rgba(101,213,139,.08); color: var(--success); font-size: 10px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.runtime-status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(101,213,139,.09); }
.runtime-meta-line { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px 14px; color: var(--muted); font-size: 10px; }
.runtime-meta-line strong { color: var(--text); }
.runtime-import { position: relative; z-index: 1; padding: 17px; display: flex; flex-direction: column; justify-content: space-between; border: 1px solid var(--border); border-radius: 17px; background: rgba(5,10,13,.5); }
.runtime-import-label { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.runtime-import h4 { margin: 8px 0 5px; font-size: 16px; }
.runtime-import p { display: none; }
.runtime-import-actions { margin-top: 16px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.runtime-primary, .runtime-ghost { min-height: 42px; padding: 0 14px; border-radius: 11px; cursor: pointer; font-size: 11px; font-weight: 900; }
.runtime-primary { border: 0; background: var(--cyan); color: #061714; }
.runtime-primary:disabled { opacity: .55; cursor: wait; }
.runtime-ghost { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft); }
.runtime-primary:hover, .runtime-ghost:hover { filter: brightness(1.07); }
.runtime-device-panel { margin-top: 14px; padding: 14px 16px; border: 1px solid rgba(110,215,207,.18); border-radius: 16px; background: rgba(9,16,21,.74); }
.runtime-device-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.runtime-device-copy strong { display: block; color: var(--text); font-size: 12px; }
.runtime-device-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.runtime-device-list { margin-top: 11px; display: grid; gap: 7px; }
.runtime-device-item { min-width: 0; padding: 10px 11px; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 12px; background: rgba(5,10,13,.48); }
.runtime-device-name { overflow: hidden; color: var(--text-soft); font-size: 11px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; }
.runtime-device-meta { margin-top: 3px; color: var(--muted); font-size: 9px; }
.runtime-device-code { color: var(--accent); font-family: ui-monospace, monospace; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.runtime-device-actions { display: flex; align-items: center; gap: 6px; }
.runtime-device-actions button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; font-size: 9px; font-weight: 900; }
.runtime-device-actions button.approve { border-color: rgba(101,213,139,.28); color: var(--success); }
.runtime-device-empty { padding: 8px 0 2px; color: var(--muted); font-size: 10px; }
.runtime-stat-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.runtime-stat { min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 15px; background: rgba(16,24,31,.82); color: var(--text); text-align: left; cursor: pointer; transition: transform .18s, border-color .18s, background .18s; }
.runtime-stat:hover, .runtime-stat.active { transform: translateY(-2px); border-color: rgba(255,181,71,.34); background: linear-gradient(145deg, rgba(255,181,71,.08), rgba(16,24,31,.9)); }
.runtime-stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.runtime-stat-value { margin-top: 10px; font-family: "Avenir Next Condensed", "Avenir Next", sans-serif; font-size: 31px; font-weight: 900; letter-spacing: -.04em; }
.runtime-stat-diff { min-height: 17px; margin-top: 3px; color: var(--muted); font-size: 10px; }
.runtime-stat-diff.has-change { color: var(--accent); }
.runtime-workbench { margin-top: 14px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-lg); background: rgba(15,23,29,.88); }
.runtime-tabs { padding: 10px; display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--border); scrollbar-width: none; }
.runtime-tabs::-webkit-scrollbar { display: none; }
.runtime-tab { min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 900; white-space: nowrap; }
.runtime-tab.active { border-color: rgba(110,215,207,.22); background: rgba(110,215,207,.09); color: var(--cyan); }
.runtime-toolbar { padding: 14px 16px; display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto auto; gap: 9px; border-bottom: 1px solid var(--border); background: rgba(5,10,13,.25); }
.runtime-search, .runtime-filter { width: 100%; min-height: 42px; padding: 0 13px; border: 1px solid var(--border-strong); border-radius: 11px; background: rgba(6,11,15,.7); color: var(--text); outline: none; font-size: 12px; }
.runtime-search:focus, .runtime-filter:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(110,215,207,.08); }
.runtime-results-head { min-height: 54px; padding: 11px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.runtime-results-head strong { color: var(--text); }
.runtime-pagination { display: flex; align-items: center; gap: 7px; }
.runtime-pagination button { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); color: var(--text-soft); cursor: pointer; }
.runtime-pagination button:disabled { opacity: .35; cursor: default; }
.runtime-grid { padding: 0 16px 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.runtime-empty { grid-column: 1 / -1; min-height: 230px; display: grid; place-items: center; padding: 30px; color: var(--muted); text-align: center; font-size: 12px; }
.runtime-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 15px; background: rgba(8,14,18,.76); }
.runtime-card.changed { border-color: rgba(255,181,71,.25); }
.runtime-card-media { position: relative; aspect-ratio: 16 / 7.8; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--border); background: radial-gradient(circle at 50% 40%, rgba(110,215,207,.1), transparent 48%), #0b1217; }
.runtime-card-media img { width: 100%; height: 100%; object-fit: contain; }
.runtime-card-download { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(11,16,21,.85); }
.download-page-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 0 13px; border-radius: 11px; font-size: 12px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.download-page-btn svg { width: 15px; height: 15px; }
.runtime-card-image { position: absolute; inset: 0; z-index: 1; padding: 9px; }
.runtime-media-heroSkins .runtime-card-image { padding: 0; object-fit: cover; object-position: 50% 24%; }
.runtime-card-thumb { position: absolute; right: 9px; bottom: 9px; z-index: 2; width: 48px !important; height: 48px !important; padding: 2px; border: 1px solid rgba(255,255,255,.2); border-radius: 12px; background: rgba(4,9,12,.88); box-shadow: 0 8px 20px rgba(0,0,0,.35); object-fit: cover !important; }
.runtime-media-soldierSkins .runtime-card-thumb { width: 68px !important; border-radius: 9px; object-fit: contain !important; }
.runtime-card-monogram { color: rgba(110,215,207,.48); font-family: "Avenir Next Condensed", "Avenir Next", sans-serif; font-size: 30px; font-weight: 900; letter-spacing: -.04em; }
.runtime-card-id { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 4px 7px; border-radius: 7px; background: rgba(4,9,12,.82); color: var(--cyan); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 9px; font-weight: 900; }
.runtime-diff { position: absolute; top: 8px; right: 8px; z-index: 3; padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; background: rgba(4,9,12,.82); color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.runtime-diff.new, .runtime-diff.renamed, .runtime-diff.changed { border-color: rgba(255,181,71,.32); color: var(--accent); }
.runtime-diff.removed { border-color: rgba(255,113,108,.32); color: var(--danger); }
.runtime-diff.same { border-color: rgba(101,213,139,.22); color: var(--success); }
.runtime-card-body { padding: 13px; }
.runtime-card-kicker { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.runtime-card-name { min-height: 38px; margin-top: 5px; color: var(--text); font-size: 13px; font-weight: 850; line-height: 1.4; }
.runtime-card-old { min-height: 30px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 9px; line-height: 1.4; }
.runtime-card-old strong { color: var(--text-soft); }
.runtime-card-meta { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.runtime-mini-tag { padding: 4px 6px; border-radius: 7px; background: var(--surface-2); color: var(--muted); font-size: 8px; font-weight: 800; }
.runtime-sync-bar { margin-top: 14px; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border: 1px solid rgba(255,181,71,.2); border-radius: 16px; background: linear-gradient(90deg, rgba(255,181,71,.08), rgba(15,23,29,.84)); }
.runtime-sync-copy strong { display: block; font-size: 13px; }
.runtime-sync-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.runtime-sync-options { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.runtime-check { min-height: 38px; padding: 0 10px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 10px; background: rgba(5,10,13,.35); color: var(--text-soft); font-size: 10px; font-weight: 800; }
.runtime-check input { accent-color: var(--accent); }
.legacy-scanner { margin-top: 14px; border: 1px solid var(--border); border-radius: 16px; background: rgba(15,23,29,.65); }
.legacy-scanner > summary { min-height: 54px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-soft); cursor: pointer; font-size: 12px; font-weight: 850; list-style: none; }
.legacy-scanner > summary::-webkit-details-marker { display: none; }
.legacy-scanner > summary::after { content: "+"; color: var(--cyan); font-size: 18px; }
.legacy-scanner[open] > summary::after { content: "−"; }
.legacy-scanner .dump-console { border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; }

/* Modal and toast */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 300; padding: 22px; align-items: center; justify-content: center; background: rgba(2,6,9,.72); backdrop-filter: blur(9px); }
.modal-overlay.show { display: flex; }
.modal { width: min(460px, 100%); padding: 24px; border: 1px solid var(--border-strong); border-radius: 20px; background: #121b22; box-shadow: var(--shadow); animation: modalIn .22s ease both; }
.modal.modal-wide { width: min(760px, 100%); }
.modal-kicker { color: var(--accent); font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.modal h3 { margin: 5px 0 19px; font-size: 21px; letter-spacing: -.035em; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; margin-bottom: 7px; color: var(--text-soft); font-size: 11px; font-weight: 800; }
.form-group input { height: 45px; padding: 0 13px; font-size: 14px; }
.form-group textarea { min-height: 100px; padding: 12px 13px; resize: vertical; }
.form-hint { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.modal-actions { margin-top: 20px; display: flex; justify-content: flex-end; gap: 8px; }
.btn-cancel, .btn-save { min-width: 90px; height: 40px; border-radius: 10px; font-size: 12px; font-weight: 900; }
.btn-cancel { border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft); }
.btn-save { background: var(--accent); color: var(--accent-ink); }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 400; max-width: min(380px, calc(100vw - 32px)); padding: 13px 16px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--border-strong); border-radius: 12px; background: #111a21; color: var(--text); box-shadow: var(--shadow); font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(24px) scale(.97); pointer-events: none; transition: .25s; }
.toast::before { content: ""; width: 8px; height: 8px; flex: 0 0 auto; border-radius: 50%; background: var(--success); }
.toast.show { opacity: 1; transform: none; }
.toast.err::before { background: var(--danger); }

@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes sectionIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  :root { --sidebar: 232px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-hero { grid-template-columns: 1fr; }
  .hero-status { max-width: 540px; }
}

@media (max-width: 820px) {
  .login-shell { max-width: 420px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .workspace { min-height: 100vh; }
  .topbar { min-height: 64px; padding: 10px 14px; }
  .topbar-copy h1 { font-size: 20px; }
  .topbar-copy p { display: none; }
  .topbar .eyebrow { font-size: 9px; }
  .version-badge { height: 36px; padding: 0 10px; }
  .btn-publish { height: 38px; padding: 0 13px; }
  .mobile-menu-btn { display: inline-flex; width: 38px; height: 38px; padding: 0; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); cursor: pointer; }
  .mobile-menu-btn span { width: 17px; height: 2px; border-radius: 2px; background: var(--text-soft); transition: transform .18s ease, opacity .18s ease; }
  .mobile-menu-btn[aria-expanded="true"] { border-color: var(--cyan); background: rgba(110,215,207,.12); }
  .mobile-menu-btn[aria-expanded="true"] span { background: var(--cyan); }
  .mobile-menu-btn[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-btn[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mobile-menu:not([hidden]) {
    position: sticky;
    top: 64px;
    z-index: 96;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px 14px 12px;
    background: rgba(11,16,21,.96);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(18px);
  }
  .mobile-menu .tab { width: 100%; min-height: 40px; padding: 0 11px; gap: 8px; border-color: var(--border); background: var(--surface); }
  .mobile-menu .tab:hover { transform: none; }
  .mobile-menu .tab-icon { width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
  .content { padding: 18px 14px calc(36px + env(safe-area-inset-bottom)); }
  .overview-hero { min-height: 0; padding: 24px; }
  .overview-hero::after { font-size: 180px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card:last-child { grid-column: span 2; }
  .section-head { align-items: stretch; flex-direction: column; gap: 13px; }
  .section-tools { width: 100%; }
  .search-wrap { width: 100%; }
  .btn-add { flex: 0 0 auto; }
  .exc-grid { grid-template-columns: 1fr; }
  .dump-controls { grid-template-columns: 1fr; }
  .runtime-hero { grid-template-columns: 1fr; }
  .runtime-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .runtime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-toolbar { grid-template-columns: minmax(0, 1fr) 170px; }
  .runtime-toolbar .runtime-ghost { grid-column: 1 / -1; }
  .runtime-sync-bar { align-items: stretch; flex-direction: column; }
  .runtime-sync-options { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .login-overlay { overflow-y: auto; place-items: start center; padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom)); }
  .login-shell { width: 100%; margin: auto 0; border-radius: 22px; }
  .login-brand { padding: 17px 20px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; font-size: 15px; }
  .login-panel { padding: 20px; align-items: flex-start; }
  .login-box h2 { margin-bottom: 15px; font-size: 22px; }
  .login-box input { height: 50px; }
  .btn-login { height: 48px; }
  .topbar-actions { gap: 6px; }
  .version-badge { font-size: 10px; }
  .btn-publish .publish-label { display: none; }
  .btn-publish { width: 38px; padding: 0; justify-content: center; border-radius: 11px; font-size: 17px; }
  .mobile-menu:not([hidden]) { top: 64px; }
  .overview-hero { padding: 21px; border-radius: 19px; }
  .overview-hero h2 { font-size: 30px; }
  .hero-status { padding: 14px; }
  .stats { gap: 9px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 28px; }
  .section-title h2 { font-size: 23px; }
  .section-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .skin-config-tools { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .skin-config-tools .btn-import, .skin-config-tools .btn-add { width: 100%; }
  .table-shell { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .data-table, .data-table tbody { display: block; width: 100%; }
  .data-table thead { display: none; }
  .data-table tbody { display: grid; gap: 9px; }
  .data-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: default; }
  .data-table tbody td { display: block; padding: 0; border: 0; }
  .data-table tbody td::before { content: attr(data-label); display: block; margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
  .data-table tbody td:first-child { grid-column: 1; grid-row: 2; }
  .data-table tbody td.item-name { grid-column: 1 / -1; grid-row: 1; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
  .data-table tbody td.item-id { grid-column: 2; grid-row: 2; text-align: right; }
  .data-table tbody td.actions { grid-column: 1 / -1; grid-row: 3; padding-top: 10px; justify-content: stretch; border-top: 1px solid var(--border); }
  .data-table tbody td.actions::before { display: none; }
  .data-table tbody td.actions .btn-sm { flex: 1; height: 38px; }
  .drag-handle { width: 34px; height: 34px; }
  .empty-state { display: block !important; }
  .exc-card { align-items: flex-start; flex-direction: column; }
  .exc-card .actions { width: 100%; padding-top: 11px; border-top: 1px solid var(--border); }
  .exc-card .actions .btn-sm { flex: 1; height: 37px; }
  .chips { grid-template-columns: 1fr; }
  .dump-controls { padding: 16px; gap: 15px; }
  .dump-results-head { padding: 12px 16px; align-items: flex-start; flex-direction: column; }
  .dump-grid { padding: 12px; grid-template-columns: 1fr; }
  .dump-card-actions button, .dump-card-actions a { min-height: 40px; }
  .runtime-hero { padding: 20px; border-radius: 19px; }
  .runtime-hero::after { font-size: 72px; }
  .runtime-import-actions { grid-template-columns: 1fr; }
  .runtime-stat-grid { gap: 8px; }
  .runtime-stat { padding: 13px; }
  .runtime-stat-value { font-size: 27px; }
  .runtime-workbench { border-radius: 18px; }
  .runtime-toolbar { grid-template-columns: 1fr; padding: 12px; }
  .runtime-toolbar .runtime-ghost { grid-column: auto; }
  .runtime-results-head { align-items: flex-start; flex-direction: column; }
  .runtime-grid { padding: 0 12px 12px; grid-template-columns: 1fr; }
  .runtime-card-media { aspect-ratio: 16 / 7; }
  /* Điện thoại: thẻ tướng 2 cột, ảnh trên - tên dưới cho gọn và xem được nhiều hơn. */
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: 8px; padding: 10px 8px; text-align: center; }
  .hero-avatar { width: 100%; max-width: 96px; height: auto; aspect-ratio: 1 / 1; border-radius: 12px; }
  .hero-copy { width: 100%; }
  .hero-name { font-size: 13px; }
  .hero-meta { justify-content: center; }
  .skin-grid { grid-template-columns: 1fr; gap: 8px; }
  .skin-browser-tools { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .skin-browser-select { width: 100%; max-width: none; }
  .skin-browser-bar { align-items: flex-start; flex-direction: column; gap: 8px; }
  .skin-browser-pager { width: 100%; justify-content: space-between; }
  .runtime-sync-options { display: grid; grid-template-columns: 1fr 1fr; }
  .runtime-check { justify-content: center; }
  .runtime-sync-options .runtime-primary { grid-column: 1 / -1; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100%; padding: 22px 18px calc(20px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; border-bottom: 0; animation-name: sheetIn; }
  .modal.modal-wide { width: 100%; }
  .modal::before { content: ""; width: 42px; height: 4px; display: block; margin: -9px auto 16px; border-radius: 9px; background: var(--surface-3); }
  .modal-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .btn-cancel, .btn-save { width: 100%; height: 46px; }
  .toast { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); left: 16px; max-width: none; }
  .skin-picker-grid { grid-template-columns: 1fr; max-height: 52vh; }
}

@keyframes sheetIn { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }

/* ==================== TÀI LIỆU API ==================== */
.docs-stack { display: grid; gap: 16px; min-width: 0; }
.docs-card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); scroll-margin-top: 18px; }
.docs-card > h3 { margin: 0 0 6px; font-size: 16px; }
.docs-card > h3 code { font-size: 15px; }
.docs-card > p { margin: 0 0 4px; color: var(--text-soft); font-size: 13px; line-height: 1.7; }
.docs-sub { margin: 18px 0 8px; color: var(--muted); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.docs-list { margin: 6px 0 0; padding-left: 18px; color: var(--text-soft); font-size: 13px; line-height: 1.75; }
.docs-list li { margin-bottom: 7px; }
.docs-card code, .docs-card p code, .docs-list code, .docs-note code { padding: 1px 5px; border-radius: 5px; background: rgba(110,215,207,.09); color: var(--accent); font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; }
.docs-code { margin: 10px 0 0; max-width: 100%; padding: 14px 15px; overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: rgba(3,7,10,.62); color: #b9d7d3; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11.5px; line-height: 1.66; white-space: pre; }
.docs-code b { color: var(--accent); font-weight: 700; }
.docs-table { width: 100%; border-collapse: collapse; }
.docs-table th { padding: 9px 10px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 9.5px; font-weight: 900; letter-spacing: .1em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.docs-table td { padding: 10px; border-bottom: 1px solid var(--border); color: var(--text-soft); font-size: 12.5px; line-height: 1.55; vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table td code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 12px; color: var(--text); }
.docs-table .path { color: var(--text); font-weight: 700; }
.docs-table .method { min-width: 40px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 10.5px; letter-spacing: .04em; }
.docs-scroll { overflow-x: auto; max-width: 100%; }
.docs-anchor { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.docs-anchor a { padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-soft); font-size: 11.5px; font-weight: 700; text-decoration: none; }
.docs-anchor a:hover { border-color: rgba(110,215,207,.3); color: var(--accent); }
@media (max-width: 600px) {
  .docs-card { padding: 16px; }
  .docs-table th, .docs-table td { padding: 8px 7px; font-size: 12px; }
}

.data-table thead th:nth-child(2) { width: 78px; }
.item-thumb { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.item-thumb-fallback { color: var(--muted); font-size: 11px; font-weight: 900; }

/* Thông báo hạ: ảnh chữ nhật dài (400×160 / 400×200) → hiển thị đủ, không nền, không viền.
   min-height để khung có chiều cao ngay từ đầu, nếu không ảnh loading="lazy" cao 0 sẽ không bao giờ tải. */
.item-thumb-wide { width: 184px; max-width: 46vw; min-height: 74px; height: auto; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.item-thumb-wide img { width: 100%; height: auto; min-height: 6px; object-fit: contain; }
#sec-billboards .data-table thead th:nth-child(2) { width: 200px; }
#sec-billboards .data-table tbody td.item-media { padding-right: 6px; }
@media (max-width: 600px) {
  .item-thumb-wide { width: 100%; max-width: none; }
  #sec-billboards .data-table tbody td.item-media { grid-column: 1 / -1; grid-row: 1; width: 100%; }
  #sec-billboards .data-table tbody td.item-name { grid-column: 1 / -1; grid-row: 2; }
  #sec-billboards .data-table tbody td:first-child { grid-column: 1; grid-row: 3; }
  #sec-billboards .data-table tbody td.item-id { grid-column: 3; grid-row: 3; text-align: right; }
  #sec-billboards .data-table tbody td.actions { grid-column: 1 / -1; grid-row: 4; }
}

@media (max-width: 600px) {
  .data-table tbody tr { grid-template-columns: auto minmax(0, 1fr) auto; }
  .data-table tbody td.item-media { grid-column: 1; grid-row: 1 / span 2; align-self: center; }
  .data-table tbody td.item-media::before { display: none; }
  .data-table tbody td.item-name { grid-column: 2 / -1; grid-row: 1; }
  .data-table tbody td:first-child { grid-column: 2; grid-row: 2; }
  .data-table tbody td.item-id { grid-column: 3; grid-row: 2; text-align: right; }
  .data-table tbody td.actions { grid-column: 1 / -1; grid-row: 3; }
}

/* ===== Kỹ năng tướng + phép bổ trợ (tab Kỹ năng) ===== */
.skills-subtitle { display: flex; align-items: center; margin: 6px 0 11px; color: var(--text); font-size: 13px; font-weight: 900; letter-spacing: -.01em; }
.skills-subtitle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.skills-subtitle-row .skills-subtitle { margin: 0; }
.season-badge { display: inline-flex; min-height: 24px; padding: 0 10px; align-items: center; border: 1px solid rgba(255,181,71,.34); border-radius: 999px; background: rgba(255,181,71,.1); color: #ffb547; font-size: 10.5px; font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.season-badge[hidden] { display: none; }
.skills-note { margin: 9px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.skills-note[hidden] { display: none; }
.spell-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.kind-badge { display: inline-flex; height: 18px; padding: 0 7px; align-items: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--muted); font: 700 9.5px ui-monospace, monospace; text-transform: uppercase; }
.kind-badge.new { border-color: rgba(110,215,207,.34); background: rgba(110,215,207,.1); color: var(--cyan); }
.kind-badge.season { border-color: rgba(255,181,71,.34); background: rgba(255,181,71,.1); color: #ffb547; }
.spell-card.is-new { border-color: rgba(110,215,207,.28); background: rgba(110,215,207,.05); }
.spell-card.is-season { border-color: rgba(255,181,71,.26); background: rgba(255,181,71,.05); }
.spell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; margin-bottom: 24px; }
.spell-card { min-width: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.spell-icon { width: 52px; height: 52px; display: block; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface-2); }
.spell-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.spell-copy { min-width: 0; }
.spell-name { color: var(--text); font-size: 13px; font-weight: 900; letter-spacing: -.01em; }
.spell-desc { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; }
.skill-hero-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 10px; align-items: start; }
.skill-hero { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.skill-hero[open] { border-color: rgba(110,215,207,.32); background: rgba(15,23,29,.72); }
.skill-hero summary { display: grid; grid-template-columns: 13px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 11px; cursor: pointer; list-style: none; }
.skill-hero summary::-webkit-details-marker { display: none; }
.skill-hero summary::before { content: '▸'; color: var(--muted); font-size: 10px; line-height: 1; }
.skill-hero[open] summary::before { content: '▾'; color: var(--cyan); }
.skill-hero summary:hover { background: rgba(110,215,207,.06); }
.skill-hero-name { min-width: 0; overflow: hidden; color: var(--text); font-size: 13.5px; font-weight: 900; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
.skill-hero-meta { flex: 0 0 auto; color: var(--muted); font: 10px ui-monospace, monospace; white-space: nowrap; }
.skill-hero-body { display: grid; gap: 8px; padding: 0 11px 11px; }
.skill-item { min-width: 0; display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: start; gap: 9px; padding: 9px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.skill-icon { width: 46px; height: 46px; display: block; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
.skill-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.skill-copy { min-width: 0; }
.skill-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.skill-slot { display: inline-flex; height: 19px; padding: 0 7px; align-items: center; border: 1px solid rgba(110,215,207,.24); border-radius: 999px; background: rgba(110,215,207,.08); color: var(--cyan); font: 700 9.5px ui-monospace, monospace; }
.skill-name { color: var(--text); font-size: 12.5px; font-weight: 800; }
.skill-desc { margin: 5px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }

@media (max-width: 820px) {
  .skill-hero-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 600px) {
  .spell-grid, .skill-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .spell-card { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .spell-icon { width: 46px; height: 46px; }
  .skill-item { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .skill-icon { width: 42px; height: 42px; }
}

/* ===== Trang bị (vật phẩm trong trận) ===== */
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; align-items: start; }
.item-card { min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: start; gap: 11px; padding: 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.item-icon { width: 56px; height: 56px; display: block; overflow: hidden; border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface-2); }
.item-icon img { width: 100%; height: 100%; display: block; object-fit: cover; }
.item-body { min-width: 0; }
.item-head { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.item-name { color: var(--text); font-size: 13.5px; font-weight: 900; letter-spacing: -.01em; }
.item-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.skin-tag.item-type { border-color: rgba(110,215,207,.26); background: rgba(110,215,207,.08); color: var(--cyan); }
.skin-tag.item-price { border-color: rgba(255,181,71,.3); background: rgba(255,181,71,.1); color: #ffb547; }
.item-stats { margin: 6px 0 0; color: var(--text-soft); font-size: 11.5px; font-weight: 700; line-height: 1.55; }
.item-card.is-new { border-color: rgba(110,215,207,.28); background: rgba(110,215,207,.05); }
.item-card.is-rework { border-color: rgba(255,181,71,.26); background: rgba(255,181,71,.05); }
.item-passives { margin: 6px 0 0; padding-left: 14px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.item-passives li { margin-bottom: 3px; }
.item-passives li::marker { color: rgba(110,215,207,.5); }

@media (max-width: 820px) {
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 600px) {
  .item-grid { grid-template-columns: minmax(0, 1fr); }
  .item-card { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .item-icon { width: 46px; height: 46px; }
  .section-tools .skin-browser-select { max-width: none; width: 100%; }
}

/* ==================== TAB TÀI KHOẢN ==================== */
/* `display:grid` của .account-grid đè thuộc tính `hidden` của trình duyệt ⇒ phải chặn tường minh,
   nếu không danh sách vẫn hiện phía dưới khi đang mở hồ sơ. */
.account-grid[hidden], #account-detail[hidden] { display: none !important; }
.account-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.account-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: border-color .16s, transform .16s; }
.account-card:hover { border-color: rgba(255, 181, 71, .35); transform: translateY(-1px); }
.account-card-name { font-size: 15px; font-weight: 800; }
.account-card-sub { color: var(--muted); font-size: 12px; }
.account-card-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.account-card-meta { color: var(--muted); font-size: 11px; }

.account-detail { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.account-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; justify-content: space-between; }
.account-name { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.account-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.account-stats { display: grid; gap: 10px; margin: 16px 0 6px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.account-stat { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.account-stat-value { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800; }
.account-stat-label { color: var(--muted); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; }
.account-rank-icon { width: 22px; height: 22px; object-fit: contain; }

.account-hero-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.account-hero { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.account-hero .hero-avatar { width: 48px; height: 48px; border-radius: 12px; }
.account-hero-copy { min-width: 0; }
.account-hero-name { font-size: 13px; font-weight: 700; }
.account-hero-meta { margin-bottom: 6px; color: var(--muted); font-size: 11px; }
.account-skin-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.account-skin-chip { padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(110, 215, 207, .10); color: var(--text-soft); font-size: 11px; }
.account-skin-chip.warn { border-color: rgba(255, 209, 102, .35); background: rgba(255, 209, 102, .08); color: var(--warn); }

.account-banned { color: var(--danger); }
.account-official { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; padding: 14px 16px; border: 1px solid rgba(255, 181, 71, .28); border-radius: var(--radius); background: rgba(255, 181, 71, .05); }
/* Cột grid phải là minmax(0,1fr) và mọi con phải min-width:0 — nếu không, bảng so sánh
   (ô `white-space:nowrap`) sẽ kéo cột rộng ~700px và làm tràn ngang cả trang trên mobile. */
.account-official > * { min-width: 0; }
.account-official-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.account-official-head .btn-cancel { min-height: 30px; padding: 0 12px; font-size: 12px; }
.account-official-status { margin: 0; color: var(--text-soft); font-size: 12px; line-height: 1.6; }
.account-official-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.account-official-tools .search-input { flex: 1 1 220px; min-width: 0; }
.account-official-tools #account-official-cookie { flex: 2 1 340px; }
.account-official .form-hint { margin: 0; }

/* Nhiều phiên + bảng so sánh (admin) */
.account-session-list { display: grid; gap: 8px; }
.account-session-list[hidden], #account-compare[hidden] { display: none !important; }
.account-session { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.account-session.is-error { border-color: rgba(255, 107, 107, .42); }
.account-session-name { font-size: 13px; font-weight: 700; }
.account-session-meta { margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.55; overflow-wrap: anywhere; }
.account-session-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.account-session-actions .btn-cancel { min-height: 28px; padding: 0 10px; font-size: 12px; }
.account-compare-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 4px 0 6px; font-size: 13px; }
.account-compare-legend { color: var(--muted); font-size: 11.5px; }
.account-compare-diff { color: var(--warn); font-weight: 800; }
.account-compare-scroll { max-width: 100%; overflow-x: auto; }
.account-compare-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.account-compare-table th, .account-compare-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.account-compare-table thead th { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.account-compare-table tbody th { font-weight: 700; }

@media (max-width: 760px) {
  /* Thẻ phiên: xếp dọc để hàng nút không đẩy ngang. */
  .account-session { grid-template-columns: minmax(0, 1fr); }
  .account-session-actions { justify-content: flex-start; }
  .account-official-tools .search-input { flex: 1 1 100%; }
}

@media (max-width: 600px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .account-detail { padding: 14px; }
  .account-hero-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==================== CHẾ ĐỘ CÔNG KHAI ====================
   Trang xem công khai cho mọi người. Chỉ chức năng SỬA / IMPORT / ĐỒNG BỘ mới ẩn đi
   và vẫn được server chặn bằng token, nên ẩn ở đây chỉ là lớp giao diện. */
body.guest .admin-only { display: none !important; }
body.guest .drag-handle { cursor: default; opacity: .35; }
.login-note { margin: -6px 0 14px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.btn-login-cancel { width: 100%; margin-top: 8px; min-height: 42px; border: 1px solid var(--border); border-radius: 12px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 13px; font-weight: 700; }
.btn-login-cancel:hover { border-color: var(--border-strong, rgba(255,255,255,.22)); color: var(--text); }

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