:root {
    color-scheme: light;
    --ink: #111827;
    --muted: #5f6875;
    --line: #e5dce1;
    --surface: #f8f7f8;
    --brand: #7a1640;
    --accent: #ED5A96;
    --accent-light: #ff86b8;
    --success: #237a57;
    --soft: #fff0f6;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, #fff0f6 0%, #faf8f9 48%, #ffffff 100%);
}

button,
a,
input {
    font: inherit;
}

.shell,
.learn-shell {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 28px 18px;
}

.shell {
    min-height: 100vh;
    display: grid;
    align-content: center;
    gap: 18px;
}

.course-landing {
    padding: 28px 0;
}

.course-logo {
    width: min(310px, 72vw);
    height: auto;
    margin-bottom: 34px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--brand);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: anywhere;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 12vw, 4rem);
    line-height: 1;
}

h2 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
}

.subtitle {
    margin: 14px 0 0;
    color: var(--accent);
    font-size: clamp(1.15rem, 5vw, 1.8rem);
    font-weight: 700;
}

.summary,
.activity-heading p,
.activity-card p,
.completion-panel p {
    color: var(--muted);
    font-size: 1.04rem;
    line-height: 1.55;
}

.summary {
    max-width: 32rem;
    margin: 22px 0 0;
}

.secondary-action,
.primary-action,
.text-action,
.tutor-button,
.icon-link {
    min-height: 44px;
    border-radius: 6px;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}

.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 28px;
    padding: 0 22px;
    background: var(--brand);
    color: var(--white);
    font-weight: 700;
}

.reset-form {
    margin-top: 12px;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--muted);
    font-weight: 700;
}

.status-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
}

.status-panel div {
    min-width: 0;
    padding: 14px;
    border-right: 1px solid var(--line);
}

.status-panel div:last-child {
    border-right: 0;
}

.status-panel span,
.status-panel strong {
    display: block;
}

.status-panel span {
    color: var(--muted);
    font-size: 0.78rem;
}

.status-panel strong {
    margin-top: 4px;
    overflow-wrap: anywhere;
}

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

.learn-header {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
}

.learn-header span,
.progress-copy span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.learn-header strong {
    display: block;
    margin-top: 2px;
    font-size: 0.96rem;
}

.learn-header-context {
    min-width: 0;
    display: flex;
    gap: 14px;
    align-items: center;
}

.learn-header-context > div { min-width: 0; }
.learn-header-logo {
    width: 112px;
    height: auto;
    flex: 0 0 auto;
}

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--white);
    color: var(--ink);
    font-size: 1.2rem;
}

.tutor-button {
    padding: 0 12px;
    background: #fff0f6;
    color: #7a1640;
    font-weight: 700;
}

.learn-shell {
    padding-top: 18px;
    padding-bottom: 48px;
}

.progress-block {
    margin-bottom: 24px;
}

.progress-copy {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin-bottom: 8px;
}

.progress-copy strong {
    color: var(--brand);
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #eadde4;
}

.progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.activity-heading {
    margin-bottom: 18px;
}

.activity-heading h1,
.completion-panel h1 {
    font-size: clamp(1.9rem, 9vw, 3.4rem);
}

.activity-card,
.completion-panel {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 24px rgba(24, 33, 47, 0.06);
}

.activity-callout {
    margin-top: 18px;
    padding: 14px;
    border-left: 4px solid var(--accent);
    background: #fff0f6;
    color: #6f1c42;
    line-height: 1.45;
}

.activity-form {
    margin: 0;
}

.option-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.option-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 12px;
    align-items: start;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    line-height: 1.4;
}

.option-row input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    accent-color: var(--brand);
}

.secondary-form {
    margin-top: 16px;
}

.text-action {
    padding: 0;
    background: transparent;
    color: var(--brand);
    font-weight: 700;
}

@media (max-width: 520px) {
    .shell {
        align-content: start;
        padding-top: 54px;
    }

    .status-panel {
        grid-template-columns: 1fr;
    }

    .status-panel div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .status-panel div:last-child {
        border-bottom: 0;
    }

    .learn-header {
        grid-template-columns: 40px 1fr auto;
    }

    .tutor-button {
        max-width: 92px;
    }

    .learn-header-logo { display: none; }
    .learn-header-context { gap: 0; }
}

