/* ==========================================================================
   Estilo NutriFit para Trujillo Guides (ATM Software Labs)
   Minimalista: fondo #FAFAFA / #09090B, tarjetas blancas / zinc-900,
   acento menta (#047857 / #10B981), Outfit autoalojada, radios de 16px.
   Se carga la última para sobrescribir tokens y componentes sin tocar el JS.
   ========================================================================== */
/* Inter variable (fontsource-variable 5, latin, OFL): one file for every weight */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations'), url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/outfit-latin-var.woff2') format('woff2');
}

html[data-theme], html[data-theme] body, :root {
  /* ATM baseline font stack (self-hosted Inter), shared with apex, labs, invest, charts and tools. */
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-sans: var(--font);
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Code", Menlo, monospace;
  --font-mono: var(--mono);
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px 0 rgb(0 0 0 / .04), 0 1px 1px -1px rgb(0 0 0 / .03);
  --shadow-lift: 0 8px 24px -12px rgb(0 0 0 / .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

html[data-theme="light"], html[data-theme="light"] body {
  color-scheme: light;
  --bg: #FAFAFA; --bg-elev: #FFFFFF; --bg-card: #FFFFFF; --bg-card-hover: #F4F4F5;
  --bg-card-subtle: #F4F4F5; --bg-code: #F4F4F5;
  --line: #E4E4E7; --line-strong: #D4D4D8; --border: #E4E4E7; --border-subtle: #F4F4F5; --border-focus: #059669;
  --text: #18181b; --text-primary: #18181b; --muted: #52525B; --text-secondary: #52525B; --dim: #71717A; --text-muted: #71717A;
  --white: #18181b;
  --accent: #047857; --accent-cyan: #047857; --accent-pill: #047857; --accent-pill-text: #FFFFFF; --green: #047857;
  --accent-soft: #ECFDF5;
  --header-bg: rgba(250, 250, 250, .85); --header-border: #E4E4E7;
  --shadow-dropdown: 0 8px 24px -12px rgb(0 0 0 / .18);
}
html[data-theme="dark"], html[data-theme="dark"] body {
  color-scheme: dark;
  --bg: #09090B; --bg-elev: #18181B; --bg-card: #18181B; --bg-card-hover: #27272A;
  --bg-card-subtle: #111113; --bg-code: #111113;
  --line: #27272A; --line-strong: #3F3F46; --border: #27272A; --border-subtle: #1F1F23; --border-focus: #34D399;
  --text: #FAFAFA; --text-primary: #FAFAFA; --muted: #A1A1AA; --text-secondary: #A1A1AA; --dim: #71717A; --text-muted: #71717A;
  --white: #FAFAFA;
  --accent: #34D399; --accent-cyan: #34D399; --accent-pill: #10B981; --accent-pill-text: #052E1F; --green: #10B981;
  --accent-soft: rgba(16, 185, 129, .12);
  --header-bg: rgba(9, 9, 11, .85); --header-border: #27272A;
  --shadow-dropdown: 0 8px 24px -12px rgb(0 0 0 / .6);
}

html body, html body.docs-body, html body.community-body {
  font-family: var(--font) !important;
  background: var(--bg) !important;
  background-image: none !important;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}
html body button, html body input, html body select, html body textarea { font-family: var(--font) !important; }
html body code, html body pre, html body kbd { font-family: var(--mono) !important; }

/* Cabecera: barra limpia, translúcida, con borde fino */
html body .docs-topbar {
  background: var(--header-bg) !important;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--header-border) !important;
  box-shadow: none !important;
}
html body .docs-topbar .brand { font-weight: 600; letter-spacing: -.01em; color: var(--text-primary); }
html body .brand-avatar { border-radius: 10px; }

/* Botones: primario menta, secundarios con borde, radios redondeados */
html body .account-login, html body .nav-profile-btn.account-login,
html body .btn-primary, html body .auth-submit, html body #auth-submit-action, html body .nf-cta {
  background: var(--accent-pill) !important;
  color: var(--accent-pill-text) !important;
  border: 0 !important;
  border-radius: 12px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
html body #publish-btn, html body .btn-publish, html body button[type="submit"].btn-publish,
html body .write-actions button[type="submit"], html body .forum-compose button[type="submit"] {
  background: #10B981 !important;
  color: #ffffff !important;
  border: 1px solid #10B981 !important;
  border-radius: 10px !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25) !important;
}
html body #publish-btn svg, html body .btn-publish svg, html body .forum-compose button[type="submit"] svg {
  stroke: #ffffff !important;
  color: #ffffff !important;
}
html body #publish-btn:hover, html body .btn-publish:hover,
html body .write-actions button[type="submit"]:hover, html body .forum-compose button[type="submit"]:hover {
  background: #059669 !important;
  color: #ffffff !important;
}
html[data-theme="light"] body .account-login:hover, html[data-theme="light"] body #auth-submit-action:hover { background: #065F46 !important; }
html[data-theme="dark"] body .account-login:hover, html[data-theme="dark"] body #auth-submit-action:hover { background: #34D399 !important; }
html body .meta-chip, html body .social-bar button, html body .theme-toggle, html body .lang-btn,
html body .topbar-actions > button:not(.account-login), html body .auth-social-btn, html body #auth-guest-action {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-primary) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-card) !important;
}
html body .meta-chip:hover, html body .social-bar button:hover, html body .auth-social-btn:hover { background: var(--bg-card-hover) !important; }

