/* ==========================================================================
   GVYI Platform — Demo design system
   Art direction: Global VYSA — xanh lam sâu (key visual Diễn đàn) + đỏ/cam logo, nền kem
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --font-ui: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --font-display: 'Lora', Georgia, serif;

  --maxw: 1220px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

:root,
[data-theme='light'] {
  --bg: #f7f5f0;
  --surface: #fffdfa;
  --surface-2: #f1eee8;
  --surface-3: #e8e4dc;
  --border: #ddd8ce;
  --divider: #e8e4db;
  --text: #1a1f33;
  --text-muted: #626880;
  --text-faint: #9ea3b5;
  --text-inverse: #fbfaf6;

  --primary: #c8261b;
  --primary-hover: #a61d14;
  --primary-soft: #fbe4e0;
  --accent: #e8731e;
  --accent-soft: #fde9d9;
  --gold: #a87a10;
  --gold-soft: #f6ead0;
  --navy: #0f1f6e;
  --navy-deep: #0a1450;

  --ok: #2f6b3d;
  --ok-soft: #dfeade;
  --warn: #8a5a10;
  --warn-soft: #f4e9d4;
  --danger: #94243c;
  --danger-soft: #f3dde2;

  --shadow-sm: 0 1px 2px rgba(27, 38, 32, 0.06), 0 1px 3px rgba(27, 38, 32, 0.04);
  --shadow: 0 2px 4px rgba(27, 38, 32, 0.05), 0 8px 24px rgba(27, 38, 32, 0.07);
  --shadow-lg: 0 4px 8px rgba(27, 38, 32, 0.06), 0 20px 48px rgba(27, 38, 32, 0.12);
  --grain-opacity: 0.035;
}

[data-theme='dark'] {
  --bg: #0f1220;
  --surface: #161a2c;
  --surface-2: #1d2236;
  --surface-3: #262c44;
  --border: #303754;
  --divider: #242a42;
  --text: #e9eaf2;
  --text-muted: #9a9fb8;
  --text-faint: #666c86;
  --text-inverse: #0f1220;

  --primary: #ff7b6b;
  --primary-hover: #ff9686;
  --primary-soft: #3a1f1c;
  --accent: #f4a261;
  --accent-soft: #3a2a1a;
  --gold: #e0b95a;
  --gold-soft: #2e2718;
  --navy: #0d1a5c;
  --navy-deep: #080f3a;

  --ok: #74c286;
  --ok-soft: #1a2c1f;
  --warn: #d9a95a;
  --warn-soft: #2d2416;
  --danger: #e5738d;
  --danger-soft: #32191f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.3), 0 20px 48px rgba(0, 0, 0, 0.5);
  --grain-opacity: 0.02;
}

/* ---------- reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}
img,
svg {
  display: block;
  max-width: 100%;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
h4 {
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.011em;
}
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
::selection {
  background: var(--primary-soft);
  color: var(--text);
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (max-width: 640px) {
  .wrap {
    padding-inline: var(--space-4);
  }
}
.section {
  padding-block: clamp(var(--space-10), 5vw, var(--space-20));
}
.stack > * + * {
  margin-top: var(--space-4);
}
.row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.grid {
  display: grid;
  gap: var(--space-5);
}
.hide {
  display: none !important;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--divider);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  height: 66px;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}
.brand svg {
  color: var(--primary);
}
.brand-text {
  line-height: 1.15;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-sub {
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}
.nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.nav a.active {
  color: var(--primary);
  background: var(--primary-soft);
}
.header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s;
}
.icon-btn:hover {
  color: var(--text);
  border-color: var(--text-faint);
}
.lang-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.lang-toggle button {
  border: 0;
  background: transparent;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s;
}
.lang-toggle button[aria-pressed='true'] {
  background: var(--primary);
  color: var(--text-inverse);
}
.menu-btn {
  display: none;
}
@media (max-width: 1080px) {
  .nav {
    position: fixed;
    inset: 66px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3);
    gap: var(--space-1);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s var(--ease);
  }
  .nav.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .menu-btn {
    display: grid;
    margin-left: auto;
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  border-color: var(--text-faint);
  background: var(--surface-2);
}
.btn-quiet {
  background: transparent;
  color: var(--text-muted);
  padding-inline: var(--space-3);
}
.btn-quiet:hover {
  color: var(--text);
  background: var(--surface-2);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.btn-danger:hover {
  background: color-mix(in srgb, var(--danger) 18%, transparent);
}
.btn-sm {
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease);
}
a.card,
a.card-link {
  display: block;
  color: inherit;
}
.card-link:hover {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  cursor: pointer;
}
.card-flat {
  background: var(--surface-2);
  border-color: transparent;
}

/* ---------- typography helpers ---------- */
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.display {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.028em;
  line-height: 1.08;
}
.h-page {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  letter-spacing: -0.022em;
}
.h-sec {
  font-size: var(--text-lg);
  font-weight: 600;
}
.muted {
  color: var(--text-muted);
}
.faint {
  color: var(--text-faint);
}
.small {
  font-size: var(--text-sm);
}
.xs {
  font-size: var(--text-xs);
}
.lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.55;
  font-weight: 400;
}
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 0.8125em;
}

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.5;
  background: var(--surface-3);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-gold {
  background: var(--gold-soft);
  color: var(--gold);
}
.badge-accent {
  background: var(--accent-soft);
  color: var(--accent);
}
.badge-ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge-warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
}
.badge-dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.tag {
  display: inline-block;
  padding: 0.15em 0.55em;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--divider);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* ---------- forms ---------- */
