:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-strong: #eef3f0;
    --ink: #111827;
    --muted: #667085;
    --line: #e4e7ec;
    --accent: #0f8a6c;
    --accent-2: #2563eb;
    --warn: #c05621;
    --shadow: 0 14px 40px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 1px 2px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, Segoe UI, Arial, sans-serif;
    text-rendering: geometricPrecision;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
select,
textarea,
button {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    min-height: 72px;
    padding: 0 28px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    min-width: 150px;
    color: #101828;
}

.brand > span:last-child {
    display: grid;
    gap: 2px;
    line-height: 1.05;
}

.brand small {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-width: 0;
}

.topnav {
    display: flex;
    gap: 8px;
}

.topnav a,
.admin-tabs a,
.secondary-btn {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.topnav a:hover,
.admin-tabs a:hover,
.secondary-btn:hover,
.logout-link:hover {
    border-color: #cbd5e1;
    background: #f9fafb;
    transform: translateY(-1px);
}

.user-chip {
    display: grid;
    justify-items: end;
    line-height: 1.2;
    min-width: 160px;
}

.user-chip span {
    font-weight: 700;
}

.user-chip small,
small {
    color: var(--muted);
}

.logout-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
    transition: background 140ms ease, transform 140ms ease;
}

.flash-stack {
    position: fixed;
    right: 20px;
    top: 78px;
    z-index: 20;
    display: grid;
    gap: 8px;
}

.flash {
    padding: 12px 14px;
    border-radius: 8px;
    background: #fff;
    border-left: 4px solid var(--accent-2);
    box-shadow: var(--shadow);
}

.flash.error {
    border-left-color: var(--warn);
}

.flash.success {
    border-left-color: var(--accent);
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 20%, rgba(15, 138, 108, 0.14), transparent 28%),
        radial-gradient(circle at 82% 78%, rgba(37, 99, 235, 0.12), transparent 30%),
        var(--bg);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(380px, 100%);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.login-form {
    display: grid;
    align-content: center;
    gap: 16px;
    min-height: 320px;
    padding: 32px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    box-shadow: var(--shadow-soft);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(15, 138, 108, 0.75);
    box-shadow: 0 0 0 4px rgba(15, 138, 108, 0.12);
}

textarea {
    resize: vertical;
}

.primary-btn,
.secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
}

.primary-btn {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 22px rgba(15, 138, 108, 0.18);
    transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.primary-btn:hover {
    background: #0b7359;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 138, 108, 0.22);
}

.app-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
    transition: grid-template-columns 180ms ease;
}

.app-layout.sidebar-collapsed {
    grid-template-columns: 58px minmax(0, 1fr);
}

.lesson-sidebar {
    position: relative;
    min-height: calc(100vh - 72px);
    overflow: visible;
    border-right: 1px solid var(--line);
    background: #101828;
    color: #e9efe9;
}

.lesson-sidebar-tools {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    padding: 10px 12px 8px;
    background: #101828;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-toggle {
    position: fixed;
    top: 86px;
    left: 322px;
    z-index: 9999;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: #175cd3;
    color: #f8fafc;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.22);
}

.sidebar-toggle:hover {
    background: #1849a9;
}

.sidebar-toggle-icon {
    width: 10px;
    height: 10px;
    border-left: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: translateX(2px) rotate(45deg);
}

.sidebar-collapsed .lesson-sidebar-tools {
    justify-content: center;
}

.sidebar-collapsed .sidebar-toggle {
    left: 40px;
}

.sidebar-collapsed .sidebar-toggle-icon {
    transform: translateX(-2px) rotate(225deg);
}

.sidebar-collapsed .lesson-sidebar-content {
    display: none;
}

.sidebar-collapsed .lesson-sidebar > :not(.lesson-sidebar-tools) {
    display: none;
}

.sidebar-collapsed .lesson-sidebar {
    min-width: 58px;
    max-width: 58px;
}

.sidebar-head {
    z-index: 3;
    display: grid;
    gap: 4px;
    padding: 20px 18px;
    background: #101828;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-head span {
    color: #9cac9f;
    font-size: 13px;
}

