/* Homepage composition and manual website browsing. Shared footer geometry stays in lab-shell.css. */
body[data-template=collection] .collection-intro{padding-top:24px}
.lab-overview>.overview-section{border:0;padding-block:44px 49px}
.lab-overview>.components-section{--home-components-bg:#f2f2f2;background:var(--home-components-bg);box-shadow:0 0 0 100vmax var(--home-components-bg);clip-path:inset(0 -100vmax);padding-block:41px 43px}
html[data-lab-theme=dark] .lab-overview>.components-section{--home-components-bg:#1b1b1b}
html[data-lab-theme] .components-section :is(.sample-button-stage,.sample-nav-stage,.sample-input-stage){border:0;border-radius:0;background:transparent}
.components-section .component-samplers{gap:30px}.components-section .sample-caption{margin-bottom:8px}
/* The preview frame brightens around its link on hover and focus. */
.components-section{--sample-outline:#A92023}
html[data-lab-theme=dark] .components-section{--sample-outline:#F28B8E}
.components-section .sample-stage-frame{position:relative;margin-bottom:22px}
.components-section .sample-component-link{position:absolute;z-index:3;inset-inline-end:6px;bottom:0;transform:translateY(50%);display:grid;place-items:center;width:44px;height:44px;color:var(--lab-ui-muted)}
.components-section .sample-component-link>svg{display:block;width:28px;height:28px;padding:5px;border-radius:4px;background:var(--home-components-bg);fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round}
.components-section .sample-component-link:is(:hover,:focus-visible){color:var(--lab-ui-ink)}
.components-section .sample-component-link:hover>svg{background:var(--lab-ui-hover)}
.components-section .sample-component-link:focus-visible{outline:2px solid var(--lab-ui-ink);outline-offset:-6px;border-radius:7px}
.components-section :is(.sample-button-stage,.sample-nav-stage,.sample-input-stage)::after{content:"";position:absolute;inset:0;pointer-events:none;border:1px dashed var(--sample-outline);opacity:0;transition:opacity .15s ease}
.components-section .component-samplers>article:is(:hover,:focus-within) :is(.sample-button-stage,.sample-nav-stage,.sample-input-stage)::after{opacity:1}
.sample-link-tooltip{position:absolute;right:0;bottom:calc(100% + 6px);z-index:4;width:max-content;max-width:200px;padding:6px 9px;border-radius:4px;background:var(--lab-ui-ink);color:var(--lab-ui-bg);font:11px/1.4 'Work Sans',Arial,sans-serif;opacity:0;visibility:hidden;pointer-events:none}
.sample-component-link:is(:hover,:focus-visible) .sample-link-tooltip{opacity:1;visibility:visible}
@media(hover:none),(pointer:coarse){
 .components-section :is(.sample-button-stage,.sample-nav-stage,.sample-input-stage)::after{opacity:1}
}
@media(prefers-reduced-motion:reduce){.components-section :is(.sample-button-stage,.sample-nav-stage,.sample-input-stage)::after{transition:none}}
.lab-overview>.apps-section{border-top:1px solid var(--lab-ui-line)}
.lab-overview .overview-colour-tools>article{border:0;padding-top:0}.lab-overview .design-card-bottom{border-top:0;margin-top:12px;padding-top:0}
.websites-section{position:relative}.websites-section>.overview-heading{margin-bottom:24px}


#overview-websites{display:flex;gap:28px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-behavior:smooth;scroll-padding-inline:20px;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:var(--lab-ui-line) transparent;padding:2px 20px 13px;margin-inline:-20px;width:calc(100% + 40px);max-width:none;min-width:0}
#overview-websites>.design-card{flex:0 0 calc((100% - 28px)/2);min-width:0;scroll-snap-align:start;scroll-snap-stop:normal}
#overview-websites:focus-visible{outline:2px solid var(--lab-ui-ink);outline-offset:5px}
@media(max-width:840px){.components-section .component-samplers{gap:17px}}
@media(max-width:600px){body[data-template=collection] .collection-intro{padding-top:20px}.lab-overview>.overview-section{padding-block:32px 36px}.lab-overview>.components-section{padding-block:30px 33px}.components-section .component-samplers{gap:24px}#overview-websites{gap:20px}#overview-websites>.design-card{flex-basis:100%}.websites-section>.overview-heading{margin-bottom:15px}}
@media(prefers-reduced-motion:reduce){#overview-websites{scroll-behavior:auto}}

/* Quiet category labels and clearer collection links. */
body[data-template=collection] .overview-eyebrow{font:400 13px/1.4 'Work Sans',Arial,sans-serif;letter-spacing:0;text-transform:none}
body[data-template=collection] .overview-heading>a{display:inline-flex;align-items:center;gap:16px;min-height:44px;padding:0;color:var(--lab-ui-ink);font:500 14px/1.4 'Work Sans',Arial,sans-serif;white-space:nowrap}
body[data-template=collection] .overview-heading>a:hover:hover{text-decoration:underline;text-underline-offset:5px}
#sample-idea{padding-inline:14px}
.sample-idea-field{position:relative}
.sample-idea-field>input{display:block}
.sample-idea-field:has(.sample-idea-flight) #sample-idea::placeholder{opacity:0}
.sample-idea-flight{position:absolute;z-index:1;top:50%;inset-inline:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none;color:var(--lab-ui-ink);font-size:15px}
.sample-idea-actions{display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--lab-ui-muted);font-size:10px}
.sample-idea-actions>button{min-height:32px;padding:4px 7px;color:var(--lab-ui-ink);font-weight:500}
.sample-idea-actions>button:enabled:is(:hover,:focus-visible){text-decoration:underline;text-underline-offset:3px}
@media(pointer:coarse){.sample-idea-actions>button{min-height:44px}}
/* Keep each app complexity badge beside its type label in all card lists. */
.design-card.is-app .design-card-info{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;column-gap:8px;row-gap:5px}
.design-card.is-app .design-card-info>div{display:contents}.design-card.is-app .design-card-info h3{grid-column:1;grid-row:1;min-width:0}.design-card.is-app .design-card-info p{grid-column:1/-1;grid-row:2;margin-top:0}.design-card.is-app .design-card-info .design-level{grid-column:2;grid-row:1;display:inline-flex;align-self:start;margin-top:0}
@media(max-width:600px){body[data-template=collection] .overview-heading>a{font-size:13px}.design-card.is-app .design-card-info{column-gap:6px}.design-card.is-app .design-card-info .design-level{font-size:8px}}

/* One compact count and filter row; the main header owns category navigation. */
.collection-meta{display:flex;align-items:center;justify-content:space-between;gap:24px;padding:18px 0 22px}
.collection-meta>p{flex:1 1 auto;min-width:0}
.collection-meta .browse-fields{flex:0 1 480px;gap:14px}
.collection-meta .collection-search{flex:1 1 auto;min-width:0}
.collection-meta .collection-search input{width:100%;min-width:0}
.collection-meta .browse-fields>label:nth-child(2){flex:0 0 auto}
.collection-meta .browse-fields select{max-width:142px}
.catalog-colour-picker{position:relative;display:grid;place-items:center;flex:0 0 40px;width:40px;height:40px;padding:10px;border:0;border-radius:4px;background:transparent;color:var(--lab-ui-muted)}
.catalog-colour-picker>svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.catalog-colour-picker:hover{background:var(--lab-ui-hover);color:var(--lab-ui-ink)}
.catalog-colour-picker:focus-visible{outline:2px solid var(--lab-ui-ink);outline-offset:2px}
.catalog-colour-picker:is(:hover,:focus-visible)>.card-action-tooltip{opacity:1;visibility:visible;transform:none}
@media(max-width:840px){.collection-meta{align-items:stretch;flex-direction:column;gap:8px;padding-block:16px 20px}.collection-meta>p{max-width:none}.collection-meta .browse-fields{flex:none;width:100%;justify-content:space-between}.collection-meta .collection-search kbd{display:none}}
@media(max-width:600px){.collection-meta{gap:6px;font-size:10px}.collection-meta .browse-fields{display:grid;grid-template-columns:minmax(0,1fr) auto 36px;gap:6px}.collection-meta .browse-fields select{max-width:120px;padding-left:10px}.collection-meta .collection-search{gap:7px}.catalog-colour-picker{width:36px;height:36px;padding:8px}}

/* A single visual route into the colour workspace. */
.colour-gateway{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);align-items:center;gap:48px;padding:36px;background:var(--lab-ui-surface);color:var(--lab-ui-ink);text-decoration:none}
.colour-gateway-copy h2{max-width:14ch;margin:14px 0 26px;font:500 clamp(30px,3vw,42px)/1.08 'Work Sans',Arial,sans-serif;letter-spacing:-1.6px}
.colour-gateway-cta{display:inline-flex;align-items:center;gap:28px;min-height:44px;font:500 13px/1.4 'Work Sans',Arial,sans-serif}
.colour-gateway-cta>span{font-size:23px;transition:transform .16s}
.colour-gateway:hover .colour-gateway-cta{text-decoration:underline;text-underline-offset:5px}
.colour-gateway:hover .colour-gateway-cta>span{transform:translate(2px,-2px)}
.colour-gateway:focus-visible{outline:2px solid var(--lab-ui-ink);outline-offset:5px}
.colour-gateway-art{display:flex;height:190px;overflow:hidden}
.colour-gateway-art>i{display:block;flex:1;background:var(--swatch)}
@media(max-width:600px){.colour-gateway{grid-template-columns:1fr;gap:22px;padding:24px}.colour-gateway-copy h2{font-size:32px;margin-block:12px 13px;max-width:15ch}.colour-gateway-art{height:100px}.colour-gateway-cta{font-size:12px}}
@media(prefers-reduced-motion:reduce){.colour-gateway-cta>span{transition:none}.colour-gateway:hover .colour-gateway-cta>span{transform:none}}
/* Keep the quiet download action beside each title, with one count line below. */
.design-card .design-card-top{position:relative;z-index:2;gap:8px;min-width:0}
.design-card .design-card-title{flex:1 1 auto;min-width:0;overflow:hidden}
.design-card .design-card-title>span{flex-shrink:0}
.design-card .design-card-title h2{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.design-card-actions{display:flex;align-items:center;justify-content:flex-end;gap:4px;flex:0 0 auto}
.design-card-actions>:is(.save-design,.download-design){position:relative;display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;min-width:30px;min-height:30px;padding:5px;border:0;border-radius:4px;line-height:1}
.design-card-actions>.download-design,.design-card-actions>.save-design:not([aria-pressed=true]){background:transparent;color:var(--lab-ui-muted)}
.design-card-actions>:is(.save-design,.download-design)>svg{display:block;width:16px;height:16px;flex-shrink:0;stroke-width:1.25;stroke-linecap:round;stroke-linejoin:round}
.design-card-actions>.download-design>svg{fill:none;stroke:currentColor}
.design-card-actions>.save-design>svg.is-filled{fill:currentColor}
.design-card-actions>:is(.save-design,.download-design):hover{background:var(--lab-ui-hover);color:var(--lab-ui-ink)}
.design-card-actions>:is(.save-design,.download-design):focus-visible{outline:2px solid var(--lab-ui-ink);outline-offset:-2px}
.card-action-tooltip{position:absolute;top:calc(100% + 6px);right:0;z-index:20;display:block;width:max-content;max-width:calc(100vw - 24px);padding:5px 8px;border:1px solid var(--lab-ui-soft-line);border-radius:3px;background:var(--lab-ui-raised);color:var(--lab-ui-muted);font:10px/1.3 'Work Sans',Arial,sans-serif;white-space:nowrap;opacity:0;visibility:hidden;transform:translateY(-2px);pointer-events:none;transition:opacity .12s,transform .12s,visibility .12s}
.design-card-actions>button:is(:hover,:focus-visible)>.card-action-tooltip{opacity:1;visibility:visible;transform:translateY(0)}
.design-card>.design-card-bottom{display:block;gap:0;min-width:0}
.design-card.is-app .design-card-info p{min-height:0}
.design-card.is-app>.design-card-bottom{margin-top:10px;padding-top:9px}
.lab-overview .design-card.is-app>.design-card-bottom{margin-top:10px;padding-top:0}
.design-card>.design-card-bottom>span{display:block;white-space:nowrap}
@media(max-width:600px){.design-card .design-card-top{gap:6px}.design-card-actions{gap:2px}.design-card-actions>:is(.save-design,.download-design){flex-basis:28px;width:28px;height:28px;min-width:28px;min-height:28px;padding:4px}}
@media(prefers-reduced-motion:reduce){.card-action-tooltip{transition:none}}

/* App screen browsing stays with its preview, outside the template link. */
.design-preview-shell{position:relative;min-width:0;--preview-control-glass:rgba(255,255,255,.72);--preview-control-glass-hover:rgba(255,255,255,.88);--preview-control-glass-line:rgba(255,255,255,.8)}
html[data-lab-theme=dark] .design-preview-shell{--preview-control-glass:rgba(28,28,28,.72);--preview-control-glass-hover:rgba(38,38,38,.9);--preview-control-glass-line:rgba(255,255,255,.2)}
.collection-grid.apps{column-gap:26px}
.app-preview-controls{position:absolute;z-index:2;inset:0;pointer-events:none;color:var(--lab-ui-ink)}
.app-preview-controls button{position:absolute;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:inherit;padding:14px;box-shadow:none;pointer-events:auto;cursor:pointer;touch-action:manipulation}
/* Centre the artwork on the edge, with most of the hit area inside the preview. */
.app-preview-controls [data-preview-step="-1"]{left:-7px;--app-chevron-offset:-15px}
.app-preview-controls [data-preview-step="1"]{right:-7px;--app-chevron-offset:15px}
.app-preview-controls button::before,.website-preview-scroll::before{content:"";position:absolute;inset:6px;z-index:0;border:1px solid var(--preview-control-glass-line);border-radius:50%;background:var(--preview-control-glass);box-shadow:inset 0 1px 0 #ffffff4d,0 2px 10px #00000017;-webkit-backdrop-filter:blur(12px) saturate(1.15);backdrop-filter:blur(12px) saturate(1.15);pointer-events:none}
.app-preview-controls button::before{inset:9px;transform:translateX(var(--app-chevron-offset));opacity:.44;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);transition:opacity .15s}
.app-preview-controls button:is(:hover,:focus-visible,:active)::before{opacity:.9}
.website-preview-scroll:is(:hover,.is-dragging)::before{background:var(--preview-control-glass-hover)}
.app-preview-controls button:focus-visible,.website-preview-scroll:focus-visible{outline:none}
.app-preview-controls button:focus-visible::before,.website-preview-scroll:focus-visible::before{outline:2px solid var(--lab-ui-ink);outline-offset:2px}
.app-preview-controls svg{position:relative;z-index:1;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;transform:translateX(var(--app-chevron-offset));opacity:.72;transition:opacity .15s;pointer-events:none}
.app-preview-controls button:is(:hover,:focus-visible,:active) svg{opacity:1}
.app-preview-count{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(hover:none){.app-preview-controls svg{opacity:.88}}
@media(prefers-reduced-motion:reduce){.app-preview-controls button::before,.app-preview-controls svg{transition:none}}

/* A draggable right-edge handle skims the website inside its preview. */
.website-preview-scroll-rail{position:absolute;z-index:3;top:30px;bottom:30px;right:-20px;width:44px;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .15s,visibility .15s}
.design-preview-shell:is(:hover,:focus-within) .website-preview-scroll-rail{opacity:1;visibility:visible}
.website-preview-scroll{position:absolute;left:0;top:0;transform:translateY(-50%);display:grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--lab-ui-ink);box-shadow:none;cursor:ns-resize;pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none}
.website-preview-scroll::before{left:8px;right:4px}
.website-preview-scroll svg{position:relative;z-index:1;width:18px;height:18px;transform:translateX(2px);fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
@media(hover:none){.website-preview-scroll-rail{opacity:1;visibility:visible}}
@media(prefers-reduced-motion:reduce){.website-preview-scroll-rail{transition:none}}

/* Give phone searches a full line and keep native fields large enough to
   edit without the browser zooming the page on focus. */
@media(max-width:600px){
 .collection-meta .browse-fields{grid-template-columns:minmax(0,1fr) 44px;gap:6px 12px}
 .collection-meta .collection-search{grid-column:1/-1;min-height:44px}
 .collection-meta .collection-search input,.collection-meta .browse-fields select{font-size:16px;min-height:44px}
 .collection-meta .browse-fields>label:nth-child(2){min-width:0}
 .collection-meta .browse-fields select{max-width:100%;width:100%;padding-left:0;border-left:0}
 .catalog-colour-picker{width:44px;height:44px;padding:12px}
 #sample-idea,.sample-idea-flight{font-size:16px}
 .design-card-actions>:is(.save-design,.download-design){flex-basis:40px;width:40px;height:40px;min-width:40px;min-height:40px;padding:10px}
}