/* Portada */
html body .kicker { color: var(--accent) !important; font-weight: 600; letter-spacing: .08em; }
html body .hero h1, html body .page-title { font-weight: 600 !important; letter-spacing: -.02em; color: var(--text-primary) !important; }
html body .lede, html body .page-subtitle { color: var(--text-secondary) !important; font-weight: 400; }
html body .home-search input, html body .home-filters select, html body input[type="search"],
html body input[type="text"], html body input[type="email"], html body input[type="password"], html body textarea, html body select {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: 14px !important;
  color: var(--text-primary) !important;
  box-shadow: var(--shadow-card) !important;
  min-height: 48px;
}
html body input:focus, html body select:focus, html body textarea:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
  outline: none !important;
}
html body input[type="checkbox"] { accent-color: var(--accent-pill); min-height: 0; box-shadow: none !important; }

/* Tarjetas */
html body .guide-card, html body .attach-card, html body .ach-card, html body .achievement-card,
html body .settings-card, html body .doc-sidebar .article-toc, html body .feed-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-card) !important;
  background-image: none !important;
}
html body .guide-card { border-left-width: 1px !important; transition: box-shadow .25s var(--ease), transform .25s var(--ease), border-color .25s; }
html body .guide-card:hover { box-shadow: var(--shadow-lift) !important; transform: translateY(-1px); border-color: var(--line-strong) !important; }
html body .guide-card-avatar { background: var(--accent-soft) !important; color: var(--accent) !important; border-radius: 12px !important; }
html body .home-label, html body .toc-title { color: var(--text-muted) !important; letter-spacing: .08em; font-weight: 600; }

/* Artículo */
html body .md-body { color: var(--text-primary); }
html body .md-body p, html body .md-body li { color: var(--text-secondary); }
html body .md-body strong { color: var(--text-primary); font-weight: 600; }
html body .md-body h2, html body .md-body h3, html body .md-body h4 { font-weight: 600 !important; letter-spacing: -.01em; color: var(--text-primary) !important; }
html body .md-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); }
html body .md-body blockquote {
  background: var(--accent-soft) !important; border: 0 !important; border-left: 3px solid var(--accent-pill) !important;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; color: var(--text-primary) !important;
}
html body .md-body :not(pre) > code {
  background: var(--bg-card-subtle) !important; border: 1px solid var(--border) !important;
  color: var(--text-primary) !important; border-radius: 6px !important; padding: .1em .35em;
}
html body .md-body pre, html body .md-body .code-block, html body .md-body [class*="code-wrap"] {
  background: var(--bg-code) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important; box-shadow: none !important;
}
html body .md-body pre code { color: var(--text-primary) !important; }
html body .md-body .table-wrap, html body .md-body .md-table-wrap {
  background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-sm) !important;
}
html body .md-body th { background: var(--bg-card-subtle) !important; color: var(--text-muted) !important; font-weight: 600; }
html body .md-body td, html body .md-body th { border-color: var(--border) !important; color: var(--text-secondary); }
html body .md-body hr, html body hr.divider { border: 0 !important; border-top: 1px solid var(--border) !important; background: none !important; }
html body .doc-sidebar .toc-link { color: var(--text-secondary) !important; }
html body .doc-sidebar .toc-link.active, html body .doc-sidebar .toc-item.active > .toc-link {
  color: var(--accent) !important; background: var(--accent-soft) !important;
}
html body .back-nav, html body .poster-handle { color: var(--accent) !important; }
html body .poster-avatar { background: var(--accent-soft) !important; color: var(--accent) !important; }

