/* Mastory Learner — shared kid-friendly UI */
@import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap");
@import url("/certificate-formal.css?v=2");

:root {
  --bg-top: #fff4d6;
  --bg-mid: #dbeafe;
  --bg-bottom: #ede9fe;
  --ink: #1e1b4b;
  --muted: #64748b;
  --brand: #6366f1;
  --brand-dark: #4f46e5;
  --brand-light: #c7d2fe;
  --card: rgba(255, 255, 255, 0.9);
  --card-border: rgba(255, 255, 255, 0.95);
  --shadow: 0 16px 40px rgba(79, 70, 229, 0.1), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-soft: 0 8px 22px rgba(99, 102, 241, 0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --page-max: 780px;
  --danger: #e11d48;
  --focus-ring: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

* {
  box-sizing: border-box;
}

.hidden,
[hidden] {
  display: none !important;
}

/* Protected pages stay blank until auth.js confirms a signed-in user. */
.protected-content,
#page-wrapper.protected-content {
  display: none !important;
}

.auth-loading {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: "Nunito", "Segoe UI", Tahoma, Arial, sans-serif;
  color: #1f2937;
  background:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(251, 191, 36, 0.14), transparent 55%),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.65) 0%, transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.45) 0%, transparent 18%),
    radial-gradient(circle at 72% 82%, rgba(199, 210, 254, 0.35) 0%, transparent 28%);
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 32px 20px 56px;
  align-self: center;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

#page-wrapper {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  margin-bottom: 28px;
  text-align: center;
  padding: 8px 0 4px;
}

.logo {
  margin: 0;
  font-size: 2.4rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--brand);
}

.tagline {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
  overflow-wrap: anywhere;
  font-size: 1.02rem;
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 20px;
  margin-top: 16px;
}

.top-nav a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.06);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.top-nav a:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.12);
}

.nav-user-email {
  font-size: 0.85rem;
  font-weight: 600;
  color: #475569;
  overflow-wrap: anywhere;
}

.top-nav .btn-logout {
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(225, 29, 72, 0.15);
}

.top-nav .nav-user-email {
  flex-basis: 100%;
  text-align: center;
  margin-top: 4px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 26px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.panel + .panel {
  margin-top: 20px;
}

label.field-label,
.prompt-label {
  display: block;
  margin: 0 0 8px;
  font-weight: 600;
  color: #334155;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.controls {
  margin: 16px 0 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 140px;
  min-width: 0;
  font-weight: 600;
  color: #334155;
  font-size: 0.9rem;
}

select {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.btn-row {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

button,
.btn {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(99, 102, 241, 0.38);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-soft);
}

.btn-secondary:hover:not(:disabled) {
  background: #fff;
  transform: translateY(-1px);
  border-color: var(--brand-light);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
}

#story,
.story-body,
.story-preview {
  white-space: pre-wrap;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#story {
  min-height: 120px;
  padding: 4px 2px;
}

#story:not(.empty):not(.loading):not(.error):not(.safety-warning) {
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.55) 0%, rgba(244, 236, 255, 0.45) 100%);
  border: 1px solid rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
}

#story.empty {
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

#story.loading {
  color: var(--muted);
  font-style: normal;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 120px;
}

.story-loading-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #475569;
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.loading-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--brand);
  animation: loading-dot 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes loading-dot {
  0%,
  80%,
  100% {
    transform: scale(0.65);
    opacity: 0.35;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

#story.error {
  color: var(--danger);
  font-style: normal;
}

#story.error a {
  color: var(--brand);
  font-weight: 700;
}

#story.safety-warning {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 16px;
  font-style: normal;
}

#story.safety-warning a {
  color: #9a3412;
  font-weight: 700;
}

.safety-note {
  margin: 8px 0 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
}

.auth-status {
  margin: 12px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}

.auth-status a {
  color: var(--brand);
  text-decoration: none;
}

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

/* Ordered child flow on the creator page */
.flow-steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  counter-reset: flow;
}

.flow-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.85) 0%, rgba(244, 236, 255, 0.85) 100%);
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.45;
  box-shadow: var(--shadow-soft);
}

.flow-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.flow-steps strong {
  color: var(--ink);
}

/* Welcome / entrance page */
.welcome-wrap {
  position: relative;
  z-index: 1;
}

.welcome-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 32px;
}

.welcome-card h1 {
  margin: 0 0 12px;
  width: 100%;
}

.welcome-card > p:not(.auth-message):not(.reset-lead) {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 420px;
}

/* Auth + choose — centered form stack */
.auth-stack,
.choose-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 320px;
  margin: 24px auto;
}

.auth-stack--wide {
  max-width: 360px;
}

.auth-hint {
  margin: -4px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
}

.privacy-promise {
  margin: 0 auto 20px;
  max-width: 420px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 2px solid #f5d565;
  background: linear-gradient(180deg, #fffbeb 0%, #fff8e1 100%);
  text-align: left;
  box-shadow: 0 8px 24px rgba(120, 84, 0, 0.08);
}

.privacy-promise--profile {
  max-width: none;
}

.privacy-promise__title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 800;
  color: #8a5a00;
}

.privacy-promise__text {
  margin: 0;
  color: #5c4a12;
  font-size: 0.92rem;
  line-height: 1.55;
}

.social-profile-card {
  margin: 0 auto;
  max-width: 480px;
  padding: 20px;
  border-radius: 18px;
  border: 2px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.social-profile-card--signup {
  margin-bottom: 18px;
}

.social-profile-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding: 16px;
  border-radius: 14px;
  background: #f1f5f9;
}

