/* ==========================================================================
   French with Manga — Student Portal
   Depends on css/main.css for design tokens, buttons and base type.
   ========================================================================== */

:root {
  --sidebar-w: 264px;
  --topbar-h: 68px;

  /* Chart roles — validated set (see reports charts) */
  --series-1: #3A4F9A;   /* brand blue      */
  --series-2: #EB6834;   /* orange          */
  --series-3: #1BAF7A;   /* aqua            */
  --seq-100: #cde2fb;
  --seq-250: #86b6ef;
  --seq-400: #3987e5;
  --seq-550: #1c5cab;
  --seq-700: #0d366b;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --grid-line: #E7E9F1;
  --axis-ink: #8A8FA3;
}

body.portal {
  background-color: var(--bg);
  overflow-x: hidden;
}

/* ==========================================================================
   Auth pages (login / signup / reset)
   ========================================================================== */

.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 3rem;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(40rem 30rem at 80% 0%, rgba(255, 125, 89, .35), transparent 60%),
    linear-gradient(160deg, var(--primary) 0%, var(--primary-dark) 60%, #1B2450 100%);
}

.auth-aside .logo { color: #fff; font-size: 1.35rem; }
.auth-aside .logo span { color: #FFC5B2; }

.auth-aside-body { max-width: 26rem; }

.auth-aside-body h2 {
  font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  margin-bottom: 1rem;
}

.auth-aside-body p {
  color: rgba(255, 255, 255, .75);
  font-size: 1.02rem;
}

.auth-points {
  display: grid;
  gap: .9rem;
  margin-top: 2rem;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .95rem;
  color: rgba(255, 255, 255, .88);
}

.auth-points i {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  font-size: .7rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, .16);
}

.auth-quote {
  padding: 1.25rem 1.4rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
  font-size: .92rem;
  color: rgba(255, 255, 255, .9);
}

.auth-quote footer {
  margin-top: .6rem;
  font-size: .82rem;
  color: rgba(255, 255, 255, .6);
}

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--surface);
}

.auth-card {
  width: 100%;
  max-width: 27rem;
}

.auth-card h1 {
  font-size: 1.9rem;
  margin-bottom: .5rem;
}

.auth-lede {
  color: var(--muted);
  margin-bottom: 2rem;
}

.auth-tabs {
  display: flex;
  gap: .25rem;
  padding: .3rem;
  margin-bottom: 1.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
}

.auth-tabs a {
  flex: 1;
  padding: .55rem;
  text-align: center;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-full);
}

.auth-tabs a.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.social-auth {
  display: grid;
  gap: .75rem;
  margin-bottom: 1.5rem;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  width: 100%;
  padding: .8rem;
  font-size: .93rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.btn-social:hover { border-color: var(--muted); background: var(--bg); }

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  font-size: .8rem;
  color: var(--muted);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-hint {
  margin: -.9rem 0 1.4rem;
  font-size: .82rem;
  color: var(--muted);
}

.form-error {
  display: block;
  margin-top: .4rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--status-critical);
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: var(--status-critical);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: .75rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.password-toggle:hover { color: var(--ink); background: var(--bg); }

.strength-meter {
  display: flex;
  gap: .3rem;
  margin: -.85rem 0 .5rem;
}

.strength-meter span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transition: background var(--transition);
}

.strength-meter[data-score="1"] span:nth-child(-n+1) { background: var(--status-critical); }
.strength-meter[data-score="2"] span:nth-child(-n+2) { background: var(--status-serious); }
.strength-meter[data-score="3"] span:nth-child(-n+3) { background: var(--status-warning); }
.strength-meter[data-score="4"] span { background: var(--status-good); }

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin-bottom: 1.4rem;
  font-size: .9rem;
  color: var(--muted);
  cursor: pointer;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: .15rem;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.checkbox a { color: var(--primary); font-weight: 500; }

.auth-alt {
  margin-top: 1.5rem;
  text-align: center;
  font-size: .92rem;
  color: var(--muted);
}

.auth-alt a { color: var(--primary); font-weight: 600; }

.demo-note {
  display: flex;
  gap: .75rem;
  padding: .9rem 1rem;
  margin-bottom: 1.5rem;
  font-size: .86rem;
  line-height: 1.5;
  color: var(--muted);
  background: var(--primary-tint);
  border: 1px dashed rgba(58, 79, 154, .3);
  border-radius: var(--radius-sm);
}

.demo-note i { color: var(--primary); margin-top: .15rem; }
.demo-note strong { color: var(--ink); }
.demo-note button {
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 0;
  border-bottom: 1px dashed currentColor;
  cursor: pointer;
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-main { align-items: flex-start; padding-top: 3rem; }
}

/* ==========================================================================
   App shell
   ========================================================================== */

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  height: 100vh;
  padding: 1.25rem 1rem;
  background: var(--surface);
  border-right: 1px solid var(--line);
  transition: transform var(--transition);
}

.app-sidebar .logo {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .35rem .5rem 1.5rem;
  font-size: 1.08rem;
}

.app-sidebar .logo-mark {
  width: 32px;
  height: 32px;
}

.side-nav {
  display: grid;
  align-content: start;
  gap: .2rem;
  flex: 1;
  overflow-y: auto;
}

.side-nav-label {
  padding: 1.25rem .75rem .4rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--axis-ink);
}

