/* css/components/auth.css */
/* ──────────────────────────────────────────────────────────────────────────
   Authentication modal, user widget (header), profile panel, sync status
   ────────────────────────────────────────────────────────────────────────── */

/* ── Full-screen auth (Duolingo-style) ─────────────────────────────────── */
.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  flex-direction: column;
  background: #fff;
  font-family: 'Nunito', sans-serif;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.auth-screen.visible {
  display: flex;
  opacity: 1;
}

.auth-screen.hiding {
  opacity: 0;
}

body.auth-screen-open {
  overflow: hidden;
}

body.auth-screen-open #app {
  visibility: hidden;
}

.auth-screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  flex-shrink: 0;
}

.auth-screen-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.auth-screen-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  color: #afafaf;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
}

.auth-screen-close:hover {
  color: #777;
  background: #f7f7f7;
}

.auth-screen-close .material-symbols-outlined {
  font-size: 1.5rem;
}

.auth-screen-header-link {
  border: 2px solid #d0d0d0;
  background: #fff;
  color: #3c3c3c;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.auth-screen-header-link:hover {
  background: #f7f7f7;
  border-color: #afafaf;
}

.auth-screen-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 40px;
}

.auth-screen-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #3c3c3c;
  margin: 0 0 12px;
  text-align: center;
}

.auth-screen-subtitle {
  margin: 0 0 32px;
  max-width: 360px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  color: #777;
}

.auth-screen-form {
  width: 100%;
  max-width: 400px;
}

/* Form fields */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.auth-field-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #777;
}

.auth-field-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #3c3c3c;
  background: #fff;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.auth-field-input::placeholder {
  color: #afafaf;
}

.auth-field-input:focus {
  outline: none;
  border-color: #777;
}

.auth-screen-primary-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  background: #f47417;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
  box-shadow: 0 4px 0 #d45f0a;
  margin-bottom: 4px;
}

.auth-screen-primary-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.auth-screen-primary-btn:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #d45f0a;
}

.auth-screen-primary-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-screen-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3c3c3c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-screen-google-btn:hover:not(:disabled) {
  background: #f7f7f7;
  border-color: #afafaf;
}

.auth-screen-google-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.auth-screen-google-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-screen-guest-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1cb0f6;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-screen-guest-btn:hover {
  background: #fff8f3;
  border-color: #f47417;
}

.auth-screen-loader {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: #777;
  font-size: 0.875rem;
}

.auth-screen-loader i {
  animation: spin 0.8s linear infinite;
}

.auth-screen-error {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  color: #b91c1c;
  font-size: 0.85rem;
}

.auth-screen-footer {
  flex-shrink: 0;
  padding: 16px 24px 28px;
  text-align: center;
}

.auth-screen-footer p {
  margin: 0;
  color: #afafaf;
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 400px;
  margin-inline: auto;
}

.auth-screen-footer a {
  color: #777;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Legacy modal classes kept for reference snippet compatibility */
#auth-modal-overlay {
  display: none;
}

/* ── Auth divider ────────────────────────────────────────────────────────── */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #afafaf;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: #e5e5e5;
}

.auth-google-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Switch between login / register */
.auth-switch-text {
  margin-top: 20px;
  text-align: center;
  font-size: 0.88rem;
  color: #777;
}

.auth-switch-text a {
  color: #f47417;
  font-weight: 700;
  text-decoration: none;
}

.auth-switch-text a:hover {
  text-decoration: underline;
}

/* Guest note */
.auth-guest-note {
  margin-top: 12px;
  color: #afafaf;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: center;
}

/* ── Header user widget ─────────────────────────────────────────────────── */
.user-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px 6px 6px;
  border-radius: 50px;
  background: rgba(45, 46, 95, 0.04);
  border: 1px solid rgba(45, 46, 95, 0.08);
  transition: background 0.2s;
  color: var(--text-dark);
  font-size: 0.875rem;
  font-weight: 500;
  user-select: none;
}
.user-widget:hover {
  background: rgba(45, 46, 95, 0.08);
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.user-avatar-initials {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

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

/* ── User profile panel ──────────────────────────────────────────────────── */
.user-profile-panel {
  display: none;
  position: fixed;
  top: 72px;
  right: 20px;
  width: 300px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(45, 46, 95, 0.1);
  border: 1px solid var(--border-light);
  flex-direction: column;
  overflow: hidden;
  z-index: 8888;
  opacity: 0;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.user-profile-panel.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: #fff;
}

.profile-avatar-large {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.4);
}
.profile-avatar-large img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-initials-large {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.profile-info {
  min-width: 0;
}
.profile-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-email {
  font-size: 0.78rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Preferences ─────────────────────────────────────────────────────────── */
.profile-prefs {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pref-row label {
  font-size: 0.85rem;
  color: var(--text-medium);
  font-weight: 500;
  min-width: 70px;
  display: inline-flex;
  align-items: center;
  line-height: 1.25;
}
.pref-row select {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  color: var(--text-dark);
  background: #f8fafc;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.pref-row select:focus {
  border-color: var(--primary);
}

/* ── Profile sync status ─────────────────────────────────────────────────── */
.profile-sync-status {
  min-height: 20px;
  padding: 0 20px;
  font-size: 0.78rem;
  color: var(--text-light);
  transition: color 0.2s;
}
.profile-sync-status.syncing { color: var(--primary); }
.profile-sync-status.saved   { color: var(--completed); }
.profile-sync-status.error   { color: var(--incorrect); }

/* ── Sign out button ─────────────────────────────────────────────────────── */
.profile-signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 8px 20px 20px;
  padding: 10px 20px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 50px;
  color: #b91c1c;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.profile-signout-btn i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 0.95rem;
}
.profile-signout-btn:hover {
  background: #fee2e2;
  transform: translateY(-1px);
}

/* ── Global sync-status indicator ──────────────────────────────────────────── */
.sync-status {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 50px;
  font-weight: 500;
  vertical-align: middle;
}
.sync-status.syncing {
  background: #eff6ff;
  color: var(--primary);
  animation: pulse 1.2s ease-in-out infinite;
}
.sync-status.synced {
  background: #f0fdf4;
  color: var(--completed);
}
.sync-status.error {
  background: #fef2f2;
  color: var(--incorrect);
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}



/* ── Header sign-in button (guest / unauthenticated) ─────────────────── */
.header-signin-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
}
.header-signin-btn:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}
.header-signin-btn i {
  font-size: 0.8rem;
}

@media (max-width: 420px) {
  .header-signin-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
    gap: 0;
  }

  .header-signin-btn span {
    display: none;
  }

  .user-widget {
    padding: 4px;
    gap: 0;
  }

  .user-name {
    display: none;
  }
}

@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  .user-profile-panel {
    display: none !important;
  }
}

/* ── Full profile section (rendered in main-content) ─────────────────── */
.profile-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 28px;
}

/* ── Account page (full-screen profile; editorial shell like premium plans / dashboard) ─ */
.account-page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  box-sizing: border-box;
  min-height: 100vh;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}

.account-page-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.account-page-header .btn-back {
  flex-shrink: 0;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 12px;
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 4px rgba(45, 46, 95, 0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.account-page-header .btn-back:hover {
  background: var(--editorial-cream);
  border-color: rgba(45, 46, 95, 0.12);
  box-shadow: var(--shadow-md);
  transform: none;
}

.account-page-header .btn-back:active {
  transform: scale(0.98);
  box-shadow: 0 1px 4px rgba(45, 46, 95, 0.06);
}

.account-page-header .btn-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 46, 95, 0.18);
}

