.image-viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 8px; overflow: hidden; border: 0; border-radius: 0; color: #f5f5f5; background: #252323; font: inherit; color-scheme: dark; isolation: isolate; }
.image-viewer:not([open]), .image-viewer [hidden] { display: none !important; }
.image-viewer::backdrop { background: #141414; }
.image-viewer *, .image-viewer *::before, .image-viewer *::after { box-sizing: border-box; }
.image-viewer button { font: inherit; cursor: pointer; }
.image-viewer a { text-decoration: none; }
.image-viewer :is(button, a, summary, [tabindex]):focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.image-viewer button:disabled { color: #8a8a8a; cursor: default; }
.image-viewer svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.image-viewer-backdrop { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }
.image-viewer-backdrop img { width: 100%; height: 100%; object-fit: cover; opacity: .45; filter: blur(65px) saturate(.5); transform: scale(1.18); }
.image-viewer-backdrop::after { content: ''; position: absolute; inset: 0; background: #17151480; }
.image-viewer-layout { display: grid; grid-template-columns: minmax(0, 1fr) 352px; gap: 16px; width: 100%; height: 100%; }
.image-viewer-stage { position: relative; display: flex; justify-content: center; align-items: center; min-width: 0; min-height: 0; padding: 3px 0; }
.image-viewer-image { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.image-viewer-loading { margin: 0; padding: 24px; color: #ddd; font-size: 13px; text-align: center; }
.image-viewer-stage-actions { position: absolute; right: 8px; bottom: 5px; display: flex; gap: 6px; }
.image-viewer-stage-actions .image-viewer-icon-button { width: 32px; height: 32px; border-color: transparent; background: #1c1c1c80; }
.image-viewer-floating-close { display: none !important; position: absolute; z-index: 5; top: 8px; right: 8px; }
.image-viewer-sidebar { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 12px 8px 10px; overflow: hidden; border: 1px solid #ffffff0c; border-radius: 22px; background: #363636f5; box-shadow: 0 4px 24px #0001; }
.image-viewer-header { display: flex; flex: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 5px 11px; }
.image-viewer-avatar { display: grid; place-items: center; flex: none; width: 40px; height: 40px; overflow: hidden; border: 1px solid #ffffff30; border-radius: 50%; color: #171717; background: #f5f5f5; font-size: 18px; font-weight: 700; }
.image-viewer-author { display: flex; flex: 1; flex-direction: column; gap: 3px; min-width: 0; }
.image-viewer-author strong { overflow: hidden; font-size: 14px; font-weight: 600; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-author span { color: #9a9a9a; font-size: 11px; line-height: 1.3; }
.image-viewer-icon-button { display: inline-grid; place-items: center; flex: none; width: 42px; height: 40px; margin: 0; padding: 0; border: 1px solid #ffffff12; border-radius: 11px; color: #f3f3f3; background: linear-gradient(#ffffff06, #ffffff00), #414141; }
.image-viewer-icon-button:hover:not(:disabled) { border-color: #ffffff30; background: #505050; }
.image-viewer-icon-button[aria-pressed='true'] { color: #181818; background: #fff; }
.image-viewer-icon-button[aria-pressed='true'] svg { fill: currentColor; }
.image-viewer-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #ffffff08; }
.image-viewer-close svg { width: 16px; height: 16px; }
.image-viewer-content { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #ffffff24 transparent; }
.image-viewer-tabs { display: grid; grid-template-columns: .95fr .95fr 1.25fr; gap: 3px; min-height: 39px; margin-bottom: 9px; padding: 3px; border: 1px solid #ffffff04; border-radius: 12px; background: #ffffff06; }
.image-viewer-tabs button { display: flex; justify-content: center; align-items: center; gap: 5px; min-width: 0; padding: 7px 3px; border: 1px solid transparent; border-radius: 8px; color: #eee; background: transparent; font-size: 11px; font-weight: 500; }
.image-viewer-tabs button[aria-selected='true'] { border-color: #ffffff10; background: #ffffff06; }
.image-viewer-tabs svg { width: 14px; height: 14px; }
.image-viewer-prompt-section { padding: 9px 8px 8px; border-radius: 13px; background: #ffffff05; }
.image-viewer-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; padding-left: 4px; }
.image-viewer-section-heading h2 { display: flex; align-items: center; gap: 7px; margin: 0; color: #a1a1a1; font-size: 10px; font-weight: 500; letter-spacing: .45px; line-height: 1.5; text-transform: uppercase; }
.image-viewer-copy { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 25px; padding: 3px 9px; border: 1px solid #ffffff12; border-radius: 6px; color: #f1f1f1; background: #ffffff03; font-size: 11px !important; }
.image-viewer-copy svg { width: 12px; height: 12px; }
.image-viewer-copy:hover { background: #ffffff0c; }
.image-viewer-prompt { min-height: 160px; max-height: 29dvh; margin: 0; padding: 12px; overflow: auto; overscroll-behavior: contain; border-radius: 9px; color: #f1f1f1; background: #ffffff06; font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; white-space: pre-wrap; scrollbar-width: thin; scrollbar-color: #ffffff24 transparent; }
.image-viewer-details { margin-top: 5px; }
.image-viewer-details summary { display: flex; align-items: center; gap: 7px; min-height: 39px; padding: 8px 4px; list-style: none; color: #a1a1a1; font-size: 10px; font-weight: 500; letter-spacing: .45px; text-transform: uppercase; cursor: pointer; }
.image-viewer-details summary::-webkit-details-marker { display: none; }
.image-viewer-details summary::after { content: ''; width: 6px; height: 6px; margin: 0 4px 0 auto; border-right: 1px solid #929292; border-bottom: 1px solid #929292; transform: rotate(45deg); }
.image-viewer-details[open] summary::after { transform: rotate(225deg); }
.image-viewer-settings { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr); gap: 7px 10px; margin: 0; padding: 13px 12px; border-radius: 9px; background: #ffffff06; font-size: 12px; line-height: 1.4; }
.image-viewer-settings dt { min-width: 0; margin: 0; color: #a1a1a1; }
.image-viewer-settings dd { min-width: 0; margin: 0; color: #eee; text-align: right; overflow-wrap: anywhere; }
.image-viewer-footer { position: relative; display: flex; flex: none; flex-direction: column; gap: 8px; margin-top: auto; padding: 18px 8px 0; }
.image-viewer-primary, .image-viewer-secondary, .image-viewer-download { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; min-width: 0; margin: 0; padding: 8px 10px; border: 1px solid #ffffff17; border-radius: 10px; font-size: 12px !important; font-weight: 550 !important; line-height: 1.4; text-align: center; }
.image-viewer-primary { color: #111; background: #fff; border-color: #fff; box-shadow: 0 2px 0 #ffffff26; }
.image-viewer-primary:hover:not(:disabled) { background: #e9e9e9; border-color: #e9e9e9; }
.image-viewer-secondary, .image-viewer-download { color: #f5f5f5; background: linear-gradient(#ffffff06, #ffffff00), #414141; }
.image-viewer-secondary:hover:not(:disabled), .image-viewer-download:hover { border-color: #ffffff30; background: #505050; }
.image-viewer-reuse-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.image-viewer-footer-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 42px); gap: 7px; }
.image-viewer-footer-row .image-viewer-download { gap: 6px; padding-inline: 5px; }
.image-viewer-more { position: absolute; z-index: 6; right: 8px; bottom: 50px; display: grid; gap: 3px; width: min(250px, 100%); padding: 5px; border: 1px solid #ffffff24; border-radius: 12px; background: #282828; box-shadow: 0 12px 36px #0006; }
.image-viewer-more :is(a, button) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 9px; border: 0; border-radius: 7px; background: transparent; color: #eee; font-size: 12px; text-align: left; }
.image-viewer-more :is(a, button):hover { background: #ffffff0c; }
.image-viewer-notice { margin: 1px 0 0; color: #ddd; font-size: 11px; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
.image-output-preview { cursor: default; }
.image-viewer--without-info .image-viewer-layout { grid-template-columns: minmax(0, 1fr); }
.image-viewer--without-info .image-viewer-sidebar { display: none; }
.image-viewer--without-info .image-viewer-floating-close, .image-viewer-stage:fullscreen .image-viewer-floating-close { display: grid !important; }
.image-viewer-stage:fullscreen { width: 100vw; height: 100dvh; padding: 12px; background: #111; }
@media (max-width: 1000px) and (min-width: 761px) { .image-viewer-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; } }
@media (max-height: 720px) and (min-width: 761px) { .image-viewer-prompt { min-height: 100px; max-height: 23dvh; } .image-viewer-settings { gap: 5px 10px; padding-block: 10px; } .image-viewer-footer { padding-top: 12px; } }
@media (max-width: 760px) {
  .image-viewer { padding: 0; overflow: auto; overscroll-behavior: contain; }
  .image-viewer-layout { display: flex; flex-direction: column; gap: 0; min-height: 100%; height: auto; }
  .image-viewer-stage { flex: none; height: min(66dvh, 720px); min-height: 240px; padding: 12px 12px 30px; }
  .image-viewer-stage-actions { right: 12px; bottom: 5px; }
  .image-viewer-sidebar { flex: 1; min-height: 420px; padding: 14px 10px max(16px, env(safe-area-inset-bottom)); border-width: 1px 0 0; border-radius: 22px 22px 0 0; background: #363636; }
  .image-viewer-close, .image-viewer-floating-close { position: fixed; z-index: 7; top: max(12px, env(safe-area-inset-top)); right: 12px; width: 36px; height: 36px; border: 1px solid #ffffff20; background: #242424d9; backdrop-filter: blur(12px); }
  .image-viewer-content { flex: none; overflow: visible; }
  .image-viewer-prompt { min-height: 120px; max-height: 240px; }
  .image-viewer--without-info .image-viewer-stage { height: 100dvh; }
}
@media (max-width: 360px) { .image-viewer-footer-row { grid-template-columns: minmax(0, 1fr) repeat(3, 36px); gap: 5px; } .image-viewer-footer-row .image-viewer-icon-button { width: 36px; } }
