/* The picture page: its own neutral palette on purpose, separate from the shell's warm tokens.
   superagent/theme.py derives the dark twin of every token here. Colors written in hsl() are left alone,
   which is what text over photos and drop shadows need: they stay the same in both themes. */
:root{--img-bg:#ffffff;--img-text:#0d0d0d;--img-muted:#6e6e6e;--img-line:#e5e5e5;--img-fill:#f4f4f4;--img-fill-strong:#ececec;--img-send:#0d0d0d;--img-send-text:#ffffff;--img-danger:#c4320a}
/* Only .images-main scrolls. The body can't, so neither a collapsing browser toolbar nor a rubber-band overscroll can carry the composer with it.
   Fixed beside the sidebar rather than in the shell's flow, so the shell's page rules never reach it. */
body:has(#images-page:not([hidden])){overflow:hidden;overscroll-behavior:none}
.images-page{position:fixed;inset:0 0 auto;display:flex;flex-direction:column;height:var(--app-height,100dvh);margin:0;overflow:hidden;overscroll-behavior:none;background:var(--img-bg);color:var(--img-text);font:16px/1.5 system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
.images-page *{box-sizing:border-box}
/* The shell styles these elements directly. :where keeps the resets lower than every rule below. */
.images-page :where(label){flex-direction:row;gap:normal;margin:0;color:inherit;font-size:inherit;font-weight:400;line-height:inherit}
.images-page :where(p){color:inherit}
.images-page :where(select,input,textarea){width:auto;max-width:none}
.images-page :where(button){min-height:0}
.images-page :where(h1,h2){letter-spacing:normal}
.images-page[hidden],.images-page [hidden]{display:none!important}
@media(min-width:1024px){body:not(.navigation-collapsed) .images-page{left:var(--nav-width)}}
.images-page svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.images-page button,.images-page select,.images-page textarea,.images-page input{font:inherit;color:inherit}
.images-page button{cursor:pointer}
.images-main{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.images-home{width:min(1388px,100%);margin:0 auto;padding:0 48px 24px}
.images-page .images-menu{display:none;margin-left:-8px}
body.navigation-collapsed .images-page .images-menu{display:grid}
@media(max-width:1023px){.images-page .images-menu{display:grid}}
.images-head{flex:none;display:flex;align-items:center;gap:8px;width:min(1388px,100%);min-height:36px;margin:0 auto;padding:20px 48px 0}
.images-head h1{min-width:0;margin:0;overflow:hidden;font-size:24px;font-weight:500;line-height:36px;text-overflow:ellipsis;white-space:nowrap}
.images-page:has(#images-turns:not([hidden])) .images-head{padding-top:10px;padding-bottom:6px}
.images-page:has(#images-turns:not([hidden])) .images-head h1{font-size:16px}
.images-back{display:grid;place-items:center;width:36px;height:36px;margin-left:-8px;border-radius:50%;color:var(--img-text)}
.images-back:hover{background:var(--img-fill)}
.images-quota{flex:none;margin-left:auto;color:var(--img-muted);font-size:13px;white-space:nowrap}
.images-page .images-wipe{flex:none;height:32px;padding:0 12px;border:0;border-radius:16px;background:transparent;color:var(--img-muted);font-size:13px;white-space:nowrap}
.images-page .images-wipe:hover{background:var(--img-fill);color:var(--img-danger)}
.images-page .images-tabs{display:flex;order:0;gap:4px;align-items:normal;justify-content:normal;width:auto;margin:16px 0;overflow-x:auto;font-size:inherit;line-height:inherit;scrollbar-width:none}
.images-tabs a{flex:none;display:inline-flex;align-items:center;height:36px;padding:0 16px;border-radius:18px;color:var(--img-muted);font-size:14px;font-weight:500;text-decoration:none}
.images-tabs a:hover{color:var(--img-text)}
.images-tabs a[aria-current=page]{background:var(--img-fill);color:var(--img-text)}
.images-page .images-tabs a[aria-current]:after{content:none}
.images-ideas{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.images-idea{position:relative;display:block;width:100%;aspect-ratio:4/5;padding:0;overflow:hidden;border:0;border-radius:16px;background:var(--img-fill);text-align:left}
.images-idea img{display:block;width:100%;height:100%;object-fit:cover;transition:transform .2s}
.images-idea:hover img{transform:scale(1.02)}
.images-idea span{position:absolute;inset:auto 0 0;padding:40px 12px 12px;background:linear-gradient(transparent,hsl(0 0% 0%/.5));color:hsl(0 0% 100%);font-size:14px;font-weight:500}
.images-main h2{margin:40px 0 16px;font-size:18px;font-weight:600}
.images-gallery{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
.images-tile{position:relative;display:block;width:100%;aspect-ratio:1;padding:0;overflow:hidden;border:0;border-radius:12px;background:var(--img-fill);text-align:left}
.images-tile img{display:block;width:100%;height:100%;object-fit:cover;transition:opacity .15s}
.images-tile:hover img{opacity:.88}
.images-tile-busy,.images-tile-failed{display:flex;flex-direction:column;justify-content:center;gap:8px;padding:12px;font-size:13px;cursor:default}
.images-tile-busy{color:var(--img-muted);animation:images-pulse 1.8s ease-in-out infinite}
.images-tile-failed p{margin:0;color:var(--img-danger)}
.images-tile-text{margin:0;display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:3}
.images-tile-actions{display:flex;gap:8px}
.images-tile-actions button{height:30px;padding:0 10px;border:1px solid var(--img-line);border-radius:15px;background:var(--img-bg);font-size:13px}
@keyframes images-pulse{50%{background:var(--img-fill-strong)}}
.images-turns{display:flex;flex-direction:column;gap:32px;width:min(768px,100%);margin:0 auto;padding:16px 16px 24px}
.images-turn{display:flex;flex-direction:column;gap:16px}
.images-ask{align-self:flex-end;display:flex;flex-direction:column;align-items:flex-end;gap:8px;max-width:min(80%,560px)}
.images-ask img{display:block;max-width:160px;max-height:160px;object-fit:cover;border-radius:12px}
.images-ask p{margin:0;padding:10px 16px;border-radius:20px;background:var(--img-fill);white-space:pre-wrap;overflow-wrap:anywhere}
.images-reply{align-self:flex-start;width:100%;max-width:440px}
.images-reply-busy,.images-reply-failed{display:flex;flex-direction:column;justify-content:center;gap:8px;min-height:160px;padding:16px;border-radius:16px;background:var(--img-fill);font-size:14px}
.images-reply-busy{color:var(--img-muted);animation:images-pulse 1.8s ease-in-out infinite}
.images-reply-failed p{margin:0;color:var(--img-danger)}
.images-pictures{display:grid;gap:12px}
.images-pictures-many{grid-template-columns:repeat(2,minmax(0,1fr));max-width:600px}
.images-pictures figure{min-width:0;margin:0}
.images-picture{display:block;width:100%;padding:0;overflow:hidden;border:0;border-radius:14px;background:var(--img-fill)}
.images-picture img{display:block;width:100%;height:auto;min-height:80px}
.images-picture-actions{display:flex;gap:4px;margin-top:6px}
.images-page .images-picture-actions a,.images-page .images-picture-actions button{display:inline-flex;align-items:center;height:32px;padding:0 10px;border:0;border-radius:16px;background:transparent;color:var(--img-muted);font-size:13px;text-decoration:none;white-space:nowrap}
.images-page .images-picture-actions a:hover,.images-page .images-picture-actions button:hover{background:var(--img-fill);color:var(--img-text)}
.images-dock{flex:none;display:flex;justify-content:center;padding:8px 16px calc(16px + env(safe-area-inset-bottom))}
.images-composer{position:relative;width:min(768px,100%);padding:10px 8px 8px;border-radius:24px;background:var(--img-bg);box-shadow:0 0 0 1px rgba(0,0,0,.06),0 4px 16px hsl(0 0% 0%/.1)}
.images-chips{display:flex;flex-wrap:wrap;gap:8px}
.images-chips:not(:has(>:not([hidden]))){display:none}
.images-bar{display:flex;align-items:center;gap:4px;margin-top:4px}
.images-plain{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:transparent}
.images-plain:hover:not(:disabled){background:var(--img-fill)}
.images-plain:disabled{opacity:.3;cursor:default}
.images-composer textarea{display:block;width:100%;min-height:56px;max-height:min(240px,30dvh);padding:4px 8px;border:0;border-radius:0;outline:0;resize:none;background:transparent;line-height:24px}
.images-page .images-options-toggle{flex:none;display:inline-flex;align-items:center;gap:2px;height:40px;padding:0 8px 0 12px;border:0;border-radius:20px;background:transparent;color:var(--img-muted);font-size:14px;white-space:nowrap}
.images-options-toggle:hover,.images-options-toggle[aria-expanded=true]{background:var(--img-fill)}
.images-options-toggle svg{width:16px;height:16px}
.images-effort{position:relative;display:inline-flex;align-items:center;min-width:0;border-radius:20px;color:var(--img-muted)}
.images-effort:hover{background:var(--img-fill)}
.images-effort select{height:40px;padding:0 26px 0 12px;border:0;outline:0;border-radius:20px;-webkit-appearance:none;appearance:none;background:transparent;color:inherit;font-size:14px;cursor:pointer}
.images-effort select:focus-visible{box-shadow:0 0 0 2px var(--img-line)}
.images-effort svg{position:absolute;right:8px;width:16px;height:16px;pointer-events:none}
.images-bar .images-send{margin-left:auto}
.images-page .images-send{display:grid;place-items:center;flex:none;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:var(--img-send);color:var(--img-send-text)}
.images-page .images-send:disabled{opacity:.3;cursor:default}
.images-options{position:absolute;left:0;bottom:calc(100% + 8px);z-index:10;display:grid;gap:4px;width:min(340px,100%);padding:8px;border-radius:20px;background:var(--img-bg);box-shadow:0 0 0 1px rgba(0,0,0,.06),0 8px 24px hsl(0 0% 0%/.12)}
.images-option{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:40px;padding:0 8px;font-size:14px}
.images-option span{flex:none;color:var(--img-muted)}
.images-option strong{font-weight:500}
.images-option select{min-width:0;max-width:200px;height:32px;padding:0 4px;border:0;outline:0;border-radius:8px;background:transparent;text-align:right}
.images-option select:hover{background:var(--img-fill)}
.images-option input{flex:1;min-width:0;height:32px;padding:0 10px;border:0;outline:0;border-radius:10px;background:var(--img-fill)}
.images-attachment{display:inline-flex;align-items:center;gap:8px;margin:0 0 6px 4px;padding:4px 8px 4px 4px;border-radius:12px;background:var(--img-fill);font-size:13px}
.images-attachment img{width:40px;height:40px;object-fit:cover;border-radius:8px}
.images-attachment button{width:24px;height:24px;padding:0;border:0;border-radius:50%;background:transparent}
.images-template{width:min(800px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:0;overflow:hidden;border:0;border-radius:20px;background:var(--img-bg);color:var(--img-text)}
.images-template[open]{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr)}
.images-template::backdrop{background:hsl(0 0% 0%/.45)}
.images-template>img{display:block;width:100%;height:100%;min-height:0;max-height:calc(100dvh - 32px);object-fit:cover;background:var(--img-fill)}
.images-template-side{display:flex;flex-direction:column;gap:12px;min-height:0;padding:20px;overflow:auto}
.images-template-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.images-template-head h2{margin:0;font-size:18px;font-weight:600}
.images-template-head .images-plain{width:32px;height:32px;margin:-4px -6px -4px 0}
.images-template-hint{margin:0;font-size:14px}
.images-template-text{margin:0;flex:1 1 auto;color:var(--img-muted);font-size:14px;overflow-wrap:anywhere}
.images-template .images-option{padding:0}
.images-page .images-template-add{height:40px;border:1px dashed var(--img-line);border-radius:12px;background:transparent;font-size:14px}
.images-template-add:hover{background:var(--img-fill)}
.images-page .images-template-use{align-self:flex-end;height:36px;padding:0 16px;border:0;border-radius:18px;background:var(--img-send);color:var(--img-send-text);font-size:14px;font-weight:500}
.images-viewer{width:100vw;max-width:100vw;height:100dvh;max-height:100dvh;margin:0;padding:0;border:0;border-radius:0;background:var(--img-bg);color:var(--img-text)}
.images-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
.images-viewer-top{display:flex;align-items:center;gap:4px;padding:8px 12px}
.images-page .images-viewer-link{height:36px;margin-left:8px;padding:0 12px;border:0;border-radius:18px;background:transparent;color:var(--img-muted);font-size:14px}
.images-viewer-link:hover,.images-viewer-link[aria-expanded=true]{background:var(--img-fill);color:var(--img-text)}
.images-actions{display:flex;align-items:center;gap:8px;margin-left:auto;margin-right:4px}
.images-actions a,.images-actions button{display:inline-flex;align-items:center;height:36px;padding:0 14px;border:0;border-radius:18px;background:transparent;color:inherit;font-size:14px;text-decoration:none;white-space:nowrap;box-shadow:0 0 0 1px var(--img-line)}
.images-actions a:hover,.images-actions button:hover{background:var(--img-fill)}
.images-actions .images-danger{color:var(--img-danger)}
.images-viewer-stage{position:relative;display:grid;place-items:center;min-height:0;padding:0 24px 24px}
.images-viewer-stage>img{max-width:100%;max-height:100%;min-height:0;object-fit:contain;border-radius:4px}
.images-prompt{position:absolute;top:8px;left:24px;z-index:1;width:min(420px,calc(100% - 48px));max-height:calc(100% - 16px);margin:0;padding:12px 14px;overflow:auto;border-radius:16px;background:var(--img-bg);box-shadow:0 0 0 1px rgba(0,0,0,.06),0 8px 24px hsl(0 0% 0%/.12);font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.images-notice{position:fixed;left:50%;top:calc(12px + env(safe-area-inset-top));z-index:20;max-width:calc(100vw - 32px);margin:0;padding:10px 16px;transform:translateX(-50%);border-radius:12px;background:var(--img-send);color:var(--img-send-text);font-size:14px}
.images-notice a{color:inherit;text-decoration:underline}
@media (prefers-reduced-motion:reduce){.images-tile-busy,.images-reply-busy{animation:none}.images-idea img{transition:none}.images-idea:hover img{transform:none}}
@media (max-width:1100px){.images-ideas{grid-template-columns:repeat(4,minmax(0,1fr))}.images-gallery{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media (max-width:800px){.images-home{padding-right:24px;padding-left:24px}.images-head{padding-right:24px;padding-left:24px}.images-ideas{grid-template-columns:repeat(3,minmax(0,1fr))}.images-gallery{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}}
@media (max-width:600px){
 .images-home{padding:0 16px 16px}
 .images-head{padding:12px 16px 0}
 .images-page .images-tabs{margin:12px -16px;padding:0 16px}
 .images-ideas{grid-template-columns:repeat(2,minmax(0,1fr))}
 .images-dock{padding:6px 12px calc(12px + env(safe-area-inset-bottom))}
 .images-template[open]{grid-template-columns:minmax(0,1fr);overflow:auto}
 .images-template>img{height:auto;max-height:42dvh;aspect-ratio:4/5}
 .images-viewer-top{flex-wrap:wrap}
 .images-actions{order:3;width:100%;margin:4px 0 0;overflow-x:auto;padding:1px}
 .images-viewer-top #images-viewer-close{margin-left:auto}
 .images-viewer-stage{padding:0 12px}
 .images-prompt{left:12px;width:calc(100% - 24px)}
}