.feedback-panel {
    margin-bottom: 22px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 10px 24px rgba(24, 33, 47, 0.06);
}

.feedback-panel h2 {
    margin-bottom: 8px;
}

.feedback-panel > p:last-of-type {
    margin-bottom: 0;
    color: var(--ink);
    line-height: 1.5;
}

.feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 20px;
}
.feedback-actions form { margin: 0; }
.feedback-actions .primary-action { margin-top: 0; }
.feedback-geoff-action {
    display: inline-flex;
    gap: 9px;
    align-items: center;
    margin-right: auto;
}
.feedback-geoff-action img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.feedback-panel.is-correct {
    border-left: 5px solid var(--success);
}

.feedback-panel.is-revisit {
    border-left: 5px solid var(--accent);
}

.question-heading p {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.option-row:has(input:checked) {
    border-color: var(--brand);
    background: var(--soft);
}

.completion-panel {
    text-align: left;
}

.completion-panel .primary-action {
    margin-top: 18px;
}

.feedback-panel.is-neutral {
    border-left: 5px solid #55708a;
}

.scenario-figure {
    margin: 0 0 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
}

.scenario-figure img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.scenario-figure figcaption {
    padding: 12px 14px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

.ordering-list {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: ordering;
}

.ordering-item {
    counter-increment: ordering;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 64px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfd;
}

.ordering-handle {
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.ordering-label::before {
    content: counter(ordering) ". ";
    color: var(--brand);
    font-weight: 700;
}

.ordering-controls {
    display: grid;
    grid-template-columns: repeat(2, 40px);
    gap: 6px;
}

.order-button {
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.15rem;
    font-weight: 700;
}

.order-button:hover:not(:disabled),
.order-button:focus-visible {
    border-color: var(--brand);
    color: var(--brand);
}

.order-button:disabled {
    cursor: default;
    opacity: 0.3;
}

.reflection-field {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    color: var(--ink);
    font-weight: 700;
}

.reflection-field textarea {
    width: 100%;
    min-height: 132px;
    resize: vertical;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fbfcfd;
    color: var(--ink);
    font: inherit;
    font-weight: 400;
    line-height: 1.5;
}

.reflection-field textarea:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(237, 90, 150, 0.18);
}

.activity-form[aria-busy="true"] {
    opacity: 0.75;
}

.primary-action:disabled {
    cursor: wait;
    opacity: 0.8;
}

@media (max-width: 520px) {
    .ordering-item {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .ordering-controls {
        grid-column: 2;
        justify-content: start;
    }
}

.learning-copy {
    display: grid;
    gap: 14px;
}

.learning-copy p {
    margin: 0;
}

.learning-definition {
    display: grid;
    gap: 7px;
    margin-top: 22px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.learning-definition span {
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.learning-definition strong {
    font-size: 1.12rem;
    line-height: 1.45;
}

.learning-points,
.learning-steps {
    display: grid;
    gap: 0;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.learning-points li {
    display: grid;
    gap: 5px;
    padding: 14px 0 14px 16px;
    border-top: 1px solid var(--line);
    border-left: 4px solid #55708a;
}

.learning-points li:last-child {
    border-bottom: 1px solid var(--line);
}

.learning-points strong,
.learning-steps strong {
    color: var(--ink);
    line-height: 1.35;
}

.learning-points span,
.learning-steps span {
    color: var(--muted);
    line-height: 1.5;
}

.learning-steps {
    counter-reset: learning-step;
}

.learning-steps li {
    counter-increment: learning-step;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 2px 12px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.learning-steps li:last-child {
    border-bottom: 1px solid var(--line);
}

.learning-steps li::before {
    content: counter(learning-step);
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--white);
    font-size: 0.86rem;
    font-weight: 700;
}

.activity-callout strong,
.activity-callout span {
    display: block;
}

.activity-callout strong {
    margin-bottom: 5px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.activity-callout.is-info {
    border-left-color: #55708a;
    background: #edf3f7;
    color: #263f54;
}

.activity-callout.is-caution {
    border-left-color: var(--accent);
    background: #fff0f6;
    color: #6f1c42;
}

.course-shell {
    width: min(100%, 900px);
    min-height: 0;
    align-content: start;
    gap: 0;
    padding-top: 44px;
    padding-bottom: 72px;
}

.course-landing {
    min-height: min(640px, 82vh);
    display: grid;
    align-content: center;
}

.course-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 30px 0 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.course-facts div {
    min-width: 0;
    padding: 15px 16px 15px 0;
}

.course-facts dt {
    color: var(--muted);
    font-size: 0.78rem;
}

.course-facts dd {
    margin: 5px 0 0;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.35;
}

.course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 28px;
}

.course-actions form,
.course-actions .reset-form {
    margin: 0;
}

.course-actions .primary-action {
    margin-top: 0;
}

.course-overview,
.course-outcomes {
    padding: 52px 0;
    border-top: 1px solid var(--line);
}

.course-overview h2,
.course-outcomes h2 {
    max-width: 680px;
    font-size: 1.65rem;
    line-height: 1.2;
}

.course-overview > p:not(.eyebrow) {
    max-width: 700px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.course-outcomes ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.course-outcomes li {
    display: grid;
    gap: 5px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.course-outcomes li:nth-last-child(-n + 2) {
    border-bottom: 1px solid var(--line);
}

.course-outcomes strong {
    line-height: 1.35;
}

.course-outcomes span {
    color: var(--muted);
    line-height: 1.5;
}

.course-boundary {
    padding: 20px;
    border-left: 5px solid var(--accent);
    background: #fff0f6;
    color: #6f1c42;
}

.course-boundary strong,
.course-boundary p {
    display: block;
}

.course-boundary p {
    margin: 7px 0 0;
    line-height: 1.55;
}

@media (max-width: 640px) {
    .course-shell {
        padding-top: 24px;
    }

    .course-landing {
        min-height: 0;
        padding: 34px 0 52px;
    }

    .course-facts,
    .course-outcomes ul {
        grid-template-columns: 1fr;
    }

    .course-facts div {
        padding: 12px 0;
        border-top: 1px solid var(--line);
    }

    .course-facts div:first-child {
        border-top: 0;
    }

    .course-actions {
        align-items: stretch;
    }

    .course-actions form,
    .course-actions button {
        width: 100%;
    }

    .course-outcomes li:nth-last-child(2) {
        border-bottom: 0;
    }

    .course-outcomes li:last-child {
        border-bottom: 1px solid var(--line);
    }
}

/* Varied tutorial treatments */
.learning-card {
    overflow: hidden;
}

.learning-content {
    min-width: 0;
}

.learning-media {
    margin: -20px -20px 22px;
    background: #e8ecef;
}

.learning-media img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.learning-media figcaption {
    padding: 10px 18px;
    color: var(--muted);
    background: #f4f6f7;
    font-size: 0.82rem;
    line-height: 1.4;
}

.layout-feature {
    padding: 0;
}

.layout-feature .learning-media {
    margin: 0;
}

.layout-feature .learning-media img {
    height: clamp(220px, 34vw, 320px);
    aspect-ratio: auto;
    object-position: center 42%;
}

.layout-feature .learning-content {
    padding: 24px;
}

.layout-split {
    display: grid;
    grid-template-columns: minmax(240px, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    padding: 0;
}

.layout-split .learning-media {
    height: auto;
    min-height: 0;
    margin: 0;
}

.layout-split .learning-media img {
    height: 380px;
    aspect-ratio: auto;
    object-position: center 42%;
}

.layout-split .learning-media figcaption {
    display: none;
}

.layout-split .learning-content {
    padding: 26px;
}

.layout-tiles .learning-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.layout-tiles .learning-points li {
    padding: 16px;
    border: 1px solid var(--line);
    border-top: 4px solid #55708a;
    border-left-width: 1px;
    background: #f8fafb;
}

.layout-tiles .learning-points li:last-child {
    border-bottom: 1px solid var(--line);
}

.layout-pathway .learning-steps {
    gap: 12px;
}

.layout-pathway .learning-steps li {
    padding: 16px;
    border: 0;
    background: #fff0f6;
}

.layout-pathway .learning-steps li:nth-child(even) {
    background: #edf3f7;
}

.layout-definition {
    border-top: 6px solid var(--brand);
}

.layout-definition .learning-definition {
    margin: 0 0 22px;
    padding: 20px;
    border: 0;
    background: #fff0f6;
}

.layout-contrast .learning-points li:nth-child(odd) {
    border-left-color: var(--brand);
    background: #fff7fa;
}

.layout-contrast .learning-points li:nth-child(even) {
    border-left-color: var(--accent);
    background: #fff4f8;
}

.layout-section-intro {
    border: 0;
    background: #7a1640;
    color: var(--white);
}
.layout-section-intro .learning-content { padding: 34px; }
.layout-section-intro .learning-copy p,
.layout-section-intro .section-intro-focus { color: #ffe6f0; }
.section-intro-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.section-intro-meta strong, .section-intro-meta span { font-size: 0.82rem; }
.section-intro-focus {
    margin: 18px 0 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.45;
}
.layout-section-intro .activity-form .primary-action { background: var(--white); color: #7a1640; }
.geoff-introduction {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
    margin-top: 24px;
    padding: 18px;
    border: 1px solid #efbfd3;
    background: #fff4f8;
}
.geoff-introduction img { width: 92px; height: 92px; object-fit: contain; }
.geoff-introduction strong, .geoff-introduction p { display: block; }
.geoff-introduction strong { color: var(--ink); }
.geoff-introduction p { margin: 6px 0 14px; color: var(--muted); line-height: 1.5; }
.geoff-introduction .secondary-action { width: auto; }

@media (max-width: 700px) {
    .layout-split {
        grid-template-columns: 1fr;
    }

    .layout-split .learning-media {
        min-height: 0;
    }

    .layout-split .learning-media img {
        height: 220px;
        aspect-ratio: auto;
    }

    .layout-feature .learning-media img {
        height: 210px;
    }

    .layout-split .learning-content {
        padding: 20px;
    }

    .layout-tiles .learning-points {
        grid-template-columns: 1fr;
    }

    .layout-section-intro .learning-content { padding: 24px 20px; }
    .geoff-introduction {
        grid-template-columns: 56px minmax(0, 1fr);
        align-items: start;
        padding: 14px;
    }
    .geoff-introduction img { width: 56px; height: 56px; }
    .geoff-introduction > div { display: contents; }
    .geoff-introduction strong { align-self: center; }
    .geoff-introduction p { grid-column: 1 / -1; margin-top: 4px; }
    .geoff-introduction .secondary-action { grid-column: 1 / -1; width: 100%; }
}

/* Contextual AI Tutor */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tutor-is-open {
    overflow: hidden;
}

.tutor-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(24, 33, 47, 0.48);
}

.tutor-drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 21;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    width: min(440px, 100%);
    height: 100dvh;
    border-left: 1px solid var(--line);
    background: var(--white);
    box-shadow: -16px 0 42px rgba(24, 33, 47, 0.18);
    transform: translateX(100%);
    transition: transform 220ms ease;
}

.tutor-drawer[aria-hidden="false"] {
    transform: translateX(0);
}

.tutor-drawer-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    min-height: 76px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
}

.tutor-drawer-header .eyebrow {
    margin-bottom: 4px;
    font-size: 0.7rem;
}

.tutor-drawer-header h2 {
    font-size: 1.25rem;
}

.tutor-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--white);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

.tutor-context {
    display: grid;
    gap: 3px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: #fff0f6;
}

.tutor-context span,
.tutor-message > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.tutor-context strong {
    font-size: 0.9rem;
    line-height: 1.35;
}

.tutor-messages {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 18px;
    background: #f7f9fb;
    overscroll-behavior: contain;
}

.tutor-message {
    display: grid;
    gap: 5px;
    max-width: 88%;
}

.tutor-message .formatted-answer {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    color: var(--ink);
    line-height: 1.5;
}

.formatted-answer p { margin: 0; }
.formatted-answer p + p,
.formatted-answer p + ul,
.formatted-answer p + ol,
.formatted-answer ul + p,
.formatted-answer ol + p { margin-top: 0.8em; }
.formatted-answer ul,
.formatted-answer ol { margin: 0.7em 0 0; padding-left: 1.3em; }
.formatted-answer li { padding-left: 0.15em; line-height: 1.5; }
.formatted-answer li + li { margin-top: 0.45em; }
.formatted-answer strong { font-weight: 750; }
.formatted-answer em { font-style: italic; }
.formatted-answer-heading {
    display: block;
    margin-bottom: 0.65em;
    font-size: 1.02em;
}

.tutor-message.is-user {
    align-self: end;
}

.tutor-message.is-user > span {
    text-align: right;
}

.tutor-message.is-user .formatted-answer {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.tutor-suggestions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    scrollbar-width: thin;
}

.tutor-suggestions button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid #b9c8d3;
    border-radius: 6px;
    background: #edf3f7;
    color: #263f54;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 700;
}

.tutor-form {
    padding: 12px 18px 16px;
    border-top: 1px solid var(--line);
    background: var(--white);
}

.tutor-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: end;
}

.tutor-input-row textarea {
    width: 100%;
    min-height: 48px;
    max-height: 132px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #aeb9c5;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
}

.tutor-input-row button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: var(--white);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
}

.tutor-input-row button:disabled,
.tutor-input-row textarea:disabled {
    cursor: wait;
    opacity: 0.65;
}

.tutor-input-row textarea:focus,
.tutor-close:focus-visible,
.tutor-suggestions button:focus-visible,
.tutor-input-row button:focus-visible {
    outline: 3px solid rgba(237, 90, 150, 0.24);
    outline-offset: 2px;
}

.tutor-status {
    min-height: 18px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

@media (max-width: 520px) {
    .tutor-drawer {
        width: 100%;
        border-left: 0;
    }

    .tutor-message {
        max-width: 92%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tutor-drawer {
        transition: none;
    }
}

/* Guided AI scenarios */
.scenario-learning {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 16px 36px rgba(24, 33, 47, 0.08);
}

.scenario-situation {
    padding: 24px;
    border-bottom: 1px solid #dfc8c1;
    background: #fbf2ef;
}

.scenario-situation-heading {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
}

.scenario-situation-heading .eyebrow {
    margin-bottom: 4px;
    color: #92402f;
}

.scenario-marker {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 700;
}

.scenario-situation > p {
    margin: 0;
    color: var(--ink);
    font-size: 1.08rem;
    line-height: 1.62;
}

.scenario-turn-guide {
    display: block;
    margin-top: 14px;
    color: #725d57;
    font-size: 0.8rem;
    font-weight: 700;
}

.scenario-conversation {
    min-width: 0;
    background: #f7f9fb;
}

.scenario-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 180px;
    max-height: 520px;
    overflow-y: auto;
    padding: 24px;
    overscroll-behavior: contain;
}

.scenario-message {
    display: grid;
    gap: 5px;
    max-width: 88%;
}

.scenario-message > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.scenario-message .formatted-answer {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    line-height: 1.55;
}

.scenario-message.is-learner {
    align-self: end;
}

.scenario-message.is-learner > span {
    text-align: right;
}

.scenario-message.is-learner .formatted-answer {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}

.scenario-response-form {
    padding: 20px 24px 24px;
    border-top: 1px solid var(--line);
    background: var(--white);
}

.scenario-response-form > label {
    display: block;
    margin-bottom: 9px;
    font-weight: 700;
}

.scenario-response-form textarea {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    padding: 14px;
    border: 1px solid #aeb9c5;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    line-height: 1.5;
}

.scenario-response-form textarea:focus {
    outline: 3px solid rgba(237, 90, 150, 0.2);
    outline-offset: 2px;
    border-color: var(--brand);
}

.scenario-form-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.scenario-form-actions > span {
    color: var(--muted);
    font-size: 0.82rem;
}

.scenario-form-actions .primary-action {
    flex: 0 0 auto;
    margin-top: 0;
}

.scenario-complete {
    padding: 24px;
    border-top: 1px solid #bfd8d1;
    background: #eef7f4;
}

.scenario-complete h2 {
    margin-bottom: 8px;
}

.scenario-complete p:not(.eyebrow) {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.scenario-complete-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.scenario-complete-actions .primary-action,
.scenario-complete-actions .secondary-action {
    margin-top: 0;
}

@media (max-width: 560px) {
    .scenario-situation,
    .scenario-messages,
    .scenario-response-form,
    .scenario-complete {
        padding: 18px;
    }

    .scenario-message {
        max-width: 94%;
    }

    .scenario-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scenario-form-actions .primary-action,
    .scenario-complete-actions > *,
    .scenario-complete-actions button {
        width: 100%;
    }

    .scenario-complete-actions {
        display: grid;
    }
}

/* Tutor review entry points */
.learn-tools,
.completion-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.learn-tools {
    justify-content: end;
}

.coach-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}

.completion-actions {
    flex-wrap: wrap;
    margin-top: 18px;
}

.completion-actions .primary-action {
    margin-top: 0;
}

@media (max-width: 520px) {
    .learn-tools {
        gap: 3px;
    }

    .coach-link,
    .learn-tools .tutor-button {
        padding: 0 7px;
        font-size: 0.82rem;
    }

    .completion-actions,
    .completion-actions a {
        width: 100%;
    }
}

/* Geoff tutor identity */
.tutor-button {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding-left: 7px;
}

.tutor-button-avatar {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.tutor-identity,
.tutor-review-brand {
    display: flex;
    gap: 11px;
    align-items: center;
    min-width: 0;
}

.tutor-avatar {
    width: 54px;
    height: 54px;
    flex: 0 0 auto;
    object-fit: contain;
}

.tutor-review-avatar {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    object-fit: contain;
}

@media (max-width: 520px) {
    .tutor-button-avatar {
        width: 26px;
        height: 26px;
    }

    .tutor-button {
        gap: 4px;
        padding: 0 7px;
    }

    .tutor-avatar {
        width: 46px;
        height: 46px;
    }
}

/* Embedded Geoff conversations */
.inline-geoff-panel[hidden] { display: none; }
.inline-geoff-panel {
    grid-column: 1 / -1;
    min-width: 0;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #efbfd3;
    border-radius: 8px;
    background: var(--white);
}
.inline-geoff-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.inline-geoff-header img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}
.inline-geoff-header span,
.inline-geoff-header strong { display: block; }
.inline-geoff-header span {
    color: var(--brand);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}
.inline-geoff-header strong {
    margin-top: 2px;
    color: var(--ink);
}
.inline-geoff-messages {
    display: grid;
    gap: 12px;
}
.inline-geoff-message {
    display: grid;
    gap: 5px;
    max-width: 92%;
}
.inline-geoff-message > span {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
}
.inline-geoff-message .formatted-answer {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff7fa;
    color: var(--ink);
    line-height: 1.55;
}
.inline-geoff-message.is-user { justify-self: end; }
.inline-geoff-message.is-user > span { text-align: right; }
.inline-geoff-message.is-user .formatted-answer {
    border-color: var(--brand);
    background: var(--brand);
    color: var(--white);
}
.inline-geoff-form {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}
.inline-geoff-form > label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}
.inline-geoff-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: end;
}
.inline-geoff-input-row textarea {
    width: 100%;
    min-height: 52px;
    max-height: 150px;
    resize: vertical;
    padding: 12px;
    border: 1px solid #aeb9c5;
    border-radius: 6px;
    color: var(--ink);
    background: var(--white);
    font: inherit;
    line-height: 1.4;
}
.inline-geoff-input-row textarea:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(237, 90, 150, 0.2);
    outline-offset: 2px;
}
.inline-geoff-input-row button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--brand);
    color: var(--white);
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 700;
}
.inline-geoff-input-row button:disabled,
.inline-geoff-input-row textarea:disabled {
    cursor: wait;
    opacity: 0.65;
}
.inline-geoff-status {
    min-height: 18px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}
@media (max-width: 520px) {
    .inline-geoff-panel { padding: 14px; }
    .inline-geoff-message { max-width: 100%; }
}
