/* ==========================================================================
   I HATE CALCULATOR COMPONENTS — SLEEK EDITORIAL & SWISS UTILITY
   Header, Masthead, Quick Search, Library Cards, Modals, Embed Hub
   ========================================================================== */

/* Header / Masthead Navbar - Sleek Glassmorphism (56px) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: var(--header-height);
  background: rgba(250, 249, 246, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

[data-theme="dark"] .site-header {
  background: rgba(19, 19, 18, 0.86);
  border-bottom-color: var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

/* Brand Logo - Crisp & Understated */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-edition-tag {
  font-family: var(--font-financial);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  margin-left: 0.35rem;
  display: inline-block;
  vertical-align: middle;
}

.brand-icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 6px;
  background: var(--brand-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

[data-theme="dark"] .brand-icon {
  background: var(--brand-primary);
  color: var(--bg-app);
}

/* Navigation Links - Crisp Editorial Pills */
.header-nav {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav-link {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.nav-link.active {
  color: var(--text-primary);
  font-weight: 600;
  background: var(--bg-surface-elevated);
}

/* Header Action Group */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

/* Search Trigger Button - Sleek Modern Pill */
.cmd-k-trigger {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  height: 32px;
  padding: 0 0.65rem 0 0.6rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
  font-size: 0.8rem;
  transition: all 0.15s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.cmd-k-trigger:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-surface);
  box-shadow: var(--shadow-xs);
}

.cmd-k-shortcut {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* Language Switcher - Sleek Pill */
.lang-switcher-wrap {
  position: relative;
  display: inline-flex;
}

.lang-switcher-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.65rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.lang-switcher-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-surface);
}

.lang-flag {
  font-size: 0.95rem;
  line-height: 1;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 155px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.3rem;
  display: none;
  flex-direction: column;
  gap: 0.1rem;
  z-index: 120;
}

.lang-dropdown-menu.open {
  display: flex;
}

.lang-option-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  width: 100%;
  text-align: left;
  transition: all 0.1s ease;
}

.lang-option-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.lang-option-btn.active {
  color: var(--brand-primary);
  background: var(--brand-primary-subtle);
  font-weight: 700;
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  cursor: pointer;
}

@media (max-width: 960px) {
  .header-nav {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-flex;
  }
}

/* Mobile Drawer */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  justify-content: flex-end;
}

.mobile-drawer-backdrop.open {
  display: flex;
}

.mobile-drawer {
  width: 290px;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.mobile-drawer-link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md);
  transition: all 0.1s ease;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mobile-drawer-link:hover, .mobile-drawer-link.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
  font-weight: 600;
}

/* ==========================================================================
   HERO / MASTHEAD SECTION
   ========================================================================== */
.hero-section {
  padding: 3.5rem 0 2.5rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.editorial-masthead-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.65rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.editorial-masthead-stamp .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-forest);
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  max-width: 860px;
  margin: 0 auto 1rem;
}

.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--brand-primary);
}

.hero-desc {
  font-size: clamp(0.95rem, 1.8vw, 1.1rem);
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 2rem;
}

/* Grounded Editorial Search Box */
.hero-search-wrapper {
  max-width: 580px;
  margin: 0 auto 1.5rem;
  position: relative;
}

.hero-search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-app);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.45rem 0.35rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.hero-search-bar:focus-within {
  border-color: var(--brand-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px var(--brand-primary-subtle);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  padding: 0.4rem 0.5rem;
}

.hero-search-input::placeholder {
  color: var(--text-muted);
}

.hero-search-btn {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
  border: none;
}

.hero-search-btn:hover {
  background: var(--btn-primary-hover);
  color: var(--btn-primary-fg);
}

/* Category Quick Filter Chips */
.quick-chips-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.chip-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: var(--bg-surface);
}

.chip-btn.active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
  font-weight: 600;
}

.chip-count {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.chip-btn.active .chip-count {
  background: rgba(0, 0, 0, 0.15);
  color: var(--btn-primary-fg);
}

[data-theme="dark"] .chip-btn.active .chip-count {
  background: rgba(0, 0, 0, 0.2);
  color: var(--btn-primary-fg);
}

/* ==========================================================================
   FLAGSHIP SHOWCASE SECTION (Homepage)
   ========================================================================== */
.flagship-section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.flagship-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 1024px) {
  .flagship-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .flagship-grid {
    grid-template-columns: 1fr;
  }
}

.flagship-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  position: relative;
}

.flagship-card:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.flagship-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.flagship-icon-box {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.flagship-card:hover .flagship-icon-box {
  background: var(--brand-primary);
  color: #ffffff;
  border-color: var(--brand-primary);
  transform: scale(1.08);
  box-shadow: 0 6px 18px rgba(15, 41, 66, 0.2);
}

.flagship-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--brand-sand-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.flagship-card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 0.5rem;
}