.account-page-header-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.account-page-title {
  font-family: 'Mileast', 'Georgia', serif;
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.12;
}

.account-page-subtitle {
  margin: 0;
  color: rgba(45, 46, 95, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 36rem;
  font-weight: 500;
}

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 36%) minmax(0, 1fr);
  gap: 24px 28px;
  align-items: start;
}

.account-identity-card {
  background: var(--editorial-cream);
  border-radius: var(--editorial-radius, 20px);
  border: 1px solid rgba(45, 46, 95, 0.08);
  box-shadow: var(--editorial-card-shadow);
  padding: 22px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-identity-avatar-wrap {
  width: 100%;
  max-width: 132px;
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(45, 46, 95, 0.12);
  background: var(--editorial-blue-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.account-identity-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.account-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--white);
  background: rgba(45, 46, 95, 0.82);
}

.account-identity-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.account-identity-name {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.2;
  word-wrap: break-word;
}

.account-identity-email {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(45, 46, 95, 0.72);
  line-height: 1.4;
  word-wrap: break-word;
}

.account-identity-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.account-editorial-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(45, 46, 95, 0.12);
}

.account-editorial-tag--premium {
  background: rgba(243, 214, 73, 0.35);
  color: var(--text-dark);
}

.account-editorial-tag--free {
  background: rgba(208, 232, 252, 0.65);
  color: rgba(45, 46, 95, 0.78);
}

.account-identity-meta {
  margin: 4px 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(45, 46, 95, 0.55);
  letter-spacing: 0.02em;
}

.account-identity-actions {
  margin-top: auto;
  padding-top: 8px;
}

.account-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(45, 46, 95, 0.18);
  background: var(--white);
  color: var(--text-dark);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(45, 46, 95, 0.05);
}

.account-btn-secondary:hover {
  background: var(--editorial-blue-mist);
  border-color: rgba(45, 46, 95, 0.22);
}

.account-signout-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: none;
  color: #b4533b;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.account-signout-btn:hover {
  color: #9a3412;
  text-decoration: underline;
}

.account-signout-btn:focus-visible {
  outline: 2px solid rgba(180, 83, 59, 0.45);
  outline-offset: 3px;
  border-radius: 4px;
}

.account-modules {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.account-module {
  border-radius: var(--editorial-radius, 20px);
  border: 1px solid rgba(45, 46, 95, 0.08);
  box-shadow: var(--editorial-card-shadow);
  padding: 20px 20px 18px;
}

.account-module--prefs {
  background: rgba(183, 184, 229, 0.22);
}

.account-module--membership {
  background: var(--editorial-green);
}

.account-module-title {
  margin: 0 0 14px;
  font-family: 'Mileast', 'Georgia', serif;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dark);
  line-height: 1.15;
}

.account-module-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.account-module .profile-sync-status {
  min-height: 1.25em;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0;
}

.account-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.account-pref-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: rgba(45, 46, 95, 0.85);
}

.account-level-select {
  flex: 1 1 auto;
  min-width: 140px;
  max-width: 280px;
  appearance: none;
  border-radius: 14px;
  padding: 12px 40px 12px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text-dark);
  background-color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(45, 46, 95, 0.16);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%232D2E5F' d='M1 1.5L6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  box-shadow: none;
}

.account-level-select:hover {
  border-color: rgba(45, 46, 95, 0.28);
  background-color: rgba(255, 255, 255, 0.88);
}

.account-level-select:focus {
  outline: none;
  border-color: rgba(45, 46, 95, 0.45);
  box-shadow: 0 0 0 3px rgba(45, 46, 95, 0.12);
}

.account-membership-kicker {
  margin: 0;
  font-family: 'Mileast', 'Georgia', serif;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dark);
}

.account-membership-summary {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(45, 46, 95, 0.78);
  line-height: 1.45;
}

.account-access-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-access-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(45, 46, 95, 0.82);
}

.account-access-line--on {
  color: var(--text-dark);
}

.account-access-line--off {
  color: rgba(45, 46, 95, 0.5);
}

.account-access-icon {
  color: #1e6f4a;
  font-size: 0.85rem;
}

.account-access-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(45, 46, 95, 0.2);
  flex-shrink: 0;
}

.account-module-footer {
  margin-top: 4px;
}

