/* Shared header column: sidhuvudet delar exakt kanter med panelen (RAM.md §3).
   affischen-shell.css saknar bredd för .smidity-public-header i arctic-läget;
   den regeln bor här tills skalet tar över den (STATUS punkt 1). */
html[data-smidity-theme="arctic"] .smidity-public-header{width:min(var(--content-width,1328px),calc(100% - 2 * var(--page-gutter,clamp(20px,4vw,56px))))!important;max-width:var(--content-width,1328px)!important;margin-inline:auto!important;box-sizing:border-box!important}

/* I ramen bär ramen yttre måttet: panelen ska ta ramen 100%, inte ramen
   minus 2*gutter. Annars hamnar panelen 52 px in mot ramen (71+52=123 mot
   sidhuvudets 71/1369 vid 1440; 20+20=40 mot 20 vid 390). Gutters ligger
   redan utanför ramen (smidity-editor-host.css:9).
   Specificiteten matchar affischen-shell.css:709:s
   html[data-smidity-theme="arctic"] :is(main.smidity-tool-start, …) — både
   !important och samma selektor ⇒ senare stylesheet vinner. Tool-start.css
   laddas före shellen (HTML-ordning), så ramen anropar ännu högre
   specificitet för att vinna oavsett ordning. */
html[data-smidity-theme="arctic"][data-smidity-editor-frame] :is(main.smidity-tool-start, .smidity-tool-page, .smidity-tool-column){width:100%!important;max-width:100%!important;margin-inline:0!important;padding-inline:0!important}
/* Sidhuvudet i ramen tar ramens yttre mått, samma som panelen. Regeln på rad 4
   räknar bort två gutters (calc(100% - 2*gutter)) och ger 52 px inbredd mot
   panelen när ramen redan är gutterfri (mätt: handling/wheels 1440, header
   [52,1246] mot panel [0,1298]). Specificiteten (0,3,1) slår rad 4. */
html[data-smidity-theme="arctic"][data-smidity-editor-frame] .smidity-public-header{width:100%!important;max-width:100%!important;margin-inline:0!important}
/* Panelens överkant ligger 20 px under linjen i ramen även på mobil; media-regeln
   ovan (margin 14 px) gav 14 px (mätt: panelTop 70, linje 56 vid 390). */
@media(max-width:680px){html[data-smidity-theme="arctic"][data-smidity-editor-frame] .smidity-tool-panel{margin-top:20px!important}}

/* Introduktionsheadern i startpanelen staplas alltid vertikalt: rubrik överst,
   ingress under, båda med samma vänsterkant som korten. Klädstudion är
   referensen. Gäller alla bredder, inklusive mobil — ingen tvåspaltsuppställning.
   ped-tools.css / animation.css / chain.css har header{display:flex} + header
   padding som överskriver :where()-regeln nedan, så här används en starkare
   selektor som även nollställer headerns inre padding. */
header.smidity-tool-start__intro{display:block!important;padding-inline:0!important;border:none!important}

/* Shared entry surface. File selection and processing stay with each tool. */
.smidity-tool-start,
.smidity-tool-page,
.smidity-tool-column{font-family:Manrope,system-ui,sans-serif;color:var(--smidity-text);width:min(var(--content-width,1328px),calc(100% - 2 * var(--page-gutter,clamp(20px,4vw,56px))))!important;max-width:var(--content-width,1328px)!important;margin-inline:auto!important;padding-inline:0!important;box-sizing:border-box!important}
.smidity-tool-start *{box-sizing:border-box}

/* Shared panel: height matches content, no fixed 800px or excess dead space */
.smidity-tool-panel,
.smidity-tool-start__panel{width:100%!important;max-width:100%!important;margin:20px 0 32px 0!important;padding:24px 28px!important;border:1px solid var(--smidity-border)!important;border-radius:14px!important;background:var(--smidity-surface)!important;box-sizing:border-box!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}

