:root {
  --bg: #f8fafc;
  --bg-gradient-top: #eff6ff;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #dbeafe;
  --border: #e2e8f0;
  --success: #059669;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --alert-error-bg: #fee2e2;
  --alert-error-text: #b91c1c;
}

html[data-theme="dark"] {
  --bg: #0f172a;
  --bg-gradient-top: #0c1929;
  --bg-card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #1e3a5f;
  --border: #334155;
  --success: #34d399;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --alert-error-bg: #450a0a;
  --alert-error-text: #fca5a5;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Component display rules (.btn, .form-page, ...) otherwise beat the UA [hidden] rule. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-gradient-top) 0%, var(--bg) 40%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.site-header {
  display: grid;
  /* Equal side tracks keep .nav visually centered after logo-only branding */
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "start nav session";
  align-items: center;
  column-gap: 1rem;
  row-gap: 0.65rem;
  padding: 0.75rem 0;
}

.site-header-start {
  grid-area: start;
  justify-self: start;
}

.site-header-session {
  grid-area: session;
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 4rem;
}

.session-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1;
  flex-shrink: 0;
  text-transform: uppercase;
  user-select: none;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.session-avatar:hover {
  background: var(--accent);
  color: #fff;
}

.session-avatar[aria-current="page"] {
  box-shadow: 0 0 0 2px var(--accent);
}

.session-logout {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
}

.session-logout:hover {
  color: var(--accent);
}

.site-header-start {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  min-height: 4rem;
}

.site-header-session .theme-toggle {
  order: -1;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

.theme-toggle svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.theme-toggle .theme-icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .theme-icon-moon {
  display: block;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  line-height: 0;
}

.logo-mark {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  border-radius: 0.35rem;
  line-height: 0;
  flex-shrink: 0;
}

.logo-mark img {
  height: 4rem;
  width: auto;
  display: block;
}

.logo-mark::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 35%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0.1) 65%,
    transparent 100%
  );
  transform: skewX(-18deg);
  pointer-events: none;
  opacity: 0;
}

.logo-mark:hover::after {
  opacity: 1;
  animation: logo-shine 1.05s ease;
}

@keyframes logo-shine {
  from {
    left: -120%;
  }
  to {
    left: 140%;
  }
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "start session"
      "nav nav";
    row-gap: 0.5rem;
  }

  .site-header-start,
  .site-header-session,
  .nav {
    min-height: unset;
  }

  .site-header-session {
    align-self: start;
    min-height: unset;
    padding-top: 0.35rem;
  }

  .nav {
    width: 100%;
    justify-self: stretch;
    justify-content: center;
  }
}

.nav {
  grid-area: nav;
  justify-self: center;
  display: flex;
  gap: 0.75rem 1rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 4rem;
}

.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.2;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--accent);
}

.nav a[data-nav-signup] {
  color: var(--text-muted);
  font-weight: 500;
}

.nav a[data-nav-signup]:hover {
  color: var(--accent);
}

.nav a.nav-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.nav-user {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--accent);
  border: 2px solid var(--accent-soft);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.btn-danger {
  background: transparent;
  color: var(--alert-error-text);
  border: 2px solid var(--alert-error-text);
}

.btn-danger:hover {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

.hero {
  text-align: center;
  padding: 3.5rem 0 4rem;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
}

.badge strong {
  color: var(--success);
  display: block;
  font-size: 1rem;
}

.trust-callout {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--success) 12%, var(--bg-card)),
    var(--bg-card)
  );
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
  border-left: 4px solid var(--success);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 0 0 2rem;
  box-shadow: var(--shadow);
  text-align: center;
}

.trust-callout-text {
  margin: 0 auto;
  max-width: 42rem;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem);
  line-height: 1.55;
  color: var(--text);
}

.trust-callout-text strong {
  color: var(--success);
  font-size: 1.1em;
}

.model-showcase {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 0 0 2rem;
  box-shadow: var(--shadow);
}

.model-showcase h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  text-align: center;
  line-height: 1.25;
}

