/* FingerWPM v29 — shared dark theme for every page. */
html{color-scheme:light}
html.theme-dark{color-scheme:dark;background:#111827}
html.theme-dark body{background-color:#111827;color:#e8eef8}
body{transition:background-color .18s ease,color .18s ease}

/* Resource / guide pages */
html.theme-dark body[data-resource-page]{--bg:#111827;--surface:#182235;--text:#eef4ff;--muted:#9eacc0;--line:#334258;--accent:#6f91ff;background:#111827;color:#eef4ff}
html.theme-dark body[data-resource-page] .site-head{background:rgba(17,24,39,.94);border-color:#334258}
html.theme-dark body[data-resource-page] .brand{color:#eef4ff}
html.theme-dark body[data-resource-page] .nav a,
html.theme-dark body[data-resource-page] .breadcrumbs,
html.theme-dark body[data-resource-page] .article p,
html.theme-dark body[data-resource-page] .article li,
html.theme-dark body[data-resource-page] .lead,
html.theme-dark body[data-resource-page] .side a,
html.theme-dark body[data-resource-page] .site-foot-inner{color:#b9c6d8}
html.theme-dark body[data-resource-page] .article h2,
html.theme-dark body[data-resource-page] .article h3,
html.theme-dark body[data-resource-page] .side h2,
html.theme-dark body[data-resource-page] h1{color:#f5f8ff}
html.theme-dark body[data-resource-page] .note,
html.theme-dark body[data-resource-page] .side{background:rgba(28,39,56,.78);border-color:#3a4a61}
html.theme-dark body[data-resource-page] .cta.secondary{color:#eef4ff;border-color:#41516a}
html.theme-dark body[data-resource-page] .site-foot{border-color:#334258}

/* Private profile */
html.theme-dark .profile-page-body{--pf-ink:#edf3fb;--pf-muted:#9eacc0;--pf-line:#344258;--pf-bg:#111827;--pf-soft:#182235;background:linear-gradient(180deg,#111827 0,#121b2a 50%,#111827 100%);color:#edf3fb}
html.theme-dark .profile-page-header{background:rgba(17,24,39,.93);border-color:#344258}
html.theme-dark .profile-photo-preview{border-color:#26364b;box-shadow:0 12px 30px rgba(0,0,0,.28),0 0 0 1px #40516a}
html.theme-dark .profile-photo-preview img{background:#182235}
html.theme-dark .profile-photo-button,
html.theme-dark .profile-secondary-action,
html.theme-dark .profile-icon-action{background:#182235;border-color:#41516a;color:#dfe8f6}
html.theme-dark .profile-member-pill{background:#1d293a;color:#aebbd0}
html.theme-dark .profile-online-pill{background:#12362d;color:#7be0ba}
html.theme-dark .profile-level-ring{background:conic-gradient(var(--pf-blue) 0deg,#27354a 0deg)}
html.theme-dark .profile-level-ring:before{background:#111827}
html.theme-dark .profile-level-progress,
html.theme-dark .completion-bar{background:#26354a}
html.theme-dark .profile-chart-switch{background:#182235}
html.theme-dark .profile-chart-switch button{color:#9eacc0}
html.theme-dark .profile-chart-switch button.is-active{background:#26385a;color:#a9bdff;box-shadow:none}
html.theme-dark .profile-chart-summary,
html.theme-dark .profile-analytics-section .profile-section-heading,
html.theme-dark .profile-chart-details,
html.theme-dark .profile-journey-strip{border-color:#344258!important}
html.theme-dark .profile-chart-summary>div:not(:last-child),
html.theme-dark .profile-journey-strip>div,
html.theme-dark .profile-record-breakdown>div,
html.theme-dark .chart-detail-row{border-color:#344258!important}
html.theme-dark .profile-chart-wrap{background:linear-gradient(180deg,rgba(83,112,211,.12),rgba(24,34,53,.55))!important;border-color:#344258!important}
html.theme-dark .chart-grid{stroke:#344258}
html.theme-dark .chart-axis-label,
html.theme-dark .chart-x-label{fill:#8fa0b8}
html.theme-dark .chart-dot{fill:#111827}
html.theme-dark .profile-next-achievement{background:linear-gradient(90deg,#211c38,#171b2a)}
html.theme-dark .achievement-item,
html.theme-dark .certificate-item{border-color:#344258}
html.theme-dark .achievement-item:hover{background:linear-gradient(90deg,rgba(111,145,255,.08),transparent)}
html.theme-dark .achievement-icon{background:#1c2a44}
html.theme-dark .certificate-medal{background:linear-gradient(145deg,#443719,#2d291d);box-shadow:none}
html.theme-dark .certificate-stats b{background:#352d1b;color:#e7c978}
html.theme-dark .profile-sidebar-overview{background:linear-gradient(145deg,#18243a,#1a1d31);border-color:#34445d;box-shadow:0 14px 34px rgba(0,0,0,.18)}
html.theme-dark .profile-form input,
html.theme-dark .profile-form textarea,
html.theme-dark .profile-chart-controls select{background:#151f30;border-color:#41516a;color:#edf3fb}
html.theme-dark .profile-toggle-row{border-color:#344258}
html.theme-dark .profile-history .history-filters{background:linear-gradient(90deg,#172235,#182131);border-color:#344258}
html.theme-dark .profile-record-breakdown:empty:after{border-color:#41516a;color:#9eacc0}
html.theme-dark .profile-section-heading p,
html.theme-dark .profile-history-heading p,
html.theme-dark .profile-hero-bio,
html.theme-dark .profile-chart-summary span,
html.theme-dark .profile-journey-strip small,
html.theme-dark .profile-record-breakdown span,
html.theme-dark .profile-photo-help{color:#9eacc0}

/* Public profile */
html.theme-dark .public-profile-body{--pp-ink:#edf3fb;--pp-muted:#9eacc0;--pp-line:#344258;--pp-bg:#111827;background:linear-gradient(180deg,#111827,#121b2a 55%,#111827);color:#edf3fb}
html.theme-dark .public-profile-header{background:rgba(17,24,39,.93);border-color:#344258}
html.theme-dark .public-avatar{border-color:#26364b;box-shadow:0 12px 30px rgba(0,0,0,.28),0 0 0 1px #40516a}
html.theme-dark .public-avatar img{background:#182235}
html.theme-dark .public-meta span{background:#1d293a;color:#aebbd0}
html.theme-dark .public-hero-side{border-color:#344258}
html.theme-dark .public-level-number{background:linear-gradient(145deg,#18263e,#251f3b);border-color:#3c4c65}
html.theme-dark .public-level-title{color:#edf3fb}
html.theme-dark .public-level-progress{background:#26354a}
html.theme-dark .public-chart-switch{background:#182235}
html.theme-dark .public-chart-switch button{color:#9eacc0}
html.theme-dark .public-chart-switch button.is-active{background:#26385a;color:#a9bdff;box-shadow:none}
html.theme-dark .public-analytics-section .public-section-head,
html.theme-dark .public-chart-summary,
html.theme-dark .public-chart-details,
html.theme-dark .public-journey-strip{border-color:#344258!important}
html.theme-dark .public-chart-summary>div:not(:last-child),
html.theme-dark .public-journey-strip>div,
html.theme-dark .record-breakdown>div,
html.theme-dark .public-profile-body .chart-detail-row{border-color:#344258!important}
html.theme-dark .public-chart-wrap{background:linear-gradient(180deg,rgba(83,112,211,.12),rgba(24,34,53,.55))!important;border-color:#344258!important}
html.theme-dark .public-profile-body .chart-grid{stroke:#344258}
html.theme-dark .public-profile-body .chart-axis-label,
html.theme-dark .public-profile-body .chart-x-label{fill:#8fa0b8}
html.theme-dark .public-profile-body .chart-dot{fill:#111827}
html.theme-dark .public-profile-body .achievement-item,
html.theme-dark .public-profile-body .certificate-item{border-color:#344258}
html.theme-dark .public-profile-body .achievement-icon{background:#1c2a44}
html.theme-dark .public-profile-body .certificate-medal{background:linear-gradient(145deg,#443719,#2d291d)}
html.theme-dark .public-profile-body .certificate-stats b{background:#352d1b;color:#e7c978}
html.theme-dark .public-table-wrap{background:#151f30;border-color:#41516a}
html.theme-dark .public-table-wrap th{background:#1c2738;color:#aebbd0}
html.theme-dark .public-table-wrap th,
html.theme-dark .public-table-wrap td{border-color:#344258}
html.theme-dark .public-profile-body .public-section-head p,
html.theme-dark .public-profile-body .public-bio,
html.theme-dark .public-profile-body .public-chart-summary span,
html.theme-dark .public-profile-body .public-journey-strip small,
html.theme-dark .public-profile-body .record-breakdown span,
html.theme-dark .public-profile-body .achievement-copy p,
html.theme-dark .public-profile-body .achievement-copy small{color:#9eacc0}
html.theme-dark .public-history-pagination button{background:#182235;border-color:#41516a;color:#edf3fb}

/* Shared auth/history surfaces on standalone pages */
html.theme-dark .history-table-wrap,
html.theme-dark .history-summary article,
html.theme-dark .history-guest{background:#151f30;border-color:#41516a}
html.theme-dark .history-table th{background:#1c2738;border-color:#41516a;color:#b9c6d8}
html.theme-dark .history-table td{border-color:#344258;color:#e8eef8}
html.theme-dark .history-filters select,
html.theme-dark .history-refresh,
html.theme-dark .history-pagination button{background:#151f30;border-color:#41516a;color:#edf3fb}

/* Certificate screen theme. Printing remains the original light certificate. */
html.theme-dark .certificate-page-body{background:#0f1724;color:#edf3fb}
html.theme-dark .certificate-page-body .cert-card{background:#152033;box-shadow:0 20px 60px rgba(0,0,0,.38)}
html.theme-dark .certificate-page-body .cert-frame{background:radial-gradient(circle at 50% 45%,#1a273a 0,#172235 55%,#111b2a 100%);color:#edf3fb}
html.theme-dark .certificate-page-body .cert-recipient p,
html.theme-dark .certificate-page-body .cert-motto{color:#b9c6d8}
html.theme-dark .certificate-page-body .cert-performance{background:rgba(17,27,43,.82);border-color:#41516a}
html.theme-dark .certificate-page-body .cert-details>div{background:#172235;border-color:#41516a}
html.theme-dark .certificate-page-body .cert-details small,
html.theme-dark .certificate-page-body .verify-copy small,
html.theme-dark .certificate-page-body .verify-copy p{color:#aebbd0}
html.theme-dark .certificate-page-body .cert-actions a{background:#1c2738;color:#9fb6ff}

@media print{
  html.theme-dark .certificate-page-body{background:#fff!important;color:#071b3d!important}
  html.theme-dark .certificate-page-body .cert-card{background:#fff!important}
  html.theme-dark .certificate-page-body .cert-frame{background:radial-gradient(circle at 50% 45%,#fff 0,#fff 55%,#f8fbff 100%)!important;color:#071b3d!important}
  html.theme-dark .certificate-page-body .cert-recipient p{color:#293241!important}
  html.theme-dark .certificate-page-body .cert-motto{color:#7d8492!important}
  html.theme-dark .certificate-page-body .cert-performance{background:rgba(255,255,255,.8)!important;border-color:#dce3ee!important}
  html.theme-dark .certificate-page-body .cert-details>div{background:#fff!important;border-color:#dce3ee!important}
}

/* FingerWPM official social links — v30 */
.global-social-follow{
  width:min(1180px,calc(100% - 40px));
  margin:34px auto 0;
  padding:20px 0 28px;
  border-top:1px solid #d5e0ea;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:16px;
  font-family:Arial,sans-serif;
}
.global-social-label{
  color:#607089;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  white-space:nowrap;
}
.global-social-icons{
  display:flex;
  align-items:center;
  gap:9px;
}
.global-social-follow .social-icon,
.resource-social .social-icon{
  width:36px;
  height:36px;
  display:grid;
  place-items:center;
  border:1px solid #ccd9e5;
  border-radius:11px;
  background:#fff;
  color:#17243a;
  text-decoration:none;
  transition:transform .16s ease,border-color .16s ease,background .16s ease,color .16s ease;
}
.global-social-follow .social-icon:hover,
.resource-social .social-icon:hover{
  transform:translateY(-2px);
  border-color:#7d9cff;
  background:#edf3ff;
  color:#315fdf;
}
.global-social-follow .social-icon svg,
.resource-social .social-icon svg{
  width:18px;
  height:18px;
  display:block;
  fill:currentColor;
}
.resource-footer-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
}
.resource-social{
  display:flex;
  align-items:center;
  gap:12px;
}
html.theme-dark .global-social-follow{border-color:#344258}
html.theme-dark .global-social-label{color:#9eacc0}
html.theme-dark .global-social-follow .social-icon,
html.theme-dark .resource-social .social-icon{
  background:#172235;
  border-color:#41516a;
  color:#edf3fb;
}
html.theme-dark .global-social-follow .social-icon:hover,
html.theme-dark .resource-social .social-icon:hover{
  background:#223252;
  border-color:#6f91ff;
  color:#b8c8ff;
}
@media(max-width:680px){
  .global-social-follow{flex-direction:column;gap:11px;margin-top:24px}
  .resource-footer-inner{flex-direction:column;align-items:flex-start}
  .resource-social{width:100%;justify-content:space-between}
}
@media print{
  .global-social-follow{display:none!important}
}

/* v32 profile/public-profile additions */
html.theme-dark .profile-insight-grid,html.theme-dark .public-insight-grid,html.theme-dark .profile-privacy-controls legend{border-color:#344258}
html.theme-dark .skill-track,html.theme-dark .achievement-progress,html.theme-dark .next-achievement-progress,html.theme-dark .public-skill-breakdown .skill-track{background:#26354a}
html.theme-dark .profile-formula-note,html.theme-dark .public-formula-note,html.theme-dark .profile-skill-breakdown .skill-row span,html.theme-dark .public-skill-breakdown .skill-row span{color:#9eacc0}
html.theme-dark .profile-pending-certificates{background:#302919;border-color:#6c5729;color:#f1d98f}
html.theme-dark .public-share{background:#182235;border-color:#41516a;color:#edf3fb}

/* FingerWPM v37 — theme control available on every page. */
.global-theme-toggle{
  -webkit-appearance:none;appearance:none;border:1px solid #cfd9e7;background:#fff;color:#334155;
  min-width:40px;height:40px;padding:0 11px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;
  gap:7px;font:800 12px/1 Inter,system-ui,-apple-system,"Segoe UI",sans-serif;cursor:pointer;
  box-shadow:0 4px 14px rgba(31,48,77,.06);transition:background .16s ease,border-color .16s ease,color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.global-theme-toggle:hover{border-color:#8da4d8;box-shadow:0 7px 18px rgba(31,48,77,.11);transform:translateY(-1px)}
.global-theme-toggle:focus-visible{outline:3px solid rgba(49,87,213,.25);outline-offset:2px}
.global-theme-toggle svg{width:20px;height:20px;display:block;flex:0 0 20px}
.global-theme-toggle-text{white-space:nowrap}
html.theme-dark .global-theme-toggle{background:#182235!important;border-color:#4a5b73!important;color:#eef4ff!important;box-shadow:0 5px 16px rgba(0,0,0,.18)}
html.theme-dark .global-theme-toggle:hover{background:#202d43!important;border-color:#7084a2!important}
.standalone-header-actions .global-theme-toggle{flex:0 0 auto}
body[data-resource-page] .nav .global-theme-toggle{margin-left:2px;height:38px;min-width:38px;border-radius:10px}
.global-theme-toggle-floating{position:fixed;right:20px;top:20px;z-index:1000}
@media(max-width:640px){
  .global-theme-toggle{width:38px;min-width:38px;height:38px;padding:0;border-radius:10px}
  .global-theme-toggle-text{display:none}
  .global-theme-toggle-floating{right:12px;top:12px}
  body[data-resource-page] .nav .global-theme-toggle{margin-left:0}
}
@media print{.global-theme-toggle{display:none!important}}

