.lg {
    --lg-green: #064b35;
    --lg-gold: #f7bf09;
    max-width: 60rem;
    margin-inline: auto;
    padding: clamp(1rem, 3vw, 2rem);
    color: #163e30;
    background: #f5f7f3;
    border-radius: 1.25rem;
}
.lg header {
    padding: 1.5rem;
    border-radius: .85rem;
    background: var(--lg-green);
    color: white;
    border-bottom: .25rem solid var(--lg-gold);
}
.lg header h2, .lg header p { color: inherit; margin: .25rem 0; }
.lg header span { font-size: .85rem; }
.lg article { margin: 1rem 0; padding: 1rem; border-radius: .85rem; background: white; }
.lg form { display: grid; gap: .65rem; margin: 1rem 0; }
.lg label { display: grid; gap: .3rem; }
.lg input:not([type=hidden]), .lg textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #789285;
    border-radius: .5rem;
    font: inherit;
    padding: .65rem;
}
.lg button {
    justify-self: start;
    min-height: 44px;
    padding: .6rem 1rem;
    border: 1px solid var(--lg-green);
    border-radius: .6rem;
    background: var(--lg-green);
    color: white;
    font: inherit;
}
.lg p { overflow-wrap: anywhere; }
.lg [hidden] { display: none !important; }
.lg video { display: block; width: min(100%, 28rem); margin-top: .75rem; border-radius: .6rem; }
.lg [data-lg-badge] { background: white; width: max-content; padding: 12px; }
.lg code { overflow-wrap: anywhere; }
.lg-seance {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    padding: clamp(1.5rem, 7vw, 6rem);
    margin: 0;
    border: 0;
    background: #064b35;
    color: #fff;
    overflow: auto;
}
.lg-seance::backdrop { background: #064b35; }
.lg-seance h2, .lg-seance p { color: inherit; }
.lg-seance h2 { font-size: clamp(2rem, 6vw, 5rem); overflow-wrap: anywhere; }
.lg-seance [data-lg-message] { font-size: clamp(1.25rem, 3vw, 2.5rem); white-space: pre-wrap; }
.lg-seance p.lg-seance-label { color: #f7bf09; }
.lg .lg-seance button { background: #f7bf09; color: #163e30; }
.lg details label { margin-top: .75rem; }
.lg .lg-editor { display: grid; gap: .5rem; }
.lg .lg-writing-tools { display: flex; flex-wrap: wrap; gap: .4rem; }
.lg .lg-writing-tools button { background: #fff; color: var(--lg-green); }
.lg .lg-written { overflow-wrap: anywhere; }
.lg fieldset { min-width: 0; border: 1px solid #c9d8ca; border-radius: .6rem; }
.lg fieldset button { margin: .3rem .3rem .3rem 0; }
.lg .lg-site-choice { display: flex; gap: .5rem; align-items: center; min-height: 44px; }
.lg .lg-site-choice input[type=checkbox] { width: auto; }
.lg .lg-drawing { display: grid; gap: .5rem; }
.lg :is(.lg-drawing canvas,.lg-drawing-preview) {
    display: block;
    width: min(100%, 40rem);
    height: auto;
    border: 1px solid #a6bda9;
    border-radius: .5rem;
    background: #fff;
}
.lg .lg-drawing canvas { touch-action: none; }

body.lg-interface {
    margin: 0;
    min-height: 100vh;
    background: #f5f7f3;
    color: #163e30;
    font: 1rem/1.55 system-ui, -apple-system, sans-serif;
}
.lg-interface .lg {
    padding: clamp(.75rem, 4vw, 2.5rem);
    border-radius: 0;
}
.lg-interface .lg :is(h1,h2,h3,h4,h5,p) {
    max-width: none;
    letter-spacing: normal;
}
.lg-banner { display: grid; gap: clamp(1rem, 4vw, 1.8rem); }
.lg-banner h1 {
    margin: 0;
    color: #fff;
    font: 750 clamp(1.75rem, 6vw, 3rem)/1.08 system-ui, sans-serif;
}
.lg-wordmark { display: flex; align-items: center; gap: .65rem; }
.lg-wordmark strong { display: block; color: #fff; font-size: 1.15rem; line-height: 1.2; }
.lg-wordmark span:not(.lg-mark) { display: block; color: #e5f1e9; }
.lg-interface .lg article {
    border: 1px solid #dce6dd;
    padding: clamp(1rem, 4vw, 1.5rem);
}
.lg-interface .lg article > :first-child { margin-top: 0; }
.lg-interface .lg article > :last-child { margin-bottom: 0; }
.lg-interface .lg h4 { font-size: 1.3rem; }
.lg-interface .lg :is(input:not([type=hidden]),textarea,select) {
    color: #163e30;
    background: #fff;
}
.lg-interface .lg select {
    min-height: 44px;
    border: 1px solid #789285;
    border-radius: .5rem;
    font: inherit;
    padding: .6rem;
}
.lg-interface .lg :is(button,.lg-button) { cursor: pointer; font-weight: 650; }
.lg-interface .lg :is(button,.lg-button):focus-visible {
    outline: 3px solid #f7bf09;
    outline-offset: 2px;
}
.lg-interface .lg .lg-button {
    display: inline-block;
    background: #064b35;
    color: #fff;
    border-radius: .6rem;
    padding: .65rem 1rem;
    text-decoration: none;
}
.lg-interface .lg .lg-feedback {
    background: #edf4ed;
    border-left: 3px solid #064b35;
    padding: .75rem 1rem;
    border-radius: .35rem;
}

.lg-wordmark { justify-content: space-between; flex-wrap: wrap; }
.lg-municipal-logo {
    width: clamp(7rem, 22vw, 13rem);
    height: auto;
    max-width: 100%;
    padding: .35rem .55rem;
    background: #fff;
    border-radius: .65rem;
}
.lg-dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    margin-block: 1rem;
}
.lg-dashboard-toolbar form { margin: 0; }
.lg-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.lg-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: .75rem;
    border-radius: .65rem;
    background: #e6efe7;
    color: #064b35;
    font-weight: 700;
    text-decoration: none;
}
.lg-nav a:hover { background: #dae9dc; }
.lg-app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lg-app-tile {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    padding: .9rem;
    border: 1px solid #dce6dd;
    border-radius: .8rem;
    background: #fff;
}
.lg-app-tile :is(strong,small), .lg-app-tile div > span { display: block; }
.lg-app-tile small { color: #52665c; }
.lg-app-icon {
    display: grid;
    place-items: center;
    flex: 0 0 2.5rem;
    height: 2.5rem;
    border-radius: .65rem;
    background: #e6efe7;
    color: #064b35;
    font-weight: 800;
}
.lg-app-docs { background: #e5effb; color: #214b82; }
.lg-app-slides { background: #fff1c5; color: #614a06; }
.lg-work {
    margin-block: .65rem;
    border: 1px solid #dce6dd;
    border-radius: .85rem;
    background: #fff;
}
.lg-work > summary {
    padding: .85rem 1rem;
    cursor: pointer;
    font-weight: 700;
}
.lg-work > summary small {
    margin-inline-start: .5rem;
    color: #52665c;
    font-weight: 550;
}
.lg-interface .lg .lg-work > article { margin: 0; border: 0; border-top: 1px solid #dce6dd; }

.lg-drawing-tools {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
    gap: .65rem .85rem;
    width: 100%;
    max-width: 48rem;
}
.lg-drawing-tools > label { min-width: 0; align-content: end; }
.lg-drawing-tools :is(select, input[type=color]) {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}
.lg-interface .lg input[type=color] { min-height: 44px; padding: .25rem; }
.lg-seance .lg-drawing-preview { margin-block: .75rem; }

.lg-app-tile > a {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
    color: inherit;
    text-decoration: none;
}
.lg-office:not(:target) { display: none; }
.lg-sheet { overflow-x: auto; }
.lg-sheet table { width: 100%; border-collapse: collapse; }
.lg-sheet th, .lg-sheet td { padding: .25rem; border: 1px solid #b9c9c1; }
.lg-sheet input { width: 100%; min-width: 4.5rem; box-sizing: border-box; margin: 0; }
.lg-slide { border: 1px solid #b9c9c1; padding: 1rem; margin-block: .75rem; }

.lg-new-work {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
    padding: .8rem;
    background: #fff4c8;
    border: 1px solid #cf9d00;
    border-radius: .75rem;
}
.lg .lg-cloze input { width: min(12ch, 30%); margin: .2rem; padding: .4rem; }
.lg-seance [data-lg-media] img, .lg-seance [data-lg-media] canvas {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 66vh;
    margin: .5rem auto;
    object-fit: contain;
}
.lg-seance [data-lg-media] nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .75rem;
}

.lg-teacher { margin-top: 1rem; }
.lg-teacher-class { margin: .25rem 0 1rem; color: #42594e; font-weight: 650; }
.lg-teacher-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: 1rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.lg-teacher-tiles li { display: flex; }
.lg-teacher-tiles li a {
    box-sizing: border-box;
    display: grid;
    align-content: start;
    gap: .45rem;
    width: 100%;
    padding: 1.1rem;
    background: white;
    color: #193d31;
    text-decoration: none;
    border: 1px solid #d3dfd5;
    border-radius: .9rem;
}
.lg-teacher-tiles li a:hover { border-color: #487459; background: #fbfdfa; }
.lg-teacher-dashboard a:focus-visible, .lg-teacher-back:focus-visible {
    outline: 3px solid #176547;
    outline-offset: 3px;
}
.lg-teacher-tiles strong { font-size: 1.13rem; line-height: 1.25; }
.lg-teacher-tiles li a > span:last-child { font-size: .9rem; color: #42594e; }
.lg-teacher-icon {
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    margin-bottom: .2rem;
    border-radius: .75rem;
    background: #dceee2;
    color: #13583f;
}
.lg-teacher-icon svg { width: 1.65rem; height: 1.65rem; }
.lg-teacher-icon-rendus { background: #fff0c8; color: #685006; }
.lg-teacher-icon-projection { background: #dfebf9; color: #234f78; }
.lg-teacher-icon-tablettes { background: #ede5f5; color: #694885; }
.lg-teacher-icon-applications { background: #f8e8df; color: #80442d; }
.lg-teacher-panel { display: none; background: white; padding: clamp(1rem, 3vw, 1.65rem); border-radius: .9rem; }
.lg-teacher-panel:target { display: block; }
.lg-teacher:has(> .lg-teacher-panel:target) .lg-teacher-dashboard { display: none; }
.lg-teacher-back { font-weight: 650; }

.lg-creator-kinds {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    gap: .65rem;
    margin: 0;
    border: 0;
    padding: 0;
}
.lg-creator-kinds legend { margin-bottom: .6rem; font-weight: 700; }
.lg-creator-kinds label { position: relative; cursor: pointer; }
.lg-creator-kinds input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lg-creator-kinds label span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    border: 1px solid #bfcfc4;
    border-radius: .65rem;
    padding: .65rem .25rem;
    text-align: center;
}
.lg-creator-kinds b { font-size: 1.5rem; line-height: 1; }
.lg-creator-kinds input:checked + span { background: #dceee2; border-color: #346651; }
.lg-creator-kinds input:focus-visible + span { outline: 2px solid #176547; outline-offset: 2px; }
[data-lg-creator], [data-lg-builder] { display: grid; gap: 1rem; }
.lg-creator-choice { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; margin-bottom: .55rem; }
.lg-creator-choice > label:first-child { flex: 1 1 10rem; }
.lg-creator-choice > label:nth-child(2) { display: flex; align-items: center; min-height: 2.6rem; }
.lg-creator-choice input[type=radio] { width: auto; }
.lg-creator-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.lg-creator-preview { width: min(40rem, 92vw); border: 0; border-radius: .8rem; padding: 1.25rem; }
.lg-creator-preview::backdrop { background: #13291cb3; }
.lg .lg-preview-cloze input { width: min(12ch, 28%); margin: .2rem; }

.lg-followup-stats { display: flex; flex-wrap: wrap; gap: .7rem; padding: 0; list-style: none; }
.lg-followup-stats li { padding: .55rem .8rem; background: #e8f2e9; border-radius: .65rem; }
.lg-followup-stats strong { margin-right: .25rem; font-size: 1.2em; }
.lg-followup-scroll { overflow-x: auto; }
.lg-followup-table { width: 100%; border-collapse: collapse; text-align: left; }
.lg-followup-table caption { text-align: left; margin: .5rem 0; font-weight: 650; }
.lg-followup-table :is(th, td) { padding: .7rem .5rem; border-bottom: 1px solid #d3dfd5; }
.lg-teacher-response { margin-top: .7rem; border: 1px solid #d3dfd5; border-radius: .65rem; padding: .7rem; }
.lg-teacher-response summary { cursor: pointer; font-weight: 650; }
.lg-followup-score { padding: .7rem; background: #fff4c8; border-radius: .65rem; }

.lg-listen { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.lg-save-status:empty { display: none; }
.lg-save-status { margin: 0; color: #42594e; font-size: .9rem; }

.lg-device-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap:.75rem; padding:0; list-style:none; }
.lg-device-list li { display:grid; align-content:start; gap:.35rem; border:1px solid #d3dfd5; border-radius:.7rem; padding:.8rem; }
.lg-revision { background:#fff4cf; border:1px solid #d8b449; border-radius:.65rem; padding:.8rem; }

.lg-support-layers {
    position: relative;
    width: min(100%, 40rem);
    aspect-ratio: 2;
    border: 1px solid #a6bda9;
    border-radius: .5rem;
    overflow: hidden;
    background: white;
}
.lg .lg-support-layers canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}
.lg .lg-support-background { pointer-events: none; }
.lg-support:not([data-ready]) canvas { pointer-events: none; }
.lg-support > p:empty { display: none; }

.lg-access-code { display: grid; gap: .45rem; padding: 1rem; border-radius: .7rem; background: #e8f2e9; }
.lg-access-code code { font-size: 1.4rem; letter-spacing: .08em; }
.lg [data-lg-camera] { display: flex; flex-wrap: wrap; gap: .6rem; }
.lg [data-lg-camera] :is(video,p) { flex-basis: 100%; }

.lg-archive-filters { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,11rem),1fr)); gap:.7rem; }
.lg-teacher-response code { overflow-wrap:anywhere; }
.lg-family-preview { padding:1rem; background:#f4f7f3; border:1px solid #d3dfd5; border-radius:.8rem; }

.lg-class-summary { margin: 0 0 1.15rem; padding: 1rem; border: 1px solid #d3dfd5; border-radius: .9rem; background: white; }
.lg-class-summary h2 { margin-top: 0; }
.lg-summary-stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(7rem,1fr)); gap:.55rem; margin:.6rem 0 1rem; padding:0; list-style:none; }
.lg-summary-stats li { display:grid; gap:.12rem; padding:.7rem; border-radius:.6rem; background:#e8f2e9; }
.lg-summary-stats li:nth-child(2) { background:#fff0c8; }
.lg-summary-stats li:nth-child(3) { background:#f6e8df; }
.lg-summary-stats strong { font-size:1.55rem; }
.lg-summary-works { display:grid; padding:0; list-style:none; }
.lg-summary-works li { display:flex; flex-wrap:wrap; justify-content:space-between; gap:.35rem 1rem; padding:.5rem 0; border-top:1px solid #dce5dc; }
.lg-summary-works span { font-size:.9rem; }
.lg-help-alert { margin:0 0 .7rem; padding:.65rem .85rem; border-radius:.65rem; background:#fff0c8; }
.lg-help-alert a { font-weight:700; }
[data-lg-teacher-help] ul { display:grid; gap:.55rem; padding:0; list-style:none; }
[data-lg-teacher-help] li { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; padding:.65rem; border:1px solid #d3dfd5; border-radius:.65rem; }
.lg .lg-student-help form { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; margin:.6rem 0; }

.lg-file-folder { --file-color:#31704f; --file-bg:#e5f4e9; margin:.6rem 0; border:1px solid #d5e0d7; border-radius:.8rem; background:#fff; }
.lg-file-orange { --file-color:#994a27; --file-bg:#fbece3; }
.lg-file-blue { --file-color:#285f91; --file-bg:#e5f0ff; }
.lg-file-violet { --file-color:#67458f; --file-bg:#f0e8fa; }
.lg-file-yellow { --file-color:#78601b; --file-bg:#fff2ce; }
.lg-file-pink { --file-color:#923f67; --file-bg:#fae8f1; }
.lg-file-teal { --file-color:#236b6b; --file-bg:#e0f3f1; }
.lg-file-folder > summary, .lg .lg-file-item > summary {
    display:flex; align-items:center; gap:.65rem; min-height:3rem; padding:.45rem .7rem;
    cursor:pointer; list-style:none; overflow-wrap:anywhere;
}
.lg-file-folder > summary::-webkit-details-marker, .lg-file-item > summary::-webkit-details-marker { display:none; }
.lg-file-folder > summary::before, .lg-file-item > summary::before {
    content:''; flex:none; width:.4rem; height:.4rem; border:solid currentColor; border-width:0 2px 2px 0;
    transform:rotate(-45deg); margin-right:.15rem;
}
.lg-file-folder[open] > summary::before, .lg-file-item[open] > summary::before { transform:rotate(45deg); }
.lg-file-folder > summary:focus-visible, .lg-file-item > summary:focus-visible { outline:2px solid #176547; outline-offset:2px; }
.lg-file-folder > summary { background:var(--file-bg); color:var(--file-color); border-radius:.75rem; }
.lg-file-icon { position:relative; flex:none; width:2.1rem; height:1.75rem; display:grid; place-items:center; }
.lg-file-icon svg { position:absolute; inset:0; width:100%; height:100%; }
.lg-file-icon b { position:relative; color:white; line-height:1; font-size:.95rem; padding-top:.24rem; }
.lg-file-folder > summary small { margin-left:auto; padding:.18rem .48rem; border-radius:.5rem; background:#fff; font-weight:700; }
.lg-file-list { margin:.48rem .7rem .65rem 1.22rem; padding-left:.65rem; border-left:2px solid var(--file-bg); }
.lg .lg-file-item { margin:.35rem 0; padding:0; }
.lg .lg-file-item > :not(summary) { margin-inline:.7rem; }
.lg-file-paper { color:var(--file-color); font-size:1.15rem; flex:none; }
.lg .lg-file-item > summary small { margin-left:auto; padding:.2rem .45rem; border-radius:.45rem; font-size:.75rem; flex-shrink:0; }
.lg .lg-file-item .lg-file-status-todo { background:#e9efeb; color:#40564a; }
.lg .lg-file-item .lg-file-status-draft { background:#fff2ce; color:#654c06; }
.lg .lg-file-item .lg-file-status-sent { background:#e5f0ff; color:#254e7c; }
.lg .lg-file-item .lg-file-status-retry { background:#fbece3; color:#803a20; }
.lg .lg-file-item .lg-file-status-done { background:#e5f4e9; color:#235339; }
@media (max-width: 470px) {
    .lg-file-list { margin-left:.5rem; padding-left:.35rem; }
    .lg .lg-file-item > summary { flex-wrap:wrap; gap:.35rem; }
    .lg .lg-file-item > summary small { margin-left:1rem; }
}

.lg-expand-tools { display:flex; justify-content:flex-end; margin-bottom:.4rem; }
.lg-expanded-editor-open { overflow:hidden; }
.lg .lg-editor-expanded {
    position:fixed; z-index:200; inset:0; overflow:auto;
    padding:clamp(.65rem,2vw,1.3rem); background:#f6faf6; color:#163e30;
    border:0; border-radius:0; margin:0;
}
.lg-editor-expanded .lg-expand-tools {
    position:sticky; top:0; z-index:1; padding:.2rem 0; background:#f6faf6;
}
.lg .lg-editor-expanded [name=answer] { min-height:55dvh; }
.lg .lg-drawing.lg-editor-expanded { display:block; }
.lg .lg-drawing.lg-editor-expanded .lg-drawing-tools { margin-bottom:.65rem; }
.lg .lg-drawing.lg-editor-expanded > canvas,
.lg .lg-drawing.lg-editor-expanded .lg-support-layers {
    width:min(100%, max(28rem, calc((100dvh - 13rem) * 2)));
    max-width:100%;
    margin-inline:auto;
}
.lg .lg-drawing.lg-editor-expanded [data-lg-undo] { margin-top:.5rem; }
.lg [data-lg-slides] fieldset { margin-bottom:.65rem; }

.lg-video-work video { display:block; width:min(100%,52rem); max-height:65vh; margin:.6rem 0; background:#0b241a; border-radius:.6rem; }
.lg-video-drop { margin-top:.7rem; border:2px dashed #7c9a89; border-radius:.65rem; padding:.75rem; background:#f6faf6; }
.lg-video-drop.lg-drag-over { background:#e2f1e7; border-color:#176547; }