.model-showcase-lead {
  margin: 0 auto 2rem;
  max-width: 46rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.model-showcase-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.model-showcase-col h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.model-showcase-list {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.model-showcase-list li {
  margin: 0 0 0.85rem;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.model-showcase-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
}

.model-showcase-list strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.15rem;
}

.model-showcase-link {
  margin: 0;
  font-size: 0.9rem;
}

.model-showcase-teaser {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.model-tier-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.model-tier-card {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.85rem 1rem;
}

.model-tier-card h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  color: var(--accent);
}

.model-tier-purpose {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.model-tier-examples {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono, ui-monospace, monospace);
}

.model-showcase-languages {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.model-showcase-languages strong {
  color: var(--text);
}

.model-showcase-note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.model-showcase-cta {
  text-align: center;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.model-showcase-cta .btn {
  margin: 0 0.35rem 0.5rem;
}

.model-showcase-cta-note {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .model-showcase-grid {
    grid-template-columns: 1fr;
  }
}

.model-tier-matrix {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 0 0 2rem;
  box-shadow: var(--shadow);
}

.model-tier-matrix h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  text-align: center;
}

.model-tier-matrix-lead {
  margin: 0 auto 1.5rem;
  max-width: 40rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.model-tier-matrix-wrap {
  overflow-x: auto;
  margin-bottom: 1rem;
}

.model-tier-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.model-tier-matrix-table th,
.model-tier-matrix-table td {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  text-align: left;
}

.model-tier-matrix-table thead th {
  background: color-mix(in srgb, var(--accent) 8%, var(--bg));
  color: var(--text);
  font-weight: 600;
}

.model-tier-matrix-table tbody th {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.model-tier-matrix-table td {
  color: var(--text-muted);
}

.model-tier-matrix-note {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.privacy-promise {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.25rem;
  margin: 0 0 1rem;
  box-shadow: var(--shadow);
}

.privacy-promise h2 {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  text-align: center;
}

.privacy-promise-lead {
  margin: 0 auto 1.5rem;
  max-width: 42rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.privacy-promise-list {
  margin: 0 auto 1.25rem;
  padding: 0;
  list-style: none;
  max-width: 40rem;
}

.privacy-promise-list li {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
  position: relative;
  color: var(--text-muted);
}

.privacy-promise-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--success);
}

.privacy-promise-list strong {
  color: var(--text);
  display: block;
  margin-bottom: 0.2rem;
}

.privacy-promise-note {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 4rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0 3rem;
}

.pricing-grid-paid {
  grid-template-columns: minmax(240px, 280px) 1fr;
  align-items: start;
}

.pricing-paid-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .pricing-grid-paid {
    grid-template-columns: 1fr;
  }
}

.price-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.price-card.featured {
  border-color: var(--accent);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.15);
}

.price-card h3 {
  margin: 0 0 0.25rem;
}

.founding-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  margin-left: 0.5rem;
  vertical-align: middle;
}

.founding-note {
  font-size: 0.82rem;
  color: var(--accent);
  margin: 0.35rem 0 0;
  font-weight: 500;
}

.founding-note code {
  font-weight: 700;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0.5rem 0;
}

.price span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}

.price-card ul {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.5rem;
  flex: 1;
}

.price-card li {
  padding: 0.35rem 0;
  color: var(--text-muted);
}

.price-card li::before {
  content: "✓ ";
  color: var(--success);
  font-weight: 700;
}

.form-page {
  max-width: 520px;
  margin: 2rem auto 4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-page h1 {
  margin-top: 0;
  font-size: 1.5rem;
}

label {
  display: block;
  font-weight: 600;
  margin: 1rem 0 0.35rem;
  font-size: 0.9rem;
}

input,
select {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-card);
  color: var(--text);
}