.account-text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  color: var(--text-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.account-text-link:hover {
  color: var(--primary-light);
}

.account-text-link:focus-visible {
  outline: 2px solid rgba(45, 46, 95, 0.35);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (min-width: 769px) {
  .account-page-header {
    align-items: center;
    margin-bottom: 28px;
  }

  .account-page-subtitle {
    font-size: 0.86rem;
  }
}

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

  .account-page-header .btn-back .icon-btn-label {
    display: none;
  }

  .account-pref-row {
    flex-direction: column;
    align-items: stretch;
  }

  .account-level-select {
    max-width: none;
  }
}

/* Apple-style full profile: glassmorphism, soft gradients, SF-like typography */
.profile-section--apple {
  min-height: 100vh;
  padding: 24px;
  max-width: 680px;
  margin: 0 auto;
  box-sizing: border-box;
  background:
    radial-gradient(120% 80% at 0% -10%, rgba(0, 122, 255, 0.18), transparent 42%),
    radial-gradient(90% 60% at 100% 0%, rgba(88, 86, 214, 0.12), transparent 38%),
    radial-gradient(70% 50% at 50% 100%, rgba(52, 199, 89, 0.06), transparent 45%),
    linear-gradient(180deg, #f5f6fa 0%, #e8ecf4 100%);
  color: #1d1d1f;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}

.profile-section-header--apple {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.profile-section-header--apple h2 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #1d1d1f;
}

.profile-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.profile-section-header .btn-back,
.btn-back {
  border: none;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #1d1d1f;
  border-radius: 999px;
  padding: 10px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease,
    box-shadow 0.22s ease;
  line-height: 1;
}

.profile-section-header .btn-back:hover,
.btn-back:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.profile-section-header .btn-back:active,
.btn-back:active {
  transform: scale(0.97) translateY(0);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.profile-section-header .btn-back:focus-visible,
.btn-back:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px rgba(0, 122, 255, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.profile-section-header .btn-back i,
.btn-back i {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-section--apple .profile-section-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 28px;
  padding: 22px;
  margin-bottom: 18px;
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.profile-section--apple .profile-section-card:hover {
  box-shadow:
    0 26px 56px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 255, 255, 0.88);
}

.profile-section--apple .profile-section-card h3 {
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
  text-transform: none;
}

.profile-section--apple .profile-section-card h3 .material-symbols-outlined {
  font-size: 1.2rem;
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.9;
}

.profile-section--apple .profile-prefs {
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-section-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 20px;
}

.profile-section--apple .profile-section-avatar-row {
  margin-bottom: 0;
}

.profile-section-avatar {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-section--apple .profile-section-avatar {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.profile-section-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-section--apple .profile-section-avatar img {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.profile-section--apple .profile-section-avatar:hover img {
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.profile-section-avatar .profile-initials-large {
  font-size: 1.4rem;
}

.profile-section--apple .profile-section-avatar .profile-initials-large {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #007aff, #5856d6);
  border: 4px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.profile-section--apple .profile-section-avatar:hover .profile-initials-large {
  transform: scale(1.03);
  box-shadow: 0 16px 36px rgba(0, 122, 255, 0.35);
}

.profile-section-info {
  flex: 1;
  min-width: 0;
}

.profile-section--apple .profile-section-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.profile-section--apple .profile-name {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1d1d1f;
}

.profile-section--apple .profile-email {
  margin-top: 3px;
  font-size: 0.92rem;
  color: #6e6e73;
  opacity: 1;
}

.profile-section-sub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.2;
}

.profile-pack-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0;
  line-height: 1.2;
}

.profile-section-sub-badge i {
  display: inline-flex;
  align-items: center;
  line-height: 1;
  font-size: 0.85rem;
}

.profile-section-sub-badge.free {
  background: #e8eaed;
  color: #6e6e73;
}

.profile-section-sub-badge.premium {
  color: #7a4b00;
  background: linear-gradient(135deg, #fff4c2, #ffd36a);
}

.profile-section--apple .pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  margin: 0;
  border-top: none;
}

.profile-section--apple .pref-row label {
  font-size: 0.95rem;
  color: #6e6e73;
  font-weight: 500;
}

.profile-section--apple .pref-row select {
  flex: 0 1 auto;
  appearance: none;
  border: none;
  background: #f5f5f7;
  color: #1d1d1f;
  border-radius: 14px;
  padding: 11px 36px 11px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236e6e73' d='M1 1.5L6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.profile-section--apple .pref-row select:focus {
  outline: 3px solid rgba(0, 122, 255, 0.25);
  outline-offset: 0;
}

.profile-section--apple .profile-signout-btn {
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: #ff3b30;
  border-radius: 18px;
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease,
    box-shadow 0.22s ease;
  margin: 0;
}

.profile-section--apple .profile-signout-btn:hover {
  transform: translateY(-1px);
  background: #fff5f5;
  box-shadow:
    0 14px 32px rgba(255, 59, 48, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.profile-section--apple .profile-signout-btn:active {
  transform: scale(0.98);
}

@media (max-width: 560px) {
  .profile-section--apple {
    padding: 18px;
  }

  .profile-section--apple .profile-section-avatar-row {
    align-items: flex-start;
  }

  .profile-section--apple .profile-section-avatar img,
  .profile-section--apple .profile-section-avatar .profile-initials-large {
    width: 72px;
    height: 72px;
  }

  .profile-section--apple .profile-section-avatar .profile-initials-large {
    font-size: 1.2rem;
  }

  .profile-section--apple .profile-section-card {
    border-radius: 24px;
    padding: 18px;
  }

  .profile-section--apple .profile-name {
    font-size: 1.18rem;
  }

  .profile-section-header .btn-back .icon-btn-label {
    display: none;
  }
}

/* ── Animal avatar grid ─────────────────────────────────────────────── */
.animal-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-top: 8px;
}
.animal-avatar-option {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  background: #f1f5f9;
}
.animal-avatar-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.animal-avatar-option:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.animal-avatar-option.animal-avatar-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

/* Avatar grid container (shown on click) */
.animal-avatar-grid-container {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
}

/* Edit hint overlay on profile avatar */
.profile-avatar-edit-hint {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.profile-section-avatar:hover .profile-avatar-edit-hint {
  opacity: 1;
}

/* Avatar grid pagination */
.animal-avatar-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-medium);
}
.animal-avatar-page-btn {
  background: none;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--text-dark);
  transition: background 0.15s;
}
.animal-avatar-page-btn:hover:not(:disabled) {
  background: #f1f5f9;
}
.animal-avatar-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

/* Animal avatar displayed in profile/header as circle */
.animal-avatar-circle {
  width: var(--avatar-img-size, 100%);
  height: var(--avatar-img-size, 100%);
  min-width: var(--avatar-img-size, 100%);
  min-height: var(--avatar-img-size, 100%);
  object-fit: cover;
  border-radius: 50%;
}

/* ── Premium plans section (editorial dashboard — same product shell as bento) ─ */
.premium-plans-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  box-sizing: border-box;
  min-height: 100vh;
  background: var(--bg-light);
  color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}

/* Title row: back + “Choose your Pack” */
.premium-plans-section .profile-section-header.premium-plans-page-header {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

.premium-plans-page-header {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.premium-plans-section .premium-plans-page-header .btn-back {
  flex-shrink: 0;
  padding: 8px 12px;
  min-height: 40px;
  border-radius: 12px;
  background: var(--white);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.premium-plans-section .premium-plans-page-header .btn-back:hover {
  background: var(--editorial-cream);
  border-color: rgba(45, 46, 95, 0.12);
  box-shadow: var(--shadow-md);
  transform: none;
}

.premium-plans-section .premium-plans-page-header .btn-back:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-sm);
}

.premium-plans-section .premium-plans-page-header .btn-back:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 46, 95, 0.18);
}

.premium-plans-header-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.premium-plans-header-titles h2 {
  font-family: 'Mileast', 'Georgia', serif;
  font-size: clamp(1.15rem, 2.8vw, 1.45rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.12;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Plans header — Material line icon (same vocabulary as dashboard premium) */
.premium-plans-header-icon.material-symbols-outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  font-size: 1.45rem;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  color: var(--text-dark);
  opacity: 0.9;
}

.premium-plans-header-desc {
  margin: 0;
  color: rgba(45, 46, 95, 0.72);
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 36rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 500;
}

@media (min-width: 769px) {
  .premium-plans-page-header {
    align-items: center;
    margin-bottom: 24px;
  }

  .premium-plans-header-titles h2 {
    font-size: 1.42rem;
  }

  .premium-plans-header-desc {
    font-size: 0.86rem;
  }
}
.premium-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.premium-plan-card {
  background: #fff;
  border-radius: var(--editorial-radius, 20px);
  box-shadow: var(--shadow-md);
  padding: 28px;
  text-align: center;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
  position: relative;
}
.premium-plan-card:hover {
  transform: translateY(-2px);
}
.premium-plan-card.current {
  border-color: var(--secondary);
}
.premium-plan-card.recommended {
  border-color: var(--primary);
}
.premium-plan-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 50px;
  white-space: nowrap;
}
.premium-plan-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}
.premium-plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.premium-plan-price {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
}
.premium-plan-price span {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-medium);
}
.premium-plan-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  text-align: left;
}
.premium-plan-features li {
  padding: 6px 0;
  font-size: 0.85rem;
  color: var(--text-medium);
  display: flex;
  align-items: center;
  gap: 8px;
}
.premium-plan-features li i {
  color: var(--secondary);
  font-size: 0.75rem;
  flex-shrink: 0;
}
.premium-plan-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

/* “Current plan” on pack cards — passive editorial state (no SaaS green) */
.premium-pack-card .premium-plan-btn.current-plan {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  text-align: center;
  background: rgba(45, 46, 95, 0.06);
  color: var(--text-dark);
  border: 1px solid rgba(45, 46, 95, 0.085);
  cursor: default;
}

.premium-pack-card .premium-plan-btn.current-plan .material-symbols-outlined,
.premium-pack-card .premium-plan-btn.current-plan i {
  flex-shrink: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-medium);
}

.profile-section--apple .premium-plan-btn {
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 14px 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  min-height: 48px;
  box-sizing: border-box;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.profile-section--apple .premium-plan-btn.current-plan {
  background: linear-gradient(135deg, #007aff, #5856d6);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.28);
  cursor: default;
}

.profile-section--apple .premium-plan-btn.primary {
  background: linear-gradient(135deg, #007aff, #5856d6);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 122, 255, 0.22);
}

.profile-section--apple .premium-plan-btn.primary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}

.profile-section--apple .premium-plan-btn.primary:active {
  transform: scale(0.98);
}

.profile-section--apple .premium-plan-btn .material-symbols-outlined,
.profile-section--apple .premium-plan-btn i {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.premium-plan-btn.primary {
  background: var(--primary);
  color: #fff;
}
.premium-plan-btn.primary:hover {
  background: var(--secondary);
}
.premium-plan-btn.outline {
  background: transparent;
  color: var(--text-medium);
  border: 2px solid #e2e8f0;
}

.profile-pack-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.profile-pack-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 9px;
}
.profile-pack-badge.admin {
  background: #e9f2ff;
  color: #0066cc;
}
.profile-pack-badge.theory {
  background: #eef8ef;
  color: #248a3d;
}
.profile-pack-badge.exams {
  background: #fff0f3;
  color: #d70015;
}
.profile-pack-badge.free {
  background: rgba(100, 116, 139, 0.12);
  color: #475569;
}

@media (max-width: 768px), (max-height: 520px) and (orientation: landscape) and (max-width: 1024px) {
  .profile-section {
    max-width: 430px;
    padding: 0;
  }

  .profile-section-header {
    margin-bottom: 14px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,0.94);
    box-shadow: 0 6px 20px rgba(45,46,95,0.07);
  }

  .profile-section-header .btn-back,
  .premium-plans-page-header .btn-back {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 999px;
    justify-content: center;
  }

  .profile-section-header .btn-back .icon-btn-label {
    display: none;
  }

  .profile-section-header h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.1;
  }

  .profile-section--apple {
    padding: 8px 12px 32px;
  }

  .profile-section--apple .profile-section-card {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 24px;
    box-shadow:
      0 20px 50px rgba(0, 0, 0, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.8);
  }

  .profile-section-header--apple h2 {
    font-size: 1.45rem;
  }

  .premium-plans-section {
    padding: 12px 12px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .premium-plans-page-header .premium-plans-header-titles h2 {
    font-size: clamp(1rem, 4vw, 1.2rem);
    gap: 8px;
  }

  .premium-plans-page-header .premium-plans-header-icon.material-symbols-outlined {
    width: 1.3rem;
    height: 1.3rem;
    font-size: 1.22rem;
  }

  .premium-plans-page-header .premium-plans-header-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .premium-plans-section .premium-plans-page-header .btn-back {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
  }

  .profile-section-avatar-row {
    align-items: center;
    gap: 14px;
  }

  .profile-section-info {
    min-width: 0;
  }

  .profile-section--apple .profile-name,
  .profile-section--apple .profile-email {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .profile-pack-badges {
    gap: 8px;
  }

  .profile-section--apple .pref-row {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .profile-section--apple .pref-row label {
    min-width: 0;
  }

  .profile-section--apple .pref-row select {
    width: 100%;
  }

  .profile-section--apple .profile-signout-btn {
    width: 100%;
    justify-content: center;
    margin: 0;
  }
}

/* Duration selector — editorial chip row (same rhythm as dashboard) */
.premium-duration-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 6px;
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: visible;
  padding: 6px;
  border-radius: var(--editorial-radius, 20px);
  background: var(--editorial-cream);
  border: 1px solid var(--border-light);
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.premium-duration-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex-shrink: 0;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-dark);
  font-family: 'Nunito', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: normal;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
  position: relative;
  text-align: center;
  line-height: 1.12;
  box-sizing: border-box;
  box-shadow: none;
}

.premium-duration-btn:hover:not(.active) {
  background: var(--white);
  border-color: rgba(45, 46, 95, 0.1);
}

.premium-duration-btn:active:not(.active) {
  transform: scale(0.98);
}

.premium-duration-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(45, 46, 95, 0.15);
}

.premium-duration-btn-label {
  font-size: clamp(0.62rem, 2.8vw, 0.82rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  color: inherit;
}

@media (min-width: 480px) {
  .premium-duration-btn {
    padding: 10px 8px;
  }
  .premium-duration-btn-label {
    font-size: 0.85rem;
    white-space: normal;
  }
}

.premium-duration-btn.active {
  background: #214c9b;
  color: #fff;
  border-color: #214c9b;
  box-shadow:
    0 4px 6px -1px rgba(23, 37, 84, 0.15),
    0 2px 4px -2px rgba(23, 37, 84, 0.15);
}

.premium-duration-btn.active .premium-duration-btn-label {
  color: #fff;
}

.premium-duration-btn.active .premium-duration-badge {
  background: rgba(255, 255, 255, 0.88);
  color: rgba(45, 46, 95, 0.78);
  border-color: rgba(255, 255, 255, 0.45);
}

.premium-duration-badge {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(198, 210, 198, 0.55);
  color: rgba(45, 46, 95, 0.68);
  font-size: clamp(0.46rem, 2vw, 0.56rem);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
  max-width: 100%;
  line-height: 1.15;
  border: 1px solid rgba(45, 46, 95, 0.06);
}

@media (max-width: 768px) {
  .premium-duration-selector {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 6px;
  }
  .premium-duration-btn {
    min-height: 52px;
  }
}

/* Pack cards grid — bento-like pastel modules */
.premium-packs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

@media (min-width: 700px) and (max-width: 899px) {
  .premium-packs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .premium-packs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

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

.premium-pack-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-radius: calc(var(--editorial-radius, 20px) + 4px);
  padding: 14px 14px 12px;
  text-align: center;
  position: relative;
  overflow: visible;
  border: 1px solid rgba(45, 46, 95, 0.08);
  box-shadow: var(--editorial-card-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.premium-pack-card-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}

/* Pack Theory / Exams / Complete — fixed order from JS */
.premium-packs-grid .premium-pack-card:nth-child(1) {
  background: linear-gradient(165deg, #fdf6eb 0%, var(--editorial-cream) 55%, #f3e8f8 100%);
  color: var(--text-dark);
}

.premium-packs-grid .premium-pack-card:nth-child(2) {
  background: linear-gradient(165deg, rgba(243, 214, 73, 0.45) 0%, #fff9e8 50%, #fff4dc 100%);
  color: var(--text-dark);
}

.premium-packs-grid .premium-pack-card:nth-child(3) {
  background: linear-gradient(165deg, #fce8dc 0%, var(--editorial-blue-mist) 52%, #e8ecf8 100%);
  color: var(--text-dark);
}

.premium-pack-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 14px rgba(45, 46, 95, 0.07);
  border-color: rgba(45, 46, 95, 0.12);
}

.premium-pack-card:active {
  transform: translateY(0) scale(0.99);
}

.premium-pack-card.pack-recommended {
  border-color: rgba(236, 163, 117, 0.55);
  box-shadow: var(--editorial-card-shadow);
  overflow: visible;
}

.premium-pack-card.pack-owned {
  border-color: rgba(45, 46, 95, 0.1);
}

.premium-pack-badge {
  position: absolute;
  top: 7px;
  right: 10px;
  left: auto;
  z-index: 2;
  margin: 0;
  transform: none;
  display: inline-block;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-dark);
  font-family: 'Mileast', 'Georgia', serif;
  font-size: 0.54rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 4px 9px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: none;
  border: 1px solid rgba(45, 46, 95, 0.09);
  pointer-events: none;
}

.premium-pack-card.pack-recommended .premium-pack-badge {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(236, 163, 117, 0.4);
}

.premium-pack-icon {
  display: block;
  width: 2.15rem;
  height: 2.15rem;
  margin: 0 auto 6px;
  font-size: 0;
  line-height: 0;
  color: transparent;
  overflow: hidden;
  background: center / contain no-repeat;
  filter: none;
  opacity: 0.9;
}

.premium-packs-grid .premium-pack-card:nth-child(1) .premium-pack-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D2E5F' stroke-width='1.15' stroke-linecap='round'%3E%3Cpath d='M4 19.5A2.5 2.5 0 016.5 17H20'/%3E%3Cpath d='M6.5 2H20v20H6.5A2.5 2.5 0 014 19.5v-15A2.5 2.5 0 016.5 2z'/%3E%3Cpath d='M8 7h8M8 11h5'/%3E%3C/svg%3E");
}

.premium-packs-grid .premium-pack-card:nth-child(2) .premium-pack-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D2E5F' stroke-width='1.15' stroke-linecap='round'%3E%3Cpath d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/%3E%3Cpath d='M14 2v6h6M8 13h8M8 17h6'/%3E%3C/svg%3E");
}

.premium-packs-grid .premium-pack-card:nth-child(3) .premium-pack-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232D2E5F' stroke-width='1.15' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l7 4v6c0 5-3.5 9-7 10-3.5-1-7-5-7-10V7l7-4z'/%3E%3Cpath d='M9 12l2 2 4-5'/%3E%3C/svg%3E");
}

.premium-pack-name {
  font-family: 'Mileast', 'Georgia', serif;
  font-size: 1.02rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dark);
  margin-bottom: 3px;
  line-height: 1.15;
  padding-inline: 4px;
}

.premium-pack-tagline {
  font-family: 'Nunito', sans-serif;
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(45, 46, 95, 0.78);
  margin-bottom: 8px;
  line-height: 1.4;
  padding-inline: 2px;
}

.premium-pack-price-big {
  font-family: 'Mileast', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-dark);
  letter-spacing: 0.02em;
}

