/* ==========================================================================
   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;
}

.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-converters {
  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-converters {
  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;
}

.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;
  transition: opacity 0.15s ease;
}

.cmd-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.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(5, 1fr);
  gap: 1rem;
}

@media (max-width: 1100px) {
  .footer-trust-grid {
    grid-template-columns: repeat(3, 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: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-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;
}

/* ==========================================================================
   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 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;
}


/* ==========================================================================
   VÁ TRÀN NGANG TRÊN ĐIỆN THOẠI — thêm 20/09/2026
   --------------------------------------------------------------------------
   Đo được: .header-inner là flex và mọi con đều flex-shrink:0, nên header
   luôn đòi 566px (logo 265 + nhóm nút 283 + nút menu 18) trong khi màn
   điện thoại chỉ 390px → tài liệu tràn 221px.
   body{overflow-x:hidden} có sẵn chỉ GIẤU vết tràn, không chữa nguyên nhân:
   khách vẫn mất chữ ở mép phải.
   Cách chữa: bỏ phần CHỮ trang trí, giữ nguyên mọi chức năng (kính lúp vẫn
   mở được ô tìm kiếm, nút ngôn ngữ vẫn còn cờ + mã).
   ========================================================================== */
@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; }          /* thẻ "EDITION" thuần trang trí */
  .header-actions { gap: 0.35rem; }
  .cmd-k-trigger { padding: 0 0.6rem; }
  .cmd-k-trigger > span[data-i18n] { display: none; }   /* còn icon kính lúp */
  .cmd-k-shortcut { display: none; }                    /* phím ⌘K vô nghĩa trên điện thoại */
}
@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; }      /* giữ lá cờ là đủ nhận biết */
}

/* ── 320px: đừng để ô nhập và nút nhảy ra ngoài mép (thêm 20/09/2026) ── */
@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; }
}

/* ── Màn rất hẹp (≤360px: iPhone SE đời đầu, Galaxy Fold gập) ──
   Đo tại 320px: logo 141 + nhóm nút 164 + khoảng cách 8 = 313px nội dung,
   nhưng khung trừ lề chỉ còn 288px → thiếu 26px.
   Bù bằng cách thu lề trang và các khoảng đệm, KHÔNG bỏ nút nào:
   kính lúp, ngôn ngữ, sáng/tối, menu đều còn nguyên. */
@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; }
}

/* ── Trang /embed trên điện thoại ──
   Lưới đã gom về 1 cột ở ≤860px, nhưng rãnh `1fr` vẫn có SÀN min-content:
   nội dung bên trong đòi 382px nên rãnh không chịu co dưới mức đó → tràn.
   `minmax(0, 1fr)` bỏ cái sàn đó đi; min-width:0 làm điều tương tự cho ô con. */
@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; }
  /* đoạn mã nhúng dài không được kéo giãn cả trang */
  .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; }
}

/* ══════════════════════════════════════════════════════════════════════════
   VÁ ĐỢT 2 — 20/09/2026, sau khi NHÌN ảnh chụp thật trên iPhone 390px
   (phép đo tràn-ngang báo sạch hết, nhưng mắt nhìn vẫn xấu → thước đo cũ
    đo sai thứ cần đo)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. Hộp "ON THIS PAGE" ĐÈ LÊN BÀI VIẾT ──
   Trên máy tính nó là cột bên, `position:sticky` là đúng. Nhưng ở điện thoại
   lưới gom còn 1 cột nên nó nằm TRÊN bài viết — vẫn dính, thành ra chữ bài
   viết trôi phía sau tấm thẻ trắng. Phải trả nó về dòng chảy bình thường. */
@media (max-width: 860px) {
  .sticky-doc-nav {
    position: static;
    top: auto;
    margin-bottom: 1.5rem;
  }
}

/* ── 2. Thanh tìm kiếm ở đầu trang bị cắt chữ ──
   Icon kính lúp bị bóp còn một chấm, chữ gợi ý bị cắt ngang giữa từ. */
@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;   /* cắt gọn bằng dấu … thay vì cụt ngang từ */
  }
  .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; }   /* còn mũi tên, đủ hiểu */
  .hero-search-btn { padding: 0.55rem 0.75rem; }
}

/* ── 3. Nhãn tròn đầu trang: chấm xanh rơi lạc khỏi chữ ──
   Chữ dài xuống 2 dòng, `align-items:center` đẩy chấm ra giữa chiều cao nên
   nhìn như bị rớt ra ngoài. Neo nó vào DÒNG ĐẦU. */
@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; }
}

/* Ngôn ngữ chưa dịch đủ — hiện mờ + nhãn "Soon" (thêm 20/09/2026) */
.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);
}

/* ── Bảng gợi ý tìm kiếm tức thì (thêm 20/09/2026) ──
   Trước đây kết quả nằm cách ô tìm kiếm 2.242px nên khách gõ xong không
   thấy gì. Bảng này neo ngay dưới ô nhập. */
.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; }
}

/* Kết quả hộp ⌘K giờ là thẻ <a>, cần bỏ gạch chân và giữ nguyên dáng cũ */
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; }

/* ── Giữ chỗ trước cho hàng nút lọc (thêm 20/09/2026) ──
   `#quick-chips-container` RỖNG trong HTML, JS mới đổ 9 nút vào. Ô đang cao
   0px bỗng cao 73px (máy tính) / 194px (điện thoại) → đẩy toàn bộ phần dưới
   xuống, đo được CLS 0,102 — vượt ngưỡng "Tốt" 0,1 của Core Web Vitals.
   Số đo lấy từ trang thật chứ không ước lượng. */
#quick-chips-container { min-height: 73px; }
@media (max-width: 700px) { #quick-chips-container { min-height: 194px; } }
