.custom-tools{max-width:1200px;margin:auto;padding:calc(20px + env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) max(20px,env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px))}
.custom-tools [hidden]{display:none!important}
.custom-tools .page-outil__header h1{min-width:0;overflow-wrap:anywhere}
.custom-tools .custom-tools-back{width:auto;min-width:44px;padding:0 14px;gap:8px;white-space:nowrap;font-size:.85rem}
.custom-tools .custom-tools-back::before{content:none}
.custom-tools .custom-tools-back .tool-back__chev{display:block;width:8px;height:8px;flex:none;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);font-size:0}
@media(max-width:560px){.custom-tools .page-outil__header:has(.custom-tools-back){grid-template-columns:max-content minmax(0,1fr) auto}}
.custom-prompt{margin:20px 0;padding:16px;border:1px solid var(--border,#d9e1ea);border-radius:12px;background:var(--surface,#fff)}
.custom-prompt .custom-toolbar{margin:0}.custom-prompt h3{margin:0}.custom-prompt p{line-height:1.6}.custom-prompt summary{cursor:pointer}
#ai-prompt{display:block;width:100%;margin-top:12px;padding:12px;resize:vertical;border:1px solid #bdc9d6;border-radius:8px;font:14px/1.6 system-ui;white-space:pre-wrap;background:#fafcff;color:#15253c}
#prompt-copy-status{color:#287b6c;margin-bottom:0}
#editor-memory-status{margin-bottom:0;color:#287b6c}#code-copy-status{line-height:1.6;color:#287b6c}
.custom-toolbar,.custom-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.custom-toolbar{justify-content:space-between;margin:16px 0}
.custom-toolbar h2{margin:0}.custom-toolbar p{margin:8px 0}
.custom-local-note,.custom-help{font-size:.9rem;line-height:1.6;color:var(--text-muted,#536477);margin:16px 0}
.custom-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:16px;margin:24px 0}
.custom-card{border:1px solid var(--border,#d9e1ea);background:var(--surface,#fff);border-radius:16px;padding:20px;overflow-wrap:anywhere}
.custom-card h3{margin:0 0 10px}.custom-card p{white-space:pre-wrap}.custom-card time{display:block;font-size:.8rem;color:var(--text-muted,#536477);margin:12px 0}
.custom-card-header{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.custom-card-header h3{flex:1;min-width:0}.custom-card-open{border:0;background:transparent;color:inherit;font:inherit;font-weight:700;text-align:left;cursor:pointer;padding:4px 0;min-height:44px;width:100%;overflow-wrap:anywhere}
.custom-more{flex:none;min-width:44px;min-height:44px;border:1px solid #bdc9d6;border-radius:10px;font-size:28px;line-height:1;background:white;color:#1a2744;cursor:pointer}
.custom-card-status{font-size:.85rem;color:#536477}
.custom-menu{width:calc(100% - 32px);max-width:520px;border:1px solid #bdc9d6;border-radius:16px;padding:24px;color:#1a2744}
.custom-menu::backdrop{background:#14203988}.custom-menu .custom-toolbar{margin-top:0}.custom-menu-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.custom-menu .custom-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start}.custom-menu h2{overflow-wrap:anywhere}#menu-close{min-width:44px;padding:8px}
.custom-publication{margin-top:20px;border-top:1px solid #d9e1ea;padding-top:20px}.custom-publication p{font-size:.9rem;line-height:1.5}.custom-publish-check{display:flex;gap:10px;align-items:center;font-weight:700;min-height:44px}.custom-publish-check input{width:20px;height:20px;flex:none}
#menu-author{display:block;width:100%;padding:10px;font:inherit;border:1px solid #bdc9d6;border-radius:8px;margin-top:8px}
.custom-catalog-toolbar{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap;margin:24px 0}.custom-catalog-toolbar label{display:flex;flex-direction:column;gap:8px}.custom-catalog-toolbar label:first-child{flex:1;min-width:200px}.custom-catalog-toolbar input,.custom-catalog-toolbar select{padding:12px;border:1px solid #bdc9d6;border-radius:8px;font:inherit;width:100%;background:white;color:#1a2744}
#catalog-list [aria-pressed=true]{background:#d9eee8;border-color:#287b6c}#catalog-preview{margin-top:24px}
.custom-card .custom-actions{gap:6px}.custom-card .btn{font-size:.85rem;min-height:44px}
.custom-tabs{display:flex;gap:4px;margin-top:20px}.custom-tabs button{font:inherit;padding:12px 20px;border:1px solid #bdc9d6;background:#eff3f8;border-radius:8px 8px 0 0;cursor:pointer}
.custom-tabs [aria-selected=true]{color:white;background:#1a2744}
.custom-code{display:block;width:100%;min-height:330px;resize:vertical;padding:16px;border:1px solid #bdc9d6;border-radius:0 8px 8px 8px;font:14px/1.6 Consolas,monospace;tab-size:2;color:#15253c;background:#fafcff;white-space:pre;overflow:auto}
#tool-form>.custom-actions{margin-top:16px}
#runtime iframe{display:block;width:100%;height:75dvh;min-height:420px;border:1px solid #bdc9d6;border-radius:12px;background:white}
#editor:not([hidden])~#runner #runtime iframe{height:60dvh}
.custom-error{margin-top:20px;padding:16px;border:1px solid #b9333d;background:#fff3f3;border-radius:12px;color:#7a1820}
.custom-error pre{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.5 Consolas,monospace;max-height:240px;overflow:auto}
#notice{padding:12px;border-radius:8px;background:#eef6f4;white-space:pre-wrap}
#delete-dialog{max-width:500px;width:calc(100% - 32px);border:1px solid #bdc9d6;border-radius:16px;padding:24px}
#delete-dialog::backdrop{background:#14203988}
@media(max-width:600px){.custom-tools{padding:calc(12px + env(safe-area-inset-top,0px)) max(12px,env(safe-area-inset-right,0px)) max(12px,env(safe-area-inset-bottom,0px)) max(12px,env(safe-area-inset-left,0px))}.custom-toolbar{align-items:flex-start}.custom-toolbar .custom-actions{width:100%}.custom-tabs button{padding:12px 16px}.custom-code{min-height:280px}#runtime iframe{min-height:380px;height:70dvh}}
.custom-runtime-stage{position:relative}
.custom-tools-body-fs{overflow:hidden!important}
#tool-stage:fullscreen{width:100vw;height:100dvh;background:white}
#tool-stage:-webkit-full-screen{width:100vw;height:100dvh;background:white}
#tool-stage.is-fullscreen-fallback{position:fixed;inset:0;z-index:1000001;width:100%;height:100dvh;background:white}
.custom-tools-body-fs #tool-stage #runtime{width:100%;height:100%}
.custom-tools-body-fs #runner #tool-stage #runtime iframe{width:100%;height:100%;min-height:0;border:0;border-radius:0}
.custom-fullscreen-exit{position:absolute;top:max(12px,env(safe-area-inset-top));right:max(12px,env(safe-area-inset-right));z-index:2;min-height:44px;min-width:80px;background:white!important;color:#1a2744!important;border:1px solid #bdc9d6;box-shadow:0 3px 16px #14203933}
.custom-grid{grid-template-columns:repeat(auto-fill,minmax(170px,1fr))}
.custom-card{position:relative;padding:0;background:linear-gradient(145deg,#fff,#f1f5fb);box-shadow:0 3px 12px #1420390a;transition:box-shadow .15s,transform .15s}
.custom-card:hover{box-shadow:0 6px 20px #14203918;transform:translateY(-2px)}
.custom-card h3{margin:0;width:100%}.custom-card-header{display:block}
.custom-card-open{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:160px;padding:26px 16px 22px;text-align:center;line-height:1.35;font-size:1rem;overflow-wrap:normal;word-break:normal;hyphens:none}
.custom-card-open>span:last-child{max-width:100%;white-space:normal}
.custom-card-icon{font-size:2.5rem;line-height:1.3}
.custom-more{position:absolute;right:6px;top:6px;border:0;background:transparent;font-size:26px}
.custom-icon-picker{grid-column:1/-1;min-width:0;border:1px solid #bdc9d6;border-radius:12px;padding:12px 16px}
.custom-icon-picker label{max-width:250px}.custom-icon-picker details{margin-top:12px}.custom-icon-picker summary{cursor:pointer;min-height:44px;align-content:center}
.custom-icon-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(46px,1fr));gap:8px;max-height:240px;overflow:auto;padding:8px 0}
.custom-icon-grid button{min-height:48px;border:1px solid #d9e1ea;border-radius:10px;background:#fff;font-size:1.6rem;cursor:pointer}
.custom-icon-grid button[aria-pressed=true]{background:#d9eee8;border:2px solid #287b6c}
.custom-preview{width:calc(100% - 24px);max-width:1100px;max-height:94dvh;border:1px solid #bdc9d6;border-radius:16px;padding:20px;color:#1a2744;background:#fff;overflow:auto;overscroll-behavior:contain}
.custom-preview::backdrop{background:#142039a6}.custom-preview>.custom-toolbar{margin-top:0}.custom-preview h2{overflow-wrap:anywhere}
#preview-runtime iframe,.custom-preview #runtime iframe{display:block;width:100%;height:60dvh;min-height:250px;border:1px solid #bdc9d6;border-radius:12px;background:white}
#menu-description{white-space:pre-wrap;overflow-wrap:anywhere}#menu-details{white-space:pre-line}
.custom-menu{max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
.custom-menu>.custom-toolbar{position:sticky;top:-24px;padding:12px 0;background:white;z-index:3}
.custom-menu>.custom-toolbar h2{font-size:1.3rem}
#catalog-menu-description{white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:600px){.custom-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,160px),1fr));gap:10px}.custom-card-open{padding:36px 12px 20px;min-height:155px}.custom-preview{padding:12px}.custom-preview>.custom-toolbar{position:sticky;top:-12px;background:white;z-index:2;padding:8px 0}.custom-preview .custom-actions{gap:6px}}
.custom-editor-intro{line-height:1.6;color:var(--text-muted,#536477)}
.custom-step{margin:20px 0;padding:24px;border:1px solid var(--border,#d9e1ea);border-radius:16px;background:var(--surface,#fff)}
.custom-step h3{display:flex;align-items:center;gap:10px;margin:0 0 20px;font-size:1.2rem;line-height:1.4}
.custom-step-number{display:inline-flex;align-items:center;justify-content:center;flex:none;width:32px;height:32px;border-radius:50%;background:#287b6c;color:white;font-size:1rem}
.custom-step p{line-height:1.6}.custom-step>.custom-toolbar{margin:0 0 16px}.custom-step>.custom-toolbar h3{margin:0}
.custom-builder-fields{display:grid;gap:16px}.custom-builder-fields label,.custom-builder-label{display:block;font-weight:600;line-height:1.5}
.custom-builder-fields input:not([type=checkbox]),.custom-builder-fields textarea,.custom-builder-fields select,.custom-builder-label textarea{box-sizing:border-box;display:block;width:100%;margin-top:8px;padding:12px;border:1px solid #bdc9d6;border-radius:10px;background:#fafcff;color:#1a2744;font:inherit;line-height:1.5;resize:vertical}
.custom-builder-fields .custom-publish-check{display:flex;align-items:flex-start;gap:10px;padding:12px;border-radius:10px;background:#f1f5fb;font-weight:500;cursor:pointer}
.custom-builder-fields .custom-publish-check input[type=checkbox]{box-sizing:border-box;flex:0 0 20px;width:20px;height:20px;margin:2px 0 0;padding:0;accent-color:#287b6c}
.custom-audience-label{display:flex;align-items:center;gap:10px}.custom-info-button{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid #bdc9d6;border-radius:50%;background:#f1f5fb;color:#1a2744;font:bold 1.1rem Georgia,serif;cursor:pointer}
.custom-info-button:focus-visible{outline:3px solid #287b6c;outline-offset:3px}.custom-audience-help{padding:4px 16px;margin-top:12px;background:#eef6f4;border:1px solid #cbded9;border-radius:12px;color:#43536a;line-height:1.6}
.custom-builder-fields .custom-local-note{margin:0}.custom-builder-options{min-width:0;border:0;padding:0;margin:24px 0 16px}
.custom-builder-options legend{font-weight:700;margin-bottom:6px}.custom-builder-options>.custom-publish-check{padding:12px;margin:8px 0;background:#f1f5fb;border-radius:10px;font-weight:500;cursor:pointer;line-height:1.5;align-items:flex-start}
.custom-builder-options input[type=checkbox]{accent-color:#287b6c;margin-top:2px}.custom-optional{font-weight:400;color:#536477}
#memory-options{margin:12px 0;padding:16px;border-left:3px solid #287b6c;border-radius:8px;background:#eef6f4}
.custom-appearance>summary,.custom-prompt>details>summary{cursor:pointer;min-height:44px;align-content:center;font-weight:600}
.custom-appearance .custom-icon-picker{box-sizing:border-box;max-width:680px;border:1px solid #d9e5e2;padding:20px;margin:8px 0 0;background:#f7faf9;border-radius:16px}
.custom-icon-current{display:flex;align-items:center;gap:18px}
.custom-icon-preview{display:flex;align-items:center;justify-content:center;flex:none;width:80px;height:80px;overflow:hidden;border:1px solid #cbded9;border-radius:20px;background:#fff;box-shadow:0 3px 10px #1a274408;font-size:2.5rem;line-height:1}
.custom-icon-entry{min-width:0}.custom-icon-picker .custom-icon-entry label{display:block;font-weight:600;margin:0 0 6px}
.custom-icon-entry input{box-sizing:border-box;display:block;width:156px;max-width:100%;min-height:48px;padding:8px 12px;border:1px solid #b7c9c4;border-radius:10px;background:#fff;color:#1a2744;font:inherit;font-size:1.4rem;line-height:1.3}
.custom-icon-entry #tool-icon-hint{margin:8px 0 0;color:#536477;font-size:.88rem;line-height:1.5}
.custom-icon-picker>details{margin-top:18px;padding-top:10px;border-top:1px solid #dce7e4}
.custom-icon-picker summary{color:#43536a;font-size:.92rem;font-weight:600}
.custom-icon-grid{grid-template-columns:repeat(auto-fill,minmax(48px,1fr));gap:8px;max-height:256px;padding:8px 4px 4px}
.custom-icon-grid button{display:flex;align-items:center;justify-content:center;min-width:0;height:48px;padding:0;border:2px solid transparent;box-shadow:0 0 0 1px #dce5e2;border-radius:12px;font-size:1.55rem;transition:background .15s,border-color .15s}
.custom-icon-grid button:hover{background:#edf5f2;border-color:#abcfc3}
.custom-icon-grid button[aria-pressed=true]{background:#dff1ea;border:2px solid #287b6c;box-shadow:none}
.custom-icon-grid button:focus-visible,.custom-icon-entry input:focus-visible{outline:3px solid #287b6c;outline-offset:3px}
@media(max-width:480px){.custom-appearance .custom-icon-picker{padding:14px}.custom-icon-current{gap:12px;align-items:flex-start}.custom-icon-preview{width:60px;height:60px;border-radius:16px;font-size:2rem}.custom-icon-grid{gap:8px}}
.custom-prompt>details{margin-top:16px}.custom-code-step .custom-actions{margin-top:16px}
.custom-designer-error{color:#b42318;font-weight:600}
.custom-tools .custom-catalog-header{grid-template-columns:max-content minmax(0,1fr);gap:12px}
.custom-tools .custom-catalog-back{width:auto;font-size:.9rem;padding:0 14px;gap:10px;line-height:1;white-space:nowrap;flex-shrink:0}
.custom-tools .custom-catalog-back::before{content:none}
.custom-tools .custom-catalog-back .tool-back__chev{display:block;box-sizing:border-box;width:8px;height:8px;flex:none;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg)}
.custom-needs{padding:16px;border:1px solid #cbded9;background:#f0f7f5;border-radius:12px;margin:16px 0;overflow-wrap:anywhere}
.custom-needs h3{font-size:1.05rem;margin:0 0 12px}.custom-needs h4{font-size:.95rem;margin:16px 0 6px}.custom-needs p{line-height:1.55;margin:6px 0}.custom-needs p:last-child{font-size:.9rem;color:#43536a;margin-top:16px}
.custom-access-dialog{max-width:650px}.custom-access-dialog label:not(.custom-publish-check){display:block;font-weight:600;margin:14px 0}
.custom-access-dialog select{display:block;width:100%;padding:12px;margin:8px 0;border:1px solid #bdc9d6;border-radius:8px;background:white;color:#1a2744;font:inherit}
.custom-access-dialog input[type=number]{display:block;width:100%;padding:12px;margin:8px 0;border:1px solid #bdc9d6;border-radius:8px;font:inherit}
.custom-access-students{max-height:230px;overflow:auto;border:1px solid #d9e1ea;padding:12px;border-radius:10px;margin:12px 0}.custom-access-dialog fieldset{border:1px solid #d9e1ea;border-radius:10px;margin:16px 0}
.custom-access-mode{display:flex;flex-wrap:wrap;gap:8px 24px;padding:8px 12px}.custom-access-mode legend{font-weight:600}.custom-access-mode label{cursor:pointer}.custom-access-mode input[type=radio]{accent-color:#287b6c}
.custom-access-students .custom-access-team-members{margin:0 0 12px 30px;color:#536477;font-size:.85rem;overflow-wrap:anywhere}
.custom-access-dialog p{line-height:1.6}.custom-review-proposal{position:absolute;top:12px;left:12px;z-index:3;background:#fff2cf!important;color:#513800!important;border:2px solid #be8900;box-shadow:0 3px 16px #14203933}
.custom-access-needs{padding:14px;background:#eef6f4;border-left:3px solid #287b6c;border-radius:8px;font-weight:600}
#tool-read-fields{margin:12px 0;padding:16px;border:1px solid #cbded9;border-radius:10px;background:#f5f9f8}
#tool-read-fields .custom-publish-check{font-weight:500}
.custom-editor-section{margin:24px 0;padding:20px;border:1px solid #cddcd8;border-radius:16px;background:#fff}
.custom-editor-section>h3,.custom-editor-section>.custom-toolbar h3{font-size:1.25rem;margin:0}
.custom-editor-section>p{line-height:1.6;color:#43536a}
.custom-prompt-options>summary{cursor:pointer;font-weight:600;padding:14px 0;min-height:44px}
.custom-analysis-status{font-weight:600}.custom-analysis-warning{color:#85420c;background:#fff5df;border-radius:8px;padding:10px}
#preview-data{margin:12px 0}#preview-data>summary{cursor:pointer;font-weight:600;padding:12px 0;min-height:44px}
@media(max-width:600px){.custom-editor-section{padding:12px}}
@media(max-width:600px){.custom-step{padding:16px;margin:16px 0}.custom-step h3{font-size:1.08rem}.custom-step-number{width:28px;height:28px}#memory-options{padding:12px}}

.custom-card-likes{position:absolute;top:12px;left:12px;display:inline-flex;align-items:center;gap:4px;padding:4px 8px;border-radius:999px;background:var(--surface,#fff);color:var(--text,#1a2744);font-size:.8rem;font-weight:700;line-height:1.4;pointer-events:none}
.custom-card--catalog .custom-card-open{padding-top:44px}
.custom-card--catalog{display:flex;flex-direction:column;position:relative}
.custom-card--catalog>.custom-more{position:absolute;top:12px;right:12px}
.custom-card-footer{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:auto;padding:10px;box-sizing:border-box}
.custom-card-data{display:flex;align-items:center;flex-wrap:wrap;gap:4px;min-height:44px;max-width:100%}
.custom-data-badge{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;flex:none;border:1px solid #dbe4ec;border-radius:10px;background:#f3f7fa;font-size:20px;cursor:pointer}
.custom-data-badge:focus-visible{outline:3px solid #287b6c;outline-offset:2px}
.custom-card-additions{white-space:nowrap;font-size:.85rem;font-weight:700;color:#536477;margin-left:auto}
.custom-card .custom-card-hint{font-size:.85rem;color:#536477;line-height:1.5;margin:0;padding:0 12px 12px}
.custom-catalog-legend{display:flex;flex-wrap:wrap;gap:8px 18px;font-size:.85rem;color:#536477;margin:12px 0}
/* Shared teacher preview and trusted student shell. */
.custom-share-dialog { width:min(960px, 96vw); max-width:96vw; max-height:94dvh; overflow:auto; }
.custom-share-stage iframe, #student-runtime iframe { width:100%; min-height:420px; border:1px solid #dbe2ea; border-radius:12px; }
.custom-share-field { display:grid; grid-template-columns:24px minmax(100px,1fr) minmax(130px,1fr); gap:8px; align-items:center; margin:12px 0; }
.custom-share-field small { grid-column:2/-1; overflow-wrap:anywhere; }
.custom-share-field input:not([type=checkbox]), .custom-share-field select { width:100%; min-width:0; padding:8px; }
.custom-share-dialog > label { display:block; margin:16px 0; }
.custom-share-dialog > button { margin:8px 8px 8px 0; }
.custom-student-results { padding:16px; background:#f2f6fa; border-radius:12px; margin:16px 0; }
.custom-student-results label { display:block; margin:12px 0; }
.custom-student-results input, .custom-student-results select { padding:10px; max-width:100%; }
@media(max-width:520px) { .custom-share-field { grid-template-columns:24px minmax(0,1fr); } .custom-share-field select { grid-column:2; } }
.custom-ai-warning { padding:14px 16px; border-left:4px solid #b87112; background:#fff7e7; color:#553708; border-radius:8px; line-height:1.6; }
#creation-assistant > summary { cursor:pointer; font-weight:700; padding:8px 0; font-size:1.15rem; }
#creation-assistant[open] > summary { margin-bottom:16px; }
#tool-results-summary, #share-results-summary { padding:12px 16px; background:#eef8f6; border-radius:10px; line-height:1.6; margin:12px 0; }
#share-results-settings > summary, #share-results-settings details > summary { cursor:pointer; padding:12px 0; font-weight:600; }
#share-results-settings select { max-width:100%; }
.custom-data-badge[data-kind=audience] { white-space:nowrap; font-size:.78rem; }
