/* Shell-only layout on top of ds/bundle.css. Prefix gs- so it never collides with the ga- components. */
html { background: var(--bg); color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
body { min-height: 100vh; }
.gs-page { max-width: var(--content-max); margin: 0 auto; padding: var(--space-4); box-sizing: border-box; display: grid; gap: var(--space-8); }
@media (min-width: 960px) { .gs-page { padding: var(--space-6) var(--space-8) var(--space-16); } }
.gs-banner { max-width: 760px; }
.gs-head { display: grid; gap: var(--space-2); }
.gs-title { margin: 0; }
@media (max-width: 639px) { .gs-title { font-size: 30px; line-height: 34px; } }

/* real photos in the components that were drawn around placeholder divs */
img.ga-card__cover, img.ga-hcard__thumb, img.ga-menu__thumb { display: block; width: 100%; object-fit: cover; }
img.ga-gallery__img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--media-bg); }
.gs-photo { display: block; object-fit: cover; }
.ga-drop[data-state="filled"] { cursor: default; }
.ga-compare { max-height: 78vh; margin: 0 auto; }
.ga-compare .ga-compare__img { object-fit: cover; }
.ga-gallery[data-count="1"] { max-width: 720px; margin: 0 auto; }
.ga-gallery[data-count="1"] .ga-gallery__item { display: block; max-height: 78vh; }
.ga-stage > .ga-render { margin: 0 auto; max-width: 720px; }
.ga-stage > .ga-empty { min-height: 320px; }
.ga-stage__foot { margin-top: var(--space-4); }

/* dialogs: centred on desktop, bottom sheet on phones */
.gs-scrim { position: fixed; inset: 0; z-index: var(--z-sheet); }
.gs-dialog { position: fixed; z-index: calc(var(--z-sheet) + 1); left: 50%; top: 12vh; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); max-height: 76vh; display: flex; flex-direction: column; box-sizing: border-box; }
.gs-menu-list { overflow: auto; min-height: 0; }
.gs-menu-thumb { width: 44px; height: 55px; border-radius: var(--radius-sm); object-fit: cover; flex: none; }
.gs-code { display: flex; gap: var(--space-2); margin-top: var(--space-3); }
.gs-code .ga-field__control { flex: 1; min-width: 0; }
@media (max-width: 639px) {
  .gs-dialog { top: auto; bottom: 0; left: 0; transform: none; width: 100%; max-height: 82vh; border-radius: var(--radius-xl) var(--radius-xl) 0 0; }
}
@media (max-width: 519px) { #mode { display: none; } .ga-header { gap: var(--space-2); } }
.gs-pad { padding: var(--space-5); gap: var(--space-1); }

/* ── Page frame: ambient layer behind, optional panels in the side strips ── */
body { background: transparent; }
button.ga-link { background: none; border: 0; padding: 0; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.gs-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; }
.gs-skip:focus { left: 8px; padding: 8px 12px; background: var(--surface); }
.ga-header [data-on] { background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line); }
.gs-layout { position: relative; }
.gs-main { min-width: 0; }
#view:focus { outline: none; }

.gs-panel { box-sizing: border-box; background: var(--surface-glass); -webkit-backdrop-filter: blur(24px) saturate(1.3); backdrop-filter: blur(24px) saturate(1.3); overflow: auto; overscroll-behavior: contain; }
.gs-panel:focus { outline: none; }
.gs-panel--left { border-right: 1px solid var(--line); }
.gs-panel--right { border-left: 1px solid var(--line); }
.gs-panel-scrim { position: fixed; inset: 0; z-index: calc(var(--z-sheet) + 1); background: var(--scrim); }

@media (min-width: 1440px) {
  .gs-layout { display: grid; grid-template-columns: var(--lw, 0) minmax(0, 1fr) var(--rw, 0); }
  html[data-left="open"] .gs-layout { --lw: 320px; }
  html[data-right="open"] .gs-layout { --rw: 320px; }
  .gs-panel { position: sticky; top: 64px; height: calc(100vh - 64px); }
  html[data-left="closed"] .gs-panel--left, html[data-right="closed"] .gs-panel--right { display: none; }
  .gs-panel--left { grid-column: 1; grid-row: 1; }
  .gs-main { grid-column: 2; grid-row: 1; }
  .gs-panel--right { grid-column: 3; grid-row: 1; }
  .gs-panel-scrim { display: none; }
  /* the rail's sticky offset assumes a full-width page; keep it under the header */
  .ga-app { max-width: min(var(--content-max), 100%); }
}
@media (max-width: 1439px) {
  .gs-panel { position: fixed; top: 0; bottom: 0; z-index: calc(var(--z-sheet) + 2); width: min(360px, 88vw); background: var(--surface); box-shadow: var(--shadow-2); transition: transform var(--duration-base) var(--ease-standard), visibility 0s linear var(--duration-base); visibility: hidden; }
  .gs-panel--left { left: 0; transform: translateX(-104%); }
  .gs-panel--right { right: 0; transform: translateX(104%); }
  html[data-drawer="left"] .gs-panel--left, html[data-drawer="right"] .gs-panel--right { transform: none; visibility: visible; transition: transform var(--duration-base) var(--ease-standard); }
}

