/* ---------------------------------------------------------------------------
   Design system
   Dark graphite shell, warm off-white cards, muted pastel accents.
   No gradients, no heavy shadows — depth comes from surface contrast.
--------------------------------------------------------------------------- */

:root {
    /* Shell */
    --shell:            #3D434B;
    --shell-deep:       #343A41;
    --shell-line:       rgba(255, 255, 255, .10);
    --shell-hover:      rgba(255, 255, 255, .07);

    /* Text on the dark shell */
    --on-shell:         #FFFFFF;
    --on-shell-muted:   rgba(255, 255, 255, .62);
    --on-shell-faint:   rgba(255, 255, 255, .40);

    /* Cards */
    --card:             #F3F1ED;
    --card-raised:      #FFFFFF;
    --card-sunken:      #E8E5DF;
    --card-line:        #DCD8D1;

    /* Text on cards */
    --ink:              #23272C;
    --ink-muted:        #6B7076;
    --ink-faint:        #9A9EA3;

    /* Pastel accents — flat fills, dark readable text */
    --mint:             #D8EFDD;
    --mint-ink:         #1E5134;
    --blush:            #F6DCE1;
    --blush-ink:        #7A2438;
    --sky:              #DBE7F4;
    --sky-ink:          #1F456E;
    --sand:             #F2E6D2;
    --sand-ink:         #6B4E19;

    --radius-lg:        18px;
    --radius:           12px;
    --radius-sm:        8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--shell);
    color: var(--on-shell);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; }

/* ------------------------------ Top navigation --------------------------- */

.nav {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 18px 32px;
    border-bottom: 1px solid var(--shell-line);
    background: var(--shell);
    position: sticky;
    top: 0;
    z-index: 20;
}

.nav__brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    text-decoration: none;
    white-space: nowrap;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 15px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--on-shell-muted);
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
}

.nav__link:hover { background: var(--shell-hover); color: var(--on-shell); }
.nav__link[aria-current="page"] { background: rgba(255,255,255,.12); color: var(--on-shell); }
.nav__link svg { width: 19px; height: 19px; flex: none; }

.nav__right { display: flex; align-items: center; gap: 14px; }

.nav__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card);
    color: var(--ink);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    flex: none;
}

.nav__toggle { display: none; }

/* ------------------------------ Page shell ------------------------------- */

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 40px 32px 80px;
}

.page__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.page__title {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
}

.page__sub {
    margin-top: 6px;
    color: var(--on-shell-muted);
    font-size: 15px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: var(--on-shell-faint);
    margin-bottom: 14px;
}

/* --------------------------------- Cards --------------------------------- */

.card {
    background: var(--card);
    color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 28px;
}

.card--tight { padding: 20px; }
.card--white { background: var(--card-raised); color: var(--ink); }

.card__title {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -.015em;
    margin-bottom: 4px;
}

.card__meta { font-size: 14px; color: var(--ink-muted); }

.grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.grid--halves { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.stack { display: grid; gap: 18px; }

/* -------------------------------- Material card -------------------------- */

.material-card {
    background: var(--card);
    color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-decoration: none;
    transition: transform .16s ease;
}

.material-card:hover { transform: translateY(-2px); }

.material-card__body { flex: 1; }

.material-card__title {
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -.015em;
    margin-bottom: 6px;
}

.material-card__desc {
    font-size: 14px;
    color: var(--ink-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.material-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--ink-muted);
    border-top: 1px solid var(--card-line);
    padding-top: 13px;
}

/* --------------------------------- Chips --------------------------------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .01em;
    white-space: nowrap;
}

.chip--mint  { background: var(--mint);  color: var(--mint-ink); }
.chip--blush { background: var(--blush); color: var(--blush-ink); }
.chip--sky   { background: var(--sky);   color: var(--sky-ink); }
.chip--sand  { background: var(--sand);  color: var(--sand-ink); }
.chip--quiet { background: var(--card-sunken); color: var(--ink-muted); }

/* On the dark shell chips need their own translucent variants. */
.chip--onshell { background: rgba(255,255,255,.12); color: var(--on-shell-muted); }

/* -------------------------------- Buttons -------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .15s ease, background .15s ease, border-color .15s ease;
    white-space: nowrap;
}

.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* Primary on the dark shell */
.btn--light { background: var(--card-raised); color: var(--ink); }
.btn--light:hover:not(:disabled) { background: #fff; opacity: .9; }

/* Primary on a light card */
.btn--dark { background: var(--shell); color: var(--on-shell); }
.btn--dark:hover:not(:disabled) { background: var(--shell-deep); }

.btn--ghost { background: transparent; color: var(--on-shell); border-color: var(--shell-line); }
.btn--ghost:hover:not(:disabled) { background: var(--shell-hover); }

.btn--quiet { background: var(--card-sunken); color: var(--ink); }
.btn--quiet:hover:not(:disabled) { background: var(--card-line); }

.btn--danger { background: transparent; color: var(--blush); border-color: rgba(246,220,225,.35); }
.btn--danger:hover:not(:disabled) { background: rgba(246,220,225,.10); }

.btn--block { width: 100%; }
.btn--sm { padding: 8px 15px; font-size: 14px; }

/* --------------------------------- Forms --------------------------------- */

.field { margin-bottom: 20px; }

.field__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 7px;
    color: var(--ink);
}

.field__hint { font-size: 13px; color: var(--ink-muted); margin-top: 6px; }

.input,
.textarea,
.select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--card-line);
    border-radius: var(--radius);
    background: var(--card-raised);
    color: var(--ink);
    font-family: inherit;
    font-size: 15px;
    line-height: 1.5;
    transition: border-color .15s ease;
}

.input:focus,
.textarea:focus,
.select:focus {
    outline: none;
    border-color: var(--shell);
}

.textarea { resize: vertical; min-height: 200px; }

