/* ==========================================================================
   COMPONENTS – Buttons, Cards, Chips, Inputs, Tags
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: var(--text-base);
  font-family: var(--font-headline);
  letter-spacing: -0.01em;
  transition: all var(--t-base);
  white-space: nowrap;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 2px solid var(--tertiary);
  outline-offset: 3px;
}

/* Primary – gradient */
.btn--primary {
  background: linear-gradient(135deg, var(--primary-container), var(--primary));
  color: var(--on-primary-fixed);
  box-shadow: 0 4px 16px rgba(46, 91, 255, 0.25);
}
.btn--primary:hover {
  box-shadow: 0 0 0 4px rgba(0, 220, 229, 0.20), 0 4px 16px rgba(46, 91, 255, 0.35);
  color: var(--on-primary-fixed);
  transform: translateY(-1px);
}
.btn--primary:active {
  transform: scale(0.97);
}

/* Secondary – ghost */
.btn--secondary {
  background-color: rgba(45, 52, 73, 0.50);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(142, 144, 162, 0.20);
  color: var(--primary);
}
.btn--secondary:hover {
  background-color: var(--surface-container-highest);
  box-shadow: var(--glow-tertiary);
  color: var(--primary);
}

/* Outline/ghost tertiary */
.btn--outline {
  background: transparent;
  border: 1px solid rgba(67, 70, 86, 0.50);
  color: var(--on-surface);
  border-radius: var(--radius-xl);
}
.btn--outline:hover {
  background: var(--tertiary);
  color: var(--on-tertiary);
  border-color: var(--tertiary);
}

/* Ghost */
.btn--ghost {
  background: transparent;
  border: 1px solid rgba(142, 144, 162, 0.25);
  color: var(--primary);
}
.btn--ghost:hover {
  background: rgba(45, 52, 73, 0.50);
  border-color: rgba(184, 195, 255, 0.35);
  box-shadow: 0 0 0 3px rgba(0, 220, 229, 0.12);
  color: var(--primary);
}

/* Small size */
.btn--sm {
  padding: var(--sp-2) var(--sp-4);
  font-size: var(--text-sm);
  border-radius: var(--radius);
  font-weight: 600;
}
.btn--sm .material-symbols-outlined {
  font-size: 1rem;
}

/* Large size */
.btn--lg {
  padding: var(--sp-4) var(--sp-8);
  font-size: var(--text-md);
}

/* --------------------------------------------------------------------------
   2. Editorial article cards
   -------------------------------------------------------------------------- */
.card {
  border-radius: var(--radius-2xl);
  overflow: hidden;
  background-color: var(--surface-container-high);
  transition: transform var(--t-base);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
}
.card--glass {
  background: rgba(45, 52, 73, 0.40);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(67, 70, 86, 0.15);
  box-shadow: inset 0 1px 0 rgba(184, 195, 255, 0.05);
}

/* Card image */
.card__image {
  position: relative;
  overflow: hidden;
}
.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t-slow);
  display: block;
}
.card:hover .card__image img {
  transform: scale(1.06);
}
.card__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--surface-container) 0%, transparent 60%);
  pointer-events: none;
}

/* Card body */
.card__body {
  padding: var(--sp-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card__kicker {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tertiary);
  margin-bottom: var(--sp-3);
}
.card__title {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--on-surface);
  line-height: 1.25;
  margin-bottom: var(--sp-3);
  transition: color var(--t-base);
}
.card:hover .card__title {
  color: var(--primary);
}
.card__title a {
  color: inherit;
  text-decoration: none;
}
.card__title a:hover {
  color: var(--primary);
}
.card__excerpt {
  font-size: var(--text-base);
  color: var(--on-surface-variant);
  line-height: 1.6;
  flex: 1;
}
.card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-top: var(--sp-4);
  font-size: var(--text-xs);
  color: var(--outline);
}
.card__meta-sep {
  width: 3px;
  height: 3px;
  border-radius: var(--radius-full);
  background: var(--outline);
  flex-shrink: 0;
}

/* Feature card – large, image bottom-overlay style */
.card--feature {
  position: relative;
  height: 340px;
  background-color: var(--surface-container);
}
.card--feature .card__image {
  position: absolute;
  inset: 0;
  height: 100%;
}
.card--feature .card__image-overlay {
  background: linear-gradient(to top, var(--surface-container) 0%, transparent 55%);
}
.card--feature .card__body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: transparent;
  justify-content: flex-end;
}
.card--feature .card__title {
  font-size: var(--text-2xl);
  color: #ffffff;
}