.premium-pack-price-period {
  font-family: 'Nunito', sans-serif;
  font-size: 0.76rem;
  color: rgba(45, 46, 95, 0.68);
  font-weight: 600;
  margin-bottom: 2px;
}

.premium-pack-price-total {
  font-family: 'Nunito', sans-serif;
  font-size: 0.72rem;
  color: rgba(45, 46, 95, 0.65);
  margin-bottom: 8px;
  min-height: 14px;
  font-weight: 500;
}

.premium-pack-features {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  text-align: left;
  flex: 1 1 auto;
}

.premium-pack-card .premium-plan-btn {
  margin-top: auto;
  flex-shrink: 0;
}

.premium-pack-features li {
  padding: 3px 0;
  font-size: 0.78rem;
  color: rgba(45, 46, 95, 0.76);
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.premium-pack-features li i {
  color: rgba(45, 46, 95, 0.52);
  font-size: 0.68rem;
  flex-shrink: 0;
  margin-top: 0.2em;
}

/* Premium page — CTA buttons (separate from profile-section--apple scope) */
.premium-plans-section .premium-plan-btn {
  display: flex;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 10px 12px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.premium-plans-section .premium-plan-btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 6px rgba(45, 46, 95, 0.12);
}

.premium-plans-section .premium-plan-btn.primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 2px 10px rgba(45, 46, 95, 0.14);
}