.flagship-card-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.flagship-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.flagship-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.flagship-card-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.flagship-primary-link {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.15s ease;
  text-decoration: none;
}

.flagship-primary-link:hover {
  transform: translateX(3px);
  color: var(--brand-primary-hover);
}

/* ==========================================================================
   BENTO / INTERACTIVE STUDIO SECTION
   ========================================================================== */
.bento-section {
  padding: 3rem 0 4rem;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.section-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-accent);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

/* Editorial Studio Container */
.calc-studio {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.studio-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  overflow-x: auto;
}

.studio-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.studio-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.02);
}

.studio-tab-btn.active {
  color: var(--brand-primary);
  background: var(--bg-surface);
  border-bottom-color: var(--brand-primary);
}

/* ==========================================================================
   TOOL DIRECTORY CARDS (LIBRARY STYLE)
   ========================================================================== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

/* 02/12/2026 — luoi 282 cong cu chiem 4.517/5.832 the cua trang chu.
   `content-visibility:auto` cho trinh duyet bo qua bo cuc + ve phan ngoai man;
   `contain-intrinsic-size` giu cho san nen khong gay lech bo cuc (CLS).
   Noi dung VAN nam trong DOM: Google doc duoc, Ctrl+F tim duoc. */
.tool-grid > .tool-card{content-visibility:auto;contain-intrinsic-size:auto 186px}
.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  text-decoration: none;
}

.tool-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.tool-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.tool-card-icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-lg);
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--border-subtle);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tool-card-icon.category-finance {
  background: rgba(45, 90, 39, 0.08);
  color: var(--brand-forest);
  border-color: rgba(45, 90, 39, 0.2);
}

.tool-card-icon.category-tax {
  background: rgba(15, 41, 66, 0.08);
  color: var(--brand-primary);
  border-color: rgba(15, 41, 66, 0.2);
}

.tool-card-icon.category-health {
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.2);
}

.tool-card-icon.category-math {
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
  border-color: rgba(99, 102, 241, 0.2);
}

.tool-card-icon.category-time {
  background: rgba(217, 119, 6, 0.08);
  color: #d97706;
  border-color: rgba(217, 119, 6, 0.2);
}

.tool-card-icon.category-convert {
  background: rgba(13, 148, 136, 0.08);
  color: #0d9488;
  border-color: rgba(13, 148, 136, 0.2);
}

[data-theme="dark"] .tool-card-icon.category-finance {
  background: rgba(74, 138, 66, 0.18);
  color: #68bb5c;
  border-color: rgba(74, 138, 66, 0.35);
}

[data-theme="dark"] .tool-card-icon.category-tax {
  background: rgba(56, 114, 173, 0.18);
  color: #79b2eb;
  border-color: rgba(56, 114, 173, 0.35);
}

[data-theme="dark"] .tool-card-icon.category-health {
  background: rgba(217, 119, 6, 0.18);
  color: #f59e0b;
  border-color: rgba(217, 119, 6, 0.35);
}

[data-theme="dark"] .tool-card-icon.category-math {
  background: rgba(129, 140, 248, 0.18);
  color: #a5b4fc;
  border-color: rgba(129, 140, 248, 0.35);
}

[data-theme="dark"] .tool-card-icon.category-time {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .tool-card-icon.category-convert {
  background: rgba(20, 184, 166, 0.18);
  color: #5eead4;
  border-color: rgba(20, 184, 166, 0.35);
}

.tool-card:hover .tool-card-icon {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.tool-card-title {
  font-family: var(--font-sans);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.tool-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.tool-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.tool-card-action {
  font-weight: 600;
  color: var(--brand-primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.15s ease;
  
  text-decoration: none;
}

.tool-card:hover .tool-card-action {
  transform: translateX(3px);
}

/* ==========================================================================
   COMMAND PALETTE MODAL (CMD+K)
   ========================================================================== */
.cmd-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1rem 2rem;
  opacity: 0;
  pointer-events: none;
  
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

.cmd-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.15s ease, visibility 0s linear 0s;
}

.cmd-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  transition: transform 0.2s ease;
}

.cmd-modal-backdrop.open .cmd-modal {
  transform: translateY(0);
}

.cmd-search-input-wrap {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.cmd-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: 1.05rem;
  color: var(--text-primary);
}

.cmd-search-input::placeholder {
  color: var(--text-muted);
}

.cmd-results-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.5rem;
}

.cmd-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.1s ease;
}

.cmd-result-item:hover, .cmd-result-item.selected {
  background: var(--bg-surface-elevated);
}