/* Modal de acceso: tarjeta tipo NutriFit, misma fuente */
html body .auth-backdrop { background: rgb(9 9 11 / .45) !important; backdrop-filter: blur(6px); }
html body .auth-card {
  background: var(--bg-card) !important; border: 1px solid var(--border) !important;
  border-radius: 24px !important; box-shadow: var(--shadow-lift) !important; color: var(--text-primary) !important;
  font-family: var(--font) !important;
}
html body .auth-card * { font-family: var(--font) !important; }
html body .auth-icon-badge { background: var(--accent-soft) !important; border: 0 !important; border-radius: 14px !important; }
html body .auth-icon-badge img { border-radius: 8px; display: block; }
html body .auth-title { font-weight: 600 !important; letter-spacing: -.01em; color: var(--text-primary) !important; }
html body .auth-subtitle, html body .auth-card label { color: var(--text-secondary) !important; }
html body .auth-tabs { background: var(--bg-card-subtle) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; }
html body .auth-tab { color: var(--text-secondary) !important; border-radius: 10px !important; background: transparent !important; }
html body .auth-tab.active { background: var(--bg-card) !important; color: var(--text-primary) !important; box-shadow: var(--shadow-card) !important; }
html body .auth-card a, html body #auth-forgot-pwd { color: var(--accent) !important; }

/* 404 y logros */
html body .nf-badge { background: var(--accent-soft) !important; color: var(--accent) !important; border-radius: 999px !important; }
html body .ach-tab-btn { border-radius: 12px !important; border: 1px solid var(--border) !important; background: var(--bg-card) !important; color: var(--text-secondary) !important; }
html body .ach-tab-btn.is-active { background: var(--accent-pill) !important; color: var(--accent-pill-text) !important; border-color: transparent !important; }

/* Foco accesible coherente */
html body a:focus-visible, html body button:focus-visible, html body [tabindex]:focus-visible {
  outline: 2px solid var(--border-focus) !important; outline-offset: 2px;
}
html, body { overflow-x: hidden; }

/* Logros: filas como tarjetas; las bloqueadas, atenuadas sin fondo oscuro fijo */
html body .ach-guide-row {
  background: var(--bg-card) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important; box-shadow: var(--shadow-card) !important;
}
html body .ach-guide-row.is-locked { opacity: .65 !important; filter: grayscale(1) !important; }
html body .ach-guide-row .ach-guide-desc, html body .ach-guide-row p { color: var(--text-secondary) !important; }

/* Separador del modal sin franja oscura */
html body .auth-divider span { background: var(--bg-card) !important; color: var(--text-muted) !important; }
html body .auth-divider::before { background: var(--border) !important; }
html body .ach-guide-row h3, html body .ach-guide-row h4, html body .ach-guide-row [class*="title"], html body .ach-guide-row [class*="name"] { color: var(--text-primary) !important; }
html body .ach-guide-row [class*="req"], html body .ach-guide-row [class*="how"] span:last-child { color: var(--text-secondary) !important; }