.field {
  display: block;
}
.field > label,
.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  line-height: 1.5;
}
.err {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-1);
  font-weight: 500;
}
input[type='text'],
input[type='email'],
input[type='date'],
input[type='url'],
input[type='number'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 0.5625rem var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--text-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.6;
}
select {
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: var(--space-8);
}
.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-sm);
}
.check input {
  margin-top: 0.28em;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

/* ---------- misc components ---------- */
.divider {
  height: 1px;
  background: var(--divider);
  border: 0;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.chip {
  padding: 0.3rem var(--space-3);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.16s;
}
.chip:hover {
  border-color: var(--text-faint);
  color: var(--text);
}
.chip[aria-pressed='true'] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-inverse);
}
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: var(--text-sm);
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
  letter-spacing: 0.02em;
  font-family: var(--font-display);
}
.avatar-lg {
  width: 84px;
  height: 84px;
  font-size: var(--text-lg);
}
.avatar-sm {
  width: 34px;
  height: 34px;
  font-size: var(--text-xs);
}
.meter {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.5s var(--ease);
}
.empty {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}
.empty svg {
  margin: 0 auto var(--space-4);
  color: var(--text-faint);
}
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--space-6);
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--bg);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.28s var(--ease);
  z-index: 200;
  max-width: min(90vw, 420px);
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.demo-note {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--gold);
  font-size: var(--text-xs);
  line-height: 1.55;
  border: 1px solid color-mix(in srgb, var(--gold) 25%, transparent);
}
.demo-note svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(var(--space-12), 7vw, var(--space-24));
  color: #fff;
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(100deg, rgba(8, 15, 58, 0.92) 0%, rgba(10, 20, 80, 0.78) 55%, rgba(10, 20, 80, 0.55) 100%),
    url('assets/hero-bg.jpg');
  background-size: cover;
  background-position: center right;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 6px;
  background: linear-gradient(90deg, var(--primary) 0 60%, #ffcd00 60% 100%);
}
.hero .eyebrow { color: #ffd27a; }
.hero .lead { color: rgba(255, 255, 255, 0.82); }
.hero .demo-note { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.85); }
.hero .btn-ghost { color: #fff; background: transparent; border-color: rgba(255, 255, 255, 0.45); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.hero .stat { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.16); color: #fff; backdrop-filter: blur(6px); }
.hero .stat b { color: #ffd27a; }
.hero .stat span { color: rgba(255, 255, 255, 0.75); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(var(--space-8), 5vw, var(--space-16));
  align-items: center;
}
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}
.hero h1 {
  max-width: 15ch;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}
.stat {
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-xl);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.stat span {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: block;
  margin-top: var(--space-1);
}

/* ---------- feed ---------- */
.feed-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--divider);
}
.feed-item:last-child {
  border-bottom: 0;
}
.feed-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--text-muted);
}