.social-avatar-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.social-profile-preview__text {
  min-width: 0;
  text-align: left;
}

.social-display-preview {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.social-username-preview {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--brand);
}

.social-name-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.social-username-field {
  display: flex;
  align-items: stretch;
}

.social-username-prefix {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 2px solid #cbd5e1;
  border-right: 0;
  border-radius: 12px 0 0 12px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 700;
}

.social-username-input {
  border-radius: 0 12px 12px 0 !important;
}

.social-avatar-colors {
  margin: 0;
  padding: 0;
  border: 0;
}

.social-avatar-colors .profile-label {
  margin-bottom: 10px;
}

.avatar-color-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avatar-color-option {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.avatar-color-option:hover {
  transform: scale(1.08);
}

.avatar-color-option.is-selected {
  border-color: #0f172a;
  transform: scale(1.08);
}

.profile-label-note {
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 520px) {
  .social-name-row {
    grid-template-columns: 1fr;
  }
}

.auth-fields .profile-label {
  display: block;
  margin: 0 0 6px;
  text-align: left;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
}

.auth-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  text-align: left;
}

.auth-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #475569;
  cursor: pointer;
}

.auth-check input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--brand);
}

.auth-check a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

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

.verify-lead,
.verify-help,
.verify-email-line {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  max-width: 420px;
}

.verify-email-line {
  margin-top: 8px;
  font-size: 0.95rem;
}

.verify-help {
  margin-top: 12px;
  font-size: 0.9rem;
}

.profile-verify-note {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-verify-note a {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.profile-verify-note a:hover {
  text-decoration: underline;
}

.auth-fields {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  width: 100%;
}

.password-field {
  position: relative;
  width: 100%;
}

.password-field .auth-input {
  padding-right: 4.5rem;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--brand);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.password-toggle:hover {
  background: rgba(124, 92, 255, 0.08);
}

.password-toggle:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.password-toggle[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn[aria-busy="true"] {
  opacity: 0.85;
  cursor: wait;
}

.auth-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
}

.auth-input[aria-invalid="true"] {
  border-color: #dc2626;
}

.auth-input,
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-input:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

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

.auth-link a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 600;
}

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

.choose-actions .welcome-enter,
.choose-actions .btn,
.auth-stack .welcome-enter,
.auth-stack .btn {
  width: 100%;
  text-align: center;
}

.auth-page .welcome-card h1 {
  font-size: clamp(1.5rem, 5vw, 1.85rem);
  color: var(--ink);
}

.welcome-auth-notice {
  max-width: 360px;
  margin: 12px auto 0;
}

.auth-page .reset-lead,
.auth-page .verify-lead,
.auth-page .verify-help,
.auth-page .verify-email-line {
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.reset-fallback {
  margin-top: 4px;
}

.auth-message {
  margin: 0 auto 16px;
  max-width: 300px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.auth-stack .auth-message {
  margin: 0;
}

.auth-message--error {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.auth-message--success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.profile-panel {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
}

.profile-lead {
  margin: 0 0 24px;
  color: var(--muted);
  text-align: center;
}

.profile-details {
  margin: 0 auto 24px;
  display: grid;
  gap: 16px;
  max-width: 360px;
  width: 100%;
  text-align: left;
}

.profile-detail {
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.profile-detail dt {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.profile-detail dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.profile-actions {
  justify-content: center;
}

.profile-message {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.profile-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
  text-align: left;
}

.profile-section--alt {
  text-align: center;
}

.profile-section h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--ink);
  text-align: center;
}

.profile-section-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: center;
}

.profile-section-lead--compact {
  margin-top: -6px;
  margin-bottom: 14px;
}

.profile-subheading {
  margin: 24px 0 8px;
  font-size: 1.05rem;
  color: var(--ink);
  text-align: center;
}

.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 360px;
  margin: 0 auto;
}

.profile-label {
  display: block;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
}

.profile-delete-check {
  margin: 0;
}

.profile-danger {
  margin-top: 32px;
  padding: 20px 18px 22px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fff5f5;
}

.profile-danger h2 {
  color: #991b1b;
}

.profile-danger .profile-section-lead {
  color: #9f1239;
}

.grownup-gate {
  text-align: center;
}

.grownup-gate-panel {
  max-width: 360px;
  margin: 0 auto;
  text-align: center;
}

.grownup-gate-panel.hidden {
  display: none;
}

.grownup-pin-input {
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.35em;
  font-weight: 800;
  padding-left: 1.25em;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 20px;
}

.pin-key {
  min-height: 52px;
  border: 2px solid rgba(99, 102, 241, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s ease, background 0.12s ease;
}

.pin-key:hover {
  background: #fff;
  transform: translateY(-1px);
}

.pin-key--action {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--brand-dark);
}

.grownup-gate-message {
  max-width: 360px;
  margin: 16px auto 0;
}

.reset-lead {
  margin: 0 0 20px;
  color: var(--muted);
}

.reset-form {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  text-align: center;
}

.reset-email-line {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

.reset-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
}

.reset-input {
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
}

.reset-submit {
  width: 100%;
  margin-top: 4px;
}

.reset-fallback {
  margin: 20px 0 0;
  font-size: 0.9rem;
}

.reset-fallback a {
  color: var(--brand);
  text-decoration: none;
}

.reset-fallback a:hover {
  text-decoration: underline;
}

.welcome-kicker {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.welcome-logo {
  margin: 0 0 16px;
  font-size: 2.8rem;
}

.welcome-lead {
  margin: 0 auto 28px;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.05rem;
}

.welcome-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
  text-align: center;
}

.welcome-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.9) 0%, rgba(244, 236, 255, 0.9) 100%);
  padding: 20px 16px;
  border-radius: 18px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: var(--shadow-soft);
}