/* ---------- Etiquetas: Outfit en lugar de monoespaciada (el código sigue en mono) ---------- */
html body .kicker, html body .home-label, html body .toc-title, html body .md-body th,
html body .nf-badge, html body .nf-path, html body [class*="ach-"]:not(code):not(pre),
html body [class*="-label"]:not(code), html body [class*="badge"], html body .meta-chip, html body .tag, html body .pill {
  font-family: var(--font) !important;
}
html body .kicker, html body .home-label, html body .toc-title { letter-spacing: .06em; }

/* ---------- Panel de acceso estilo NutriFit ---------- */
html.auth-open, html.auth-open body { overflow: hidden; }
html body .auth-backdrop { align-items: center; justify-content: center; padding: 16px; }
html body .auth-card {
  position: relative; width: 100%; max-width: 420px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 32px 28px 24px !important; animation: auth-pop .26s var(--ease) both;
}
@keyframes auth-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
html body .auth-grabber { display: none; }
html body .auth-close-btn {
  position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; min-height: 36px;
  display: grid; place-items: center; border-radius: 10px !important; border: 0 !important;
  background: transparent !important; color: var(--text-muted) !important; cursor: pointer;
}
html body .auth-close-btn:hover { background: var(--bg-card-hover) !important; color: var(--text-primary) !important; }
html body .auth-header { display: flex; flex-direction: column; align-items: flex-start; text-align: start; gap: 6px; margin-bottom: 20px; }
html body .auth-icon-badge { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 8px; }
html body .auth-title { font-size: 1.5rem !important; line-height: 1.2; margin: 0 !important; }
html body .auth-subtitle { font-size: .95rem !important; margin: 0 !important; line-height: 1.5; }
html body .auth-tabs { display: grid !important; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; margin-bottom: 16px; }
html body .auth-tab { min-height: 40px; font-weight: 500 !important; }
html body .auth-social-buttons { display: grid; gap: 10px; }
html body .btn-social-google-wrap { position: relative; }
html body .auth-social-btn {
  width: 100%; min-height: 48px; display: flex !important; align-items: center; justify-content: center; gap: 10px;
  font-weight: 500 !important; font-size: .95rem !important; cursor: pointer;
}
html body .auth-divider { display: flex !important; align-items: center; gap: 12px; margin: 20px 0 !important; position: static !important; }
html body .auth-divider::before, html body .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border) !important; position: static !important; }
html body .auth-divider span { background: none !important; padding: 0 !important; font-size: .8rem; position: static !important; }
html body .auth-input-label { display: block; font-size: .875rem; font-weight: 500; color: var(--text-primary) !important; margin-bottom: 6px; }
html body .auth-input { width: 100%; box-sizing: border-box; padding: 0 14px; font-size: 1rem; }
html body .auth-input[aria-invalid="true"] { border-color: #DC2626 !important; box-shadow: 0 0 0 3px rgb(220 38 38 / .15) !important; }
html body .auth-pwd-wrap { position: relative; }
html body .auth-pwd-wrap .auth-input { padding-right: 48px; }
html body .auth-pwd-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; min-height: 36px;
  display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--text-muted); cursor: pointer;
}
html body .auth-pwd-toggle[aria-pressed="true"] { color: var(--accent); }
html body .auth-forgot-link { font-size: .8rem; font-weight: 500; text-decoration: none; }
html body .auth-msg { border-radius: 12px; padding: 10px 12px; font-size: .875rem; line-height: 1.45; margin-bottom: 14px; }
html body .auth-msg.is-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
html body .auth-msg.is-ok { background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
html[data-theme="dark"] body .auth-msg.is-error { background: rgb(127 29 29 / .25); color: #FCA5A5; border-color: rgb(248 113 113 / .3); }
html body .auth-submit-btn {
  width: 100%; min-height: 52px; border-radius: 14px !important; font-size: 1rem !important;
  display: flex !important; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
}
html body .auth-submit-btn:disabled { opacity: .75; cursor: progress; }
html body .auth-spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: auth-spin .7s linear infinite; }
html body .auth-submit-btn.is-loading .auth-spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }
html body .auth-guest-btn { background: none !important; border: 0 !important; box-shadow: none !important; color: var(--text-secondary) !important; font-weight: 500; cursor: pointer; min-height: 40px; }
html body .auth-guest-btn:hover { color: var(--text-primary) !important; }
html body .auth-footer-links { display: flex; justify-content: center; gap: 8px; margin-top: 12px; font-size: .78rem; color: var(--text-muted); }
html body .auth-footer-links a { color: var(--text-muted) !important; text-decoration: none; }