.side-link {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem .75rem;
  font-size: .93rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.side-link i {
  width: 20px;
  font-size: .95rem;
  text-align: center;
}

.side-link:hover { background: var(--bg); color: var(--ink); }

.side-link.active {
  background: var(--primary-tint);
  color: var(--primary);
  font-weight: 600;
}

.side-link .pill {
  margin-left: auto;
  padding: .1rem .5rem;
  font-size: .7rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.side-cta {
  margin-top: 1rem;
  padding: 1.1rem;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, var(--primary), var(--primary-dark));
  color: #fff;
}

.side-cta h4 {
  font-family: var(--font-main);
  font-size: .92rem;
  margin-bottom: .3rem;
}

.side-cta p {
  margin-bottom: .9rem;
  font-size: .8rem;
  color: rgba(255, 255, 255, .75);
}

.side-cta .btn {
  width: 100%;
  padding: .55rem;
  font-size: .84rem;
  background: #fff;
  color: var(--primary);
  box-shadow: none;
}

.side-cta .btn:hover { background: #fff; color: var(--primary-dark); }

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 1rem;
  height: var(--topbar-h);
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: rgba(246, 247, 251, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-title { min-width: 0; }

.topbar-title h1 {
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-title p {
  margin-bottom: 0;
  font-size: .82rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-left: auto;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.icon-btn:hover { color: var(--primary); border-color: rgba(58, 79, 154, .3); }

.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
}

.menu-toggle { display: none; }

.user-chip {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .3rem .7rem .3rem .3rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: border-color var(--transition);
}

.user-chip:hover { border-color: rgba(58, 79, 154, .3); }

.user-chip .avatar { width: 32px; height: 32px; font-size: .78rem; }

.user-chip-name {
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
}

.user-chip-name small {
  display: block;
  font-size: .74rem;
  font-weight: 500;
  color: var(--muted);
}

.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  width: 300px;
  padding: .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
}

.dropdown.open { opacity: 1; visibility: visible; transform: none; }

.dropdown-wrap { position: relative; }

.dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .75rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--axis-ink);
}

.dropdown-head button {
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary);
  background: none;
  border: 0;
  cursor: pointer;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .6rem .75rem;
  font-size: .9rem;
  font-family: inherit;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--bg); }
.dropdown-item i { width: 18px; color: var(--muted); text-align: center; }
.dropdown-item.danger { color: var(--status-critical); }
.dropdown-item.danger i { color: var(--status-critical); }

.dropdown hr { margin: .4rem .5rem; border: 0; border-top: 1px solid var(--line); }

.notice-item {
  display: flex;
  gap: .75rem;
  padding: .7rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.notice-item:hover { background: var(--bg); }
.notice-item.unread { background: var(--primary-tint); }

.notice-item i {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  font-size: .8rem;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-full);
}

.notice-item p {
  margin-bottom: .15rem;
  font-size: .86rem;
  line-height: 1.45;
}

.notice-item small { font-size: .76rem; color: var(--muted); }