.cmd-result-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cmd-result-icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.cmd-result-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.cmd-result-cat {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cmd-modal-foot {
  padding: 0.65rem 1rem;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cmd-keys-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cmd-key {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.68rem;
  font-weight: 700;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  padding: 0.65rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.toast-bubble.fade-out {
  opacity: 0;
}

/* Trust & Fact-Checked Banner */
.trust-bar {
  padding: 2.25rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  margin-top: 3.5rem;
}

.trust-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.trust-icon-box {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--brand-forest);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   SEO FAQ SECTION
   ========================================================================== */
.faq-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.faq-grid {
  max-width: 820px;
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface-elevated);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-xs);
}

.faq-summary {
  padding: 1.15rem 1.25rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.faq-summary::-webkit-details-marker {
  display: none;
}

.faq-summary-icon {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.faq-item[open] .faq-summary-icon {
  transform: rotate(180deg);
  color: var(--brand-primary);
}

.faq-body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

/* ==========================================================================
   INSTITUTIONAL FOOTER SECTION (ACCREDITED & FINANCIAL STANDARDS)
   ========================================================================== */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2.5rem;
  margin-top: auto;
  position: relative;
}

/* Institutional Trust Badges Strip */
.footer-trust-strip {
  padding-bottom: 3.5rem;
  margin-bottom: 3.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.footer-trust-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.25rem;
}

.footer-trust-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.015em;
  margin-bottom: 0.4rem;
}

.footer-trust-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.footer-trust-grid {
  display: grid;
  
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) {
  .footer-trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .footer-trust-grid {
    grid-template-columns: 1fr;
  }
}

.trust-badge-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.trust-badge-card--wide {
  grid-column: span 2;
}

@media (max-width: 1100px) {
  .trust-badge-card--wide { grid-column: span 2; }
}

@media (max-width: 700px) {

  .footer-trust-grid .trust-badge-card--wide {
    grid-column: span 1;
    width: 17rem;
  }
}

.trust-src-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.trust-src-link {
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.25;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--brand-primary);
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.trust-src-link:hover,
.trust-src-link:focus-visible {
  border-color: var(--brand-primary);
  background: var(--bg-surface-elevated);
  text-decoration: underline;
}

.trust-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--border-hover);
  background: var(--bg-surface);
}

.trust-badge-icon {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--brand-primary);
  box-shadow: var(--shadow-xs);
  flex-shrink: 0;
}

[data-theme="dark"] .trust-badge-icon {
  background: var(--bg-surface-alt);
  color: var(--brand-primary);
}

.trust-badge-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.trust-badge-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.trust-badge-tag {
  font-family: var(--font-financial);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--brand-forest);
  background: var(--brand-forest-subtle);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  width: fit-content;
  margin-top: auto;
}

/* 4-Column Editorial Links Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-brand p {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 0.85rem;
  max-width: 320px;
}

.footer-col-title {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 1.1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.footer-link {
  font-size: 0.84rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
  letter-spacing: -0.005em;
}

.footer-link:hover {
  color: var(--text-primary);
}

/* Regulatory Financial Disclosure & Compliance Box */
.footer-disclaimer-box {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.25rem;
  font-size: 0.77rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.footer-disclaimer-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
}

/* Bottom Bar */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-editions-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.74rem;
  font-family: var(--font-financial);
}

.footer-editions-label {
  color: var(--text-muted);
  font-weight: 500;
}

.footer-edition-badge {
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

a.footer-edition-badge:hover,
a.footer-edition-badge:focus-visible {
  color: var(--text-primary);
  border-color: var(--text-muted);
  text-decoration: underline;
}

a.footer-edition-badge:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

/* ==========================================================================
   EMBED HUB & WIDGET CONFIGURATOR STYLES
   ========================================================================== */
.embed-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2rem;
  margin-bottom: 3.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .embed-hub-grid {
    grid-template-columns: 1fr;
  }
}

.embed-config-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.embed-preview-wrapper {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.embed-code-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.code-snippet-box {
  position: relative;
  background: var(--bg-app);
  color: var(--text-primary);
  padding: 1.15rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.6;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
}

.platform-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.platform-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.platform-card h3,
.platform-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.platform-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* ==========================================================================
   EDITORIAL & CONTENT PAGES (ABOUT, TERMS, PRIVACY, METHODOLOGY, CONTACT)
   ========================================================================== */

.page-hero {
  padding: 4rem 0 2.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
}

.page-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-accent);
  background: var(--brand-accent-subtle);
  border-radius: var(--radius-full);
  margin-bottom: 1rem;
}

.page-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.page-hero-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
}

.content-page-layout {
  padding: 3rem 0 5rem;
}

.content-sidebar-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 860px) {
  .content-sidebar-grid {
    grid-template-columns: 1fr;
  }
}

.sticky-doc-nav {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}

.sticky-doc-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.sticky-doc-link {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.35;
}

.sticky-doc-link:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.sticky-doc-link.active {
  background: var(--brand-sand-light);
  color: var(--text-primary);
  font-weight: 600;
}

.editorial-article {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow-sm);
  line-height: 1.7;
}

@media (max-width: 640px) {
  .editorial-article {
    padding: 1.5rem 1.25rem;
  }
}