@media (max-width: 600px) {
  html body .auth-backdrop { align-items: flex-end !important; padding: 0 !important; }
  html body .auth-card {
    max-width: none !important; width: 100% !important; border-radius: 24px 24px 0 0 !important;
    max-height: 92dvh !important; padding: 12px 20px calc(20px + env(safe-area-inset-bottom)) !important;
    border-bottom: 0 !important; animation: auth-sheet .32s var(--ease) both;
  }
  html body .auth-grabber { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 16px; }
  html body .auth-close-btn { top: 16px; right: 12px; }
}
@keyframes auth-sheet { from { transform: translateY(100%); } to { transform: none; } }

/* ---------- Páginas de error de acceso ---------- */
html body.auth-error-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; margin: 0; }
.auth-error-card { width: 100%; max-width: 440px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px; padding: 32px 28px; box-shadow: var(--shadow-card); }
.auth-error-logo { border-radius: 12px; margin-bottom: 16px; }
.auth-error-card h1 { font-size: 1.4rem; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.auth-error-card p { color: var(--text-secondary); line-height: 1.55; margin: 0 0 20px; }
.auth-error-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-error-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--border); color: var(--text-primary); text-decoration: none; font-weight: 500; background: var(--bg-card); }
.auth-error-btn.primary { background: var(--accent-pill); color: var(--accent-pill-text); border-color: transparent; }
.auth-error-card details { margin-top: 20px; font-size: .85rem; color: var(--text-muted); }
.auth-error-card summary { cursor: pointer; }
.auth-error-card pre { white-space: pre-wrap; word-break: break-word; background: var(--bg-code); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-top: 8px; font-family: var(--mono); }

/* ---------- Firma ---------- */
html body.firma-body, html body .firma-wrap { background: var(--bg) !important; }

/* Menú de cuenta y perfil */
html body .account-menu { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 14px !important; box-shadow: var(--shadow-lift) !important; padding: 6px !important; min-width: 220px; }
html body .account-menu a, html body .account-menu button { display: block; width: 100%; text-align: start; padding: 10px 12px !important; border-radius: 10px !important; color: var(--text-primary) !important; background: none !important; border: 0 !important; font: 500 .9rem var(--font) !important; text-decoration: none; }
html body .account-menu a:hover, html body .account-menu button:hover { background: var(--bg-card-hover) !important; }
html body .account-menu [data-logout] { color: #DC2626 !important; }
html body .account-menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: grid; }
html body .account-menu-head strong { font-weight: 600; color: var(--text-primary); }
html body .account-menu-head span { font-size: .8rem; color: var(--text-muted); }
html body .account-chip { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 999px !important; color: var(--text-primary) !important; }
html body .account-photo { border-radius: 999px; object-fit: cover; }
html body .profile-header-card { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 24px !important; box-shadow: var(--shadow-card) !important; background-image: none !important; }
html body .profile-large-avatar { border-radius: 999px !important; object-fit: cover; }
html body .profile-name { font-weight: 600 !important; letter-spacing: -.02em; color: var(--text-primary) !important; }
html body .role-badge { background: var(--accent-soft) !important; color: var(--accent) !important; border: 0 !important; border-radius: 999px !important; }
html body .profile-handle { color: var(--text-muted) !important; }
html body .profile-joined { display: block; margin-top: 6px; font-size: .85rem; color: var(--text-muted); }
html body .profile-action-btn { background: var(--bg-card) !important; border: 1px solid var(--border) !important; border-radius: 12px !important; color: var(--text-primary) !important; }
html body .profile-empty-state { background: var(--bg-card) !important; border: 1px dashed var(--border) !important; border-radius: 20px !important; color: var(--text-secondary) !important; }
html body .profile-empty-state h3 { color: var(--text-primary) !important; }
html body .profile-handle, html body .stat-value { font-family: var(--font) !important; }