.payment-methods {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.payment-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.payment-option.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.payment-option input {
  width: auto;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.alert-info {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.alert-error {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
}

html[data-theme="dark"] .btn-primary {
  box-shadow: 0 2px 12px rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] .price-card.featured {
  box-shadow: 0 8px 32px rgba(96, 165, 250, 0.2);
}

.legal {
  padding: 2rem 0 4rem;
  max-width: 720px;
}

.legal h1 {
  font-size: 1.75rem;
}

.legal h2 {
  font-size: 1.15rem;
  margin-top: 2rem;
}

.legal h3 {
  font-size: 1rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
}

.legal ul {
  padding-left: 1.25rem;
}

.contact-page {
  max-width: 840px;
}

.contact-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.contact-highlight {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-elevated, rgba(0, 0, 0, 0.03));
}

html[data-theme="dark"] .contact-highlight {
  background: rgba(255, 255, 255, 0.04);
}

.contact-highlight h2 {
  margin-top: 0;
}

.contact-note {
  margin-bottom: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.contact-card {
  padding: 1.15rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.contact-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text);
}

.contact-card p {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.contact-card p:last-child {
  margin-bottom: 0;
}

.faq-page .faq-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 42rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.faq-list {
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  background: var(--bg-card);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
}

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

.faq-item summary::after {
  content: "+";
  float: right;
  font-weight: 400;
  color: var(--text-muted);
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
}

.faq-answer {
  padding: 1rem 1.25rem 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.faq-answer p {
  margin: 0 0 0.75rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
}

.faq-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.faq-table th,
.faq-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
}

.faq-table th {
  background: var(--bg);
}

.site-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer a {
  margin: 0 0.5rem;
}

.billing-toggle {
  display: inline-flex;
  gap: 0.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem;
  margin-top: 1rem;
}

.billing-option {
  border: none;
  background: transparent;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}

.billing-option.active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.billing-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--success);
  margin-left: 0.25rem;
}

.price-save {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
  margin-top: 0.25rem;
}

.profile-page .lead {
  font-size: 1rem;
  text-align: left;
  margin: 0.5rem 0 0;
}

.profile-hero {
  padding: 1.5rem 0 0.5rem;
}

.profile-hero h1 {
  margin: 0;
  font-size: 1.75rem;
}

.profile-section {
  margin: 2rem 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--border);
}

.profile-section h2 {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
}

.profile-section-note {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 36rem;
}

.profile-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.profile-form-row .profile-field {
  flex: 1 1 12rem;
}

.profile-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.profile-field span {
  font-weight: 600;
  color: var(--text-muted);
}

.profile-field input {
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
}

.profile-field-narrow {
  flex: 0 1 5rem;
  max-width: 6rem;
}