.editorial-article h2 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 2.25rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  letter-spacing: -0.01em;
}

.editorial-article h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.editorial-article h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.5rem 0 0.65rem;
}

.editorial-article p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.editorial-article ul, .editorial-article ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
  color: var(--text-secondary);
}

.editorial-article li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Manifesto Cards */
.manifesto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.manifesto-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.manifesto-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.manifesto-card-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.manifesto-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.manifesto-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 0;
}

/* Formula & Methodology Blocks */
.formula-block {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--brand-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.formula-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--brand-accent);
  margin-bottom: 0.5rem;
}

.formula-math {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  overflow-x: auto;
}

.formula-legend {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Compliance Badge List */
.badge-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.badge-pill.success {
  background: var(--brand-forest-subtle);
  border-color: rgba(22, 101, 52, 0.2);
  color: var(--brand-forest);
}

/* Contact Page Components */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  margin-top: 2rem;
}

@media (max-width: 840px) {
  .contact-container {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.contact-form-group {
  margin-bottom: 1.25rem;
}

.contact-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.contact-input, .contact-textarea, .contact-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
}

.contact-input:focus, .contact-textarea:focus, .contact-select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(15, 41, 66, 0.08);
}

.contact-textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-xs);
}

.contact-info-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-info-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.contact-info-card a {
  color: var(--brand-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
}

@media (max-width: 760px) {
  .header-inner { gap: 0.5rem; }
  .brand-logo { font-size: 1.05rem; gap: 0.4rem; min-width: 0; }
  .brand-edition-tag { display: none; }          
  .header-actions { gap: 0.35rem; }
  .cmd-k-trigger { padding: 0 0.6rem; }
  .cmd-k-trigger > span[data-i18n] { display: none; }   
  .cmd-k-shortcut { display: none; }                    
}
@media (max-width: 430px) {
  .brand-logo { font-size: 0.95rem; }
  .lang-switcher-btn { padding: 0 0.45rem; gap: 0.25rem; }
}
@media (max-width: 360px) {
  .brand-logo { font-size: 0.88rem; }
  .lang-switcher-btn .lang-text { display: none; }      
}

@media (max-width: 380px) {
  .hero-search-bar { padding: 0.3rem 0.35rem 0.3rem 0.7rem; }
  .hero-search-btn { padding: 0.5rem 0.7rem; flex-shrink: 0; }
  .hero-search-input { min-width: 0; }
}

@media (max-width: 360px) {
  .container { padding-left: 0.75rem; padding-right: 0.75rem; }
  .header-inner { gap: 0.3rem; }
  .header-actions { gap: 0.28rem; }
  .brand-logo { font-size: 0.8rem; gap: 0.3rem; }
  .cmd-k-trigger { padding: 0 0.45rem; }
  .lang-switcher-btn { padding: 0 0.35rem; }

  .brand-logo { flex-shrink: 1; min-width: 0; overflow: hidden; }
  .brand-name { overflow: hidden; text-overflow: ellipsis; }
  .header-actions { min-width: 0; flex-shrink: 0; }
}

@media (max-width: 860px) {
  .embed-hub-grid { grid-template-columns: minmax(0, 1fr); }
  .embed-hub-grid > * { min-width: 0; }
  .embed-hub-grid input,
  .embed-hub-grid select,
  .embed-hub-grid textarea { max-width: 100%; min-width: 0; }
  
  .embed-hub-grid pre,
  .embed-hub-grid code { overflow-x: auto; white-space: pre-wrap; word-break: break-word; }
}
@media (max-width: 380px) {
  .embed-config-card { padding-left: 1rem; padding-right: 1rem; }
}

@media (max-width: 860px) {
  .sticky-doc-nav {
    position: static;
    top: auto;
    margin-bottom: 1.5rem;
  }
}

@media (max-width: 600px) {
  .hero-search-bar { padding: 0.3rem 0.35rem 0.3rem 0.8rem; }
  .hero-search-bar > svg,
  .hero-search-bar .hero-search-icon { flex-shrink: 0; }
  .hero-search-input {
    min-width: 0;
    font-size: 0.92rem;
    text-overflow: ellipsis;   
  }
  .hero-search-btn { padding: 0.5rem 0.85rem; font-size: 0.88rem; flex-shrink: 0; }
}
@media (max-width: 400px) {
  .hero-search-btn span,
  .hero-search-btn .btn-label { display: none; }   
  .hero-search-btn { padding: 0.55rem 0.75rem; }
}

@media (max-width: 600px) {
  .editorial-masthead-stamp {
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.64rem;
    letter-spacing: 0.02em;
    padding: 0.4rem 0.75rem;
    text-align: left;
  }
  .editorial-masthead-stamp .dot { flex-shrink: 0; margin-top: 0.34rem; }
}

.lang-option-btn.lang-option-soon { opacity: 0.5; cursor: default; }
.lang-option-btn.lang-option-soon:hover { background: transparent; }
.lang-soon-tag {
  margin-left: auto;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.1rem 0.32rem;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 60;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  text-align: left;
}
.search-suggest[hidden] { display: none; }
.search-suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.95rem;
  text-decoration: none;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.12s ease;
}
.search-suggest-item:last-of-type { border-bottom: 0; }
.search-suggest-item:hover,
.search-suggest-item.active { background: var(--bg-surface-elevated); }
.search-suggest-name {
  font-size: 0.9rem; font-weight: 600; color: var(--text-primary);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-suggest-name mark {
  background: var(--brand-sand-light, #f3e6cf);
  color: inherit; padding: 0 1px; border-radius: 2px;
}
.search-suggest-cat {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase; color: var(--text-muted); flex-shrink: 0;
}
.search-suggest-empty,
.search-suggest-foot {
  padding: 0.75rem 0.95rem; font-size: 0.78rem; color: var(--text-muted);
}
.search-suggest-foot { border-top: 1px solid var(--border-subtle); background: var(--bg-surface-elevated); }
@media (max-width: 600px) {
  .search-suggest-cat { display: none; }
  .search-suggest-name { font-size: 0.86rem; }
}

a.cmd-result-item { text-decoration: none; color: inherit; }
.cmd-result-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); font-size: 0.88rem; }