/* ---------- Sin azul: acento único menta y neutros zinc ---------- */
html[data-theme] body { --accent-cyan: var(--accent); --border-focus: var(--accent); --accent-blue: var(--accent); --link: var(--text-primary); }
html body a { color: inherit; }
html body .md-body a, html body .profile-achievements-widget a, html body a.hub-link, html body .back-nav {
  color: var(--text-primary) !important; text-decoration: underline; text-decoration-color: var(--line-strong) !important; text-underline-offset: 3px;
}
html body .md-body a:hover, html body .profile-achievements-widget a:hover, html body .back-nav:hover { text-decoration-color: var(--accent) !important; }
html body .back-nav { text-decoration: none; }
html body .profile-tech-tag, html body .tag-chip, html body [class*="tag-chip"] {
  background: var(--bg-card-subtle) !important; color: var(--text-secondary) !important; border: 1px solid var(--border) !important;
  border-radius: 999px !important; font-family: var(--font) !important;
}
html body .profile-avatar-wrap, html body .profile-large-avatar, html body .profile-avatar-wrap > * {
  box-shadow: none !important; outline: 0 !important; border-color: var(--border) !important;
}
html body .account-initials, html body .profile-avatar-wrap .avatar-initials, html body [class*="avatar-initials"], html body .guide-card-avatar-initials, html body .poster-avatar {
  background: var(--bg-card-hover) !important; color: var(--text-secondary) !important; border: 1px solid var(--border) !important;
}
html body .account-chip, html body #account-btn { border: 1px solid var(--border) !important; box-shadow: none !important; }
html body .btn-exp-mode, html body .filter-kind-chips button, html body .filter-sort-dropdown, html body #filter-search-input {
  background: var(--bg-card) !important; border: 1px solid var(--border) !important; color: var(--text-primary) !important; box-shadow: none !important;
}
html body .btn-exp-mode.is-advanced, html body .btn-exp-mode[aria-pressed="true"], html body .btn-exp-mode.active { border-color: var(--accent) !important; color: var(--accent) !important; }
html body .filter-kind-chips button.active, html body .filter-kind-chips button.is-active { background: var(--text-primary) !important; color: var(--bg) !important; border-color: transparent !important; }
html body input:focus, html body select:focus, html body textarea:focus, html body #filter-search-input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px var(--accent-soft) !important; }
html body .profile-search-wrap, html body .filter-search-wrap { border: 0 !important; box-shadow: none !important; background: none !important; }
html body .profile-header-card::before, html body .profile-header-card::after { display: none !important; }
html body .role-badge { font-family: var(--font) !important; letter-spacing: .04em; }
html body .auth-social-btn { background: var(--bg-card) !important; color: var(--text-primary) !important; }
html body .auth-social-btn:focus-visible { outline: 2px solid var(--accent) !important; }
html body .card-category-badge, html body .ticker-badge, html body [class*="cat-pill-"] {
  background: var(--bg-card-subtle) !important; color: var(--text-secondary) !important; border: 1px solid var(--border) !important; font-family: var(--font) !important;
}
html body .card-category-badge.category-guide { color: var(--accent) !important; }
html body .filter-search-box { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }
html body .account-menu-wrap { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }

/* ---------- Valores por defecto del navegador sin azul ---------- */
html { accent-color: var(--accent-pill, #10B981); }
html body input[type="checkbox"], html body input[type="radio"], html body input[type="range"], html body progress { accent-color: var(--accent-pill) !important; }
html body ::selection { background: rgba(16, 185, 129, .28); color: inherit; }
html body a:visited { color: inherit; }
html body :focus { outline-color: var(--accent); }
html body :focus:not(:focus-visible) { outline: none; }
html body * { -webkit-tap-highlight-color: rgba(16, 185, 129, .15); }
html { scrollbar-color: var(--line-strong) transparent; }
html body ::-webkit-scrollbar { width: 10px; height: 10px; }
html body ::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--bg); }
html body ::-webkit-scrollbar-track { background: transparent; }
html body input, html body textarea, html body select { caret-color: var(--accent); }
/* Resaltado de código: tokens neutros + menta */
html body .md-body pre .hljs-keyword, html body .md-body pre .token.keyword, html body .md-body pre .hljs-built_in, html body .md-body pre .token.function { color: var(--accent) !important; }
html body .md-body pre .hljs-string, html body .md-body pre .token.string { color: var(--text-primary) !important; }
html body .md-body pre .hljs-comment, html body .md-body pre .token.comment { color: var(--text-muted) !important; }
html body .md-body pre .hljs-number, html body .md-body pre .hljs-attr, html body .md-body pre .token.number, html body .md-body pre .token.property { color: var(--text-secondary) !important; }