.step-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.welcome-step p {
  margin: 0;
  color: #475569;
  line-height: 1.5;
  font-size: 0.95rem;
}

.welcome-step strong {
  color: var(--ink);
}

.brand-link {
  display: block;
  text-decoration: none;
}

.site-brand-logo {
  width: min(240px, 72vw);
  height: auto;
  display: block;
  margin: 0 auto 12px;
  filter: drop-shadow(0 8px 16px rgba(99, 102, 241, 0.12));
}

.social-links {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.social-links li {
  background: linear-gradient(135deg, #fff7e6 0%, #f4ecff 100%);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  padding: 14px 16px;
  color: #475569;
  font-size: 0.95rem;
  text-align: center;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--brand-dark);
  font-weight: 600;
  text-decoration: none;
}

.social-links a:hover {
  text-decoration: underline;
}

.social-links img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.social-database-section {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 22px;
}

.social-schema-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.social-schema-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.social-schema-card h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  color: var(--brand-dark);
}

.social-schema-card p {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.45;
}

.social-safety-strip {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  padding: 18px;
}

.social-safety-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #475569;
  line-height: 1.55;
}

@media (max-width: 720px) {
  .social-schema-grid {
    grid-template-columns: 1fr;
  }
}

.welcome-tagline {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brand-dark);
  text-align: center;
  width: 100%;
}

.welcome-pronounce {
  margin: 0 0 18px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-align: center;
  width: 100%;
}

.welcome-safe {
  margin: 18px 0 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: #475569;
}

.welcome-enter {
  font-size: 1.2rem;
  font-weight: 800;
  padding: 16px 48px;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  white-space: normal;
  line-height: 1.35;
}

.welcome-enter:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.42);
}

.enter-spark {
  display: inline-block;
  margin-left: 6px;
  animation: spark-pulse 1.6s ease-in-out infinite;
}

@keyframes spark-pulse {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.25) rotate(15deg); opacity: 0.7; }
}

.footer-dot {
  margin: 0 10px;
  color: var(--muted);
}

/* Playful floating background (welcome page) */
.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  filter: blur(2px);
}

.cloud-1 { width: 120px; height: 40px; top: 12%; left: 8%; }
.cloud-2 { width: 90px; height: 30px; top: 28%; right: 10%; }
.cloud-3 { width: 150px; height: 46px; bottom: 16%; left: 14%; }

.twinkle {
  position: absolute;
  color: #fbbf24;
  font-size: 1.25rem;
  opacity: 0.8;
  animation: twinkle 3s ease-in-out infinite;
}

.twinkle-1 { top: 18%; right: 22%; animation-delay: 0s; }
.twinkle-2 { top: 40%; left: 12%; color: #818cf8; animation-delay: 0.6s; }
.twinkle-3 { bottom: 24%; right: 16%; animation-delay: 1.2s; }
.twinkle-4 { top: 64%; left: 22%; color: #f472b6; animation-delay: 1.8s; }
.twinkle-5 { bottom: 12%; right: 30%; animation-delay: 2.4s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
  .enter-spark,
  .twinkle,
  .loading-dots span {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

.welcome-footer a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.welcome-footer a:hover {
  text-decoration: underline;
}

.questions-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
  text-align: left;
}

.questions-section.hidden {
  display: none;
}

.questions-section h2 {
  margin: 0 0 12px;
  font-size: 1.2rem;
  color: var(--ink);
}

.questions-section ol {
  margin: 0;
  padding-left: 1.25rem;
  line-height: 1.7;
  color: #334155;
}

.questions-section li + li {
  margin-top: 8px;
}

.grownups-intro,
.legal-card {
  overflow-wrap: anywhere;
  max-width: 100%;
}

.grownups-intro {
  font-size: 1.05rem;
  color: #334155 !important;
  background: linear-gradient(135deg, rgba(255, 247, 230, 0.9) 0%, rgba(244, 236, 255, 0.9) 100%);
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(99, 102, 241, 0.14);
  box-shadow: var(--shadow-soft);
}

.legal-card .section {
  margin-top: 24px;
}

.legal-card h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--ink);
}

.legal-card p {
  margin: 0 0 8px;
  color: #475569;
  line-height: 1.7;
}

.legal-card ul {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  color: #475569;
  line-height: 1.6;
}

.legal-card li + li {
  margin-top: 6px;
}

.story-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 22px;
  margin-top: 18px;
  line-height: 1.65;
  max-width: 100%;
  overflow-wrap: anywhere;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.story-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(79, 70, 229, 0.14);
}

.story-card-title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.3;
  text-align: center;
}

.story-card .meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  justify-content: center;
}

.story-date {
  font-weight: 600;
  color: #475569;
}

.story-tags {
  text-transform: capitalize;
}

.story-card .story-preview {
  color: #334155;
  margin: 12px 0 16px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.reader-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 5vw, 1.75rem);
  color: var(--ink);
  overflow-wrap: anywhere;
  line-height: 1.25;
  text-align: center;
}

.reader-meta {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e2e8f0;
  text-align: center;
}

.status {
  margin-top: 12px;
  font-size: 14px;
  color: #059669;
  min-height: 1.25em;
  text-align: center;
}

footer,
.site-footer,
.welcome-footer {
  margin-top: auto;
  padding-top: 28px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  overflow-wrap: anywhere;
  width: 100%;
}

footer a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.loading-text,
#stories {
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