/* panel contents */
.gs-p-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: inherit; border-bottom: 1px solid var(--line); }
.gs-panel .gs-p-head { background: var(--surface); }
@media (min-width: 1440px) { .gs-panel .gs-p-head { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; } }
.gs-p-body { display: grid; gap: var(--space-4); padding: var(--space-4) var(--space-4) var(--space-10); align-content: start; }
.gs-p-title { margin: 0; }
.gs-p-text { margin: 0; color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.gs-p-foot { margin: 0; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
.gs-p-card { display: grid; gap: var(--space-2); padding: var(--space-4); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface-raised) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.gs-p-card__title { margin: 0; font: 700 14px/20px var(--font-sans); }
.gs-p-list { margin: 0; padding-left: 18px; color: var(--ink-muted); font-size: 14px; line-height: 20px; display: grid; gap: 4px; }
.gs-p-list b { color: var(--ink); font-weight: 600; }
.gs-p-chips { gap: 6px; }
.gs-p-chips .ga-chip { height: 32px; padding: 0 12px; font-size: 12px; }
.gs-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: var(--space-3); }
.gs-steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3); color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.gs-steps li::before { content: counter(s); display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-full); background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: var(--on-accent); font: 800 13px/1 var(--font-sans); }
.gs-steps b, .gs-how b { color: var(--ink); }
.gs-faq { border-radius: var(--radius-md); box-shadow: inset 0 0 0 1px var(--line); padding: 0 var(--space-4); }
.gs-faq summary { cursor: pointer; padding: var(--space-3) 0; font: 600 14px/20px var(--font-sans); list-style: none; }
.gs-faq summary::-webkit-details-marker { display: none; }
.gs-faq summary::after { content: '+'; float: right; color: var(--ink-muted); }
.gs-faq[open] summary::after { content: '–'; }
.gs-faq p { margin: 0 0 var(--space-3); color: var(--ink-muted); font-size: 14px; line-height: 20px; }
.gs-news { display: grid; gap: 4px; padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.gs-news__date { margin: 0; font: 700 11px/14px var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); }
.gs-news__title { margin: 0; font: 700 15px/20px var(--font-sans); }
.gs-feed { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.gs-feed__item { display: grid; grid-template-columns: 26px 1fr; gap: var(--space-2); align-items: start; padding: var(--space-2); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.gs-feed__item:hover { background: var(--surface-raised); }
.gs-feed__item:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.gs-feed__rank { color: var(--ink-muted); font: 700 13px/20px var(--font-sans); text-align: right; }
.gs-feed__title { display: block; font: 600 14px/20px var(--font-sans); overflow-wrap: anywhere; }
.gs-feed__meta { display: block; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
.gs-account { grid-template-columns: 44px 1fr; align-items: start; }
.gs-account .ga-btn { grid-column: 1 / -1; }
.gs-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); }
.gs-set .ga-chips { gap: 6px; }
.gs-switch { display: grid; grid-template-columns: 44px 1fr; gap: var(--space-3); align-items: start; cursor: pointer; }
.gs-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gs-switch__track { position: relative; width: 44px; height: 26px; border-radius: var(--radius-full); background: var(--surface-sunken); box-shadow: inset 0 0 0 1px var(--line-strong); transition: background var(--duration-fast) var(--ease-standard); }
.gs-switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: var(--radius-full); background: var(--ink-muted); transition: transform var(--duration-fast) var(--ease-pop), background var(--duration-fast); }
.gs-switch input:checked + .gs-switch__track { background: linear-gradient(100deg, var(--accent), var(--accent-2)); box-shadow: none; }
.gs-switch input:checked + .gs-switch__track::after { transform: translateX(18px); background: var(--on-accent); }
.gs-switch input:focus-visible + .gs-switch__track { box-shadow: var(--focus-ring); }
.gs-switch .ga-field__label, .gs-switch .ga-field__help { display: block; margin: 0; }