.sidebar-head strong {
    font-size: 24px;
}

.lesson-link {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transition: background 140ms ease, box-shadow 140ms ease;
    overflow-wrap: anywhere;
}

.lesson-link:hover,
.lesson-link.active {
    background: #1d2939;
}

.lesson-link.active {
    box-shadow: inset 4px 0 0 #22c55e;
}

.lesson-link time {
    color: #98a2b3;
    font-size: 12px;
    font-weight: 700;
}

.lesson-link strong {
    color: #f8fafc;
    font-size: 15px;
    line-height: 1.25;
}

.lesson-link small {
    color: #98a2b3;
    font-size: 12px;
    line-height: 1.25;
}

.workspace {
    display: grid;
    align-content: start;
    gap: 24px;
    padding: 28px;
}

.empty-workspace {
    min-height: calc(100vh - 72px);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 248, 251, 0.2)),
        var(--bg);
}

.workspace-head,
.admin-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.workspace-head h1,
.admin-head h1 {
    margin: 0;
    font-size: clamp(28px, 3.5vw, 44px);
    line-height: 1.02;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--accent);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 12px;
}

.term-pill,
.type-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #e7f6f1;
    color: #0b7359;
    font-weight: 800;
    font-size: 12px;
}

.type-badge.large {
    min-height: 40px;
    font-size: 14px;
}

.focus-panel,
.submission-panel,
.lesson-content,
.table-wrap,
.admin-form,
.edit-form,
.stats-grid > div {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.focus-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
}

.focus-panel h2,
.lesson-card h3,
.submission-panel h2,
.lesson-content h2,
.table-wrap h2 {
    margin: 0 0 8px;
}

.focus-panel p,
.lesson-card p,
.submission-panel p,
.lesson-content p {
    margin: 0;
    color: var(--muted);
}

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