#quick-chips-container { min-height: 73px; }
@media (max-width: 700px) { #quick-chips-container { min-height: 194px; } }

@media (max-width: 720px) {
  .site-footer { padding: 2rem 0 1.5rem; }

  .footer-trust-strip {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .footer-trust-header { margin-bottom: 0.8rem; }
  .footer-trust-title { font-size: 0.95rem; margin-bottom: 0; }
  .footer-trust-subtitle { display: none; }

  .footer-trust-grid {
    grid-template-columns: none;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: visible;
  }

  .trust-badge-card {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 0.6rem;
    row-gap: 0.4rem;
    width: auto;
    padding: 0.62rem 0;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 0;
  }
  .footer-trust-grid .trust-badge-card:last-child { border-bottom: 0; padding-bottom: 0; }
  .trust-badge-card:hover { transform: none; box-shadow: none; }

  .trust-badge-icon {
    width: 1.5rem; height: 1.5rem; margin: 0;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .trust-badge-icon svg { width: 14px; height: 14px; }
  .trust-badge-name { font-size: 0.78rem; line-height: 1.3; margin: 0; }
  
  .trust-badge-meta { display: none; }
  .trust-badge-tag {
    font-size: 0.58rem; padding: 0.1rem 0.4rem; margin: 0;
    white-space: nowrap; justify-self: end;
  }
  
  .footer-trust-grid .trust-badge-card--wide { width: auto; }
  .footer-trust-grid .trust-badge-card--wide .trust-badge-name { grid-area: 1 / 2 / 2 / 3; }
  .footer-trust-grid .trust-badge-card--wide .trust-badge-tag { grid-area: 1 / 3 / 2 / 4; }
  .footer-trust-grid .trust-badge-card--wide .trust-src-links {
    grid-area: 2 / 1 / 3 / 4;
    margin: 0;
    gap: 0.3rem;
  }
  
  .footer-trust-grid .trust-src-link {
    font-size: 0.62rem;
    padding: 0.14rem 0.45rem;
    max-width: 9.3rem;
  }

  .footer-grid {
    gap: 0.25rem;
    margin-bottom: 1.25rem;
  }
  .footer-brand p { font-size: 0.8rem; margin-top: 0.6rem; max-width: none; }
  .footer-brand > div[style] { margin-top: 0.7rem !important; }

  .footer-col-gap {
    border-top: 1px solid var(--border-subtle);
    padding: 0;
  }
  .footer-col-gap .footer-col-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding: 0.7rem 0;
    cursor: pointer;
    user-select: none;
  }
  .footer-col-gap .footer-col-title::after {
    content: '＋';
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1;
  }
  .footer-col-gap[open] .footer-col-title::after { content: '−'; }
  .footer-col-gap .footer-col-title::-webkit-details-marker { display: none; }
  .footer-col-gap .footer-links {
    gap: 0.5rem;
    padding: 0 0 0.85rem;
  }
  .footer-col-gap .footer-link { font-size: 0.82rem; }

  .footer-disclaimer-box {
    padding: 0.8rem 0.9rem;
    margin-bottom: 1.1rem;
    font-size: 0.72rem;
  }
  .footer-disclaimer-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .footer-disclaimer-box.mo-rong .footer-disclaimer-text {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
  }
  .footer-disclaimer-box .nut-mo-mo-ta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.35rem;
    background: none;
    border: 0;
    font: inherit;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
  }

  .footer-editions-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.35rem;
  }
  .footer-editions-row::-webkit-scrollbar { display: none; }
  .footer-edition-badge { flex-shrink: 0; font-size: 0.6rem; padding: 0.15rem 0.4rem; }
  .footer-bottom { padding-top: 0.9rem; gap: 0.5rem; }
}

