/* =====================================================================
   1. DESIGN TOKENS — đổi màu/khoảng cách toàn site tại đây
   ===================================================================== */
:root {
  --blue: #3b6cf6;
  --purple: #8b5cf6;
  --gradient: linear-gradient(135deg, var(--blue) 0%, var(--purple) 100%);
  --primary: #5458ee;
  --primary-hover: #4347dc;
  --on-primary: #ffffff;
  --primary-soft: #eef0ff;

  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f1f3fa;
  --border: #e3e6f0;
  --text: #151833;
  --muted: #5d6380;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(21, 24, 51, .06);
  --shadow: 0 2px 6px rgba(21, 24, 51, .05), 0 12px 32px rgba(21, 24, 51, .07);
  --shadow-lg: 0 24px 64px rgba(59, 64, 160, .18);
  --container: 1200px;
  --header-h: 68px;
  --font: "Be Vietnam Pro", "Segoe UI", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #7c7fff; --primary-hover: #9497ff; --on-primary: #0b0d1c; --primary-soft: #1f2148;
    --bg: #0b0d19; --surface: #13162a; --surface-2: #1a1e36; --border: #262b4a;
    --text: #eceefb; --muted: #9aa0bf; --success: #4ade80; --danger: #f87171; --warning: #fbbf24;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 6px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
    --shadow-lg: 0 24px 64px rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --primary: #7c7fff; --primary-hover: #9497ff; --on-primary: #0b0d1c; --primary-soft: #1f2148;
  --bg: #0b0d19; --surface: #13162a; --surface-2: #1a1e36; --border: #262b4a;
  --text: #eceefb; --muted: #9aa0bf; --success: #4ade80; --danger: #f87171; --warning: #fbbf24;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 2px 6px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 64px rgba(0,0,0,.5);
}

/* =====================================================================
   2. NỀN TẢNG
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { line-height: 1.25; margin: 0; letter-spacing: -.02em; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
/* Icon nằm cùng dòng với chữ */
p > svg, b > svg, h3 > svg, a > svg, span > svg, li > svg { display: inline-block; vertical-align: -0.15em; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -48px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }
.gradient-text { background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
[hidden] { display: none !important; }

/* Nút */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
  text-decoration: none !important;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 6px 18px rgba(84, 88, 238, .35); }
.btn-primary:hover { box-shadow: 0 8px 24px rgba(84, 88, 238, .45); filter: brightness(1.05); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-text { background: transparent; color: var(--text); padding: 10px 14px; }
.btn-text:hover { background: var(--surface-2); }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .65; cursor: progress; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text);
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Nhãn */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge-free { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.badge-pro { background: var(--gradient); color: #fff; }
.badge-new { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.badge-admin { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge-soft { background: var(--primary-soft); color: var(--primary); }

.spinner {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================================
   3. HEADER & ĐIỀU HƯỚNG
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--text); text-decoration: none !important; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--gradient);
  display: inline-flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 4px 12px rgba(84, 88, 238, .4);
}
.main-nav { display: flex; gap: 4px; }
.main-nav a {
  padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: 15px;
  text-decoration: none;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--primary); background: var(--primary-soft); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }

.user-menu { position: relative; }
.user-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer;
}
.user-btn:hover { border-color: var(--primary); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--gradient); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex: none;
}
.user-btn .name { font-weight: 600; font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); width: 260px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.dropdown-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.dropdown-head .email { font-size: 13px; color: var(--muted); }
.dropdown a, .dropdown button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0;
  background: none; border-radius: 10px; color: var(--text); font-size: 14px; cursor: pointer; text-align: left;
  text-decoration: none;
}
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dropdown .danger { color: var(--danger); }

.mobile-nav {
  display: none; position: fixed; inset: var(--header-h) 0 auto 0; z-index: 39;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 12px 16px 20px;
}
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: 12px 14px; border-radius: 10px; color: var(--text); font-weight: 500; text-decoration: none; }
.mobile-nav a.active { background: var(--primary-soft); color: var(--primary); }
.mobile-nav .mobile-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* =====================================================================
   4. TRANG CHỦ
   ===================================================================== */
