/* ============================================================
   Parlance design system — warm, premium, focused.
   Tokens → base → layout → components → modules → utilities
   ============================================================ */
:root {
  --violet: #6852E8; --violet-700: #4530B8; --violet-100: #F0EDFF; --violet-200: #DCD5FF; --violet-50: #F7F5FF;
  --coral: #FF8A78; --coral-100: #FFE8E3; --mint: #29B894; --mint-100: #DDF6EF; --amber: #F2B441; --amber-100: #FFF3D6;
  --bg: #FAF9FE; --surface: #FFFFFF; --text: #20223A; --muted: #6B6E8A; --line: #E7E5F3; --line-strong: #D5D2EA;
  --danger: #E24B4B; --danger-100: #FDE4E4;
  --radius: 16px; --radius-sm: 10px; --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(32,34,58,.05), 0 1px 6px rgba(104,82,232,.06);
  --shadow: 0 6px 24px rgba(32,34,58,.07), 0 2px 6px rgba(104,82,232,.05);
  --shadow-lg: 0 20px 50px rgba(69,48,184,.14);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --sidebar-w: 264px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--violet-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 2.4vw, 2.4rem); } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; font-family: var(--font); font-weight: 600; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
:focus-visible { outline: 3px solid rgba(104,82,232,.45); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.scrim { display: none; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.25rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; padding: .35rem .5rem 1rem; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; color: var(--violet-700); }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.nav-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .75rem .6rem .25rem; }
.nav-link { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; font-size: .93rem; transition: background .15s, color .15s; }
.nav-link:hover { background: var(--violet-50); text-decoration: none; }
.nav-link.active { background: var(--violet-100); color: var(--violet-700); }
.nav-link .ic { width: 20px; text-align: center; opacity: .85; }
.nav-badge { margin-left: auto; background: var(--coral); color: #fff; border-radius: 999px; font-size: .7rem; padding: .05rem .45rem; font-weight: 700; }
.sidebar-foot { margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: .5rem; }
.main { padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.topbar .title-block h1 { margin: 0; } .topbar .title-block p { margin: .15rem 0 0; color: var(--muted); }
.menu-toggle { display: none; }
.lang-switch { display: inline-flex; gap: .25rem; }
.lang-switch button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .25rem .6rem; font-size: .78rem; cursor: pointer; color: var(--muted); }
.lang-switch button.active { background: var(--violet-100); color: var(--violet-700); border-color: var(--violet-200); font-weight: 600; }

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(84vw, 300px); transform: translateX(-100%); transition: transform .25s; z-index: 50; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .menu-toggle { display: inline-flex; }
  .main { padding: 1rem 1rem 5rem; }
  .scrim { position: fixed; inset: 0; background: rgba(32,34,58,.35); z-index: 40; display: none; }
  .scrim.show { display: block; }
}

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: 999px; padding: .62rem 1.2rem; font-weight: 600; font-size: .93rem; border: 1px solid transparent; cursor: pointer; transition: transform .08s, box-shadow .15s, background .15s, color .15s, border-color .15s; line-height: 1.2; font-family: inherit; white-space: nowrap; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: linear-gradient(135deg, var(--violet), var(--violet-700)); color: #fff; box-shadow: 0 6px 16px rgba(104,82,232,.28); }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(104,82,232,.36); color: #fff; }
.btn-secondary { background: var(--violet-100); color: var(--violet-700); }
.btn-secondary:hover { background: var(--violet-200); }
.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--violet); color: var(--violet-700); background: var(--violet-50); }
.btn-ghost { background: transparent; color: var(--violet-700); }
.btn-ghost:hover { background: var(--violet-50); }
.btn-coral { background: var(--coral); color: #fff; box-shadow: 0 6px 16px rgba(255,138,120,.3); }
.btn-mint { background: var(--mint); color: #fff; }
.btn-danger { background: var(--danger-100); color: var(--danger); }
.btn-sm { padding: .4rem .85rem; font-size: .83rem; }
.btn-lg { padding: .85rem 1.6rem; font-size: 1.02rem; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; }
.btn-block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline.loading::after, .btn-ghost.loading::after, .btn-secondary.loading::after { border-color: rgba(104,82,232,.3); border-top-color: var(--violet); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards & surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.card-hover { transition: transform .15s, box-shadow .2s; }
.card-hover:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 1.1rem; }
.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-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 1200px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr);} }
@media (max-width: 700px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.between { justify-content: space-between; }
.hero-card { background: linear-gradient(135deg, var(--violet-700), var(--violet) 70%, #8A78F2); color: #fff; border: 0; position: relative; overflow: hidden; }
.hero-card h1, .hero-card h2 { color: #fff; }
.hero-card .muted { color: rgba(255,255,255,.78); }
.hero-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.illustration { width: 100%; height: auto; border-radius: var(--radius); display: block; }
.module-card { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: center; }
.module-card img { width: 110px; height: 110px; object-fit: cover; border-radius: 14px; background: var(--violet-50); }
@media (max-width: 500px) { .module-card { grid-template-columns: 1fr; } .module-card img { width: 100%; height: 140px; } }

/* ---------- Badges, pills, stats ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .2rem .6rem; font-size: .75rem; font-weight: 600; background: var(--violet-100); color: var(--violet-700); }
.badge-coral { background: var(--coral-100); color: #C44A36; } .badge-mint { background: var(--mint-100); color: #157A61; } .badge-amber { background: var(--amber-100); color: #8A5A00; } .badge-gray { background: #EEEEF5; color: var(--muted); } .badge-danger { background: var(--danger-100); color: var(--danger); }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat .value { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--violet-700); }
.stat .label { font-size: .8rem; color: var(--muted); }
.kpi { display: flex; align-items: center; gap: 1rem; }
.kpi .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--violet-100); font-size: 1.3rem; }
.progress { height: 8px; background: var(--violet-100); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--mint)); border-radius: 999px; transition: width .4s; }
.progress.coral > span { background: var(--coral); } .progress.mint > span { background: var(--mint); } .progress.amber > span { background: var(--amber); }
.level-pill { display: inline-flex; align-items: baseline; gap: .25rem; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; color: var(--violet-700); }
.level-pill small { font-family: var(--font); font-weight: 500; color: var(--muted); font-size: .75rem; }
.chip { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; font-size: .82rem; background: var(--surface); }
.chip.active { border-color: var(--violet); background: var(--violet-100); color: var(--violet-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ok { background: var(--mint); } .dot.warn { background: var(--amber); } .dot.bad { background: var(--danger); }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
label { font-weight: 600; font-size: .88rem; }
.hint { font-size: .8rem; color: var(--muted); }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .65rem .85rem; font: inherit; background: var(--surface); color: var(--text); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px rgba(104,82,232,.14); }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.field-validation-error, .text-danger { color: var(--danger); font-size: .82rem; }
.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; color: var(--danger); font-size: .88rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.inline-form { display: inline; }

/* ---------- Alerts / toast / empty ---------- */
.alert { border-radius: var(--radius-sm); padding: .8rem 1rem; border: 1px solid; font-size: .92rem; }
.alert-info { background: var(--violet-50); border-color: var(--violet-200); color: var(--violet-700); }
.alert-warn { background: var(--amber-100); border-color: #F5D58A; color: #6B4A00; }
.alert-danger { background: var(--danger-100); border-color: #F5B8B8; color: #9A2626; }
.alert-success { background: var(--mint-100); border-color: #A9E7D5; color: #0F5F4A; }
.toast { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow-lg); z-index: 100; font-size: .9rem; animation: toastIn .3s; max-width: 92vw; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty img { width: 180px; max-width: 60%; margin: 0 auto 1rem; display: block; }
.skeleton { background: linear-gradient(90deg, var(--violet-50), var(--violet-100), var(--violet-50)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; min-height: 1rem; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* ---------- Practice runner ---------- */
.runner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; }
@media (max-width: 1000px) { .runner { grid-template-columns: 1fr; } }
.runner-side { position: sticky; top: 1rem; align-self: start; }
.question-nav { display: flex; flex-wrap: wrap; gap: .35rem; }
.question-nav button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; font-size: .8rem; cursor: pointer; }
.question-nav button.current { border-color: var(--violet); background: var(--violet-100); color: var(--violet-700); }
.question-nav button.answered { background: var(--mint-100); border-color: #A9E7D5; }
.question-nav button.wrong { background: var(--coral-100); border-color: #FFC4B8; }
.passage { background: var(--violet-50); border: 1px solid var(--violet-200); border-radius: var(--radius); padding: 1.1rem 1.25rem; white-space: pre-wrap; line-height: 1.7; font-size: 1rem; max-height: 52vh; overflow: auto; }
.passage mark { background: #FFF1B8; border-radius: 3px; padding: 0 .1em; }
.question { font-size: 1.08rem; font-weight: 600; margin: 1rem 0 .75rem; }
.options { display: grid; gap: .55rem; }
.option { display: flex; gap: .75rem; align-items: flex-start; border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .9rem; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; text-align: left; font: inherit; width: 100%; }
.option:hover { border-color: var(--violet); background: var(--violet-50); }
.option .lbl { width: 26px; height: 26px; border-radius: 8px; background: var(--violet-100); color: var(--violet-700); display: grid; place-items: center; font-weight: 700; font-size: .8rem; flex: none; }
.option.selected { border-color: var(--violet); background: var(--violet-100); }
.option.correct { border-color: var(--mint); background: var(--mint-100); }
.option.correct .lbl { background: var(--mint); color: #fff; }
.option.incorrect { border-color: var(--coral); background: var(--coral-100); }
.option.incorrect .lbl { background: var(--coral); color: #fff; }
.option:disabled { cursor: default; }
.explanation { border-left: 4px solid var(--mint); background: var(--mint-100); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .8rem 1rem; margin-top: 1rem; }
.explanation.wrong { border-color: var(--coral); background: var(--coral-100); }
.timer { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--violet-700); font-variant-numeric: tabular-nums; }
.timer.urgent { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.audio-box { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.audio-box .play { width: 56px; height: 56px; border-radius: 50%; background: var(--violet); color: #fff; font-size: 1.3rem; border: 0; cursor: pointer; display: grid; place-items: center; }
.audio-box .play:disabled { background: var(--line-strong); cursor: not-allowed; }
.wave { flex: 1; height: 36px; background: repeating-linear-gradient(90deg, var(--violet-200) 0 3px, transparent 3px 6px); border-radius: 6px; opacity: .6; }
.wave.playing { background: repeating-linear-gradient(90deg, var(--violet) 0 3px, transparent 3px 6px); animation: wavemove .6s linear infinite; opacity: 1; }
@keyframes wavemove { to { background-position: 6px 0; } }

/* ---------- Writing ---------- */
.editor { width: 100%; min-height: 360px; font-size: 1.05rem; line-height: 1.75; padding: 1rem 1.2rem; }
.wordcount { font-weight: 600; } .wordcount.ok { color: var(--mint); } .wordcount.bad { color: var(--coral); }
.score-ring { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--violet) calc(var(--p) * 1%), var(--violet-100) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 9px; background: var(--surface); border-radius: 50%; }
.score-ring span { position: relative; font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--violet-700); }
.subscore { display: grid; grid-template-columns: 140px 1fr 36px; gap: .6rem; align-items: center; font-size: .9rem; }
.diff del { background: var(--coral-100); color: #9A2626; text-decoration: line-through; } .diff ins { background: var(--mint-100); color: #0F5F4A; text-decoration: none; }
.error-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .9rem; display: grid; gap: .3rem; }
.error-item .orig { color: var(--danger); text-decoration: line-through; } .error-item .corr { color: #0F5F4A; font-weight: 600; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; } @media (max-width: 800px) { .compare { grid-template-columns: 1fr; } }
.prose { white-space: pre-wrap; line-height: 1.7; }

/* ---------- Speaking ---------- */
.conversation { display: flex; flex-direction: column; gap: .75rem; max-height: 58vh; overflow-y: auto; padding: .25rem; }
.bubble { max-width: 82%; padding: .75rem 1rem; border-radius: 18px; line-height: 1.55; position: relative; }
.bubble.examiner { background: var(--violet-100); color: var(--violet-700); border-bottom-left-radius: 6px; align-self: flex-start; }
.bubble.student { background: var(--surface); border: 1px solid var(--line); border-bottom-right-radius: 6px; align-self: flex-end; }
.bubble .who { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; margin-bottom: .2rem; }
.bubble audio { width: 100%; margin-top: .4rem; height: 34px; }
.record-btn { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: 1.8rem; cursor: pointer; box-shadow: 0 10px 28px rgba(255,138,120,.4); display: grid; place-items: center; transition: transform .1s; }
.record-btn.recording { background: var(--danger); animation: pulse 1.2s infinite; }
.record-btn:disabled { background: var(--line-strong); box-shadow: none; cursor: not-allowed; }
.examiner-avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: var(--violet-100); }

/* ---------- Chat (tutor) ---------- */
.chat { display: grid; grid-template-columns: 240px 1fr; gap: 1rem; min-height: 70vh; }
@media (max-width: 900px) { .chat { grid-template-columns: 1fr; } .chat-list { display: none; } }
.chat-list a { display: block; padding: .5rem .7rem; border-radius: 8px; font-size: .86rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list a.active { background: var(--violet-100); color: var(--violet-700); }
.chat-main { display: flex; flex-direction: column; }
.chat-messages { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: .8rem; padding: .5rem; max-height: 62vh; }
.msg { max-width: 85%; padding: .8rem 1rem; border-radius: 16px; line-height: 1.6; }
.msg.user { align-self: flex-end; background: var(--violet); color: #fff; border-bottom-right-radius: 6px; }
.msg.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .tools { margin-top: .4rem; display: flex; gap: .5rem; }
.msg .translation { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .9rem; }
.msg p:last-child { margin-bottom: 0; } .msg ul { margin: .3rem 0; padding-left: 1.1rem; }
.chat-input { display: flex; gap: .5rem; padding-top: .75rem; border-top: 1px solid var(--line); margin-top: .5rem; }
.chat-input textarea { min-height: 48px; max-height: 160px; }
.suggestions { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.typing { display: inline-flex; gap: 4px; } .typing i { width: 7px; height: 7px; background: var(--violet); border-radius: 50%; animation: blink 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2; } 40% { opacity: 1; } }

/* ---------- Flashcards ---------- */
.flashcard { perspective: 1200px; min-height: 260px; }
.flashcard .inner { position: relative; width: 100%; min-height: 260px; transition: transform .5s; transform-style: preserve-3d; }
.flashcard.flipped .inner { transform: rotateY(180deg); }
.flashcard .face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: var(--radius-lg); padding: 1.5rem; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: .5rem; }
.flashcard .front { background: linear-gradient(135deg, var(--violet), var(--violet-700)); color: #fff; }
.flashcard .back { background: var(--surface); border: 1px solid var(--line); transform: rotateY(180deg); }
.flashcard .word { font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.grade-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }

/* ---------- Landing ---------- */
.landing { max-width: 1180px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2.5rem) 4rem; }
.landing-nav { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0 2rem; }
.landing-hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 2rem; align-items: center; }
.landing-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.08; }
.landing-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
@media (max-width: 860px) { .landing-hero { grid-template-columns: 1fr; } }
.feature { display: flex; gap: .9rem; align-items: flex-start; }
.feature .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--violet-100); font-size: 1.3rem; flex: none; }
.bg-deco { position: fixed; inset: 0; z-index: -1; background: url('/images/background.webp') center/cover no-repeat; opacity: .55; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand { justify-content: center; padding-bottom: .5rem; }

/* ---------- Utilities ---------- */
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.w-100 { width: 100%; } .text-center { text-align: center; } .right { margin-left: auto; } .nowrap { white-space: nowrap; } .hidden { display: none !important; } .flex-1 { flex: 1; }
.divider { height: 1px; background: var(--line); margin: 1rem 0; }
.fade-in { animation: fadeIn .35s ease; } @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } }
.sticky-bottom { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding-top: 1rem; }
canvas { max-width: 100%; }
@media print { .sidebar, .topbar .row, .btn { display: none !important; } .app { display: block; } }

/* ---------- Loading indicators ---------- */
#pl-bar { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--violet), var(--mint)); z-index: 200; opacity: 0; transition: width .4s ease, opacity .3s; box-shadow: 0 0 8px rgba(104,82,232,.6); pointer-events: none; }
#pl-bar.on { opacity: 1; }
#pl-overlay { position: fixed; inset: 0; background: rgba(250,249,254,.86); backdrop-filter: blur(4px); z-index: 150; display: none; place-items: center; text-align: center; padding: 1rem; }
#pl-overlay.on { display: grid; animation: fadeIn .25s; }
#pl-overlay .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 2rem 2.2rem; box-shadow: var(--shadow-lg); max-width: 420px; }
#pl-overlay img { width: 84px; height: 84px; border-radius: 50%; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
#pl-overlay .spinner { width: 42px; height: 42px; margin: .8rem auto; border: 4px solid var(--violet-100); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
#pl-overlay h3 { margin: .5rem 0 .25rem; }
#pl-overlay .elapsed { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }
#pl-overlay .steps { margin-top: .6rem; font-size: .85rem; color: var(--muted); min-height: 1.2em; }