.back-to-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  z-index: 990;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease, background .15s ease;
}

.back-to-top-btn.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top-btn:hover,
.back-to-top-btn:focus-visible {
  background: var(--brand-primary);
  color: #fff;
  border-color: var(--brand-primary);
}

@media (max-width: 720px) {
  .back-to-top-btn {
    
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: var(--bg-surface);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
  }
  
  .back-to-top-btn.gan-cuoi { bottom: 4.5rem; }
}

@media (max-width: 720px) {

  .hero-section { padding: 1.25rem 0 1.5rem; }
  .editorial-masthead-stamp {
    font-size: 0.62rem;
    padding: 0.3rem 0.7rem;
    letter-spacing: 0.06em;
  }
  .hero-title { font-size: 1.95rem; line-height: 1.15; margin-bottom: 0.6rem; }
  .hero-desc {
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .quick-chips-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.4rem;
    min-height: 0 !important;
    padding-bottom: 0.15rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent);
  }
  .quick-chips-bar::-webkit-scrollbar { display: none; }
  .quick-chips-bar > * { flex: 0 0 auto; }
  .quick-chips-bar.het-cuon { -webkit-mask-image: none; mask-image: none; }

  .tool-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.6rem !important;
    
    grid-auto-flow: dense;
  }
  .tool-card {
    padding: 0.7rem 0.7rem 0.75rem;
    border-radius: 13px;
    box-shadow: none;
    position: relative;
  }
  .tool-card-head { margin-bottom: 0.45rem; }
  .tool-card-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 9px;
    box-shadow: none;
    border-width: 1px;
  }
  .tool-card-icon svg { width: 15px; height: 15px; }
  
  .tool-card-head .badge-pill { display: none; }
  .tool-card-head .badge {
    font-size: 0.55rem;
    padding: 0.12rem 0.35rem;
    letter-spacing: 0.04em;
  }
  .tool-card-title {
    font-size: 0.83rem;
    line-height: 1.25;
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .tool-card-desc { display: none; }
  .tool-card-foot {
    border-top: 0;
    padding-top: 0;
    margin-top: auto;
    font-size: 0.62rem;
  }
  .tool-card-foot > span { color: var(--text-muted); }
  
  .tool-card-action span {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }

  .tool-card.noi-bat {
    grid-column: span 2;
    border-color: var(--brand-primary);
    border-width: 1.5px;
    background: linear-gradient(180deg, rgba(15, 41, 66, 0.045), transparent 60%);
  }
  .tool-card.noi-bat .tool-card-title {
    font-size: 0.98rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
  .tool-card.noi-bat .tool-card-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.74rem;
    line-height: 1.4;
    margin-bottom: 0.35rem;
  }
  .tool-card.noi-bat .tool-card-icon { width: 2.4rem; height: 2.4rem; }
  
  .tool-card.noi-bat .tool-card-action span {
    position: static;
    width: auto; height: auto;
    margin: 0; overflow: visible;
    clip: auto; clip-path: none;
    white-space: normal;
  }

  .flagship-grid { gap: 0.7rem; }
  .flagship-card { padding: 1rem; }
  .flagship-card-head { margin-bottom: 0.5rem; }
  .flagship-icon-box {
    width: 2.4rem !important;
    height: 2.4rem !important;
    border-radius: 11px;
    box-shadow: none;
  }
  .flagship-icon-box svg { width: 17px; height: 17px; }
  .flagship-card-title { font-size: 1.05rem; line-height: 1.22; margin-bottom: 0.3rem; }
  .flagship-card-desc {
    font-size: 0.8rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.6rem;
  }
  
  .flagship-highlights {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.3rem;
  }
  .flagship-highlights::-webkit-scrollbar { display: none; }
  .flagship-highlights > * { flex: 0 0 auto; font-size: 0.65rem; padding: 0.2rem 0.45rem; }
  .flagship-card-actions { padding-top: 0.6rem; margin-top: 0.6rem; }

  .section-header { margin-bottom: 0.9rem; }
  .section-tag { font-size: 0.64rem; margin-bottom: 0.25rem; }
  .section-title { font-size: 1.35rem; line-height: 1.2; margin-bottom: 0.3rem; }
  .section-subtitle {
    font-size: 0.82rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .flagship-section, .bento-section, .faq-section, .trust-bar { padding: 1.5rem 0; }

  .faq-grid { gap: 0.4rem; }
}

@media (max-width: 720px) {
  .faq-item { border-radius: 11px; }
  .faq-summary { padding: 0.7rem 0.85rem; font-size: 0.86rem; line-height: 1.35; }
  .faq-body { padding: 0 0.85rem 0.8rem; font-size: 0.8rem; line-height: 1.5; }
  .faq-grid { gap: 0.4rem; }
}

.tool-card-icon.category-everyday {
  background: rgba(190, 24, 93, 0.08);
  color: #be185d;
  border-color: rgba(190, 24, 93, 0.2);
}

.tool-card-icon.category-dev {
  background: rgba(71, 85, 105, 0.1);
  color: #475569;
  border-color: rgba(71, 85, 105, 0.22);
}

[data-theme="dark"] .tool-card-icon.category-everyday {
  background: rgba(244, 114, 182, 0.14);
  color: #f9a8d4;
  border-color: rgba(244, 114, 182, 0.3);
}

[data-theme="dark"] .tool-card-icon.category-dev {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.32);
}

