:root {
      color-scheme: light;
      --ink: #14243c;
      --muted: #4c5d70;
      --soft: #687789;
      --navy: #11213b;
      --blue: #254ebe;
      --blue-dark: #183b9d;
      --cyan: #82e3eb;
      --paper: #f4f7fb;
      --white: #ffffff;
      --line: #dce3eb;
      --line-strong: #cbd5e0;
      --focus: #a34a00;
      --danger: #a52b36;
      --radius: 19px;
      font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      font-size: 16px;
    }
    *, *::before, *::after { box-sizing: border-box; }
    html { scroll-behavior: smooth; }
    body { margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55; }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    a { color: var(--blue-dark); }
    :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
    .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
    .skip { position: fixed; top: .6rem; left: .6rem; z-index: 100; transform: translateY(-180%); background: #fff; color: var(--ink); padding: .7rem 1rem; border-radius: .6rem; font-weight: 700; }
    .skip:focus { transform: none; }
    .topbar { background: var(--navy); color: #fff; }
    .teacher-picker { background: #eaf0fb; border-bottom: 1px solid #cbd5e0; }
    .teacher-picker-inner { max-width: 1420px; margin: auto; padding: .55rem clamp(1rem, 3vw, 2.5rem); display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; font-size: .86rem; }
    .teacher-picker-inner > strong { color: var(--navy); }
    .teacher-picker-links { display: flex; flex-wrap: wrap; gap: .45rem; }
    .teacher-picker-links a, .teacher-picker-current { display: inline-flex; align-items: center; min-height: 44px; padding: .48rem .8rem; border-radius: .65rem; border: 1px solid #b2c4e0; background: #fff; font-weight: 740; text-decoration: none; }
    .teacher-picker-links a:hover { background: #f7faff; border-color: var(--blue); }
    .teacher-picker-current { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
    .topbar-inner { max-width: 1420px; min-height: 78px; margin: auto; padding: .75rem clamp(1rem, 3vw, 2.5rem); display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
    .brand { display: flex; align-items: center; gap: .8rem; min-width: 0; }
    .brand-mark { width: 42px; height: 42px; border: 1px solid #aac0dd; border-radius: 12px; display: grid; place-items: center; font-weight: 800; letter-spacing: -.08em; color: var(--cyan); flex: none; }
    .brand-name { font-size: 1rem; font-weight: 760; letter-spacing: -.015em; line-height: 1.22; }
    .brand-sub { font-size: .79rem; color: #bac9db; line-height: 1.3; }
    .edit-trigger { background: #fff; color: var(--navy); border: 1px solid #fff; border-radius: .7rem; min-height: 44px; padding: .55rem .9rem; font-size: .9rem; font-weight: 730; white-space: nowrap; }
    .edit-trigger:hover { background: #e8f2ff; }
    .page { max-width: 1420px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); display: grid; grid-template-columns: 235px minmax(0,1fr); gap: clamp(1.2rem, 2.6vw, 2.5rem); align-items: start; }
    .rail { padding-top: .2rem; }
    .rail-label { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; margin: .2rem .75rem 1rem; }
    .class-nav { display: grid; gap: .35rem; }
    .class-button { width: 100%; min-height: 58px; background: transparent; color: var(--ink); border: 1px solid transparent; border-radius: 13px; display: flex; align-items: center; justify-content: space-between; gap: .7rem; text-align: left; padding: .7rem .85rem; }
    .class-button:hover { background: #e7edf5; }
    .class-button[aria-current="page"] { background: #fff; border-color: var(--line); box-shadow: 0 3px 12px rgba(17,33,59,.06); }
    .class-button strong { font-size: 1.08rem; letter-spacing: -.015em; }
    .class-button small { color: var(--muted); font-size: .77rem; white-space: nowrap; }
    .class-button[aria-current="page"]::before { content: ""; width: 4px; height: 26px; background: var(--blue); border-radius: 4px; margin-left: -.4rem; }
    .rail-note { margin: 1.6rem .75rem 0; border-top: 1px solid var(--line-strong); padding-top: 1.1rem; color: var(--muted); font-size: .85rem; }
    .main { min-width: 0; }
    .hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 23px; padding: clamp(1.4rem, 3vw, 2.3rem); min-height: 194px; }
    .hero::after { content: ""; position: absolute; width: 370px; height: 370px; right: -100px; top: -225px; border: 64px solid rgba(130,227,235,.12); border-radius: 50%; pointer-events: none; }
    .eyebrow { margin: 0 0 .75rem; text-transform: uppercase; color: var(--cyan); letter-spacing: .16em; font-size: .76rem; font-weight: 850; }
    h1, h2, h3, p { margin-top: 0; }
    .hero h1 { max-width: 700px; margin: 0; font-size: clamp(1.75rem, 3.2vw, 2.75rem); line-height: 1.15; letter-spacing: -.045em; }
    .hero-bottom { display: flex; gap: 1rem 1.6rem; flex-wrap: wrap; margin-top: 1.55rem; color: #deebf7; font-size: .91rem; }
    .hero-bottom strong { color: #fff; font-size: 1rem; }
    .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin: 2rem 0 .9rem; }
    .section-heading h2 { font-size: 1.22rem; letter-spacing: -.025em; margin: 0; }
    .section-heading span { color: var(--muted); font-size: .86rem; }
    .subject-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: .75rem; }
    .subject-card { position: relative; background: #fff; border: 1px solid var(--line); color: var(--ink); border-radius: var(--radius); text-align: left; padding: 1.1rem 1.2rem; min-height: 158px; display: flex; flex-direction: column; align-items: flex-start; box-shadow: 0 1px 2px rgba(17,33,59,.025); }
    .subject-card:hover { border-color: #879ed2; transform: translateY(-1px); }
    .subject-card[aria-current="page"] { border: 2px solid var(--blue); padding: calc(1.1rem - 1px) calc(1.2rem - 1px); box-shadow: 0 5px 17px rgba(37,78,190,.09); }
    .subject-number { color: var(--blue); font-size: .79rem; letter-spacing: .08em; font-weight: 850; }
    .subject-title { display: block; margin: .75rem 0 .8rem; font-size: 1rem; font-weight: 780; line-height: 1.32; letter-spacing: -.02em; overflow-wrap: anywhere; }
    .subject-count { margin-top: auto; color: var(--muted); font-size: .82rem; }
    .subject-arrow { position: absolute; right: 1.1rem; top: 1.04rem; font-size: 1.15rem; line-height: 1; color: var(--blue); }
    .workspace { margin-top: 1.9rem; }
    .workspace-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
    .workspace-head .overline { color: var(--blue-dark); font-size: .77rem; letter-spacing: .12em; font-weight: 840; text-transform: uppercase; margin: 0 0 .35rem; }
    .workspace-head h2 { font-size: clamp(1.3rem, 2.1vw, 1.8rem); letter-spacing: -.035em; margin: 0; line-height: 1.24; }
    .search-wrap { display: flex; align-items: center; gap: .6rem; border: 1px solid var(--line-strong); background: #fff; border-radius: .75rem; padding: 0 .85rem; min-height: 46px; width: min(100%, 300px); }
    .search-wrap:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
    .search-wrap svg { flex: none; color: var(--muted); }
    .search-wrap input { min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: var(--ink); font-size: .9rem; }
    .search-wrap input::placeholder { color: #58687b; opacity: 1; }
    .results-status { min-height: 1.25rem; color: var(--muted); font-size: .85rem; margin: 0 0 .55rem; }
    .columns { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
    .panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
    .panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line); }
    .panel-heading h3 { font-size: 1.05rem; margin: 0; letter-spacing: -.02em; }
    .count-pill { color: var(--blue-dark); background: #eaf0ff; border-radius: 99px; padding: .15rem .6rem; font-weight: 800; font-size: .8rem; }
    .entry-list { padding: .25rem 1.15rem; }
    .entry { padding: 1.12rem .1rem 1.2rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
    .entry:last-child { border-bottom: 0; }
    .entry-title { font-weight: 780; font-size: 1rem; line-height: 1.35; margin: 0 0 .45rem; }
    .entry-description { color: var(--muted); font-size: .9rem; white-space: pre-line; margin: 0 0 .65rem; }
    .entry-meta { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 .7rem; }
    .due { display: inline-flex; border-radius: .45rem; background: #eaf0ff; color: #173779; padding: .18rem .5rem; font-size: .8rem; font-weight: 760; }
    .due.overdue { background: #ffebed; color: #932531; }
    .due.today { background: #fff1db; color: #744000; }
    .entry-link { font-size: .89rem; font-weight: 750; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
    .empty { padding: 1.35rem 1.15rem 1.6rem; }
    .empty strong { display: block; margin-bottom: .35rem; font-size: .94rem; }
    .empty p { color: var(--muted); font-size: .87rem; margin: 0; }
    .empty-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 10px; background: #edf3ff; color: var(--blue-dark); font-size: 1.2rem; margin-bottom: .9rem; }
    .footer { max-width: 1420px; margin: .7rem auto 0; padding: 1.4rem clamp(1rem, 3vw, 2.5rem) 2rem; color: var(--muted); border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; }
    .footer p { margin: 0; }
    dialog { border: 0; border-radius: 20px; width: min(95vw, 670px); max-height: min(90vh, 950px); padding: 0; color: var(--ink); background: var(--white); box-shadow: 0 24px 90px rgba(11,26,47,.25); }
    dialog::backdrop { background: rgba(8,22,41,.66); }
    .dialog-inner { padding: clamp(1.2rem, 3vw, 2rem); }
    .dialog-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
    .dialog-top h2 { margin: 0 0 .35rem; font-size: 1.55rem; letter-spacing: -.035em; }
    .dialog-close { min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); background: #fff; border-radius: .7rem; color: var(--ink); font-size: 1.4rem; line-height: 1; }
    .dialog-close:hover { background: var(--paper); }
    .editor-intro { color: var(--muted); font-size: .89rem; margin: .35rem 0 1.2rem; }
    .editor-info { background: #edf3ff; border-left: 4px solid var(--blue); padding: .8rem .9rem; border-radius: 0 .55rem .55rem 0; color: #19345b; font-size: .86rem; margin-bottom: 1.35rem; }
    .editor-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .85rem; }
    .field { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
    .field.full { grid-column: 1 / -1; }
    .field label { font-size: .9rem; font-weight: 780; }
    .field input, .field textarea, .field select { width: 100%; min-height: 44px; border: 1px solid #acb9c8; background: #fff; border-radius: .6rem; color: var(--ink); padding: .58rem .7rem; }
    .field textarea { resize: vertical; min-height: 82px; }
    .field small { color: var(--muted); font-size: .77rem; }
    .actions { display: flex; gap: .6rem; flex-wrap: wrap; grid-column: 1/-1; margin-top: .25rem; }
    .button { min-height: 44px; border-radius: .65rem; border: 1px solid var(--line-strong); padding: .58rem .9rem; background: #fff; color: var(--ink); font-size: .88rem; font-weight: 760; }
    .button:hover { background: #edf3ff; }
    .button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
    .button.primary:hover { background: var(--blue-dark); }
    .button.danger { color: var(--danger); }
    .editor-bottom { margin-top: 1.4rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
    .editor-bottom h3 { font-size: 1.03rem; margin: 0 0 .6rem; }
    .editor-entries { list-style: none; padding: 0; margin: 0 0 1rem; max-height: 190px; overflow: auto; }
    .editor-entries li { display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .58rem 0; border-bottom: 1px solid var(--line); }
    .editor-entries li:last-child { border: 0; }
    .editor-entries .item-name { font-size: .86rem; font-weight: 680; overflow-wrap: anywhere; }
    .editor-entries .item-type { display: block; color: var(--muted); font-size: .76rem; font-weight: 450; }
    .editor-entries .item-buttons { flex: none; display: flex; gap: .3rem; }
    .editor-entries button { min-height: 40px; border: 1px solid var(--line-strong); background: #fff; border-radius: .5rem; color: var(--blue-dark); padding: .35rem .5rem; font-size: .79rem; font-weight: 730; }
    .editor-entries button.delete { color: var(--danger); }
    .editor-empty { color: var(--muted); font-size: .85rem; margin: .4rem 0 1rem; }
    .export-row { display: flex; align-items: center; flex-wrap: wrap; gap: .7rem 1rem; background: var(--paper); border: 1px solid var(--line); padding: .9rem; border-radius: .8rem; }
    .export-row p { margin: 0; color: var(--muted); font-size: .81rem; flex: 1 1 200px; }
    .toast { position: fixed; z-index: 50; right: 1rem; bottom: 1rem; max-width: min(420px, calc(100% - 2rem)); background: var(--navy); color: #fff; padding: .8rem 1rem; border-radius: .75rem; box-shadow: 0 10px 28px rgba(17,33,59,.24); font-size: .87rem; }
    /* Panel nauczyciela — czytelny formularz wpisu */
    .entry-form-intro { color: var(--muted); font-size: .9rem; margin-bottom: 1.1rem; }
    .entry-form { gap: .9rem; }
    .entry-form-step { display: flex; gap: .7rem; align-items: center; border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .25rem; }
    .entry-form-step h3, .entry-form-step p { margin: 0; }
    .entry-form-step h3 { font-size: 1rem; }
    .entry-form-step p { color: var(--muted); font-size: .81rem; }
    .entry-step-number { flex: none; width: 2rem; height: 2rem; border-radius: .65rem; display: grid; place-items: center; color: #fff; background: var(--blue-dark); font-weight: 800; }
    .entry-form-group { border: 1px solid var(--line-strong); border-radius: .8rem; background: #fff; overflow: hidden; }
    .entry-form-group[open] { border-color: #9aaed6; box-shadow: 0 3px 14px rgba(17,33,59,.05); }
    .entry-form-group > summary { display: flex; flex-direction: column; gap: .05rem; padding: .85rem 2.5rem .85rem 1rem; min-height: 58px; position: relative; cursor: pointer; list-style: none; }
    .entry-form-group > summary::-webkit-details-marker { display: none; }
    .entry-form-group > summary::after { content: '+'; position: absolute; right: 1rem; top: .75rem; font-size: 1.25rem; font-weight: 700; color: var(--blue-dark); }
    .entry-form-group[open] > summary::after { content: '−'; }
    .entry-form-group > summary:hover { background: #f3f7ff; }
    .entry-form-group > summary span { font-weight: 780; }
    .entry-form-group > summary small, .entry-group-body > .submission-options > small { color: var(--muted); font-size: .78rem; }
    .entry-group-body { border-top: 1px solid var(--line); background: #fbfcff; padding: 1rem; display: grid; gap: .85rem; }
    .entry-group-body .submission-options { margin: 0; }
    .entry-form > .actions { border-top: 1px solid var(--line); padding-top: 1rem; margin-top: .25rem; }
    @media (max-width: 520px) { .entry-group-body { padding: .8rem; } }
    .toast[hidden], [hidden] { display: none !important; }
    @media (max-width: 1050px) { .subject-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .page { grid-template-columns: 190px minmax(0,1fr); } }
    @media (max-width: 780px) { .page { display: block; } .rail { padding: 0; margin-bottom: 1.1rem; } .rail-label { margin: .1rem 0 .55rem; } .class-nav { display: flex; overflow-x: auto; padding-bottom: .2rem; gap: .55rem; } .class-button { width: auto; min-width: 96px; min-height: 46px; padding: .55rem .75rem; gap: .5rem; flex: none; justify-content: center; } .class-button[aria-current="page"]::before, .class-button small, .rail-note { display: none; } .hero { min-height: auto; } }
    @media (max-width: 590px) { .brand-sub { display: none; } .topbar-inner { min-height: 68px; } .edit-trigger { padding: .5rem .62rem; font-size: .8rem; } .brand-name { font-size: .9rem; } .brand-mark { width: 36px; height: 36px; } .hero { border-radius: 17px; } .subject-grid, .columns { grid-template-columns: minmax(0,1fr); } .subject-card { min-height: 119px; } .workspace-head { align-items: stretch; gap: .85rem; } .search-wrap { width: 100%; } .editor-form { grid-template-columns: minmax(0,1fr); } .field { grid-column: 1 / -1; } .dialog-inner { padding: 1.1rem; } .footer { margin-top: 1.2rem; } }
    @media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .subject-card { transform: none !important; } }
    .class-button, .subject-card, a.edit-trigger, a.button { text-decoration: none; }
    .search-wrap { width: min(100%, 410px); }
    .search-button { border: 0; border-radius: .5rem; padding: .38rem .55rem; background: var(--blue); color: #fff; font-size: .82rem; font-weight: 750; }
    .search-button:hover { background: var(--blue-dark); }
    .entry-link { display: block; margin-top: .55rem; }
    .entry-link.entry-link-game { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .55rem .9rem; border-radius: .65rem; background: var(--blue-dark); color: #fff; text-decoration: none; }
    .entry-link.entry-link-game:hover { background: var(--navy); }
    .results-status { margin: .1rem 0 .8rem; }

    .pdf-page { max-width: 1150px; margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.5rem); }
    .pdf-path { color: var(--blue-dark); font-size: .85rem; font-weight: 760; margin-bottom: .5rem; }
    .pdf-page h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); line-height: 1.2; margin-bottom: .45rem; overflow-wrap: anywhere; }
    .pdf-name { color: var(--muted); overflow-wrap: anywhere; margin-bottom: 1rem; }
    .pdf-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: .75rem; }
    .pdf-actions .button { display: inline-flex; align-items: center; text-decoration: none; }
    .pdf-hint { color: var(--muted); font-size: .9rem; }
    .pdf-frame { display: block; width: 100%; height: min(75vh, 1000px); min-height: 420px; background: #fff; border: 1px solid var(--line-strong); border-radius: .8rem; }

    .admin-main { max-width: 1420px; margin: 0 auto; padding: clamp(1.2rem, 3vw, 2.5rem); }
    .admin-main h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.04em; margin: 0 0 .55rem; }
    .admin-main h2 { font-size: 1.2rem; letter-spacing: -.025em; margin: 0 0 1.1rem; }
    .admin-main .overline { color: var(--blue-dark); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 800; margin-bottom: .3rem; }
    .admin-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.1rem, 2vw, 1.7rem); min-width: 0; }
    .login-card { max-width: 470px; margin: clamp(1rem, 6vh, 4rem) auto; }
    .login-card p { color: var(--muted); }
    .login-card .field { margin: 1rem 0; }
    .admin-head { display: flex; gap: 1rem; justify-content: space-between; align-items: start; flex-wrap: wrap; margin-bottom: 1.4rem; }
    .admin-head p:not(.overline) { color: var(--muted); margin: 0; }
    .admin-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: start; gap: 1rem; }
    .admin-form { display: grid; gap: .9rem; }
    .admin-form .field input, .admin-form .field textarea, .admin-form .field select { max-width: 100%; }
    .admin-form .field input[type=file] { padding: .6rem; }
    .admin-form .field input[type=file]::file-selector-button { margin-right: .7rem; padding: .38rem .6rem; border: 1px solid var(--line-strong); border-radius: .45rem; background: var(--paper); color: var(--ink); font: inherit; font-size: .82rem; }
    .admin-form .actions { margin-top: .3rem; align-items: center; }
    .teacher-create-card { margin-bottom: 1.2rem; }
    .teacher-create-form { max-width: 700px; }
    .teacher-slug-input { display: flex; align-items: center; gap: .45rem; }
    .teacher-slug-input input { min-width: 0; }
    .teacher-slug-input span { white-space: nowrap; font-weight: 750; }
    .form-alert, .form-success { padding: .78rem .95rem; border-radius: .7rem; margin: 0 0 1rem; font-weight: 680; }
    .form-alert { background: #ffebed; color: #7f1d27; border: 1px solid #f0a8af; }
    .form-success { background: #e8f7ee; color: #15512f; border: 1px solid #99d7ad; }
    .attached { margin: .1rem 0 0; font-size: .86rem; overflow-wrap: anywhere; }
    .check-row { display: flex; align-items: start; gap: .6rem; font-size: .86rem; }
    .check-row input { width: 19px; height: 19px; flex: none; }
    .admin-list { list-style: none; margin: 0; padding: 0; }
    .admin-item { padding: .9rem 0; display: flex; justify-content: space-between; align-items: center; gap: .8rem; border-bottom: 1px solid var(--line); }
    .admin-item:last-child { border-bottom: 0; }
    .admin-item strong { display: block; overflow-wrap: anywhere; line-height: 1.35; }
    .admin-item span:not(.sr-only) { display: block; color: var(--muted); font-size: .82rem; margin-top: .25rem; overflow-wrap: anywhere; }
    .item-actions { display: flex; gap: .4rem; flex: none; }
    .item-actions .button { font-size: .82rem; padding: .4rem .55rem; min-height: 40px; display: inline-flex; align-items: center; }
    .delete-confirm summary { list-style: none; cursor: pointer; }
    .delete-confirm summary::-webkit-details-marker { display: none; }
    .delete-confirm form { margin-top: .5rem; padding: .65rem; background: #fff4f4; border: 1px solid #e8adb3; border-radius: .6rem; max-width: 220px; }
    .delete-confirm form p { font-size: .82rem; margin: 0 0 .5rem; }
    @media (max-width: 880px) { .admin-layout { grid-template-columns: 1fr; } }
    @media (max-width: 590px) { .topbar-inner { flex-wrap: wrap; } .admin-item { align-items: start; flex-direction: column; } .item-actions { width: 100%; } }

    /* Portal v2: konta uczniów, planowanie i oddane prace. */
    .header-actions, .portal-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
    .portal-tabs { margin: 1.2rem 0; border-bottom: 1px solid var(--line-strong); padding-bottom: .8rem; }
    .portal-tabs a { min-height: 44px; padding: .6rem 1rem; border: 1px solid var(--line-strong); border-radius: .7rem; background: #fff; font-weight: 750; text-decoration: none; }
    .portal-tabs a[aria-current=page] { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); }
    .submission-options { border: 1px solid var(--line-strong); border-radius: .7rem; padding: 1rem; min-width: 0; }
    .submission-options legend { padding: 0 .3rem; font-weight: 750; }
    .submission-options .check-row { margin: .5rem 0; }
    .submission-options p { font-size: .82rem; color: var(--muted); margin: .6rem 0 0; }
    .publication-status { font-weight: 760; }
    .credentials, .review-card { margin-bottom: 1.2rem; }
    .credentials { border: 2px solid var(--blue-dark); }
    .table-scroll { overflow-x: auto; margin: 1rem 0; }
    .data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
    .data-table caption { text-align: left; font-weight: 750; padding: .5rem 0; }
    .data-table th, .data-table td { padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
    .data-table thead th { background: #eef3fb; }
    .data-table small { display: block; color: var(--muted); font-weight: 450; margin-top: .25rem; }
    .data-table code { white-space: nowrap; }
    .filter-form { display: flex; gap: .7rem; flex-wrap: wrap; align-items: end; margin: 1rem 0; }
    .filter-form .field { flex: 1 1 170px; }
    .student-item { padding: 1rem 0; border-bottom: 1px solid var(--line); }
    .student-item p { margin: .25rem 0; }
    .status-line { color: var(--muted); font-size: .85rem; margin-top: .9rem; }
    .plain-text { white-space: pre-wrap; overflow-wrap: anywhere; }
    .version-history { margin: 1.2rem 0; }
    .version-history summary, .code-preview summary { cursor: pointer; font-weight: 750; min-height: 44px; padding: .5rem 0; }
    .code-preview { margin: 1rem 0; }
    .code-preview p { color: var(--muted); font-size: .85rem; }
    .code-preview pre { max-height: 550px; overflow: auto; padding: 1rem; background: #101e33; color: #f5f8ff; border-radius: .7rem; font-size: .9rem; tab-size: 4; }
    .student-tasks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .student-tasks h3 { margin: .5rem 0; overflow-wrap: anywhere; }
    .status-badge { display: inline-block; background: #eaf0ff; color: #173779; font-size: .85rem; border-radius: .5rem; padding: .3rem .6rem; }
.student-test-card { border-color: #e4b7bc; box-shadow: inset 0 3px 0 var(--danger); }
.student-test-card .overline { color: #7f1d27; }
    .submission-version { padding: 1rem 0; border-bottom: 1px solid var(--line); }
    .submission-version h3 { margin-bottom: .5rem; }
    .submission-file { margin: .8rem 0; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .7rem; background: #f8fafc; }
    .submission-file h4 { margin: 0 0 .55rem; overflow-wrap: anywhere; }
    .submission-file .code-preview { margin-bottom: 0; }
    .feedback { padding: 1rem; border: 1px solid #99d7ad; background: #e8f7ee; border-radius: .7rem; }
    .feedback p { margin: .5rem 0 0; }
    .admin-main .review-card { margin-top: 1.2rem; }
    a.button { display: inline-flex; align-items: center; }
    @media(max-width: 680px) { .student-tasks { grid-template-columns: 1fr; } .data-table th, .data-table td { padding: .55rem; } .header-actions { width: 100%; } .portal-tabs a { flex: 1 1 auto; text-align: center; } }
    @media print { .credentials { border: 0; } body:has(.credentials) .topbar, body:has(.credentials) .admin-head, body:has(.credentials) .portal-tabs, body:has(.credentials) .school-layout, body:has(.credentials) .form-success { display: none; } .credentials table tr { break-inside: avoid; } }

/* v3: prace na lekcji i płynna nawigacja */
.panel-classwork { grid-column: 1 / -1; }
.panel-classwork .panel-heading { border-top: 3px solid var(--blue-dark); }
.panel-test { grid-column: 1 / -1; border-color: #e4b7bc; }
.panel-test .panel-heading { border-top: 3px solid var(--danger); background: #fff8f8; }
.panel-test .count-pill { background: #ffebed; color: #7f1d27; }
.panel-test .empty-mark { background: #ffebed; color: #7f1d27; font-size: .86rem; font-weight: 850; }
html.portal-navigation { scroll-behavior: auto; overflow-anchor: none; }
.workspace[aria-busy="true"] { opacity: .65; }
.hero-bottom { flex-wrap: wrap; }

/* v3.1: zarządzanie klasą i usuwanie konta */
.account-edit { margin: .7rem 0; }
.account-edit summary, .account-delete summary { list-style: none; cursor: pointer; }
.account-edit form, .account-delete form { padding: .9rem; margin-top: .6rem; border: 1px solid var(--line); border-radius: .6rem; background: #f5f8fc; }
.account-delete form { border-color: #e8adb3; background: #fff4f4; }
.account-delete { flex-basis: 100%; }
.account-edit form p, .account-delete form p { font-size: .88rem; }

/* v3.2: osobne zarządzanie kontami, filtry, paginacja i operacje zbiorcze */
.student-subnav { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.3rem 0 1.2rem; }
.student-subnav a { min-height: 44px; display: inline-flex; align-items: center; padding: .55rem .85rem; border-radius: .65rem; color: var(--muted); font-weight: 760; text-decoration: none; }
.student-subnav a:hover { background: #e7edf5; color: var(--ink); }
.student-subnav a[aria-current=page] { background: #dfe8ff; color: var(--blue-dark); }
.account-create-card { max-width: 780px; }
.account-create-card > p:not(.overline) { color: var(--muted); }
.accounts-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; flex-wrap: wrap; }
.accounts-heading h2 { margin-bottom: .35rem; }
.accounts-heading p:not(.overline) { color: var(--muted); margin-bottom: .5rem; }
.accounts-filter { padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #f7f9fc; }
.accounts-filter .search-field { flex: 2 1 260px; }
.accounts-filter .field:not(.search-field) { flex: 1 1 165px; }
.bulk-class-form { display: flex; align-items: end; gap: .8rem; flex-wrap: wrap; margin: 1rem 0 .3rem; padding: .9rem 1rem; border: 1px solid #a8bae8; border-radius: .8rem; background: #eef3ff; }
.bulk-class-form > div:first-of-type { flex: 1 1 230px; align-self: center; }
.bulk-class-form > div:first-of-type strong, .bulk-class-form > div:first-of-type small { display: block; }
.bulk-class-form > div:first-of-type small { color: var(--muted); margin-top: .15rem; }
.bulk-class-form .field { flex: 0 1 145px; }
.accounts-table-scroll { margin-bottom: .5rem; }
.accounts-table { min-width: 970px; }
.accounts-table th, .accounts-table td { padding: .65rem .7rem; vertical-align: middle; }
.accounts-table tbody tr:has(.row-management[open]) { background: #f8faff; }
.accounts-table .select-cell { width: 62px; text-align: center; }
.accounts-table .select-cell input { width: 20px; height: 20px; accent-color: var(--blue); }
.accounts-table .student-name { display: block; min-width: 165px; margin-bottom: .18rem; overflow-wrap: anywhere; }
.accounts-table th code { color: var(--muted); font-size: .8rem; font-weight: 550; }
.muted { color: var(--muted); }
.account-status { display: inline-block; padding: .23rem .5rem; border-radius: 99px; white-space: nowrap; font-size: .77rem; font-weight: 780; }
.account-status.active { color: #15512f; background: #e1f4e8; }
.account-status.first-login { color: #744000; background: #fff1db; }
.account-status.blocked { color: #7f1d27; background: #ffebed; }
.manage-cell { min-width: 146px; }
.row-management > summary, .row-management .delete-confirm > summary, .row-management .account-delete > summary { list-style: none; cursor: pointer; }
.row-management > summary::-webkit-details-marker, .row-management .delete-confirm > summary::-webkit-details-marker, .row-management .account-delete > summary::-webkit-details-marker { display: none; }
.row-management[open] > summary { color: var(--blue-dark); background: #eaf0ff; }
.row-management-panel { min-width: 300px; display: grid; gap: .75rem; margin-top: .65rem; padding: .8rem; border: 1px solid var(--line); border-radius: .65rem; background: #fff; }
.compact-account-form { display: grid; gap: .3rem; }
.compact-account-form > label { font-size: .82rem; font-weight: 760; }
.inline-control { display: flex; align-items: stretch; gap: .4rem; }
.inline-control select { min-width: 95px; min-height: 44px; border: 1px solid #acb9c8; border-radius: .6rem; background: #fff; padding: .5rem .65rem; }
.compact-actions { display: flex; align-items: start; gap: .45rem; flex-wrap: wrap; }
.compact-actions form { margin: 0; }
.row-management .delete-confirm form { max-width: 280px; }
.row-management .account-delete { flex-basis: auto; }
.row-management .account-delete form { max-width: 520px; }
.empty-filter { padding: 1.2rem 0 .3rem; }
.empty-filter p { color: var(--muted); }
.pagination { display: flex; justify-content: center; align-items: center; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }
.pagination > a:not(.button) { min-width: 44px; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: .65rem; background: #fff; font-weight: 760; text-decoration: none; }
.pagination > a[aria-current=page] { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); }
@media (max-width: 680px) {
  .student-subnav a { flex: 1 1 auto; justify-content: center; }
  .accounts-heading .button, .bulk-class-form .field, .bulk-class-form > .button { width: 100%; }
  .bulk-class-form .field { flex-basis: 100%; }
  .accounts-table { min-width: 880px; }
}
@media print {
  body:has(.credentials) .student-subnav, body:has(.credentials) .accounts-list-card, body:has(.credentials) .account-create-card { display: none; }
}

/* v3.3: podgląd hasła i kontakt ucznia z nauczycielem */
.password-control { display: flex; align-items: stretch; gap: .45rem; }
.password-control input { min-width: 0; flex: 1 1 auto; }
.password-toggle { min-width: 78px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: .6rem; background: #fff; color: var(--blue-dark); padding: .5rem .65rem; font-weight: 760; }
.password-toggle:hover { background: #edf3ff; }
.password-toggle[aria-pressed=true] { color: #fff; background: var(--blue-dark); border-color: var(--blue-dark); }
.contact-card { max-width: 760px; margin: 0 auto; }
.contact-card > p:not(.overline) { color: var(--muted); }
@media (max-width: 460px) {
  .password-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
}

/* v3.4: prywatny dziennik bezpieczeństwa */
.audit-intro { border-left: 4px solid var(--blue-dark); }
.audit-intro > p { max-width: 920px; }
.audit-stats { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.audit-stats > div { min-width: 165px; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .75rem; background: #f7f9fc; }
.audit-stats strong, .audit-stats span { display: block; }
.audit-stats strong { color: var(--blue-dark); font-size: 1.4rem; }
.audit-stats span { color: var(--muted); font-size: .82rem; }
.audit-filter { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(135px, 1fr)); gap: .75rem; align-items: end; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: .8rem; background: #f7f9fc; }
.audit-filter .actions { grid-column: 1 / -1; }
.audit-table { width: 100%; min-width: 1050px; border-collapse: collapse; text-align: left; font-size: .88rem; }
.audit-table th, .audit-table td { padding: .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.audit-table thead th { background: #eef3fb; }
.audit-table tbody th { min-width: 175px; }
.audit-table small { display: block; margin-top: .2rem; color: var(--muted); font-weight: 450; }
.audit-table time { white-space: nowrap; }
.audit-event { display: inline-block; padding: .25rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 760; }
.audit-login { color: #17436d; background: #e3efff; }
.audit-account { color: #664008; background: #fff0cf; }
.audit-content { color: #3f3270; background: #eee9ff; }
.audit-submission { color: #15512f; background: #e1f4e8; }
.audit-contact { color: #72404d; background: #fde9ef; }
.audit-security { color: #7a2028; background: #ffe7e9; }
.manage-cell > .button { margin-bottom: .35rem; }
@media (max-width: 900px) {
  .audit-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-filter .search-field, .audit-filter .actions { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
  .audit-filter { grid-template-columns: 1fr; }
  .audit-filter .search-field, .audit-filter .actions { grid-column: auto; }
  .audit-filter .actions .button { width: 100%; }
}

/* v3.7: izolowany runner kodu */
.runner-main { max-width: 1180px; }
.status-badge.safe { background: #dcfce7; color: #166534; align-self: center; }
.runner-notice { display: flex; align-items: center; gap: .9rem; border-left: 5px solid #16a34a; padding-block: 1rem; }
.runner-notice h2 { margin: 0 0 .15rem; font-size: 1rem; }
.runner-notice p { margin: 0; color: var(--muted); font-size: .9rem; }
.runner-notice-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: #166534; font-size: 1.15rem; font-weight: 900; }
.runner-workspace { padding: clamp(1rem, 2vw, 1.5rem); }
.runner-toolbar, .runner-panel-head, .runner-field-label { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.runner-toolbar { align-items: end; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.runner-toolbar .field { min-width: min(100%, 330px); margin: 0; }
.runner-toolbar .actions { margin: 0; }
.runner-toolbar .button { min-width: 108px; }
.runner-editor-field { margin-top: 1rem; }
.runner-field-label { margin-bottom: .45rem; }
.runner-field-label label { margin: 0; }
.runner-field-label span, .runner-panel-label { color: var(--muted); font-size: .77rem; font-weight: 650; }
.code-editor, .runner-console { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; font-size: .92rem; line-height: 1.55; tab-size: 2; }
.code-editor { min-height: 330px; resize: vertical; white-space: pre; overflow: auto; border-color: #b7c5d7; background: #fbfdff; }
.code-editor:focus { background: #fff; }
.runner-output-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; margin-top: 1.25rem; }
.runner-output-grid.has-preview { grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); }
.runner-result-panel { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.runner-panel-head { min-height: 45px; margin: 0; padding: .55rem .8rem; border-bottom: 1px solid var(--line); background: #f8fafc; }
.runner-panel-head h2 { margin: 0; font-size: .92rem; }
#runner-status { display: inline-flex; align-items: center; min-height: 26px; padding: .18rem .55rem; border-radius: 999px; background: #e9eef5; color: var(--muted); font-size: .76rem; font-weight: 750; }
#runner-status[data-tone="working"] { background: #e8efff; color: #183b9d; }
#runner-status[data-tone="success"] { background: #dcfce7; color: #166534; }
#runner-status[data-tone="warning"] { background: #fff4d6; color: #7c4a03; }
#runner-status[data-tone="error"] { background: #fee2e2; color: #991b1b; }
.runner-console { min-height: 280px; max-height: 480px; overflow: auto; margin: 0; padding: 1rem; border-radius: 0; background: #08111f; color: #e2e8f0; white-space: pre-wrap; overflow-wrap: anywhere; }
.runner-console[data-placeholder="1"] { color: #94a3b8; }
.runner-preview { display: block; width: 100%; min-height: 280px; height: 100%; border: 0; background: #fff; }
[hidden] { display: none !important; }
@media (max-width: 850px) {
  .runner-output-grid.has-preview { grid-template-columns: 1fr; }
  .runner-toolbar { align-items: stretch; flex-direction: column; }
  .runner-toolbar .field { min-width: 0; }
  .runner-toolbar .actions { display: grid; grid-template-columns: repeat(3, 1fr); }
  .runner-toolbar .button { min-width: 0; padding-inline: .6rem; }
  .code-editor { min-height: 300px; }
}
@media (max-width: 520px) {
  .runner-notice { align-items: flex-start; }
  .runner-toolbar .actions { grid-template-columns: 1fr 1fr; }
  .runner-toolbar .button:first-child { grid-column: 1 / -1; }
}

/* v3.9: rozbudowana Akademia Pythona */
.python-course-page { background: #eef3f9; }
.python-brand { color: #fff; text-decoration: none; }
.python-brand:hover .brand-name { text-decoration: underline; text-underline-offset: 4px; }
.python-main { max-width: 1500px; margin: 0 auto; padding: clamp(1rem, 3vw, 2.5rem); }
.python-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(230px, .55fr); gap: clamp(1.5rem, 4vw, 4rem); align-items: center; min-height: 260px; margin-bottom: 1.25rem; padding: clamp(1.6rem, 4vw, 3.25rem); border-radius: 24px; color: #fff; background: linear-gradient(128deg, #102445 0%, #193a75 62%, #185b78 100%); box-shadow: 0 16px 45px rgba(17,33,59,.13); }
.python-hero::after { content: "</>"; position: absolute; right: 36%; bottom: -3.2rem; color: rgba(255,255,255,.055); font-family: ui-monospace, monospace; font-size: 13rem; font-weight: 900; line-height: 1; transform: rotate(-7deg); pointer-events: none; }
.python-hero > * { position: relative; z-index: 1; }
.python-hero h1 { max-width: 800px; margin: 0 0 .8rem; font-size: clamp(2rem, 4vw, 3.65rem); line-height: 1.05; letter-spacing: -.055em; }
.python-hero > div:first-child > p:last-child { max-width: 750px; margin: 0; color: #dce9f8; font-size: clamp(.97rem, 1.4vw, 1.1rem); }
.python-progress-card { justify-self: end; width: min(100%, 290px); padding: 1.25rem; border: 1px solid rgba(255,255,255,.22); border-radius: 18px; background: rgba(4,17,35,.28); backdrop-filter: blur(7px); }
.python-progress-card strong, .python-progress-card span { display: block; }
.python-progress-card strong { font-size: 2rem; line-height: 1.1; }
.python-progress-card span { margin: .15rem 0 .8rem; color: #dce9f8; font-size: .85rem; }
.python-progress-card small { display: block; margin-top: .25rem; color: #dce9f8; text-align: right; font-weight: 700; }
.python-progress { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.2); }
.python-progress::-webkit-progress-bar { border-radius: 999px; background: rgba(255,255,255,.2); }
.python-progress::-webkit-progress-value { border-radius: 999px; background: #73e3df; transition: width .3s ease; }
.python-progress::-moz-progress-bar { border-radius: 999px; background: #73e3df; }
.python-layout { display: grid; grid-template-columns: 305px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.python-syllabus { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 7px 25px rgba(17,33,59,.06); scrollbar-width: thin; }
.python-syllabus-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; gap: .6rem; padding: 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.python-syllabus-head span { color: var(--muted); font-size: .8rem; }
.python-section { border-bottom: 1px solid var(--line); }
.python-section:last-child { border-bottom: 0; }
.python-section summary { display: flex; align-items: start; justify-content: space-between; gap: .55rem; min-height: 52px; padding: .85rem 1rem; cursor: pointer; font-size: .86rem; font-weight: 780; }
.python-section summary:hover { background: #f4f7fb; }
.python-section summary small { flex: none; color: var(--muted); font-weight: 550; }
.python-section ol { list-style: none; margin: 0; padding: 0 0 .65rem; }
.python-section li { margin: 0; }
.python-section li a { display: grid; grid-template-columns: 25px minmax(0, 1fr); gap: .55rem; align-items: start; min-height: 44px; padding: .55rem 1rem; color: #34475e; text-decoration: none; font-size: .82rem; line-height: 1.35; }
.python-section li a:hover { color: var(--blue-dark); background: #f0f4fb; }
.python-section li a[aria-current="page"] { color: #173779; background: #e7eeff; font-weight: 760; }
.python-lesson-state { width: 21px; height: 21px; display: grid; place-items: center; border: 1px solid #acbacb; border-radius: 50%; color: transparent; font-size: .7rem; line-height: 1; }
.python-lesson-state.done { border-color: #198754; color: #fff; background: #198754; }
.python-content { min-width: 0; }
.python-welcome { padding: clamp(1.3rem, 3vw, 2.25rem); background: linear-gradient(140deg, #fff 0%, #f3f7ff 100%); }
.python-welcome h2 { margin-bottom: .55rem; font-size: clamp(1.55rem, 2.5vw, 2.1rem); }
.python-welcome > p:not(.overline) { max-width: 820px; color: var(--muted); }
.python-welcome-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.15rem; }
.python-section-title { display: flex; justify-content: space-between; gap: 1rem; align-items: end; margin: 2rem 0 1rem; }
.python-section-title h2 { margin: 0; font-size: clamp(1.4rem, 2vw, 1.8rem); }
.python-section-title > p { max-width: 470px; margin: 0; color: var(--muted); font-size: .86rem; text-align: right; }
.python-module-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.python-module-card { min-height: 230px; display: flex; flex-direction: column; padding: 1.35rem; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.python-module-number { color: #3760bd; font-size: .8rem; font-weight: 850; letter-spacing: .12em; }
.python-module-card h3 { margin: .65rem 0 .5rem; font-size: 1.2rem; }
.python-module-card p { color: var(--muted); font-size: .9rem; }
.python-module-card > div { display: flex; justify-content: space-between; gap: .7rem; align-items: center; margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--line); font-size: .82rem; }
.python-module-card > div span { color: var(--muted); }
.python-module-card > div a { font-weight: 780; }
.python-privacy-note { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px solid #a8d5bd; border-radius: 14px; background: #edfaf2; }
.python-privacy-note p { margin: .2rem 0 0; color: #315b43; font-size: .87rem; }
.python-lesson { display: grid; gap: 1rem; }
.python-lesson > section, .python-lesson > nav, .python-lesson-header { border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.python-lesson-header { display: flex; justify-content: space-between; align-items: start; gap: 1.5rem; padding: clamp(1.35rem, 3vw, 2.35rem); }
.python-lesson-header h1 { max-width: 850px; margin: 0 0 .6rem; font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.1; letter-spacing: -.045em; }
.python-lesson-header > div:first-child > p:last-child { max-width: 840px; margin: 0; color: var(--muted); font-size: 1rem; }
.python-lesson-meta { flex: none; display: grid; justify-items: end; gap: .55rem; color: var(--muted); font-size: .8rem; }
.python-complete-badge { display: inline-flex; align-items: center; min-height: 32px; padding: .3rem .65rem; border-radius: 999px; color: #604000; background: #fff1cf; font-weight: 780; }
.python-complete-badge.done { color: #15512f; background: #dff5e7; }
.python-roadmap { padding: clamp(1.15rem, 2.6vw, 1.75rem); background: linear-gradient(135deg, #f8fbff, #eef4ff) !important; }
.python-roadmap > div { display: flex; justify-content: space-between; gap: 1rem; align-items: end; }
.python-roadmap h2 { margin: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); }
.python-roadmap ol { list-style: none; display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0 0; padding: 0; counter-reset: roadmap; }
.python-roadmap li { display: inline-flex; align-items: center; gap: .45rem; padding: .42rem .65rem .42rem .45rem; border: 1px solid #b7c7e8; border-radius: 999px; color: #263d62; background: #fff; font-size: .82rem; font-weight: 680; }
.python-roadmap li span { width: 1.45rem; height: 1.45rem; display: grid; flex: none; place-items: center; border-radius: 50%; color: #fff; background: #3158b7; font-size: .7rem; }
.python-goals, .python-theory, .python-pitfalls { padding: clamp(1.15rem, 2.6vw, 1.75rem); }
.python-goals { border-left: 5px solid #3760bd !important; background: #f4f7ff !important; }
.python-lesson section h2 { margin: 0 0 .75rem; font-size: clamp(1.1rem, 2vw, 1.35rem); }
.python-goals ul, .python-pitfalls ul { margin: 0; padding-left: 1.2rem; }
.python-goals li, .python-pitfalls li { padding: .2rem 0 .2rem .2rem; }
.python-theory p { max-width: 92ch; margin: 0; color: #35485e; }
.python-algorithm { overflow: hidden; }
.python-algorithm > ol { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; margin: 0; padding: 1.2rem; }
.python-algorithm > ol li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: .65rem; align-items: start; padding: .8rem; border: 1px solid #d5deeb; border-radius: 11px; background: #fbfcfe; }
.python-algorithm > ol li > span { width: 2rem; height: 2rem; display: grid; place-items: center; border-radius: 9px; color: #fff; background: #234ca8; font-size: .8rem; font-weight: 850; }
.python-algorithm > ol p { margin: .15rem 0 0; color: #33475e; }
.python-deep-dive, .python-worked-examples, .python-challenges { padding: clamp(1.15rem, 2.6vw, 1.75rem); }
.python-deep-dive .python-section-title, .python-worked-examples .python-section-title, .python-challenges .python-section-title { margin: 0 0 1rem; }
.python-deep-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; }
.python-deep-grid article { padding: 1rem; border: 1px solid #d5deeb; border-radius: 12px; background: #fbfcfe; }
.python-deep-grid h3 { margin: 0 0 .6rem; color: #173779; font-size: 1rem; }
.python-deep-grid p { margin: .55rem 0 0; color: #3e5065; font-size: .9rem; }
.python-syntax { display: grid; grid-template-columns: minmax(190px, .55fr) minmax(0, 1.45fr); gap: 1rem; align-items: center; padding: clamp(1.15rem, 2.6vw, 1.75rem); color: #fff; background: #132744 !important; border-color: #132744 !important; }
.python-syntax h2 { margin-bottom: 0 !important; }
.python-syntax > div:last-child { display: flex; flex-wrap: wrap; gap: .55rem; }
.python-syntax code { padding: .45rem .65rem; border: 1px solid #49617f; border-radius: .55rem; color: #d9f7f5; background: #0b1c33; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.python-example, .python-practice, .python-quiz { overflow: hidden; }
.python-block-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); background: #f8fafc; }
.python-block-head h2, .python-block-head p { margin-bottom: 0; }
.python-block-head > span { color: var(--muted); font-size: .78rem; }
.python-example > pre { margin: 0; padding: 1.25rem; overflow: auto; color: #e6edf6; background: #081525; font-size: .9rem; line-height: 1.6; tab-size: 4; }
.python-example-output { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; align-items: start; padding: 1rem 1.2rem; background: #f6f8fb; }
.python-example-output pre { margin: 0; overflow: auto; color: #1f3c2e; font: .86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; }
.python-examples-grid { display: grid; gap: 1rem; }
.python-worked-card { overflow: hidden; border: 1px solid #cad5e3; border-radius: 13px; background: #fff; }
.python-worked-card > header { padding: 1rem 1.1rem; }
.python-worked-card > header > span { color: #3158b7; font-size: .73rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.python-worked-card h3 { margin: .25rem 0 .4rem; font-size: 1.05rem; }
.python-worked-card header p { max-width: 90ch; margin: 0; color: var(--muted); font-size: .9rem; }
.python-code-label { display: flex; justify-content: space-between; gap: .7rem; padding: .5rem 1rem; border-top: 1px solid #d8e0ea; color: #cad6e4; background: #13243a; font-size: .75rem; font-weight: 750; }
.python-code-label small { color: #aebfd2; }
.python-worked-card > pre { margin: 0; padding: 1.1rem; overflow: auto; color: #e6edf6; background: #081525; font-size: .86rem; line-height: 1.58; tab-size: 4; }
.python-challenge-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.python-challenge-grid article { padding: 1rem; border: 1px solid #d3dcea; border-radius: 12px; background: #fbfcfe; }
.python-level { display: inline-flex; padding: .25rem .55rem; border-radius: 999px; color: #173779; background: #e7eeff; font-size: .72rem; font-weight: 820; }
.python-challenge-grid article > p { margin: .7rem 0; color: #30445b; }
.python-challenge-grid details { border-top: 1px solid #dce3ec; padding-top: .65rem; }
.python-challenge-grid summary { width: fit-content; color: #214da6; cursor: pointer; font-size: .82rem; font-weight: 760; }
.python-challenge-grid details p { margin: .55rem 0 0; color: var(--muted); font-size: .85rem; }
.python-practice > p, .python-practice > label, .python-practice > textarea, .python-editor-actions, .python-output { margin-left: 1.2rem; margin-right: 1.2rem; }
.python-practice > p { margin-top: 1.15rem; margin-bottom: .9rem; }
.python-practice > label { display: block; margin-bottom: .35rem; font-weight: 780; }
.python-practice > textarea { width: calc(100% - 2.4rem); min-height: 300px; border: 1px solid #9cafc3; border-radius: 10px; padding: 1rem; color: #102039; background: #fbfdff; }
.python-local-badge { color: #15512f !important; font-weight: 760; }
.python-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .85rem 0 1.1rem; }
#python-run-status { margin-left: auto; padding: .25rem .55rem; border-radius: 999px; color: var(--muted); background: #edf1f5; font-size: .78rem; font-weight: 720; }
#python-run-status[data-tone="working"] { color: #173779; background: #e5edff; }
#python-run-status[data-tone="success"] { color: #15512f; background: #dff5e7; }
#python-run-status[data-tone="warning"] { color: #714200; background: #fff1cf; }
#python-run-status[data-tone="error"] { color: #891f2a; background: #ffe5e8; }
.python-output { margin-bottom: 1.2rem; overflow: hidden; border: 1px solid #23364c; border-radius: 10px; color: #dbe6f3; background: #081525; }
.python-output > div:first-child { display: flex; justify-content: space-between; gap: .8rem; padding: .65rem .8rem; border-bottom: 1px solid #2f4258; }
.python-output small { color: #aebdd0; }
.python-output-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.python-output-columns > * { min-width: 0; margin: 0; padding: .9rem; }
.python-output-columns > div { border-left: 1px solid #2f4258; }
.python-output pre { min-height: 105px; max-height: 310px; overflow: auto; margin: .4rem 0 0; color: #e7eef8; background: transparent; font: .86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
#python-output { margin: 0; }
.python-pitfalls { border-left: 5px solid #d08700 !important; background: #fffaf0 !important; }
.python-summary { display: grid; grid-template-columns: minmax(190px, .45fr) minmax(0, 1.55fr); gap: 1rem; padding: clamp(1.15rem, 2.6vw, 1.75rem); border-left: 5px solid #198754 !important; background: #effaf3 !important; }
.python-summary ul { margin: 0; padding-left: 1.2rem; }
.python-summary li { padding: .18rem 0 .18rem .2rem; color: #244b35; }
.python-quiz { padding: clamp(1.15rem, 2.6vw, 1.75rem); }
.python-quiz form { display: grid; gap: .7rem; }
.python-quiz label { display: grid; grid-template-columns: 23px minmax(0, 1fr); gap: .7rem; align-items: start; padding: .85rem 1rem; border: 1px solid var(--line-strong); border-radius: 10px; cursor: pointer; }
.python-quiz label:hover { border-color: #6985c9; background: #f5f8ff; }
.python-quiz label:has(input:checked) { border-color: #3760bd; background: #edf2ff; box-shadow: 0 0 0 1px #3760bd; }
.python-quiz input { width: 19px; height: 19px; margin: .15rem 0 0; accent-color: #254ebe; }
.python-quiz button { justify-self: start; margin-top: .35rem; }
.python-quiz-result { min-height: 0; padding: 0; border-radius: 10px; }
.python-quiz-result:not(:empty) { padding: .85rem 1rem; }
.python-quiz-result.correct { color: #15512f; border: 1px solid #8dd0a7; background: #e8f7ee; }
.python-quiz-result.incorrect { color: #73410b; border: 1px solid #e6bd6d; background: #fff6df; }
.python-lesson-footer { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0 1rem; }

@media (max-width: 1050px) {
  .python-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .python-hero { grid-template-columns: minmax(0, 1fr) 240px; }
  .python-module-grid { grid-template-columns: 1fr; }
}
@media (max-width: 800px) {
  .python-hero { grid-template-columns: 1fr; min-height: 0; }
  .python-progress-card { justify-self: stretch; width: 100%; }
  .python-layout { display: block; }
  .python-syllabus { position: static; max-height: none; margin-bottom: 1rem; }
  .python-section:not([open]) { display: block; }
  .python-lesson-header { display: grid; }
  .python-lesson-meta { justify-items: start; }
  .python-syntax { grid-template-columns: 1fr; }
  .python-deep-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .python-main { padding-inline: .75rem; }
  .python-hero { padding: 1.25rem; border-radius: 17px; }
  .python-hero::after { display: none; }
  .python-section-title { display: block; }
  .python-section-title > p { margin-top: .45rem; text-align: left; }
  .python-module-card { min-height: 210px; }
  .python-lesson-header { padding: 1.2rem; }
  .python-block-head { align-items: start; flex-direction: column; }
  .python-roadmap > div { display: block; }
  .python-roadmap ol { display: grid; }
  .python-roadmap li { border-radius: 10px; }
  .python-algorithm > ol, .python-challenge-grid, .python-summary { grid-template-columns: 1fr; }
  .python-example-output { grid-template-columns: 1fr; }
  .python-output-columns { grid-template-columns: 1fr; }
  .python-output-columns > div { border-top: 1px solid #2f4258; border-left: 0; }
  #python-run-status { width: 100%; margin-left: 0; }
  .python-editor-actions .button { flex: 1 1 120px; justify-content: center; }
  .python-lesson-footer .button { flex: 1 1 0; justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .python-progress::-webkit-progress-value { transition: none; }
}

/* v4.0: prywatne rozmowy ucznia z nauczycielem */
.chat-nav-badge, .chat-unread { min-width: 1.45rem; height: 1.45rem; display: inline-grid; place-items: center; padding: 0 .35rem; border-radius: 999px; color: #fff; background: #b42332; font-size: .72rem; font-weight: 850; line-height: 1; }
.chat-nav-badge { margin-left: .3rem; vertical-align: middle; }
.chat-nav-badge.is-empty, .chat-unread.is-empty { display: none; }
.chat-card { max-width: 920px; margin-inline: auto; padding: 0; overflow: hidden; }
.chat-heading, .chat-inbox-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.35rem; border-bottom: 1px solid var(--line); background: #fbfcff; }
.chat-heading h2, .chat-inbox-head h2 { margin-bottom: .2rem; }
.chat-heading p, .chat-inbox-head p { margin-bottom: 0; }
.chat-presence { color: var(--muted); font-size: .85rem; }
.chat-presence::before { content: ""; width: .55rem; height: .55rem; display: inline-block; margin-right: .45rem; border-radius: 50%; background: #8793a2; box-shadow: 0 0 0 3px #e9edf2; }
.chat-presence.is-online { color: #17643a; font-weight: 720; }
.chat-presence.is-online::before { background: #1d9858; box-shadow: 0 0 0 3px #d9f3e4; }
.chat-card > .editor-info { margin: 1rem 1.35rem 0; }
.chat-older { align-self: center; display: block; margin: .8rem auto 0; border: 0; border-radius: 999px; padding: .42rem .8rem; color: #214a9e; background: #e8efff; font-size: .78rem; font-weight: 780; }
.chat-older:hover { background: #dbe6ff; }
.chat-sound { white-space: nowrap; }
.chat-messages { height: clamp(360px, 52vh, 650px); overflow-y: auto; display: flex; flex-direction: column; gap: .48rem; padding: 1.2rem 1.35rem; background: linear-gradient(180deg, #f4f7fb, #f9fbfd); scrollbar-gutter: stable; }
.chat-loading { margin: auto; color: var(--muted); text-align: center; }
.chat-message { width: fit-content; max-width: min(78%, 670px); padding: .68rem .82rem .52rem; border: 1px solid #d4dce7; border-radius: 15px 15px 15px 4px; background: #fff; box-shadow: 0 1px 2px rgba(17,33,59,.04); overflow-wrap: anywhere; }
.chat-message.is-own { align-self: flex-end; color: #fff; border-color: #254ebe; border-radius: 15px 15px 4px 15px; background: #254ebe; }
.chat-message p { margin: 0; white-space: pre-wrap; }
.chat-message small { display: block; margin-top: .28rem; color: #657589; font-size: .69rem; }
.chat-message.is-own small { color: #dce6ff; text-align: right; }
.chat-composer { display: grid; gap: .55rem; padding: 1rem 1.35rem 1.25rem; border-top: 1px solid var(--line); background: #fff; }
.chat-composer textarea { width: 100%; min-height: 78px; resize: vertical; padding: .72rem .8rem; border: 1px solid #9faebe; border-radius: .7rem; color: var(--ink); background: #fff; }
.chat-compose-actions { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.chat-compose-actions small { color: var(--muted); font-size: .75rem; }
.chat-error { margin: .2rem 0 0; }
.chat-admin { display: grid; grid-template-columns: minmax(290px, 360px) minmax(0, 1fr); gap: 1rem; align-items: stretch; }
.chat-inbox, .chat-teacher-panel { margin: 0; height: min(74vh, 790px); min-height: 610px; }
.chat-inbox { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-inbox-head { padding: 1rem; }
.chat-filters { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(105px, .8fr); gap: .55rem; padding: .8rem; border-bottom: 1px solid var(--line); }
.chat-filters .field { grid-column: auto; }
.chat-filters label { font-size: .75rem; }
.chat-filters input, .chat-filters select { min-height: 40px; padding: .45rem .55rem; font-size: .83rem; }
.chat-conversations { flex: 1; overflow-y: auto; }
.chat-contact { display: grid; grid-template-columns: 2.35rem minmax(0, 1fr) auto; gap: .65rem; align-items: center; min-height: 84px; padding: .72rem .8rem; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.chat-contact:hover { background: #f3f6fb; }
.chat-contact.is-selected { background: #edf2ff; box-shadow: inset 4px 0 #254ebe; }
.chat-avatar { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; border-radius: 12px; color: #fff; background: #243d65; font-weight: 850; }
.chat-contact-copy { min-width: 0; display: grid; }
.chat-contact-copy strong, .chat-contact-copy small, .chat-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-contact-copy strong { font-size: .88rem; }
.chat-contact-copy small { color: var(--muted); font-size: .7rem; }
.chat-preview { margin-top: .22rem; color: #536377; font-size: .75rem; }
.chat-contact-meta { align-self: start; display: grid; justify-items: end; gap: .55rem; }
.chat-online-dot { width: .65rem; height: .65rem; border-radius: 50%; background: #a4adb8; box-shadow: 0 0 0 3px #edf0f4; }
.chat-online-dot.is-online { background: #1d9858; box-shadow: 0 0 0 3px #d9f3e4; }
.chat-teacher-panel { max-width: none; display: flex; flex-direction: column; }
.chat-teacher-panel .chat-messages { flex: 1; height: auto; min-height: 300px; }
.chat-no-selection { margin: auto; padding: 2rem; text-align: center; color: var(--muted); }
.chat-no-selection h2 { color: var(--ink); }

@media (max-width: 880px) {
  .chat-admin { grid-template-columns: 1fr; }
  .chat-inbox { height: auto; min-height: 0; max-height: 460px; }
  .chat-teacher-panel { min-height: 610px; }
}
@media (max-width: 580px) {
  .chat-heading, .chat-inbox-head { align-items: stretch; flex-direction: column; padding: 1rem; }
  .chat-sound { width: 100%; }
  .chat-card > .editor-info { margin: .8rem 1rem 0; }
  .chat-messages { height: 55vh; min-height: 330px; padding: 1rem; }
  .chat-message { max-width: 88%; }
  .chat-composer { padding: .85rem 1rem 1rem; }
  .chat-compose-actions { align-items: stretch; flex-direction: column; }
  .chat-compose-actions .button { width: 100%; justify-content: center; }
  .chat-filters { grid-template-columns: 1fr; }
  .chat-teacher-panel { min-height: 570px; }
}

/* v4.1: gry z wynikami i kontrolowany tryb sprawdzianu */
.game-page { display: grid; gap: 1rem; }
.game-intro-card { max-width: 980px; }
.game-rules { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0; }
.game-rules span { padding: .4rem .7rem; border: 1px solid #bdcbe0; border-radius: 999px; color: #1e437f; background: #edf3ff; font-size: .8rem; font-weight: 800; }
.game-strict-warning { margin: 1rem 0; padding: 1rem 1.1rem; border: 1px solid #e0b35c; border-left: 5px solid #c87a00; border-radius: 10px; color: #553604; background: #fff7df; }
.game-strict-warning p { margin: .45rem 0 0; }
.game-host { position: relative; min-height: 680px; overflow: hidden; border: 1px solid #243d65; border-radius: 15px; background: #07131d; box-shadow: 0 15px 35px rgba(6,18,35,.2); }
.game-host:fullscreen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.game-host-bar { min-height: 58px; display: flex; align-items: center; gap: 1rem; padding: .55rem .8rem; color: #fff; background: #0d2234; }
.game-host-bar strong { margin-right: auto; }
.game-host-bar span { color: #ffd58a; font-size: .82rem; font-weight: 800; }
.game-host-bar .button { color: #fff; border-color: #607890; background: #17344c; }
.game-host iframe { display: block; width: 100%; height: calc(100vh - 145px); min-height: 620px; border: 0; background: #08141e; }
.game-host:fullscreen iframe { height: calc(100vh - 58px); }
.game-pause { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1rem; background: rgba(5,13,24,.9); backdrop-filter: blur(6px); }
.game-pause > div { width: min(620px, 100%); padding: clamp(1.3rem, 4vw, 2.3rem); border: 1px solid #5b7090; border-radius: 16px; color: #eef5ff; background: #11243d; box-shadow: 0 22px 55px #0008; }
.game-pause h2 { color: #fff; }
.game-pause .button { margin: .4rem .35rem 0 0; }
.game-result-summary { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 1.3rem; }
.game-result-summary > * { padding: .5rem .75rem; border-radius: 8px; color: #24364c; background: #edf2f8; }
.game-result-summary strong { color: #164b2c; background: #e3f5e9; }
.game-answer-report { display: grid; gap: .8rem; }
.game-answer-row { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.game-answer-row > div:first-child { display: flex; align-items: center; gap: .55rem; }
.game-answer-row > p { margin: .65rem 0; }
.answer-trail { margin: .6rem 0; padding-left: 1.7rem; }
.answer-trail li { padding: .2rem .4rem; }
.answer-trail .is-correct { color: #17643a; font-weight: 750; }
.answer-trail .is-wrong { color: #8c2631; }
.game-reason { margin: .7rem 0 0; padding: .75rem .9rem; border-left: 4px solid #3158b7; color: #2e415b; background: #edf3ff; white-space: pre-wrap; }

@media (max-width: 680px) {
  .game-host { min-height: 560px; border-radius: 10px; }
  .game-host-bar { align-items: stretch; flex-wrap: wrap; }
  .game-host-bar strong { width: 100%; }
  .game-host iframe { min-height: 520px; height: 75vh; }
}

/* v4.7: czytelniejsze wpisy oraz załączniki PDF i ZIP */
.panel { background: #f8fafc; box-shadow: 0 7px 24px rgba(17, 33, 59, .055); }
.panel-heading { background: #fff; }
.entry-list { display: grid; gap: .85rem; padding: 1rem; }
.entry {
  --entry-accent: var(--blue);
  position: relative;
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--entry-accent);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(17, 33, 59, .045);
}
.entry:last-child { border-bottom: 1px solid var(--line); }
.entry-kind-material { --entry-accent: #3158b7; }
.entry-kind-homework { --entry-accent: #8b4b13; }
.entry-kind-classwork { --entry-accent: #136b58; }
.entry-kind-test { --entry-accent: var(--danger); }
.entry-card-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .65rem; }
.entry-type { display: inline-flex; align-items: center; min-height: 28px; padding: .22rem .55rem; border-radius: 999px; color: #263d5f; background: #edf2f8; font-size: .72rem; font-weight: 850; letter-spacing: .035em; text-transform: uppercase; }
.entry-kind-homework .entry-type { color: #6e390b; background: #fff1de; }
.entry-kind-classwork .entry-type { color: #0c5847; background: #e3f5ef; }
.entry-kind-test .entry-type { color: #7f1d27; background: #ffebed; }
.entry-title { margin-bottom: .55rem; font-size: 1.08rem; line-height: 1.28; }
.entry-description { color: #3f5065; font-size: .92rem; line-height: 1.62; }
.entry-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: .9rem; }
.entry-actions .entry-link { margin: 0; }
.entry-link.entry-link-primary, .entry-link.entry-link-game {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .58rem .9rem;
  border-radius: .65rem;
  color: #fff;
  background: var(--blue-dark);
  text-decoration: none;
}
.entry-link.entry-link-primary:hover, .entry-link.entry-link-game:hover { background: var(--navy); }
.entry-files { margin-top: 1rem; padding: .85rem; border: 1px solid #d5deea; border-radius: 11px; background: #f7f9fc; }
.entry-files-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .6rem; color: #334862; font-size: .8rem; font-weight: 850; text-transform: uppercase; letter-spacing: .045em; }
.entry-files-title span { min-width: 24px; padding: .05rem .4rem; border-radius: 999px; color: #173779; background: #e4ebff; text-align: center; }
.entry-file-list { display: grid; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.entry-file-list li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-width: 0; padding: .55rem .6rem; border: 1px solid #dce3eb; border-radius: 9px; background: #fff; }
.entry-file-info { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.entry-file-info > span:last-child { display: grid; min-width: 0; }
.entry-file-info strong { overflow: hidden; color: var(--ink); font-size: .84rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.entry-file-info small { color: var(--muted); font-size: .73rem; }
.file-kind { width: 42px; min-height: 31px; display: grid; place-items: center; flex: none; border-radius: 7px; color: #fff; background: #a52b36; font-size: .68rem; font-weight: 900; letter-spacing: .04em; }
.file-kind-zip { background: #3158b7; }
.file-action { min-height: 40px; display: inline-flex; align-items: center; flex: none; padding: .45rem .65rem; border: 1px solid #a9b8ca; border-radius: 8px; color: #173779; background: #fff; font-size: .78rem; font-weight: 800; text-decoration: none; }
.file-action:hover { border-color: var(--blue); background: #edf3ff; }
.task-entry-files { margin: 1rem 0 1.2rem; }
.task-entry-files h3 { margin: 0 0 .7rem; font-size: 1rem; }
.student-entry-card { border-top: 4px solid var(--blue-dark); box-shadow: 0 5px 18px rgba(17, 33, 59, .06); }
.student-entry-classwork { border-top-color: #136b58; }
.student-entry-homework { border-top-color: #8b4b13; }
.student-entry-test { border-top-color: var(--danger); }
.student-entry-card .status-badge { margin: .2rem 0 .7rem; }

@media (max-width: 590px) {
  .entry-list { padding: .75rem; }
  .entry { padding: 1rem; }
  .entry-file-list li { align-items: stretch; flex-direction: column; }
  .entry-file-info { width: 100%; }
  .entry-file-info strong { white-space: normal; }
  .file-action { width: 100%; justify-content: center; }
  .entry-actions > a { width: 100%; justify-content: center; }
}

/* v4.8: responsywne filmy oraz przesyłanie dużych plików porcjami */
.entry-video {
  overflow: hidden;
  margin: 1rem 0;
  border: 1px solid #cbd7e5;
  border-radius: 13px;
  background: #101827;
  box-shadow: 0 8px 24px rgba(17, 33, 59, .12);
}
.video-frame { width: 100%; aspect-ratio: 16 / 9; background: #05080f; }
.video-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #05080f; }
.entry-video figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .9rem;
  padding: .75rem .9rem;
  color: #e9f0fa;
  background: #17243a;
}
.entry-video figcaption > span:first-child { display: grid; min-width: 0; }
.entry-video figcaption strong { overflow-wrap: anywhere; font-size: .86rem; }
.entry-video figcaption small { margin-top: .15rem; color: #b9c7d9; font-size: .72rem; }
.video-hint { max-width: 260px; color: #c9d8ed; font-size: .72rem; line-height: 1.4; text-align: right; }
.task-video { max-width: 960px; }
.video-upload-box { border-color: #b8c8dc; background: #f7faff; }
.video-upload-progress { width: 100%; height: 16px; accent-color: var(--blue-dark); }
.video-upload-box [data-video-status] { margin: .55rem 0; }
.video-upload-box [data-video-status].is-error { color: var(--danger); font-weight: 750; }
.current-video { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.current-video p { margin: 0 0 .65rem; }

@media (max-width: 590px) {
  .entry-video { margin-inline: -.2rem; border-radius: 10px; }
  .entry-video figcaption { align-items: flex-start; flex-direction: column; }
  .video-hint { max-width: none; text-align: left; }
}

/* v4.9: prywatnościowy monitoring anomalii bezpieczeństwa */
.security-subnav { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; padding: .4rem; border: 1px solid var(--line); border-radius: 12px; background: #edf1f6; }
.security-subnav a { min-height: 42px; display: inline-flex; align-items: center; padding: .55rem .8rem; border-radius: 9px; color: #34475f; font-size: .84rem; font-weight: 800; text-decoration: none; }
.security-subnav a:hover { background: #fff; }
.security-subnav a[aria-current="page"] { color: #fff; background: var(--navy); box-shadow: 0 4px 12px rgba(17,33,59,.16); }
.security-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(230px, .6fr); gap: 1.25rem; align-items: center; overflow: hidden; border-left: 5px solid #3158b7; background: linear-gradient(135deg, #fff 0%, #f1f5ff 100%); }
.security-hero h2 { margin-bottom: .55rem; font-size: clamp(1.45rem, 2.4vw, 2rem); }
.security-hero p:last-child { max-width: 900px; margin-bottom: 0; color: #43556a; }
.security-risk { padding: 1rem; border: 1px solid #abcbb9; border-radius: 13px; color: #1d5838; background: #eef9f2; }
.security-risk.has-risk { border-color: #e1a5aa; color: #7d2029; background: #fff0f1; }
.security-risk span, .security-risk strong, .security-risk small { display: block; }
.security-risk span { font-size: .73rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.security-risk strong { margin: .35rem 0; font-size: 1.2rem; }
.security-risk small { color: inherit; opacity: .82; }
.security-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.security-metrics article { padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 4px 14px rgba(17,33,59,.045); }
.security-metrics span, .security-metrics strong, .security-metrics small { display: block; }
.security-metrics span { color: #42546a; font-size: .78rem; font-weight: 780; }
.security-metrics strong { margin: .25rem 0; color: var(--navy); font-size: 1.8rem; line-height: 1; }
.security-metrics small { color: var(--muted); font-size: .72rem; }
.security-trend .accounts-heading > p { max-width: 430px; color: var(--muted); font-size: .82rem; }
.security-bars { height: 180px; display: grid; grid-template-columns: repeat(7, minmax(32px, 1fr)); gap: .65rem; align-items: end; margin-top: 1rem; padding: 1rem 1rem .65rem; border: 1px solid var(--line); border-radius: 12px; background: repeating-linear-gradient(to top, #f8fafc 0, #f8fafc 34px, #e6ebf2 35px); }
.security-bars > div { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: .4rem; }
.security-bar { width: min(54px, 80%); min-height: 5px; align-self: end; display: flex; justify-content: center; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #4771d0, #25499d); }
.security-bar.bar-h-0 { height: 5px; background: #cbd4df; }
.security-bar.bar-h-1 { height: 10%; }
.security-bar.bar-h-2 { height: 20%; }
.security-bar.bar-h-3 { height: 30%; }
.security-bar.bar-h-4 { height: 40%; }
.security-bar.bar-h-5 { height: 50%; }
.security-bar.bar-h-6 { height: 60%; }
.security-bar.bar-h-7 { height: 70%; }
.security-bar.bar-h-8 { height: 80%; }
.security-bar.bar-h-9 { height: 90%; }
.security-bar.bar-h-10 { height: 100%; }
.security-bar i { align-self: start; transform: translateY(-1.25rem); color: #24364d; font-size: .7rem; font-style: normal; font-weight: 850; }
.security-bars small { color: var(--muted); font-size: .7rem; }
.security-filter { display: grid; grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, 1fr)); gap: .7rem; align-items: end; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #f7f9fc; }
.security-filter .actions { grid-column: 1 / -1; }
.security-alert-list { display: grid; gap: .85rem; }
.security-alert { --severity: #587089; padding: 1rem 1.1rem; border: 1px solid var(--line); border-left: 5px solid var(--severity); border-radius: 12px; background: #fff; }
.security-alert.severity-critical { --severity: #8b1722; background: #fff8f8; }
.security-alert.severity-high { --severity: #c34231; }
.security-alert.severity-medium { --severity: #d28a00; }
.security-alert.severity-low { --severity: #3570a8; }
.security-alert > header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.security-alert > header > div { display: flex; flex-wrap: wrap; gap: .4rem; }
.security-alert > header > small { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.security-severity, .security-state { display: inline-flex; min-height: 27px; align-items: center; padding: .2rem .55rem; border-radius: 999px; font-size: .7rem; font-weight: 850; }
.security-severity { color: #fff; background: var(--severity); }
.security-state { color: #34475f; background: #e9eef4; }
.security-state.state-open { color: #80212a; background: #ffe6e8; }
.security-state.state-reviewed { color: #694200; background: #fff0cf; }
.security-state.state-resolved { color: #155a35; background: #def4e7; }
.security-alert h3 { margin: .75rem 0 .35rem; font-size: 1.1rem; }
.security-alert > p { margin: 0; color: #43556a; }
.security-alert dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin: .85rem 0; }
.security-alert dl div { padding: .65rem; border: 1px solid #dce3eb; border-radius: 9px; background: #f8fafc; }
.security-alert dt { color: var(--muted); font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.security-alert dd { margin: .22rem 0 0; color: #293d55; font-size: .82rem; overflow-wrap: anywhere; }
.security-advice { padding: .75rem .85rem; border-left: 4px solid #3158b7; border-radius: 7px; background: #edf3ff; }
.security-advice p { margin: .25rem 0 0; color: #344d70; font-size: .84rem; }
.security-alert-action { display: flex; align-items: center; justify-content: flex-end; gap: .55rem; margin-top: .85rem; }
.security-alert-action label { font-size: .8rem; font-weight: 760; }
.security-alert-action select { min-height: 40px; padding: .45rem .55rem; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; }
.security-empty { padding: 1rem; border: 1px dashed #aab7c7; border-radius: 10px; color: #4b5d72; background: #f8fafc; }
.security-privacy { border-left: 5px solid #23805a; }
.security-privacy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0; }
.security-privacy-grid article { padding: 1rem; border: 1px solid #cee0d5; border-radius: 11px; background: #f5fbf7; }
.security-privacy-grid h3 { margin: 0 0 .55rem; font-size: 1rem; }
.security-privacy-grid ul, .security-rules ul { margin: 0; padding-left: 1.25rem; }
.security-privacy-grid li, .security-rules li { padding: .18rem 0; }
.security-privacy > p:last-child { margin-bottom: 0; color: var(--muted); font-size: .82rem; }
.security-rules { margin-top: 1rem; }
.security-rules summary { cursor: pointer; color: var(--navy); font-weight: 850; }
.security-rules ul { margin-top: .8rem; }

@media (max-width: 930px) {
  .security-hero { grid-template-columns: 1fr; }
  .security-metrics { grid-template-columns: 1fr; }
  .security-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .security-filter .search-field, .security-filter .actions { grid-column: 1 / -1; }
  .security-alert dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 590px) {
  .security-subnav { display: grid; }
  .security-subnav a { justify-content: center; text-align: center; }
  .security-filter { grid-template-columns: 1fr; }
  .security-filter .search-field, .security-filter .actions { grid-column: auto; }
  .security-filter .actions .button { width: 100%; }
  .security-alert > header, .security-alert-action { align-items: stretch; flex-direction: column; }
  .security-alert dl, .security-privacy-grid { grid-template-columns: 1fr; }
  .security-alert-action .button { justify-content: center; }
  .security-bars { gap: .25rem; padding-inline: .45rem; }
  .security-bar { width: 70%; }
}