/* Secondary cards (smaller) */
.card--sm {
  border-radius: var(--radius-xl);
  background-color: var(--surface-container-highest);
}
.card--sm .card__image {
  height: 12rem;
}
.card--sm .card__title {
  font-size: var(--text-lg);
}

/* --------------------------------------------------------------------------
   3. Pulse chip (Live indicator)
   -------------------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip--live {
  background-color: rgba(0, 121, 126, 0.30);
  color: var(--tertiary);
  border: 1px solid rgba(0, 220, 229, 0.20);
}
.chip--live::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--tertiary);
  animation: pulse-dot 2s infinite;
  flex-shrink: 0;
}

.chip--status {
  background-color: var(--surface-container-high);
  border: 1px solid rgba(0, 220, 229, 0.20);
  color: var(--tertiary);
}
.chip--perf {
  background-color: var(--surface-container-high);
  border: 1px solid rgba(184, 195, 255, 0.20);
  color: var(--primary);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.75); }
}

/* --------------------------------------------------------------------------
   4. Tags (taxonomy)
   -------------------------------------------------------------------------- */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
/* Flatten all Drupal wrapper divs so flex works on the links */
.tag-list div { display: contents; }
/* Hide Drupal's field label div (contains text, no <a> inside) */
.tag-list > div > div:first-child:not(:has(a)) { display: none; }
/* Style tag links regardless of whether .tag class is present */
.tag-list a {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  text-decoration: none;
  transition: background var(--t-base), color var(--t-base);
  white-space: nowrap;
}
.tag-list a:hover {
  background-color: var(--primary-container);
  color: var(--on-primary-fixed);
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background-color: var(--secondary-container);
  color: var(--on-secondary-container);
  text-decoration: none;
  transition: background var(--t-base), color var(--t-base);
  white-space: nowrap;
}
.tag:hover {
  background-color: var(--primary-container);
  color: var(--on-primary-fixed);
}

/* --------------------------------------------------------------------------
   5. Glassmorphism card
   -------------------------------------------------------------------------- */
.glass-card {
  background: rgba(45, 52, 73, 0.40);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(67, 70, 86, 0.15);
  border-radius: var(--radius-xl);
}

/* --------------------------------------------------------------------------
   6. Ghost border utility (accessibility divider)
   -------------------------------------------------------------------------- */
.ghost-divider {
  border: none;
  border-top: 1px solid rgba(67, 70, 86, 0.15);
  margin: 0;
}

/* --------------------------------------------------------------------------
   7. Pager
   -------------------------------------------------------------------------- */