@media (max-width: 720px) {

  .tool-breadcrumbs,
  .tool-header-badges,
  .footer-editions-row {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 26px), transparent 100%);
  }
  .tool-breadcrumbs.het-cuon,
  .tool-header-badges.het-cuon,
  .footer-editions-row.het-cuon {
    -webkit-mask-image: none;
    mask-image: none;
  }
}

.header-nav {
  min-width: 0;
  flex: 0 1 auto;
  scrollbar-width: none;
}
.header-nav::-webkit-scrollbar { display: none; }
.header-nav > * { flex-shrink: 0; }

@media (min-width: 721px) and (max-width: 1140px) {
  .header-actions { min-width: 0; }
  .cmd-k-trigger {
    flex-shrink: 1;
    min-width: 0;
    padding-left: 0.55rem;
    padding-right: 0.55rem;
    gap: 0;
  }
  .cmd-k-trigger span,
  .cmd-k-shortcut { display: none; }
}

.tool-grid .tool-card { cursor: pointer; position: relative; }

.tool-grid .tool-card .tool-card-action::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}

.tool-grid .tool-card:hover .tool-card-action,
.tool-grid .tool-card:focus-within .tool-card-action {
  color: var(--brand-primary);
  gap: 0.45rem;
  
  transform: none;
}

.tool-grid .tool-card:hover .tool-card-action svg,
.tool-grid .tool-card:focus-within .tool-card-action svg {
  transform: translateX(3px);
  transition: transform 0.15s ease;
}

.tool-grid .tool-card:focus-within {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.tool-grid .tool-card .tool-card-action:focus-visible {
  outline: none;
}

.brand-icon:has(img.brand-img) { background: none; border-radius: 0; }
.brand-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.nav-group { position: relative; display: inline-flex; }

.nav-trigger {
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.nav-caret { transition: transform 0.18s ease; flex-shrink: 0; }

.nav-group:hover .nav-caret,
.nav-group:focus-within .nav-caret,
.nav-group--open .nav-caret { transform: rotate(-180deg); }

.nav-sub {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  z-index: 200;
  min-width: 19rem;
  padding: 0.4rem;
  display: grid;
  gap: 0.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.nav-sub::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -0.6rem;
  height: 0.6rem;
}

.nav-group:hover .nav-sub,
.nav-group:focus-within .nav-sub,
.nav-group--open .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-sub-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.87rem;
  font-weight: 600;
  transition: background 0.13s ease, color 0.13s ease;
}

.nav-sub-link:hover,
.nav-sub-link:focus-visible {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
}

.nav-sub-link.active {
  background: var(--bg-surface-elevated);
  color: var(--brand-primary);
}

.nav-sub-name { flex: 1 1 auto; min-width: 0; }

.nav-sub-count {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.05rem 0.42rem;
  flex-shrink: 0;
}

.nav-group--active .nav-trigger { color: var(--brand-primary); }

.mobile-drawer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.mobile-drawer-heading {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  padding: 0.85rem 0.15rem 0.3rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 0.35rem;
}

.mobile-drawer-links .mobile-drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.mobile-drawer-count {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.05rem 0.42rem;
  flex-shrink: 0;
}

@media (max-width: 860px) {
  .nav-sub {
    left: 0;
    transform: translateX(0) translateY(-4px);
    min-width: 17rem;
  }
  .nav-group:hover .nav-sub,
  .nav-group:focus-within .nav-sub,
  .nav-group--open .nav-sub { transform: translateX(0) translateY(0); }
}

.flagship-card { cursor: pointer; }

.flagship-primary-link::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  z-index: 1;
}

.flagship-card:hover .flagship-primary-link,
.flagship-card:focus-within .flagship-primary-link {
  color: var(--brand-primary-hover);
  transform: none;
}

.flagship-primary-link:hover { transform: none; }

.flagship-card:hover .flagship-primary-link svg,
.flagship-card:focus-within .flagship-primary-link svg {
  transform: translateX(3px);
  transition: transform 0.15s ease;
}

.flagship-card-actions .btn {
  position: relative;
  z-index: 2;
}