/* Shared consent checkbox: inside the drop zone under the action buttons */
.smidity-tool-start__consent{display:flex;align-items:center;justify-content:center;gap:10px;margin:16px 0 0 0;font:400 14px/1.5 Manrope,system-ui,sans-serif;color:var(--smidity-text);cursor:pointer;position:relative;z-index:1}
.smidity-tool-start__consent input[type=checkbox]{accent-color:var(--smidity-mint);cursor:pointer;width:16px;height:16px;flex-shrink:0}

.smidity-tool-start__intro h1{margin:0;font:500 clamp(30px,3.8vw,48px)/1.08 SpaceGrotesk,Manrope,sans-serif;letter-spacing:-.04em}
.smidity-tool-start__intro>p{max-width:70ch;margin:14px 0 0;color:var(--smidity-text-muted);line-height:1.7}
/* Rubrik och ingress står i en kolumn under varandra (referensbildens form).
   :where() håller 0-specificitet, så verktygens egna h1/p-regler kan fortfarande vinna. */
:where(.smidity-tool-start__intro){display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.smidity-tool-start__intro > [data-smidity-page-beta]{justify-self:start}
:where(.smidity-tool-start__intro h1){margin:0}
:where(.smidity-tool-start__intro>p){margin:0}
.smidity-tool-start__facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:24px 0;padding:0;list-style:none}
.smidity-tool-start__facts li{padding:16px;border:1px solid var(--smidity-border);border-radius:8px;background:var(--smidity-surface);line-height:1.5}
.smidity-tool-start__facts strong{display:block;margin-bottom:6px;color:var(--smidity-text,#fff)}
.smidity-tool-start .docs-links a{color:var(--smidity-text,#fff)}
.smidity-tool-start__facts span{color:var(--smidity-text-muted)}
.smidity-tool-start__drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;min-height:200px;padding:24px;border:1px dashed var(--smidity-border);border-radius:10px;background:var(--smidity-background);text-align:center}
.smidity-tool-start__drop:focus-within{outline:2px solid var(--smidity-mint);outline-offset:3px}
.smidity-tool-start__drop h2{margin:0;font:500 20px/1.3 SpaceGrotesk,Manrope,sans-serif}
.smidity-tool-start__drop p,.smidity-tool-start__empty{margin:0;color:var(--smidity-text-muted);line-height:1.6}
.smidity-tool-start__actions{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.smidity-tool-start__actions :is(button,label){display:inline-flex;align-items:center;justify-content:center;min-height:44px;margin:0;padding:10px 16px;border:1px solid var(--smidity-border);border-radius:8px;background:var(--smidity-surface);color:var(--smidity-text);font:600 13px/1.3 Manrope,system-ui,sans-serif;cursor:pointer}
.smidity-tool-start__actions :is(button,label):hover{border-color:var(--smidity-mint)}
html[data-smidity-theme="arctic"] .smidity-tool-start .smidity-tool-start__drop input[type=file]{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;opacity:0;cursor:pointer}
html[data-smidity-theme="arctic"] .smidity-tool-panel .smidity-tool-start__drop input[type=file]{position:absolute;inset:0;width:100%;height:100%;min-height:0;padding:0;border:0;opacity:0;cursor:pointer}
.smidity-tool-start__actions{position:relative;z-index:1;pointer-events:none}
.smidity-tool-start__actions :is(button,label){pointer-events:auto}
.smidity-tool-start__empty{margin-top:18px}
.smidity-tool-start__error{margin-top:16px;padding:12px 14px;border:1px solid currentColor;border-radius:8px;line-height:1.5}
.smidity-tool-start [lang=sv],html[lang=sv] .smidity-tool-start [lang=en]{display:none}
html[lang=sv] .smidity-tool-start [lang=sv]{display:initial}
/* Samma växling i panelen (fordonssidorna har ingen .smidity-tool-start-klass). */
.smidity-tool-panel [lang=sv],html[lang=sv] .smidity-tool-panel [lang=en]{display:none}
html[lang=sv] .smidity-tool-panel [lang=sv]{display:initial}
html[lang=en] .smidity-tool-panel [lang=sv]{display:none!important}
html[lang=en] .smidity-tool-panel [lang=en]{display:initial}
@media(max-width:680px){.smidity-tool-panel,.smidity-tool-start__panel{padding:16px 14px!important;margin:14px 0 24px 0!important}.smidity-tool-start__facts{grid-template-columns:minmax(0,1fr)}.smidity-tool-start__drop{min-height:180px;padding:20px 12px}.smidity-tool-start__actions{width:100%}}
/* Full kontrast i tomt läge: "Välj filer" ser aldrig gråtonad ut. */
.smidity-tool-start__actions :is(button,label){color:var(--smidity-text)}

/* RÄTTNING-2: mätaren läser getComputedStyle(label) — säkerställ full kontrast
   även när editor.css jämfört på senare kaskadsteg (label basregel). */
.smidity-tool-panel .smidity-tool-start__actions :is(button,label){color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__actions label{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__consent{color:var(--smidity-text)!important}
/* Fordonssidorna laddar /vehicles/editor.css först och tool-start.css saknar
   färg på h1 — den ärver editor.css body #e8edf2 i stället för
   --smidity-text. Ingress/facts/drop-p är explicit muted (var(--smidity-text-muted)). Det är
   nedtoningen på bilden. Full färg på alla panelnivåer i tomt läge,
   oavsett vilken stilmall som laddades först. */
.smidity-tool-panel .smidity-tool-start__intro h1{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__intro>p{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__facts strong{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__facts span{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__drop h2{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__drop p{color:var(--smidity-text)!important}
.smidity-tool-panel .smidity-tool-start__actions :is(button,label){color:var(--smidity-text)!important}

/* Tom rad under header: skalets arctic-regel (rad 353) ger headern
   border-bottom var(--smidity-border) — det är den vågräta linjen mellan header och
   panel på bilden. I tomt läge ska den bort. */
html[data-smidity-theme="arctic"] body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header{
 border-bottom:0!important;padding-bottom:13px!important}
/* Kantlinjen tas bort; 1 px läggs i stället under innehållet så att logotypen står på startsidans y (ledarbeslut 2026-11-11). */
@media(max-width:640px){html[data-smidity-theme="arctic"] body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header{padding-bottom:1px!important}}

/* Panelen ska sträcka sig lika brett som headern (Bilddom c): editor.css ger
   main 3-kolumns-grid, så tvinga panelen över alla kolumner och huvudet till
   en kolumn. Bredden ägs av ramen (smidity-editor-host.css: ramen tar
   yttre måttet, panel 100% av ramen) — ingen egen bredd/pad här. */
main:has(> .smidity-tool-panel) > .smidity-tool-panel{grid-column:1/-1!important}
html[data-smidity-theme="arctic"] main:has(> .smidity-tool-panel){
 display:block!important;height:auto!important;min-height:0!important;overflow:visible!important;max-width:100%!important}
main:has(> .smidity-tool-panel[hidden]){display:none!important}
/* Verktygens egna workspace-main (glass/debadge/donor/part-offset) har padding
   18 px (8 px på mobil) och insätter panelen mot ramen (mätt: [18,1280] mot
   [0,1298] vid 1440, [10,310] mot [0,320] vid 390). I ramen ska panelen ta
   ramens yttre mått. */
html[data-smidity-theme="arctic"][data-smidity-editor-frame] main:has(> .smidity-tool-panel){padding:0!important}

/* Tomt läge: verktygsradens behållare ska inte ta någon höjd alls — ingen
   min-height/padding/bakgrund kvar. Knapparna döljs redan av skalet
   (affischen-shell.css:732); behållaren döljs helt så inget tomt band syns. */
html[data-smidity-theme="arctic"]:not([data-smidity-workspace="active"]) body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header .smidity-tool-controls,
html[data-smidity-theme="arctic"]:not([data-smidity-workspace="active"]) body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header .smidity-workspace-toolbar-inner{
 display:none!important}
/* Headerns egna box är panel-färg (skalets [data-smidity-header]-regel); i
   tomt läge tas den sunden av nav-raden i body-grund så ingen extra låda syns. */
html[data-smidity-theme="arctic"] body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header[data-smidity-header]{
 background:var(--smidity-background)!important}
html[data-smidity-theme="arctic"] body:has(.smidity-tool-panel:not([hidden])) .smidity-public-header[data-smidity-header] .smidity-public-account{
 background:var(--smidity-surface)!important}
/* Fristående verktyg utan iframe använder samma avstånd till rubriken. */
html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]) body:has(#model-form) main.smidity-tool-start,
html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]) main.mlo-wrap.smidity-tool-start { padding-top: 40px !important; }
@media(max-width:680px){
 html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]) body:has(#model-form) main.smidity-tool-start,
 html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]) main.mlo-wrap.smidity-tool-start { padding-top: 32px !important; }
}

/* Fordonsverktygens gemensamma start och Face3D följer sidhuvudets kolumn. */
html[data-smidity-theme="arctic"][data-smidity-editor-frame] body:has(main:not(.smidity-tool-start)> .smidity-tool-panel:not([hidden])) > [data-smidity-header]{height:20px!important;min-height:20px!important;max-height:20px!important;padding:0!important}
html[data-smidity-theme="arctic"][data-smidity-editor-frame] main:not(.smidity-tool-start):has(> .smidity-tool-panel:not([hidden])){width:min(var(--content-width,1328px),calc(100% - 2 * var(--page-gutter,clamp(20px,4vw,56px))))!important;max-width:var(--content-width,1328px)!important;margin-inline:auto!important}
html[data-smidity-theme="arctic"][data-smidity-editor-frame] main:not(.smidity-tool-start)> .smidity-tool-panel:not([hidden]),
html[data-smidity-theme="arctic"] :is(main[data-face3d-status],main#main:has(.tools-gated))> .smidity-tool-panel{padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}
/* Bandets bakgrund börjar vid ramens överkant även när startpanelen har toppmarginal. */
html[data-smidity-theme="arctic"][data-smidity-editor-frame] main:not(.smidity-tool-start):has(> .smidity-tool-panel:not([hidden]))::before{top:-40px!important}
@media(max-width:680px){
 html[data-smidity-theme="arctic"][data-smidity-editor-frame] body:has(main:not(.smidity-tool-start)> .smidity-tool-panel:not([hidden])) > [data-smidity-header]{height:12px!important;min-height:12px!important;max-height:12px!important}
 html[data-smidity-theme="arctic"][data-smidity-editor-frame] main:not(.smidity-tool-start):has(> .smidity-tool-panel:not([hidden]))::before{top:-32px!important}
}
html[data-smidity-theme="arctic"] :is(main[data-face3d-status],main#main:has(.tools-gated)){padding-top:40px!important}
html[data-smidity-theme="arctic"] :is(main[data-face3d-status],main#main:has(.tools-gated))> .smidity-tool-panel{margin:0!important}
@media(max-width:680px){html[data-smidity-theme="arctic"] :is(main[data-face3d-status],main#main:has(.tools-gated)){padding-top:32px!important}}

/* Fristående verktygsstarter har samma nattfärg under det tonade bandet. */
html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]):has(:is(main[data-face3d-status],main.mlo-wrap,main #model-form,main#main .tools-gated)),
html[data-smidity-theme="arctic"]:not([data-smidity-editor-frame]):has(:is(main[data-face3d-status],main.mlo-wrap,main #model-form,main#main .tools-gated)) body{background-color:var(--smidity-night,#060a11)!important}
