:root {
    --green-950: #102c24;
    --green-850: #173d32;
    --green-700: #2f6652;
    --paper: #f5f1e8;
    --paper-2: #fffdf7;
    --ink: #17211d;
    --muted: #66716c;
    --line: #d9d5ca;
    --rust: #a34e2a;
    --rust-soft: #f3e2da;
    --lime: #b8d936;
    --lime-soft: #edf4c9;
    --shadow: 0 18px 50px rgb(16 44 36 / 10%);
    --radius: 18px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }

.topbar {
    min-height: 76px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
    padding: 12px clamp(18px, 4vw, 58px);
    color: white;
    background: var(--green-950);
    border-bottom: 3px solid var(--lime);
}
.brand { display: inline-flex; gap: 11px; align-items: center; text-decoration: none; }
.brand__mark { display: grid; place-items: center; width: 42px; height: 42px; color: var(--green-950); background: var(--lime); border-radius: 12px; font-weight: 900; }
.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; opacity: .7; }
.main-nav { display: flex; gap: 6px; justify-content: center; }
.main-nav a { padding: 10px 12px; border-radius: 10px; text-decoration: none; color: rgb(255 255 255 / 72%); }
.main-nav a:hover, .main-nav a.is-active { color: white; background: rgb(255 255 255 / 10%); }
.account-menu { position: relative; }
.account-menu summary { list-style: none; cursor: pointer; text-align: right; }
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary span, .account-menu summary small { display: block; }
.account-menu summary small { color: var(--lime); }
.account-menu__panel { position: absolute; right: 0; z-index: 20; width: 210px; margin-top: 12px; padding: 8px; color: var(--ink); background: white; border-radius: 12px; box-shadow: var(--shadow); }
.account-menu__panel a, .link-button { display: block; width: 100%; padding: 10px; border: 0; text-align: left; text-decoration: none; color: inherit; background: transparent; border-radius: 8px; }
.account-menu__panel a:hover, .link-button:hover { background: var(--paper); }

.page-shell { width: min(1180px, calc(100% - 36px)); margin: 38px auto 70px; }
.page-header { display: flex; gap: 24px; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.page-header h1, .guest-card h1 { margin: 0 0 8px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.02; font-weight: 700; }
.page-header p, .guest-card > p { margin: 0; color: var(--muted); max-width: 720px; line-height: 1.55; }
.eyebrow { margin: 0 0 10px; color: var(--rust); text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 800; }

.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 24px; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 22px rgb(16 44 36 / 5%); }
.card h2, .card h3 { margin-top: 0; }
.card p { color: var(--muted); line-height: 1.55; }
.card__meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.empty-state { padding: 44px 24px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); background: rgb(255 255 255 / 40%); }
.empty-state p { color: var(--muted); }
.stat { min-height: 126px; }
.stat strong { display: block; font-size: 2rem; margin-bottom: 8px; }
.stat span { color: var(--muted); }