@media (max-width: 768px) {
  .wrap {
    padding: 24px 16px 40px;
  }

  .panel {
    padding: 18px;
  }

  .welcome-steps,
  .flow-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .story-card {
    padding: 18px;
  }
}

@media (max-width: 540px) {
  .wrap {
    padding: 20px 14px 32px;
  }

  .logo {
    font-size: 2rem;
  }

  .panel {
    padding: 16px;
  }

  .controls {
    flex-direction: column;
  }

  .controls label {
    flex: 1 1 auto;
    width: 100%;
  }

  .welcome-card {
    padding: 28px 18px;
  }

  .welcome-steps,
  .flow-steps {
    grid-template-columns: 1fr;
  }

  .welcome-step {
    flex-direction: row;
    text-align: left;
    align-items: center;
    gap: 14px;
  }

  .welcome-enter {
    display: block;
    width: 100%;
    max-width: 100%;
    text-align: center;
    padding-left: 20px;
    padding-right: 20px;
  }

  .btn-row {
    width: 100%;
  }

  .btn-row button,
  .btn-row .btn,
  .card-actions .btn,
  .card-actions button,
  .story-actions button {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }

  .card-actions,
  .story-actions {
    width: 100%;
  }

  footer,
  .site-footer,
  .welcome-footer {
    font-size: 0.8rem;
    padding-top: 24px;
  }
}

@media (max-width: 380px) {
  .wrap {
    padding: 16px 12px 28px;
  }

  .footer-dot {
    display: none;
  }

  footer a,
  .site-footer a,
  .welcome-footer a {
    display: block;
    margin: 4px 0;
  }
}

/* Settings page — dark mobile-style layout */
.settings-page {
  background: #000;
  color: #fff;
  min-height: 100vh;
  min-height: 100dvh;
}

.settings-page::before {
  display: none;
}

.settings-page .auth-loading.settings-loading {
  background: #000;
  color: #a3a3a3;
}

.settings-app {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.settings-shell,
.settings-gate {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.settings-topbar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  padding: 12px 8px 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.settings-back {
  appearance: none;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.settings-title {
  margin: 0;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.settings-scroll,
.settings-subpage-body,
.settings-gate-body {
  flex: 1;
  padding: 8px 0 32px;
  overflow-y: auto;
}

.settings-group {
  margin-top: 18px;
}

.settings-group-label {
  margin: 0 0 8px;
  padding: 0 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #737373;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-bottom: 1px solid #1f1f1f;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease;
}

.settings-row:hover,
.settings-row:focus-visible {
  background: #111;
  outline: none;
}

.settings-row--danger {
  color: #ef4444;
}

.settings-row--danger .settings-icon {
  color: #ef4444;
}

.settings-row--toggle {
  cursor: default;
}

.settings-row--toggle:hover {
  background: transparent;
}

.settings-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: #fff;
  display: inline-flex;
}

.settings-icon svg {
  width: 100%;
  height: 100%;
}

.settings-row-text {
  flex: 1;
}

.settings-chevron {
  color: #525252;
  font-size: 1.25rem;
  line-height: 1;
}

.settings-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #a3a3a3;
  margin-right: 4px;
}

.settings-badge--warn {
  color: #fbbf24;
}

.settings-switch {
  position: relative;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
}

.settings-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #404040;
  transition: background 0.15s ease;
}

.settings-switch-slider::before {
  content: "";
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}

.settings-switch input:checked + .settings-switch-slider {
  background: #6366f1;
}

.settings-switch input:checked + .settings-switch-slider::before {
  transform: translateX(18px);
}

.settings-subpage.hidden,
.settings-shell.hidden,
.settings-gate[hidden] {
  display: none !important;
}

.settings-subtitle {
  margin: 28px 20px 8px;
  font-size: 1.05rem;
  color: #fff;
}

.settings-subtitle--danger {
  color: #f87171;
}

.settings-sublead,
.settings-gate-lead,
.settings-gate-note {
  margin: 0 20px 16px;
  color: #a3a3a3;
  font-size: 0.92rem;
  line-height: 1.5;
}

.settings-details {
  margin: 0;
  padding: 0 20px;
  display: grid;
  gap: 0;
}

.settings-detail {
  padding: 16px 0;
  border-bottom: 1px solid #1f1f1f;
}

.settings-detail dt {
  margin: 0 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #737373;
}

.settings-detail dd {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  word-break: break-word;
}

.settings-page .profile-form {
  padding: 0 20px;
  max-width: none;
}

.settings-page .profile-label,
.settings-page .auth-check {
  color: #d4d4d4;
}

.settings-page .auth-input,
.settings-page input[type="password"] {
  background: #111;
  border-color: #333;
  color: #fff;
}

.settings-page .auth-input:focus,
.settings-page input[type="password"]:focus {
  border-color: #6366f1;
}

.settings-page .password-toggle {
  color: #a5b4fc;
}

.settings-page .btn-primary {
  width: 100%;
}

.settings-secondary-action {
  display: block;
  width: calc(100% - 40px);
  margin: 16px 20px 0;
}

.settings-page .profile-message,
.settings-page .auth-message {
  margin: 16px 20px;
  max-width: none;
}

.settings-page .profile-verify-note {
  margin: 16px 20px;
  background: #1c1408;
  border-color: #713f12;
  color: #fcd34d;
}

.settings-page .profile-verify-note a {
  color: #a5b4fc;
}

.settings-page .pin-key {
  background: #111;
  border-color: #333;
  color: #fff;
}

.settings-page .pin-key:hover {
  background: #1a1a1a;
}

.settings-gate-link {
  text-align: center;
  margin-top: 16px;
}

.settings-gate-link a {
  color: #a5b4fc;
}

.settings-group--last {
  padding-bottom: 24px;
}

.profile-section--progress .profile-actions {
  display: flex;
  justify-content: center;
}

.profile-read-cert-wrap {
  max-width: 100%;
  margin: 0 auto 16px;
  text-align: left;
}

.profile-read-cert-summary {
  margin: 0 0 14px;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

.profile-read-cert-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 14px;
}

.profile-read-cert-stat {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.78rem;
  color: var(--muted);
}

.profile-read-cert-stat strong {
  display: block;
  margin-top: 2px;
  font-size: 1rem;
  color: var(--ink);
}

.profile-read-cert-wrap {
  margin-top: 8px;
}

.profile-read-cert-wrap .read-certificate--formal {
  box-shadow: var(--shadow-soft);
}

.profile-read-cert-loading {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .profile-read-cert-stats {
    grid-template-columns: 1fr;
  }
}

body.studio-page .wrap {
  max-width: var(--page-max);
}

body.studio-page .site-header {
  margin-bottom: 12px;
}

.studio-dash {
  margin: 0 auto;
  padding: 8px 0 24px;
}

.studio-dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.studio-dash-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-dash-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ink);
}