/* ---------- profile ---------- */
.profile-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(170px, 240px);
  gap: var(--space-5);
  align-items: start;
}
.profile-head > :last-child { text-align: right; }
.profile-head > :last-child .small { text-align: left; }
.profile-head > :last-child .xs { text-align: left; }
@media (max-width: 720px) {
  .profile-head {
    grid-template-columns: auto 1fr;
  }
  .profile-head > :last-child {
    grid-column: 1 / -1;
  }
}
.kv {
  display: grid;
  grid-template-columns: minmax(120px, auto) 1fr;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
}
.kv dt {
  color: var(--text-muted);
}
.kv dd {
  margin: 0;
}
.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}
@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* ---------- verification ladder ---------- */
.ladder {
  display: grid;
  gap: var(--space-2);
}
.ladder-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: var(--text-sm);
}
.ladder-row.on {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- table ---------- */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
th {
  text-align: left;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: var(--surface-2);
}

/* ---------- steps ---------- */
html { scroll-padding-top: 96px; }

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
}
.step {
  display: flex;
  align-items: center;
  white-space: nowrap;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-faint);
  background: var(--surface-2);
  white-space: nowrap;
  flex-shrink: 0;
}
.step.on {
  background: var(--primary);
  color: var(--text-inverse);
}
.step.done {
  background: var(--ok-soft);
  color: var(--ok);
}
.step-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, currentColor 20%, transparent);
  font-size: 0.6875rem;
}

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: 1px solid var(--divider);
}
.tab {
  padding: var(--space-3) var(--space-4);
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: all 0.18s;
}
.tab:hover {
  color: var(--text);
}
.tab[aria-selected='true'] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- filters sidebar ---------- */
.dir-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 900px) {
  .dir-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}
.filter-block + .filter-block {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--divider);
}
.filter-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

/* ---------- milestone wall ---------- */
.timeline {
  position: relative;
  padding-left: var(--space-8);
}
.timeline::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--divider);
}
.tl-item {
  position: relative;
  padding-bottom: var(--space-6);
}
.tl-item:last-child {
  padding-bottom: 0;
}
.tl-dot {
  position: absolute;
  left: calc(-1 * var(--space-8) + 4px);
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--bg);
  background: var(--text-faint);
}
.tl-dot.done {
  background: var(--ok);
}
.tl-dot.active {
  background: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--divider);
  background: var(--surface-2);
  padding-block: var(--space-10);
  margin-top: var(--space-16);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-8);
}
.site-footer h4 {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text);
  margin-bottom: var(--space-3);
}
.site-footer a:hover {
  color: var(--primary);
}

/* ---------- animation ---------- */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.view {
  animation: rise 0.34s var(--ease) both;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* ---------- responsive fixes ---------- */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-6);
  }
}
@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-6);
  }
  .stat-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
body,
.wrap,
.site-footer,
.footer-grid {
  overflow-wrap: break-word;
}
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- header responsive ---------- */
.menu-btn {
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .header-inner {
    gap: var(--space-3);
  }
  .brand-name {
    font-size: 0.9375rem;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-sub {
    display: none;
  }
  .header-tools .btn-primary {
    display: none;
  }
  .lang-toggle button {
    padding: var(--space-2);
  }
}
@media (max-width: 1080px) {
  .nav .btn-primary,
  .nav-cta {
    display: flex;
    margin-top: var(--space-2);
  }
}
@media (min-width: 1081px) {
  .nav-cta {
    display: none;
  }
}
.nav a.nav-cta {
  background: var(--primary);
  color: var(--text-inverse);
  justify-content: center;
}
.nav a.nav-cta:hover {
  background: var(--primary);
  color: var(--text-inverse);
}
@media (max-width: 720px) {
  .brand-name {
    max-width: 34vw;
  }
  .header-tools {
    gap: var(--space-1);
  }
}

/* ---------- header fit (flex min-width chain) ---------- */
@media (max-width: 1080px) {
  .header-inner {
    min-width: 0;
  }
  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }
  .brand-text {
    min-width: 0;
    overflow: hidden;
  }
  .brand-name {
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .menu-btn {
    margin-left: var(--space-2);
  }
}


/* ---------- brand logo ---------- */
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 0 0 1px var(--border);
  flex: none;
}
.site-footer .brand-logo { width: 34px; height: 34px; }