.button-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 17px; border: 1px solid transparent; border-radius: 12px; text-decoration: none; font-weight: 750; }
.button--primary { color: white; background: var(--green-850); }
.button--primary:hover { background: var(--green-700); }
.button--secondary { color: var(--green-950); background: transparent; border-color: var(--green-700); }
.button--danger { color: var(--rust); background: transparent; border-color: var(--rust); }
.button--small { min-height: 36px; padding: 7px 11px; font-size: .9rem; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #e8ece9; font-size: .8rem; font-weight: 750; }
.badge--active { background: var(--lime-soft); color: var(--green-950); }
.badge--warning { background: var(--rust-soft); color: var(--rust); }

.form-card { max-width: 760px; }
.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label { font-weight: 750; }
.field small { color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #bfc7c2; border-radius: 10px; }
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid rgb(184 217 54 / 30%); border-color: var(--green-700); }
.check-row { display: flex; align-items: flex-start; gap: 9px; }
.check-row input { margin-top: 4px; }

.notice { margin-bottom: 20px; padding: 14px 16px; border-radius: 12px; line-height: 1.45; }
.notice ul { margin-bottom: 0; }
.notice--success { background: var(--lime-soft); border-left: 4px solid var(--lime); }
.notice--warning, .notice--error { color: #692f1a; background: var(--rust-soft); border-left: 4px solid var(--rust); }

.table-wrap { overflow-x: auto; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
tr:last-child td { border-bottom: 0; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; }

.guest-page { display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at top left, #315f50 0, var(--green-950) 48%, #0a211b 100%); }
.guest-shell { width: min(500px, 100%); }
.brand--guest { margin: 0 auto 22px; width: max-content; color: white; }
.guest-card { padding: clamp(25px, 5vw, 45px); background: var(--paper-2); border-radius: 24px; box-shadow: 0 30px 80px rgb(0 0 0 / 25%); }
.guest-card h1 { font-size: clamp(2rem, 8vw, 3rem); }
.guest-card form { margin-top: 28px; }
.guest-card .button { width: 100%; }
.guest-links { display: flex; justify-content: center; margin-top: 18px; }
.guest-links a { color: var(--green-700); font-weight: 700; }
.guest-footer { margin: 18px 0 0; color: rgb(255 255 255 / 65%); text-align: center; font-size: .88rem; }
.role-options { display: grid; gap: 12px; margin: 25px 0; }
.role-option { display: flex; gap: 12px; align-items: center; padding: 16px; background: white; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.role-option:has(input:checked) { border-color: var(--green-700); box-shadow: 0 0 0 3px rgb(184 217 54 / 30%); }

.session-warning[hidden] { display: none; }
.session-warning { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgb(8 25 20 / 65%); }
.session-warning__card { width: min(520px, 100%); padding: 32px; background: var(--paper-2); border: 2px solid var(--rust); border-radius: 20px; box-shadow: var(--shadow); }

.pagination { margin-top: 22px; }

.wms-muted { color: var(--muted); font-size: .9rem; }
.wms-section-gap { margin-top: 24px; }
.wms-card-actions { margin-top: 20px; }
.wms-card-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; color: var(--muted); font-size: .85rem; }
.wms-assignment-card h2, .wms-monitor-card h2, .wms-version-card h2 { margin-bottom: 8px; }
.wms-monitor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.wms-assignment-form, .wms-assignment-list { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.wms-assignment-list p { margin: 7px 0; }
.code-field { min-height: 190px !important; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .86rem; line-height: 1.45; }
.code-field--large { min-height: 360px !important; }

.wms-workspace { overflow: hidden; margin-top: -10px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.wms-app-header { display: grid; grid-template-columns: 1fr auto; gap: 14px 24px; padding: 18px 22px 0; color: white; background: var(--green-850); }
.wms-app-brand strong, .wms-app-brand span, .wms-app-user span, .wms-app-user strong { display: block; }
.wms-app-brand strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-weight: 500; }
.wms-app-brand span { margin-top: 3px; color: var(--lime); font-size: .68rem; text-transform: uppercase; letter-spacing: .11em; }
.wms-app-user { text-align: right; }
.wms-app-user span { font-size: .84rem; }
.wms-app-user strong { margin-top: 3px; color: var(--lime); font-size: .7rem; }
.wms-macro-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wms-macro-nav a, .wms-macro-nav span { min-width: 0; padding: 12px 8px 11px; overflow: hidden; color: rgb(255 255 255 / 78%); border-bottom: 3px solid transparent; text-align: center; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; }
.wms-macro-nav .is-active { color: white; border-bottom-color: var(--lime); }
.wms-macro-nav span { opacity: .55; }
.wms-teacher-presence { display: flex; align-items: center; gap: 10px; padding: 11px 22px; color: #713821; background: var(--rust-soft); border-bottom: 1px solid #dfbcae; font-size: .84rem; }
.wms-teacher-presence[hidden] { display: none; }
.wms-presence-mark { width: 9px; height: 9px; flex: 0 0 auto; background: var(--rust); border-radius: 50%; box-shadow: 0 0 0 5px rgb(163 78 42 / 12%); }
.wms-context-bar { display: flex; justify-content: space-between; gap: 18px; padding: 14px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.wms-context-bar > div:last-child { text-align: right; }
.wms-context-bar strong, .wms-context-bar span { display: block; }
.wms-context-bar strong { font-size: .85rem; }
.wms-context-bar span { margin-top: 3px; color: var(--muted); font-size: .72rem; }
.wms-process { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; padding: 14px 22px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.wms-process-step span { display: block; height: 6px; background: #dcd7cb; border-radius: 5px; }
.wms-process-step small { display: block; margin-top: 6px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; }
.wms-process-step.is-current span { background: var(--rust); }
.wms-process-step.is-current small { color: var(--rust); font-weight: 800; }
.wms-process-step.is-complete span { background: var(--lime); }
.wms-process-step.is-complete small { color: var(--green-850); font-weight: 800; }
.wms-process-step.is-excluded span { background: #ebe7dc; opacity: .55; }
.wms-process-step.is-excluded small { color: var(--muted); opacity: .72; font-style: italic; }
.wms-workspace-body { padding: 24px; }
.wms-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin-bottom: 18px; }
.wms-page-head h1 { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1; }
.wms-page-head p:last-child { max-width: 720px; margin: 0; color: var(--muted); line-height: 1.5; }
.wms-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.wms-kpis > div { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; }
.wms-kpis strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.35rem; font-weight: 500; }
.wms-kpis span { color: var(--muted); font-size: .76rem; }
.wms-control-panel { display: grid; grid-template-columns: 1fr minmax(300px, .75fr); gap: 24px; align-items: start; margin-bottom: 18px; padding: 20px; color: #713821; background: var(--rust-soft); border: 1px solid #dfbcae; border-radius: 14px; }
.wms-control-panel h2 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; }
.wms-control-panel p:last-child { margin-bottom: 0; line-height: 1.5; }
.wms-control-form textarea { min-height: 86px; }
.wms-main-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 16px; }
.wms-next-action { position: relative; overflow: hidden; border-left: 6px solid var(--green-850); }
.wms-next-action::after { content: ""; position: absolute; top: -60px; right: -55px; width: 145px; height: 145px; border: 28px solid rgb(184 217 54 / 45%); border-radius: 50%; pointer-events: none; }
.wms-next-action h2 { position: relative; max-width: 530px; font-family: Georgia, "Times New Roman", serif; font-size: 1.7rem; }
.wms-next-action p { position: relative; max-width: 600px; padding-right: 48px; }
.wms-next-action form { position: relative; margin-top: 20px; }
.wms-phase-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.wms-phase-list li { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.wms-phase-list li:last-child { border-bottom: 0; }
.wms-phase-list li::before { content: counter(list-item); display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 auto; color: var(--muted); background: #ebe7dc; border-radius: 50%; font-size: .7rem; }
.wms-phase-list li span { flex: 1; font-weight: 700; font-size: .84rem; }
.wms-phase-list li small { color: var(--muted); }
.wms-phase-list li.is-current::before { color: white; background: var(--rust); }
.wms-phase-list li.is-current small { color: var(--rust); }
.wms-phase-list li.is-excluded { opacity: .68; }
.wms-phase-list li.is-excluded::before { content: "–"; }
.wms-snapshot { margin-top: 18px; padding: 18px; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; }
.wms-snapshot h2 { margin: 0 0 14px; font-size: 1.15rem; }
.wms-snapshot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 10px; }
.wms-snapshot-grid div { padding: 13px; background: var(--paper); }
.wms-snapshot-grid strong, .wms-snapshot-grid span { display: block; }
.wms-snapshot-grid span { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.wms-timeline { display: grid; gap: 12px; }
.wms-timeline-event { display: grid; grid-template-columns: 12px 1fr; gap: 10px; }
.wms-timeline-event > span { width: 10px; height: 10px; margin-top: 4px; background: var(--lime); border: 2px solid var(--green-850); border-radius: 50%; }
.wms-timeline-event strong, .wms-timeline-event small { display: block; }
.wms-timeline-event small { margin-top: 3px; color: var(--muted); }
.wms-observation-exit { display: flex; justify-content: flex-end; margin-top: 18px; }
.wms-operation-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 20px; }
.wms-operation-nav a { padding: 9px 13px; color: var(--green-850); border: 1px solid var(--green-700); border-radius: 999px; text-decoration: none; font-size: .82rem; font-weight: 750; }
.wms-operation-nav a.is-active { color: white; background: var(--green-850); }
.wms-lesson-callout { padding: 18px 20px; background: var(--lime-soft); border-left: 5px solid var(--lime); border-radius: 13px; }
.wms-lesson-callout strong, .wms-lesson-callout span { display: block; }
.wms-lesson-callout span { margin-top: 5px; color: var(--green-850); line-height: 1.5; }
.wms-quantity-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.wms-quantity-strip > div { padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.wms-quantity-strip strong, .wms-quantity-strip span { display: block; }
.wms-quantity-strip span { margin-top: 3px; color: var(--muted); font-size: .75rem; }
.wms-status-line { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wms-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wms-item-selector { display: grid; gap: 12px; }
.wms-item-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(110px, .6fr)) minmax(180px, 1fr); gap: 10px; align-items: end; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.wms-item-row .field { margin-bottom: 0; }
.wms-item-choice { display: flex; gap: 10px; align-items: center; align-self: center; }
.wms-item-choice small { display: block; margin-top: 3px; color: var(--muted); }
.wms-flow-arrow { color: var(--green-700); font-size: 1.4rem; }
.wms-task-card { border-left: 5px solid var(--green-850); }
.wms-task-card.is-exception { border-left-color: var(--rust); }
.wms-task-card.is-complete { border-left-color: var(--lime); }
.wms-capacity-meter { height: 7px; overflow: hidden; background: #dfdbd0; border-radius: 999px; }
.wms-capacity-meter span { display: block; height: 100%; background: var(--green-700); border-radius: inherit; }
.wms-readonly-fieldset { padding: 0; border: 0; }
.wms-readonly-fieldset:disabled { opacity: .68; }
.wms-correction-panel { margin-top: 18px; padding: 16px; background: var(--rust-soft); border: 1px solid #dfbcae; border-radius: 12px; }

.academy-content-head .badge { flex: 0 0 auto; }
.academy-content-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.academy-course-card { display: flex; flex-direction: column; min-height: 360px; }
.academy-course-card h2 { margin-bottom: 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.6rem; }
.academy-course-card .card__meta { margin: auto 0 18px; }
.academy-course-card .button { align-self: flex-start; }
.academy-course-overview { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .65fr); gap: 20px; align-items: start; }
.academy-course-main h2 { margin: 30px 0 14px; font-family: Georgia, "Times New Roman", serif; }
.academy-content-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--line); border: 1px solid var(--line); border-radius: 13px; }
.academy-content-facts div { padding: 17px; background: var(--paper); }
.academy-content-facts strong, .academy-content-facts span { display: block; }
.academy-content-facts strong { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
.academy-content-facts span { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.academy-content-list { display: grid; gap: 8px; padding-left: 22px; line-height: 1.55; }
.academy-unit-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.academy-unit-list li { display: flex; gap: 13px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.academy-unit-list span { display: grid; place-items: center; width: 30px; height: 30px; color: var(--green-950); background: var(--lime-soft); border-radius: 50%; font-size: .72rem; font-weight: 800; }
.academy-materials-card { position: sticky; top: 20px; border-top: 5px solid var(--lime); }
.academy-material-actions { display: grid; gap: 10px; margin-top: 22px; }
.academy-teacher-download { display: inline-block; color: var(--rust); font-weight: 750; }
.academy-private-note { color: var(--muted); font-size: .82rem; line-height: 1.45; }
.academy-test-form { display: grid; gap: 15px; }
.academy-question-card { margin: 0; padding-top: 20px; }
.academy-question-card legend { display: flex; gap: 12px; align-items: flex-start; width: 100%; padding: 0 8px; font-weight: 780; line-height: 1.45; }
.academy-question-card legend > span { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; color: white; background: var(--green-850); border-radius: 50%; }
.academy-answer-list { display: grid; gap: 8px; }
.academy-answer-list label { display: flex; gap: 11px; align-items: flex-start; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 11px; cursor: pointer; }
.academy-answer-list label:has(input:checked) { border-color: var(--green-700); box-shadow: 0 0 0 3px rgb(184 217 54 / 25%); }
.academy-answer-list input { margin-top: 5px; }
.academy-answer-list span { display: flex; gap: 9px; line-height: 1.45; }
.academy-answer-list strong { color: var(--rust); }
.academy-test-submit { position: sticky; bottom: 12px; z-index: 5; display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 15px 18px; color: white; background: var(--green-950); border-radius: 14px; box-shadow: var(--shadow); }
.academy-test-submit p { margin: 0; color: rgb(255 255 255 / 72%); font-size: .85rem; }
.academy-test-submit .button { color: var(--green-950); background: var(--lime); }
.academy-test-result { max-width: 780px; margin: 60px auto; text-align: center; }
.academy-test-result h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2rem, 5vw, 3.3rem); }
.academy-score-ring { display: grid; place-items: center; align-content: center; width: 170px; height: 170px; margin: 28px auto; color: var(--green-950); background: var(--lime-soft); border: 12px solid var(--lime); border-radius: 50%; }
.academy-score-ring strong { font-family: Georgia, "Times New Roman", serif; font-size: 3rem; line-height: 1; }
.academy-score-ring span { margin-top: 5px; }
.academy-test-result .button-row { justify-content: center; margin-top: 25px; }
.academy-solutions { display: grid; gap: 12px; }
.academy-solution-card { display: grid; grid-template-columns: 38px 1fr; gap: 14px; padding: 18px; border-left: 5px solid var(--rust); }
.academy-solution-card > span { display: grid; place-items: center; width: 34px; height: 34px; color: white; background: var(--rust); border-radius: 50%; font-weight: 800; }
.academy-solution-card h2 { margin: 0; font-size: 1rem; }
.academy-solution-card p { margin-bottom: 0; }

@media (max-width: 850px) {
    .wms-item-row { grid-template-columns: 1fr 1fr; }
    .wms-item-choice, .wms-item-row .field:last-child { grid-column: 1 / -1; }
}

@media (max-width: 850px) {
    .topbar { grid-template-columns: 1fr auto; }
    .main-nav { grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
    .grid--3, .grid--2 { grid-template-columns: 1fr; }
    .page-header { align-items: flex-start; flex-direction: column; }
    .wms-monitor-grid { grid-template-columns: 1fr 1fr; }
    .wms-control-panel, .wms-main-grid { grid-template-columns: 1fr; }
    .academy-content-grid { grid-template-columns: 1fr 1fr; }
    .academy-course-overview { grid-template-columns: 1fr; }
    .academy-materials-card { position: static; }
}

@media (max-width: 560px) {
    .guest-page { padding: 16px; }
    .topbar { gap: 12px; padding: 12px 16px; }
    .main-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
        overflow: visible;
    }
    .main-nav a {
        min-width: 0;
        padding: 9px 5px;
        text-align: center;
        line-height: 1.2;
    }
    .brand small { display: none; }
    .account-menu summary span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-shell { width: min(100% - 24px, 1180px); margin-top: 24px; }
    .card { padding: 19px; }
    .academy-content-grid { grid-template-columns: 1fr; }
    .academy-content-facts { grid-template-columns: 1fr; }
    .academy-test-submit { align-items: stretch; flex-direction: column; }
    th, td { padding: 12px; }
    .wms-monitor-grid { grid-template-columns: 1fr; }
    .wms-app-header { padding: 14px 14px 0; }
    .wms-macro-nav { overflow-x: auto; grid-template-columns: repeat(5, minmax(100px, 1fr)); }
    .wms-context-bar, .wms-page-head { align-items: flex-start; flex-direction: column; }
    .wms-context-bar > div:last-child { text-align: left; }
    .wms-process { padding-inline: 14px; gap: 4px; }
    .wms-process-step small { white-space: normal; font-size: .58rem; }
    .wms-workspace-body { padding: 16px; }
    .wms-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wms-kpis > div { display: block; padding: 9px; }
    .wms-kpis strong, .wms-kpis span { display: block; }
    .wms-kpis strong { font-size: 1rem; }
    .wms-kpis span { margin-top: 4px; font-size: .64rem; }
    .wms-snapshot-grid { grid-template-columns: 1fr; }
    .wms-form-grid, .wms-item-row { grid-template-columns: 1fr; }
    .wms-item-choice, .wms-item-row .field:last-child { grid-column: auto; }
    .wms-quantity-strip { grid-template-columns: 1fr; }
}