.studio-dash-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.studio-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.studio-live-badge--dark {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: var(--brand-dark);
}

.studio-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: studio-live-pulse 1.8s ease-out infinite;
}

@keyframes studio-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

.studio-dash-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.studio-widget {
  background: var(--card);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px 16px 14px;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.studio-widget--wide {
  min-height: 380px;
}

.studio-widget--certificate {
  min-height: auto;
}

.studio-widget--certificate .profile-read-cert-wrap {
  margin-bottom: 0;
}

.studio-widget-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.studio-widget-head h2 {
  margin: 0 0 4px;
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--ink);
}

.studio-widget-head p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.studio-chart-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
}

.studio-chart-wrap--short {
  min-height: 170px;
}

.studio-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.studio-kpi {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.studio-kpi-label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-kpi-value {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.1;
  color: var(--ink);
}

.studio-kpi-value--text {
  font-size: 1rem;
}

.studio-dash-note {
  margin: 10px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.studio-dash-note--met {
  color: #166534;
}

.studio-feed-status--dark {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.studio-periods--dark {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.studio-periods--dark .studio-period {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
  opacity: 0.85;
}

.studio-periods--dark .studio-period-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.studio-periods--dark .studio-period-status {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}

.studio-periods--dark .studio-period--current {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
  opacity: 1;
}

.studio-periods--dark .studio-period--active {
  opacity: 1;
  border-color: rgba(34, 197, 94, 0.4);
  background: #f0fdf4;
}

.studio-periods--dark .studio-period--active .studio-period-status {
  color: #166534;
}

.studio-activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}

.studio-activity-list--dark .studio-activity-item {
  display: block;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.studio-activity-list--dark .studio-activity-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

.studio-activity-list--dark .studio-activity-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--ink);
}

.studio-activity-empty {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed rgba(148, 163, 184, 0.4);
  color: var(--muted);
  text-align: center;
  font-size: 0.88rem;
  line-height: 1.5;
}

.studio-activity-item--new {
  animation: studio-event-in 0.55s ease;
  border-color: rgba(99, 102, 241, 0.4) !important;
  background: rgba(199, 210, 254, 0.35) !important;
}

@keyframes studio-event-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.studio-back {
  margin: 18px 0 0;
  text-align: center;
}

.studio-back-btn {
  min-width: 200px;
}

.social-studio {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

.studio-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 720px;
  padding: 16px 12px;
  border: 1px solid #e7eaf0;
  border-radius: 14px;
  background: #ffffff;
}

.studio-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: #111827;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
}

.studio-sidebar-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.studio-menu {
  display: grid;
  gap: 6px;
}

.studio-menu-item,
.studio-sidebar-foot a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #4b5563;
  font-size: 0.88rem;
  font-weight: 650;
  text-decoration: none;
}

.studio-menu-item--active {
  background: #edf5ff;
  color: #2563eb;
}

.studio-sidebar-group {
  display: grid;
  gap: 12px;
  margin-top: 24px;
  padding: 12px;
}

.studio-sidebar-group p {
  margin: 0 0 2px;
  color: #111827;
  font-size: 0.9rem;
  font-weight: 800;
}

.studio-sidebar-group span {
  color: #4b5563;
  font-size: 0.86rem;
}

.studio-sidebar-foot {
  display: grid;
  gap: 4px;
  margin-top: auto;
}

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

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.studio-search {
  position: relative;
  flex: 1;
  max-width: 430px;
}

.studio-search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.studio-search input {
  width: 100%;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0 16px;
  background: #f8fafc;
  color: #111827;
  font: inherit;
}

.studio-top-actions,
.studio-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.studio-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 0.84rem;
}

.studio-user-chip span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  color: #ffffff;
  font-size: 0.72rem;
}

.studio-page-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.studio-page-head h1 {
  margin: 0;
  color: #111827;
  font-size: 1.7rem;
}

.studio-dash-kicker {
  color: #6b7280;
}

.studio-filter-row button,
.studio-widget-head button,
.studio-add-social {
  min-height: 40px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0 12px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.studio-add-social {
  border-color: #2f80ed;
  background: #2f80ed;
  color: #ffffff;
}

.studio-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(420px, 2fr);
  gap: 14px;
}