.premium-plans-section .premium-plan-btn.primary:active {
  transform: scale(0.98);
}

.premium-plans-section .premium-pack-card .premium-plan-btn.current-plan {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
  text-align: center;
  background: rgba(255, 255, 255, 0.35);
  color: var(--text-dark);
  border: 1px solid rgba(45, 46, 95, 0.085);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: default;
  box-shadow: none;
}

.premium-plans-section .premium-pack-card .premium-plan-btn.current-plan:hover {
  transform: none;
  filter: none;
}

/* “Included” — passive; premium tier covers this pack’s scope */
.premium-plans-section .premium-plan-btn.plan-included {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  text-align: center;
  background: rgba(255, 255, 255, 0.32);
  color: var(--text-dark);
  border: 1px dashed rgba(45, 46, 95, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: default;
  box-shadow: none;
  font-weight: 700;
}

.premium-plans-section .premium-plan-btn.plan-included:hover {
  transform: none;
  filter: none;
}

.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(1) .premium-plan-btn.plan-included {
  background: rgba(255, 255, 255, 0.48);
}

.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(2) .premium-plan-btn.plan-included {
  background: rgba(255, 255, 255, 0.5);
}

.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(3) .premium-plan-btn.plan-included {
  background: rgba(255, 255, 255, 0.42);
}

/* Tonal “current plan” strip per card (passive, matches each pastel module) */
.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(1) .premium-plan-btn.current-plan {
  background: rgba(255, 255, 255, 0.55);
}

.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(2) .premium-plan-btn.current-plan {
  background: rgba(255, 255, 255, 0.58);
}

.premium-plans-section .premium-packs-grid .premium-pack-card:nth-child(3) .premium-plan-btn.current-plan {
  background: rgba(255, 255, 255, 0.48);
}

.premium-plans-section .premium-plan-btn .material-symbols-outlined,
.premium-plans-section .premium-plan-btn i {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* JS-driven entrance motion (respect reduced motion in JS + CSS) */
@keyframes apple-ui-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes apple-ui-fade-in-soft {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.apple-ui-profile-card-enter {
  animation: apple-ui-fade-up 0.52s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--apple-stagger, 0ms);
}

.apple-ui-pack-enter {
  animation: apple-ui-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--apple-stagger, 0ms);
}

.apple-ui-duration-enter {
  animation: apple-ui-fade-in-soft 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--apple-stagger, 0ms);
}

@media (prefers-reduced-motion: reduce) {
  .apple-ui-profile-card-enter,
  .apple-ui-pack-enter,
  .apple-ui-duration-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .profile-section--apple .profile-section-card,
  .account-module,
  .account-identity-card,
  .profile-duo-stat-card,
  .profile-duo-achievement,
  .profile-duo-settings-card,
  .profile-duo-tool-chip,
  .premium-pack-card,
  .premium-duration-btn {
    transition-duration: 0.01ms !important;
  }
}

