/* Homepage responsive layout; base rules are in homepage-core.css. */
@media(max-width:860px){
 .image-tool-site .home-core.hero{padding:20px 16px calc(152px + env(safe-area-inset-bottom))}
 .image-tool-site .home-core h1{text-wrap:balance}
 .image-tool-site .home-core .comparison{grid-template-columns:repeat(2,minmax(0,1fr));gap:1px;background:var(--line)}
 .image-tool-site .home-core .home-preview+.home-preview{border-top:0}
 .image-tool-site .home-core .preset-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;overflow:visible;padding-bottom:8px}
 .image-tool-site .home-core .preset-list button{min-width:0;padding:8px 4px}
 .image-tool-site .home-core :is(.home-quick-adjustments,.home-advanced) .adjustments{grid-template-columns:minmax(0,1fr)}
 .image-tool-site .home-core .utility-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .image-tool-site .home-core .utility-actions button{padding:8px;min-height:44px}
 .image-tool-site .home-core .home-save-slot{min-height:128px}
 .image-tool-site .home-core .home-save{grid-template-columns:104px minmax(0,1fr);gap:8px 12px}
 .image-tool-site .home-core .home-save.is-editor-visible{position:fixed;z-index:40;inset:auto 0 0;margin:0;padding:8px max(16px,env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:var(--bg);border-top:1px solid var(--line)}
 .image-tool-site .home-core .download{width:100%;min-height:44px}
 .home-result-grid,.home-effect-copy,.home-scene-grid{grid-template-columns:minmax(0,1fr)}
 .tool-directory .directory-grid{gap:40px}
 .directory-grid article{padding-bottom:24px;border-bottom:1px solid var(--line)}
 .directory-grid article:last-child{border-bottom:0}
 .directory-grid .text-link,.ideas .text-link{display:inline-flex;align-items:center;min-height:44px}
 .image-tool-site .home-core .inspector-toolbar{gap:12px}
 .image-tool-site .home-core #closeInspector{min-height:44px;min-width:72px}
}
@media(max-width:860px) and (max-height:500px){
 .image-tool-site .home-core .home-save.is-editor-visible{position:static;border:0;padding:8px 0}
 .image-tool-site .home-core.hero{padding-bottom:24px}
 .image-tool-site .home-core .home-save-slot{min-height:0}
}

/* More Image Tools: compact text directory, scoped to the homepage. */
.image-tool-site .tool-directory .directory-more{margin-top:2.5rem}
.image-tool-site .directory-more>h3{font-size:1.125rem;margin:0 0 .75rem}
.image-tool-site .tool-directory .directory-more-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(250px,100%),1fr));gap:0 1.75rem}
.image-tool-site .directory-more-grid>a{display:block;padding:.85rem 0;border-top:1px solid rgba(127,127,127,.28);text-decoration:none;color:inherit;min-width:0;min-height:44px}
.image-tool-site .directory-more-grid>a strong{display:block;font-size:1rem;font-weight:600;line-height:1.35}
.image-tool-site .directory-more-grid>a span{display:block;margin-top:.3rem;font-size:.875rem;line-height:1.5;opacity:.72}
.image-tool-site .directory-more-grid>a:hover strong,.image-tool-site .directory-more-grid>a:focus-visible strong{text-decoration:underline;text-underline-offset:3px}
.image-tool-site .directory-more-grid>a:focus-visible{outline:2px solid var(--accent);outline-offset:4px}

/* An open adjustment panel keeps a compact, uncropped live comparison in view. */
@media(max-width:860px) and (min-height:501px){
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-column{position:sticky;top:64px;z-index:30;background:var(--bg);border-bottom:1px solid var(--line)}
 .image-tool-site .home-core-tool:has(details[open]) .comparison{grid-template-columns:repeat(2,minmax(0,1fr));gap:1px}
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-image{height:clamp(88px,18svh,144px);aspect-ratio:auto}
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-caption{min-height:32px;padding:4px 8px;font-size:12px}
 .image-tool-site .home-core-tool:has(details[open]) :is(.home-input-label,.home-source-badge,.home-upload-notes,.home-preview-caption span){display:none}
 .image-tool-site .home-core-tool:has(details[open]) .home-preview+.home-preview{border-top:0}
 .image-tool-site .home-core-tool:has(details[open]) .home-input{border-radius:8px}
 .image-tool-site .home-core :is(.home-quick-adjustments,.home-advanced){scroll-margin-top:260px}
}

@media(max-width:860px){
 .image-tool-site .home-core .home-preview-caption{font-size:12px;min-height:64px;padding:8px}
 .image-tool-site .home-core .home-preview-caption span{font-size:11px}
}
/* Detail inspection takes priority over the compact editing preview. */
.image-tool-site .home-core-tool:has(>#inspector:not([hidden])) .home-preview-column{position:static}
@media(max-width:860px) and (min-height:501px){
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-column>p{display:none}
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-caption{min-height:0;height:auto;padding:4px 8px}
}

@media(max-width:860px) and (min-height:501px){
 .image-tool-site .home-core-tool:has(details[open]) .home-preview-column{position:static}
}

.home-tool-shortcuts{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 20px;margin:0 auto 20px}
.home-tool-shortcuts a{display:inline-flex;align-items:center;min-height:44px;color:var(--accent);text-underline-offset:4px}