/* ── Explore extras ── */
.gs-recent { display: flex; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-2); scroll-snap-type: x proximity; }
.gs-recent__item { flex: none; width: 240px; display: grid; grid-template-columns: 56px 1fr; gap: var(--space-3); align-items: center; padding: var(--space-2); border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; scroll-snap-align: start; transition: box-shadow var(--duration-fast) var(--ease-standard); }
.gs-recent__item:hover { box-shadow: inset 0 0 0 1px var(--job, var(--line-strong)), 0 8px 24px -12px var(--job, transparent); }
.gs-recent__item:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.gs-recent__item img { width: 56px; height: 70px; border-radius: var(--radius-sm); object-fit: cover; background: var(--skeleton); }
.gs-recent__title { display: block; font: 700 14px/18px var(--font-sans); }
.gs-recent__time { display: block; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
.gs-how { display: grid; gap: var(--space-5); padding: var(--space-8) 0 var(--space-4); border-top: 1px solid var(--line); }
.gs-how h2 { margin: 0; }
.gs-how__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.gs-how__steps li { display: grid; gap: var(--space-2); padding: var(--space-5); border-radius: var(--radius-lg); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-muted); }
.gs-how__steps b { font: 700 17px/22px var(--font-sans); }
.gs-how__n { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-full); background: linear-gradient(100deg, var(--accent), var(--accent-2)); color: var(--on-accent); font: 800 15px/1 var(--font-sans); }

/* ── Footer ── */
.gs-footer { max-width: var(--content-max); margin: 0 auto; box-sizing: border-box; padding: var(--space-8) var(--space-4) var(--space-10); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); border-top: 1px solid var(--line); }
@media (min-width: 960px) { .gs-footer { padding: var(--space-8) var(--space-8) var(--space-12); } }
.gs-footer__mark { font-size: 15px; }
.gs-footer__links { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.gs-footer__note { margin: 0; flex-basis: 100%; color: var(--ink-muted); font: 400 12px/16px var(--font-sans); }
html[data-route="app"] .gs-footer { display: none; }

/* ── Phone tab bar (not on app pages, where Generate owns the bottom edge) ── */
.gs-tabbar { display: none; }
@media (max-width: 639px) {
  .gs-tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-rail-footer); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px var(--space-2) calc(6px + env(safe-area-inset-bottom)); background: var(--surface-glass); -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
  .gs-tabbar a, .gs-tabbar button { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border: 0; background: none; border-radius: var(--radius-md); color: var(--ink-muted); font: 600 11px/14px var(--font-sans); text-decoration: none; cursor: pointer; }
  .gs-tabbar [aria-current="page"] { color: var(--ink); }
  .gs-tabbar [aria-current="page"] .ga-icon { color: var(--accent-ink); }
  .gs-tabbar :focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
  html[data-route="app"] .gs-tabbar { display: none; }
  html:not([data-route="app"]) .gs-main { padding-bottom: 72px; }
  #toggle-left, #toggle-right { display: none; }
  html[data-route="app"] #toggle-left, html[data-route="app"] #toggle-right { display: inline-flex; }
}

/* ── Toasts, lightbox, pickers ── */
.gs-toasts { position: fixed; right: var(--space-4); bottom: var(--space-4); z-index: var(--z-toast); display: grid; gap: var(--space-2); justify-items: end; pointer-events: none; }
@media (max-width: 639px) { .gs-toasts { left: var(--space-4); bottom: calc(84px + env(safe-area-inset-bottom)); } html[data-route="app"] .gs-toasts { bottom: calc(96px + env(safe-area-inset-bottom)); } }
.gs-toast { pointer-events: auto; width: min(360px, calc(100vw - 32px)); box-sizing: border-box; background: var(--surface); box-shadow: var(--shadow-2); animation: gs-in var(--duration-base) var(--ease-pop); transition: opacity var(--duration-slow), transform var(--duration-slow); }
.gs-toast.is-out { opacity: 0; transform: translateY(8px); }
@keyframes gs-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.gs-lightbox { position: fixed; inset: 0; z-index: calc(var(--z-sheet) + 3); display: grid; place-items: center; background: color-mix(in srgb, var(--media-bg) 92%, transparent); animation: gs-in var(--duration-base) var(--ease-standard); }
.gs-lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); object-fit: contain; border-radius: var(--radius-md); }
.gs-lightbox__bar { position: fixed; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: var(--space-2); }
.gs-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-2); overflow: auto; margin-top: var(--space-3); }
.gs-pick button { padding: 0; border: 0; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; aspect-ratio: 4 / 5; background: var(--skeleton); }
.gs-pick button:focus-visible { outline: 2px solid transparent; box-shadow: var(--focus-ring); }
.gs-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gs-from-history { margin-top: var(--space-1); justify-self: start; }