.studio-widget {
  min-height: 0;
  border: 1px solid #e8ecf3;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.studio-widget--growth {
  grid-row: span 2;
}

.studio-widget--country,
.studio-widget--activity {
  grid-column: span 1;
}

.studio-widget-head h2 {
  color: #111827;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.96rem;
}

.studio-widget-head p {
  color: #6b7280;
}

.studio-growth-meter {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 150px;
}

.studio-growth-arc {
  width: 168px;
  aspect-ratio: 2 / 1;
  border-radius: 168px 168px 0 0;
  background: conic-gradient(from 270deg, #2f80ed 0 58%, #22c7d9 58% 72%, #e5e7eb 72% 100%);
  mask: radial-gradient(circle at 50% 100%, transparent 0 47%, #000 48%);
}

.studio-growth-score {
  margin-top: -52px;
  color: #111827;
  font-size: 1.8rem;
}

.studio-growth-meter span {
  color: #4b5563;
  font-size: 0.76rem;
  font-weight: 750;
}

.studio-platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.studio-platform-card {
  padding: 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
}

.studio-platform-card span,
.studio-platform-card small {
  display: block;
  color: #6b7280;
  font-size: 0.72rem;
}

.studio-platform-card strong {
  display: block;
  margin: 4px 0 2px;
  color: #111827;
  font-size: 1rem;
}

.studio-total-followers {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.studio-total-followers strong {
  color: #111827;
  font-size: 2rem;
}

.studio-total-followers span {
  color: #14a66f;
  font-size: 0.78rem;
  font-weight: 750;
}

.studio-channel-bars {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.studio-channel-bars div {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #111827;
  font-size: 0.82rem;
  font-weight: 700;
}

.studio-channel-bars i {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22c7d9 var(--bar), #e8edf2 var(--bar));
}

.studio-chart-wrap--growth {
  min-height: 260px;
}

.studio-chart-wrap--donut {
  min-height: 190px;
}

.studio-chart-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.studio-chart-gallery .studio-widget--wide {
  grid-column: 1 / -1;
}

.studio-kpi-row--top {
  margin-bottom: 14px;
}

.studio-heatmap {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin: 8px 0 14px;
}

.studio-heatmap span {
  height: 28px;
  border-radius: 4px;
  background: #e8edf2;
}

.studio-chart-wrap--sessions {
  min-height: 140px;
}

.studio-chart-wrap--hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.studio-periods--dark .studio-period {
  background: #f8fafc;
  border-color: #e5e7eb;
}

.studio-periods--dark .studio-period-name {
  color: #111827;
}

.studio-periods--dark .studio-period-status {
  color: #6b7280;
}

.studio-periods--dark .studio-period--current {
  border-color: rgba(47, 128, 237, 0.45);
  box-shadow: inset 0 0 0 1px rgba(47, 128, 237, 0.12);
}

.studio-periods--dark .studio-period--active {
  background: #edfdf8;
  border-color: rgba(20, 166, 111, 0.35);
}

.studio-periods--dark .studio-period--active .studio-period-status {
  color: #14a66f;
}

.studio-map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
  color: #111827;
  font-size: 0.78rem;
  font-weight: 750;
}

.studio-dot-map {
  position: relative;
  min-height: 180px;
  border-radius: 8px;
  background-image: radial-gradient(#cbd5e1 1.4px, transparent 1.4px);
  background-size: 8px 8px;
  background-color: #f8fafc;
  overflow: hidden;
}

.studio-dot-map i {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #cbd5e1;
  opacity: 0.45;
  box-shadow: none;
  transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.studio-dot-map i.is-on {
  opacity: 1;
  background: #14b8a6;
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.16);
}

.studio-dot-map i[data-period="noon"].is-on { background: #84cc16; box-shadow: 0 0 0 5px rgba(132, 204, 22, 0.16); }
.studio-dot-map i[data-period="night"].is-on { background: #4b5563; box-shadow: 0 0 0 5px rgba(75, 85, 99, 0.16); }
.studio-dot-map i[data-period="goal"].is-on { background: #0ea5e9; box-shadow: 0 0 0 5px rgba(14, 165, 233, 0.16); }
.studio-dot-map i[data-period="stories"].is-on { background: #a3e635; box-shadow: 0 0 0 5px rgba(163, 230, 53, 0.16); }
.studio-dot-map i[data-period="views"].is-on { background: #6366f1; box-shadow: 0 0 0 5px rgba(99, 102, 241, 0.16); }

.studio-widget--titles .studio-activity-list {
  max-height: 260px;
  overflow: auto;
  margin: 0;
}

.studio-dot-map i:nth-child(1) { left: 18%; top: 34%; }
.studio-dot-map i:nth-child(2) { left: 46%; top: 34%; background: #9333ea; }
.studio-dot-map i:nth-child(3) { left: 76%; top: 45%; background: #111827; }
.studio-dot-map i:nth-child(4) { left: 30%; top: 74%; background: #84cc16; }
.studio-dot-map i:nth-child(5) { left: 56%; top: 66%; background: #a3e635; }
.studio-dot-map i:nth-child(6) { left: 82%; top: 70%; background: #d946ef; }

.studio-kpi-row--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
}

.studio-kpi {
  background: #f8fafc;
  border-color: #e5e7eb;
}

.studio-kpi-label {
  color: #6b7280;
}

.studio-kpi-value,
.studio-kpi-value--text {
  color: #111827;
}

.studio-feed-status--dark {
  background: #eaf8ff;
  color: #1177c8;
}

.studio-activity-list--dark .studio-activity-item {
  background: #f8fafc;
  border-color: #e5e7eb;
}

.studio-activity-list--dark .studio-activity-time {
  color: #6b7280;
}

.studio-activity-list--dark .studio-activity-text {
  color: #111827;
}

.studio-activity-empty {
  background: #f8fafc;
  border-color: #d8dee8;
  color: #6b7280;
}

.studio-dash-note {
  color: #4b5563;
}

.studio-dash-note--met {
  color: #14a66f;
}

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

  .studio-sidebar {
    min-height: auto;
  }

  .studio-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .studio-dash-grid {
    grid-template-columns: 1fr;
  }

  .studio-chart-gallery {
    grid-template-columns: 1fr;
  }

  .studio-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body.studio-page .wrap {
    padding: 12px;
  }

  .social-studio {
    padding: 12px;
  }

  .studio-topbar,
  .studio-page-head,
  .studio-filter-row,
  .studio-top-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-platforms,
  .studio-kpi-row--compact {
    grid-template-columns: 1fr;
  }

  .studio-dash-header {
    flex-direction: column;
  }

  .studio-periods--dark {
    grid-template-columns: 1fr;
  }

  .studio-activity-list--dark .studio-activity-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* Remove story / account data modals */
body.modal-open {
  overflow: hidden;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  animation: confirm-fade-in 0.18s ease;
}

@keyframes confirm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confirm-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: min(92vh, 720px);
  overflow: auto;
  padding: 28px 24px 22px;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

.confirm-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.8);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.confirm-dialog-close:hover {
  background: #e2e8f0;
}

.confirm-dialog-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(225, 29, 72, 0.12);
  color: var(--danger);
  font-size: 1.35rem;
  font-weight: 800;
}

.confirm-dialog-title {
  margin: 0 0 10px;
  text-align: center;
  color: var(--ink);
  font-size: 1.45rem;
}

.confirm-dialog-lead {
  margin: 0 0 16px;
  text-align: center;
  color: #475569;
  line-height: 1.55;
}

.confirm-choice-group {
  margin: 0 0 16px;
  padding: 0;
  border: none;
}

.confirm-choice-legend {
  margin-bottom: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.confirm-choice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 2px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.75);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.confirm-choice:has(input:checked) {
  border-color: var(--brand-light);
  box-shadow: var(--shadow-soft);
}

.confirm-choice input {
  margin-top: 4px;
  accent-color: var(--brand);
}

.confirm-choice-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--ink);
}

.confirm-choice-text span {
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
}

.confirm-delete-field {
  margin-bottom: 8px;
}

.confirm-dialog-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.confirm-dialog-footer .btn {
  min-width: 132px;
}

.data-saver-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.data-saver-item {
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.85);
}

.data-saver-item-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  color: var(--ink);
}

.data-saver-item-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.data-saver-item-preview {
  margin: 0 0 12px;
  color: #475569;
  font-size: 0.95rem;
  line-height: 1.55;
}

.data-saver-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Software update modal */
html.update-pending .sky,
html.update-pending .welcome-wrap {
  visibility: hidden;
}

html.update-pending body.welcome-page {
  background:
    radial-gradient(ellipse 120% 70% at 50% -15%, rgba(251, 191, 36, 0.14), transparent 55%),
    linear-gradient(165deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
}

.update-overlay {
  z-index: 10000;
}

.update-dialog-icon {
  background: rgba(99, 102, 241, 0.14);
  color: var(--brand-dark);
}

.update-dialog-footer {
  justify-content: center;
}

.library-notice {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-align: center;
}

.library-notice--success {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.library-notice--error {
  background: rgba(225, 29, 72, 0.1);
  color: #be123c;
  border: 1px solid rgba(225, 29, 72, 0.2);
}

@media (max-width: 560px) {
  .confirm-dialog-footer {
    flex-direction: column;
  }

  .confirm-dialog-footer .btn {
    width: 100%;
    min-width: 0;
  }
}

/* Signup: same Mastory colors as before; simplified fields (no phone / birthday) */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.signup-card .privacy-promise {
  margin-top: 18px;
}

.signup-form {
  max-width: 420px;
}

.signup-form .auth-fields {
  width: 100%;
}

.signup-legal {
  max-width: 420px;
  text-align: left;
}

/* —— Accounts Center (Account / profile) — light Mastory colors —— */
body.accounts-center-page {
  --ac-surface: rgba(255, 255, 255, 0.92);
  --ac-surface-2: rgba(255, 255, 255, 0.96);
  --ac-border: rgba(148, 163, 184, 0.28);
  --ac-text: var(--ink);
  --ac-muted: var(--muted);
  --ac-link: var(--brand-dark);
  color-scheme: light;
  color: var(--ac-text);
}

body.accounts-center-page .auth-loading {
  color: var(--muted);
}

body.accounts-center-page #page-wrapper,
body.accounts-center-page .ac-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.ac-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 16px 20px 40px;
}

.ac-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.ac-brand .site-brand-logo {
  height: 42px;
  width: auto;
}

.ac-top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.ac-top-nav a {
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 700;
}

.ac-top-nav a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.ac-gate {
  background: var(--card);
  border: 1px solid var(--card-border);
  color: var(--ink);
  max-width: 420px;
  margin: 24px auto;
  padding: 28px 22px 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ac-gate .profile-lead,
.ac-gate .profile-section-lead {
  color: var(--muted);
}

.ac-gate h1,
.ac-gate h2 {
  color: var(--ink);
}

.ac-gate .btn.welcome-enter {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 8px auto 0;
}

.ac-gate .auth-link {
  margin-top: 28px;
}

.ac-gate .auth-link a {
  color: var(--brand);
}

.ac-gate .auth-link a:hover {
  color: var(--brand-dark);
}

.ac-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ac-sidebar {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--radius);
  padding: 22px 16px 18px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
}

.ac-sidebar-head h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.ac-sidebar-head p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.ac-sidebar-head a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
}

.ac-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ac-nav-label {
  margin: 14px 8px 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ac-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  border-radius: 12px;
  padding: 12px 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.ac-nav-item:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--brand-dark);
}

.ac-nav-item.is-active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16) 0%, rgba(124, 58, 237, 0.12) 100%);
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.22);
}

.ac-nav-item--bottom {
  margin-top: 10px;
}

.ac-nav-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  color: var(--brand);
  opacity: 0.95;
}

.ac-nav-item.is-active .ac-nav-icon {
  color: var(--brand-dark);
}

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

.ac-panel {
  display: none;
}

.ac-panel.is-active {
  display: block;
}

.ac-panel-head {
  margin: 4px 0 18px;
}

.ac-panel-head h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.7rem;
  letter-spacing: -0.02em;
}

