.km-shell{--km-border:#d7dce2;--km-bg:#f5f7f9;--km-card:#fff;--km-text:#17202a;--km-primary:#1d5f91;color:var(--km-text);font-size:15px;line-height:1.45}.km-shell *{box-sizing:border-box}.km-mobile-title{display:none}.km-nav{display:flex;flex-wrap:wrap;gap:6px;padding:8px;margin-bottom:18px;background:var(--km-bg);border:1px solid var(--km-border);border-radius:12px;position:sticky;top:0;z-index:5}.km-nav a{padding:9px 12px;border-radius:8px;text-decoration:none;color:inherit;font-weight:600}.km-nav a.active{background:var(--km-primary);color:#fff}.km-main h1{font-size:1.8rem}.km-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.km-two{display:grid;grid-template-columns:minmax(280px,420px) minmax(0,1fr);gap:16px}.km-card{background:var(--km-card);border:1px solid var(--km-border);border-radius:12px;padding:16px;margin:0 0 16px;box-shadow:0 1px 2px rgba(0,0,0,.04)}.km-card h2,.km-card h3{margin-top:0}.km-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.km-form-grid label{display:flex;flex-direction:column;gap:5px;font-weight:600}.km-form-grid input:not([type=checkbox]),.km-form-grid select,.km-form-grid textarea,.km-filter select,.km-card textarea{width:100%;min-height:42px;padding:8px 10px;border:1px solid #b8c0c8;border-radius:8px;background:#fff;color:#111}.km-full{grid-column:1/-1}.km-inline{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.km-button,.km-icon-button{min-height:38px;padding:8px 12px;border:1px solid #aab2ba;border-radius:8px;background:#fff;cursor:pointer;color:#111}.km-primary{background:var(--km-primary);border-color:var(--km-primary);color:#fff;font-weight:700}.km-icon-button{min-width:38px;padding:6px}.km-link-danger{border:0;background:none;color:#b32d2e;text-decoration:underline;cursor:pointer}.km-filter{display:flex;gap:8px;max-width:600px;margin-bottom:16px}.km-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}.km-table{width:100%;border-collapse:collapse;min-width:640px}.km-table th,.km-table td{padding:9px;border-bottom:1px solid var(--km-border);vertical-align:top;text-align:left}.km-table th{background:#f7f8fa;white-space:nowrap}.km-table input{max-width:190px}.km-done{opacity:.55;text-decoration:line-through}.km-alert{padding:10px 12px;border-radius:8px;margin-bottom:14px}.km-success{background:#edf8ef;border:1px solid #76b980}.km-error{background:#fff0f0;border:1px solid #d88787}.km-tool-status{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0}.km-tool-status span{padding:5px 8px;border-radius:999px;background:#eef1f4}.km-ok{color:#146c2e}.km-warn{color:#8a5700}.km-duplicate{background:#fff7e6}.km-list-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
@media(max-width:850px){.km-mobile-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.km-nav{display:none;position:static}.km-nav.open{display:grid;grid-template-columns:1fr 1fr}.km-two,.km-form-grid{grid-template-columns:1fr}.km-full{grid-column:auto}.km-filter{flex-direction:column}.km-shell{font-size:14px}.km-main h1{font-size:1.45rem}.km-card{padding:12px}.km-table{min-width:560px}.km-button{min-height:44px}.km-form-grid input:not([type=checkbox]),.km-form-grid select,.km-form-grid textarea{font-size:16px;min-height:46px}}
@media(max-width:480px){.km-nav.open{grid-template-columns:1fr}.km-inline{align-items:stretch;flex-direction:column}.km-inline>*{width:100%}.km-table{min-width:520px}}
@media print{.km-nav,.km-mobile-title,.km-main>h1,.km-card:not(.km-print-area),.km-print{display:none!important}.km-print-area{border:0;box-shadow:none;padding:0}.km-table{min-width:0}.km-table th,.km-table td{padding:5px;font-size:10pt}.km-shell{font-size:10pt}}

/* Browserbasierter Dateiimport */
.km-import-status{margin:12px 0 16px;padding:10px 12px;border-radius:8px;background:#eef2f6;border:1px solid #d8e0e7;font-weight:600}
.km-import-status.km-ok{background:#eef8f0;border-color:#b9dfc1}
.km-import-status.km-warn{background:#fff8e8;border-color:#efd69c}
.km-import-progress-wrap{margin-top:6px}
.km-import-progress{height:10px;border-radius:999px;overflow:hidden;background:#e5e7eb;margin-bottom:6px}
.km-import-progress span{display:block;height:100%;width:0;background:currentColor;transition:width .2s ease}
.km-import .km-help{margin-bottom:0}
@media(max-width:700px){.km-import-status{font-size:14px}.km-import input[type=file]{max-width:100%}}

/* Gut sichtbare, synchronisierte horizontale Tabellen-Navigation */
.km-scroll-top{overflow-x:auto;overflow-y:hidden;height:16px;margin:2px 0 4px;border-radius:6px;background:#f0f2f4;scrollbar-gutter:stable}
.km-scroll-top-inner{height:1px}
.km-table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-gutter:stable}
.km-students-table{min-width:1050px}
@media(max-width:700px){.km-scroll-top{height:18px}.km-students-table{min-width:980px}}

/* Screenshot-Import aus der Zwischenablage */
.km-paste-zone{border:2px dashed #9bb2c7;border-radius:10px;padding:16px;background:#f8fbfd;cursor:text;outline:none;transition:border-color .15s ease,background .15s ease,box-shadow .15s ease}
.km-paste-zone:focus{border-color:var(--km-primary,#1d5f91);box-shadow:0 0 0 3px rgba(29,95,145,.12)}
.km-paste-zone.km-paste-ready{border-style:solid;border-color:#65a975;background:#f1faf3}
.km-paste-zone-title{font-size:16px;margin-bottom:5px}
.km-paste-zone-text{color:#4d5965;margin-bottom:10px}
.km-paste-zone kbd{display:inline-block;min-width:24px;padding:2px 5px;border:1px solid #b8c0c8;border-bottom-width:2px;border-radius:5px;background:#fff;font:inherit;font-size:.9em;text-align:center}
.km-paste-actions{display:flex;gap:8px;flex-wrap:wrap}
.km-paste-preview{display:flex;align-items:center;gap:12px;margin-top:12px;padding-top:12px;border-top:1px solid #dce4ea}
.km-paste-preview img{width:120px;max-height:80px;object-fit:contain;border:1px solid #cfd8df;border-radius:6px;background:#fff}
.km-paste-preview span{font-weight:600;overflow-wrap:anywhere}
@media(max-width:700px){.km-paste-actions{flex-direction:column}.km-paste-actions .km-button{width:100%}.km-paste-preview{align-items:flex-start}.km-paste-preview img{width:90px}}

.km-import-preview-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:12px}.km-import-preview-actions p{margin:0}.km-button.km-danger{background:#b32d2e;color:#fff;border-color:#b32d2e}.km-button.km-danger:hover{background:#8f2424;color:#fff}.km-editable-students input,.km-editable-students textarea{box-sizing:border-box;min-width:120px;width:100%}.km-editable-students td:nth-child(6),.km-editable-students td:nth-child(7){min-width:210px}.km-editable-students td:nth-child(6) input,.km-editable-students td:nth-child(7) input{display:block;margin-bottom:5px}.km-editable-students td:last-child{min-width:110px}.km-editable-students{min-width:1650px}
@media(max-width:700px){.km-import-preview-actions{align-items:stretch}.km-import-preview-actions form,.km-import-preview-actions p,.km-import-preview-actions button{width:100%}.km-editable-students{min-width:1550px}}

/* Schüler-Hinzufügen ein-/ausblenden */
.km-student-add-controls{display:flex;justify-content:flex-start;margin:0 0 10px}
.km-student-layout.km-add-hidden{grid-template-columns:minmax(0,1fr)}
.km-student-add-panel[hidden]{display:none!important}
@media(max-width:850px){.km-student-add-controls .km-button{width:100%}}


/* Stundenpläne */
.km-timetable-grid{align-items:start}
.km-timetable-list{margin-top:18px}
.km-timetable-item{border-top:1px solid #e0e4e8;padding-top:14px;margin-top:14px}
.km-timetable-item:first-child{border-top:0}
.km-timetable-image{display:block;width:100%;height:auto;max-height:720px;object-fit:contain;border:1px solid #d8dde3;border-radius:8px;background:#fff}
.km-timetable-pdf{display:block;width:100%;height:620px;border:1px solid #d8dde3;border-radius:8px;background:#fff}
@media(max-width:850px){.km-timetable-pdf{height:70vh;min-height:420px}.km-timetable-image{max-height:none}}

/* Klassenliste: fixierbare Spalten + mitlaufende horizontale Scrollleiste */
.km-column-pin-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0;padding:8px 10px;background:#f7f8fa;border:1px solid var(--km-border);border-radius:8px;font-size:13px}
.km-column-pin-label{font-weight:700}.km-pin-option{display:inline-flex;align-items:center;gap:3px;white-space:nowrap;font-weight:400}.km-pin-reset{border:1px solid #aab2ba;background:#fff;border-radius:6px;padding:5px 8px;cursor:pointer}
.km-students-table .km-pinned-col{position:sticky;left:var(--km-pin-left,0);z-index:2;background:#fff;background-clip:padding-box}
.km-students-table thead .km-pinned-col{z-index:4;background:#f7f8fa}
.km-students-table .km-pinned-edge{box-shadow:5px 0 7px -6px rgba(0,0,0,.55)}
.km-scroll-floating{display:none;position:fixed;bottom:8px;height:18px;overflow-x:auto;overflow-y:hidden;z-index:9998;background:#f0f2f4;border:1px solid #c9cfd5;border-radius:7px;box-shadow:0 2px 8px rgba(0,0,0,.18);scrollbar-gutter:stable}
.km-scroll-floating.is-visible{display:block}.km-scroll-floating-inner{height:1px}
@media(max-width:700px){.km-column-pin-toolbar{align-items:flex-start}.km-scroll-floating{bottom:5px;height:20px}}

.km-parent-columns{margin:16px 0 20px;padding:14px;border:1px solid #d9e1ea;border-radius:8px;background:#f8fafc}
.km-parent-columns h3{margin-top:0}
.km-parent-column-options{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.km-parent-column-options label{display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
@media (max-width:700px){.km-parent-column-options{align-items:flex-start;flex-direction:column}.km-parent-column-options label{white-space:normal}}

/* 0.2.16: komplette Spalten (Kopf + alle Datenzeilen) wirklich fixieren */
.km-table-scroll{position:relative}
.km-students-table.km-has-pinned-columns{border-collapse:separate!important;border-spacing:0!important}
.km-students-table thead th.km-pinned-col,
.km-students-table tbody td.km-pinned-col,
.km-students-table tfoot td.km-pinned-col{position:-webkit-sticky!important;position:sticky!important;left:var(--km-pin-left,0)!important;background:#fff!important;background-clip:padding-box!important}
.km-students-table thead th.km-pinned-col{z-index:12!important}
.km-students-table tbody td.km-pinned-col,.km-students-table tfoot td.km-pinned-col{z-index:8!important}
.km-students-table tbody tr:nth-child(odd) td.km-pinned-col,.km-students-table tbody tr:nth-child(even) td.km-pinned-col{background:#fff!important}
.km-students-table .km-pinned-edge{box-shadow:6px 0 8px -7px rgba(0,0,0,.75)!important}

/* Bulk-Speichern und Elternportal-Zeilenfreigabe */
.km-bulk-save-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-top:14px;padding:12px 0}
.km-parent-row-control{white-space:nowrap;min-width:118px}
.km-parent-row-control label{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.km-bulk-students-form .km-table-scroll{margin-bottom:0}
@media (max-width:700px){.km-bulk-save-bar{align-items:stretch;flex-direction:column}.km-bulk-save-bar button{width:100%}}

/* 0.2.19: gespeicherte Listen eindeutig kennzeichnen, einklappen und löschen */
.km-saved-list .km-list-toolbar{align-items:flex-start}
.km-list-title-wrap h3{margin:0}.km-list-ident{display:flex;gap:6px;flex-wrap:wrap;align-items:baseline}.km-list-class{font-weight:700}.km-list-date{font-weight:600}.km-list-name{font-weight:700}
.km-list-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.km-list-actions form{margin:0}
.km-list-body[hidden]{display:none!important}
.km-saved-list.km-list-collapsed{padding-bottom:14px}
@media(max-width:700px){.km-saved-list .km-list-toolbar{align-items:stretch;flex-direction:column}.km-list-actions{justify-content:flex-start}.km-list-actions .km-button,.km-list-actions form{width:100%}.km-list-actions form .km-button{width:100%}}
@media print{.km-list-actions{display:none!important}.km-list-body[hidden]{display:block!important}.km-saved-list{break-inside:avoid}}

.km-class-actions{display:flex;align-items:flex-start;gap:8px;flex-wrap:wrap;min-width:210px}.km-class-actions .km-button,.km-class-actions .button{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;margin:0!important;line-height:1.25}.km-class-actions a{position:relative;float:none!important}
@media(max-width:700px){.km-class-actions{min-width:170px;flex-direction:column;align-items:stretch}.km-class-actions .km-button,.km-class-actions .button{width:100%;white-space:normal;text-align:center}}

/* v0.2.23 Elternportal-Zugang direkt bearbeitbar */
.km-portal-inline-form{display:flex;flex-direction:column;gap:8px;min-width:230px;max-width:320px}.km-portal-inline-form label{display:block}.km-portal-inline-form input[type=text],.km-portal-inline-form input[type=date]{width:100%;box-sizing:border-box}.km-portal-inline-form .km-button,.km-portal-inline-form .button{align-self:flex-start;white-space:normal}
@media(max-width:782px){.km-portal-inline-form{min-width:210px}}

/* Listen bearbeiten */
.km-list-edit-panel{margin:14px 0 18px;padding:16px;border:1px solid #d9e1e8;border-radius:8px;background:#f8fafc}
.km-list-edit-panel[hidden]{display:none!important}
.km-list-edit-form .km-help{display:block;margin-top:4px;color:#667085}
.km-list-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
@media(max-width:700px){.km-list-actions>.km-button,.km-list-actions>form{width:100%}.km-list-actions form .km-button{width:100%}}

/* Listen: Drei-Zustände-Schalter */
.km-list-state-help{margin:0 0 10px}.km-list-state{font-size:19px;font-weight:700;line-height:1;min-width:40px}.km-list-state-0{opacity:.75}.km-list-state-1{background:#eef8f0;border-color:#77a980}.km-list-state-2{background:#fff2f2;border-color:#c98b8b}.km-check-form{margin:0}.km-check-form .km-icon-button{display:inline-flex;align-items:center;justify-content:center}

.km-list-save{background:#218838!important;border-color:#218838!important;color:#fff!important;font-weight:700}.km-list-dirty .km-list-save{box-shadow:0 0 0 3px rgba(33,136,56,.18)}


/* v0.2.29 Elternportal: Klassenliste standardmäßig eingeklappt */
.km-parent-classlist{margin:18px 0}.km-parent-classlist>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;user-select:none}.km-parent-classlist>summary::-webkit-details-marker{display:none}.km-parent-classlist-hide{display:none}.km-parent-classlist[open] .km-parent-classlist-show{display:none}.km-parent-classlist[open] .km-parent-classlist-hide{display:inline}.km-parent-classlist-content{margin-top:14px}.km-parent-classlist-content h3{margin-top:0}
@media(max-width:700px){.km-parent-classlist>summary{width:100%;box-sizing:border-box}.km-parent-classlist-content .km-table-scroll{-webkit-overflow-scrolling:touch}}