section { padding: 88px 0; }
.section-head { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.section-head .eyebrow { font-size: 14px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .08em; }
.section-head h2 { font-size: clamp(28px, 4vw, 38px); margin-top: 8px; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 17px; }

/* Hero */
.hero { position: relative; padding: 72px 0 88px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 720px; height: 720px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--purple) 22%, transparent), transparent);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: auto auto -30% -15%; width: 640px; height: 640px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--blue) 18%, transparent), transparent);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--muted);
  box-shadow: var(--shadow-sm); text-decoration: none !important;
}
.hero-pill .badge { font-size: 11px; }
.hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 800; margin: 22px 0 18px; letter-spacing: -.035em; }
.hero-lead { font-size: 19px; color: var(--muted); max-width: 540px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.hero-note { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; font-size: 14px; color: var(--muted); }
.hero-note span { display: inline-flex; align-items: center; gap: 6px; }
.hero-note svg { color: var(--success); }

.hero-visual { position: relative; }
.window {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.win-bar { display: flex; align-items: center; gap: 7px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.win-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border); }
.win-bar i:nth-child(1) { background: #f87171; } .win-bar i:nth-child(2) { background: #fbbf24; } .win-bar i:nth-child(3) { background: #4ade80; }
.win-bar b { margin-left: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.win-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.55; }
.bubble.me { align-self: flex-end; background: var(--gradient); color: #fff; border-bottom-right-radius: 6px; }
.bubble.ai { align-self: flex-start; display: flex; gap: 10px; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble.ai .ai-dot { flex: none; width: 26px; height: 26px; border-radius: 8px; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; }
.bubble.ai ol { margin: 0; padding-left: 18px; }
.gen-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gen-img { aspect-ratio: 1; border-radius: 12px; position: relative; overflow: hidden; }
.gen-img.g1 { background: radial-gradient(circle at 70% 35%, #ffd27a 0 12%, transparent 13%), linear-gradient(180deg, #ff8f6b, #c058d6 60%, #4a3aa8); }
.gen-img.g1::after { content: ""; position: absolute; inset: 55% 0 0; background: #2b2167; clip-path: polygon(0 60%, 25% 10%, 45% 50%, 70% 0, 100% 45%, 100% 100%, 0 100%); }
.gen-img.g2 { background: radial-gradient(circle at 30% 30%, #b7f3ff 0 10%, transparent 11%), linear-gradient(160deg, #3b6cf6, #22d3ee); }
.gen-img.g2::after { content: ""; position: absolute; inset: 60% 0 0; background: linear-gradient(180deg, #0e7490, #164e63); border-radius: 50% 50% 0 0 / 30% 30% 0 0; }
.gen-img.g3 { background: conic-gradient(from 200deg at 50% 60%, #8b5cf6, #ec4899, #f59e0b, #8b5cf6); }
.gen-img.g3::after { content: ""; position: absolute; inset: 25%; border-radius: 50%; background: rgba(255,255,255,.25); backdrop-filter: blur(6px); }
.prompt-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); color: var(--muted); font-size: 14px;
}
.prompt-bar span { flex: 1; }
.prompt-bar b { width: 34px; height: 34px; border-radius: 50%; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); font-size: 13px; font-weight: 600; animation: float 6s ease-in-out infinite;
}
.float-card .ic { width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; }
.float-card small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.float-card.f1 { right: 28px; top: -26px; animation-delay: -1.5s; }
.float-card.f1 .ic { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.float-card.f2 { right: -24px; bottom: -22px; animation-delay: -3s; }
.float-card.f2 .ic { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .float-card { animation: none; } html { scroll-behavior: auto; } }

/* Số liệu */
.stats-strip { padding: 0 0 24px; }
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.stat { padding: 26px 20px; text-align: center; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: 14px; }

/* Thẻ ứng dụng */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 32px; }
.chip {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; font-weight: 500; cursor: pointer; color: var(--muted);
}
.chip:hover { color: var(--text); border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.app-card {
  display: flex; flex-direction: column; gap: 14px; padding: 22px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.app-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.app-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.app-icon { width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center; color: #fff; }
.app-card-top .badges { display: flex; gap: 6px; }
.app-card h3 { font-size: 18px; }
.app-card p { color: var(--muted); font-size: 14px; flex: 1; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border); }
.app-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.app-meta span { display: inline-flex; align-items: center; gap: 4px; }
.app-meta .star { color: #f59e0b; }
.app-card .btn { padding: 8px 16px; font-size: 14px; }
.see-all { text-align: center; margin-top: 36px; }

/* 3 bước */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.step-num {
  width: 44px; height: 44px; border-radius: 14px; background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; margin-bottom: 18px;
}
.step h3 { font-size: 19px; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 15px; }

/* Đối tượng */
.alt-bg { background: var(--surface); border-block: 1px solid var(--border); }
.audience { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.aud-card { padding: 28px; border-radius: var(--radius-lg); background: var(--bg); border: 1px solid var(--border); }
.aud-card .aud-icon { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 16px; background: var(--primary-soft); color: var(--primary); }
.aud-card h3 { font-size: 19px; margin-bottom: 12px; }
.aud-card ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.aud-card li { display: flex; gap: 10px; color: var(--muted); font-size: 15px; }
.aud-card li svg { flex: none; margin-top: 3px; color: var(--primary); }

/* Bảng giá */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; align-items: stretch; }
.plan {
  position: relative; display: flex; flex-direction: column; padding: 32px 28px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
}
.plan.featured { border: 2px solid transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--gradient) border-box; box-shadow: var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); }
.plan h3 { font-size: 20px; }
.plan .plan-desc { color: var(--muted); font-size: 14px; margin-top: 6px; min-height: 44px; }
.price { margin: 22px 0; display: flex; align-items: baseline; gap: 6px; }
.price b { font-size: 38px; font-weight: 800; letter-spacing: -.03em; }
.price span { color: var(--muted); font-size: 15px; }
.plan ul { list-style: none; margin: 0 0 28px; padding: 0; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.plan li { display: flex; gap: 10px; font-size: 15px; }
.plan li svg { flex: none; margin-top: 3px; color: var(--success); }
.plan li.off { color: var(--muted); }
.plan li.off svg { color: var(--muted); }

/* FAQ */
.faq { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary svg { flex: none; transition: transform .2s; color: var(--muted); }
.faq details[open] summary svg { transform: rotate(45deg); }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

/* CTA cuối */
.cta-band {
  position: relative; overflow: hidden; padding: 56px; border-radius: 28px; background: var(--gradient); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.cta-band::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255,255,255,.1);
}
.cta-band h2 { font-size: clamp(26px, 3.6vw, 36px); }
.cta-band p { opacity: .9; margin-top: 8px; font-size: 17px; }
.cta-band .btn { position: relative; z-index: 1; background: #fff; color: #3a2fd0; box-shadow: 0 8px 24px rgba(0,0,0,.18); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 32px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-grid p { color: var(--muted); font-size: 14px; margin-top: 14px; max-width: 320px; }
.footer-grid h4 { font-size: 14px; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid ul a { color: var(--muted); font-size: 14px; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* =====================================================================
   5. TRANG ĐĂNG NHẬP / ĐĂNG KÝ
   ===================================================================== */
.auth { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  position: relative; overflow: hidden; background: var(--gradient); color: #fff;
  padding: 64px clamp(32px, 5vw, 72px); display: flex; flex-direction: column; justify-content: center; gap: 28px;
}
.auth-aside::before, .auth-aside::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); }
.auth-aside::before { width: 420px; height: 420px; right: -140px; top: -120px; }
.auth-aside::after { width: 280px; height: 280px; left: -100px; bottom: -80px; }
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; }
.auth-aside > p { font-size: 17px; opacity: .9; max-width: 460px; }
.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.benefits li { display: flex; gap: 14px; align-items: center; font-size: 16px; }
.benefits .ic { flex: none; width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; }
.quote { margin: 0; max-width: 460px; padding: 20px 22px; border-radius: 18px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-size: 15px; }
.quote footer { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 14px; }
.quote .avatar { background: rgba(255,255,255,.25); }
.quote small { display: block; opacity: .8; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { font-size: 30px; font-weight: 800; }
.auth-card .sub { color: var(--muted); margin-top: 8px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 28px 0 24px; background: var(--surface-2); border-radius: 999px; }
.auth-tabs a { text-align: center; padding: 9px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none; }
.auth-tabs a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.btn-google { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); border-radius: 12px; padding: 12px; }
.btn-google:hover { border-color: var(--primary); background: var(--surface-2); }
.divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--muted); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.form { display: flex; flex-direction: column; gap: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input {
  width: 100%; height: 50px; padding: 0 46px 0 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.input[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent); }
.toggle-pass {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px;
  border: 0; background: none; border-radius: 10px; color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.toggle-pass:hover { color: var(--text); background: var(--surface-2); }
.field-error { display: flex; align-items: center; gap: 6px; color: var(--danger); font-size: 13px; margin-top: 6px; }
.field-hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 10px; }
.strength i { height: 4px; border-radius: 2px; background: var(--border); transition: background .2s; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.form-alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; font-size: 14px; }
.form-alert.error { background: color-mix(in srgb, var(--danger) 10%, transparent); color: var(--danger); }
.form-alert.info { background: var(--primary-soft); color: var(--primary); }
.form-alert svg { flex: none; margin-top: 2px; }
.auth-switch { text-align: center; margin-top: 24px; color: var(--muted); font-size: 15px; }
.auth-switch a { font-weight: 600; }

.demo-box { margin-top: 28px; padding: 16px; border-radius: 14px; border: 1px dashed var(--border); background: var(--surface); }
.demo-box p { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.demo-list { display: flex; flex-wrap: wrap; gap: 8px; }
.demo-list button {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg); font-size: 13px; cursor: pointer;
}
.demo-list button:hover { border-color: var(--primary); color: var(--primary); }

/* =====================================================================
   6. TRANG CHỜ (các trang sẽ làm ở bước sau)
   ===================================================================== */
.placeholder { padding: 96px 0; }
.placeholder-card {
  max-width: 640px; margin: 0 auto; text-align: center; padding: 48px 32px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.placeholder-card .ph-icon { width: 64px; height: 64px; margin: 0 auto 20px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.placeholder-card h1 { font-size: 28px; }
.placeholder-card p { color: var(--muted); margin-top: 10px; }
.placeholder-card .who { margin: 24px auto 0; display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.placeholder-card .actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* Toast */
.toasts { position: fixed; z-index: 80; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 10px; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: 15px; box-shadow: var(--shadow-lg);
  animation: toast-in .25s ease-out;
}
.toast.success svg { color: #4ade80; } .toast.error svg { color: #f87171; } .toast.info svg { color: #a5b4fc; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }

/* =====================================================================
   6b. KHUNG TRANG DÙNG CHUNG (tiêu đề trang, thẻ, bảng, hộp thoại...)
   ===================================================================== */
.page { padding: 40px 0 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.page-head h1 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--primary); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 24px;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-title h2, .card-title h3 { font-size: 18px; }
.card-title .muted { font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 24px; }

.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 18px; border-radius: var(--radius);
  background: var(--primary-soft); color: var(--text); font-size: 15px; margin-bottom: 24px;
}
.notice > svg { flex: none; color: var(--primary); margin-top: 2px; }
.notice.warn { background: color-mix(in srgb, var(--warning) 12%, transparent); }
.notice.warn > svg { color: var(--warning); }
.notice .btn { margin-left: auto; padding: 7px 14px; font-size: 14px; }

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted); border: 1px dashed var(--border);
  border-radius: var(--radius-lg); background: var(--surface);
}
.empty .ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }

.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 80px 0; color: var(--muted); }
.spinner.dark { border-color: var(--border); border-top-color: var(--primary); }

/* Ô nhập dạng thường (không icon) */
.input.plain, select.input, textarea.input { padding: 0 14px; }
textarea.input { height: auto; min-height: 120px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; cursor: pointer; }
.input.sm { height: 42px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 14px; cursor: pointer; color: var(--muted); font-weight: 500;
}
.seg button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tag.ok { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }
.tag.warn { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.tag.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--gradient); }
.bar.full > i { background: var(--danger); }

.btn-sm { padding: 7px 14px; font-size: 14px; }
.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }
.btn-ok { background: var(--success); color: #fff; }
.btn-ok:hover { filter: brightness(1.08); }

/* Bảng */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 13px; font-weight: 600; color: var(--muted); padding: 12px 16px; background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
.table tr.hl td { background: color-mix(in srgb, var(--warning) 6%, transparent); }
.table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: nowrap; }
.user-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.user-cell b { display: block; }
.user-cell .muted { font-size: 13px; }

/* Công tắc bật/tắt */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); cursor: pointer; transition: .2s; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }

/* Hộp thoại */
dialog.modal {
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.modal::backdrop { background: rgba(10, 12, 30, .55); backdrop-filter: blur(2px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Tab trong trang */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 28px; overflow-x: auto; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; color: var(--muted); font-weight: 600; font-size: 15px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; align-items: center; justify-content: center; }

/* Thẻ số liệu */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.tile .label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.tile .label .ic { width: 32px; height: 32px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; }
.tile .value { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin-top: 12px; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile .bar { margin-top: 12px; }
.tile .foot { font-size: 13px; color: var(--muted); margin-top: 8px; }

/* Biểu đồ cột đơn giản */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.chart .col i { display: block; width: 100%; max-width: 36px; border-radius: 6px 6px 2px 2px; background: var(--gradient); min-height: 3px; opacity: .9; }
.chart .col i.zero { background: var(--surface-2); opacity: 1; }
.chart .col span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.chart .col b { font-size: 11px; color: var(--muted); font-weight: 600; }
.hbars { display: flex; flex-direction: column; gap: 14px; }
.hbar { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.mini-icon { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; }
.hbar .name { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.hbar .num { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* =====================================================================
   6c. DANH SÁCH & CHI TIẾT ỨNG DỤNG
   ===================================================================== */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { position: relative; flex: 1; min-width: 240px; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 46px; border-radius: 999px; }
.toolbar select.input { width: auto; min-width: 170px; border-radius: 999px; }
.result-count { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.chips.left { justify-content: flex-start; margin-bottom: 20px; }

.detail-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: center; }
.detail-hero .app-icon { width: 84px; height: 84px; border-radius: 24px; }
.detail-hero h1 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; }
.detail-hero .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.detail-hero p { color: var(--muted); font-size: 17px; margin-top: 8px; max-width: 640px; }
.detail-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--muted); }
.detail-meta span { display: inline-flex; align-items: center; gap: 6px; }
.detail-cta { display: flex; flex-direction: column; gap: 8px; align-items: stretch; min-width: 220px; }
.detail-cta .hint { font-size: 13px; color: var(--muted); text-align: center; }
.detail-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; margin-top: 32px; }
.guide { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: g; }
.guide li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; counter-increment: g; }
.guide li::before {
  content: counter(g); width: 34px; height: 34px; border-radius: 11px; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.guide li span { padding-top: 5px; }
.example { display: block; width: 100%; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); font-size: 14px; cursor: pointer; color: var(--text); }
.example:hover { border-color: var(--primary); color: var(--primary); }
.examples { display: flex; flex-direction: column; gap: 10px; }
.perm-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 15px; }
.perm-list li { display: flex; gap: 10px; align-items: flex-start; }
.perm-list svg { flex: none; margin-top: 3px; }
.perm-list .yes svg { color: var(--success); }
.perm-list .no { color: var(--muted); }

/* =====================================================================
   6d. KHU LÀM VIỆC (dùng ứng dụng)
   ===================================================================== */
.ws-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.ws-head .app-icon { width: 52px; height: 52px; }
.ws-head h1 { font-size: 24px; font-weight: 800; }
.ws-head p { color: var(--muted); font-size: 14px; }
.ws-head .right { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uses-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; color: var(--muted); }
.uses-pill b { color: var(--text); }
.ws { display: grid; grid-template-columns: 400px 1fr; gap: 24px; align-items: start; }
.ws-form { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 18px; }
.ws-form .field label { margin-bottom: 8px; }
.ws-output { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.char-count { font-size: 12px; color: var(--muted); text-align: right; margin-top: 6px; }

.output-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.output-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.output-head .muted { font-size: 13px; }
.output-body { padding: 22px 24px; }
.progress { display: flex; align-items: center; gap: 14px; padding: 4px 0; color: var(--muted); font-size: 15px; }
.progress .time { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.caret::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--primary); margin-left: 2px; }
@keyframes blink { 50% { opacity: 0; } }

/* Văn bản Markdown do AI trả về */
.md { font-size: 16px; line-height: 1.75; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2, .md h3, .md h4 { margin: 1.2em 0 .5em; font-size: 18px; }
.md h2 { font-size: 20px; }
.md p { margin: 0 0 .9em; }
.md ul, .md ol { margin: 0 0 .9em; padding-left: 1.4em; }
.md li { margin: .25em 0; }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; padding: 2px 6px; border-radius: 6px; background: var(--surface-2); }
.md pre { background: var(--surface-2); padding: 14px 16px; border-radius: 12px; overflow-x: auto; margin: 0 0 1em; }
.md pre code { padding: 0; background: none; }
.md blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--primary); color: var(--muted); }
.md table { border-collapse: collapse; margin: 0 0 1em; width: 100%; font-size: 15px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.md th { background: var(--surface-2); }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }

/* Chat */
.chat-wrap { display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - 170px); min-height: 480px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.chat-log { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.msg { display: flex; gap: 12px; max-width: 860px; width: 100%; }
.msg.user { align-self: flex-end; justify-content: flex-end; }
.msg .who { flex: none; width: 34px; height: 34px; border-radius: 11px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--gradient); font-weight: 700; font-size: 14px; }
.msg .bubble-x { padding: 12px 16px; border-radius: 18px; max-width: 100%; min-width: 0; }
.msg.user .bubble-x { background: var(--gradient); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-width: 78%; }
.msg.ai .bubble-x { background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.ai .tools { display: flex; gap: 6px; margin-top: 8px; }
.chat-empty { margin: auto; text-align: center; max-width: 520px; }
.chat-empty .app-icon { margin: 0 auto 16px; width: 60px; height: 60px; }
.chat-empty h2 { font-size: 22px; margin-bottom: 8px; }
.chat-empty .examples { margin-top: 20px; }
.composer { border-top: 1px solid var(--border); padding: 14px; display: flex; gap: 10px; align-items: flex-end; background: var(--surface); }
.composer textarea {
  flex: 1; resize: none; min-height: 50px; max-height: 200px; padding: 13px 16px; border-radius: 16px; border: 1px solid var(--border);
  background: var(--bg); font-size: 16px; line-height: 1.5;
}
.composer textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent); }
.composer .btn { height: 50px; width: 50px; padding: 0; border-radius: 16px; flex: none; }
.composer-note { font-size: 12px; color: var(--muted); text-align: center; padding: 0 14px 10px; background: var(--surface); }

/* Ảnh / video */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.media-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.media-card .media { aspect-ratio: 9 / 16; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.media-card .media.land { aspect-ratio: 16 / 9; }
.media-card .media.square { aspect-ratio: 1; }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-card img { cursor: zoom-in; }
.media-card .meta { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.media-card .meta p { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.media-card .meta .row { display: flex; gap: 6px; flex-wrap: wrap; }
.media-card .pending { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; }
.media-card .pending .time { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.media-card .failed { padding: 20px; color: var(--danger); font-size: 14px; text-align: center; overflow-wrap: anywhere; display: flex; flex-direction: column; align-items: center; }
.drop {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 22px; text-align: center; cursor: pointer;
  color: var(--muted); font-size: 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; background: var(--bg);
}
.drop:hover, .drop.over { border-color: var(--primary); background: var(--primary-soft); }
.drop img { max-height: 240px; max-width: 100%; border-radius: 10px; }
.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.thumbs button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; aspect-ratio: 1; cursor: pointer; background: var(--surface-2); }
.thumbs button[aria-pressed="true"] { border-color: var(--primary); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(5, 6, 15, .88); display: none; align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }

.locked { text-align: center; max-width: 560px; margin: 40px auto; }
.locked .ic { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 22px; background: var(--gradient); color: #fff; display: flex; align-items: center; justify-content: center; }
.locked h1 { font-size: 26px; }
.locked p { color: var(--muted); margin: 10px 0 24px; }

/* =====================================================================
   6e. DASHBOARD & HỒ SƠ
   ===================================================================== */
.hello { display: flex; align-items: center; gap: 18px; }
.hello .avatar { width: 56px; height: 56px; font-size: 22px; border-radius: 18px; }
.recent-list { display: flex; flex-direction: column; }
.recent-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.recent-item:first-child { border-top: 0; padding-top: 0; }
.recent-item .app-icon { width: 42px; height: 42px; border-radius: 12px; flex: none; }
.recent-item .info { flex: 1; min-width: 0; }
.recent-item .info b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item .info span { font-size: 13px; color: var(--muted); }
.plan-box { border-radius: var(--radius-lg); padding: 24px; background: var(--gradient); color: #fff; position: relative; overflow: hidden; }
.plan-box::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.1); }
.plan-box .label { font-size: 14px; opacity: .85; }
.plan-box h3 { font-size: 26px; margin: 4px 0 6px; display: flex; align-items: center; gap: 8px; }
.plan-box p { opacity: .9; font-size: 14px; }
.plan-box .btn { margin-top: 16px; background: #fff; color: #3a2fd0; position: relative; z-index: 1; }
.plan-box.free { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.plan-box.free::after { background: var(--primary-soft); }
.plan-box.free .btn { background: var(--gradient); color: #fff; }

.profile-card { text-align: center; }
.profile-card .avatar { width: 84px; height: 84px; font-size: 32px; border-radius: 26px; margin: 0 auto 14px; }
.profile-card h2 { font-size: 22px; }
.profile-card .badges { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14px; margin-top: 20px; text-align: left; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.months label { position: relative; cursor: pointer; }
.months input { position: absolute; opacity: 0; }
.months span { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg); text-align: center; font-size: 13px; color: var(--muted); }
.months span b { font-size: 17px; color: var(--text); }
.months input:checked + span { border: 2px solid var(--primary); background: var(--primary-soft); padding: 13px 7px; }
.months input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.bank { border-radius: var(--radius); background: var(--bg); border: 1px dashed var(--border); padding: 16px 18px; }
.bank .kv { margin-top: 10px; }
.total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.total b { font-size: 24px; }

/* =====================================================================
   6f. RESPONSIVE cho các trang trên
   ===================================================================== */
@media (max-width: 1024px) {
  .ws { grid-template-columns: 1fr; }
  .ws-form { position: static; }
  .detail-grid, .grid-2 { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: auto 1fr; }
  .detail-cta { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .page { padding: 24px 0 64px; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-hero .app-icon { width: 64px; height: 64px; }
  .form-grid { grid-template-columns: 1fr; }
  .months { grid-template-columns: 1fr 1fr; }
  .chat-wrap { height: calc(100vh - var(--header-h) - 130px); }
  .chat-log { padding: 16px; }
  .msg.user .bubble-x { max-width: 88%; }
  .msg .who { display: none; }
  .toolbar select.input { flex: 1; }
  .card { padding: 18px; }
  .tile .value { font-size: 26px; }
  .media-grid { grid-template-columns: 1fr 1fr; }
}

/* =====================================================================
   7. RESPONSIVE
   ===================================================================== */
@media (max-width: 1024px) {
  .hero .container { grid-template-columns: 1fr; gap: 56px; }
  .hero-copy { text-align: center; }
  .hero-lead { margin: 0 auto; }
  .hero-cta, .hero-note { justify-content: center; }
  .hero-visual { max-width: 560px; margin: 0 auto; width: 100%; }
  .plans { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 860px) {
  .main-nav, .header-actions .guest-only, .user-btn .name { display: none; }
  .user-btn { padding: 4px; }
  .menu-toggle { display: inline-flex; }
  .steps, .audience { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--border); }
}
@media (max-width: 600px) {
  .container { padding: 0 16px; }
  section { padding: 64px 0; }
  .hero { padding: 40px 0 64px; }
  .hero-lead { font-size: 17px; }
  .hero-cta .btn { width: 100%; }
  .float-card.f1 { right: 8px; }
  .float-card.f2 { right: -4px; }
  .cta-band { padding: 36px 24px; }
  .cta-band .btn { width: 100%; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .auth-main { padding: 32px 16px; align-items: flex-start; }
  .stat b { font-size: 24px; }
}