.lesson-card {
    display: grid;
    gap: 12px;
    min-height: 164px;
    padding: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.lesson-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.lesson-workspace {
    padding-bottom: 48px;
}

.lesson-workspace .workspace-head h1 {
    font-size: clamp(22px, 2.2vw, 30px);
    line-height: 1.14;
}

.lesson-content {
    display: grid;
    gap: 24px;
    padding: 26px;
}

.lead {
    font-size: 18px;
}

.recipe-steps {
    display: grid;
    gap: 18px;
}

.step-row {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 16px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.step-number {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    background: #101828;
    color: #fff;
    border-radius: 50%;
    font-weight: 900;
}

.image-slot {
    display: grid;
    place-items: center;
    min-height: 190px;
    margin-top: 14px;
    background:
        linear-gradient(45deg, #f2f4f7 25%, transparent 25%),
        linear-gradient(-45deg, #f2f4f7 25%, transparent 25%),
        #fff;
    background-size: 22px 22px;
    border: 1px dashed #b7c7b9;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 800;
}

.simulation {
    display: grid;
    grid-template-columns: minmax(260px, 520px) 220px;
    gap: 22px;
}

.pc-case {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #253044;
    border: 12px solid #111827;
    border-radius: 8px;
}

.slot {
    position: absolute;
    display: grid;
    place-items: center;
    border: 2px dashed #7f9185;
    border-radius: 8px;
    color: #dbe5dd;
    font-weight: 800;
    text-align: center;
}

.slot.done {
    background: rgba(29, 211, 133, 0.22);
    border-style: solid;
    border-color: #1dd385;
}

.slot-board { left: 22%; top: 15%; width: 46%; height: 54%; }
.slot-ram { left: 72%; top: 18%; width: 16%; height: 42%; }
.slot-disk { left: 12%; bottom: 12%; width: 28%; height: 18%; }
.slot-psu { right: 9%; bottom: 10%; width: 24%; height: 22%; }
.slot-fan { left: 9%; top: 12%; width: 16%; height: 20%; border-radius: 50%; }

.component-tray {
    display: grid;
    align-content: start;
    gap: 10px;
}

.component {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.component.selected {
    border-color: var(--accent-2);
    background: #eff6ff;
}

.component.used {
    opacity: 0.45;
}

pre {
    overflow: auto;
    padding: 14px;
    background: #101828;
    color: #dce7df;
    border-radius: 8px;
}

.submission-panel {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 440px);
    gap: 20px;
    padding: 22px;
}

.upload-form {
    display: grid;
    gap: 10px;
}

.admin-shell {
    display: grid;
    gap: 22px;
    width: min(1180px, calc(100% - 40px));
    margin: 28px auto 56px;
}

.admin-shell.narrow {
    width: min(820px, calc(100% - 40px));
}

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

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stats-grid > div {
    display: grid;
    gap: 4px;
    padding: 20px;
}

.stats-grid span {
    font-size: 34px;
    font-weight: 900;
}

.admin-form,
.edit-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 18px;
}

.admin-form.compact {
    grid-template-columns: 2fr 1fr 1fr auto;
}

.lesson-form {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.lesson-form textarea,
.lesson-form input[name="allowed_extensions"],
.edit-form label,
.edit-form .checkbox-row {
    grid-column: 1 / -1;
}

.edit-form {
    grid-template-columns: 1fr;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input {
    width: auto;
    min-height: auto;
}

.table-wrap {
    overflow: auto;
    padding: 8px;
}

.table-wrap h2 {
    padding: 12px 14px 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    background: #f8fafc;
    font-weight: 900;
}

tbody tr {
    transition: background 120ms ease;
}

tbody tr:hover {
    background: #fbfcfd;
}

td small {
    display: block;
}

.row-title-link {
    color: var(--accent);
    font-weight: 900;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions a {
    color: var(--accent);
    font-weight: 800;
}

.lesson-status-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lesson-status-strip span,
.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 900;
}

.lesson-status-strip span {
    background: #eef2f6;
    color: var(--ink);
}

.status-badge.submitted {
    background: #e7f6f1;
    color: #0b7359;
}

.status-badge.missing {
    background: #fff1f0;
    color: #b42318;
}

.custom-lesson {
    display: grid;
    gap: 24px;
}

.lesson-hero {
    display: grid;
    gap: 8px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.lesson-hero h2 {
    margin: 0;
    font-size: 24px;
}

.lesson-hero p,
.lesson-card-list p {
    margin: 0;
    color: var(--muted);
}

.lesson-kicker {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.lesson-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.lesson-card-list article,
.ui-shot,
.code-task,
.pc-builder-game,
.pixel-admin-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.lesson-card-list article {
    display: grid;
    gap: 6px;
    padding: 16px;
}

.lesson-card-list h3 {
    margin: 0;
    font-size: 16px;
}

.ui-shot {
    margin-top: 12px;
    overflow: hidden;
}

.ui-shot figcaption {
    padding: 9px 12px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.fake-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
    background: #eef2f6;
}

.fake-ribbon span,
.fake-menu span {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid #cfd8e3;
    border-radius: 6px;
    background: #fff;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.fake-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
}

.fake-document,
.fake-slide,
.fake-sheet {
    min-height: 180px;
    margin: 14px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: linear-gradient(#fff, #fbfcfd);
}

.fake-document {
    padding: 22px;
}

.fake-line {
    height: 10px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: #d0d5dd;
}

.fake-line.short {
    width: 48%;
}

.fake-slide {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 18px;
    padding: 24px;
}

.fake-slide::before,
.fake-slide::after {
    content: "";
    border-radius: 8px;
    background: #dbeafe;
}

.fake-slide::after {
    background: #dcfce7;
}

.fake-sheet {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: 34px;
}

.fake-sheet span {
    border-right: 1px solid #e4e7ec;
    border-bottom: 1px solid #e4e7ec;
}

.code-task {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.code-task pre {
    margin: 0;
}

.pc-builder-game {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.pc-builder-grid {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 300px);
    gap: 18px;
}

.pc-builder-game .pc-case {
    min-height: 300px;
}

.pc-builder-score {
    color: var(--accent);
    font-weight: 900;
}

.pixel-admin-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
    gap: 18px;
    padding: 18px;
}

.pixel-admin-panel h2 {
    margin: 0 0 10px;
}

.pixel-result {
    min-height: 22px;
    color: var(--muted);
    font-weight: 800;
}

.pixel-page {
    max-width: 1600px;
}

.pixel-settings {
    grid-template-columns: repeat(5, minmax(160px, 1fr));
}

.pixel-console {
    display: grid;
    grid-template-columns: minmax(520px, 1fr) 360px;
    gap: 18px;
    margin-top: 18px;
}

.pixel-frame-shell,
.pixel-control-panel section {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.pixel-frame-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f8fafc;
}

.pixel-frame-toolbar strong {
    display: block;
    color: var(--text);
}

.pixel-frame-toolbar span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pixel-toolbar-actions,
.pixel-send-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

#pixel-frame {
    display: block;
    width: 100%;
    height: min(76vh, 760px);
    min-height: 520px;
    border: 0;
    background: #05070b;
}

.pixel-control-panel {
    display: grid;
    align-content: start;
    gap: 14px;
}

.pixel-control-panel section {
    padding: 16px;
}

.pixel-control-panel h2 {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 16px;
}

.pixel-control-panel textarea {
    width: 100%;
    resize: vertical;
}

.pixel-send-row {
    margin-top: 10px;
}

#pixel-char-count {
    margin-right: auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pixel-log {
    min-height: 160px;
    max-height: 280px;
    overflow: auto;
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #101828;
    color: #e5eefc;
    font-family: Consolas, ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
}

.pipeline-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.pipeline-list div {
    display: grid;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.pipeline-list dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.pipeline-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-family: Consolas, ui-monospace, monospace;
    font-size: 13px;
}

.inline-eval {
    display: grid;
    grid-template-columns: 1fr 90px auto;
    gap: 8px;
}

.inline-eval textarea {
    grid-column: 1 / -1;
}

.rich-lesson {
    display: grid;
    gap: 22px;
}

.compact-lesson-hero {
    padding-bottom: 6px;
}

.outcome-grid article {
    border-left: 3px solid var(--accent);
}

.lesson-step {
    align-items: start;
}

.step-copy {
    min-width: 0;
}

.ui-shot {
    overflow: hidden;
    margin: 16px 0 0;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.ui-shot figcaption {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.fake-ribbon span.active {
    border-color: var(--accent);
    background: #eef6ff;
    color: var(--accent-strong);
}

.excel-formula,
.editor-tabs,
.media-toolbar {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #fbfcfe;
    color: #344054;
    font-size: 12px;
    font-weight: 800;
}

.shot-grid {
    display: grid;
    grid-template-columns: 44px repeat(4, minmax(76px, 1fr));
    margin: 14px;
    border-top: 1px solid #d0d5dd;
    border-left: 1px solid #d0d5dd;
}

.shot-grid span {
    min-height: 34px;
    padding: 7px 8px;
    border-right: 1px solid #d0d5dd;
    border-bottom: 1px solid #d0d5dd;
    color: #344054;
    font-size: 12px;
    font-weight: 700;
}

.shot-grid span:nth-child(-n + 5) {
    background: #eef2f6;
    color: #101828;
}

.shot-chart {
    display: flex;
    align-items: end;
    gap: 10px;
    height: 112px;
    margin: 0 14px 14px;
    padding: 16px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: linear-gradient(#fff, #f8fafc);
}

.shot-chart i {
    flex: 1;
    border-radius: 5px 5px 0 0;
    background: var(--accent);
}

.ppt-stage {
    display: grid;
    grid-template-columns: 54px minmax(180px, 1fr) 150px;
    gap: 12px;
    padding: 14px;
}

.ppt-stage aside,
.ppt-stage section {
    display: grid;
    gap: 8px;
    align-content: start;
}

.ppt-stage b,
.ppt-stage section span {
    display: block;
    padding: 8px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #f8fafc;
    color: #344054;
    font-size: 12px;
}

.ppt-stage .fake-slide {
    margin: 0;
    min-height: 220px;
    grid-template-columns: 1fr 120px;
}

.ppt-stage .fake-slide h4,
.fake-document h4 {
    margin: 0 0 10px;
    color: #101828;
}

.ppt-stage .fake-slide p,
.fake-document p {
    margin: 0 0 12px;
    color: #475467;
}

.fake-document table {
    width: 100%;
    margin: 12px 0;
    border-collapse: collapse;
    font-size: 12px;
}

.fake-document th,
.fake-document td {
    padding: 6px;
    border: 1px solid #d0d5dd;
}

.fake-document ol {
    margin: 10px 0 12px 18px;
    color: #344054;
    font-size: 13px;
}

.fake-lines {
    display: grid;
    gap: 8px;
}

.fake-lines i {
    height: 9px;
    border-radius: 999px;
    background: #d0d5dd;
}

.fake-lines i.short {
    width: 52%;
}

.code-shot pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
    background: #101828;
    color: #e5eefc;
    font-size: 13px;
    line-height: 1.55;
}

.editor-tabs span {
    padding: 5px 9px;
    border: 1px solid #d0d5dd;
    border-radius: 5px;
    background: #ffffff;
}

.media-workspace {
    display: grid;
    grid-template-columns: 120px 1fr;
    min-height: 220px;
}

.media-workspace aside {
    padding: 14px;
    border-right: 1px solid #e5e7eb;
    background: #f8fafc;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
    line-height: 2;
}

.media-workspace main {
    display: grid;
    gap: 10px;
    align-content: center;
    padding: 20px;
}

.media-workspace main i {
    display: block;
    height: 34px;
    border-radius: 6px;
    background: linear-gradient(90deg, #60a5fa 0 38%, #22c55e 38% 70%, #f59e0b 70%);
}

.audio-shot .media-workspace main i {
    height: 26px;
    background: repeating-linear-gradient(90deg, #2563eb 0 8px, #93c5fd 8px 14px);
}

.image-shot .media-workspace main i {
    height: 48px;
    background: linear-gradient(135deg, #e0f2fe, #fde68a);
}

.network-map {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 20px;
}

.network-map span,
.part-grid span,
.concept-flow span {
    padding: 10px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    background: #f8fafc;
    color: #344054;
    font-size: 12px;
    font-weight: 900;
    text-align: center;
}

.network-map b {
    height: 2px;
    background: #98a2b3;
}

.part-grid,
.concept-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 20px 20px;
}

.concept-flow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 20px;
}

.lesson-checkout,
.lesson-spec-grid article {
    padding: 18px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
}

.lesson-checkout h2,
.lesson-spec-grid h3 {
    margin: 0 0 10px;
    color: #101828;
}

.lesson-checkout ul {
    margin: 0 0 12px 20px;
    color: #344054;
}

.lesson-checkout li {
    margin: 6px 0;
}

.lesson-spec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.year-plan-card,
.intro-teacher-note {
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.year-plan-head,
.intro-teacher-note {
    padding: 18px;
}

.year-plan-head {
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.year-plan-head h2,
.intro-teacher-note h2 {
    margin: 0 0 6px;
    color: #101828;
}

.year-plan-head p,
.intro-teacher-note p {
    margin: 0;
    color: #475467;
}

.year-plan-table-wrap {
    overflow-x: auto;
}

.year-plan-table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    font-size: 13px;
}

.year-plan-table th,
.year-plan-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.year-plan-table th {
    background: #ffffff;
    color: #475467;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.year-plan-table td:first-child,
.year-plan-table td:nth-child(2),
.year-plan-table td:nth-child(3) {
    white-space: nowrap;
    color: #475467;
    font-weight: 800;
}

.intro-lesson {
    display: grid;
    gap: 16px;
}

.intro-accordion {
    display: grid;
    gap: 12px;
}

.intro-item {
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.intro-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 18px;
    cursor: pointer;
    color: #101828;
    font-size: 17px;
    font-weight: 900;
    list-style: none;
}

.intro-item summary::-webkit-details-marker {
    display: none;
}

.intro-item summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid #d0d5dd;
    border-radius: 50%;
    color: #475467;
    font-weight: 900;
}

.intro-item[open] summary {
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.intro-item[open] summary::after {
    content: "-";
}

.intro-panel {
    display: grid;
    gap: 16px;
    padding: 18px;
}

.intro-panel p {
    max-width: 74ch;
    color: #344054;
    line-height: 1.55;
}

.intro-rules .rules-list,
.compact-task-list {
    margin: 0;
    padding-left: 22px;
    color: #344054;
    line-height: 1.58;
}

.intro-rules .rules-list li,
.compact-task-list li {
    margin: 8px 0;
}

.rules-footnote {
    padding-top: 4px;
    color: #667085;
    font-size: 13px;
}

.rules-text {
    margin: 0;
    padding: 18px;
    overflow-x: auto;
    white-space: pre-wrap;
    color: #344054;
    font: 14px/1.6 Inter, Segoe UI, Arial, sans-serif;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.inline-upload-form {
    max-width: 560px;
    padding-top: 2px;
}

.submission-state {
    padding: 12px 14px;
    background: #ecfdf3;
    border: 1px solid #abefc6;
    border-radius: 8px;
    color: #067647;
}

.word-soc-lesson {
    max-width: 1180px;
}

.word-gallery {
    display: grid;
    gap: 14px;
}

.word-gallery > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.word-gallery-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.word-gallery-tabs label {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

#word-theory-1:checked ~ .word-gallery-tabs label[for="word-theory-1"],
#word-theory-2:checked ~ .word-gallery-tabs label[for="word-theory-2"],
#word-theory-3:checked ~ .word-gallery-tabs label[for="word-theory-3"],
#word-theory-4:checked ~ .word-gallery-tabs label[for="word-theory-4"],
#word-theory-5:checked ~ .word-gallery-tabs label[for="word-theory-5"],
#word-theory-6:checked ~ .word-gallery-tabs label[for="word-theory-6"],
#word-theory-7:checked ~ .word-gallery-tabs label[for="word-theory-7"],
#g2-word-theory-1:checked ~ .word-gallery-tabs label[for="g2-word-theory-1"],
#g2-word-theory-2:checked ~ .word-gallery-tabs label[for="g2-word-theory-2"],
#g2-word-theory-3:checked ~ .word-gallery-tabs label[for="g2-word-theory-3"],
#g2-word-theory-4:checked ~ .word-gallery-tabs label[for="g2-word-theory-4"],
#g2-word-theory-5:checked ~ .word-gallery-tabs label[for="g2-word-theory-5"],
#g2-word-theory-6:checked ~ .word-gallery-tabs label[for="g2-word-theory-6"],
#g2-word-theory-7:checked ~ .word-gallery-tabs label[for="g2-word-theory-7"] {
    border-color: #175cd3;
    background: #eff8ff;
    color: #1849a9;
}

.word-gallery-slides {
    min-width: 0;
}

.word-gallery-slide {
    display: none;
    margin: 0;
}

#word-theory-1:checked ~ .word-gallery-slides .slide-1,
#word-theory-2:checked ~ .word-gallery-slides .slide-2,
#word-theory-3:checked ~ .word-gallery-slides .slide-3,
#word-theory-4:checked ~ .word-gallery-slides .slide-4,
#word-theory-5:checked ~ .word-gallery-slides .slide-5,
#word-theory-6:checked ~ .word-gallery-slides .slide-6,
#word-theory-7:checked ~ .word-gallery-slides .slide-7,
#g2-word-theory-1:checked ~ .word-gallery-slides .slide-1,
#g2-word-theory-2:checked ~ .word-gallery-slides .slide-2,
#g2-word-theory-3:checked ~ .word-gallery-slides .slide-3,
#g2-word-theory-4:checked ~ .word-gallery-slides .slide-4,
#g2-word-theory-5:checked ~ .word-gallery-slides .slide-5,
#g2-word-theory-6:checked ~ .word-gallery-slides .slide-6,
#g2-word-theory-7:checked ~ .word-gallery-slides .slide-7 {
    display: grid;
    gap: 14px;
}

.word-gallery-slide img,
.soc-title-preview img,
.margin-reference-grid img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #ffffff;
}

.word-gallery-slide figcaption,
.soc-title-preview figcaption,
.margin-reference-grid figcaption {
    color: #475467;
    font-size: 13px;
}

.word-gallery-slide .compact-task-list {
    max-width: 86ch;
}

.soc-title-layout {
    display: grid;
    grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.soc-title-preview,
.margin-reference-grid figure {
    display: grid;
    gap: 8px;
    margin: 0;
}

.soc-title-preview img {
    max-height: 720px;
    object-fit: contain;
}

.soc-steps {
    margin-top: 0;
}

.soc-title-workbench {
    display: grid;
    grid-template-columns: minmax(230px, 310px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.soc-title-hints {
    position: sticky;
    top: 82px;
    padding: 14px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
}

.soc-title-hints ol {
    display: grid;
    gap: 9px;
    margin: 0;
    padding-left: 18px;
    color: #475467;
    font-size: 12px;
    line-height: 1.45;
}

.soc-title-hints li {
    position: relative;
    padding-right: 18px;
}

.soc-title-hints li::after {
    content: "->";
    position: absolute;
    top: 0;
    right: 0;
    color: #175cd3;
    font-weight: 900;
}

.soc-title-preview-large {
    justify-items: center;
}

.soc-title-preview-large img {
    width: min(100%, 760px);
    max-height: none;
}

.margin-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.margin-reference-clean {
    margin-top: 18px;
}

.soc-margin-section {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.soc-margin-section h2 {
    margin: 0;
    color: #101828;
    font-size: 20px;
    line-height: 1.2;
}

.edupage-checkout {
    margin-top: 0;
}

.word-practice-lesson {
    max-width: 1280px;
}

.formatting-workbench {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.formatting-hints {
    position: sticky;
    top: 82px;
    padding: 14px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
}

.formatting-hints ol {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #475467;
    font-size: 12px;
    line-height: 1.45;
}

.formatting-hints li {
    position: relative;
    padding-right: 18px;
}

.formatting-hints li::after {
    content: "->";
    position: absolute;
    top: 0;
    right: 0;
    color: #175cd3;
    font-weight: 900;
}

.word-document-shell {
    overflow: hidden;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #eef2f7;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.word-ribbon-mini {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    border-bottom: 1px solid #d8dee8;
    background: #ffffff;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.word-ribbon-mini span {
    padding: 5px 8px;
    border-radius: 6px;
}

.word-ribbon-mini .active {
    background: #eff8ff;
    color: #175cd3;
}

.word-page-a3 {
    width: min(100%, 860px);
    min-height: 620px;
    margin: 18px auto;
    padding: clamp(24px, 5vw, 54px);
    background: #ffffff;
    border: 1px solid #d0d5dd;
    color: #101828;
    font-family: Calibri, "Segoe UI", Arial, sans-serif;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.word-page-a3 h2 {
    margin: 0;
    text-align: center;
    color: #1849a9;
    font-family: "Times New Roman", Times, serif;
    font-size: 28px;
    line-height: 1.15;
}

.doc-meta,
.doc-right {
    margin: 0 0 18px;
    text-align: right;
    color: #667085;
    font-size: 12px;
}

.doc-subtitle {
    margin: 8px 0 18px;
    text-align: center;
    color: #067647;
    font-size: 18px;
    font-style: italic;
    text-decoration: underline;
}

.doc-justify {
    text-align: justify;
    font-size: 15px;
    line-height: 1.58;
}

.doc-red {
    color: #b42318;
    font-weight: 800;
}

.doc-blue {
    color: #175cd3;
    background: #d1e9ff;
    font-weight: 800;
}

.doc-numbered {
    display: grid;
    gap: 6px;
    margin: 18px 0;
    padding-left: 24px;
    font-size: 15px;
}

.doc-image-row {
    display: grid;
    grid-template-columns: minmax(180px, 280px) 1fr;
    gap: 16px;
    align-items: center;
    margin: 18px 0;
}

.inserted-chart {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 12px;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #f8fafc;
}

.inserted-chart figcaption {
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.chart-bars {
    display: flex;
    align-items: end;
    gap: 12px;
    height: 120px;
    padding: 10px;
    border-left: 2px solid #98a2b3;
    border-bottom: 2px solid #98a2b3;
}

.chart-bars span {
    width: 42px;
    background: linear-gradient(180deg, #2e90fa, #12b76a);
    border-radius: 5px 5px 0 0;
}

.inserted-chart small {
    color: #667085;
    font-size: 11px;
}

.doc-small {
    color: #344054;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

.doc-center {
    text-align: center;
    color: #7a2e0e;
    font-size: 16px;
    font-weight: 800;
}

.doc-equations {
    margin: 18px 0;
    padding: 12px 14px;
    border-left: 4px solid #175cd3;
    background: #eff8ff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 15px;
}

.doc-equations p {
    margin: 5px 0;
}

.formatting-lead {
    margin: 0 0 14px;
    max-width: 72ch;
    color: #344054;
    font-size: 0.98rem;
    font-weight: 800;
}

.formatting-target-image {
    margin: 0;
}

.formatting-target-image img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
    user-select: none;
}

.asset-downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.download-card {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 8px;
    background: #175cd3;
    color: #fff;
    font-weight: 900;
    text-decoration: none;
}

.download-card:hover {
    background: #1849a9;
}

.formatting-reference-section {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e4e7ec;
}

.formatting-reference-section h2 {
    margin: 0 0 12px;
    color: #101828;
    font-size: 1rem;
}

.formatting-reference-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.formatting-reference-grid figure {
    margin: 0;
}

.formatting-reference-grid img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #d8dee8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.doc-left {
    text-align: left;
    font-size: 14px;
}

.doc-left a {
    color: #175cd3;
    font-weight: 800;
}

main img:not(.no-zoom) {
    cursor: zoom-in;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(12, 18, 32, 0.86);
}

.image-lightbox.open {
    display: flex;
}

.image-lightbox img {
    max-width: min(96vw, 1500px);
    max-height: 92vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
    cursor: zoom-out;
}

.image-lightbox button {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
}

@media (max-width: 900px) {
    .topbar {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 12px 16px;
    }

    .topbar-actions {
        align-items: flex-start;
        flex-direction: column;
        width: 100%;
    }

    .topnav {
        flex-wrap: wrap;
    }

    .user-chip {
        justify-items: start;
    }

    .app-layout {
        grid-template-columns: 1fr;
    }

    .app-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .app-layout.sidebar-collapsed .lesson-sidebar {
        min-height: 56px;
        max-height: 56px;
    }

    .sidebar-toggle,
    .sidebar-collapsed .sidebar-toggle {
        position: absolute;
        top: 10px;
        right: 12px;
        left: auto;
    }

    .simulation,
    .submission-panel,
    .pc-builder-grid,
    .pixel-admin-panel,
    .pixel-console,
    .pixel-settings {
        grid-template-columns: 1fr;
    }

    #pixel-frame {
        min-height: 420px;
        height: 64vh;
    }

    .lesson-sidebar {
        min-height: auto;
        max-height: none;
    }

    .workspace {
        padding: 18px;
    }

    .workspace-head,
    .admin-head,
    .focus-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-actions {
        justify-content: flex-start;
    }

    .stats-grid,
    .admin-form,
    .admin-form.compact,
    .lesson-form {
        grid-template-columns: 1fr;
    }

    .login-form {
        min-height: auto;
        padding: 28px;
    }

    .ppt-stage,
    .media-workspace,
    .lesson-spec-grid {
        grid-template-columns: 1fr;
    }

    .network-map,
    .part-grid,
    .concept-flow,
    .soc-title-layout,
    .soc-title-workbench,
    .margin-reference-grid,
    .formatting-reference-grid,
    .formatting-workbench,
    .doc-image-row {
        grid-template-columns: 1fr;
    }

    .formatting-hints,
    .soc-title-hints {
        position: static;
    }

    .network-map b {
        min-height: 16px;
        width: 2px;
        justify-self: center;
    }
}
