/* ==========================================================================
   Minimal Top Bar & Focused Lean Hero
   ========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}

.topbar-logo {
  width: 38px;
  height: 38px;
  display: block;
  border-radius: 11px;
  filter: drop-shadow(0 6px 12px rgba(37, 99, 235, 0.24));
}

.topbar-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Compact Topbar Language Switcher */
.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-select-icon {
  position: absolute;
  left: 11px;
  pointer-events: none;
  opacity: 0.85;
}

.lang-select-wrap select.lang-select {
  width: auto;
  min-width: 108px;
  height: var(--ctrl-md);
  padding: 0 30px 0 33px;
  border-radius: var(--radius-md);
  background-color: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-xs), var(--card-sheen);
}

/* 3-Mode Icon Segmented Theme Control (Light / Dark / System) */
.theme-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: var(--ctrl-md);
  padding: 3px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
}

.theme-seg-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  opacity: 0.62;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease, transform 0.14s var(--ease-out);
}

.theme-seg-btn:hover {
  opacity: 0.95;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
}

.theme-seg-btn.active {
  opacity: 1;
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm), var(--card-sheen);
}

[data-theme="dark"] .theme-seg-btn.active {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.theme-cycle-mobile {
  display: none;
}

/* Lean Centered Hero */
.hero-lean {
  text-align: center;
  max-width: 100%;
  margin: 0 auto var(--space-6);
  padding: 0;
}

.hero-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: clamp(24px, 3.4vw, 33px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: var(--space-3);
}

.hero-swap-icon {
  width: 30px;
  height: 30px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.hero-subtitle {
  max-width: 740px;
  margin: 0 auto var(--space-4);
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.65;
}

.hero-subtitle strong {
  color: var(--text);
  font-weight: 700;
}

/* Compact Single-Row Trust Strip on Desktop */
.trust-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: var(--space-2);
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  box-shadow: var(--shadow-xs), var(--card-sheen);
  transition: border-color 0.16s ease, transform 0.16s var(--ease-out);
}

.trust-pill-text {
  display: inline;
  white-space: nowrap;
}

.trust-pill:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.trust-pill strong {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 900px) and (min-width: 641px) {
  .trust-strip {
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  .topbar {
    margin-bottom: 10px;
  }
  .topbar-brand {
    gap: var(--space-2);
    min-width: 0;
  }
  .topbar-logo {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .topbar-name {
    font-size: 15.5px;
    white-space: nowrap;
  }
  .topbar-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .topbar .badge {
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
    gap: 5px;
  }
  .topbar .badge-extra {
    display: none;
  }
  .topbar .btn-icon {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
  }
  .topbar .lang-select-wrap,
  .topbar .theme-segmented {
    display: none;
  }
  .topbar .theme-cycle-mobile {
    display: grid;
  }

  /* Keep Brand + Intro compact (~25%-30% of mobile viewport) with zero clipping in any language */
  .hero-lean {
    margin-bottom: var(--space-3);
    padding: 0;
  }
  .hero-brand-repeat {
    display: none;
  }
  .hero-title {
    font-size: clamp(16.5px, 4.7vw, 19.5px);
    gap: 6px;
    line-height: 1.25;
    margin-bottom: 6px;
    max-width: 100%;
  }
  .hero-swap-icon {
    width: 21px;
    height: 21px;
  }
  .hero-subtitle {
    font-size: 12.5px;
    line-height: 1.45;
    margin-bottom: 10px;
    word-break: break-word;
  }
  .hero-sub-extra {
    display: none;
  }
  .trust-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
  }
  .trust-pill {
    justify-content: center;
    height: 28px;
    padding: 0 8px;
    gap: 5px;
    font-size: 11.5px;
    min-width: 0;
    overflow: hidden;
  }
  .trust-pill-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .trust-pill strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .trust-pill .ui-icon {
    width: 14px;
    height: 14px;
  }
  .trust-pill-detail {
    display: none;
  }
}

@media (max-width: 480px) {
  .topbar .badge {
    display: none;
  }
}
