/* Final interface layer. It intentionally neutralizes earlier experimental patches. */
.topbar{
  height:76px;
  padding:0;
}
.topbar-inner{
  width:min(calc(100% - 40px),1120px);
  height:100%;
  margin:0 auto;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:center;
  gap:28px;
}
.brand{min-width:176px;line-height:.95}
.brand small{display:block;margin-top:5px;font-size:10px;line-height:1.1;letter-spacing:0;white-space:nowrap}
.topbar nav{display:flex;align-items:center;justify-content:flex-start;gap:4px;min-width:0}
.topbar nav button{padding:10px 12px;white-space:nowrap;font-size:14px}
.topbar nav button.active{color:var(--blue);background:color-mix(in srgb,var(--blue) 9%,transparent)}
.top-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;min-width:max-content}
.icon-toggle,.switch-control,.account-control{
  height:40px;
  border:1px solid color-mix(in srgb,var(--ink) 10%,var(--line));
  background:color-mix(in srgb,var(--surface-solid) 62%,transparent);
  color:var(--ink);
  box-shadow:none;
  backdrop-filter:blur(14px);
  transition:background .18s,border-color .18s,transform .18s;
}
.icon-toggle:hover,.switch-control:hover,.account-control:hover{transform:translateY(-1px);border-color:color-mix(in srgb,var(--blue) 38%,var(--line));background:color-mix(in srgb,var(--blue) 7%,var(--surface-solid))}
.icon-toggle{display:grid;place-items:center;flex:none;width:40px;padding:0;border-radius:50%!important}
.icon-toggle span,.icon-toggle svg{display:block;width:20px;height:20px}
.icon-toggle svg,.account-control svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.switch-control{display:flex;align-items:center;gap:8px;padding:4px 12px 4px 6px;border-radius:999px}
.switch-track{flex:none}
.switch-label{font-size:13px}
.account-control{display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 14px!important;border-radius:12px!important;max-width:none!important;overflow:visible!important;font-size:13px;font-weight:800;white-space:nowrap}
.account-control svg{width:18px;height:18px}
.account-control.signed-in{border-color:color-mix(in srgb,var(--blue) 24%,var(--line));color:var(--ink)}

.stats-wide{display:grid!important;grid-template-columns:minmax(285px,1.55fr) repeat(4,minmax(132px,1fr));align-items:stretch;gap:12px!important}
.stats-wide .stat{min-width:0!important;min-height:104px}
.stats-wide .stat:before{display:none!important;content:none!important}
.stats-wide .stat:not(.stat-vocabulary){display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:12px;padding:18px!important}
.stats-wide .stat-vocabulary{display:grid!important;grid-template-columns:34px minmax(0,1fr) 24px;align-items:center;gap:12px;height:100%;min-width:0!important;padding:18px 20px!important;text-align:left}
.stat-emoji{display:block!important;margin:0!important;color:initial!important;font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif!important;font-size:24px!important;line-height:1!important;white-space:nowrap}
.stat-copy{display:block!important;min-width:0;color:inherit!important}
.stat-copy strong{display:block;font-size:28px!important;line-height:1.05}
.stat-copy>span{display:block;margin-top:7px;color:var(--muted)!important;font-size:13px!important;line-height:1.25}
.stat-vocabulary .stat-copy strong{font-size:21px!important}
.stat-vocabulary .stat-copy>span{white-space:normal;overflow-wrap:anywhere}
.stat-vocabulary>i{position:static!important;justify-self:end;transform:none!important}

.action-card .action-emoji{display:block!important;width:auto!important;height:auto!important;padding:0!important;background:none!important;border-radius:0!important;color:inherit!important;font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif!important;font-size:31px!important;line-height:1!important}
.action-card .action-emoji:after,.action-card .action-emoji svg,.action-card:nth-child(2) .icon.action-emoji:after{display:none!important;content:none!important}
.home-footer{display:flex;justify-content:center;padding:24px 0 0}
.footer-reset{border:0;background:transparent;color:color-mix(in srgb,var(--muted) 78%,transparent);padding:9px 12px;font-size:12px;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}
.footer-reset:hover{color:var(--red);text-decoration-color:currentColor}

@media(max-width:1180px){
  .topbar-inner{width:calc(100% - 36px);grid-template-columns:auto minmax(360px,1fr) auto;gap:14px}
  .brand{min-width:145px}.brand small{white-space:normal;max-width:120px}
  .topbar nav button{padding-inline:8px;font-size:13px}
  .switch-label{display:none}.switch-control{padding:4px 6px}
}
@media(max-width:940px){
  .topbar-inner{grid-template-columns:1fr auto}.topbar nav{display:none}
  .top-actions{gap:6px}
}
@media(max-width:860px){
  .stats-wide{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px!important}
  .stats-wide .stat-vocabulary{grid-column:1 / -1;min-height:92px}
}
@media(max-width:560px){
  .topbar{height:66px;min-height:66px}.topbar-inner{width:calc(100% - 24px);gap:8px}
  .brand{min-width:0}.brand>span:last-child{display:none}.brand-mark{width:38px;height:38px}
  .top-actions{gap:5px}.icon-toggle,.switch-control,.account-control{height:38px}
  .icon-toggle{width:38px}.account-control{padding-inline:10px!important;font-size:12px}
  .account-control svg{display:none}.switch-control{padding-inline:5px}
  .stats-wide{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px!important}
  .stats-wide .stat{min-width:0!important;min-height:92px}
  .stats-wide .stat:not(.stat-vocabulary){grid-template-columns:28px minmax(0,1fr);gap:9px;padding:14px!important}
  .stats-wide .stat-vocabulary{grid-column:1 / -1;grid-template-columns:30px minmax(0,1fr) 22px;gap:10px;padding:16px!important}
  .stat-emoji{font-size:21px!important}.stat-copy strong{font-size:25px!important}.stat-copy>span{font-size:12px!important}
}