.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.app-content {
  padding: clamp(1.25rem, 3vw, 2rem);
  max-width: 1280px;
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(21, 24, 43, .5);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.sidebar-backdrop.open { opacity: 1; visibility: visible; }

@media (max-width: 1024px) {
  .app-sidebar { transform: translateX(-100%); }
  .app-sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .app-main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .user-chip-name { display: none; }
}

/* ==========================================================================
   Cards, grids, generic bits
   ========================================================================== */

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.card {
  padding: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.card.flush { padding: 0; overflow: hidden; }
.card.accent { background: linear-gradient(140deg, var(--primary), var(--primary-dark)); color: #fff; border-color: transparent; }
.card.accent .card-head h3 { color: #fff; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.card-head h3 {
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .15rem;
}

.card-head p {
  margin-bottom: 0;
  font-size: .84rem;
  color: var(--muted);
}

.card-head .link {
  font-size: .85rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

.section-gap { margin-bottom: 1.25rem; }

.stat-tile {
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.stat-tile .tile-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: .9rem;
  font-size: .9rem;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
}

.stat-tile .tile-value {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
}

.stat-tile .tile-label {
  font-size: .84rem;
  color: var(--muted);
}

.stat-tile .tile-delta {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .5rem;
  font-size: .78rem;
  font-weight: 600;
}

.tile-delta.up { color: #006300; }
.tile-delta.down { color: var(--status-critical); }
.tile-delta.flat { color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .6rem;
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge i { font-size: .65rem; }
.badge-neutral { background: var(--bg-alt); color: var(--muted); }
.badge-brand { background: var(--primary-tint); color: var(--primary); }
.badge-good { background: rgba(12, 163, 12, .12); color: #0a7d0a; }
.badge-warning { background: rgba(250, 178, 25, .16); color: #8a6100; }
.badge-critical { background: rgba(208, 59, 59, .12); color: var(--status-critical); }
.badge-accent { background: var(--accent-tint); color: #C4501F; }

.progress-track {
  display: block;
  height: 8px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width .8s cubic-bezier(.4, 0, .2, 1);
}

.progress-fill.accent { background: linear-gradient(90deg, var(--accent), #FFA98D); }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .84rem;
  color: var(--muted);
}

.meta-row span { display: inline-flex; align-items: center; gap: .4rem; }

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--muted);
}

.empty-state i {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  font-size: 1.4rem;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-full);
}

.empty-state h3 { font-family: var(--font-main); font-size: 1.05rem; color: var(--ink); }

.skeleton {
  background: linear-gradient(90deg, var(--bg-alt) 25%, #F4F5FA 37%, var(--bg-alt) 63%);
  background-size: 400% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Tables */
.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

table.data th {
  padding: .8rem 1.25rem;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--axis-ink);
  text-align: left;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data td {
  padding: .95rem 1.25rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--bg); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

/* Tabs */
.tabs {
  display: flex;
  gap: .25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}

.tab {
  padding: .75rem 1rem;
  font-size: .92rem;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.tab:hover { color: var(--ink); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeUp .35s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Segmented control */
.segmented {
  display: inline-flex;
  padding: .25rem;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
}

.segmented button {
  padding: .45rem 1rem;
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.segmented button.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Toggle switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.switch .slider {
  position: absolute;
  inset: 0;
  background: #C8CCDA;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition);
}

.switch .slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.setting-row:last-child { border-bottom: 0; }
.setting-row h4 { font-family: var(--font-main); font-size: .95rem; margin-bottom: .15rem; }
.setting-row p { margin-bottom: 0; font-size: .84rem; color: var(--muted); }

/* Choice cards (onboarding, checkout, plans) */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(244px, 1fr));
  gap: 1rem;
}

.choice {
  position: relative;
  display: flex;
  gap: .9rem;
  padding: 1.15rem;
  text-align: left;
  font-family: inherit;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.choice:hover { border-color: rgba(58, 79, 154, .35); transform: translateY(-2px); }

.choice.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(58, 79, 154, .12);
}

.choice.selected::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: .8rem;
  right: .8rem;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: .62rem;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
}

.choice i.choice-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
}

.choice h4 {
  font-family: var(--font-main);
  font-size: .95rem;
  margin-bottom: .2rem;
  padding-right: 1.5rem;
}

.choice p { margin-bottom: 0; font-size: .83rem; color: var(--muted); }

.chip-grid { display: flex; flex-wrap: wrap; gap: .6rem; }

.chip {
  padding: .55rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--muted);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover { border-color: rgba(58, 79, 154, .35); color: var(--ink); }

.chip.selected {
  color: var(--primary);
  background: var(--primary-tint);
  border-color: var(--primary);
  font-weight: 600;
}

/* ==========================================================================
   Onboarding
   ========================================================================== */

.onboarding-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.onboarding-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.step-track {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.step-dot {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
}

.step-dot span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: .78rem;
  background: var(--bg-alt);
  border-radius: 50%;
}

.step-dot.active { color: var(--primary); }
.step-dot.active span { background: var(--primary); color: #fff; }
.step-dot.done span { background: rgba(12, 163, 12, .15); color: #0a7d0a; }
.step-dot i { color: var(--line); font-size: .7rem; }

.onboarding-body {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(1.5rem, 5vw, 3.5rem) 1.25rem 6rem;
}

.onboarding-step { width: 100%; max-width: 46rem; }

.onboarding-step > header { margin-bottom: 2rem; text-align: center; }
.onboarding-step > header h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: .5rem; }
.onboarding-step > header p { color: var(--muted); max-width: 34rem; margin-inline: auto; }

.onboarding-foot {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.quiz-question {
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.quiz-question h4 {
  font-family: var(--font-main);
  font-size: .98rem;
  margin-bottom: 1rem;
}

.quiz-options { display: grid; gap: .55rem; }

.quiz-option {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .75rem 1rem;
  font-size: .92rem;
  font-family: inherit;
  text-align: left;
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.quiz-option:hover { border-color: rgba(58, 79, 154, .3); }
.quiz-option.selected { background: var(--primary-tint); border-color: var(--primary); font-weight: 500; }
.quiz-option.correct { background: rgba(12, 163, 12, .1); border-color: var(--status-good); }
.quiz-option.wrong { background: rgba(208, 59, 59, .08); border-color: var(--status-critical); }

.quiz-option .key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
}

.quiz-option.selected .key { background: var(--primary); border-color: var(--primary); color: #fff; }
.quiz-option.correct .key { background: var(--status-good); border-color: var(--status-good); color: #fff; }
.quiz-option.wrong .key { background: var(--status-critical); border-color: var(--status-critical); color: #fff; }

.explain {
  margin: .75rem 0 0;
  padding: .8rem 1rem;
  font-size: .86rem;
  color: var(--muted);
  background: var(--bg);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ==========================================================================
   Program & lessons
   ========================================================================== */

.program-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2rem;
  align-items: center;
  padding: 1.75rem;
  color: #fff;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(30rem 20rem at 90% 10%, rgba(255, 125, 89, .3), transparent 60%),
    linear-gradient(140deg, var(--primary), var(--primary-dark));
}

.program-hero h2 { font-size: 1.7rem; margin-bottom: .5rem; }
.program-hero p { color: rgba(255, 255, 255, .78); margin-bottom: 1.25rem; }

.program-hero .meta-row { color: rgba(255, 255, 255, .8); }

.ring {
  display: grid;
  place-items: center;
  position: relative;
  width: 148px;
  height: 148px;
  margin-inline: auto;
}

.ring svg { transform: rotate(-90deg); }
.ring-value {
  position: absolute;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.ring-value small {
  display: block;
  margin-top: .2rem;
  font-size: .72rem;
  font-weight: 500;
  opacity: .75;
}

.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1rem;
}

.module-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.15rem 1.35rem;
  text-align: left;
  font-family: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.module-head:hover { background: var(--bg); }

.module-index {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
}

.module.done .module-index { background: rgba(12, 163, 12, .13); color: #0a7d0a; }
.module.locked .module-index { background: var(--bg-alt); color: var(--axis-ink); }

.module-title { flex: 1; min-width: 0; }
.module-title h3 { font-family: var(--font-main); font-size: 1rem; margin-bottom: .25rem; }
.module-title p { margin-bottom: 0; font-size: .83rem; color: var(--muted); }

.module-chevron { color: var(--muted); transition: transform var(--transition); }
.module.open .module-chevron { transform: rotate(180deg); }

.module-body { display: none; padding: 0 1.35rem 1.1rem; }
.module.open .module-body { display: block; }

.lesson-row {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .8rem 1rem;
  margin-bottom: .5rem;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.lesson-row:hover { border-color: rgba(58, 79, 154, .25); background: var(--surface); }
.lesson-row.locked { opacity: .6; }
.lesson-row.locked:hover { border-color: transparent; background: var(--bg); }

.lesson-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: .8rem;
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
}

.lesson-row.done .lesson-icon { background: var(--status-good); border-color: var(--status-good); color: #fff; }

.lesson-info { flex: 1; min-width: 0; }
.lesson-info h4 { font-family: var(--font-main); font-size: .93rem; margin-bottom: .1rem; font-weight: 600; }
.lesson-info small { font-size: .78rem; color: var(--muted); }

.lesson-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  color: #fff;
  border-radius: var(--radius-md);
  overflow: hidden;
  background:
    radial-gradient(24rem 18rem at 70% 20%, rgba(255, 125, 89, .35), transparent 60%),
    linear-gradient(150deg, #22305F, var(--ink));
}

.play-btn {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  font-size: 1.3rem;
  color: var(--primary);
  background: #fff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  transition: transform var(--transition);
}

.play-btn:hover { transform: scale(1.06); }

.lesson-stage .stage-meta {
  position: absolute;
  left: 1.25rem;
  bottom: 1.25rem;
  font-size: .85rem;
  color: rgba(255, 255, 255, .8);
}

.flashcard {
  position: relative;
  height: 190px;
  perspective: 1200px;
  cursor: pointer;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .6s;
  transform-style: preserve-3d;
}

.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }

.flashcard-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: .4rem;
  padding: 1.25rem;
  text-align: center;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--surface);
}

.flashcard-face.back {
  transform: rotateY(180deg);
  color: #fff;
  background: linear-gradient(140deg, var(--primary), var(--primary-dark));
  border-color: transparent;
}

.flashcard-face .term { font-family: var(--font-heading); font-size: 1.5rem; }
.flashcard-face .phon { font-size: .85rem; color: var(--muted); }
.flashcard-face.back .phon { color: rgba(255, 255, 255, .7); }
.flashcard-face .hintline { font-size: .76rem; color: var(--axis-ink); }

/* ==========================================================================
   Schedule
   ========================================================================== */

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .4rem;
}

.calendar-grid .dow {
  padding: .4rem 0;
  text-align: center;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--axis-ink);
}

.day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  min-height: 62px;
  padding: .45rem .25rem;
  font-size: .85rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.day.muted { color: var(--axis-ink); background: transparent; cursor: default; }
.day.past { color: var(--axis-ink); background: transparent; cursor: not-allowed; }
.day:not(.muted):not(.past):hover { border-color: var(--primary); }
.day.selected { background: var(--primary); color: #fff; border-color: var(--primary); }
.day.today { border-color: var(--accent); }

.day .marker {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.day.selected .marker { background: #fff; }
.day .slot-count { font-size: .66rem; color: var(--muted); }
.day.selected .slot-count { color: rgba(255, 255, 255, .85); }

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: .6rem;
}

.slot {
  padding: .65rem;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.slot:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.slot.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.slot:disabled { color: var(--axis-ink); background: var(--bg); cursor: not-allowed; text-decoration: line-through; }

.session-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: .85rem;
}

.session-date {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 58px;
  padding: .5rem;
  text-align: center;
  color: var(--primary);
  background: var(--primary-tint);
  border-radius: var(--radius-sm);
}

.session-date strong { font-size: 1.25rem; line-height: 1; }
.session-date small { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; }

.session-body { flex: 1; min-width: 0; }
.session-body h4 { font-family: var(--font-main); font-size: .97rem; margin-bottom: .25rem; }
.session-actions { display: flex; gap: .5rem; flex-shrink: 0; }

.btn-sm { padding: .5rem 1rem; font-size: .84rem; }
.btn-ghost {
  background: none;
  border-color: var(--line);
  color: var(--muted);
}
.btn-ghost:hover { background: var(--bg); color: var(--ink); border-color: var(--muted); }
.btn-danger { background: var(--status-critical); color: #fff; }
.btn-danger:hover { background: #b32f2f; }

/* ==========================================================================
   Billing & checkout
   ========================================================================== */

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.5rem;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  transition: var(--transition);
}

.plan-card:hover { border-color: rgba(58, 79, 154, .3); box-shadow: var(--shadow-md); }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58, 79, 154, .1); }
.plan-card.popular { border-color: var(--accent); }

.plan-flag {
  position: absolute;
  top: -12px;
  left: 1.5rem;
  padding: .25rem .8rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: .3rem;
  margin: .75rem 0 .25rem;
}

.plan-price strong { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.plan-price span { font-size: .88rem; color: var(--muted); }

.plan-features { margin: 1.25rem 0 1.75rem; display: grid; gap: .6rem; }

.plan-features li {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .89rem;
  color: var(--muted);
}

.plan-features i { margin-top: .28rem; font-size: .72rem; color: var(--status-good); }
.plan-features li.off { opacity: .55; }
.plan-features li.off i { color: var(--axis-ink); }

.plan-card .btn { margin-top: auto; width: 100%; }

.card-brand {
  display: grid;
  place-items: center;
  width: 44px;
  height: 30px;
  font-size: 1.1rem;
  color: var(--primary);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .55rem 0;
  font-size: .92rem;
  color: var(--muted);
}

.summary-line strong { color: var(--ink); font-weight: 600; }
.summary-line.total {
  margin-top: .5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.05rem;
  color: var(--ink);
}
.summary-line.total strong { font-size: 1.35rem; }
.summary-line.discount strong { color: #006300; }

.pay-option {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.15rem;
  margin-bottom: .75rem;
  font-family: inherit;
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.pay-option:hover { border-color: rgba(58, 79, 154, .35); }
.pay-option.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58, 79, 154, .1); }

.pay-option .radio {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.pay-option.selected .radio { border-color: var(--primary); }
.pay-option.selected .radio::after {
  content: '';
  width: 10px;
  height: 10px;
  background: var(--primary);
  border-radius: 50%;
}

.pay-option h4 { font-family: var(--font-main); font-size: .94rem; margin-bottom: .1rem; }
.pay-option p { margin-bottom: 0; font-size: .82rem; color: var(--muted); }

.secure-note {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1rem;
  font-size: .8rem;
  color: var(--muted);
}

.receipt {
  padding: 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.receipt-head {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.processing {
  display: grid;
  place-items: center;
  gap: 1rem;
  padding: 4rem 1rem;
  text-align: center;
}

.spinner {
  width: 46px;
  height: 46px;
  border: 3px solid rgba(58, 79, 154, .18);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.success-mark {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  margin: 0 auto 1.25rem;
  font-size: 1.9rem;
  color: #fff;
  background: var(--status-good);
  border-radius: 50%;
  animation: pop .45s cubic-bezier(.2, 1.2, .4, 1);
}

@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

/* ==========================================================================
   Reports / charts
   ========================================================================== */

.chart-figure { margin: 0; }

.chart-figure figcaption {
  margin-bottom: .35rem;
  font-size: .82rem;
  color: var(--muted);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: .9rem;
  font-size: .82rem;
  color: var(--muted);
}

.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg text { font-family: var(--font-main); }
.chart-grid line { stroke: var(--grid-line); stroke-width: 1; }
.chart-axis text { fill: var(--axis-ink); font-size: 11px; }
.chart-baseline { stroke: #C8CCDA; stroke-width: 1; }

.chart-tooltip {
  position: fixed;
  z-index: 1200;
  padding: .55rem .75rem;
  font-size: .8rem;
  line-height: 1.45;
  color: #fff;
  background: rgba(21, 24, 43, .95);
  border-radius: var(--radius-sm);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -115%);
  transition: opacity .12s ease;
  white-space: nowrap;
}

.chart-tooltip.show { opacity: 1; }
.chart-tooltip strong { display: block; margin-bottom: .15rem; }

.skill-bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 46px;
  align-items: center;
  gap: .85rem;
  padding: .5rem 0;
  font-size: .88rem;
}

.skill-bar-row .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

.heatmap {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(7, 1fr);
  gap: 3px;
  overflow-x: auto;
  padding-bottom: .25rem;
}

.heat-cell {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  background: var(--bg-alt);
}

.heat-scale {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: .75rem;
  font-size: .76rem;
  color: var(--muted);
}

.heat-scale .heat-cell { width: 11px; height: 11px; }

/* ==========================================================================
   Messages
   ========================================================================== */

.messenger {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h) - 5.5rem);
  min-height: 520px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.thread-list { border-right: 1px solid var(--line); overflow-y: auto; }

.thread-item {
  display: flex;
  gap: .8rem;
  width: 100%;
  padding: 1rem;
  text-align: left;
  font-family: inherit;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background var(--transition);
}

.thread-item:hover { background: var(--bg); }
.thread-item.active { background: var(--primary-tint); }
.thread-item .avatar { width: 42px; height: 42px; }
.thread-meta { flex: 1; min-width: 0; }

.thread-meta h4 {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-family: var(--font-main);
  font-size: .92rem;
  margin-bottom: .2rem;
}

.thread-meta h4 small { font-size: .74rem; font-weight: 500; color: var(--muted); }

.thread-meta p {
  margin-bottom: 0;
  font-size: .82rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-unread {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: .68rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.chat { display: flex; flex-direction: column; min-width: 0; }

.chat-head {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
  background: var(--bg);
}

.chat-day {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: .76rem;
  color: var(--muted);
}

.bubble-row { display: flex; margin-bottom: .85rem; }
.bubble-row.me { justify-content: flex-end; }

.bubble {
  max-width: min(70%, 34rem);
  padding: .75rem 1rem;
  font-size: .91rem;
  line-height: 1.55;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px 14px 14px 4px;
}

.bubble-row.me .bubble {
  color: #fff;
  background: var(--primary);
  border-color: transparent;
  border-radius: 14px 14px 4px 14px;
}

.bubble time {
  display: block;
  margin-top: .3rem;
  font-size: .72rem;
  color: var(--muted);
}

.bubble-row.me time { color: rgba(255, 255, 255, .7); }

.bubble .attachment {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .6rem;
  padding: .6rem .75rem;
  font-size: .84rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--ink);
}

.bubble-row.me .attachment { background: rgba(255, 255, 255, .16); color: #fff; }

.chat-composer {
  display: flex;
  align-items: flex-end;
  gap: .6rem;
  padding: .9rem 1.25rem;
  border-top: 1px solid var(--line);
}

.chat-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: .7rem .9rem;
  font-family: inherit;
  font-size: .92rem;
  resize: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
}

.chat-composer textarea:focus { outline: none; border-color: var(--primary); }

.send-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.send-btn:hover { background: var(--primary-dark); }

/* ==========================================================================
   Modal & toast
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(21, 24, 43, .55);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), visibility var(--transition);
}

.modal-backdrop.open { opacity: 1; visibility: visible; }

.modal {
  width: 100%;
  max-width: 34rem;
  max-height: 88vh;
  overflow-y: auto;
  padding: 1.75rem;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(12px) scale(.98);
  transition: transform var(--transition);
}

.modal-backdrop.open .modal { transform: none; }
.modal.wide { max-width: 46rem; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.modal-head h3 { font-size: 1.3rem; margin-bottom: .25rem; }
.modal-head p { margin-bottom: 0; font-size: .88rem; color: var(--muted); }

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  color: var(--muted);
  background: var(--bg);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.modal-close:hover { color: var(--ink); background: var(--bg-alt); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  margin-top: 1.75rem;
}

.toast-stack {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 1400;
  display: grid;
  gap: .6rem;
  width: min(22rem, calc(100vw - 2.5rem));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.2, 1, .3, 1);
}

.toast.leaving { animation: toastOut .25s ease forwards; }
.toast.success { border-left-color: var(--status-good); }
.toast.error { border-left-color: var(--status-critical); }
.toast.warning { border-left-color: var(--status-warning); }

.toast i { margin-top: .15rem; color: var(--primary); }
.toast.success i { color: var(--status-good); }
.toast.error i { color: var(--status-critical); }
.toast.warning i { color: #8a6100; }
.toast p { margin-bottom: 0; font-size: .89rem; line-height: 1.5; }
.toast strong { display: block; font-size: .9rem; }

@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.text-muted { color: var(--muted); }
.text-sm { font-size: .86rem; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: .75rem; }
.mt-2 { margin-top: 1.25rem; }
.mb-1 { margin-bottom: .75rem; }
.mb-2 { margin-bottom: 1.25rem; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-gap { display: flex; gap: .6rem; flex-wrap: wrap; }
.stack { display: grid; gap: 1.25rem; }

/* ==========================================================================
   Portal responsive
   ========================================================================== */

@media (max-width: 1240px) {
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main, .grid-side { grid-template-columns: minmax(0, 1fr); }
  .program-hero { grid-template-columns: 1fr; text-align: center; }
  .program-hero .meta-row { justify-content: center; }
}

@media (max-width: 820px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .messenger { grid-template-columns: 1fr; height: auto; }
  .thread-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-body { min-height: 340px; }
}

@media (max-width: 640px) {
  .grid-2, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .card { padding: 1.15rem; }
  .session-card { flex-wrap: wrap; }
  .session-actions { width: 100%; }
  .session-actions .btn { flex: 1; }
  .onboarding-foot .btn { flex: 1; }
  .step-track .step-dot span:not(:only-child) { display: grid; }
  .step-dot-label { display: none; }
  table.data th, table.data td { padding: .75rem .9rem; }
}

@media print {
  .app-sidebar, .app-topbar, .no-print, .toast-stack { display: none !important; }
  .app-main { margin-left: 0; }
  body.portal { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   Exercise session — full-screen, one exercise at a time
   ========================================================================== */

body.session-mode {
  background: var(--surface);
}

.session {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.session-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  max-width: 62rem;
  width: 100%;
  margin: 0 auto;
}

.session-quit {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  font-size: 1.05rem;
  color: var(--axis-ink);
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: color var(--transition), background var(--transition);
}

.session-quit:hover { color: var(--ink); background: var(--bg-alt); }

.session-progress {
  flex: 1;
  height: 14px;
  background: var(--bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.session-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #2FBF6B, #58D68D);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

.hearts {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #E0435B;
}

.hearts strong { font-size: 1rem; }
.hearts.unlimited { color: var(--primary); }

.session-stage {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem) clamp(1rem, 4vw, 2rem) 8rem;
}

.ex {
  width: 100%;
  max-width: 44rem;
  /* auto margins centre the exercise vertically without ever clipping a tall one */
  margin-block: auto;
  animation: fadeUp .3s ease;
}

.ex-instruction {
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 1.75rem;
}

.ex-prompt {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1.1rem 1.25rem;
  margin-bottom: .75rem;
  font-size: 1.2rem;
  line-height: 1.5;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.ex-prompt .blank {
  display: inline-block;
  min-width: 5rem;
  padding: 0 .35rem;
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.ex-translation {
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: var(--muted);
}

.ex-note {
  margin: 1rem 0;
  font-size: .88rem;
  color: var(--muted);
}

.link-btn {
  margin-top: 1.5rem;
  padding: 0;
  font: inherit;
  font-size: .86rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--axis-ink);
  background: none;
  border: 0;
  cursor: pointer;
}

.link-btn:hover { color: var(--primary); }

/* --- options ------------------------------------------------------------ */
.opt-list { display: grid; gap: .75rem; }

.opt {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: 1rem 1.15rem;
  font-family: inherit;
  font-size: 1.02rem;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.opt:hover:not(:disabled) { background: var(--bg); }
.opt.selected { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.opt.right { border-color: var(--status-good); background: rgba(12, 163, 12, .1); color: #0a7d0a; }
.opt.bad { border-color: var(--status-critical); background: rgba(208, 59, 59, .08); color: var(--status-critical); }
.opt:disabled { cursor: default; }

.opt-key {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 700;
  color: var(--axis-ink);
  border: 1.5px solid var(--line);
  border-radius: 6px;
}

.opt.selected .opt-key { border-color: var(--primary); color: var(--primary); }

/* --- word bank ---------------------------------------------------------- */
.answer-area {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: .5rem;
  min-height: 104px;
  padding: .85rem;
  margin-bottom: 1.75rem;
  background:
    repeating-linear-gradient(to bottom, transparent 0 47px, var(--line) 47px 48px);
  border-radius: var(--radius-sm);
}

.answer-hint {
  align-self: flex-start;
  font-size: .9rem;
  color: var(--axis-ink);
}

.bank {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.tile {
  padding: .6rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .12s ease, background var(--transition), border-color var(--transition);
}

.tile:hover:not(:disabled):not(.used) { background: var(--bg); }
.tile:active { transform: translateY(2px); }
.tile.selected { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.tile.right { border-color: var(--status-good); background: rgba(12, 163, 12, .1); }
.tile.bad { border-color: var(--status-critical); background: rgba(208, 59, 59, .08); }

.tile.used {
  color: transparent;
  background: var(--bg-alt);
  border-color: var(--bg-alt);
  cursor: default;
}

.chip-answers { display: flex; flex-wrap: wrap; gap: .6rem; }

/* --- typing ------------------------------------------------------------- */
.type-block { margin-top: .5rem; }

.type-block textarea {
  width: 100%;
  padding: 1rem;
  font-family: inherit;
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  resize: none;
}

.type-block textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.accent-row {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .6rem;
}

.accent {
  width: 40px;
  height: 38px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-bottom-width: 3px;
  border-radius: 8px;
  cursor: pointer;
}

.accent:hover { background: var(--primary-tint); border-color: var(--primary); color: var(--primary); }

/* --- audio -------------------------------------------------------------- */
.listen-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.speak-big {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  flex-shrink: 0;
  font-size: 1.7rem;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-bottom: 5px solid var(--primary-dark);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform .12s ease;
}

.speak-big:active { transform: translateY(3px); border-bottom-width: 2px; }

.speak-slow {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 10px;
  cursor: pointer;
}

.speak-mini {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  font-size: .9rem;
  color: var(--primary);
  background: var(--primary-tint);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.speak-mini:hover { background: rgba(58, 79, 154, .18); }

/* --- speaking ----------------------------------------------------------- */
.mic-block { text-align: center; margin: 2rem 0 1rem; }

.mic-btn {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0 auto 1rem;
  font-size: 2rem;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-brand);
  transition: transform .15s ease;
}

.mic-btn:hover { transform: scale(1.04); }

.mic-btn.recording {
  background: var(--status-critical);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(208, 59, 59, .5); }
  50% { box-shadow: 0 0 0 18px rgba(208, 59, 59, 0); }
}

.heard {
  min-height: 1.4rem;
  font-size: 1rem;
  font-style: italic;
  color: var(--primary);
}

.speak-prompt span { font-size: 1.35rem; font-weight: 600; }

/* --- matching ----------------------------------------------------------- */
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-col { display: grid; gap: .6rem; align-content: start; }

.match-cell {
  padding: .9rem 1rem;
  font-family: inherit;
  font-size: .98rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
}

.match-cell:hover:not(.matched) { background: var(--bg); }
.match-cell.selected { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.match-cell.wrong { border-color: var(--status-critical); background: rgba(208, 59, 59, .1); }

.match-cell.matched {
  color: var(--status-good);
  background: rgba(12, 163, 12, .08);
  border-color: rgba(12, 163, 12, .35);
  opacity: .55;
  cursor: default;
}

/* --- tips --------------------------------------------------------------- */
.tip-card {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.tip-card h2 { font-size: 1.3rem; margin-bottom: 1rem; }

.tip-card ul { display: grid; gap: .85rem; margin-bottom: 1.5rem; }

.tip-card li {
  padding-left: 1.3rem;
  position: relative;
  font-size: .98rem;
  line-height: 1.65;
  color: var(--muted);
}

.tip-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .6rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.tip-card strong { color: var(--ink); }

.tip-examples { display: grid; gap: .6rem; }

.tip-example {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.tip-example strong { display: block; font-size: 1rem; }
.tip-example small { color: var(--muted); }

/* --- footer ------------------------------------------------------------- */
.session-foot {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  background: var(--surface);
  border-top: 2px solid var(--line);
  transition: background var(--transition), border-color var(--transition);
}

.session-foot.is-correct { background: #E8F8ED; border-top-color: #B7E6C6; }
.session-foot.is-wrong { background: #FDECEC; border-top-color: #F5C3C3; }

.foot-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  max-width: 62rem;
  margin: 0 auto;
}

.btn-check {
  min-width: 11rem;
  margin-left: auto;
  padding: .95rem 2rem;
  font-size: 1rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.feedback {
  display: flex;
  align-items: flex-start;
  gap: .9rem;
  flex: 1;
  min-width: 0;
}

.feedback-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  font-size: 1.1rem;
  color: #fff;
  border-radius: 50%;
}

.is-correct .feedback-mark { background: var(--status-good); }
.is-wrong .feedback-mark { background: var(--status-critical); }

.feedback strong { font-size: 1.1rem; }
.is-correct .feedback strong { color: #0a7d0a; }
.is-wrong .feedback strong { color: var(--status-critical); }

.feedback p { margin-bottom: 0; font-size: .95rem; }
.feedback-explain { color: var(--muted); font-size: .88rem !important; margin-top: .2rem !important; }

.end-actions { justify-content: flex-end; }
.end-actions .btn-check { margin-left: 0; }

/* --- end screens -------------------------------------------------------- */
.end-screen { text-align: center; padding-top: 2rem; }
.end-screen h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: .5rem; }

.end-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}

.end-stat {
  padding: 1.1rem .75rem;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
}

.end-stat i { font-size: 1.1rem; color: var(--primary); }
.end-stat strong { display: block; font-size: 1.5rem; line-height: 1.2; margin-top: .35rem; }
.end-stat small { color: var(--muted); font-size: .82rem; }

.crown-up {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1rem;
  font-weight: 600;
  color: #8a6100;
  background: rgba(250, 178, 25, .16);
  border-radius: var(--radius-full);
}

.mistake-list { margin-top: 2rem; text-align: left; }
.mistake-list h3 { font-family: var(--font-main); font-size: .95rem; margin-bottom: .75rem; }

.mistake {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem .9rem;
  margin-bottom: .5rem;
  font-size: .9rem;
  background: var(--bg);
  border-left: 3px solid var(--status-warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.mistake span { color: var(--muted); }

.broken-heart {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  margin: 0 auto 1.25rem;
  font-size: 2.2rem;
  color: #E0435B;
  background: rgba(224, 67, 91, .12);
  border-radius: 50%;
}

.heart-options {
  display: grid;
  gap: .75rem;
  max-width: 24rem;
  margin: 2rem auto 0;
}

@media (max-width: 560px) {
  .match-grid { gap: .6rem; }
  .session-stage { padding-bottom: 10rem; }
  .btn-check { width: 100%; min-width: 0; margin-left: 0; }
  .foot-inner { flex-direction: column; align-items: stretch; gap: .9rem; }
  .end-actions { flex-direction: column; }
  .end-stats { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Program path — units and lesson nodes
   ========================================================================== */

.unit {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.unit-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.unit.locked .unit-head { background: var(--bg-alt); color: var(--muted); }
.unit.done .unit-head { background: linear-gradient(135deg, #1F9254, #14713F); }

.unit-head h3 {
  font-family: var(--font-main);
  font-size: 1rem;
  margin-bottom: .15rem;
  color: inherit;
}

.unit-head p { margin-bottom: 0; font-size: .84rem; opacity: .8; }

.unit-head .btn {
  margin-left: auto;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .3);
  color: #fff;
  box-shadow: none;
}

.unit-head .btn:hover { background: rgba(255, 255, 255, .26); }
.unit.locked .unit-head .btn { background: var(--surface); color: var(--muted); border-color: var(--line); }

.unit-body { padding: .85rem; }

.node {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: .7rem .8rem;
  text-align: left;
  font-family: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.node:hover { background: var(--bg); }
.node.locked { cursor: not-allowed; opacity: .55; }
.node.locked:hover { background: none; }

.node-dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  font-size: 1.05rem;
  color: #fff;
  background: var(--bg-alt);
  border-radius: 50%;
  border-bottom: 4px solid rgba(0, 0, 0, .12);
}

.node.done .node-dot { background: #2FBF6B; }
.node.current .node-dot { background: var(--primary); animation: nodePulse 2s ease-in-out infinite; }
.node.locked .node-dot { background: #D5D9E5; color: #fff; border-bottom-color: rgba(0, 0, 0, .07); }
.node.checkpoint .node-dot { background: var(--status-warning); color: #fff; }
.node.checkpoint.locked .node-dot { background: #D5D9E5; }

@keyframes nodePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58, 79, 154, .35); }
  50% { box-shadow: 0 0 0 12px rgba(58, 79, 154, 0); }
}

.node-info { flex: 1; min-width: 0; }
.node-info h4 { font-family: var(--font-main); font-size: .95rem; font-weight: 600; margin-bottom: .12rem; }
.node-info small { font-size: .8rem; color: var(--muted); }

.crowns {
  display: inline-flex;
  gap: .18rem;
  margin-left: .5rem;
  font-size: .72rem;
  color: var(--status-warning);
}

.crowns .off { color: var(--line); }

.node-cta {
  flex-shrink: 0;
  padding: .45rem 1.1rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: var(--radius-full);
}

.node.done .node-cta { background: var(--surface); color: var(--muted); border: 1px solid var(--line); }

.unit-rail {
  width: 2px;
  height: 12px;
  margin-left: 2.35rem;
  background: var(--line);
}

@media (max-width: 560px) {
  .unit-head { flex-wrap: wrap; }
  .unit-head .btn { margin-left: 0; width: 100%; }
  .node-cta { display: none; }
}