/* ── Ambient effects ── */
.gs-fx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; contain: strict; --wo: .16; }
html[data-theme="light"] .gs-fx { --wo: .12; }
html[data-ambient="off"] .gs-fx { display: none; }
.gs-wisp { position: absolute; width: 52vmax; height: 52vmax; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--wc) 0, transparent 62%); opacity: var(--wo); filter: blur(30px); animation: gs-drift var(--wd, 80s) ease-in-out infinite alternate; transition: opacity 1.2s var(--ease-standard), scale 1.6s var(--ease-standard), filter 1.6s var(--ease-standard); will-change: transform; }
.gs-wisp--1 { --wc: var(--accent); left: -22vmax; top: -18vmax; --wd: 70s; }
.gs-wisp--2 { --wc: var(--accent-2); right: -24vmax; bottom: -22vmax; --wd: 90s; animation-delay: -20s; }
.gs-wisp--3 { --wc: var(--job-style); left: -26vmax; bottom: -20vmax; --wd: 110s; animation-delay: -45s; }
.gs-wisp--4 { --wc: var(--job-edits); right: -26vmax; top: -10vmax; --wd: 95s; animation-delay: -60s; }
@keyframes gs-drift {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(6vmax, 4vmax) rotate(25deg); }
  100% { transform: translate(-3vmax, 8vmax) rotate(-15deg); }
}
/* queued: the light gathers in; rendering: brighter and slowly turning; done: one bright sweep */
html[data-fx="queued"] .gs-wisp { opacity: calc(var(--wo) * 1.4); scale: .9; }
html[data-fx="rendering"] .gs-wisp { opacity: calc(var(--wo) * 1.8); scale: 1.08; filter: blur(30px) hue-rotate(25deg); }
html[data-fx="done"] .gs-wisp { opacity: calc(var(--wo) * 2.2); scale: 1.15; }
html[data-fx="error"] .gs-wisp--1, html[data-fx="error"] .gs-wisp--4 { --wc: var(--danger); }
.gs-fx::before { content: ''; position: absolute; inset: -20%; background: conic-gradient(from 0deg, transparent 0 20%, color-mix(in srgb, var(--accent) 60%, transparent) 30%, transparent 45% 70%, color-mix(in srgb, var(--accent-2) 60%, transparent) 80%, transparent 95%); opacity: 0; filter: blur(60px); transition: opacity 1.4s var(--ease-standard); animation: gs-turn 24s linear infinite; }
html[data-fx="rendering"] .gs-fx::before { opacity: .07; }
@keyframes gs-turn { to { transform: rotate(1turn); } }
.gs-sweep { position: absolute; top: -20%; bottom: -20%; left: -40%; width: 30%; background: linear-gradient(100deg, transparent, color-mix(in srgb, var(--on-media) 5%, transparent), color-mix(in srgb, var(--accent) 9%, transparent), transparent); transform: skewX(-18deg); opacity: 0; }
.gs-sweep.is-on { animation: gs-sweep 1.6s var(--ease-standard); }
@keyframes gs-sweep { 0% { left: -40%; opacity: 0; } 15% { opacity: 1; } 100% { left: 120%; opacity: 0; } }
.gs-glint { position: absolute; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; background: var(--c); box-shadow: 0 0 calc(var(--s) * 2) var(--c), 0 0 calc(var(--s) * 5) color-mix(in srgb, var(--c) 40%, transparent); opacity: 0; animation: gs-glint var(--t) var(--ease-standard) forwards; }
.gs-glint::before, .gs-glint::after { content: ''; position: absolute; left: 50%; top: 50%; width: calc(var(--s) * 4); height: 1px; margin-left: calc(var(--s) * -2); background: linear-gradient(90deg, transparent, var(--c), transparent); opacity: .8; }
.gs-glint::after { transform: rotate(90deg); }
@keyframes gs-glint {
  0% { opacity: 0; transform: translate(0, 0) scale(.3) rotate(0deg); }
  18% { opacity: .95; transform: translate(calc(var(--dx) * .15), calc(var(--dy) * .15)) scale(1) rotate(20deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.4) rotate(70deg); }
}
html[data-ambient="calm"] .gs-wisp { animation-duration: 240s; }
html[data-ambient="calm"] .gs-fx::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  .gs-wisp, .gs-fx::before, .gs-sweep, .gs-glint { animation: none !important; }
  .gs-wisp { transition: none; }
}
/* the tools stay calm: surfaces are opaque, so effects only show in the strips and through glass */
.ga-rail, .ga-stage, .ga-hero, .ga-card, .gs-how__steps li { isolation: isolate; }
.ga-stage { scroll-margin-top: 80px; }
.gs-footer__by { color: var(--ink-muted); font: 600 13px/18px var(--font-sans); margin-left: calc(-1 * var(--space-4)); }
