.app-shell {
  position: relative;
}

.app-toast-stack {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.app-toast {
  min-width: 220px;
  max-width: 360px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 12px 14px;
  color: var(--ui-text-on-dark);
  box-shadow: var(--ui-shadow-strong);
  transform: translateY(10px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast-success {
  background: var(--ui-success-bg);
  border-color: var(--ui-success-border);
  color: var(--ui-success-text);
}

.app-toast-error {
  background: var(--ui-error-bg);
  border-color: var(--ui-error-border);
  color: var(--ui-error-text);
}

.app-toast-info {
  background: var(--ui-info-gradient);
  border-color: var(--ui-border-focus);
  color: var(--ui-secondary-strong);
}

.app-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  z-index: 1300;
  pointer-events: none;
  background: transparent;
}

.app-progress-bar {
  width: 0;
  height: 100%;
  opacity: 0;
  background: var(--theme-accent-fill);
  transition: width 0.2s ease, opacity 0.2s ease;
}

.app-progress.is-loading .app-progress-bar {
  width: 55%;
  opacity: 1;
}

.app-progress.is-complete .app-progress-bar {
  width: 100%;
  opacity: 0;
}

.htmx-fragment {
  display: grid;
  gap: var(--ui-gap-6);
}

.htmx-fragment[data-boost="true"] {
  scroll-margin-top: 110px;
}

.theme-link-hover:hover {
  color: var(--theme-primary) !important;
}

.theme-accent-text {
  color: var(--theme-primary) !important;
}

.theme-avatar-fallback {
  background: var(--theme-accent-fill);
  color: var(--ui-text-on-dark);
}

.theme-soft-pill {
  background-color: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
}

.theme-icon-soft {
  background-color: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
}

.theme-chip-hover:hover {
  color: var(--theme-primary) !important;
  border-color: var(--ui-border-focus) !important;
}

.theme-code-pill {
  background: var(--theme-accent-fill);
}

.hub-hero-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hub-hero-signal {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ui-text) 8%, transparent);
}

.seo-editorial-section {
  margin-top: clamp(1rem, 2vw, 1.5rem);
}

.seo-editorial-shell {
  position: relative;
  display: grid;
  gap: clamp(0.9rem, 1.8vw, 1.2rem);
  padding: clamp(1rem, 2.6vw, 1.75rem);
  border-radius: 28px;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-surface) 97%, var(--color-bg));
  border: none;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ui-text) 10%, transparent);
}

.seo-editorial-shell::before {
  content: "";
  position: absolute;
  inset: auto -28px -36px auto;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: var(--ui-surface-glass-strong);
  filter: blur(18px);
  pointer-events: none;
}

.seo-editorial-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.seo-editorial-head-copy {
  display: grid;
  gap: 8px;
}

.seo-editorial-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.seo-editorial-title {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.seo-editorial-panel {
  position: relative;
  z-index: 1;
  padding: clamp(1rem, 2.2vw, 1.55rem);
  border-radius: 22px;
  border: none;
  background: var(--ui-surface-glass-strong);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--ui-text) 8%, transparent);
}

.seo-editorial-panel > :first-child {
  margin-top: 0;
}

.seo-editorial-panel > :last-child {
  margin-bottom: 0;
}

.seo-editorial-panel h2,
.seo-editorial-panel h3 {
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.seo-editorial-panel p,
.seo-editorial-panel ul,
.seo-editorial-panel ol {
  max-width: 70ch;
}

.hub-pathways-shell {
  display: grid;
  gap: clamp(0.9rem, 2vw, 1.25rem);
  padding: clamp(1rem, 2.2vw, 1.5rem);
  border-radius: 26px;
  border: none;
  background: color-mix(in srgb, var(--color-surface) 97%, var(--color-bg));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ui-text) 10%, transparent);
}

.hub-pathways-head {
  display: grid;
  gap: 8px;
  max-width: 60ch;
}

.hub-pathways-head h2,
.hub-pathways-head p {
  margin: 0;
}

.hub-pathways-head h2 {
  font-size: clamp(1.25rem, 2vw, 1.7rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hub-pathways-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
}

.hub-pathways-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 20px;
  border: none;
  background: var(--ui-surface-glass-strong);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--ui-text) 8%, transparent);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hub-pathways-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px color-mix(in srgb, var(--ui-text) 12%, transparent);
}

.hub-pathways-card-copy {
  display: grid;
  gap: 6px;
}