/* ---------- section headers ---------- */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-bottom: var(--space-6); }
.sec-head .eyebrow { color: var(--primary); }
.sec-head h2 { margin-top: var(--space-2); }
.section-alt { background: var(--surface-2); border-block: 1px solid var(--divider); }
.section-navy { background: var(--navy-deep); color: #fff; }
.section-navy .eyebrow { color: #ffd27a; }
.section-navy .muted, .section-navy .small.muted { color: rgba(255,255,255,.72); }
.section-navy .card { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.14); color: #fff; }

/* ---------- forum recap ---------- */
.recap-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--space-8); align-items: start; }
@media (max-width: 900px) { .recap-grid { grid-template-columns: 1fr; } }
.topic-list { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.topic { display: grid; grid-template-columns: 38px 1fr; gap: var(--space-3); align-items: start; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.topic b { font-family: var(--font-display); font-size: var(--text-lg); color: var(--primary); line-height: 1; }
.fact-list { list-style: none; padding: 0; display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.fact-list li { display: flex; gap: var(--space-3); align-items: flex-start; }
.fact-list li::before { content: ''; width: 8px; height: 8px; margin-top: 7px; border-radius: 2px; background: var(--accent); flex: none; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.gallery figure { position: relative; margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; background: var(--surface-3); }
.gallery figure:first-child { grid-column: 1 / -1; aspect-ratio: 16/8; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery figcaption { position: absolute; inset: auto 0 0 0; padding: var(--space-2) var(--space-3); font-size: var(--text-xs); color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }

/* ---------- timeline ---------- */
.timeline { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 1100px) { .timeline { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px) { .timeline { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tl-item { position: relative; padding: var(--space-4); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.tl-item::before { content: ''; position: absolute; top: 0; left: var(--space-4); right: var(--space-4); height: 3px; background: var(--border); border-radius: 0 0 3px 3px; }
.tl-item.current::before { background: var(--primary); }
.tl-item.next { border-style: dashed; background: transparent; }
.tl-item.next::before { background: var(--gold); }
.tl-no { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1; letter-spacing: -0.02em; }
.tl-item.current .tl-no { color: var(--primary); }
.tl-item .xs { display: block; margin-top: var(--space-1); }
.tl-theme { font-size: var(--text-sm); margin-top: var(--space-3); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- advisors ---------- */
.advisor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--space-4); }
.advisor { text-align: center; padding: var(--space-4) var(--space-3); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.advisor img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto var(--space-3); box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--border); }
.advisor.lead-role img { box-shadow: 0 0 0 3px var(--surface), 0 0 0 4px var(--primary); }
.advisor strong { display: block; font-size: var(--text-sm); }
.advisor span { display: block; font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); line-height: 1.45; }

/* ---------- partners ---------- */
.partner-strip { display: flex; flex-wrap: wrap; gap: var(--space-6) var(--space-8); align-items: center; justify-content: center; }
.partner { display: flex; align-items: center; gap: var(--space-3); color: var(--text-muted); font-size: var(--text-xs); max-width: 220px; }
.partner img { height: 48px; width: auto; max-width: 64px; object-fit: contain; }

/* ---------- CTA banner ---------- */
.cta-banner { display: grid; grid-template-columns: 1fr auto; gap: var(--space-6); align-items: center; padding: var(--space-8); border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--primary), var(--accent)); color: #fff; }
.cta-banner .btn-ghost { color: #fff; background: transparent; border-color: rgba(255,255,255,.6); }
.cta-banner .btn-primary { background: #fff; color: var(--primary); }
.cta-banner .btn-primary:hover { background: #fff3ef; }
@media (max-width: 720px) { .cta-banner { grid-template-columns: 1fr; } }

/* ---------- member photos ---------- */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.badge-forum { background: var(--navy); color: #fff; }
[data-theme='dark'] .badge-forum { background: #2b3a9a; }
.member-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.member-links a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: var(--text-xs); color: var(--text); }
.member-links a:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- footer contact ---------- */
.footer-contact { display: grid; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.footer-contact a { color: var(--primary); }
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Trang pháp lý ---- */
.legal { padding-block: var(--space-8) var(--space-12); }
.legal-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.legal-tab { padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--divider); color: var(--text-2); font-size: var(--text-sm); font-weight: 500; text-decoration: none; background: var(--surface); }
.legal-tab:hover { color: var(--text); border-color: var(--text-3); }
.legal-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.legal-head { max-width: 62rem; margin-bottom: var(--space-8); }
.legal-head h1 { margin: var(--space-2) 0 var(--space-3); }
.legal-head .lead { color: var(--text-2); font-size: var(--text-lg); line-height: 1.6; }
.legal-meta { color: var(--text-3); font-size: var(--text-sm); margin-top: var(--space-3); }
.legal-grid { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.legal-toc { position: sticky; top: 88px; display: grid; gap: 0.35rem; border-left: 2px solid var(--divider); padding-left: var(--space-4); }
.legal-toc h4 { font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: var(--space-2); }
.legal-toc a { color: var(--text-2); font-size: var(--text-sm); text-decoration: none; line-height: 1.45; padding: 0.15rem 0; }
.legal-toc a:hover { color: var(--primary); }
.legal-body { max-width: 46rem; }
.legal-sec { padding: var(--space-5) 0; border-bottom: 1px solid var(--divider); scroll-margin-top: 90px; }
.legal-sec:first-child { padding-top: 0; }
.legal-sec h2 { font-size: var(--text-xl); margin-bottom: var(--space-3); }
.legal-sec p { color: var(--text-2); line-height: 1.7; margin-bottom: var(--space-3); }
.legal-sec ul { padding-left: 1.25rem; display: grid; gap: 0.5rem; color: var(--text-2); line-height: 1.65; }
.legal-sec li::marker { color: var(--primary); }
.legal-contact { margin-top: var(--space-6); padding: var(--space-5); display: grid; gap: var(--space-3); justify-items: start; }
.legal-contact h3 { font-size: var(--text-lg); }
.legal-contact p { color: var(--text-2); }
@media (max-width: 860px) {
  .legal-grid { grid-template-columns: 1fr; }
  .legal-toc { position: static; border-left: 0; padding-left: 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); border-top: 1px solid var(--divider); padding-top: var(--space-4); }
  .legal-toc h4 { grid-column: 1 / -1; }
}

/* ---------- tài khoản / khu vực quản trị ---------- */
.nav-auth { display: inline-flex; align-items: center; }
.nav-login { font-weight: 600; }
.acct { position: relative; }
.acct summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: var(--space-2); padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--divider); background: var(--surface); }
.acct summary::-webkit-details-marker { display: none; }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.acct-name { font-size: var(--text-sm); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--divider); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14); padding: var(--space-2); display: grid; gap: 2px; z-index: 80; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: var(--text-sm); font-weight: 600; color: var(--text); background: none; border: 0; cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--bg-soft, var(--divider)); }
.acct-role { padding: 6px 10px 4px; text-transform: uppercase; letter-spacing: 0.06em; }
.acct-out { color: var(--danger); }
.nav.open .acct-menu { position: static; box-shadow: none; border: 0; padding-left: 0; }
.skeleton { background: linear-gradient(90deg, var(--divider) 25%, var(--surface) 50%, var(--divider) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: var(--radius, 12px); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--space-8); align-items: start; }
.admin-side { position: sticky; top: 84px; display: grid; gap: 2px; }
.admin-side button { text-align: left; padding: 9px 12px; border-radius: 10px; border: 0; background: none; font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.admin-side button:hover { color: var(--text); background: var(--divider); }
.admin-side button[aria-selected='true'] { color: var(--primary); background: var(--primary-soft, rgba(200, 30, 30, 0.08)); }
.admin-detail { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-6); align-items: start; }
.stat-bar { display: grid; grid-template-columns: 140px minmax(0, 1fr) 40px; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.stat-bar i { display: block; height: 8px; border-radius: 4px; background: var(--primary); }
.stat-bar span:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table-wrap th, .table-wrap td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
.table-wrap th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.table-wrap tr[data-href] { cursor: pointer; }
.table-wrap tr[data-href]:hover td { background: var(--divider); }
.ai-result { border-left: 3px solid var(--accent, var(--primary)); padding: var(--space-3) var(--space-4); margin-top: var(--space-3); background: var(--surface); border-radius: 0 10px 10px 0; display: grid; gap: var(--space-2); font-size: var(--text-sm); }
.ai-result .kv { display: grid; grid-template-columns: 120px 1fr; gap: 2px var(--space-3); font-size: var(--text-xs); }
.match-match { color: var(--ok); font-weight: 700; }
.match-partial { color: var(--warn); font-weight: 700; }
.match-mismatch { color: var(--danger); font-weight: 700; }
@media (max-width: 960px) {
  .admin-layout { grid-template-columns: 1fr; gap: var(--space-4); }
  .admin-side { position: static; display: flex; flex-wrap: wrap; }
  .admin-detail { grid-template-columns: 1fr; }
}
.kv-list { display: grid; gap: var(--space-2); margin: 0; }
.kv-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: var(--space-3); font-size: var(--text-sm); padding-bottom: var(--space-2); border-bottom: 1px solid var(--divider); }
.kv-row dt { color: var(--text-muted); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em; padding-top: 2px; }
.kv-row dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv-row { grid-template-columns: 1fr; gap: 2px; } }
.field > .hint, .field > .err { display: block; }
@media (min-width: 1081px) and (max-width: 1520px) {
  .header-inner { gap: var(--space-3); }
  .nav { gap: 0; }
  .nav a { padding: var(--space-2) 9px; font-size: 13.5px; }
  .acct-name { max-width: 96px; }
}