.field__error { color: #B3243C; font-size: 13.5px; margin-top: 6px; }

/* File drop zone */
.dropzone {
    border: 1.5px dashed var(--card-line);
    border-radius: var(--radius);
    background: var(--card-raised);
    padding: 30px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.dropzone:hover,
.dropzone.is-active { border-color: var(--shell); background: #fff; }
.dropzone__icon { font-size: 26px; margin-bottom: 8px; }
.dropzone__main { font-weight: 600; font-size: 15px; }
.dropzone__sub { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }

.progress {
    height: 6px;
    border-radius: 999px;
    background: var(--card-sunken);
    overflow: hidden;
    margin-top: 14px;
}

.progress__bar {
    height: 100%;
    width: 0;
    background: var(--shell);
    border-radius: 999px;
    transition: width .3s ease;
}

/* ------------------------------- Segmented ------------------------------- */

.segmented {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.segmented input { position: absolute; opacity: 0; pointer-events: none; }

.segmented label {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--card-line);
    background: var(--card-raised);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.segmented input:checked + label {
    background: var(--shell);
    border-color: var(--shell);
    color: var(--on-shell);
}

.segmented input:disabled + label { opacity: .4; cursor: not-allowed; }

/* --------------------------------- Alerts -------------------------------- */

.alert {
    border-radius: var(--radius);
    padding: 14px 18px;
    font-size: 14.5px;
    margin-bottom: 22px;
}

.alert--ok   { background: var(--mint);  color: var(--mint-ink); }
.alert--bad  { background: var(--blush); color: var(--blush-ink); }
.alert--info { background: var(--sky);   color: var(--sky-ink); }

/* --------------------------------- Stats --------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
}

.stat {
    background: var(--card-raised);
    color: var(--ink);
    border-radius: var(--radius);
    padding: 16px 18px;
}

.stat__value { font-size: 27px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.stat__label { font-size: 13px; color: var(--ink-muted); margin-top: 3px; }

/* On the dark shell */
.stat--onshell { background: rgba(255,255,255,.08); }
.stat--onshell .stat__value { color: var(--on-shell); }
.stat--onshell .stat__label { color: var(--on-shell-muted); }

/* ---------------------------------- Quiz --------------------------------- */

.quiz {
    max-width: 780px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.quiz__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--on-shell-muted);
}

.quiz__track {
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    overflow: hidden;
    margin-bottom: 30px;
}

.quiz__fill {
    height: 100%;
    background: var(--card-raised);
    border-radius: 999px;
    transition: width .35s ease;
}

.quiz__question {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -.02em;
    line-height: 1.35;
    margin-bottom: 24px;
}

.options { display: grid; gap: 10px; }

.option {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    width: 100%;
    text-align: left;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 1px solid var(--card-line);
    background: var(--card-raised);
    color: var(--ink);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}

.option:hover:not(:disabled) { border-color: var(--shell); }
.option:disabled { cursor: default; }

.option__key {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: var(--card-sunken);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink-muted);
}

.option.is-selected { border-color: var(--shell); background: var(--card); }
.option.is-correct  { background: var(--mint);  border-color: #A9D8B8; }
.option.is-correct .option__key  { background: #BCE3C7; color: var(--mint-ink); }
.option.is-wrong    { background: var(--blush); border-color: #E9BCC7; }
.option.is-wrong .option__key    { background: #EEC6D0; color: var(--blush-ink); }

.verdict {
    margin-top: 22px;
    border-radius: var(--radius);
    padding: 20px 22px;
}

.verdict--ok  { background: var(--mint);  color: var(--mint-ink); }
.verdict--bad { background: var(--blush); color: var(--blush-ink); }
.verdict--partial { background: var(--sand); color: var(--sand-ink); }

.verdict__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 9px;
}

.verdict__body { font-size: 15px; white-space: pre-line; }

.verdict__source {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.5);
    font-size: 14px;
    font-style: italic;
}

/* ------------------------------- Result list ----------------------------- */

.review {
    background: var(--card-raised);
    /* Sits on the dark shell, so the ink colour has to be re-stated or the
       text inherits white and disappears against the card. */
    color: var(--ink);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.review__q { font-weight: 650; font-size: 16px; margin-bottom: 10px; letter-spacing: -.01em; }

.review__row {
    display: flex;
    gap: 10px;
    font-size: 14.5px;
    padding: 5px 0;
    color: var(--ink);
}

.review__key { flex: none; width: 120px; color: var(--ink-muted); }

.review__feedback {
    margin-top: 12px;
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    background: var(--card);
    font-size: 14.5px;
    white-space: pre-line;
}

/* --------------------------------- Score --------------------------------- */

.score {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.score__ring {
    width: 118px;
    height: 118px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: none;
    background: var(--card-sunken);
    color: var(--ink);
}

.score__num { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.score__unit { font-size: 13px; color: var(--ink-muted); margin-top: 2px; }

/* --------------------------------- Empty --------------------------------- */

.empty {
    background: var(--card);
    color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 56px 32px;
    text-align: center;
}

.empty__icon { font-size: 34px; margin-bottom: 12px; }
.empty__title { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin-bottom: 6px; }
.empty__text { color: var(--ink-muted); font-size: 15px; max-width: 440px; margin: 0 auto 22px; }

/* --------------------------------- Auth ---------------------------------- */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 40px 20px;
}

.auth__card {
    width: 100%;
    max-width: 430px;
    background: var(--card);
    color: var(--ink);
    border-radius: var(--radius-lg);
    padding: 38px 34px;
}

.auth__title { font-size: 26px; font-weight: 700; letter-spacing: -.025em; margin-bottom: 6px; }
.auth__sub { color: var(--ink-muted); font-size: 15px; margin-bottom: 26px; }
.auth__foot { margin-top: 22px; text-align: center; font-size: 14.5px; color: var(--ink-muted); }
.auth__foot a { color: var(--ink); font-weight: 600; }

/* --------------------------- Tinted colour panels ------------------------ */

/* Full-bleed colour blocks. No borders, no shadows — the fill is the edge.
   Each tint ships with a matching ink so text contrast never has to be
   re-derived at the call site. */

.panel {
    border-radius: 22px;
    padding: 26px 28px;
    background: var(--panel-fill);
    color: var(--panel-ink);
}

.panel--lavender  { --panel-fill: #DEDCF5; --panel-ink: #2E2A55; --panel-soft: #ECEBFA; }
.panel--apricot   { --panel-fill: #F7B269; --panel-ink: #4A2C05; --panel-soft: #FBD3A6; }
.panel--sage      { --panel-fill: #C3D5CE; --panel-ink: #1E3A33; --panel-soft: #D9E5E1; }
.panel--periwinkle{ --panel-fill: #A3AAEE; --panel-ink: #1F2360; --panel-soft: #C2C7F4; }
.panel--mist      { --panel-fill: #DCE3E8; --panel-ink: #22323D; --panel-soft: #EBEFF2; }
.panel--ink       { --panel-fill: #2B3037; --panel-ink: #F2F4F5; --panel-soft: rgba(255,255,255,.10); }

.panel__label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    opacity: .62;
    margin-bottom: 10px;
}

.panel__title {
    font-size: clamp(24px, 3vw, 38px);
    font-weight: 600;
    letter-spacing: -.035em;
    line-height: 1.05;
}

/* Oversized numerals, the way the reference dashboards lead with a figure. */
.display {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 600;
    letter-spacing: -.05em;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.display--sm { font-size: clamp(28px, 4vw, 40px); }

.panel__inner {
    background: var(--panel-soft);
    border-radius: 16px;
    padding: 18px 20px;
}

.panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

/* Segmented progress bar, as in the "Total progress" block. */
.meter {
    display: flex;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    background: var(--panel-soft);
    font-size: 13px;
    font-weight: 600;
}

.meter__seg {
    display: grid;
    place-items: center;
    min-width: 0;
    transition: width .4s ease;
    white-space: nowrap;
    overflow: hidden;
}

.meter__seg--strong { background: #C7C3F2; color: #2E2A55; }
.meter__seg--soft   { background: #B9B4EE; color: #2E2A55; }

/* Thin hand-drawn-feeling sparkline. */
.spark { width: 100%; height: 46px; display: block; }
.spark path { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.accent-lime { color: #C8F135; }
.stroke-lime { stroke: #A8CE1E; }
.stroke-ink  { stroke: #2B3037; }

/* -------------------------------- Widgets -------------------------------- */

.widgets {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
    margin-bottom: 28px;
}

.widget {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.widget--wide { grid-column: span 4; }

.widget--link {
    text-decoration: none;
    transition: transform .16s ease;
}

.widget--link:hover { transform: translateY(-2px); }

.widget__foot {
    font-size: 14px;
    opacity: .72;
    margin-top: 10px;
}

.widget__cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    font-weight: 600;
    font-size: 15px;
}

.widget__cta svg { width: 18px; height: 18px; }

/* Circular goal meter. */
.ring {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 6px auto 0;
}

.ring__svg { width: 100%; height: 100%; display: block; }

.ring__svg circle:last-child { transition: stroke-dashoffset .6s ease; }

.ring__label {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

/* Day letters under the weekly sparkline. */
.widget__days {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    opacity: .7;
    margin-top: 4px;
}

.widget__days .is-empty { opacity: .38; }

/* Horizontal accuracy bars. */
.bars { display: grid; gap: 14px; }

.bar__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.bar__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar__value { font-weight: 700; font-variant-numeric: tabular-nums; }

.bar__track {
    height: 9px;
    border-radius: 999px;
    background: var(--panel-soft);
    overflow: hidden;
}

.bar__fill {
    height: 100%;
    border-radius: 999px;
    background: #6F8F81;
    transition: width .5s ease;
}

.bar__meta { font-size: 12.5px; opacity: .6; margin-top: 4px; }

@media (max-width: 1000px) {
    .widgets { grid-template-columns: repeat(4, 1fr); }
    .widget, .widget--wide { grid-column: span 4; }
}

@media (max-width: 640px) {
    .widgets { grid-template-columns: 1fr; }
    .widget, .widget--wide { grid-column: span 1; }
}

/* ------------------------- Glass hero (landing / input) ------------------ */

/* An atmospheric out-of-focus backdrop, built entirely from blurred colour
   fields so the page carries no external image weight. */
.aura {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: #6E8093;
    overflow: hidden;
}

.aura::before,
.aura::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
}

.aura::before {
    width: 70vw;
    height: 70vw;
    top: -18vw;
    left: -12vw;
    background: radial-gradient(circle at 35% 35%, #C6D6E2 0%, #8FA6B8 45%, rgba(110,128,147,0) 72%);
}

.aura::after {
    width: 62vw;
    height: 62vw;
    bottom: -22vw;
    right: -14vw;
    background: radial-gradient(circle at 60% 45%, #D7A184 0%, #A97E6C 40%, rgba(110,128,147,0) 70%);
}

.aura__blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(110px);
    opacity: .85;
}

.aura__blob--1 { width: 34vw; height: 34vw; top: 12%; left: 26%; background: #A9BECD; }
.aura__blob--2 { width: 26vw; height: 26vw; bottom: 8%;  left: 8%;  background: #7C93A8; }
.aura__blob--3 { width: 22vw; height: 22vw; top: 46%;   right: 24%; background: #5E7386; }

.hero {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 60px 24px;
    text-align: center;
}

.hero__inner { width: 100%; max-width: 900px; }

.hero__title {
    font-size: clamp(34px, 5.4vw, 60px);
    font-weight: 300;
    letter-spacing: -.035em;
    line-height: 1.08;
    color: #fff;
    text-shadow: 0 2px 30px rgba(0,0,0,.22);
}

.hero__sub {
    margin-top: 18px;
    font-size: clamp(15px, 1.7vw, 19px);
    color: rgba(255,255,255,.82);
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 16px rgba(0,0,0,.2);
}

/* The frosted bar itself. */
.glass {
    margin-top: 42px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 14px 14px 34px;
    border-radius: 26px;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .35);
    backdrop-filter: blur(26px) saturate(150%);
    -webkit-backdrop-filter: blur(26px) saturate(150%);
    box-shadow: 0 20px 60px rgba(30, 45, 60, .18);
    text-align: left;
}

.glass__text {
    flex: 1;
    font-size: clamp(19px, 2.6vw, 32px);
    font-weight: 300;
    letter-spacing: -.02em;
    color: #1A2530;
    background: transparent;
    border: 0;
    font-family: inherit;
    min-width: 0;
}

.glass__text::placeholder { color: rgba(26, 37, 48, .55); }
.glass__text:focus { outline: none; }

.glass__go {
    flex: none;
    width: 62px;
    height: 62px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,.5);
    background: linear-gradient(145deg, #EBD9E4 0%, #DCE6EF 50%, #E6E3D6 100%);
    color: #1A2530;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.glass__go:hover { transform: translateY(-1px); filter: brightness(1.06); }
.glass__go svg { width: 24px; height: 24px; }

/* Frosted secondary actions under the bar. */
.glass-links {
    margin-top: 26px;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.glass-link {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    border-radius: 999px;
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.32);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: background .15s ease;
}

.glass-link:hover { background: rgba(255,255,255,.3); }
.glass-link svg { width: 18px; height: 18px; }

/* A compact frosted bar used inside the app pages, on the dark shell. */
.glass--inline {
    margin-top: 0;
    padding: 10px 10px 10px 22px;
    border-radius: 18px;
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.18);
    box-shadow: none;
}

.glass--inline .glass__text { font-size: 17px; color: #fff; }
.glass--inline .glass__text::placeholder { color: rgba(255,255,255,.5); }
.glass--inline .glass__go { width: 44px; height: 44px; border-radius: 13px; }
.glass--inline .glass__go svg { width: 19px; height: 19px; }

@media (max-width: 640px) {
    .glass { padding: 10px 10px 10px 20px; border-radius: 20px; gap: 10px; }
    .glass__go { width: 48px; height: 48px; border-radius: 14px; }
}

/* --------------------------------- Coach --------------------------------- */

.coach {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 32px 40px;
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 22px;
    align-items: start;
}

.stage {
    border-radius: 22px;
    padding: 24px;
    background: var(--panel-fill);
    color: var(--panel-ink);
    text-align: center;
    position: sticky;
    top: 96px;
}

.avatar-stage {
    width: 100%;
    max-width: 250px;
    margin: 0 auto 16px;
    aspect-ratio: 200 / 220;
    border-radius: 20px;
    background: var(--panel-soft);
    overflow: hidden;
    position: relative;
    transition: box-shadow .3s ease;
}

.avatar-stage.is-speaking { box-shadow: 0 0 0 3px rgba(255,255,255,.55) inset; }

.avatar-photo { width: 100%; height: 100%; opacity: 0; transition: opacity .4s ease; }
.avatar-photo.is-loaded { opacity: 1; }
.avatar-canvas { display: block; width: 100%; height: 100%; }

.avatar-sprite {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    user-select: none;
    pointer-events: none;
}

.widget__emma-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.widget__emma {
    width: 88px;
    height: 96px;
    object-fit: cover;
    object-position: center 16%;
    border-radius: 16px;
    background: var(--panel-soft);
    flex: none;
}

.avatar-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--panel-soft);
}

.stage__note {
    font-size: 12.5px;
    opacity: .6;
    margin-top: 12px;
    min-height: 18px;
}

.stage__name { font-size: 18px; font-weight: 650; letter-spacing: -.02em; }
.stage__status { font-size: 14px; opacity: .72; margin-top: 2px; min-height: 21px; }

.stage__controls { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 0;
    background: var(--panel-soft);
    color: inherit;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform .15s ease, opacity .15s ease;
}

.icon-btn:hover { transform: translateY(-1px); }
.icon-btn.is-off { opacity: .45; }
.icon-btn svg { width: 20px; height: 20px; }

/* Voice level ring shown while the mic listens. */
.icon-btn.is-listening {
    background: #E8574F;
    color: #fff;
    animation: listening 1.1s ease-in-out infinite;
}

@keyframes listening {
    0%, 100% { box-shadow: 0 0 0 0 rgba(232,87,79,.55); }
    50%      { box-shadow: 0 0 0 9px rgba(232,87,79,0); }
}

/* ------------------------------- Chat panel ------------------------------ */

.chat {
    background: var(--card);
    color: var(--ink);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 160px);
    min-height: 460px;
    overflow: hidden;
}

.chat__head {
    padding: 20px 24px;
    border-bottom: 1px solid var(--card-line);
}

.chat__title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; }
.chat__hint { font-size: 13.5px; color: var(--ink-muted); margin-top: 2px; }

.chat__log {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bubble {
    max-width: 78%;
    padding: 13px 17px;
    border-radius: 16px;
    font-size: 15px;
    line-height: 1.5;
    white-space: pre-line;
    animation: rise .22s ease;
}

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

.bubble--coach { background: var(--card-raised); border-bottom-left-radius: 5px; align-self: flex-start; }
.bubble--user  { background: var(--shell); color: var(--on-shell); border-bottom-right-radius: 5px; align-self: flex-end; }
.bubble--error { background: var(--blush); color: var(--blush-ink); align-self: flex-start; }

.bubble__replay {
    display: block;
    margin-top: 8px;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    color: var(--ink-muted);
    cursor: pointer;
    text-decoration: underline;
}

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--ink-faint);
    animation: blip 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }

@keyframes blip {
    0%, 60%, 100% { opacity: .3; transform: translateY(0); }
    30%           { opacity: 1;  transform: translateY(-3px); }
}

.chat__foot {
    border-top: 1px solid var(--card-line);
    background: var(--card);
}

/* Dictation status, shown only while the microphone is live. */
.chat__mic-hint {
    font-size: 13px;
    color: var(--ink-muted);
    padding: 10px 20px 0;
    min-height: 0;
    transition: color .2s ease;
}

.chat__mic-hint:empty { display: none; }

.chat__mic-hint.is-sending {
    color: var(--blush-ink);
    font-weight: 600;
}

.chat__form {
    display: flex;
    gap: 10px;
    padding: 12px 20px 16px;
    background: var(--card);
}

.chat__input {
    flex: 1;
    padding: 13px 16px;
    border: 1px solid var(--card-line);
    border-radius: 12px;
    background: var(--card-raised);
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    resize: none;
    max-height: 120px;
}

.chat__input:focus { outline: none; border-color: var(--shell); }

@media (max-width: 900px) {
    .coach { grid-template-columns: 1fr; padding: 20px 16px 32px; }
    .stage { position: static; }
    .avatar-stage { max-width: 200px; }
    .chat { height: auto; min-height: 60vh; }
    .bubble { max-width: 88%; }
}

/* ------------------------------- Utilities ------------------------------- */

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.muted { color: var(--ink-muted); }
.muted-shell { color: var(--on-shell-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; }
.hidden { display: none !important; }

/* ------------------------------- Responsive ------------------------------ */

@media (max-width: 860px) {
    .nav { gap: 16px; padding: 14px 18px; flex-wrap: wrap; }
    .nav__links {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }
    .nav__links::-webkit-scrollbar { display: none; }
    .nav__right { margin-left: auto; }
    .page { padding: 26px 18px 64px; }
    .page__title { font-size: 27px; }
    .card { padding: 22px; }
    .quiz { padding: 24px 18px 64px; }
    .quiz__question { font-size: 21px; }
    .review__row { flex-direction: column; gap: 2px; }
    .review__key { width: auto; }
}