.alert-error {
  background: color-mix(in srgb, var(--danger, #c0392b) 12%, transparent);
  border-color: var(--danger, #c0392b);
  color: var(--text);
}

.profile-dl {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 0.75rem 1rem;
  margin: 0;
}

.profile-dl dt {
  font-weight: 600;
  color: var(--text-muted);
}

.profile-dl dd {
  margin: 0;
}

.profile-key-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.profile-key-masked {
  word-break: break-all;
}

.profile-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border, #c8ccd4);
  border-radius: 6px;
  background: var(--surface-elevated, var(--surface, #fff));
  color: var(--text-muted);
  cursor: pointer;
  vertical-align: middle;
}

.profile-copy-btn:hover {
  color: var(--text);
  border-color: var(--accent, #4a7fc1);
}

.profile-copy-btn:focus-visible {
  outline: 2px solid var(--accent, #4a7fc1);
  outline-offset: 2px;
}

.profile-copy-btn svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.profile-copy-btn--done {
  color: var(--success, #2e7d32);
  border-color: var(--success, #2e7d32);
}

.profile-access {
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.profile-layout {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: 2rem 2.5rem;
  align-items: start;
  padding: 0.5rem 0 2rem;
}

.profile-sidebar {
  position: sticky;
  top: 1rem;
}

.profile-sidebar-title {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profile-nav-link {
  display: block;
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.profile-nav-link:hover {
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.profile-nav-link.is-active {
  font-weight: 600;
  background: color-mix(in srgb, var(--accent, #2563eb) 14%, transparent);
  color: var(--accent, #2563eb);
}

.profile-main {
  min-width: 0;
}

.profile-section-first {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.profile-models-table-wrap {
  overflow-x: auto;
  margin-top: 0.75rem;
}

.profile-models-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.profile-models-table th,
.profile-models-table td {
  border: 1px solid var(--border);
  padding: 0.55rem 0.7rem;
  text-align: left;
  vertical-align: middle;
}

.profile-models-table th {
  background: var(--bg);
  font-weight: 600;
}

.profile-models-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg));
}

.profile-models-table code {
  font-size: 0.88em;
  word-break: break-all;
}

.profile-models-muted {
  color: var(--text-muted);
}

.profile-models-cards-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.profile-model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.profile-model-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.profile-model-card-name {
  font-size: 1rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.profile-model-card-name code {
  font-size: 0.9em;
  word-break: break-all;
  font-weight: 400;
  color: var(--text-muted);
}

.profile-model-card-name .profile-copy-btn {
  flex-shrink: 0;
}

.profile-model-card-best {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.profile-model-card-best strong {
  color: var(--text);
  font-weight: 600;
}

.profile-model-card-desc {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text);
  margin: 0;
}

.profile-model-card-analogy {
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
  border-left: 3px solid var(--border);
  padding-left: 0.6rem;
  font-style: italic;
  margin: 0;
}

.profile-model-tier {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-card));
  color: var(--accent);
}

.profile-model-tier--fast {
  background: rgba(34, 197, 94, 0.12);
  color: rgb(34, 197, 94);
}

.profile-model-tier--standard {
  background: rgba(59, 130, 246, 0.12);
  color: rgb(59, 130, 246);
}

.profile-model-tier--premium {
  background: rgba(168, 85, 247, 0.12);
  color: rgb(168, 85, 247);
}

.profile-dl-overview dd {
  white-space: pre-line;
}

.profile-address-display {
  line-height: 1.5;
}

.profile-empty {
  color: var(--text-muted);
}

.profile-overview-links {
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
}

.profile-cta-row {
  justify-content: flex-start;
  margin-top: 1rem;
}

.subscription-dialog {
  width: min(38rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: auto;
}

.subscription-dialog::backdrop {
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(2px);
}

.subscription-dialog-card {
  padding: 1.5rem;
}

.subscription-dialog-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  line-height: 1.3;
}

.subscription-dialog-card p {
  margin: 0 0 1rem;
}

.subscription-founder-warning {
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--alert-error-text);
  border-radius: 6px;
  background: var(--alert-error-bg);
}

.subscription-dialog textarea {
  width: 100%;
  min-height: 6rem;
  resize: vertical;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
}

.subscription-dialog fieldset {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.subscription-dialog legend {
  padding: 0 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.subscription-dialog fieldset label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.5rem 0 0;
  font-weight: 400;
}

.subscription-dialog input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.subscription-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.subscription-dialog .btn:disabled,
#subscription-cancel-open:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

@media (max-width: 520px) {
  .subscription-dialog {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }

  .subscription-dialog-card {
    padding: 1.1rem;
  }

  .subscription-dialog-actions {
    flex-direction: column;
  }

  .subscription-dialog-actions .btn {
    width: 100%;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .profile-sidebar {
    position: static;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
}

@media (max-width: 520px) {
  .profile-dl {
    grid-template-columns: 1fr;
  }
  .profile-dl dt {
    margin-top: 0.5rem;
  }
}

/* Admin dashboard */
.admin-hero {
  padding: 1.5rem 0 1rem;
}

.admin-hero h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.admin-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}

.admin-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.admin-panel h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.admin-subheading {
  margin: 1.5rem 0 0.75rem;
  font-size: 1rem;
  font-weight: 600;
}

.admin-subheading:first-of-type {
  margin-top: 0;
}

.admin-secret-hint {
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-left: 0.35rem;
}

.admin-secret-hint.is-saved {
  color: var(--success);
}

.admin-secret-hint.is-empty {
  color: var(--alert-error-text);
}

.admin-secret-saved {
  font-family: var(--font);
  letter-spacing: 0.12em;
}

.admin-webhook-dl code {
  word-break: break-all;
}

.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1rem;
}

.admin-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  min-width: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.admin-stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.admin-stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.admin-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.admin-per-page-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-per-page-group select {
  padding: 0.25rem 0.4rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.admin-page-btns {
  display: flex;
  gap: 0.5rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  user-select: none;
}

.admin-table th.sortable {
  cursor: pointer;
}

.admin-table th.sortable:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.admin-table th.sort-asc::after,
.admin-table th.sort-desc::after {
  content: "";
  margin-left: 0.3em;
  display: inline-block;
  width: 0;
  height: 0;
}

.admin-table th.sort-asc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 4px solid var(--text-muted);
}

.admin-table th.sort-desc::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--text-muted);
}

.admin-table th[draggable="true"] {
  padding-right: 0.25rem;
}

.admin-table th.dragging {
  opacity: 0.5;
  background: var(--accent-soft);
}

.admin-table th.drag-over {
  border-left: 3px solid var(--accent);
}

/* Column resize handles */
.admin-table th {
  position: relative;
}

.admin-table th .resize-handle {
  position: absolute;
  right: -3px;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 2;
}

.admin-table th .resize-handle:hover,
.admin-table th .resize-handle.active {
  background: var(--accent);
  opacity: 0.6;
}

.admin-table th.resizing {
  user-select: none;
  cursor: col-resize;
}

.admin-table th.resizing,
.admin-table th.resizing * {
  pointer-events: none;
}

.admin-table tbody tr:hover {
  background: var(--accent-soft);
}

.admin-users-table tbody tr.admin-user-row {
  cursor: pointer;
}

.admin-users-table th.admin-users-actions-col,
.admin-users-table td.admin-users-actions-col {
  position: sticky;
  right: 0;
  z-index: 1;
  background: var(--bg-card);
  box-shadow: -6px 0 10px -8px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.admin-table tbody tr.admin-user-row:hover td.admin-users-actions-col {
  background: var(--accent-soft);
}

.admin-theme-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.admin-theme-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.admin-theme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.admin-toggle-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 28rem;
}

.admin-toggle-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.admin-test-row {
  margin: 0.75rem 0 0.35rem;
}

.admin-test-feedback {
  margin: 0.35rem 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.admin-test-feedback.is-info {
  background: var(--accent-soft);
  color: var(--text);
  border: 1px solid var(--border);
}

.admin-test-feedback.is-error {
  background: var(--alert-error-bg);
  color: var(--alert-error-text);
  border: 1px solid var(--alert-error-text);
}

.admin-test-feedback.is-busy {
  background: var(--bg-card);
  color: var(--text-muted);
  border: 1px dashed var(--border);
}

.admin-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem !important;
}

.admin-user-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-user-editor-header h2 {
  margin: 0;
}

.admin-user-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.admin-user-fieldset {
  margin: 1.25rem 0 0;
  padding: 1rem 1rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-user-fieldset legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

.admin-billing-profile {
  margin-top: 0.5rem;
}

.admin-billing-dl {
  display: grid;
  grid-template-columns: minmax(9rem, 11rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0.75rem 0 0;
}

.admin-billing-dl dt {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.admin-billing-dl dd {
  margin: 0;
  word-break: break-word;
}

.admin-billing-history {
  margin-top: 0.75rem;
}

.admin-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

.btn-sm {
  padding: 0.25rem 0.55rem;
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .admin-user-form-grid {
    grid-template-columns: 1fr;
  }
}

.tier-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: lowercase;
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.tier-pill.tier-pro,
.tier-pill.tier-starter,
.tier-pill.tier-standard {
  background: rgba(5, 150, 105, 0.15);
  color: var(--success);
}

.tier-pill.tier-power {
  background: rgba(168, 85, 247, 0.15);
  color: #a855f7;
}

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

.tier-pill.tier-trial {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent);
}

/* Profile token usage dashboard */
.usage-dashboard {
  max-width: 960px;
}

.usage-dashboard-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.usage-dashboard h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
}

.usage-period-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.usage-cycle-select {
  min-width: 220px;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.usage-summary {
  margin-bottom: 1.75rem;
}

.usage-summary-total {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.usage-used {
  color: var(--text);
}

.usage-limit {
  color: var(--text-muted);
  font-size: 1.35rem;
  font-weight: 500;
}

.usage-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 0.65rem;
  max-width: 420px;
}

.usage-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.usage-progress-bar.is-over {
  background: var(--alert-error-text);
}

.usage-summary-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.usage-loading {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.usage-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}

.usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.usage-table th,
.usage-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.usage-table thead th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
}

.usage-table tfoot th,
.usage-table tfoot td {
  font-weight: 600;
  border-bottom: none;
  border-top: 1px solid var(--border);
}

.usage-table tbody tr:hover {
  background: var(--accent-soft);
}

.usage-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.usage-empty {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem !important;
}

.usage-footnote {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

@media (max-width: 640px) {
  .usage-summary-total {
    font-size: 1.55rem;
  }

  .usage-limit {
    font-size: 1.05rem;
  }
}

/* Welcome walkthrough (/onboarding.html) */
.onboarding-page {
  max-width: 720px;
  margin: 1.5rem auto 3rem;
}

.onboarding-progress {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.75rem 1.25rem;
}

.onboarding-card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  line-height: 1.25;
}

.onboarding-body {
  color: var(--text);
  font-size: 1rem;
}

.onboarding-body p,
.onboarding-body ul,
.onboarding-body ol {
  margin: 0 0 0.85rem;
}

.onboarding-body ul,
.onboarding-body ol {
  padding-left: 1.25rem;
}

.onboarding-body code {
  font-size: 0.92em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--accent-soft);
}

.onboarding-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0 1rem;
  font-size: 0.92rem;
}

.onboarding-table th,
.onboarding-table td {
  text-align: left;
  padding: 0.45rem 0.55rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.onboarding-table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.onboarding-actions-spacer {
  flex: 1 1 auto;
  min-width: 0.5rem;
}

.onboarding-note {
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.onboarding-prompt-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.85rem 0 1rem;
}

.onboarding-prompt-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 0.85rem 1rem;
}

.onboarding-prompt-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.onboarding-prompt-text {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.onboarding-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.onboarding-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.85rem 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: pointer;
}

.onboarding-check input {
  margin-top: 0.2rem;
  flex: 0 0 auto;
}

@media (max-width: 560px) {
  .onboarding-card {
    padding: 1.15rem 1.1rem 1rem;
  }

  .onboarding-actions-spacer {
    display: none;
  }
}

/* Achievements dashboard */
.achievements-summary {
  margin-top: 0.5rem;
}

.achievements-xp {
  margin: 0 0 0.35rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.achievements-xp-value {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}

.achievements-xp-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.achievements-overall-note {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.achievements-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  max-width: 420px;
  margin-bottom: 0.25rem;
}

.achievements-progress--category {
  margin: 0.5rem 0 1rem;
  max-width: 100%;
}

.achievements-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.35s ease;
}

.achievements-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.achievements-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--bg-card);
  outline: none;
}

.achievements-item:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
}

.achievements-item--completed {
  border-color: color-mix(in srgb, var(--success, #22c55e) 45%, var(--border));
}

.achievements-item--locked {
  opacity: 0.72;
}

.achievements-item--locked .achievements-item-title {
  color: var(--text-muted);
}

.achievements-item-title {
  font-weight: 600;
  margin: 0 0 0.2rem;
}

.achievements-item-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.achievements-item-desc {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}

.achievements-item--empty {
  border-style: dashed;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .achievements-xp-value {
    font-size: 1.7rem;
  }

  .achievements-item {
    padding: 0.75rem 0.85rem;
  }
}

.achievements-item[role="button"] {
  cursor: pointer;
}

.achievements-guide-highlight {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}

.achievements-prefs {
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 36rem;
}

.achievements-pref {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0.65rem;
  margin: 0;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
}

.achievements-pref input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.15rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--accent);
}

.achievements-xp-pulse {
  animation: achievementsXpPulse 0.45s ease;
}

.achievements-item--just-unlocked {
  animation: achievementsUnlockPop 0.55s ease;
}

@keyframes achievementsXpPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes achievementsUnlockPop {
  0% { transform: scale(0.98); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  60% { transform: scale(1.01); box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 18%, transparent); }
  100% { transform: scale(1); box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .achievements-progress-bar {
    transition: none;
  }

  .achievements-xp-pulse,
  .achievements-item--just-unlocked {
    animation: none;
  }
}

@media (max-width: 480px) {
  .achievements-pref {
    font-size: 0.88rem;
  }

  .achievements-progress {
    max-width: 100%;
  }
}

.achievements-open-chat {
  margin: 0.75rem 0 0;
}