/* The modal must use a real dark surface in dark mode, not the light card color. */
:root[data-theme="dark"] .auth-modal{background:#102237;color:#edf7ff;border-color:#2b4c68;box-shadow:0 30px 80px #000a}
:root[data-theme="dark"] .auth-modal h2{color:#edf7ff}
:root[data-theme="dark"] .auth-form label{color:#d9eafa}
:root[data-theme="dark"] .auth-form input{background:#0a1727;color:#f4faff;border-color:#365873}
:root[data-theme="dark"] .auth-form input:focus{outline:2px solid #66adff;outline-offset:1px}
:root[data-theme="dark"] .auth-tabs{border-color:#2b4c68}
:root[data-theme="dark"] .auth-tabs button{color:#a9c0d5}
:root[data-theme="dark"] .auth-tabs button.on{color:#7db9ff}
:root[data-theme="dark"] .auth-help{color:#b7cce0}
:root[data-theme="dark"] .auth-close{color:#bed2e4}

/* Completion ring: a neutral track and exactly one colored progress arc. */
.progress-ring{isolation:isolate;overflow:visible!important}
:root:not([data-theme="dark"]) .progress-ring,:root[data-theme="dark"] .progress-ring{background:transparent!important;border:0!important;box-shadow:none!important}
.progress-ring:before,.progress-ring:after,.spark-layer{display:none!important;animation:none!important}
.progress-ring>div{z-index:2;box-shadow:inset 0 0 22px rgba(82,157,220,.22)!important}
.progress-ring-track,.progress-arc{position:absolute;inset:0;width:auto;height:auto;margin:0;overflow:visible;border-radius:50%;pointer-events:none;mask:radial-gradient(farthest-side,transparent calc(100% - 21px),#000 calc(100% - 20px));-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 21px),#000 calc(100% - 20px))}
.progress-ring-track{z-index:0;background:linear-gradient(180deg,rgba(255,255,255,.28),rgba(111,151,186,.18) 44%,rgba(75,116,153,.28))}
.progress-arc{z-index:1;overflow:hidden;background:conic-gradient(from 0deg,#bcecff 0,#2f86d8 var(--progress),transparent var(--progress) 100%);filter:drop-shadow(0 4px 4px rgba(22,91,163,.3)) drop-shadow(0 -1px 1px rgba(225,248,255,.75))}
.progress-arc:after{content:"";position:absolute;inset:0;border-radius:50%;background:conic-gradient(from 0deg,rgba(255,255,255,.82) 0,rgba(255,255,255,.08) var(--progress),transparent var(--progress) 100%);mask:radial-gradient(farthest-side,transparent calc(100% - 7px),#000 calc(100% - 6px));-webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 7px),#000 calc(100% - 6px));opacity:.72}
:root[data-theme="dark"] .progress-ring-track{background:linear-gradient(180deg,rgba(190,224,247,.22),rgba(90,130,167,.14) 44%,rgba(24,57,91,.42))}
:root[data-theme="dark"] .progress-arc{background:conic-gradient(from 0deg,#c8f2ff 0,#42a8ee var(--progress),transparent var(--progress) 100%);filter:drop-shadow(0 5px 5px rgba(0,48,105,.48)) drop-shadow(0 -1px 1px rgba(218,248,255,.72))}
:root[data-theme="dark"] .progress-arc:after{background:conic-gradient(from 0deg,rgba(255,255,255,.76) 0,rgba(182,232,255,.08) var(--progress),transparent var(--progress) 100%);opacity:.68}
:root[data-theme="dark"] .progress-ring>div{box-shadow:inset 0 0 20px rgba(121,192,235,.24)!important}
.progress-tick{position:absolute;z-index:3;inset:-5px;display:block;pointer-events:none;transform:rotate(var(--progress-angle));transform-origin:center;transition:transform .7s cubic-bezier(.22,1,.36,1)}
.progress-tick:before{content:"";position:absolute;left:50%;top:0;width:7px;height:26px;border-radius:99px;transform:translateX(-50%);background:linear-gradient(180deg,#ecfdff 0%,#9fe8ff 32%,#268cdd 78%,#1268bc 100%);background-size:100% 220%;box-shadow:0 0 8px rgba(160,230,255,.95),0 0 20px rgba(50,159,230,.52);animation:tick-sheen 2.6s ease-in-out infinite}
@keyframes tick-sheen{0%,100%{background-position:50% 0%;filter:brightness(.94)}50%{background-position:50% 100%;filter:brightness(1.25)}}
@media(prefers-reduced-motion:reduce){.progress-tick:before{animation:none}.progress-tick{transition:none}}