/* ---------- Tabla de publicaciones (modo avanzado) ---------- */
html body .profile-matrix-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-card); }
html body .gt-scroll { overflow-x: auto; }
html body .gt-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 620px; }
html body .gt-table th { text-align: start; font-weight: 500; font-size: .78rem; color: var(--text-muted); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--bg-card-subtle); }
html body .gt-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text-secondary); }
html body .gt-table tbody tr:last-child td { border-bottom: 0; }
html body .gt-table tbody tr:hover td { background: var(--bg-card-hover); }
html body .gt-num { text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
html body .gt-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 500; background: var(--bg-card-subtle); border: 1px solid var(--border); color: var(--text-secondary); }
html body .gt-title a { color: var(--text-primary) !important; font-weight: 600; text-decoration: none; }
html body .gt-title a:hover { text-decoration: underline; text-decoration-color: var(--line-strong); }
html body .gt-slug { display: block; font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
html body .gt-pin { margin-left: 8px; font-size: .72rem; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
html body .gt-act { text-align: end; }
html body .gt-read { display: inline-flex; align-items: center; min-height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--accent); color: var(--accent) !important; text-decoration: none; font-weight: 500; font-size: .85rem; white-space: nowrap; }
html body .gt-read:hover { background: var(--accent-soft); }
html body .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
/* Tickers ($MSFT) neutros en cualquier vista */
html body .ticker-badge, html body .gt-title .ticker-badge, html body .profile-card-title .ticker-badge {
  background: var(--bg-card-subtle) !important; border: 1px solid var(--border) !important; color: var(--text-secondary) !important; box-shadow: none !important;
}

/* ---------- Logros en móvil: la fila se apila en vez de comprimirse ---------- */
@media (max-width: 600px) {
  html body .ach-guide-row { flex-wrap: wrap !important; align-items: flex-start !important; gap: 12px !important; }
  html body .ach-guide-info { flex: 1 1 calc(100% - 64px) !important; min-width: 0 !important; }
  html body .ach-guide-criteria { display: block !important; line-height: 1.45 !important; }
  html body .ach-guide-criteria .criteria-label { display: block !important; margin-bottom: 2px !important; }
  html body .ach-guide-meta { flex-direction: row !important; align-items: center !important; justify-content: space-between !important; width: 100% !important; padding-left: 56px !important; }
}
html body .ach-guide-criteria { color: var(--text-secondary) !important; }

/* Banderas SVG en el selector de idioma */
html body .flag { display: inline-flex; align-items: center; line-height: 1; }
html body .flag-svg { width: 20px; height: 14px; border-radius: 3px; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); display: block; flex: none; }

/* ===== RTL (árabe) ===== */
.profile-handle, .ticker-badge, .gt-slug, code, pre, kbd, .tier-ratio-badge, .meta-val, .stat-value, .ach-rarity, .ach-guide-rarity, .lang-code { direction: ltr; unicode-bidi: isolate; }
[dir=rtl] pre, [dir=rtl] code { text-align: left; }
/* Títulos y resúmenes de autor quedan en su idioma original: que decidan su propia dirección */
[dir=rtl] .profile-card-title, [dir=rtl] .profile-card-desc, [dir=rtl] .gt-title > a, [dir=rtl] .guide-card h3, [dir=rtl] .guide-card p, [dir=rtl] .feed-card h3, [dir=rtl] .feed-card p, [dir=rtl] .md-body { unicode-bidi: plaintext; }
[dir=rtl] .back-nav svg, [dir=rtl] .chevron, [dir=rtl] .arrow-icon { transform: scaleX(-1); }
[dir=rtl] .auth-header { align-items: flex-start; text-align: start; }
[dir=rtl] .account-menu { left: 0; right: auto; }
[dir=rtl] .gt-table th, [dir=rtl] .gt-table td { text-align: start; }
[dir=rtl] .achievement-toast { right: auto; left: 24px; }
[dir=rtl] input, [dir=rtl] textarea, [dir=rtl] select { text-align: start; }
[dir=rtl] input[type=email], [dir=rtl] input[type=url] { direction: ltr; text-align: end; }
[dir=rtl] .profile-status-dot { right: auto; left: 4px; }