/* Upgrade gates */
/* ── Premium access badge (billing phase) ─────────────────────────────── */
.access-premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  color: #92400e;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 6px;
}
.access-premium-badge .material-symbols-outlined {
  font-size: 14px;
  line-height: 1;
}
.upgrade-gate-card .access-premium-badge {
  margin: 0 auto 16px;
  display: inline-flex;
}
.cu-block-card-locked .access-premium-badge,
.course-nav-block-hdr .access-premium-badge {
  margin-left: 0;
  margin-bottom: 6px;
}
.tests-section-card-title-row .access-premium-badge {
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Upgrade gate modal ───────────────────────────────────────────────── */
.upgrade-gate-overlay {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(30,31,66,0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.upgrade-gate-card {
  background: #fff;
  border-radius: 24px;
  padding: 36px 32px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(45,46,95,0.18);
}
.upgrade-gate-icon { font-size: 3rem; margin-bottom: 12px; }
.upgrade-gate-title { font-size: 1.3rem; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; }
.upgrade-gate-desc { font-size: 0.9rem; color: var(--text-medium); margin-bottom: 24px; line-height: 1.55; }
.upgrade-gate-actions { display: flex; flex-direction: column; gap: 10px; }
.upgrade-gate-btn-primary {
  padding: 13px; border: none; border-radius: 50px;
  background: var(--primary); color: #fff;
  font-size: 0.95rem; font-weight: 700; cursor: pointer;
}
.upgrade-gate-btn-secondary {
  padding: 11px; border: 2px solid rgba(45,46,95,0.2); border-radius: 50px;
  background: transparent; color: var(--text-medium);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
}

/* ── Duolingo-style profile page ─────────────────────────────────────── */
.dashboard-center--profile {
  background: #f7f7f7;
  padding: 0 0 88px;
}

.dashboard-layout--profile .dashboard-center {
  min-height: 100vh;
}

@media (min-width: 901px) {
  .dashboard-layout--profile:not(.dashboard-layout-right-closed) {
    padding-right: calc(var(--dashboard-right-sidebar-width) + 72px);
  }

  .dashboard-layout--profile:not(.dashboard-layout-right-closed) .dashboard-center {
    margin-left: 32px;
    width: calc(100% - 32px);
    max-width: calc(100% - 32px);
  }
}

.profile-duo-page {
  max-width: min(1040px, 100%);
  margin: 0;
  padding: 24px 24px 40px;
  box-sizing: border-box;
  font-family: 'Nunito', sans-serif;
  color: #3c3c3c;
}

.profile-duo-header {
  position: relative;
  margin-bottom: 28px;
}

.profile-duo-hero {
  position: relative;
  height: 132px;
  border-radius: 20px;
  background: linear-gradient(120deg, #2D2E5F 0%, #3d3e7e 52%, #5355a8 100%);
  overflow: hidden;
}

.profile-duo-hero::before,
.profile-duo-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
}

.profile-duo-hero::before {
  width: 220px;
  height: 220px;
  top: -120px;
  right: -40px;
}

.profile-duo-hero::after {
  width: 150px;
  height: 150px;
  bottom: -86px;
  left: 18%;
}

.profile-duo-header-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 22px;
  padding: 0 8px;
}

.profile-duo-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  margin-top: -54px;
  margin-left: 16px;
  z-index: 2;
}

.profile-duo-header-main {
  flex: 1;
  min-width: 0;
  padding-top: 14px;
}

.profile-duo-header-actions {
  flex-shrink: 0;
  padding-top: 16px;
}

.profile-duo-name {
  margin: 0 0 2px;
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.15;
}

.profile-duo-handle {
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #777;
  overflow-wrap: anywhere;
}

.profile-duo-joined {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #afafaf;
}

.profile-duo-joined .material-symbols-outlined {
  font-size: 1rem;
}

.profile-duo-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-duo-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 2px solid #e5e5e5;
}

.profile-duo-badge--premium {
  background: #fff8d6;
  color: #7a5c00;
  border-color: #ffc800;
}

.profile-duo-badge--free {
  background: #ddf4ff;
  color: #1899d6;
  border-color: #84d8ff;
}

.profile-duo-badge--member {
  background: #fff4eb;
  color: #c45a0a;
  border-color: #f9c89a;
}

.profile-duo-badge--admin {
  background: #f3e8ff;
  color: #7c3aed;
  border-color: #d8b4fe;
}

.profile-duo-signout-btn,
.profile-duo-signin-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  min-height: 44px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 14px;
  background: #fff;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff4b4b;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.profile-duo-signout-btn .material-symbols-outlined,
.profile-duo-signin-btn .material-symbols-outlined {
  font-size: 1.1rem;
}

.profile-duo-signout-btn:hover {
  background: #fff6f6;
  border-color: #ffd8d8;
}

.profile-duo-signout-btn:active,
.profile-duo-signin-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