.pager {
  display: flex;
  justify-content: center;
  padding: var(--sp-12) var(--sp-8);
}
.pager__items {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.pager__item a,
.pager__item button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 var(--sp-3);
  border-radius: var(--radius);
  font-size: var(--text-base);
  color: var(--outline);
  background: var(--surface-container);
  transition: background var(--t-base), color var(--t-base);
  border: 1px solid rgba(67, 70, 86, 0.20);
}
.pager__item a:hover,
.pager__item--current a {
  background: var(--primary-container);
  color: var(--on-primary-fixed);
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   8. Breadcrumb
   -------------------------------------------------------------------------- */
.st-breadcrumb {
  padding: var(--sp-3) var(--sp-8) 0;
  font-size: var(--text-sm);
  color: var(--outline);
}
.st-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.st-breadcrumb li {
  display: flex;
  align-items: center;
}
.st-breadcrumb li + li::before {
  content: '/';
  margin: 0 var(--sp-2);
  opacity: 0.4;
}
.st-breadcrumb a {
  color: var(--outline);
  transition: color var(--t-base);
}
.st-breadcrumb a:hover {
  color: var(--primary);
}
.st-breadcrumb li:last-child span {
  color: var(--on-surface-variant);
}

/* --------------------------------------------------------------------------
   9. Ambient glow card (Diary section)
   -------------------------------------------------------------------------- */
.glow-card-wrap {
  position: relative;
}
.glow-card-wrap::before {
  content: '';
  position: absolute;
  inset: -4px;
  background: linear-gradient(135deg, var(--tertiary), var(--primary));
  border-radius: calc(var(--radius-2xl) + 4px);
  filter: blur(12px);
  opacity: 0.25;
  transition: opacity 1s ease;
  pointer-events: none;
  z-index: 0;
}
.glow-card-wrap:hover::before {
  opacity: 0.40;
}
.glow-card {
  position: relative;
  z-index: 1;
  background-color: var(--surface-container-high);
  border-radius: var(--radius-2xl);
  padding: var(--sp-8);
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   10. Drupal form elements
   -------------------------------------------------------------------------- */
.form-item label {
  display: block;
  margin-bottom: var(--sp-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--on-surface-variant);
}
.form-item input[type="text"],
.form-item input[type="email"],
.form-item input[type="password"],
.form-item textarea,
.form-item select {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-container-highest);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: var(--text-base);
  outline: none;
  transition: box-shadow var(--t-base);
  border-bottom: 2px solid transparent;
}
.form-item input:focus,
.form-item textarea:focus,
.form-item select:focus {
  border-bottom-color: var(--tertiary);
  box-shadow: 0 1px 0 0 var(--tertiary);
}
.form-submit {
  background: linear-gradient(135deg, var(--primary-container), var(--primary));
  color: var(--on-primary-fixed);
  font-weight: 700;
  padding: var(--sp-3) var(--sp-8);
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--t-base);
}
.form-submit:hover {
  box-shadow: 0 0 0 4px rgba(0, 220, 229, 0.20);
}

/* ── Form descriptions ( toned-down helper text ) ───── */
.path-user .form-item .description {
  font-size: var(--text-xs);
  color: var(--on-surface-variant);
  opacity: 0.7;
  margin-top: var(--sp-1);
  line-height: 1.4;
}
.path-user .form-item + .form-item {
  margin-top: var(--sp-5);
}

/* ── Login page layout ──────────────────────────────── */
.path-user .st-content {
  display: flex;
  justify-content: center;
  padding: var(--sp-8) var(--sp-4);
}
.path-user .st-content > * {
  width: 100%;
  max-width: 420px;
}
.path-user .block-system-main-block {
  background: var(--surface-1, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: var(--sp-8);
}
.path-user h1.page-title,
.path-user .block-system-main-block h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-6);
  text-align: center;
}

/* ── Social login buttons ───────────────────────────── */
.st-social-login {
  margin-top: var(--sp-6);
}
.st-social-login__divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  color: var(--text-muted, #6b7280);
  font-size: var(--text-sm);
}
.st-social-login__divider::before,
.st-social-login__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,.1);
}
.st-social-login__buttons {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.st-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  width: 100%;
  padding: 11px var(--sp-4);
  border-radius: 8px;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: filter .15s, transform .1s;
  cursor: pointer;
}
.st-social-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}
.st-social-btn:active {
  transform: translateY(0);
}
.st-social-btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.st-social-btn--facebook {
  background: #1877F2;
  color: #fff;
}
.st-social-btn--google {
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
}

/* --------------------------------------------------------------------------
   11. Login popup
   -------------------------------------------------------------------------- */
.st-header__login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: rgba(45, 52, 73, 0.50);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(142, 144, 162, 0.20);
  color: var(--primary);
  cursor: pointer;
  transition: all var(--t-base);
  text-decoration: none;
}
.st-header__login-btn:hover {
  background: var(--surface-container-highest);
  box-shadow: var(--glow-tertiary);
  color: var(--primary);
}
.st-header__login-btn .material-symbols-outlined {
  font-size: 1.25rem;
}

.st-login-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.st-login-popup[hidden] {
  display: none;
}

.st-login-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
}

.st-login-popup__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface-1, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: var(--sp-8);
  box-shadow: 0 24px 64px rgba(0,0,0,.40);
  animation: st-popup-in 0.25s ease-out;
}
@keyframes st-popup-in {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.st-login-popup__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--outline);
  cursor: pointer;
  transition: color var(--t-base);
}
.st-login-popup__close:hover {
  color: var(--on-surface);
}

.st-login-popup__title {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--sp-6);
  text-align: center;
}

.st-login-popup__register {
  text-align: center;
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--on-surface-variant);
}
.st-login-popup__register a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.st-login-popup__register a:hover {
  color: var(--tertiary);
}