/* Aviso de logro discreto: neutro + verde, sin brillos ni colores por nivel */
html body .achievement-toast { background: var(--bg-card, #111113) !important; border: 1px solid var(--border, #27272a) !important; box-shadow: 0 8px 24px rgba(0,0,0,.25) !important; }
html body .achievement-toast .toast-glow { display: none !important; }
html body .achievement-toast .toast-icon-wrap { background: rgba(16,185,129,.12) !important; color: var(--accent, #10B981) !important; box-shadow: none !important; }
html body .achievement-toast .toast-kicker { color: var(--accent, #10B981) !important; }
html body .achievement-toast .toast-title { color: var(--text-primary) !important; }
html body .achievement-toast .toast-tier-pill { background: transparent !important; color: var(--text-muted) !important; border: 0 !important; padding: 0 !important; }
html body .ticker-badge { white-space: nowrap; display: inline-block; }

/* Panel interno: sobrio, neutros y verde */
html body .admin-container { max-width: 1040px; }
html body .admin-card { border: 1px solid var(--border); background: var(--bg-card); border-radius: 14px; padding: 20px; margin: 18px 0; }
html body .admin-card h2 { font-size: 1.05rem; margin: 0 0 8px; }
html body .admin-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; font-size: .88rem; cursor: pointer; text-decoration: none; }
html body .admin-btn:hover { background: var(--bg-card-hover); }
html body .admin-btn.primary { background: var(--accent-pill); color: var(--accent-pill-text); border-color: transparent; }
html body .admin-btn[disabled] { opacity: .45; cursor: not-allowed; }
html body .admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--border); margin: 18px 0; }
html body .admin-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 10px 12px; font: inherit; font-size: .9rem; cursor: pointer; }
html body .admin-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
html body .admin-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
html body .admin-stat { border: 1px solid var(--border); background: var(--bg-card); border-radius: 12px; padding: 14px; }
html body .admin-stat b { display: block; font-size: 1.6rem; font-weight: 650; }
html body .admin-stat span { color: var(--muted); font-size: .82rem; }
html body .admin-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
html body .admin-table th, html body .admin-table td { text-align: start; padding: 9px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
html body .admin-table th { color: var(--muted); font-weight: 500; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
html body .admin-scroll { overflow-x: auto; }
html body .admin-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-inline-end: 8px; background: var(--bg-card-hover); display: inline-block; }
html body .admin-pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .74rem; border: 1px solid var(--border); color: var(--muted); }
html body .admin-pill.ok { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
html body .admin-pill.off { color: #e4a4a4; }
html body .admin-actions { display: flex; gap: 6px; flex-wrap: wrap; }
html body .admin-note { color: var(--muted); font-size: .86rem; }
html body .admin-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
html body .admin-links a { display: block; border: 1px solid var(--border); border-radius: 12px; padding: 14px; color: var(--text); text-decoration: none; background: var(--bg-card); }
html body .admin-links a:hover { background: var(--bg-card-hover); }
html body .admin-links small { display: block; color: var(--muted); margin-top: 4px; }
html body .admin-bar { height: 6px; border-radius: 4px; background: var(--bg-card-hover); overflow: hidden; min-width: 80px; }
html body .admin-bar i { display: block; height: 100%; background: var(--accent); }
html body .auth-provider-ms[hidden] { display: none !important; }