.profile-duo-signin-btn {
  background: var(--brand-orange, #f47417);
  border-color: transparent;
  border-bottom-color: var(--brand-orange-dark, #d46110);
  color: #fff;
}

.profile-duo-signin-btn:hover {
  filter: brightness(1.05);
}

.profile-duo-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #fff;
  box-shadow: 0 4px 16px rgba(45, 46, 95, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.profile-duo-avatar--editable:hover + .profile-duo-avatar-edit-badge,
.profile-duo-avatar-edit-badge:hover {
  transform: scale(1.06);
}

.profile-duo-avatar-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
}

.profile-duo-avatar-edit-badge {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2d2e5f;
  color: #fff;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(45, 46, 95, 0.25);
  cursor: pointer;
  padding: 0;
  font: inherit;
  transform: translate(12%, 12%);
  transition: transform 0.15s ease;
}

.profile-duo-avatar-edit-badge .material-symbols-outlined {
  font-size: 1rem;
}

.profile-duo-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.profile-duo-avatar-initials {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  background: var(--brand-orange, #f47417);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.profile-duo-level-pill {
  position: absolute;
  bottom: 0;
  right: -6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(45, 46, 95, 0.2);
}

.profile-duo-level-pill--b1 { background: var(--brand-orange, #f47417); }
.profile-duo-level-pill--b2 { background: #2D2E5F; }
.profile-duo-level-pill--c1 { background: #ce82ff; }

.profile-duo-promo {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 128px 18px 20px;
  margin-bottom: 28px;
  background: linear-gradient(120deg, #fff4eb 0%, #fff8f0 60%, #ffefdd 100%);
  border: 2px solid #f9c89a;
  border-bottom-width: 4px;
  border-radius: 18px;
  position: relative;
  overflow: hidden;
}

.profile-duo-promo-copy {
  flex: 1;
  min-width: 0;
}

.profile-duo-promo-copy strong {
  display: block;
  font-size: 1rem;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.profile-duo-promo-copy p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b4b4b;
  line-height: 1.4;
}

.profile-duo-promo-btn {
  flex-shrink: 0;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  background: var(--brand-orange, #f47417);
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--brand-orange-dark, #d46110);
  transition: transform 0.1s, box-shadow 0.1s;
}

.profile-duo-promo-btn:hover {
  background: #ff8533;
}

.profile-duo-promo-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--brand-orange-dark, #d46110);
}

.profile-duo-promo-illust {
  position: absolute;
  right: 14px;
  bottom: -4px;
  width: 96px;
  height: auto;
  opacity: 1;
  pointer-events: none;
}

.profile-duo-section-title {
  margin: 0 0 14px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #3c3c3c;
}

.profile-duo-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.profile-duo-section-header .profile-duo-section-title {
  margin: 0;
}

.profile-duo-stats {
  margin-bottom: 28px;
}

.profile-duo-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.profile-duo-stat-card {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 16px;
  padding: 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.profile-duo-stat-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-duo-stat-icon .material-symbols-outlined {
  font-size: 1.9rem;
  font-variation-settings: 'FILL' 1, 'wght' 500;
}

.profile-duo-stat-card--streak .profile-duo-stat-icon { color: #ff9600; }
.profile-duo-stat-card--level .profile-duo-stat-icon { color: #ffc800; }
.profile-duo-stat-card--done .profile-duo-stat-icon { color: #1cb0f6; }
.profile-duo-stat-card--score .profile-duo-stat-icon { color: #ce82ff; }

.profile-duo-stat-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.profile-duo-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: #3c3c3c;
  line-height: 1.1;
}

.profile-duo-stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: #afafaf;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-duo-stat-card--action {
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-duo-stat-card--action:hover {
  border-color: #d0d0d0;
  background: #fcfcfc;
}

.profile-duo-stat-card--action:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

.profile-duo-mobile-tools {
  display: none;
  margin-bottom: 24px;
}

.profile-duo-tool-row-card {
  padding: 0;
  overflow: hidden;
  margin-bottom: 14px;
  border-bottom-width: 4px;
}

.profile-duo-tool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 18px;
  border: none;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.profile-duo-tool-row-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-duo-tool-row-icon--lang {
  background: #ddf4ff;
  color: #1cb0f6;
}

.profile-duo-tool-row-icon .material-symbols-outlined {
  font-size: 1.35rem;
}

.profile-duo-tool-row-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-duo-tool-row-body strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: #3c3c3c;
}

.profile-duo-tool-row-body small {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9a9a9a;
}

.profile-duo-tool-row-value {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1cb0f6;
  flex-shrink: 0;
}

.profile-duo-tools-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.profile-duo-tool-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 14px 12px;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 16px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-duo-tool-chip:hover {
  border-color: #d0d0d0;
  background: #fcfcfc;
}

.profile-duo-tool-chip:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
  margin-bottom: 2px;
}

.profile-duo-tool-chip-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-duo-tool-chip-icon .material-symbols-outlined {
  font-size: 1.25rem;
}

.profile-duo-tool-chip--streak .profile-duo-tool-chip-icon {
  background: #fff4eb;
  color: var(--brand-orange, #f47417);
}

.profile-duo-tool-chip--calc .profile-duo-tool-chip-icon {
  background: #f3e8ff;
  color: #7c3aed;
}

.profile-duo-tool-chip--grades .profile-duo-tool-chip-icon {
  background: #ddf4ff;
  color: #1cb0f6;
}

.profile-duo-tool-chip--dict .profile-duo-tool-chip-icon {
  background: #e8f5e9;
  color: #2e7d32;
}

.profile-duo-tool-chip-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: #3c3c3c;
}

.profile-duo-tool-chip-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--brand-orange, #f47417);
  line-height: 1;
}

.profile-duo-mobile-quicklinks {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}

.profile-duo-mobile-tip {
  margin-bottom: 8px;
}

.profile-duo-mobile-tip .profile-duo-side-illust {
  width: 72px;
  margin-left: -6px;
}

.profile-duo-mobile-tip .profile-duo-side-card--hero {
  padding-left: 76px;
}

@media (max-width: 768px) {
  .profile-duo-mobile-tools {
    display: block;
  }
}

.profile-duo-achievements {
  margin-bottom: 28px;
}

.profile-duo-achievements-list {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-bottom-width: 4px;
  border-radius: 16px;
  overflow: hidden;
}

.profile-duo-achievement {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: #fff;
}

.profile-duo-achievement + .profile-duo-achievement {
  border-top: 2px solid #f0f0f0;
}

.profile-duo-achievement--done {
  background: #fffaf3;
}

.profile-duo-achievement-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.14);
}

.profile-duo-achievement-icon .material-symbols-outlined {
  font-size: 1.9rem;
  color: #fff;
  font-variation-settings: 'FILL' 1;
}

.profile-duo-achievement-body {
  flex: 1;
  min-width: 0;
}

.profile-duo-achievement-name {
  font-size: 1rem;
  font-weight: 800;
  color: #3c3c3c;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.profile-duo-achievement--done .profile-duo-achievement-name::after {
  content: 'check_circle';
  font-family: 'Material Symbols Outlined';
  font-size: 1.05rem;
  color: #58cc02;
  font-variation-settings: 'FILL' 1;
  line-height: 1;
}

.profile-duo-achievement-desc {
  font-size: 0.82rem;
  font-weight: 600;
  color: #999;
  margin-bottom: 10px;
  line-height: 1.35;
}

.profile-duo-achievement-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-duo-progress-bar {
  flex: 1;
  height: 16px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.profile-duo-progress-fill {
  height: 100%;
  background: var(--brand-orange, #f47417);
  border-radius: 999px;
  transition: width 0.3s ease;
  position: relative;
}

.profile-duo-progress-fill::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 8px;
  right: 8px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
}

.profile-duo-achievement--done .profile-duo-progress-fill {
  background: #58cc02;
}

.profile-duo-progress-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #afafaf;
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
}

.profile-duo-settings {
  margin-bottom: 20px;
}

.profile-duo-settings-card {
  background: #fff;
  border: 2px solid #e5e5e5;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 12px;
}

.profile-duo-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-duo-setting-label {
  font-size: 0.92rem;
  font-weight: 800;
  color: #3c3c3c;
}

.profile-duo-level-select {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 200px;
  appearance: none;
  border-radius: 12px;
  padding: 10px 36px 10px 14px;
  font-size: 0.92rem;
  font-weight: 800;
  font-family: inherit;
  color: #3c3c3c;
  background-color: #f7f7f7;
  border: 2px solid #e5e5e5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234b4b4b' d='M1 1.5L6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.profile-duo-level-select:focus {
  outline: none;
  border-color: #84d8ff;
  box-shadow: 0 0 0 3px rgba(28, 176, 246, 0.2);
}

.profile-duo-settings .profile-sync-status {
  margin-top: 10px;
  min-height: 1.25em;
  font-size: 0.82rem;
  font-weight: 700;
}

.profile-duo-character-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.profile-duo-character-desc {
  margin: 4px 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #777;
  line-height: 1.35;
}

.profile-duo-character-preview {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: cover;
  border: 2px solid #e5e5e5;
}

.profile-duo-character-empty {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #f7f7f7;
  border: 2px dashed #e5e5e5;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #afafaf;
}

.profile-duo-character-toggle {
  width: 100%;
  padding: 12px;
  border: 2px solid #e5e5e5;
  border-radius: 12px;
  background: #f7f7f7;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  color: #1cb0f6;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.profile-duo-character-toggle:hover {
  background: #ddf4ff;
  border-color: #84d8ff;
}

.profile-duo-avatar-grid-wrap {
  margin-top: 14px;
}

.profile-duo-avatar-grid-wrap .animal-avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

/* ── Profile avatar editor modal ───────────────────────────────────── */
.profile-avatar-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.profile-avatar-editor-modal--open {
  pointer-events: auto;
  opacity: 1;
}

.profile-avatar-editor-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.profile-avatar-editor-sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(88vh, 760px);
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 40px rgba(45, 46, 95, 0.18);
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.profile-avatar-editor-modal--open .profile-avatar-editor-sheet {
  transform: translateY(0);
}

.profile-avatar-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
  border-bottom: 1px solid #f0f0f0;
}

.profile-avatar-editor-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: #2d2e5f;
}

.profile-avatar-editor-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #f7f7f7;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.profile-avatar-editor-close:hover {
  background: #eee;
}

.profile-avatar-editor-preview-wrap {
  display: flex;
  justify-content: center;
  padding: 16px 20px 8px;
}

.profile-avatar-editor-preview {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(45, 46, 95, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-avatar-editor-preview .profile-duo-avatar-img,
.profile-avatar-editor-preview .profile-duo-avatar-initials {
  width: 100%;
  height: 100%;
}

.profile-avatar-editor-content {
  overflow-y: auto;
  padding: 8px 20px 24px;
}

.profile-avatar-editor-section + .profile-avatar-editor-section {
  margin-top: 18px;
}

.profile-avatar-editor-section-title {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 800;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-avatar-editor-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 0;
}

.profile-avatar-editor-grid .animal-avatar-option {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border: none;
  padding: 0;
  cursor: pointer;
  position: relative;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
}

.profile-avatar-editor-grid .animal-avatar-option img {
  pointer-events: none;
  user-select: none;
}

.avatar-bg-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.avatar-bg-swatch {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.avatar-bg-swatch:hover {
  transform: scale(1.08);
}

.avatar-bg-swatch--selected {
  border-color: #2d2e5f;
  box-shadow: 0 0 0 2px rgba(45, 46, 95, 0.2);
}

@media (min-width: 640px) {
  .profile-avatar-editor-modal {
    align-items: center;
    padding: 20px;
  }

  .profile-avatar-editor-sheet {
    border-radius: 20px;
    max-height: min(85vh, 720px);
  }

  .profile-avatar-editor-modal--open .profile-avatar-editor-sheet {
    transform: translateY(0);
  }
}

.profile-duo-sidebar-widgets {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-duo-side-hero-wrap {
  display: grid;
  position: relative;
  overflow: visible;
}

.profile-duo-side-card--hero {
  grid-area: 1 / 1;
  text-align: left;
  padding: 20px 18px 18px;
  position: relative;
  overflow: visible;
  z-index: 1;
}

.profile-duo-side-illust {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: start;
  width: 86px;
  height: auto;
  margin-left: -82px;
  z-index: 3;
  pointer-events: none;
}

.profile-duo-side-hero-text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #4b4b4b;
  line-height: 1.45;
}

.profile-duo-side-links {
  display: flex;
  flex-direction: column;
}

.profile-duo-side-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 10px 4px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 800;
  color: #3c3c3c;
  cursor: pointer;
  border-radius: 12px;
  text-align: left;
  transition: background 0.15s;
}

.profile-duo-side-link + .profile-duo-side-link {
  border-top: 2px solid #f2f2f2;
  border-radius: 0 0 12px 12px;
}

.profile-duo-side-link:hover {
  background: #f7f7f7;
}

.profile-duo-side-link:active {
  background: #f0f0f0;
}

.profile-duo-side-link-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-duo-side-link-icon .material-symbols-outlined {
  font-size: 1.25rem;
  font-variation-settings: 'FILL' 1;
}

.profile-duo-side-link-icon--grades {
  background: #ddf4ff;
  color: #1cb0f6;
}

.profile-duo-side-link-icon--streak {
  background: #fff4eb;
  color: #ff9600;
}

.profile-duo-side-link-icon--calc {
  background: #f6ecff;
  color: #ce82ff;
}

.profile-duo-side-link-icon--plans {
  background: #fff8d6;
  color: #d8a800;
}

.profile-duo-side-link-icon--dict {
  background: #e8f5e9;
  color: #2e7d32;
}

.profile-duo-side-link-label {
  flex: 1;
  min-width: 0;
}

.profile-duo-side-chevron {
  margin-left: auto;
  font-size: 1.1rem !important;
  color: #cfcfcf !important;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .profile-duo-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-duo-promo {
    flex-wrap: wrap;
    padding: 16px 18px;
  }

  .profile-duo-promo-illust {
    display: none;
  }

  .profile-duo-promo-btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .profile-duo-page {
    padding: 14px 14px 40px;
  }

  .profile-duo-header {
    margin-bottom: 22px;
  }

  .profile-duo-hero {
    height: 108px;
    border-radius: 18px;
  }

  .profile-duo-header-inner {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    text-align: center;
  }

  .profile-duo-avatar-wrap {
    margin: -58px auto 0;
  }

  .profile-duo-avatar {
    width: 104px;
    height: 104px;
  }

  .profile-duo-header-main {
    width: 100%;
    padding-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .profile-duo-joined {
    justify-content: center;
  }

  .profile-duo-badges {
    justify-content: center;
  }

  .profile-duo-header-actions {
    padding-top: 14px;
  }

  .profile-duo-stats-grid {
    gap: 10px;
  }

  .profile-duo-stat-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .profile-duo-stat-icon .material-symbols-outlined {
    font-size: 1.7rem;
  }

  .profile-duo-stat-value {
    font-size: 1.15rem;
  }

  .profile-duo-achievement {
    padding: 14px;
    gap: 12px;
  }

  .profile-duo-achievement-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .profile-duo-achievement-icon .material-symbols-outlined {
    font-size: 1.6rem;
  }

  .profile-duo-tool-row-card {
    margin-bottom: 10px;
  }

  .profile-duo-tool-row {
    padding: 11px 14px;
    gap: 10px;
  }

  .profile-duo-tool-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .profile-duo-tool-row-icon .material-symbols-outlined {
    font-size: 1.15rem;
  }

  .profile-duo-tool-row-body strong {
    font-size: 0.86rem;
  }

  .profile-duo-tool-row-body small {
    font-size: 0.7rem;
  }

  .profile-duo-tool-row-value {
    font-size: 0.8rem;
  }

  .profile-duo-mobile-quicklinks {
    padding: 4px 12px;
    margin-bottom: 12px;
  }

  .profile-duo-mobile-quicklinks .profile-duo-side-link {
    min-height: 44px;
    padding: 8px 2px;
    font-size: 0.86rem;
    gap: 10px;
  }

  .profile-duo-mobile-quicklinks .profile-duo-side-link-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .profile-duo-mobile-quicklinks .profile-duo-side-link-icon .material-symbols-outlined {
    font-size: 1.1rem;
  }

  .profile-duo-setting-row {
    flex-direction: column;
    align-items: stretch;
  }

  .profile-duo-level-select {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-duo-promo-btn {
    transition: none;
  }
}

/* ── Quicksteps Category Chooser (rendered in main-content) ──────────── */
.qs-chooser-section {
  width: 100%;
}
.qs-chooser-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.qs-category-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(45, 46, 95, 0.08);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  box-shadow: 0 4px 20px rgba(45, 46, 95, 0.08);
}
.qs-category-btn:hover {
  border-color: var(--primary);
  background: rgba(45, 46, 95, 0.03);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(45, 46, 95, 0.12);
}
.qs-category-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(45, 46, 95, 0.04);
  border-radius: 14px;
}
.qs-category-info {
  min-width: 0;
  flex: 1;
}
.qs-category-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-dark);
}
.qs-category-desc {
  font-size: 0.78rem;
  color: var(--text-medium);
  margin-top: 3px;
  line-height: 1.3;
}