/* Adjust social login inside popup */
.st-login-popup .st-social-login {
  margin-top: var(--sp-4);
}

/* --------------------------------------------------------------------------
   12. Logged-in user dropdown
   -------------------------------------------------------------------------- */
.st-header__user-wrap {
  position: relative;
}

.st-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface-1, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  padding: var(--sp-2);
  box-shadow: 0 16px 48px rgba(0,0,0,.40);
  z-index: 3000;
  animation: st-popup-in 0.2s ease-out;
}
.st-user-dropdown[hidden] {
  display: none;
}

.st-user-dropdown__item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 8px;
  color: var(--on-surface);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-base);
  white-space: nowrap;
}
.st-user-dropdown__item:hover {
  background: rgba(45, 52, 73, 0.60);
  color: var(--primary);
}
.st-user-dropdown__item .material-symbols-outlined {
  font-size: 1.1rem;
  color: var(--outline);
}


/* --------------------------------------------------------------------------
   User profile enhancements
   -------------------------------------------------------------------------- */

.st-user-profile {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.st-profile-card {
  background: var(--surface-1, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: var(--sp-6);
}

.st-profile-card--hero {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  text-align: left;
}

.st-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-profile-avatar .material-symbols-outlined {
  font-size: 36px;
  color: var(--primary, #8b5cf6);
}

.st-profile-name {
  font-size: var(--text-xl, 1.25rem);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}

.st-profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  color: var(--text-muted, #6b7280);
  font-size: var(--text-sm);
}

.st-profile-meta__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}

.st-profile-card__header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.st-profile-card__header .material-symbols-outlined {
  color: var(--primary, #8b5cf6);
  font-size: 22px;
}

.st-profile-card__title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0;
}

.st-profile-card__link {
  margin-top: var(--sp-4);
  width: 100%;
  justify-content: center;
}

/* School section */
.st-profile-school__rank {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

.st-profile-school__rank-emoji {
  font-size: 2.5rem;
  line-height: 1;
}

.st-profile-school__rank-name {
  font-weight: 700;
  font-size: var(--text-base);
}

.st-profile-school__rank-xp {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.st-profile-school__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.st-profile-stat {
  text-align: center;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: var(--sp-3) var(--sp-2);
}

.st-profile-stat__value {
  display: block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary, #8b5cf6);
}

.st-profile-stat__label {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.st-profile-xpbar {
  margin-bottom: var(--sp-4);
}

.st-profile-xpbar__track {
  height: 8px;
  background: rgba(255,255,255,.08);
  border-radius: 4px;
  overflow: hidden;
}

.st-profile-xpbar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary, #8b5cf6), #a78bfa);
  border-radius: 4px;
  transition: width .4s ease;
}

.st-profile-xpbar__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-top: var(--sp-2);
  text-align: center;
}

/* Services section */
.st-profile-services {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.st-profile-service {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: var(--sp-4);
}

.st-profile-service__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(139,92,246,.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.st-profile-service__icon .material-symbols-outlined {
  color: var(--primary, #8b5cf6);
  font-size: 22px;
}

.st-profile-service__info {
  flex: 1;
  min-width: 0;
}

.st-profile-service__name {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.st-profile-service__status {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.st-profile-service__status--active {
  color: #34d399;
}

.st-profile-service__status--free {
  color: #fbbf24;
}

.st-profile-content {
  margin-top: var(--sp-2);
}

@media (max-width: 480px) {
  .st-profile-card--hero {
    flex-direction: column;
    text-align: center;
  }
  .st-profile-school__stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .st-profile-service {
    flex-wrap: wrap;
  }
  .st-profile-service .btn {
    width: 100%;
    margin-top: var(--sp-2);
    justify-content: center;
  }
}

/* ==========================================================================
   AI Editor badge & popup
   ========================================================================== */

/* ── Inline badge next to author name ── */
.st-ai-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: var(--sp-1);
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--tertiary, #00dce5);
  cursor: pointer;
  vertical-align: middle;
  transition: color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}
.st-ai-badge:hover {
  color: var(--primary, #8b5cf6);
  transform: scale(1.15);
}
.st-ai-badge .material-symbols-outlined {
  font-size: 1.1rem;
}

/* ── Popup overlay & panel ── */
.st-ai-popup {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
}
.st-ai-popup.is-hidden {
  display: none;
}

.st-ai-popup__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(4px);
}

.st-ai-popup__panel {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--surface-1, #1a1a2e);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: var(--sp-8);
  box-shadow: 0 24px 64px rgba(0,0,0,.40);
  animation: st-popup-in 0.25s ease-out;
  text-align: center;
}

.st-ai-popup__close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  background: transparent;
  border: none;
  color: var(--outline);
  cursor: pointer;
  transition: color var(--t-base);
}
.st-ai-popup__close:hover {
  color: var(--on-surface);
}

.st-ai-popup__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(0, 220, 229, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--sp-4);
}
.st-ai-popup__icon .material-symbols-outlined {
  font-size: 28px;
  color: var(--tertiary, #00dce5);
}

.st-ai-popup__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin: 0 0 var(--sp-4);
}

.st-ai-popup__body {
  text-align: left;
  color: var(--on-surface-variant);
  font-size: var(--text-sm);
  line-height: 1.7;
  margin-bottom: var(--sp-6);
}
.st-ai-popup__body p + p {
  margin-top: var(--sp-3);
}

.st-ai-popup__link {
  justify-content: center;
}

/* ── User profile AI editor section ── */
.st-profile-ai-editor {
  color: var(--on-surface-variant);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.st-profile-ai-editor p + p {
  margin-top: var(--sp-3);
}

/* ── Legal / Basic page ─────────────────────────────────────────── */
.st-legal {
  max-width: 780px;
  margin: 0 auto;
  padding: var(--sp-10) var(--sp-8) var(--sp-16);
}
@media (max-width: 640px) {
  .st-legal { padding: var(--sp-6) var(--sp-4) var(--sp-12); }
}

.st-legal__header {
  text-align: center;
  padding-bottom: var(--sp-8);
  margin-bottom: var(--sp-10);
  border-bottom: 1px solid var(--outline-variant);
}
.st-legal__icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: var(--sp-5);
  line-height: 1;
}
.st-legal__title {
  font-family: var(--font-headline);
  font-size: clamp(var(--text-2xl), 4vw, var(--text-3xl));
  font-weight: 700;
  color: var(--on-surface);
  margin-bottom: var(--sp-3);
  letter-spacing: -0.02em;
}
.st-legal__meta {
  font-size: var(--text-sm);
  color: var(--on-surface-variant);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.st-legal__meta::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--tertiary);
}

/* ── Prose typography ────────────────────────────────────────────── */
.st-prose h2 {
  font-family: var(--font-headline);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--on-surface);
  margin: var(--sp-10) 0 var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--outline-variant);
}
.st-prose h2:first-child { margin-top: 0; }

.st-prose h3 {
  font-family: var(--font-headline);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--tertiary);
  margin: var(--sp-7) 0 var(--sp-3);
}

.st-prose h4 {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--primary);
  margin: var(--sp-5) 0 var(--sp-2);
  letter-spacing: 0;
}

.st-prose p {
  color: var(--on-surface-variant);
  line-height: 1.8;
  margin-bottom: var(--sp-4);
  font-size: var(--text-base);
}

.st-prose ul {
  list-style: disc;
  margin: var(--sp-2) 0 var(--sp-5) var(--sp-6);
}
.st-prose ol {
  list-style: decimal;
  margin: var(--sp-2) 0 var(--sp-5) var(--sp-6);
}
.st-prose li {
  color: var(--on-surface-variant);
  line-height: 1.75;
  margin-bottom: var(--sp-2);
  font-size: var(--text-base);
}

.st-prose strong {
  color: var(--on-surface);
  font-weight: 600;
}

.st-prose a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.st-prose a:hover {
  color: var(--tertiary);
}

/* Callout — zvýrazněný blok (právo na odstoupení, klíčová info) */
.st-prose .st-callout {
  background: var(--surface-container);
  border-left: 3px solid var(--tertiary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  padding: var(--sp-4) var(--sp-6);
  margin: var(--sp-6) 0;
}
.st-prose .st-callout p {
  margin-bottom: var(--sp-3);
}
.st-prose .st-callout p:last-child {
  margin-bottom: 0;
}
.st-prose .st-callout ul {
  margin-top: var(--sp-2);
}