.ac-panel-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 46rem;
}

.ac-section-title {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 1.05rem;
}

.ac-profile-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--ac-border);
  background: var(--ac-surface-2);
  color: inherit;
  border-radius: 16px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  margin-bottom: 12px;
  box-shadow: var(--shadow-soft);
}

.ac-profile-row:hover {
  border-color: var(--brand-light);
}

.ac-profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.ac-profile-row-text {
  flex: 1;
  min-width: 0;
}

.ac-profile-row-text strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.ac-profile-row-text span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
  margin-top: 2px;
}

.ac-chevron {
  color: var(--brand);
  font-size: 1.4rem;
  line-height: 1;
}

.ac-card {
  background: var(--ac-surface-2);
  border: 1px solid var(--ac-border);
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-soft);
}

.ac-card--danger {
  border-color: rgba(225, 29, 72, 0.35);
  background: #fff5f5;
}

.ac-card-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.ac-profile-editor.is-collapsed,
#ac-profile-editor.is-collapsed {
  display: none;
}

.accounts-center-page .privacy-promise {
  background: linear-gradient(180deg, #fffbeb 0%, #fff8e1 100%);
  border: 2px solid #f5d565;
  color: #5c4a12;
  box-shadow: 0 8px 24px rgba(120, 84, 0, 0.08);
}

.accounts-center-page .privacy-promise__title {
  color: #8a5a00;
}

.accounts-center-page .privacy-promise__text {
  color: #5c4a12;
}

.accounts-center-page .profile-label,
.accounts-center-page .profile-section-lead,
.accounts-center-page .auth-check,
.accounts-center-page .auth-hint {
  color: var(--muted);
}

.accounts-center-page .auth-input,
.accounts-center-page .password-field .auth-input,
.accounts-center-page select.auth-input {
  background: rgba(255, 255, 255, 0.95);
  border-color: #e2e8f0;
  color: var(--ink);
}

.accounts-center-page .auth-input:focus,
.accounts-center-page .password-field .auth-input:focus {
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.accounts-center-page .password-toggle {
  color: var(--muted);
}

.accounts-center-page .social-username-field {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.accounts-center-page .social-username-prefix {
  color: var(--brand);
}

.accounts-center-page .avatar-color-option.is-selected {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.35);
}

.accounts-center-page .ac-details {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: 16px;
  padding: 8px 16px;
  max-width: none;
  box-shadow: var(--shadow-soft);
}

.accounts-center-page .profile-detail {
  border-color: rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.7);
}

.accounts-center-page .profile-detail dt {
  color: var(--muted);
}

.accounts-center-page .profile-detail dd {
  color: var(--ink);
}

.accounts-center-page .profile-verify-note {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.accounts-center-page .profile-verify-note a,
.accounts-center-page .auth-link a {
  color: var(--brand);
}

.accounts-center-page .btn-primary,
.accounts-center-page .btn.btn-primary,
.accounts-center-page .welcome-enter.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  color: #fff;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
  border-radius: 999px;
}

.accounts-center-page .btn-primary:hover:not(:disabled),
.accounts-center-page .btn.btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.42);
}

