/* Reset & nền app */
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.6;
  transition: background .3s ease, color .3s ease;
  height: 100vh; overflow: hidden;
}
/* ── Aurora background (bản tối ưu GPU 2026-08-25) ──────────────────
   Cũ: filter blur(90px) + keyframes có scale() → Chrome phải refilter
   blur mỗi frame → FPS tụt còn ~6. Mới: radial-gradient mềm (nhìn gần
   giống hệt) + chỉ animate translate/opacity (composited, rẻ). */
.aurora {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.au {
  position: absolute; border-radius: 50%;
  /* KHÔNG đặt will-change ở đây (bỏ 2026-09-13).
     Animation đã tắt từ 2026-08-25 nên will-change chẳng còn tác dụng gì,
     nhưng nó vẫn promote 3 layer khổng lồ (500–678px) vĩnh viễn. Đo bằng
     CDP LayerTree: có will-change → 9 layer / 4.46 MPx; bỏ đi → 6 layer /
     3.44 MPx. Đây chính là phần "Chrome không xử lý nổi" của aurora.
     Chỉ thêm lại will-change nếu thật sự bật animation au-drift-*. */
}
.au-1 { width: 54vw; height: 54vw; min-width: 500px; min-height: 500px; top: -18vw; left: -12vw;
       background: radial-gradient(closest-side, var(--au-1) 0%, transparent 72%); }
.au-2 { width: 44vw; height: 44vw; min-width: 420px; min-height: 420px; bottom: -16vw; right: -10vw;
       background: radial-gradient(closest-side, var(--au-2) 0%, transparent 72%); }
.au-3 { width: 36vw; height: 36vw; min-width: 340px; min-height: 340px; top: 32%; left: 48%;
       background: radial-gradient(closest-side, var(--au-3) 0%, transparent 72%); }
/* Animation đã tắt (2026-08-25): aurora động phía sau header backdrop-filter
   ép blur lại mỗi frame → lag trên Chrome không có GPU accel. Bật lại chỉ
   khi cần bằng cách thêm lại animation au-drift-N vào các .au-* */

@media (prefers-reduced-motion: reduce) {
  .au { animation: none !important; }
}

::selection { background: rgba(10, 132, 255, .25); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

kbd {
  font-family: var(--font-mono); font-size: 10px; color: var(--subtle);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 6px;
}

/* Material Symbols */
.msym {
  font-family: 'Material Symbols Outlined'; font-weight: normal; font-style: normal;
  line-height: 1; display: inline-block; letter-spacing: normal; text-transform: none;
  white-space: nowrap; word-wrap: normal; direction: ltr;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  user-select: none; flex-shrink: 0;
}

/* ── Layout ─────────────────────────────────────── */
.app {
  max-width: 1200px; margin: 0 auto;
  padding: 84px 20px 20px;
  height: 100vh; display: flex; flex-direction: column;
}
.main-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: stretch; flex: 1; min-height: 0; }

/* ── Skeleton ───────────────────────────────────── */
/* Skeleton: chỉ shimmer header — nền trong suốt, editor card thật hiện ngay bên dưới */
#skeleton { position: fixed; top: 0; left: 0; right: 0; z-index: 300; padding: 10px 20px; pointer-events: none; transition: opacity .3s ease; }
#skeleton.hide { opacity: 0; pointer-events: none; }
/* Skeleton đã ẩn cũng phải ngừng shimmer — opacity:0 KHÔNG dừng animation */
#skeleton.hide .sk { animation: none; }
.sk-inner { max-width: 1160px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.sk {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-header { display: flex; justify-content: space-between; height: 40px; width: 100%; }

/* Mobile layout rules nằm trong components.css (cuối file) để thắng cascade */
