:root {
  --blue: #2459c4;
  --blue-dark: #173f92;
  --blue-soft: #edf4ff;
  --purple: #7248c9;
  --purple-soft: #f3edff;
  --green: #188b69;
  --green-soft: #e8f8f2;
  --ink: #15223a;
  --muted: #68748a;
  --line: #e4e9f1;
  --surface: #ffffff;
  --background: #f7f9fc;
  --danger: #bd2d3b;
  --shadow: 0 16px 45px rgba(29, 53, 92, .10);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--background);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.login-view, .loading-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #fff;
}
.login-card { position: relative; width: min(100%, 460px); padding: 36px; border: 1px solid var(--line); border-radius: 26px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); text-align: center; }
.login-card h1 { margin: 8px 0; font-size: clamp(1.8rem, 5vw, 2.4rem); }
.login-tools { position: absolute; top: 18px; right: 18px; }
.login-logo { width: 92px; height: 92px; margin: 8px auto 18px; }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 22px 0 12px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: #f8f9fc; }
.auth-choice-button { min-height: 39px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-weight: 800; cursor: pointer; }
.auth-choice-button.active { color: white; background: var(--blue); }
.login-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 24px 0 10px; padding: 5px; border-radius: 15px; background: #edf1f7; }
.login-choice-button { display: grid; gap: 3px; min-width: 0; padding: 12px 8px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; }
.login-choice-button strong { color: inherit; font-size: .86rem; }
.login-choice-button small { font-size: .68rem; font-weight: 650; }
.login-choice-button.active { color: var(--blue); background: white; box-shadow: 0 5px 16px rgba(31, 71, 127, .1); }
.login-mode-help { min-height: 38px; margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.45; }
.brand-blue-logo { display: inline-grid; place-items: center; overflow: hidden; background: #fff; }
.brand-blue-logo img { width: 100%; height: 100%; object-fit: contain; object-position: center; }
.eyebrow { margin: 0; color: var(--blue); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.muted { color: var(--muted); }
.tiny-note { color: var(--muted); font-size: .78rem; }
.text-link { display: inline-block; margin-top: 12px; color: var(--blue); font-weight: 700; }
.loading-view { align-content: center; gap: 12px; color: var(--muted); }
.spinner { width: 42px; height: 42px; border: 4px solid #dce5f7; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 258px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 24px 18px; border-right: 1px solid var(--line); background: #fff; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; margin: 0 8px 31px; text-decoration: none; }
.brand-logo { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; overflow: hidden; background: #fff; }
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; }
.brand small { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.main-nav { display: grid; gap: 6px; }
.main-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: #4e5b71; font-weight: 650; text-decoration: none; }
.main-nav a span { width: 22px; text-align: center; font-size: 1.15rem; }
.main-nav a:hover { background: #f2f5fa; }
.main-nav a.active { color: var(--blue); background: var(--blue-soft); }
.teacher-card { margin-top: auto; padding: 17px; border-radius: 17px; background: linear-gradient(145deg, #eef5ff, #f8fbff); border: 1px solid #dce7f8; }
.teacher-card p { margin: 5px 0 12px; color: var(--muted); font-size: .88rem; }
.main-area { min-width: 0; }
.topbar { height: 76px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; padding: 0 clamp(18px, 4vw, 52px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.86); backdrop-filter: blur(14px); position: sticky; top: 0; z-index: 20; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.streak-pill { padding: 9px 13px; border: 1px solid #f2dfbf; border-radius: 999px; background: #fff9eb; color: #805512; font-size: .84rem; font-weight: 700; }
.initials { width: 46px; height: 46px; display: grid; place-items: center; overflow: hidden; padding: 0; border: 2px solid #d7e4fb; border-radius: 50%; color: #fff; background: var(--blue); box-shadow: 0 5px 15px rgba(36,89,196,.18); font-size: .82rem; font-weight: 900; letter-spacing: .04em; cursor: pointer; }

.icon-button { border: 0; border-radius: 10px; background: transparent; cursor: pointer; }
.menu-button { display: none; font-size: 1.4rem; }
.page { width: min(1180px, calc(100% - 48px)); margin: 0 auto; padding: 40px 0 64px; outline: none; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; }
.page-header h1 { margin: 0 0 7px; font-size: clamp(1.75rem, 3vw, 2.45rem); }
.page-header p { margin: 0; color: var(--muted); }
.hero { min-height: 235px; display: grid; grid-template-columns: 1.4fr .6fr; align-items: center; gap: 28px; padding: clamp(26px, 5vw, 52px); overflow: hidden; border-radius: 27px; color: white; background: linear-gradient(125deg, #183e92 0%, #2a65d4 56%, #5d8ae6 100%); box-shadow: 0 20px 45px rgba(29, 74, 165, .22); }
.hero h1 { max-width: 650px; margin: 7px 0 10px; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.05; }
.hero p { max-width: 620px; margin: 0; color: rgba(255,255,255,.82); }
.hero-art { justify-self: center; width: 145px; height: 145px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 4.2rem; background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 35px 0 16px; }
.section-title h2 { margin: 0; font-size: 1.25rem; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 23px; }
.feature-card { min-height: 185px; display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; text-decoration: none; box-shadow: 0 6px 20px rgba(28, 51, 87, .05); transition: transform .18s ease, box-shadow .18s ease; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature-card h2 { margin: 15px 0 7px; font-size: 1.12rem; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: .9rem; }
.feature-card .arrow { margin-top: auto; font-weight: 800; }
.feature-icon { width: 45px; height: 45px; display: grid; place-items: center; border-radius: 13px; font-size: 1.25rem; }
.blue .feature-icon { color: var(--blue); background: var(--blue-soft); }
.purple .feature-icon { color: var(--purple); background: var(--purple-soft); }
.green .feature-icon { color: var(--green); background: var(--green-soft); }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 16px; }
.deck-card { position: relative; display: flex; flex-direction: column; min-height: 170px; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.deck-card h3 { margin: 13px 0 5px; }
.deck-card p { margin: 0; color: var(--muted); font-size: .86rem; }
.deck-card .deck-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 17px; }
.deck-mode, .status-pill { display: inline-flex; width: fit-content; padding: 5px 9px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .72rem; font-weight: 800; text-transform: capitalize; }
.deck-menu { position: absolute; top: 14px; right: 14px; }
.empty-card { grid-column: 1 / -1; padding: 42px 24px; border: 2px dashed #dce3ee; border-radius: 19px; color: var(--muted); background: rgba(255,255,255,.6); text-align: center; }
.empty-card h3 { margin: 0 0 7px; color: var(--ink); }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 11px; font-weight: 750; text-decoration: none; cursor: pointer; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { color: #fff; background: var(--blue); }
.button.primary:hover { background: var(--blue-dark); }
.button.secondary { color: var(--ink); border-color: var(--line); background: #fff; }
.button.soft { color: var(--blue); background: var(--blue-soft); }
.button.danger { color: #fff; background: var(--danger); }
.button.small { min-height: 34px; padding: 7px 10px; font-size: .78rem; }
.wide { width: 100%; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }

.helper-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; }
.chat-panel { min-height: 590px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; }
.chat-messages { flex: 1; display: flex; flex-direction: column; gap: 13px; padding: 22px; overflow-y: auto; }
.message { max-width: min(78%, 680px); padding: 12px 14px; border-radius: 15px; white-space: pre-wrap; line-height: 1.48; }
.message.helper { align-self: flex-start; background: #f0f4fb; }
.message.user { align-self: flex-end; color: #fff; background: var(--blue); }
.chat-compose { padding: 14px; border-top: 1px solid var(--line); }
.chat-compose textarea { width: 100%; resize: vertical; }
.chat-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.quick-prompts { display: grid; align-content: start; gap: 9px; }
.quick-prompts h3 { margin: 0 0 4px; }
.prompt-button { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.helper-note { padding: 14px; border-radius: 13px; color: #4f5d73; background: #fff7e8; font-size: .8rem; line-height: 1.5; }

.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 15px; }
.note-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.note-card h3 { margin: 0 0 8px; }
.note-card p { color: var(--muted); }
.note-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.upload-panel { margin-bottom: 24px; padding: 21px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack-form { display: grid; gap: 15px; margin-top: 20px; text-align: left; }
.stack-form label, fieldset { display: grid; gap: 7px; color: #3b4659; font-size: .87rem; font-weight: 700; }
input, textarea, select { width: 100%; padding: 11px 12px; border: 1px solid #d3dbe7; border-radius: 10px; color: var(--ink); background: #fff; outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,89,196,.12); }
textarea { resize: vertical; line-height: 1.45; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 8px; }
.radio-card { display: flex !important; grid-template-columns: auto 1fr; align-items: flex-start; gap: 10px !important; padding: 11px; border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.radio-card input { width: auto; margin-top: 3px; }
.radio-card span, .radio-card small { display: block; }
.radio-card small { margin-top: 3px; color: var(--muted); font-weight: 500; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: .83rem; }
.form-success { min-height: 18px; margin: 0; color: #126a50; font-size: .83rem; line-height: 1.45; }

.study-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; }
.deck-list { display: grid; align-content: start; gap: 7px; }
.deck-list button { padding: 11px 12px; border: 1px solid transparent; border-radius: 11px; color: #506079; background: transparent; text-align: left; cursor: pointer; }
.deck-list button.active { color: var(--blue); border-color: #dce7fb; background: var(--blue-soft); font-weight: 800; }
.study-panel { min-height: 420px; padding: 22px; border: 1px solid var(--line); border-radius: 19px; background: #fff; }
.study-panel-header { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
.study-panel-header h2 { margin: 0; }
.item-list { display: grid; gap: 12px; }
.study-item { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.study-item h3 { margin: 0 0 8px; font-size: 1rem; }
.study-item p { margin: 6px 0; color: var(--muted); white-space: pre-wrap; }
.item-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.inline-editor { padding: 18px; border: 1px solid #cfdcf5; border-radius: 14px; background: #f8fbff; }

.study-runner { width: min(760px, 100%); margin: 0 auto; }
.runner-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.progress-track { height: 9px; overflow: hidden; margin-bottom: 28px; border-radius: 999px; background: #e5eaf3; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #5d8ae6); transition: width .2s ease; }
.flip-card { width: 100%; min-height: 390px; display: grid; place-items: center; align-content: center; gap: 20px; padding: 42px; border: 1px solid #d7e0ee; border-radius: 25px; color: var(--ink); background: #fff; box-shadow: var(--shadow); text-align: center; cursor: pointer; }
.flip-card.flipped { background: linear-gradient(145deg, #f4f8ff, #fff); }
.flip-card small { color: var(--blue); font-weight: 850; letter-spacing: .09em; text-transform: uppercase; }
.flip-card strong { font-size: clamp(1.5rem, 4vw, 2.4rem); line-height: 1.25; white-space: pre-wrap; }
.flip-card span { color: var(--muted); font-weight: 700; }
.runner-actions { display: flex; justify-content: center; gap: 12px; margin-top: 20px; }
.quiz-stage, .result-card { padding: clamp(25px, 5vw, 46px); border: 1px solid var(--line); border-radius: 24px; background: #fff; box-shadow: var(--shadow); }
.quiz-stage > small { color: var(--blue); font-weight: 850; }
.quiz-stage h2 { margin: 15px 0 25px; font-size: clamp(1.35rem, 3vw, 2rem); }
.answer-feedback { padding: 15px; border-radius: 13px; }
.answer-feedback.correct { color: #11694f; background: var(--green-soft); }
.answer-feedback.incorrect { color: #93404a; background: #fff0f1; }
.answer-feedback p { margin-bottom: 0; }
.result-card { max-width: 560px; margin: 50px auto; text-align: center; }
.result-score { width: 130px; height: 130px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, var(--blue), #6b82df); font-size: 2.2rem; font-weight: 900; }

.notice-panel { margin-bottom: 22px; padding: 20px; border: 1px solid #f0daa4; border-radius: 18px; background: #fff9e9; }
.notice-panel h2 { margin-top: 0; font-size: 1.1rem; }
.invite-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.invite-row p { margin: 4px 0 0; color: var(--muted); }
.assignment-list, .progress-list { display: grid; gap: 13px; }
.assignment-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.assignment-card h3 { margin: 10px 0 6px; }
.assignment-card p { margin: 0 0 10px; color: var(--muted); }
.assignment-card small { color: var(--muted); }
.compact-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.compact-form label { display: grid; gap: 7px; color: #3b4659; font-size: .87rem; font-weight: 700; }
.assignment-editor { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 9px; }
.check-row { display: flex !important; align-items: center; gap: 10px !important; min-height: 48px; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.check-row input { width: auto; }
.check-row span, .check-row small { display: block; }
.check-row small { margin-top: 2px; color: var(--muted); font-weight: 500; }
.draft-item-list { display: grid; gap: 10px; margin-bottom: 12px; }
.assignment-item-adder { grid-template-columns: 1fr 1fr auto; align-items: end; }
.assignment-item-adder .button { margin-bottom: 1px; }
.progress-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.progress-row span, .progress-score small { display: block; margin-top: 4px; color: var(--muted); }
.progress-score { text-align: right; }
.progress-score strong { color: var(--blue); font-size: 1.35rem; }

.dialog { width: min(94vw, 610px); max-height: 90vh; padding: 28px; border: 0; border-radius: 20px; box-shadow: 0 28px 70px rgba(20, 34, 56, .3); overflow-y: auto; }
.dialog::backdrop { background: rgba(15, 28, 49, .55); backdrop-filter: blur(3px); }
.dialog h2 { margin-top: 0; }
.small-dialog > .button { margin-top: 10px; }
.small-dialog { width: min(92vw, 390px); }
.large-dialog { width: min(94vw, 800px); }
.dialog-close { position: absolute; top: 12px; right: 15px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f4f8; font-size: 1.35rem; cursor: pointer; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 7px; }
.practice-preview { display: grid; gap: 10px; }
.preview-item { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfd; }
.preview-item textarea { min-height: 78px; }
.admin-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-bottom: 22px; }
.stat { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.stat strong { display: block; font-size: 1.7rem; }
.stat span { color: var(--muted); }
.admin-list { display: grid; gap: 10px; }
.admin-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.toast { position: fixed; left: 50%; bottom: 25px; z-index: 100; transform: translate(-50%, 120px); max-width: min(90vw, 520px); padding: 12px 17px; border-radius: 11px; color: #fff; background: #1d2d47; box-shadow: var(--shadow); opacity: 0; transition: .25s ease; pointer-events: none; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(82vw, 280px); box-shadow: var(--shadow); transition: transform .2s ease; }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-grid; place-items: center; }
  .feature-grid { grid-template-columns: 1fr; }
  .helper-layout, .study-layout { grid-template-columns: 1fr; }
  .deck-list { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 620px) {
  .page { width: min(100% - 28px, 1180px); padding-top: 25px; }
  .topbar { height: 66px; padding: 0 14px; }
  .streak-pill { padding: 7px 9px; font-size: .72rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-art { display: none; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .form-grid, .preview-item { grid-template-columns: 1fr; }
  .compact-form, .assignment-item-adder { grid-template-columns: 1fr; }
  .assignment-card, .invite-row { align-items: stretch; flex-direction: column; }
  .flip-card { min-height: 310px; padding: 26px 19px; }
  .admin-stats { grid-template-columns: 1fr; }
  .login-card { padding: 27px 20px; }
  .dialog { padding: 25px 18px; }
}


/* V5 classroom and navigation additions */
.sidebar-worldlink { margin: 16px 4px 0; }
.teacher-card[hidden] { display: none !important; }
.home-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.teacher-features { grid-template-columns: repeat(2, 1fr); }
.classroom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.classroom-card { padding: 21px; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 8px 24px rgba(30,57,100,.06); }
.classroom-card h3 { margin: 10px 0 8px; }
.classroom-card p, .classroom-card small { color: var(--muted); }
.class-code-label { margin: 14px 0 3px !important; font-size: .78rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.class-code { display: block; margin-bottom: 8px; color: var(--blue-dark); font-size: 1.65rem; letter-spacing: .16em; }
.classroom-members { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.classroom-members span { padding: 6px 9px; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .8rem; font-weight: 700; }
@media (max-width: 900px) { .teacher-features { grid-template-columns: 1fr; } }


/* V6 account, role and topbar refinements */
.topbar-actions { margin-left: auto; justify-content: flex-end; }
.language-menu { position: relative; display: inline-flex; }
.language-menu-button { min-height: 40px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border: 1px solid #d7e0ee; border-radius: 11px; color: var(--blue-dark); background: #fff; font-size: .82rem; font-weight: 800; cursor: pointer; }
.language-menu-button:hover { background: var(--blue-soft); }
.language-menu-popover { position: absolute; top: calc(100% + 7px); right: 0; z-index: 80; min-width: 130px; overflow: hidden; padding: 5px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.language-menu-popover button { width: 100%; padding: 9px 11px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; font-weight: 700; cursor: pointer; }
.language-menu-popover button:hover, .language-menu-popover button.active { color: var(--blue); background: var(--blue-soft); }
.login-step-title { margin: 26px 0 12px; font-weight: 800; }
.role-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-choice-button { min-height: 132px; display: grid; justify-items: center; align-content: center; gap: 7px; padding: 18px 12px; border: 1px solid #dbe4f1; border-radius: 18px; color: var(--ink); background: #fff; box-shadow: 0 6px 18px rgba(25,58,109,.05); cursor: pointer; }
.role-choice-button:hover { border-color: #a9c2ef; background: #f8fbff; transform: translateY(-1px); }
.role-choice-button small { color: var(--muted); font-size: .72rem; line-height: 1.35; }
.role-choice-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 900; }
.login-role-back { margin: 18px auto 8px; }
.selected-login-role { width: fit-content; margin: 0 auto 8px; padding: 6px 10px; border-radius: 999px; color: var(--blue); background: var(--blue-soft); font-size: .78rem; font-weight: 850; }
.account-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; text-align: left; }
.account-avatar-row h2, .account-avatar-row p { margin: 0; }
.account-initials { width: 54px; height: 54px; flex: 0 0 54px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-weight: 900; letter-spacing: .04em; }
.username-editor { display: grid; gap: 9px; margin: 18px 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: #f9fbff; text-align: left; }
.username-editor .tiny-note, .username-editor .form-status { margin: 0; }
.username-editor .button { margin-top: 2px; }
@media (max-width: 620px) {
  .topbar-actions { gap: 7px; }
  .language-menu-button { min-height: 36px; padding: 7px 9px; font-size: .72rem; }
  .initials { width: 38px; height: 38px; font-size: .7rem; }
  .streak-pill { white-space: nowrap; }
  .role-choice { grid-template-columns: 1fr; }
}