.accounts-center-page .btn-secondary,
.accounts-center-page .btn.btn-secondary {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: 2px solid #e2e8f0;
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
}

.accounts-center-page .btn-secondary:hover:not(:disabled) {
  background: #fff;
  border-color: var(--brand-light);
}

.accounts-center-page .btn-danger,
.accounts-center-page .btn.btn-danger {
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
}

.accounts-center-page .btn-danger:hover:not(:disabled) {
  background: #b91c1c;
}

.accounts-center-page .pin-key {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid rgba(99, 102, 241, 0.14);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.accounts-center-page .pin-key:hover {
  background: #fff;
}

.accounts-center-page .pin-key--action {
  color: var(--brand-dark);
}

.accounts-center-page .grownup-pin-input {
  background: rgba(255, 255, 255, 0.95);
  border-color: #e2e8f0;
  color: var(--ink);
}

.ac-message {
  margin-bottom: 12px;
}

.ac-footer {
  margin-top: 28px;
  color: var(--muted);
}

.ac-footer a {
  color: var(--brand-dark);
}

@media (max-width: 860px) {
  .ac-layout {
    grid-template-columns: 1fr;
  }

  .ac-shell,
  #page-wrapper {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ac-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .ac-nav-item--bottom {
    margin-top: 10px;
  }

  .ac-panel-head h2 {
    font-size: 1.4rem;
  }
}