.hub-pathways-card-copy strong,
.hub-pathways-card-copy p {
  margin: 0;
}

.hub-pathways-card-copy strong {
  font-size: 1rem;
  line-height: 1.15;
}

.hub-pathways-card-copy p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ui-text-muted);
}

.hub-pathways-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
  font-size: 1rem;
  font-weight: 800;
  flex-shrink: 0;
}

.compact-hub-pathways {
  display: grid;
  gap: 0.95rem;
  padding: clamp(1rem, 2vw, 1.25rem);
  border-radius: 24px;
  border: none;
  background: color-mix(in srgb, var(--color-surface) 97%, var(--color-bg));
  box-shadow: 0 18px 42px color-mix(in srgb, var(--ui-text) 10%, transparent);
}

.compact-hub-pathways-head {
  display: grid;
  gap: 0.4rem;
}

.compact-hub-pathways-head h2,
.compact-hub-pathways-head p {
  margin: 0;
}

.compact-hub-pathways-head h2 {
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.compact-hub-pathways-head p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ui-text-muted);
}

.compact-hub-pathways-list {
  display: grid;
  gap: 0.7rem;
}

.compact-hub-pathways-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: start;
  padding: 0.9rem 0.95rem;
  border-radius: 18px;
  background: var(--ui-surface-glass);
  border: none;
  color: inherit;
  text-decoration: none;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--ui-text) 8%, transparent);
}

.compact-hub-pathways-item:hover {
  transform: translateY(-1px);
  background: var(--ui-surface-glass-strong);
  box-shadow: 0 16px 32px color-mix(in srgb, var(--ui-text) 12%, transparent);
}

.compact-hub-pathways-copy {
  display: grid;
  gap: 0.35rem;
}

.compact-hub-pathways-copy strong,
.compact-hub-pathways-copy p {
  margin: 0;
}

.compact-hub-pathways-copy strong {
  font-size: 0.98rem;
  line-height: 1.16;
}

.compact-hub-pathways-copy p {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ui-text-muted);
}

.compact-hub-pathways-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.95rem;
  height: 1.95rem;
  border-radius: 999px;
  background: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
  font-size: 0.95rem;
  line-height: 1;
  flex-shrink: 0;
}

.site-user-menu {
  position: relative;
}

.site-user-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--component-button-height);
  padding: calc(6px * var(--space-scale)) calc(10px * var(--space-scale));
  border: 1px solid var(--ui-border-strong);
  border-radius: 999px;
  background: var(--ui-surface-soft);
  color: var(--ui-text);
  font-size: 0.86rem;
  font-weight: 700;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-user-toggle:hover {
  border-color: var(--ui-border-focus);
  background: var(--ui-surface-soft-strong);
  transform: translateY(-1px);
}

.site-user-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.site-user-avatar img,
.site-user-avatar-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
}

.site-user-avatar img {
  object-fit: cover;
}

.site-user-avatar-fallback {
  font-size: 0.9rem;
  font-weight: 800;
}

.site-user-name {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-user-caret {
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.site-user-menu.is-open .site-user-caret {
  transform: rotate(180deg);
}

.site-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--ui-border-soft);
  background: var(--ui-surface-glass-strong);
  box-shadow: var(--ui-shadow-strong);
  backdrop-filter: blur(16px);
  display: grid;
  gap: 4px;
  z-index: 80;
}

.site-user-dropdown[hidden] {
  display: none !important;
}

.site-user-menu-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--ui-text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-user-menu-link:hover {
  background: var(--ui-surface-soft-strong);
  color: var(--ui-accent-text);
}

@media (max-width: 767px) {
  .hub-hero-signals {
    gap: 8px;
  }

  .hub-hero-signal {
    min-height: 32px;
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .seo-editorial-shell {
    border-radius: 22px;
    padding: 1rem;
  }

  .seo-editorial-panel {
    border-radius: 18px;
    padding: 1rem;
  }

  .hub-pathways-shell {
    border-radius: 20px;
    padding: 1rem;
  }
}

.site-mobile-user {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ui-border-soft);
}

.site-mobile-user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.site-mobile-user-meta {
  display: grid;
  gap: 2px;
}

.site-mobile-user-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream-muted);
}

.site-mobile-user-links {
  display: grid;
  gap: 2px;
}

.state-pill-expired {
  background-color: var(--ui-error-bg);
  color: var(--ui-error-text);
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--color-focus, var(--theme-primary));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
