:root {
  color-scheme: dark;
  --bg: #080808;
  --panel: #121212;
  --surface: #181818;
  --border: #272727;
  --muted: #a0a09d;
  --soft: #bdbdb8;
  --text: #f4f4ef;
  --accent: #d5f899;
  --max-width: 1264px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; -webkit-font-smoothing: antialiased; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { color: #101409; background: var(--accent); }

.shell { width: min(var(--max-width), calc(100% - 104px)); margin-inline: auto; }
.visually-hidden, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 30; top: 8px; left: 8px; padding: 12px 16px; color: var(--bg); background: var(--accent); border-radius: 6px; }

.brand { position: relative; display: block; width: 184px; aspect-ratio: 1848 / 556; overflow: hidden; isolation: isolate; border-radius: 4px; background: var(--bg); }
.brand img {
  position: absolute;
  display: block;
  /* Frame the artwork at x 168 and y 92 in its original 2172 px coordinate space. */
  width: calc(100% * 2172 / 1848);
  height: auto;
  max-width: none;
  inset-inline-start: calc(-100% * 168 / 1848);
  inset-block-start: calc(-100% * 92 / 556);
  mix-blend-mode: screen;
}

[data-icon] { display: inline-grid; place-items: center; flex: none; line-height: 1; }
[data-icon] svg { display: block; width: 1em; height: 1em; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--soft); font-size: 19px; transition: color .18s, background .18s; }
.icon-button:hover { color: var(--text); background: #222; }
.button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border: 1px solid transparent; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 620; line-height: 1.35; white-space: nowrap; transition: background .18s, color .18s, border-color .18s; }
.button-accent { color: #152009; background: var(--accent); }
.button-accent:hover { background: #e4ffb9; }
.button-outline { color: var(--text); border-color: #383838; background: transparent; }
.button-outline:hover { background: #232323; border-color: #555; }

.hero { position: relative; z-index: 1; padding: 56px 0 32px; text-align: center; }
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: clamp(3.1rem, 4.65vw, 4.25rem); font-weight: 750; letter-spacing: -.065em; line-height: 1.09; text-wrap: balance; }
.hero-description { max-width: 40ch; margin-top: 15px; color: var(--muted); font-size: 17px; line-height: 1.6; letter-spacing: .012em; text-wrap: balance; }

.search-area { position: relative; width: min(100%, 373px); margin-top: 23px; text-align: left; z-index: 3; }
.search-form { min-height: 46px; display: flex; align-items: center; gap: 9px; padding: 0 13px 0 16px; border: 1px solid #282828; border-radius: 24px; background: #191919; transition: border-color .18s; }
.search-form:focus-within { border-color: #829363; }
.search-symbol { color: #a2a29a; font-size: 19px; }
.search-form input { width: 100%; min-width: 0; padding: 10px 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 14px; }
.search-form input::placeholder { color: #989893; }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-key { flex: none; min-width: 37px; padding: 3px 5px; border: 1px solid #353535; border-radius: 6px; color: #a5a5a0; background: #202020; font: 12px/1.2 var(--font); text-align: center; white-space: nowrap; }
.collection-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 18px; margin-top: 11px; }
.collection-links #workspace-gallery-link { color: var(--accent); }
.search-clear { width: 28px; height: 28px; font-size: 15px; }
.search-results { position: absolute; inset: calc(100% + 7px) 0 auto; max-height: min(365px, 48dvh); overflow: auto; padding: 6px; border: 1px solid #3a3a3a; border-radius: 10px; background: #171717; box-shadow: 0 14px 50px #000a; }
.search-result { width: 100%; min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 9px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; font-size: 14px; }
.search-result:hover, .search-result:focus-visible { background: #272727; }
.search-result:focus-visible, .search-topic:focus-visible { outline-offset: -2px; }
.search-result strong { font-weight: 620; }
.search-result small { color: var(--muted); font-size: 12px; }
.search-result-description { grid-column: 1 / -1; overflow: hidden; color: var(--soft); font-size: 13px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.search-result.all-results { display: flex; justify-content: center; color: var(--accent); border-top: 1px solid #2d2d2d; }
.search-message { padding: 10px; color: var(--muted); font-size: 14px; }
.search-topics { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 10px 10px; }
.search-topic { min-height: 34px; padding: 4px 9px; color: var(--soft); border: 1px solid #383838; border-radius: 6px; background: #202020; font-size: 13px; }
.search-topic:hover { color: var(--accent); border-color: #707f5a; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { font-size: clamp(1.55rem, 2.3vw, 2rem); font-weight: 690; line-height: 1.18; letter-spacing: -.035em; }
.section-heading p { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.text-link { display: inline-flex; align-items: center; gap: 7px; flex: none; padding-block: 6px; color: var(--soft); font-size: 14px; white-space: nowrap; transition: color .18s; }
.text-link:hover { color: var(--accent); }
.text-link [data-icon] { font-size: 15px; }

.remix-section, .guide-section { padding-top: 67px; scroll-margin-top: 18px; }
.library-section { padding-top: 12px; scroll-margin-top: 18px; }
.library-heading { margin-bottom: 20px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 3px; padding: 4px; border: 1px solid var(--border); border-radius: 8px; background: #141414; }
.filter-bar button { min-height: 33px; padding: 4px 12px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); font-size: 14px; }
.filter-bar button:hover { color: var(--text); }
.filter-bar button[aria-pressed="true"] { border-color: #363636; color: var(--text); background: #272727; }
.library-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.work-card { position: relative; display: flex; flex-direction: column; width: 100%; min-width: 0; padding: 5px; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text); transition: border-color .2s, background .2s, translate .2s; }
.work-card:hover { translate: 0 -3px; border-color: #66774e; background: #191d16; }
.work-art { display: block; width: 100%; aspect-ratio: 1.76; overflow: hidden; border-radius: 7px; border: 1px solid #ffffff08; isolation: isolate; }
.work-info { display: grid; gap: 6px; width: 100%; padding: 13px 9px 11px; }
.work-type { color: var(--accent); font-size: 12px; font-weight: 580; }
.work-title-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font-size: 18px; font-weight: 690; line-height: 1.3; letter-spacing: -.02em; }
.work-title-row::before { position: absolute; inset: 0; content: ""; }
.work-title-row [data-icon] { color: var(--muted); font-size: 17px; transition: color .2s, translate .2s; }
.work-card:hover .work-title-row [data-icon] { color: var(--accent); translate: 2px 0; }
.work-description { color: var(--muted); font-size: 14px; line-height: 1.55; }
.empty-state { display: grid; justify-items: center; gap: 14px; padding: 48px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.empty-state [data-icon] { color: var(--accent); font-size: 26px; }
.empty-state h3 { font-size: 18px; font-weight: 640; text-align: center; }

.remix-panel { display: grid; grid-template-columns: .9fr 1.1fr; gap: 0; border: 1px solid #2e302a; border-radius: 13px; background: #141512; overflow: hidden; }
.remix-inputs, .remix-result { display: flex; flex-direction: column; gap: 17px; padding: 23px; }
.remix-result { border-left: 1px solid #30312c; background: #10110e; gap: 11px; }
.remix-result-heading { min-height: 37px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.remix-result-heading .button { min-height: 37px; }
.select-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.remix-inputs label, .remix-result label { display: block; font-size: 14px; font-weight: 640; line-height: 1.45; }
.select-control { position: relative; display: block; width: 100%; margin-top: 8px; }
.select-control [data-icon] { position: absolute; pointer-events: none; right: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
select, textarea { color: var(--text); border: 1px solid #35362f; border-radius: 7px; background: #1a1b17; }
select { width: 100%; appearance: none; padding: 10px 28px 10px 10px; font-size: 14px; line-height: 1.45; }
textarea { display: block; width: 100%; padding: 12px; resize: vertical; line-height: 1.65; font-size: 14px; }
textarea::placeholder { color: #a1a397; }
#company { margin-top: 8px; }
.field-note { margin-top: -8px; color: var(--muted); font-size: 13px; line-height: 1.55; }
#remix-output { min-height: 215px; flex: 1; background: #191b15; color: #daded0; }

.guide-section { padding-bottom: 74px; }
.guide-grid { display: grid; grid-template-columns: 1fr .8fr; gap: 16px; }
.guide-steps, .guide-example { margin: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.guide-steps { padding: 2px 23px 2px 45px; }
.guide-steps li { padding: 18px 0 18px 5px; }
.guide-steps li + li { border-top: 1px solid var(--border); }
.guide-steps li::marker { color: var(--accent); font-size: 15px; font-weight: 680; }
.guide-steps h3, .guide-example h3 { font-size: 17px; font-weight: 670; line-height: 1.35; }
.guide-steps p, .guide-example p { margin-top: 7px; color: var(--soft); font-size: 15px; line-height: 1.65; }
.guide-example { display: flex; flex-direction: column; align-items: start; padding: 20px; background: #161913; border-color: #343c2c; }
.guide-example h3 { color: var(--accent); }
.guide-example dl { display: grid; gap: 8px; width: 100%; margin: 15px 0; padding-top: 13px; border-top: 1px solid #343c2c; font-size: 14px; line-height: 1.6; }
.guide-example dl div { display: grid; grid-template-columns: 4.75em 1fr; gap: 6px; }
.guide-example dt { color: var(--muted); }
.guide-example dd { margin: 0; }
.guide-example .button { margin-top: auto; }

.site-footer { border-top: 1px solid var(--border); }
.footer-inner { min-height: 92px; display: flex; align-items: center; gap: 20px; }
.footer-inner .brand { width: 137px; flex: none; }
.footer-inner .site-wordmark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #f2f0e8;
  font-size: 1.45rem;
  font-weight: 760;
  line-height: 1;
  letter-spacing: -.069em;
}
.footer-inner p { color: var(--muted); font-size: 14px; }
.footer-inner .text-link:last-child { margin-left: auto; }

.join-dialog { width: min(420px, calc(100vw - 28px)); padding: 0; border: 1px solid #405d86; border-radius: 18px; background: #101725; color: var(--text); box-shadow: 0 20px 55px #000b; }
.join-dialog::backdrop { background: #030711bd; backdrop-filter: blur(5px); }
.join-panel { padding: 22px; }
.join-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.join-panel h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.join-panel p { margin: 12px 0 20px; color: #c4cddd; line-height: 1.7; }
.join-panel .button { background: #c5deff; color: #102038; }
.join-panel .button:hover { background: #e0edff; }

.detail-dialog { --detail-height: min(90dvh, 850px); width: min(1000px, calc(100vw - 32px)); max-height: var(--detail-height); padding: 0; border: 1px solid #41443a; border-radius: 15px; overflow: hidden; background: #141512; color: var(--text); box-shadow: 0 24px 120px #000a; }
.detail-dialog::backdrop { background: #050505bd; backdrop-filter: blur(5px); }
.detail-shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: var(--detail-height); }
.detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 20px 22px 16px; }
#detail-category { color: var(--accent); font-size: 13px; font-weight: 580; }
.detail-heading h2 { margin-top: 5px; font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.2; }
.detail-close { height: 36px; width: 36px; outline-offset: 1px; background: #242520; }
.detail-description { margin-top: 8px; color: var(--soft); font-size: 16px; line-height: 1.55; }
.detail-body { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 16px; align-items: start; overflow-y: auto; overscroll-behavior: contain; padding: 2px 22px 16px; }
.detail-overview { grid-column: 1; grid-row: 1; min-width: 0; }
.detail-preview { width: 100%; aspect-ratio: 1.76; overflow: hidden; border-radius: 9px; background: #20221d; isolation: isolate; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-block: 13px; }
.detail-tags span { padding: 3px 8px; border: 1px solid #34382c; border-radius: 5px; color: #c4c8bc; font-size: 12px; }
.detail-notes { display: grid; gap: 10px; margin: 0; padding: 11px 13px; border: 1px solid #30322c; border-radius: 8px; background: #1b1d18; }
.detail-notes dt { color: var(--accent); font-size: 13px; font-weight: 640; }
.detail-notes dd { margin: 5px 0 0; color: var(--soft); font-size: 14px; line-height: 1.55; }
.detail-notes ul { margin: 0; padding-left: 1.25em; }
.prompt-box { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; border: 1px solid #30322c; border-radius: 8px; background: #181916; }
.prompt-tabs { display: flex; gap: 4px; padding: 4px; border-bottom: 1px solid #30322c; }
.prompt-tabs button { min-width: 0; padding: 9px 13px; border: 1px solid transparent; border-radius: 5px; background: transparent; text-align: center; color: var(--soft); font-size: 14px; white-space: nowrap; }
.prompt-tabs button:hover { color: var(--text); }
.prompt-tabs button[aria-selected="true"] { border-color: #404b32; color: var(--accent); background: #252d1e; }
.prompt-tabs button:focus-visible { outline-offset: -2px; }
.prompt-help { padding: 11px 14px; border-bottom: 1px solid #30322c; background: #1c1e18; color: var(--soft); font-size: 14px; line-height: 1.55; }
#detail-prompt { height: clamp(185px, 38dvh, 360px); padding: 14px; border: 0; border-radius: 0; resize: none; background: transparent; font-size: 16px; }
#detail-prompt:focus-visible { outline-offset: -3px; }
.detail-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 14px; padding: 12px 22px; border-top: 1px solid #30322c; background: #181916; }
.detail-copy-status { margin-right: auto; color: var(--accent); font-size: 14px; }
.detail-buttons { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; }
.toast { position: fixed; z-index: 12; bottom: 24px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 11px 16px; border: 1px solid #435436; border-radius: 8px; box-shadow: 0 6px 35px #0009; color: var(--accent); background: #20291b; font-size: 14px; text-align: center; }

@media (max-width: 1080px) {
  .shell { width: calc(100% - 64px); }
}
@media (max-width: 880px) {
  .hero h1 { font-size: clamp(2.8rem, 7.15vw, 3.7rem); }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .remix-inputs, .remix-result { padding: 17px; }
}
@media (max-width: 700px) {
  .shell { width: calc(100% - 38px); }
  .footer-inner { flex-wrap: wrap; padding-block: 12px; }
  .hero { padding-block: 40px 28px; }
  .hero-description { font-size: 16px; }
  .hero h1 { font-size: clamp(2.7rem, 9.2vw, 4rem); }
  .remix-section, .guide-section { padding-top: 48px; }
  .remix-panel { grid-template-columns: 1fr; }
  .remix-result { border-left: 0; border-top: 1px solid #30312c; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-section { padding-bottom: 52px; }
  .detail-body { grid-template-columns: minmax(0, 1fr); }
  .prompt-box, .detail-overview { grid-column: auto; grid-row: auto; }
  #detail-prompt { height: clamp(148px, 32dvh, 250px); }
}
@media (max-width: 500px) {
  .shell { width: calc(100% - 28px); }
  .brand { width: clamp(110px, 40vw, 142px); }
  .hero { padding-block: 34px 24px; }
  .hero h1 { font-size: clamp(2.05rem, 10.35vw, 3.3rem); letter-spacing: -.07em; }
  .hero-description { margin-top: 17px; max-width: 340px; line-height: 1.7; }
  .search-area { margin-top: 21px; }
  .search-key { display: none; }
  .section-heading { gap: 8px; margin-bottom: 15px; }
  .section-heading p { font-size: 13px; }
  .library-heading { align-items: start; flex-direction: column; gap: 12px; }
  .library-grid { gap: 8px; }
  .work-info { padding: 9px 4px 7px; }
  .work-title-row { font-size: 15px; }
  .work-description { font-size: 13px; }
  .work-title-row [data-icon] { font-size: 14px; }
  .footer-inner { min-height: 72px; gap: 4px 10px; }
  .footer-inner .brand { width: min(35vw, 130px); }
  .footer-inner p { display: none; }
  .detail-dialog { --detail-height: calc(100dvh - 22px); width: calc(100vw - 22px); }
  .detail-heading, .detail-body, .detail-actions { padding-inline: 13px; }
  .detail-heading { padding-block: 14px 12px; }
  .detail-description { font-size: 14px; }
  .detail-actions { padding-block: 9px; }
  .detail-actions .button { padding-inline: 9px; }
  .prompt-tabs button { flex: 1; padding-inline: 4px; }
  .remix-result-heading .button { padding-inline: 8px; }
}

@media (min-width: 881px) and (max-height: 820px) {
  .hero h1 { font-size: clamp(3.1rem, 4.2vw, 3.7rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.ui-gallery { padding-block: 12px 44px; scroll-margin-top: 18px; }
.ui-gallery .section-heading { align-items: center; flex-wrap: wrap; gap: 6px 16px; }
.ui-gallery .ui-gallery-count { margin: 0; }
.ui-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 2.7vw, 36px) clamp(12px, 1.5vw, 22px);
}
.ui-gallery-card {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 5px;
  min-width: 0;
  color: var(--text);
  text-align: left;
}
.ui-gallery-card-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--gallery-cover-ratio, 3 / 4);
  margin-block-end: 5px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: zoom-in;
}
.ui-gallery-card-media > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.ui-gallery-card > span, .ui-gallery-card > a {
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.ui-gallery-card > .ui-gallery-card-title { font-size: clamp(.94rem, 1.45vw, 1.1rem); font-weight: 670; }
.ui-gallery-card > .ui-gallery-card-description { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.ui-gallery--mini { --gallery-cover-ratio: 2 / 3; }
#collection-content:has(.ui-gallery[data-app-shelf]:not([hidden])):not(:has(#library[data-app-library="references"])) .search-area { display:none; }
#library > .ui-gallery { width: 100%; margin-inline: 0; padding: 0; }
#library[data-app-library="references"] > .ui-gallery { display: none; }
.ui-gallery-recent { min-height:43px; padding:7px 12px; color:var(--text); border:1px solid var(--border); border-radius:8px; background:var(--panel); font:inherit; }
.ui-gallery-recent[aria-pressed="true"] { color:#c9e1ff; border-color:#7ca3d6; background:#233954; }
.ui-gallery-card > a:hover { color: #b9d8ff; text-decoration: underline; text-underline-offset: 3px; }
.ui-gallery-dialog { width: min(900px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 12px; border: 1px solid #405d86; border-radius: 15px; background: #101725; color: var(--text); }
.ui-gallery-dialog::backdrop { background: #000c; }
.ui-gallery-dialog figure { margin: 0; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
.ui-gallery-dialog figcaption h2 { font-size: 1.125rem; font-weight: 650; }
.ui-gallery-image-frame { grid-column: 1 / -1; min-width: 0; border-radius: 8px; }
.ui-gallery-dialog img { display: block; width: 100%; max-height: 70dvh; object-fit: contain; }
.ui-gallery-image-frame--actual { overflow: auto; max-height: 68dvh; background: var(--bg); }
.ui-gallery-dialog .ui-gallery-image-frame--actual img { width: auto; max-width: none; max-height: none; margin-inline: auto; }
.ui-gallery-image-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ui-gallery-image-status:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .65rem; padding: .75rem; }
.ui-gallery-image-status p { margin: 0; }
.ui-gallery-image-frame img[hidden], .home-preview-stage img[hidden], .ui-gallery-image-status button[hidden] { display: none; }
.ui-gallery-file-actions .button:disabled { opacity: .6; cursor: default; }

.ui-gallery--workspace .section-heading { margin-bottom: 14px; }
.ui-gallery-tools { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.ui-gallery-tools .filter-bar { flex: 0 1 auto; }
.ui-gallery-tools .filter-bar button[aria-pressed="true"] { color: var(--accent); border-color: #405b7e; background: #1e2d43; }
.ui-gallery-search { display: flex; flex: 0 1 250px; align-items: center; gap: 9px; min-height: 43px; padding-inline: 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--panel); }
.ui-gallery-search:focus-within { border-color: #829363; }
.ui-gallery-search input { width: 100%; min-width: 0; padding: 8px 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: .875rem; }
.ui-gallery-search input::placeholder { color: var(--muted); }
.ui-gallery--workspace { --gallery-cover-ratio: 16 / 10; }
.ui-gallery-dialog--workspace { width: min(1240px, calc(100vw - 24px)); padding: clamp(12px, 2.5vw, 24px); border-color: #383838; background: var(--panel); }
.ui-gallery-dialog--workspace figure { gap: 12px; }
.ui-gallery-dialog--workspace img { max-height: 68dvh; border-radius: 8px; background: var(--bg); }
#ui-gallery-meta { margin-top: 4px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.ui-gallery-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 12px; }
.ui-gallery-pages { display: flex; gap: 8px; }
.ui-gallery-prompt { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.ui-gallery-prompt summary { width: fit-content; color: var(--soft); cursor: pointer; }
.ui-gallery-prompt summary:hover { color: var(--accent); }
.ui-gallery-prompt p:not(:empty) { margin-top: 8px; color: var(--accent); font-size: .875rem; }
.ui-gallery-prompt textarea { display: block; width: 100%; margin-block: 8px; padding: 10px; border: 1px solid #383838; border-radius: 8px; color: var(--text); background: var(--bg); font-size: .875rem; line-height: 1.5; resize: vertical; }

@media (max-width: 950px) {
  .ui-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ui-gallery-search { flex-basis: 100%; }
}
@media (max-width: 710px) {
  .ui-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.ui-gallery-selects { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-gallery-selects select {
  min-height: 43px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel);
  font-size: .875rem;
}
.ui-gallery-page-list { margin: 12px 0; padding-inline-start: 1.4em; color: var(--soft); font-size: .875rem; line-height: 1.6; }

#ui-gallery-play { margin-top: 10px; justify-self: start; }

#home-preview-image { object-fit:contain; }