.flagship-card:focus-within {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.flagship-card .flagship-primary-link:focus-visible { outline: none; }

:root { --header-height: 4.75rem; }

.brand-logo { gap: 0.7rem; align-items: center; }
.brand-icon {
  width: 3.7rem; height: 3.7rem;
  background: none; border-radius: 0; box-shadow: none;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-img { width: 100%; height: 100%; object-fit: contain; display: block; }

.brand-words { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }

.brand-logo { --wm-muc: #0b3a3e; --wm-vang: #876933; --wm-loe: #d9b25c; }
[data-theme="dark"] .brand-logo { --wm-muc: #f5f4ef; --wm-vang: #a8843c; --wm-loe: #f0d08a; }

.brand-name {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.32rem;
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--wm-muc);
  white-space: nowrap;
}
.brand-tagline {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.66rem;
  line-height: 1.1;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--wm-vang);
  white-space: nowrap;
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-name {
    background-image: linear-gradient(100deg,
      var(--wm-muc) 0%, var(--wm-muc) 40%,
      var(--wm-loe) 50%,
      var(--wm-muc) 60%, var(--wm-muc) 100%);
    background-size: 320% 100%;
    background-position: 100% 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: brand-loe 2.4s ease-in-out 3 both;
  }
  
  .brand-logo:hover .brand-name { animation: brand-loe 1.5s ease-in-out 1 both; }
}
@keyframes brand-loe {
  from { background-position: 100% 0; }
  to   { background-position: 0% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-name, .brand-logo:hover .brand-name { animation: none; background-position: 0 0; }
}

@media (forced-colors: active) {
  .brand-name {
    background-image: none;
    color: CanvasText; -webkit-text-fill-color: CanvasText;
    animation: none;
  }
}

@media (max-width: 1500px) {
  .header-nav .nav-link { padding-left: 0.48rem; padding-right: 0.48rem; }
}

@media (max-width: 1100px) {
  .brand-icon { width: 3.1rem; height: 3.1rem; }
  .brand-name { font-size: 1.16rem; }
  .brand-tagline { font-size: 0.6rem; letter-spacing: 0.14em; }
}
@media (max-width: 860px) {
  .brand-icon { width: 2.7rem; height: 2.7rem; }
  .brand-name { font-size: 1.05rem; }
  .brand-tagline { display: none; }
}
@media (max-width: 480px) {
  .brand-icon { width: 2.35rem; height: 2.35rem; }
  .brand-name { font-size: 0.95rem; }
}

@media (max-width: 360px) {
  .brand-icon { width: 2.1rem; height: 2.1rem; }
  .brand-name { font-size: 0.8rem; }
}

/* ==========================================================================
   KÊNH YOUTUBE Ở CHÂN TRANG — thêm 26/10/2026
   Nút nằm trong `.footer-bottom` (flex, space-between, wrap) nên phải tự
   neo sát khối bản quyền bằng `margin-right:auto`; thiếu nó thì nút rơi
   vào giữa thanh và trông như lạc chỗ.
   ========================================================================== */
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: auto;
}

.footer-yt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.22rem 0.6rem 0.22rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  background: var(--bg-surface-elevated);
  color: var(--text-secondary);
  font-family: var(--font-financial);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.7;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.footer-yt-icon {
  flex-shrink: 0;
  color: #ff0000;
  transition: transform 0.15s ease;
}

.footer-yt-sub {
  padding-left: 0.45rem;
  border-left: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
}

a.footer-yt:hover,
a.footer-yt:focus-visible {
  color: var(--text-primary);
  border-color: #ff0000;
  background: var(--bg-surface);
  text-decoration: none;
}
a.footer-yt:hover .footer-yt-icon { transform: scale(1.1); }
a.footer-yt:hover .footer-yt-sub { color: var(--text-secondary); }

a.footer-yt:focus-visible {
  outline: 2px solid var(--text-muted);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .footer-social { margin-right: 0; }
  .footer-yt { font-size: 0.66rem; padding: 0.2rem 0.5rem 0.2rem 0.38rem; }
}


/* ── Thẻ Rubik ghim đầu trang chủ — làm nổi bật mà không phá hệ bong bóng ── */
.rubik-pin-card {
  position: relative;
  background: linear-gradient(180deg, #f3f7ff 0%, #ffffff 58%);
  box-shadow: 0 0 0 2px #2d5fd1, 0 14px 34px -18px rgba(45,95,209,.55);
}
.rubik-pin-card .flagship-icon-box { background: #2d5fd1; color: #fff; }
.flagship-badge-new {
  background: #2d5fd1; color: #fff; border-color: #2d5fd1;
  letter-spacing: .02em;
}
@media (prefers-reduced-motion: no-preference) {
  .rubik-pin-card { transition: transform .18s ease, box-shadow .18s ease; }
  .rubik-pin-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px #2d5fd1, 0 20px 42px -18px rgba(45,95,209,.6); }
}
