:root {
  --bg: #070b12;
  --bg-soft: #0d121c;
  --panel: #101826;
  --card: #0c121c;
  --line: rgba(148, 197, 255, 0.1);
  --line-strong: rgba(94, 234, 212, 0.35);
  --text: #eef5ff;
  --muted: #9aadc4;
  --faint: #6d8199;
  --accent: #5eead4;
  --accent-2: #38bdf8;
  --accent-ink: #041018;
  --chip: rgba(94, 234, 212, 0.06);
  --chip-active: #eef5ff;
  --danger: #fb7185;
  --ok: #4ade80;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
  --radius: 18px;
  --warm: #5eead4;
  --glow: 0 0 24px rgba(94, 234, 212, 0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
.seo-snapshot { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body {
  font-family: "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  letter-spacing: 0.01em;
  background:
    radial-gradient(900px 480px at 8% -10%, rgba(56, 189, 248, 0.12), transparent 55%),
    radial-gradient(820px 420px at 92% 0%, rgba(94, 234, 212, 0.1), transparent 52%),
    radial-gradient(700px 500px at 50% 110%, rgba(56, 189, 248, 0.05), transparent 50%),
    var(--bg);
  background-attachment: fixed;
}
.tech-grid {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(148, 197, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 197, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,0.55), transparent 75%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, video { max-width: 100%; display: block; }
button { cursor: pointer; }
::selection { background: var(--accent); color: var(--accent-ink); }

#app { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 64px; display: flex; align-items: center; gap: 16px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(148, 197, 255, 0.1);
  background: rgba(7, 11, 18, 0.78);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: inset 0 -1px 0 rgba(94, 234, 212, 0.08);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px;
  background: transparent; padding: 10px 9px; flex-direction: column; justify-content: space-between;
}
.nav-toggle span { display: block; height: 1.5px; background: var(--text); border-radius: 2px; }
.auth-actions { display: flex; gap: 8px; align-items: center; }
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--chip);
  border-radius: 999px; padding: 4px 10px 4px 4px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.user-name { font-size: 13px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 8px); width: 220px; background: #0f1622;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); z-index: 30;
}
.user-pop-name { font-weight: 650; }
.user-pop-mail { color: var(--faint); font-size: 12px; margin: 2px 0 10px; word-break: break-all; }
.user-pop a, .user-pop button {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 0; color: var(--muted);
}
.user-pop a:hover, .user-pop button:hover { color: var(--text); }
.brand {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  object-fit: cover; flex-shrink: 0;
  box-shadow: var(--glow), 0 0 0 1px rgba(94, 234, 212, 0.25);
}
.brand-text {
  display: grid; gap: 1px; line-height: 1.1;
}
.brand-text strong {
  font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  background: linear-gradient(90deg, #fff, #9ff5e8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-text small {
  font-size: 10px; color: var(--faint); letter-spacing: 0.08em; text-transform: lowercase;
}
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 14px;
  border: 1px solid transparent;
  transition: color .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.nav a.active, .nav a:hover {
  color: var(--text);
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.18);
}
.nav a.active { box-shadow: inset 0 0 0 1px rgba(94, 234, 212, 0.12); }
.topbar-meta {
  color: var(--faint); font-size: 12px;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(148, 197, 255, 0.1);
  background: rgba(255,255,255,0.02);
}
.view { flex: 1; min-height: 0; }
.site-footer {
  border-top: 1px solid rgba(148, 197, 255, 0.08);
  background: rgba(7, 11, 18, 0.65);
}
.site-footer-inner {
  max-width: 1440px; margin: 0 auto;
  padding: 16px 24px 22px;
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  color: var(--faint); font-size: 12px; letter-spacing: 0.04em;
}
.site-footer a { color: var(--accent); }
.site-footer a:hover { color: #fff; }

.page { padding: 22px 24px 48px; max-width: 1440px; margin: 0 auto; }
.gallery-page { padding-top: 16px; }
.gallery-toolbar { display: grid; gap: 10px; margin-bottom: 16px; }
.gallery-toolbar-main {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}
.gallery-search {
  flex: none;
  width: 260px !important;
  max-width: min(260px, 100%);
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}
.gallery-btn {
  flex: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  min-height: 0;
}
.gallery-btn.primary {
  box-shadow: none;
}
.gallery-count {
  flex: none; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums;
  white-space: nowrap; margin-left: 4px;
}
.gallery-filters.filter-panel {
  margin: 0; padding: 10px 12px;
  border-radius: 12px;
  background: rgba(10, 16, 26, 0.55);
  box-shadow: none;
}
.gallery-filters .filters { gap: 6px; }
.gallery-filters .filters + .filters {
  margin-top: 8px; padding-top: 8px;
}
.gallery-filters .chip {
  padding: 5px 9px; font-size: 11.5px;
  border-radius: 8px;
}
.gallery-filters .chip.active {
  box-shadow: none;
}
.gallery-filters .filter-label {
  margin-right: 4px; letter-spacing: 0.06em;
}
.gallery-pager {
  padding-top: 20px;
}
.gallery-pager .pager-num {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 197, 255, 0.28);
  cursor: pointer;
}
.gallery-pager .pager-num:hover {
  color: #fff;
  background: rgba(125, 211, 252, 0.16);
  border-color: rgba(125, 211, 252, 0.45);
}
.gallery-pager .pager-num.active {
  color: #10141c;
  background: #7dd3fc;
  border-color: transparent;
  cursor: default;
}
.gallery-pager .btn:not(:disabled):not([aria-disabled="true"]) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(148, 197, 255, 0.28);
}
.gallery-pager .btn:not(:disabled):not([aria-disabled="true"]):hover {
  color: #fff;
  background: rgba(125, 211, 252, 0.16);
  border-color: rgba(125, 211, 252, 0.45);
}
.gallery-pager .btn:disabled,
.gallery-pager .btn[aria-disabled="true"] {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.gallery-pager .gallery-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.gallery-pager .gallery-jump input {
  width: 56px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(16, 16, 20, 0.85);
  color: var(--text);
  text-align: center;
}
.gallery-pager .gallery-jump input:focus {
  outline: none;
  border-color: rgba(94, 234, 212, 0.45);
}
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-eyebrow {
  margin: 0 0 8px; color: var(--warm); font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
}
.page-head h1 {
  margin: 0; font-size: clamp(28px, 3vw, 36px); font-weight: 650;
  letter-spacing: -0.03em; line-height: 1.1;
}
.page-head p, .muted { color: var(--muted); }
.page-head #prompt-count { margin: 8px 0 0; font-size: 13px; }
.subtle { color: var(--faint); font-size: 12px; }

.toolbar, .filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-panel {
  margin: 0 0 22px; padding: 14px 16px;
  border: 1px solid rgba(148, 197, 255, 0.12); border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.05), rgba(56, 189, 248, 0.02)),
    rgba(10, 16, 26, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.filter-panel .filters { margin: 0; }
.filter-panel .filters + .filters {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.filter-label {
  color: var(--faint); font-size: 11px; margin-right: 6px;
  letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
}
.chip {
  border: 1px solid var(--line); background: var(--chip); color: var(--muted);
  border-radius: 999px; padding: 7px 11px; font-size: 12px;
  transition: background .15s ease, border-color .15s ease, color .15s ease, transform .15s ease;
}
.chip:hover { border-color: var(--line-strong); color: var(--text); }
.chip.active {
  background: linear-gradient(135deg, #e8fffb, #d9f4ff);
  color: var(--accent-ink); border-color: transparent;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.18);
}
.chip.reset {
  margin-left: 4px;
  border-style: dashed;
  color: var(--faint);
}
.chip.reset:not(:disabled):hover { color: var(--text); border-color: var(--line-strong); }
.chip.reset.is-idle,
.chip.reset:disabled { opacity: .45; cursor: default; }
.search {
  width: min(420px, 100%); border: 1px solid var(--line); background: rgba(16,16,20,0.85);
  border-radius: 14px; padding: 12px 14px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search:focus {
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.12), var(--glow);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; height: 100%;
}
.gallery-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent 28%),
    var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  overflow: hidden;
  display: flex; flex-direction: column; height: 100%;
  transition: border-color .2s ease, transform .25s ease, box-shadow .25s ease;
  animation: card-in .45s ease both;
}
.gallery-card:hover {
  border-color: rgba(94, 234, 212, 0.28);
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(0,0,0,0.4), 0 0 0 1px rgba(94, 234, 212, 0.08);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.grid .gallery-card:nth-child(1) { animation-delay: .02s; }
.grid .gallery-card:nth-child(2) { animation-delay: .04s; }
.grid .gallery-card:nth-child(3) { animation-delay: .06s; }
.grid .gallery-card:nth-child(4) { animation-delay: .08s; }
.grid .gallery-card:nth-child(5) { animation-delay: .1s; }
.grid .gallery-card:nth-child(6) { animation-delay: .12s; }
.cover {
  display: block; width: 100%; aspect-ratio: 4 / 3; height: auto;
  background: #0a0a0e; border: 0; padding: 0; overflow: hidden; cursor: zoom-in;
  position: relative; flex-shrink: 0;
}
.cover-veil {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, transparent 45%, rgba(0,0,0,0.55) 100%),
    radial-gradient(120% 80% at 50% 0%, transparent 40%, rgba(0,0,0,0.18) 100%);
  opacity: 0.85; transition: opacity .25s ease;
}
.cover-hint {
  position: absolute; left: 50%; bottom: 14px; z-index: 1;
  transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 999px;
  background: rgba(10, 10, 14, 0.72); color: #f5f5f7;
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 11px; letter-spacing: 0.08em; font-weight: 560;
  opacity: 0; transition: opacity .2s ease, transform .2s ease;
  pointer-events: none; backdrop-filter: blur(10px);
  white-space: nowrap;
}
.cover-hint i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 10px rgba(94, 234, 212, 0.7);
}
.cover:hover .cover-hint,
.cover:focus-visible .cover-hint { opacity: 1; transform: translate(-50%, 0); }
.cover:hover .cover-veil,
.cover:focus-visible .cover-veil { opacity: 1; }
.cover img {
  width: 100%; height: 100%; object-fit: cover; object-position: center;
  background: #0a0a0e; display: block;
  transition: transform .5s cubic-bezier(.2,.8,.2,1), filter .35s ease;
}
.cover:hover img,
.cover:focus-visible img { transform: scale(1.05); filter: brightness(1.06) saturate(1.05); }
.cover-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: var(--faint); }
.card-body { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-kicker {
  color: var(--faint); font-size: 11px; letter-spacing: 0.04em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 8px; flex-shrink: 0; }
.card-title {
  font-size: 15px; font-weight: 650; line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-desc {
  color: var(--muted); font-size: 13px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px; color: var(--muted); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 999px; padding: 3px 8px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: transparent; border-radius: 11px;
  padding: 8px 12px; font-size: 13px;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--chip); border-color: var(--line-strong); }
.btn.primary {
  background: linear-gradient(135deg, #7af0dc, #4fc3f7);
  color: var(--accent-ink); border-color: transparent; font-weight: 650;
  box-shadow: 0 8px 18px rgba(56, 189, 248, 0.22);
}
.btn.primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn.primary:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.ghost { color: var(--muted); }
.btn.danger { color: var(--danger); border-color: rgba(251, 113, 133, .3); }
.tip-wrap { position: relative; display: inline-flex; }
.tip-bubble {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px);
  padding: 6px 10px; border-radius: 8px; background: #f4f4f5; color: #111113;
  font-size: 12px; line-height: 1.3; white-space: nowrap; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .08s ease, transform .08s ease;
  box-shadow: var(--shadow); z-index: 30;
}
.tip-wrap:hover .tip-bubble,
.tip-wrap:focus-within .tip-bubble {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}

.pager { display: flex; justify-content: center; gap: 10px; padding: 24px 0 8px; color: var(--muted); }
.empty, .loading {
  padding: 64px 16px; text-align: center; color: var(--muted);
}

.detail {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px;
}
.detail-gallery { display: grid; gap: 12px; }
.hero {
  border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: var(--card);
}
.hero img { width: 100%; max-height: 72vh; object-fit: contain; background: #000; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs img, .thumbs button { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: none; padding: 0; overflow: hidden; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 20px;
}
.panel h1 { margin: 0 0 8px; font-size: 26px; }
.prompt-box {
  white-space: pre-wrap; background: var(--bg); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; line-height: 1.7; font-size: 14px; max-height: 360px; overflow: auto;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: 13px; margin: 10px 0 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.seo-summary { margin: 12px 0 0; line-height: 1.65; }
.seo-faq { margin-top: 8px; display: grid; gap: 8px; }
.seo-faq h2 { margin: 8px 0 0; font-size: 15px; }
.seo-faq details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--bg); }
.seo-faq summary { cursor: pointer; font-weight: 650; }
.seo-faq p { margin: 8px 0 0; color: var(--muted); line-height: 1.6; }

.workbench {
  display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 60px);
}
.logs {
  border-right: 1px solid var(--line); background: var(--bg-soft); overflow: auto; padding: 16px;
}
.logs h2 { margin: 0 0 12px; font-size: 16px; }
.log-card {
  border: 1px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px; margin-bottom: 8px;
}
.log-card.active { border-color: #fff; }
.log-card .title { font-size: 13px; font-weight: 650; }
.stage { padding: 20px 24px 32px; overflow: auto; }
.composer { display: grid; gap: 14px; max-width: 980px; }
.composer-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
textarea {
  width: 100%; min-height: 140px; resize: vertical; border-radius: 14px;
  border: 1px solid var(--line); background: var(--bg-soft); padding: 14px; outline: none;
}
.refs { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.ref {
  position: relative; width: 92px; height: 92px; flex: 0 0 auto; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); background: #000;
}
.ref img { width: 100%; height: 100%; object-fit: contain; object-position: center center; }
.ref .x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.65); color: #fff;
}
.drop {
  border: 1px dashed var(--line-strong); border-radius: 14px; padding: 18px; color: var(--muted); text-align: center;
}
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 18px; }
.result, .skeleton {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; min-height: 180px;
}
.result img, .result video { width: 100%; height: 220px; object-fit: cover; background: #000; }
.result-bar { display: flex; gap: 8px; padding: 10px; }
.skeleton { display: grid; place-items: center; color: var(--muted); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 40; padding: 20px;
}
.modal {
  width: min(920px, 100%); max-height: 86vh; overflow: auto; background: #121214;
  border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow);
}
.app-dialog {
  width: min(420px, 100%);
  background: #101822;
  border: 1px solid rgba(148, 197, 255, 0.18);
}
.app-dialog-msg {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.app-dialog-chips,
.app-dialog-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.group-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
}
.group-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 6px;
}
.group-name {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  border-radius: 8px;
  background: rgba(8, 14, 22, 0.7);
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
}
.group-name span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-name em {
  flex: none;
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
}
.group-name.active,
.group-row.is-active .group-name {
  border-color: #7dd3fc;
  color: #7dd3fc;
}
.group-act {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(148, 197, 255, 0.16);
  border-radius: 8px;
  background: #101822;
  color: #c5d4e6;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.group-act svg { width: 14px; height: 14px; display: block; }
.group-act:hover { color: #7dd3fc; border-color: #7dd3fc; }
.group-act.danger:hover { color: #fda4af; border-color: #fda4af; }
.app-dialog-actions-stack {
  flex-direction: column;
  align-items: stretch;
}
.app-dialog-actions-stack .btn { justify-content: center; }
.app-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.app-dialog-actions .btn.danger {
  background: #fda4af;
  color: #10141c;
  border-color: transparent;
}
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  padding: clamp(18px, 4vw, 48px);
  opacity: 0; transition: opacity .24s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox.is-leaving { opacity: 0; }
.lightbox-veil {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 55% at 50% 42%, rgba(94, 234, 212, 0.1), transparent 58%),
    radial-gradient(120% 90% at 50% 40%, rgba(20, 36, 56, 0.5), rgba(0, 0, 0, 0.84) 62%),
    rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
}
.lightbox-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.08; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.lightbox-stage {
  position: relative; z-index: 1; margin: 0;
  width: min(1180px, 100%);
  display: grid; gap: 16px; justify-items: center;
  transform: translateY(14px) scale(0.972);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), opacity .28s ease;
  opacity: 0;
}
.lightbox.is-open .lightbox-stage { transform: none; opacity: 1; }
.lightbox.is-leaving .lightbox-stage { transform: translateY(10px) scale(0.985); opacity: 0; }
.lightbox-frame {
  position: relative;
  width: fit-content;
  max-width: 100%;
  border-radius: 22px;
  padding: 12px;
  background:
    linear-gradient(155deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02) 42%, rgba(255,255,255,0.04)),
    rgba(14, 14, 18, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.62),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 0 80px rgba(94, 234, 212, 0.08);
  min-height: 0;
  display: grid; place-items: center;
}
.lightbox-spinner {
  position: absolute; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12); border-top-color: var(--warm);
  animation: spin .8s linear infinite;
  opacity: 1; transition: opacity .2s ease;
}
.lightbox.is-ready .lightbox-spinner { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.lightbox-frame img,
.lightbox-frame video,
.lightbox-frame .lightbox-media {
  position: relative; z-index: 1;
  display: block;
  max-width: min(1100px, calc(94vw - 24px));
  max-height: min(76vh, 880px);
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 14px;
  background: #08080b;
  opacity: 0;
  transform: scale(0.985);
  transition: opacity .35s ease, transform .4s cubic-bezier(.2,.8,.2,1);
}
.lightbox-frame video.lightbox-media {
  width: min(1100px, calc(94vw - 24px));
  max-height: min(72vh, 820px);
  background: #000;
}
.lightbox.is-ready .lightbox-frame img,
.lightbox.is-ready .lightbox-frame video,
.lightbox.is-ready .lightbox-frame .lightbox-media { opacity: 1; transform: none; }
.lightbox-caption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 18px; width: min(100%, 760px);
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(14, 14, 18, 0.72);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(245, 245, 247, 0.94);
  box-shadow: 0 16px 40px rgba(0,0,0,0.28);
}
.lightbox-caption-main { display: grid; gap: 4px; min-width: 0; }
.lightbox-eyebrow {
  color: var(--warm); font-size: 10px; letter-spacing: 0.16em;
  text-transform: uppercase; font-weight: 650;
}
.lightbox-caption strong {
  font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(560px, 70vw);
}
.lightbox-caption em {
  font-style: normal; color: rgba(168, 168, 179, 0.92); font-size: 12px; font-weight: 400;
}
.lightbox-caption-actions {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.lightbox-copy {
  background: rgba(255,255,255,0.92); color: #111; border-color: transparent;
  font-weight: 650; padding: 8px 14px; border-radius: 999px;
}
.lightbox-copy:hover {
  background: #fff; border-color: transparent; filter: none;
}
.lightbox-close {
  position: absolute; top: 20px; right: 20px; z-index: 2;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.7);
  color: #f5f5f7;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.lightbox-close svg { width: 18px; height: 18px; }
.lightbox-close:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
  transform: scale(1.05);
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  background: rgba(16, 16, 20, 0.78);
  color: #f5f5f7;
  line-height: 0;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.lightbox-nav svg { width: 22px; height: 22px; display: block; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-nav:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.3);
}
.lightbox-count { letter-spacing: 0; text-transform: none; font-weight: 650; }
body.lightbox-open { overflow: hidden; }
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 80;
  transform: translateX(-50%);
  background: #fff; color: #111;
  border-radius: 14px; padding: 12px 18px; font-size: 13px; font-weight: 600;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  pointer-events: none;
}

.field { display: grid; gap: 6px; }
.field span { color: var(--faint); font-size: 12px; }
select, .field input {
  border: 1px solid var(--line); background: var(--bg-soft); border-radius: 10px; padding: 9px 10px;
}
.settings { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }

@media (max-width: 980px) {
  .detail, .workbench, .settings { grid-template-columns: 1fr; }
  .logs { border-right: 0; border-bottom: 1px solid var(--line); max-height: 180px; }
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-meta { display: none; }
  .page { padding: 16px 14px 96px; }
  .page-head { flex-direction: column; align-items: stretch; }
  .page-head h1 { font-size: 24px; }
  .search { width: 100%; font-size: 16px; }
  .gallery-toolbar-main { width: 100%; }
  .gallery-search { width: min(260px, 100%) !important; font-size: 16px; }
  .nav-toggle { display: flex; }
  .nav {
    display: none; position: absolute; left: 12px; right: 12px; top: 68px;
    flex-direction: column; background: #121214; border: 1px solid var(--line);
    border-radius: 16px; padding: 8px; box-shadow: var(--shadow); z-index: 25;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .user-name { display: none; }
  .composer-top { flex-direction: column; align-items: stretch; }
  .stage { padding: 16px 14px 28px; }
  .settings { grid-template-columns: 1fr 1fr; }
  .nav-auth { display: block; }
  .auth-actions { display: none; }
  .auth-page { grid-template-columns: 1fr; min-height: calc(100vh - 60px); }
  .auth-visual { display: none; }
  .auth-panel { padding: 24px 16px 48px; align-items: start; }
  .auth-card { padding: 24px 20px; }
  .toast { left: 12px; right: 12px; bottom: 16px; transform: none; width: auto; }
  textarea, input, select { font-size: 16px; }
}

.auth-page {
  display: grid; grid-template-columns: minmax(280px, 1.05fr) minmax(320px, .95fr);
  min-height: calc(100vh - 60px);
}
.auth-visual {
  position: relative; overflow: hidden; padding: 48px 42px;
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(94, 234, 212, 0.14), transparent 55%),
    radial-gradient(700px 380px at 90% 20%, rgba(56, 189, 248, 0.12), transparent 50%),
    linear-gradient(180deg, #0d1522 0%, #070b12 100%);
  border-right: 1px solid var(--line);
}
.auth-glow {
  position: absolute; inset: auto -80px -120px auto; width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(94, 234, 212, 0.22), transparent 65%);
  pointer-events: none;
}
.auth-visual-inner { position: relative; max-width: 460px; }
.auth-kicker {
  margin: 0 0 10px; color: var(--accent); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 650;
}
.auth-visual h2 { margin: 0 0 14px; font-size: 36px; line-height: 1.2; font-weight: 650; }
.auth-visual p { color: var(--muted); line-height: 1.7; }
.auth-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; }
.auth-stats div {
  padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.03);
}
.auth-stats strong { display: block; font-size: 22px; margin-bottom: 4px; }
.auth-stats span { color: var(--faint); font-size: 12px; }
.auth-panel { display: grid; place-items: center; padding: 32px 24px; }
.auth-card {
  width: min(420px, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; padding: 28px;
}
.auth-card h1 { margin: 0 0 8px; font-size: 28px; }
.auth-field { display: grid; gap: 8px; margin: 14px 0; }
.auth-field span { font-size: 13px; color: var(--muted); }
.auth-field input {
  width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 12px 14px; outline: none;
}
.auth-field input:focus {
  border-color: rgba(94, 234, 212, 0.45);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.1);
}
.password-wrap { position: relative; }
.password-wrap input { padding-right: 64px; }
.password-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; color: var(--faint); font-size: 12px; padding: 6px;
}
.auth-submit { width: 100%; justify-content: center; padding: 12px 16px; margin-top: 8px; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13px; margin: 16px 0 0; }
.auth-switch a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.auth-error { color: var(--danger); font-size: 13px; margin: 0 0 8px; }
.auth-gate {
  max-width: 520px; margin: 48px auto; padding: 32px; border: 1px solid var(--line);
  border-radius: 24px; background: var(--card); text-align: center;
}
.auth-gate h1 { margin: 0 0 10px; }
@media (min-width: 981px) {
  .nav-auth { display: none; }
}
body.is-logged-in .nav-auth { display: none !important; }
body.is-auth .nav,
body.is-auth .nav-toggle,
body.is-auth .topbar-meta { display: none !important; }
body.is-auth .topbar { border-bottom-color: transparent; }

.user-pop-credits { color: var(--muted); font-size: 12px; margin: -6px 0 8px; }
.page-narrow { max-width: 760px; margin: 0 auto; padding: 28px 20px 64px; display: grid; gap: 16px; }
body.is-account { overflow: hidden; }
body.is-account #app { height: 100vh; height: 100dvh; overflow: hidden; }
body.is-account .site-footer { display: none; }
body.is-account .view { min-height: 0; display: flex; }
.account-shell {
  flex: 1; width: 100%; min-height: 0; margin: 0; padding: 0;
  display: grid; grid-template-columns: 248px minmax(0, 1fr); align-items: stretch;
  font-size: 13px; line-height: 1.45;
}
.account-side {
  height: 100%; overflow: auto;
  background: var(--bg-soft); border-right: 1px solid var(--line); border-radius: 0;
  padding: 14px 10px 18px;
}
.account-who {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center;
  padding: 2px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--line);
}
.account-who .avatar {
  width: 36px; height: 36px; font-size: 14px; line-height: 1;
  display: grid; place-items: center; flex-shrink: 0;
}
.account-id { min-width: 0; display: grid; gap: 2px; }
.account-id strong {
  display: block; font-size: 13px; font-weight: 650; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-id span {
  display: block; color: var(--faint); font-size: 11px; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.account-menu-label {
  margin: 10px 8px 4px; color: var(--faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
}
.account-menu { display: grid; gap: 1px; }
.account-menu a {
  display: grid; gap: 1px; padding: 8px 10px; border-radius: 10px; color: var(--muted);
  border: 1px solid transparent;
}
.account-menu a strong { font-size: 13px; font-weight: 620; color: var(--text); line-height: 1.3; }
.account-menu a small { font-size: 11px; color: var(--faint); line-height: 1.3; }
.account-menu a:hover { background: rgba(94, 234, 212, 0.06); }
.account-menu a.active {
  background: rgba(94, 234, 212, 0.1);
  border-color: rgba(94, 234, 212, 0.18);
}
.account-main {
  min-width: 0; min-height: 0; overflow: auto;
  display: grid; gap: 12px; align-content: stretch;
  grid-auto-rows: minmax(0, 1fr);
  padding: 14px 16px 16px;
}
.account-main:has(> .account-panel + .account-panel) {
  grid-auto-rows: auto;
  align-content: start;
}
.account-panel {
  width: 100%; min-height: 100%;
  border-radius: 14px;
  box-sizing: border-box;
  padding: 16px 18px;
}
.account-panel h1, .account-panel h2 { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.account-panel .muted, .account-panel .subtle { font-size: 12px; }
.account-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.account-panel-head a { color: var(--accent); font-size: 12px; }
.account-kicker { margin: 0 0 4px; color: var(--faint); font-size: 11px; letter-spacing: .1em; }
.account-balance { font-size: 40px; font-weight: 680; letter-spacing: -0.045em; line-height: 1; }
.account-note { color: var(--muted); font-size: 12px; line-height: 1.55; max-width: 720px; margin: 8px 0 0; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.account-main .stack-form { max-width: 420px; gap: 8px; margin-top: 10px; }
.account-main .field span { font-size: 11px; }
.account-main .field input, .account-main .account-toolbar input {
  padding: 8px 10px; border-radius: 10px; font-size: 13px;
}
.account-main .btn { padding: 7px 11px; font-size: 12px; border-radius: 9px; }
.account-main.is-manage { display: flex; flex-direction: column; }
.account-main.is-manage > .account-panel,
.account-main.is-manage > .account-manage { flex: 1; min-height: 0; }
.account-work { display: flex; flex-direction: column; min-height: 0; }
.account-work .admin-table {
  flex: 1; min-height: 0; overflow: auto;
  align-content: start;
}
.account-list {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.account-list .ledger {
  flex: 1; min-height: 0; overflow: auto; margin-top: 4px;
  align-content: start;
}
.account-list .account-pager,
.account-work .account-pager {
  flex-shrink: 0; margin-top: auto;
}
.account-toolbar {
  display: flex; flex-wrap: wrap; align-items: end; gap: 8px;
  max-width: none; margin: 10px 0;
}
.account-toolbar .field { min-width: 140px; flex: 1 1 140px; }
.account-manage {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px;
  min-height: 0; height: 100%;
}
.account-manage.is-list-only { grid-template-columns: minmax(0, 1fr); }
.account-editor { overflow: auto; }
.account-editor h3 { margin: 14px 0 6px; font-size: 13px; font-weight: 650; }
.account-user-detail {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden;
}
.account-user-detail > .account-panel-head {
  align-items: flex-start; gap: 16px; margin-bottom: 8px;
}
.account-user-detail > .account-panel-head > div:first-child {
  display: grid; gap: 6px; min-width: 0;
}
.account-user-detail > .account-panel-head h1 { margin: 0; }
.account-user-detail > .account-panel-head .btn { width: fit-content; }
.account-stat-grid {
  display: grid; grid-template-columns: repeat(3, minmax(84px, 1fr)); gap: 8px; min-width: 320px;
}
.account-stat-grid div {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(255,255,255,0.02);
}
.account-stat-grid strong { display: block; font-size: 18px; letter-spacing: -0.03em; }
.account-stat-grid span { color: var(--faint); font-size: 11px; }
.account-tabs { margin: 0 0 10px; }
.account-user-body {
  flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column;
}
.account-overview-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.account-note-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: rgba(255,255,255,0.02);
}
.account-note-card h3 { margin: 0 0 8px; font-size: 13px; }
.account-note-card p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.account-note-card .ledger-row { padding: 6px 0; }
.admin-row.ledger-head { grid-template-columns: 120px minmax(0, 1.4fr) 72px 72px 150px; }
.admin-row.codes-head { grid-template-columns: minmax(160px, 1.2fr) 72px 64px 150px auto; }
.admin-row.jobs-head { grid-template-columns: 72px 160px minmax(0, 1.6fr) 150px; }
.admin-row.audits-head { grid-template-columns: 120px minmax(0, 1.6fr) 150px; }
.account-manage-forms {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start;
}
.account-manage-forms .stack-form {
  max-width: none; margin: 0; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.account-manage-forms h3 { margin: 0 0 8px; font-size: 13px; }
.account-main .ledger { gap: 0; }
.account-main .ledger-row {
  grid-template-columns: minmax(0, 1fr) 88px 96px;
  gap: 10px; padding: 8px 0; align-items: center;
}
.account-main .ledger-row strong { font-size: 13px; font-weight: 620; }
.account-main .ledger-num { font-size: 13px; text-align: right; }
.admin-table { display: grid; align-content: start; }
.admin-row {
  display: grid; grid-template-columns: minmax(150px, 1.1fr) 72px minmax(120px, 1.2fr) 96px auto;
  gap: 10px; align-items: center; padding: 8px 2px; border-top: 1px solid var(--line);
  width: 100%; text-align: left; background: transparent; border-left: 0; border-right: 0; border-bottom: 0;
  border-radius: 0; color: inherit; font-size: 12px;
}
.admin-row.users { grid-template-columns: minmax(110px, 1fr) minmax(140px, 1.2fr) 72px 96px 96px auto; }
.admin-row.head { color: var(--faint); font-size: 11px; border-top: 0; padding-top: 2px; }
.admin-row code { font-size: 12px; }
button.admin-row { cursor: pointer; }
button.admin-row:hover, button.admin-row.active { background: rgba(94, 234, 212, 0.06); }
.admin-row em {
  margin-left: 6px; font-style: normal; font-size: 10px; color: var(--accent);
}
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; }
.account-editor .ledger-row { grid-template-columns: minmax(0, 1fr) auto; }
.account-pager {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.account-pager .pager-total { color: var(--faint); font-size: 12px; margin-right: auto; }
.account-pager .pager-num {
  min-width: 30px; height: 30px; display: inline-grid; place-items: center;
  border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: transparent;
  font-size: 12px; padding: 0 8px;
}
.account-pager .pager-num:hover { color: var(--text); border-color: var(--line-strong); }
.account-pager .pager-num.active {
  color: var(--accent-ink); background: var(--accent); border-color: transparent; font-weight: 650;
}
.account-pager .pager-gap { color: var(--faint); padding: 0 2px; }
.account-pager .btn { min-height: 30px; }
.account-main .seg { margin: 4px 0 8px; }
.account-main .code-box { margin-top: 8px; padding: 10px 12px; font-size: 12px; border-radius: 10px; }
@media (max-width: 1100px) {
  .account-manage { grid-template-columns: 1fr; height: auto; }
  .account-overview-grid, .account-manage-forms, .account-stat-grid { grid-template-columns: 1fr 1fr; }
  .account-user-detail > .account-panel-head { flex-direction: column; }
}
@media (max-width: 800px) {
  body.is-account { overflow: auto; }
  body.is-account #app { height: auto; min-height: 100dvh; overflow: visible; }
  body.is-account .site-footer { display: block; }
  body.is-account .view { display: block; }
  .account-shell { grid-template-columns: 1fr; }
  .account-side {
    height: auto; overflow: visible;
    border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 10px 8px;
  }
  .account-who { display: none; }
  .account-menu-label { display: none; }
  .account-menu {
    display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px;
  }
  .account-menu + .account-menu { margin-top: 6px; }
  .account-menu a { min-width: max-content; padding: 7px 10px; }
  .account-menu a small { display: none; }
  .account-main { padding: 12px 12px 28px; }
  .account-balance { font-size: 34px; }
  .account-main .ledger-row { grid-template-columns: minmax(0, 1fr) auto; }
  .account-main .ledger-row .subtle:last-child { grid-column: 1; }
}
.wallet-card { display: grid; gap: 4px; padding: 16px 0 8px; }
.wallet-card strong { font-size: 40px; letter-spacing: -0.04em; }
.wallet-card small { color: var(--muted); }
.stack-form { display: grid; gap: 10px; max-width: 420px; margin-top: 12px; }
.ledger, .code-table { display: grid; gap: 8px; }
.ledger-row, .code-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto;
  gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line);
}
.ledger-num { font-variant-numeric: tabular-nums; font-weight: 650; }
.ledger-num.plus { color: #5eead4; }
.ledger-num.minus { color: #fca5a5; }
.code-box {
  margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--line); white-space: pre-wrap; user-select: all;
}
body.is-studio { overflow: hidden; }
body.is-studio #app { height: 100vh; height: 100dvh; overflow: hidden; }
body.is-studio .site-footer { display: none; }
body.is-studio .view { min-height: 0; display: flex; }
body.is-studio .igen {
  flex: 1;
  width: 100%;
  min-height: 0;
  height: 100%;
}
.studio .logs {
  background: #0b111a;
  border-right: 1px solid rgba(148, 197, 255, 0.1);
  padding: 16px 12px;
}
.studio .logs h2 { font-size: 13px; letter-spacing: 0.04em; color: var(--muted); }
.studio .log-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  margin: 0 0 8px;
  padding: 8px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}
.studio .log-card.active { border-color: rgba(94, 234, 212, 0.7); background: rgba(94, 234, 212, 0.08); }
.studio .log-thumb {
  width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: #05080d; display: block;
}
.studio .log-thumb-empty { display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.studio .log-copy { min-width: 0; display: grid; gap: 4px; }
.studio .log-card .title {
  font-size: 12px; font-weight: 620; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.studio-stage {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  height: 100%;
  padding: 16px 18px 14px;
  gap: 12px;
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(56, 189, 248, 0.06), transparent 60%),
    #070b12;
}
.studio-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0; }
.studio-head h1 { margin: 0; font-size: 20px; }
.studio-head .muted { margin: 3px 0 0; font-size: 13px; }
.studio-canvas {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 4px;
}
.studio-empty {
  display: grid; justify-items: center; gap: 6px; text-align: center; color: var(--muted); max-width: 360px;
}
.studio-empty strong { color: var(--text); font-size: 16px; font-weight: 650; }
.studio-empty span { font-size: 13px; line-height: 1.6; }
.studio-shot { width: min(440px, 100%); margin: 0; display: grid; gap: 10px; }
.studio-shot img {
  width: 100%;
  height: auto;
  max-height: min(58vh, 680px);
  object-fit: contain;
  border-radius: 16px;
  background: #05080d;
  border: 1px solid rgba(148, 197, 255, 0.12);
}
.studio-shot .result-bar { justify-content: flex-end; padding: 0; }
.studio .dock {
  position: relative;
  bottom: auto;
  margin: 0;
  background: #101722;
  border: 1px solid rgba(148, 197, 255, 0.16);
  border-radius: 20px;
  padding: 8px 10px 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}
.studio .dock textarea {
  min-height: 92px;
  max-height: 180px;
  margin: 0;
  padding: 8px 8px 4px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  line-height: 1.65;
  font-size: 14px;
  resize: vertical;
}
.studio .dock-refs { gap: 8px; padding: 6px 4px 2px; }
.studio .dock .ref { width: 64px; height: 64px; border-radius: 10px; }
.studio .dock-bar {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 197, 255, 0.08);
}
.studio .ipt-pill, .studio .dock-send {
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dock {
  position: sticky; bottom: 8px; margin-top: 16px;
  background: rgba(10, 14, 22, 0.92); border: 1px solid var(--line); border-radius: 22px;
  padding: 10px 12px 12px; backdrop-filter: blur(18px); box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.dock textarea { min-height: 78px; border: 0; background: transparent; padding: 8px 6px 4px; }
.dock-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dock-slot { position: relative; }
.dock-cost { color: var(--muted); font-size: 13px; margin-left: auto; }
.dock-send { min-width: 88px; }
.dock-refs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; }
.ipt-pill {
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: inherit;
  border-radius: 999px; padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.ipt-pill:hover { border-color: var(--line-strong); }
.dock-pop {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 8;
  min-width: 180px; max-width: min(360px, 80vw); padding: 8px;
  background: #12161f; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.dock-pop-wide { min-width: 280px; }
.dock-pop-title { font-size: 12px; color: var(--muted); padding: 6px 8px 4px; }
.dock-item {
  width: 100%; text-align: left; border: 0; background: transparent; color: inherit;
  border-radius: 12px; padding: 8px 10px; display: grid; gap: 2px; cursor: pointer;
}
.dock-item small { color: var(--muted); }
.dock-item.active, .dock-item:hover { background: rgba(94, 234, 212, 0.1); }
.aspect-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 4px; }
.aspect-item {
  border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 12px;
  padding: 8px 4px; display: grid; justify-items: center; gap: 6px; cursor: pointer;
}
.aspect-item i {
  display: block; width: 22px; border: 1.5px solid currentColor; border-radius: 3px; max-height: 22px;
}
.aspect-item.active { border-color: #5eead4; color: #5eead4; }
.seg { display: flex; gap: 6px; padding: 4px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line); background: transparent; color: inherit; border-radius: 999px;
  padding: 6px 10px; cursor: pointer;
}
.seg button.active { background: #5eead4; color: #04221c; border-color: transparent; }
.ref-add {
  display: grid; place-items: center; color: var(--muted); font-size: 22px; background: transparent; cursor: pointer;
}
@media (max-width: 720px) {
  .dock-cost { margin-left: 0; }
  .ledger-row, .code-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .settings { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .btn { min-height: 40px; }
  .auth-card h1 { font-size: 24px; }
  .brand-text small { display: none; }
  .site-footer-inner { padding: 14px 16px 20px; }
}

.igen {
  display: grid;
  grid-template-columns: 280px minmax(340px, 0.92fr) minmax(320px, 1.08fr);
  min-height: 0;
  height: 100%;
  background: #070b12;
}
.igen-side, .igen-main, .igen-result {
  min-height: 0;
  min-width: 0;
}
.igen-side, .igen-result {
  display: flex;
  flex-direction: column;
  background: #0b111a;
}
.igen-side { border-right: 1px solid rgba(148, 197, 255, 0.1); overflow: hidden; }
.igen-result { border-left: 1px solid rgba(148, 197, 255, 0.1); overflow: hidden; }
.igen-result-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.igen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 14px 10px;
}
.igen-head h2 { margin: 0; font-size: 14px; font-weight: 650; }
.igen-mode-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1;
}
.igen-mode-tag.is-text {
  border-color: rgba(125, 211, 252, 0.35);
  background: rgba(125, 211, 252, 0.1);
  color: #7dd3fc;
}
.igen-mode-tag.is-image {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(94, 234, 212, 0.1);
  color: #5eead4;
}
.igen-head em {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 20px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.igen-x, .igen-tool {
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}
.igen-x { width: 32px; padding: 0; font-size: 18px; }
.igen-list { flex: 1; overflow: auto; padding: 0 10px 12px; min-width: 0; min-height: 0; }
.log-more {
  flex: none;
  display: block;
  margin: 0 10px 12px;
  min-height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  color: #7dd3fc;
  text-align: center;
  line-height: 32px;
  font-size: 12px;
  text-decoration: none;
}
.log-more:hover { border-color: rgba(125, 211, 252, 0.55); background: rgba(125, 211, 252, 0.08); }
.log-filter {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px;
}
.log-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.log-chip {
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
  cursor: pointer;
}
.log-chip.active {
  border-color: rgba(94, 234, 212, 0.55);
  color: #5eead4;
  background: rgba(94, 234, 212, 0.08);
}
.igen .log-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 8px;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(148, 197, 255, 0.08);
  border-radius: 14px;
  position: relative;
  align-items: start;
  overflow: hidden;
  box-sizing: border-box;
}
.igen .log-card:has(.log-check) {
  grid-template-columns: 18px 56px minmax(0, 1fr);
}
.igen .log-card.active { border-color: rgba(94, 234, 212, 0.65); }
.igen .log-card.is-selected { border-color: rgba(125, 211, 252, 0.7); background: rgba(125, 211, 252, 0.06); }
.igen .log-card.is-dragging { opacity: .45; }
.igen .log-check {
  display: grid;
  place-items: start center;
  padding-top: 18px;
  cursor: pointer;
}
.igen .log-check input {
  width: 14px;
  height: 14px;
  accent-color: #7dd3fc;
  cursor: pointer;
}
.igen .log-thumb {
  width: 56px; height: 56px; border-radius: 10px; object-fit: contain; object-position: center center; background: #05080d; display: block;
}
.igen .log-thumb-empty { display: grid; place-items: center; color: var(--muted); width: 56px; height: 56px; border-radius: 10px; background: #05080d; }
.igen-video .log-thumb {
  object-fit: cover;
  background: #000;
}
.igen .log-thumb-ref {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: #05080d;
}
.igen .log-thumb-ref img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.igen .log-thumb-ref .igen-spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  z-index: 1;
}
.igen .log-thumb-ref.is-running img {
  opacity: 0.55;
}
.igen .log-thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 1;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.88);
  color: #fecaca;
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
}
.igen .log-media {
  width: 56px;
  display: grid;
  gap: 4px;
  justify-items: center;
  align-content: start;
}
.igen .log-group {
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.4;
  background: rgba(249, 168, 212, 0.14);
  color: #f9a8d4;
  text-align: center;
}
.igen .log-copy {
  min-width: 0;
  max-width: 100%;
  display: grid;
  gap: 3px;
  align-content: center;
  overflow: hidden;
}
.igen .log-card .title {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.igen .log-remark {
  font-size: 11px;
  color: #fbbf24;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igen .log-file-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.igen .log-file {
  font-size: 11px;
  color: #c4d4e8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.igen .log-file:hover { color: #5eead4; }
.copy-mini {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8ea0b8;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}
.copy-mini svg { width: 13px; height: 13px; display: block; }
.copy-mini:hover { color: #5eead4; background: rgba(94, 234, 212, 0.1); }
.filename-field .copy-mini { margin-left: -2px; }
.igen .log-model {
  font-size: 11px;
  color: #7dd3fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.igen .log-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}
.igen .log-meta > span {
  flex: none;
  white-space: nowrap;
}
.igen .log-foot {
  position: relative;
  min-height: 28px;
  margin-top: 2px;
}
.igen .log-time {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 28px;
}
.igen .log-actions {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.igen .log-card:hover .log-actions {
  display: flex;
}
.igen .log-card:hover .log-time {
  visibility: hidden;
}
.igen-side.is-batch .log-card:hover .log-actions,
.igen-side.is-batch .log-card.active .log-actions,
.igen-side.is-batch .log-card.is-selected .log-actions {
  display: none !important;
}
.igen-side.is-batch .log-card:hover .log-time,
.igen-side.is-batch .log-card.active .log-time,
.igen-side.is-batch .log-card.is-selected .log-time {
  visibility: visible;
}
.igen .log-actions button {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  display: inline-grid;
  place-items: center;
  color: #10141c;
  cursor: pointer;
}
.igen .log-actions button svg {
  width: 13px;
  height: 13px;
  display: block;
}
.igen .log-actions button[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: #0b1220;
  border: 1px solid rgba(148, 197, 255, 0.2);
  color: #e8eef7;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 6;
}
.igen .log-actions button[data-tip]:hover::after,
.igen .log-actions button[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.igen .log-actions button[data-act="import"] { background: #7dd3fc; }
.igen .log-actions button[data-act="retry"] { background: #5eead4; }
.igen .log-actions button[data-act="remark"] { background: #fcd34d; }
.igen .log-actions button[data-act="group"] { background: #f9a8d4; }
.igen .log-actions button[data-act="delete"] { background: #fda4af; }
.log-batch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 10px 10px;
}
.log-batch[hidden] { display: none !important; }
.log-batch button {
  border: 0;
  border-radius: 999px;
  min-height: 26px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  color: #10141c;
}
.log-batch #log-select-all { background: #7dd3fc; }
.log-batch #log-batch-group { background: #f9a8d4; }
.log-batch #log-batch-delete { background: #fda4af; }
.log-batch #log-batch-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}
.igen-main.is-log-drop .composer-box,
.igen-main.is-ref-drop .composer-box {
  outline: 2px dashed rgba(94, 234, 212, 0.55);
  outline-offset: -4px;
}
.igen-main.is-ref-drop .composer-refs {
  outline: 2px dashed rgba(94, 234, 212, 0.7);
  outline-offset: 1px;
  border-color: rgba(94, 234, 212, 0.45);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.12), transparent 55%),
    #0a121c;
}
.is-ref-drag { cursor: grab; }
.is-ref-drag:active, .is-dragging-ref { cursor: grabbing; }
.is-dragging-ref { opacity: .55; }
.igen .log-status {
  font-style: normal; border-radius: 999px; padding: 1px 7px; font-size: 11px;
  background: rgba(56, 189, 248, 0.15); color: #7dd3fc;
}
.igen .log-status.failed { background: rgba(251, 113, 133, 0.15); color: #fda4af; }
.igen .log-status.running { background: rgba(94, 234, 212, 0.15); color: #5eead4; }
.igen-main {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #0b111a;
}
.igen-mobile-bar, .igen-summary, .igen-sheet-head, .igen-side .igen-x { display: none; }
.igen-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  flex: 1;
}
.igen-label {
  display: flex; align-items: center; gap: 8px; min-height: 32px;
}
.igen-label span:first-child { font-size: 14px; font-weight: 650; }
.igen-label-note { color: var(--muted); font-size: 12px; font-weight: 400; }
.igen-label .igen-tool { margin-left: auto; }
.igen textarea {
  min-height: 148px;
  max-height: 280px;
  margin: 0;
  border-radius: 14px;
  border: 1px solid rgba(148, 197, 255, 0.12);
  background: #0d141e;
  padding: 12px;
  line-height: 1.65;
  resize: vertical;
}
.igen-drop {
  min-height: 108px;
  border: 1px dashed rgba(148, 197, 255, 0.22);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  background: rgba(255,255,255,.02);
}
.igen-drop-empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 12px;
}
.igen .ref { width: 76px; height: 76px; }
.igen-params { display: grid; gap: 14px; padding-top: 4px; overflow: auto; min-height: 0; }
.igen-field { display: grid; gap: 8px; }
.igen-choices { display: grid; gap: 8px; }
.igen-choice {
  text-align: left;
  border: 1px solid rgba(148, 197, 255, 0.12);
  background: #0d141e;
  color: inherit;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
  cursor: pointer;
}
.igen-choice small { color: var(--muted); }
.igen-choice.active { border-color: #eef5ff; }
.igen-go {
  width: 100%;
  min-height: 44px;
  margin-top: auto;
  border: 0;
  border-radius: 12px;
  background: #e8eef8;
  color: #10141c;
  font-weight: 700;
  cursor: pointer;
}
.igen-go:disabled { opacity: .55; cursor: wait; }
.igen-go span { margin-left: 8px; font-weight: 600; color: #3b475c; }
.igen-canvas {
  flex: none;
  min-height: 0;
  overflow: visible;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-content: start;
  justify-items: stretch;
  padding: 8px 16px 12px;
}
.igen-canvas[data-n="0"],
.igen-canvas:not([data-n]) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.igen-canvas[data-n="1"],
.igen-canvas[data-n="2"],
.igen-canvas[data-n="3"],
.igen-canvas[data-n="4"] {
  grid-template-columns: 1fr 1fr;
  align-content: start;
  align-items: start;
}
.igen-spec {
  position: static;
  z-index: auto;
  flex: none;
  max-height: none;
  overflow: visible;
  border-top: 1px solid rgba(148, 197, 255, 0.1);
  margin: 0 16px 16px;
  padding: 12px 0 4px;
  display: grid;
  gap: 8px;
  background: transparent;
}
.igen-spec[hidden] { display: none !important; }
.igen-spec-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.igen-spec-row strong { font-size: 14px; }
.igen-spec-row span, .igen-spec-refs > span { font-size: 12px; color: var(--muted); }
.igen-spec-prompt-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: start;
  padding: 12px 12px 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.04), transparent 48%),
    #0a121c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.igen-spec-prompt-body {
  position: relative;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}
.igen-spec-prompt {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 13px;
  color: #d5e2f0;
  max-height: none;
  overflow: visible;
  cursor: pointer;
  border-radius: 0;
  padding: 0;
}
.igen-spec-prompt-wrap.is-collapsed .igen-spec-prompt {
  max-height: 8.2em;
  overflow: hidden;
}
.igen-spec-prompt-wrap.is-collapsed .igen-spec-prompt-body::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 18, 28, 0), #0a121c 88%);
}
.igen-spec-prompt:hover { color: #eef6ff; }
.igen-spec-prompt-wrap .copy-mini {
  grid-column: 2;
  grid-row: 1;
  margin-top: 0;
  color: #8ea0b8;
}
.igen-spec-toggle {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  margin: 0;
  padding: 2px 0 0;
  border: 0;
  background: transparent;
  color: #5eead4;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.igen-spec-toggle:hover { color: #99f6e4; }
.igen-spec-toggle[hidden] { display: none !important; }
.igen-spec-refs { display: grid; gap: 6px; }
.igen-spec-refs [data-spec-refs],
.imglog-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.igen-spec-refs em, .imglog-refs em { font-style: normal; color: var(--muted); font-size: 12px; }
.igen-spec-refs button {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #05080d;
  cursor: zoom-in;
}
.igen-spec-refs img, .imglog-refs img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  object-position: center center;
  border-radius: 8px;
  display: block;
  background: #05080d;
}
.igen-spec-refs video {
  width: 52px;
  height: 52px;
  object-fit: cover;
  display: block;
  background: #000;
}
.igen-spec-refs .spec-audio {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 11px;
  color: var(--muted);
  background: #0a121c;
}
.imglog-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px 18px;
  align-items: stretch;
}
.imglog-batch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.imglog-batch button {
  border: 0;
  border-radius: 999px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  color: #10141c;
}
.imglog-batch button:disabled { opacity: .45; cursor: not-allowed; }
.imglog-batch #img-select-all,
.imglog-batch #img-batch-download { background: #7dd3fc; }
.imglog-batch #img-batch-group { background: #c4b5fd; }
.imglog-batch #img-batch-asset { background: #86efac; }
.imglog-batch #img-batch-delete { background: #fda4af; }
.imglog-batch span { color: var(--muted); font-size: 12px; }
.imglog-card {
  position: relative;
  border: 1px solid rgba(148, 197, 255, 0.12);
  border-radius: 16px;
  background: rgba(10, 16, 26, 0.72);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}
.imglog-card.is-selected { border-color: rgba(125, 211, 252, 0.7); }
.imglog-check {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(7, 11, 18, 0.55);
  backdrop-filter: blur(8px);
}
.imglog-check input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.imglog-check span {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: transparent;
  pointer-events: none;
}
.imglog-check input:checked + span {
  border-color: #7dd3fc;
  background: #7dd3fc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.2 6.2 4.8 8.8 9.8 3.2' fill='none' stroke='%2310141c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.imglog-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  border: 0;
  background: #05080d;
  cursor: zoom-in;
  overflow: hidden;
  flex: none;
}
.imglog-cover:disabled { cursor: default; }
.imglog-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.imglog-cover em {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(5, 8, 13, 0.78);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}
.imglog-empty {
  min-height: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}
.filename-field,
.group-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.filename-field > span,
.group-field > span:first-child {
  flex: none;
  width: 3em;
  white-space: nowrap;
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  line-height: 30px;
}
.filename-field input,
.group-field .field-value {
  box-sizing: border-box;
  width: 180px;
  max-width: min(42vw, 240px);
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  border: 1px solid rgba(148, 197, 255, 0.2);
  border-radius: 8px;
  background: #0d141e;
  color: var(--text);
  padding: 0 8px;
  font-size: 12px;
  line-height: 28px;
  font-family: inherit;
  font-weight: 400;
  outline: none;
  box-shadow: none;
}
button.group-field {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  height: auto;
  max-width: none;
}
.group-field .field-value {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}
.filename-field input:focus,
.filename-field input:focus-visible,
.group-field:focus .field-value,
.group-field:focus-visible .field-value,
.group-field:hover .field-value {
  outline: none;
  box-shadow: none;
  border-color: rgba(94, 234, 212, 0.55);
}
.igen-params-sheet {
  display: none;
}
.igen-params-head {
  display: none;
}
.igen-sheet-grab {
  display: none;
}
.imglog-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 12px 12px 14px;
}
.imglog-model { font-size: 14px; font-weight: 650; }
.imglog-name {
  font-size: 12px;
  color: #7dd3fc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.imglog-meta, .imglog-foot { font-size: 12px; color: var(--muted); }
.imglog-group,
.imglog-remark {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 12px;
  line-height: 1.4;
  height: 1.4em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.imglog-group { color: #c4b5fd; }
.imglog-remark { color: #f6d7b0; }
.imglog-group.is-empty,
.imglog-remark.is-empty { color: var(--muted); }
.imglog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}
.imglog-icon {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #10141c;
  cursor: pointer;
}
.imglog-icon svg { width: 15px; height: 15px; display: block; }
.imglog-icon:disabled { opacity: .4; cursor: not-allowed; }
.imglog-icon[data-detail] { background: #7dd3fc; }
.imglog-icon[data-asset] { background: #86efac; }
.imglog-icon[data-reuse] { background: #5eead4; }
.imglog-icon[data-edit-remark] { background: #fcd34d; }
.imglog-icon[data-edit-group] { background: #c4b5fd; }
.imglog-icon.is-delete,
.imglog-icon[data-del] {
  background: #fda4af;
}
.imglog-icon:hover { filter: brightness(1.08); }
.imglog-icon[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%) translateY(2px);
  padding: 4px 8px;
  border-radius: 6px;
  background: #0b1220;
  border: 1px solid rgba(148, 197, 255, 0.2);
  color: #e8eef7;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  z-index: 5;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.imglog-icon[data-tip]:hover::after,
.imglog-icon[data-tip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.imglog-actions .btn.danger { margin-left: auto; }
.imglog-detail {
  width: min(560px, 100%);
}
.imglog-detail-meta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.imglog-detail-section {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}
.imglog-detail-section > span {
  font-size: 12px;
  color: var(--muted);
}
.imglog-detail-section > p {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  background: #0d141e;
  border: 1px solid rgba(148, 197, 255, 0.14);
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 240px;
  overflow: auto;
  font-size: 13px;
}
.imglog-detail-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.imglog-detail-refs em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}
.imglog-detail-refs button {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #05080d;
  cursor: zoom-in;
}
.imglog-detail-refs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.imglog-refrow { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); min-width: 0; }
.imglog-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
}
.imglog-foot > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.imglog-foot .btn {
  justify-self: end;
  white-space: nowrap;
  min-height: 28px;
  padding: 0 10px;
}
.pager .btn[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.imglog-pager {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.imglog-pager .pager-total { margin-right: 4px; }
.imglog-pager .pager-size {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.imglog-pager .pager-size-box { position: relative; }
.imglog-pager .pager-size-btn {
  height: 32px;
  min-width: 72px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: #0d141e;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
}
.imglog-pager .pager-size-btn svg { width: 12px; height: 12px; color: #94c5ff; }
.imglog-pager .pager-size-btn[aria-expanded="true"] {
  border-color: #7dd3fc;
  color: #7dd3fc;
}
.imglog-pager .pager-size-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 6px);
  z-index: 8;
  min-width: 100%;
  padding: 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 197, 255, 0.18);
  background: #101822;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
  display: grid;
  gap: 2px;
}
.imglog-pager .pager-size-menu[hidden] { display: none; }
.imglog-pager .pager-size-menu button {
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}
.imglog-pager .pager-size-menu button:hover,
.imglog-pager .pager-size-menu button[aria-selected="true"] {
  background: rgba(125, 211, 252, 0.16);
  color: #7dd3fc;
}
.imglog-pager .pager-num {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
}
.imglog-pager .pager-num.active {
  color: #10141c;
  background: #7dd3fc;
  border-color: transparent;
}
.imglog-pager .pager-gap { color: var(--muted); }
.imglog-pager form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.imglog-pager input {
  width: 64px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: #0d141e;
  color: inherit;
  text-align: center;
  font-size: 12px;
  outline: none;
  box-shadow: none;
}
.imglog-pager input:focus,
.imglog-pager input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(94, 234, 212, 0.55);
}
.igen-modal-pager {
  justify-content: flex-start;
  padding: 14px 0 4px;
  gap: 6px;
}
.igen-modal-pager .btn {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}
.igen-modal-pager .btn:disabled {
  opacity: .4;
  pointer-events: none;
}
.igen-modal-pager .pager-num {
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.igen-modal-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
}
.igen-modal-jump input {
  width: 56px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: #0d141e;
  color: inherit;
  text-align: center;
  font-size: 12px;
  outline: none;
  box-shadow: none;
}
.igen-modal-jump input:focus,
.igen-modal-jump input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(94, 234, 212, 0.55);
}
.igen-empty {
  width: min(100%, 360px);
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
  background: transparent;
}
.igen-empty.is-loading {
  gap: 14px;
  width: 100%;
  min-height: 220px;
  flex: 1;
}
.igen-empty strong { color: var(--text); font-size: 15px; }
.igen-empty span { font-size: 13px; line-height: 1.5; max-width: 28em; }
.igen-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(148, 197, 255, 0.18);
  border-top-color: #5eead4;
  animation: spin .8s linear infinite;
}
.igen-spinner-sm { width: 18px; height: 18px; border-width: 2px; }
.param-sheet { display: grid; gap: 12px; }
.param-line { display: grid; gap: 6px; }
.param-line > span { font-size: 12px; color: var(--muted); }
.param-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.param-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: start;
}
.param-row .param-line { flex: 1; min-width: 140px; }
.param-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  min-height: 32px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
}
.param-chip.active { border-color: #5eead4; color: #5eead4; }
.param-sheet .aspect-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.igen-sheet-mask {
  display: none;
}
@media (min-width: 981px) {
  .igen-params-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 90;
    width: min(420px, calc(100vw - 48px));
    max-height: min(70vh, 560px);
    overflow: hidden;
    background: #12161f;
    border: 1px solid rgba(148, 197, 255, 0.18);
    border-radius: 16px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: transform .24s ease, opacity .2s ease, visibility 0s linear .24s;
  }
  .igen-params-sheet.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition: transform .24s ease, opacity .2s ease, visibility 0s;
  }
  .igen-params-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 12px 14px 8px;
  }
  .igen-params-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
  }
  .igen-params-sheet #settings {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 14px 14px;
  }
  body.is-studio .igen.is-params .igen-sheet-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }
  body.is-studio .igen.is-params .igen-sheet-mask.is-on {
    opacity: 1;
    pointer-events: auto;
  }
  .igen-sheet-mask[hidden] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}
.igen-canvas .igen-shot {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  justify-self: stretch;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: #0c121b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.igen-zoom {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  border: 0;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
  background: #05080d;
  cursor: zoom-in;
}
.igen-canvas .igen-zoom img,
.igen-shot img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
  background: #05080d;
  border: 0;
  display: block;
}
.igen-shot-actions {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 28px 10px 10px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.igen-shot:hover .igen-shot-actions,
.igen-shot:focus-within .igen-shot-actions {
  opacity: 1;
  pointer-events: auto;
}
@media (hover: none) {
  .igen-shot-actions { opacity: 1; pointer-events: auto; }
}
.igen-shot-actions .btn {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.88);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}
.igen-shot .result-bar { justify-content: flex-end; padding: 0; }
.igen-wallet { color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 980px) {
  body.is-studio, body.is-studio #app { height: 100dvh; overflow: hidden; }
  body.is-studio .view {
    display: block;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.is-studio .igen,
  .igen {
    display: flex;
    flex-direction: column;
    flex: none;
    height: auto;
    min-height: 100%;
    overflow: visible;
  }
  .igen-sheet-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 80;
    border: 0;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
  }
  .igen-sheet-mask.is-on {
    opacity: 1;
    pointer-events: auto;
  }
  .igen-sheet-mask[hidden] {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .igen-side {
    display: flex;
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 85;
    height: min(88dvh, 100%);
    max-height: 88dvh;
    background: #0b111a;
    flex-direction: column;
    padding-top: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(104%);
    transform-origin: bottom center;
    transition:
      transform .3s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s linear .3s;
  }
  .igen.is-history .igen-side {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
      transform .3s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s;
  }
  .igen-side .igen-sheet-grab,
  .igen-params-sheet .igen-sheet-grab {
    display: block;
    flex: none;
    width: 40px;
    height: 4px;
    margin: 10px auto 2px;
    border-radius: 999px;
    background: rgba(148, 197, 255, 0.3);
  }
  .igen-mobile-bar, .igen-summary, .igen-sheet-head { display: flex; }
  .igen-mobile-bar {
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 8px 10px 0;
    padding: 8px;
    border: 1px solid rgba(148, 197, 255, 0.12);
    border-radius: 14px;
    background:
      linear-gradient(180deg, rgba(94, 234, 212, 0.06), transparent 70%),
      #0d141e;
  }
  .igen-mobile-bar .igen-tool {
    flex: none;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 650;
    border-color: transparent;
  }
  .igen-tool-history {
    background: rgba(125, 211, 252, 0.16);
    color: #7dd3fc;
  }
  .igen-tool-params {
    background: rgba(94, 234, 212, 0.16);
    color: #5eead4;
  }
  .igen-mobile-bar .igen-wallet {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .igen-side .igen-head {
    flex: none;
    position: sticky;
    top: 0;
    z-index: 2;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 12px 14px;
    margin: 0;
    background: #0b111a;
    border-bottom: 1px solid rgba(148, 197, 255, 0.1);
  }
  .igen-side .igen-head h2 {
    flex: 1;
    min-width: 0;
  }
  .igen-side .igen-x {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    line-height: 1;
    font-size: 22px;
  }
  .igen-side .log-filter {
    padding: 10px 12px;
  }
  .igen-side .igen-list {
    padding: 0 12px 12px;
  }
  .igen-side .log-card {
    overflow: visible;
    padding: 10px;
    gap: 8px;
  }
  .igen-side .log-actions {
    gap: 4px;
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .igen-side .log-actions button {
    width: 24px;
    height: 24px;
  }
  .igen-side .log-foot {
    gap: 6px;
  }
  .igen-wallet { flex: 1; }
  .igen-summary {
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(148, 197, 255, 0.14);
    background: #0d141e;
    color: inherit;
    border-radius: 12px;
    padding: 0 12px;
    cursor: pointer;
  }
  .igen-params { display: none; }
  .igen.is-params .igen-params {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: #0b111a;
    padding: 0 14px 24px;
    overflow: auto;
  }
  .igen-main {
    order: 1;
    flex: none;
    min-height: 0;
    padding: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
  }
  .igen-main > .igen-head {
    flex: none;
    padding: 6px 12px 4px;
  }
  .igen-result {
    order: 2;
    flex: none;
    min-height: 0;
    max-height: none;
    overflow: visible;
    border-left: 0;
    border-top: 1px solid rgba(148, 197, 255, 0.12);
  }
  .igen-result-scroll {
    flex: none;
    min-height: 0;
    overflow: visible;
  }
  .igen-result .igen-canvas[data-n="0"],
  .igen-result .igen-canvas:not([data-n]) {
    flex: none;
    min-height: 0;
    padding: 8px 16px 20px;
  }
  .igen-result .igen-empty {
    padding: 16px 12px 20px;
  }
  .igen-spec { margin: 0 12px 12px; }
  .igen-spec-prompt-wrap.is-collapsed .igen-spec-prompt {
    max-height: 7.2em;
  }
  .igen-card { display: grid; flex: none; }
  .igen-params { overflow: visible; }

  /* Touch: always show log card actions (no hover) */
  .igen .log-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 28px;
  }
  .igen .log-time {
    flex: 1;
    min-width: 0;
    visibility: visible !important;
  }
  .igen .log-actions {
    display: flex;
    position: static;
    inset: auto;
    flex: none;
  }
  .igen .log-card:hover .log-time {
    visibility: visible;
  }
  .igen-side.is-batch .log-card:hover .log-actions,
  .igen-side.is-batch .log-card.active .log-actions,
  .igen-side.is-batch .log-card.is-selected .log-actions {
    display: none !important;
  }
}

.composer-box {
  flex: 1;
  min-height: 0;
  margin: 0 14px 14px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 197, 255, 0.18);
  border-radius: 8px;
  background: #070b12;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.composer-box:focus-within {
  border-color: rgba(94, 234, 212, 0.55);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.08);
}
.composer-prompt {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.igen .composer-box textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-height: none;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  resize: none;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 16px 12px;
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  box-sizing: border-box;
}
.igen .composer-box textarea::placeholder { color: #8ea0b8; }
.composer-refs {
  display: grid;
  gap: 8px;
  margin: 0 10px 10px;
  padding: 8px 10px 10px;
  overflow: visible;
  border-radius: 8px;
  border: 1px solid rgba(148, 197, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.05), transparent 55%),
    #0a121c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.composer-refs-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1;
}
.composer-refs-meta em {
  font-style: normal;
  color: #d5e2f0;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.composer-refs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.composer-refs-scroller {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.composer-refs .ref-add {
  flex: none;
}
.composer-refs .ref-add:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.composer-refs .ref {
  position: relative;
  width: 64px;
  height: 72px;
  border-radius: 0;
  cursor: grab;
  overflow: visible;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
}
.composer-refs .ref-frame {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #0a1018;
}
.composer-refs .ref img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  border: 0;
  border-radius: 0;
  background: transparent;
  pointer-events: none;
}
.composer-refs .ref .x {
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 0;
  font-size: 0;
  color: #fff;
  z-index: 4;
  background: rgba(8, 12, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.composer-refs .ref .x svg {
  display: block;
  width: 10px;
  height: 10px;
}
.composer-refs .ref-add {
  display: grid;
  place-items: center;
  width: 64px;
  height: 72px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 197, 255, 0.28);
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  overflow: hidden;
}
.composer-refs .ref.is-dragging { opacity: .35; }
.composer-refs .ref.is-over { outline: 2px solid #5eead4; outline-offset: 2px; }
.ref-hint,
.dock-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1;
}
.ref-hint {
  border: 1px dashed rgba(125, 211, 252, 0.35);
  background: transparent;
  color: #9eb6cc;
  border-radius: 8px;
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  cursor: pointer;
}
.ref-hint:hover {
  border-color: rgba(94, 234, 212, 0.55);
  color: #e8f7ff;
  background: rgba(94, 234, 212, 0.06);
}
.composer-refs.is-empty {
  padding-bottom: 10px;
}
.composer-refs.is-empty .ref-hint {
  min-height: 48px;
  font-size: 13px;
}
.dock-btn {
  box-sizing: border-box;
  width: auto;
  min-width: 72px;
  min-height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  color: #0b1118;
  font-weight: 650;
  background: #e8eef6;
}
.dock-btn:hover { filter: brightness(1.06); }
.dock-btn-upload { background: #7dd3fc; }
.dock-btn-assets { background: #f9a8d4; }
.dock-btn-prompt { background: #5eead4; }
.dock-btn-reset { background: #fcd34d; }
.dock-btn.is-busy {
  width: auto;
  min-width: 88px;
  padding: 0 10px;
  gap: 6px;
  display: inline-flex;
  cursor: wait;
}
.dock-btn:disabled { opacity: .7; }
.prompt-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ref-uploading {
  display: grid;
  place-items: center;
  width: 64px;
  height: 72px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 197, 255, 0.4);
  background: rgba(125, 211, 252, 0.08);
}
.composer-bar {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(148, 197, 255, 0.1);
  padding: 12px 12px 14px;
  background: #0c121b;
  border-radius: 0 0 7px 7px;
  position: relative;
  z-index: 3;
}
.composer-tools,
.composer-meta,
.composer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.composer-tools { flex-wrap: wrap; }
.composer-meta {
  justify-content: space-between;
  gap: 12px;
}
.composer-meta .filename-field { flex: 1; min-width: 0; }
.composer-meta .group-field { flex: 1; min-width: 0; }
.composer-meta .composer-credits { flex: none; }
.composer-actions {
  position: relative;
  justify-content: flex-end;
  gap: 10px;
}
.composer-slot { position: static; flex: 1; min-width: 0; margin-left: 0; }
.composer-slot .dock-pop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 6;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 14px;
  max-height: none;
  overflow: visible;
}
.composer-pill {
  width: 100%;
  max-width: none;
  border: 1px solid rgba(148, 197, 255, 0.2);
  background: #0d141e;
  color: inherit;
  border-radius: 8px;
  min-height: 30px;
  padding: 0 10px;
  cursor: pointer;
}
.composer-pill:hover { border-color: rgba(94, 234, 212, 0.45); }
.composer-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  text-align: left;
  line-height: 28px;
}
.composer-credits { color: var(--muted); font-size: 12px; white-space: nowrap; }
.composer-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #5eead4;
  color: #06221c;
  font-size: 18px;
  cursor: pointer;
  flex: none;
}
.composer-send:disabled { opacity: .5; cursor: wait; }
.igen-shot .result-bar { justify-content: flex-end; }
.igen-search {
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d141e;
  padding: 0 10px;
  height: 34px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 400;
  color: var(--text);
  line-height: 32px;
  outline: none;
  box-shadow: none;
}
.igen-search:focus,
.igen-search:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(94, 234, 212, 0.55);
}
.app-dialog-input {
  margin-top: 12px !important;
  height: 34px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 32px;
  border-radius: 8px;
  background: #0d141e;
  outline: none;
  box-shadow: none;
}
.app-dialog-input:focus,
.app-dialog-input:focus-visible {
  outline: none;
  box-shadow: none;
  border-color: rgba(94, 234, 212, 0.55);
}
.igen-modal { width: min(960px, 100%); }
.igen-modal-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 62vh;
  overflow: auto;
}
.igen-asset-tabs { margin-top: 10px; }
@media (max-width: 980px) {
  .composer-box {
    flex: none;
    margin: 0 10px 10px;
    min-height: 0;
    max-height: none;
    border-radius: 8px;
    overflow: visible;
  }
  .composer-prompt {
    flex: none;
    min-height: 0;
  }
  .igen .composer-box textarea {
    flex: none;
    min-height: 132px;
    max-height: 36vh;
    height: auto;
  }
  .composer-refs {
    flex: none;
    margin: 0 8px 8px;
  }
  .composer-bar {
    flex: none;
    border-radius: 0 0 8px 8px;
    padding: 10px;
    gap: 10px;
  }
  .composer-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    flex-wrap: nowrap;
  }
  .composer-meta .filename-field,
  .composer-meta .group-field {
    display: flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-width: 0;
  }
  .composer-meta .filename-field > span,
  .composer-meta .group-field > span:first-child {
    flex: none;
    width: 3em;
    white-space: nowrap;
  }
  .composer-meta .filename-field input,
  .composer-meta .group-field .field-value {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: none;
  }
  .composer-meta .composer-credits {
    flex: none;
    justify-self: end;
  }
  .composer-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }
  .composer-slot {
    flex: 1 1 auto;
    min-width: 0;
  }
  .composer-pill {
    min-height: 30px;
    padding: 0 10px;
    border-radius: 8px;
  }
  .composer-actions .composer-credits {
    flex: none;
  }
  .composer-send {
    width: 40px;
    height: 40px;
  }
  /* Params + history: bottom sheets above mask */
  .igen-params-sheet {
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 90;
    width: auto;
    max-height: min(78dvh, 560px);
    overflow: hidden;
    background: #12161f;
    border: 1px solid rgba(148, 197, 255, 0.16);
    border-bottom: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(104%);
    transform-origin: bottom center;
    transition:
      transform .3s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s linear .3s;
  }
  .igen-params-sheet.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition:
      transform .3s cubic-bezier(.22, 1, .36, 1),
      opacity .22s ease,
      visibility 0s;
  }
  .igen-params-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex: none;
    padding: 4px 14px 10px;
  }
  .igen-params-head h2 {
    margin: 0;
    font-size: 14px;
    font-weight: 650;
  }
  .igen-params-sheet #settings {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 0 14px calc(16px + env(safe-area-inset-bottom, 0));
  }
  .composer-meta {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  }
  .composer-meta > #balance {
    display: none;
  }
  .composer-meta .filename-field,
  .composer-meta .group-field {
    display: flex;
    width: 100%;
    min-width: 0;
  }
  .composer-meta .filename-field > span,
  .composer-meta .group-field > span:first-child {
    width: 3em;
  }
  .composer-meta .filename-field input,
  .composer-meta .group-field .field-value {
    width: auto;
    max-width: none;
    flex: 1 1 auto;
  }
  .param-sheet {
    gap: 14px;
  }
  .param-sheet .aspect-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }
  .param-sheet .aspect-item {
    min-height: 56px;
    border-radius: 12px;
    padding: 8px 4px;
  }
  .param-sheet .param-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .param-sheet .param-chips {
    gap: 8px;
  }
  .param-sheet .param-chip {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
  }
  .param-sheet .param-row .param-line:last-child .param-chip {
    flex: 1 1 calc(25% - 8px);
  }
  .igen-canvas { min-height: 0; }
  .igen-canvas[data-n="1"],
  .igen-canvas[data-n="2"],
  .igen-canvas[data-n="3"],
  .igen-canvas[data-n="4"] { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1280px) {
  .imglog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .imglog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* —— image split —— */
.page.split-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.split-layout {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) minmax(240px, 300px);
  grid-template-areas: "panel stage results";
  gap: 0;
  align-items: stretch;
}
.split-layout.is-results-collapsed {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr) 52px;
}
.split-panel { grid-area: panel; }
.split-stage { grid-area: stage; }
.split-results { grid-area: results; }
.split-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px 14px 18px;
  border: none;
  border-right: 1px solid rgba(148, 197, 255, 0.12);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(94, 234, 212, 0.05), transparent 40%),
    #0b111a;
  overflow: auto;
  min-height: 0;
}
.split-brand {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.split-brand strong { font-size: 15px; letter-spacing: 0.02em; }
.split-brand span { color: var(--faint); font-size: 11px; white-space: nowrap; }
.split-drop {
  display: grid;
  gap: 6px;
  place-items: center;
  text-align: center;
  padding: 16px 12px;
  border: 1px dashed rgba(148, 197, 255, 0.28);
  border-radius: 14px;
  background: rgba(7, 11, 18, 0.45);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.split-drop strong { font-size: 14px; }
.split-drop span { color: var(--muted); font-size: 12px; }
.split-drop.is-drag,
.split-drop:hover { border-color: var(--line-strong); background: rgba(94, 234, 212, 0.06); }
.split-modes, .split-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.split-controls { display: grid; gap: 10px; }
.split-field { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.split-field input,
.split-field select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.7);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
}
.split-field input[type="range"] { padding: 0; accent-color: var(--accent); }
.split-inline { display: flex; align-items: end; gap: 8px; }
.split-inline .split-field { flex: 1; }
.split-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.split-note, .split-hint { margin: 0; color: var(--faint); font-size: 12px; line-height: 1.55; }
.split-stage {
  min-height: 0;
  min-width: 0;
  border: none;
  border-radius: 0;
  background:
    radial-gradient(700px 280px at 50% 0%, rgba(56, 189, 248, 0.05), transparent 60%),
    #05080f;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 12px 16px;
}
.split-empty { color: var(--faint); }
.split-canvas-wrap { position: relative; line-height: 0; max-width: 100%; max-height: 100%; }
.split-overlay { position: absolute; inset: 0; pointer-events: none; }
.split-overlay.is-crop { pointer-events: auto; cursor: crosshair; }
.split-overlay.is-grid { pointer-events: auto; }
.split-guide {
  position: absolute;
  z-index: 3;
  background: #b8fff4;
  box-shadow: 0 0 6px rgba(124, 255, 240, 0.75);
  pointer-events: auto;
}
.split-guide.is-v {
  top: 0;
  bottom: 0;
  width: 1px;
  margin-left: -0.5px;
  cursor: ew-resize;
  touch-action: none;
}
.split-guide.is-h {
  left: 0;
  right: 0;
  height: 1px;
  margin-top: -0.5px;
  cursor: ns-resize;
  touch-action: none;
}
.split-guide.is-v::after,
.split-guide.is-h::after {
  content: "";
  position: absolute;
  inset: -10px -6px;
}
.split-guide.is-h::after { inset: -6px -10px; }
.split-frame {
  position: absolute;
  border: 1px solid rgba(184, 255, 244, 0.95);
  box-shadow: none;
  pointer-events: none;
}
.split-frame.is-grid-cell {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.split-frame.is-clickable {
  pointer-events: auto;
  cursor: pointer;
}
.split-frame.is-clickable:hover {
  background: rgba(94, 234, 212, 0.12);
  box-shadow: inset 0 0 0 1px rgba(184, 255, 244, 0.55);
}
.split-piece-menu {
  position: fixed;
  z-index: 80;
  min-width: 140px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(148, 197, 255, 0.22);
  background: #101822;
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  display: grid;
  gap: 6px;
}
.split-piece-menu-title {
  font-size: 12px;
  color: var(--muted);
  padding: 2px 4px 4px;
}
.split-piece-menu button {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.split-piece-menu button:hover {
  border-color: #5eead4;
  color: #5eead4;
}
.split-frame.is-movable {
  pointer-events: auto;
  cursor: grab;
  box-shadow: 0 0 0 9999px rgba(4, 8, 14, 0.01);
}
.split-frame.is-movable:active { cursor: grabbing; }
.split-frame.is-circle { border-radius: 50%; }
.split-frame span {
  position: absolute; left: 4px; top: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  display: inline-grid; place-items: center;
  background: rgba(4, 16, 24, 0.78);
  color: #b8fff4;
  font-size: 10px; font-weight: 700;
  line-height: 1;
  border: 1px solid rgba(184, 255, 244, 0.55);
}
.split-results {
  min-height: 0;
  min-width: 0;
  border: none;
  border-left: 1px solid rgba(148, 197, 255, 0.14);
  padding: 12px 10px 14px;
  background: #0b111a;
  height: 100%;
  max-height: none;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}
.split-results.is-collapsed {
  padding: 10px 6px;
  grid-template-rows: auto;
}
.split-results.is-collapsed .split-grid,
.split-results.is-collapsed .split-results-empty { display: none; }
.split-results.is-collapsed .split-results-head {
  flex-direction: column;
  align-items: center;
  gap: 8px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}
.split-results.is-collapsed .split-results-head h2 { font-size: 13px; }
.split-results.is-collapsed .split-results-head span,
.split-results.is-collapsed .split-results-tools .btn:not(#split-results-toggle) { display: none; }
.split-results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.split-results-head h2 { margin: 0; font-size: 14px; }
.split-results-head span {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 11px;
}
.split-results-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.split-results-empty {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.55;
  padding: 24px 12px;
  border: 1px dashed rgba(148, 197, 255, 0.18);
  border-radius: 14px;
  min-height: 160px;
}
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
  scrollbar-width: thin;
  align-content: start;
}
.split-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.split-card-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  border-radius: 8px;
}
.split-card img,
.split-card-thumb img {
  width: 100%;
  height: 84px;
  aspect-ratio: auto;
  object-fit: contain;
  display: block;
  background:
    linear-gradient(45deg, #121820 25%, transparent 25%),
    linear-gradient(-45deg, #121820 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #121820 75%),
    linear-gradient(-45deg, transparent 75%, #121820 75%);
  background-size: 12px 12px;
  background-position: 0 0, 0 6px, 6px -6px, -6px 0;
  border-radius: 8px;
}
.split-card-thumb:hover img {
  outline: 1px solid rgba(94, 234, 212, 0.55);
}
.split-card-meta {
  display: flex; justify-content: space-between; gap: 4px;
  font-size: 10px; color: var(--muted);
}
.split-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.split-card-actions .btn {
  justify-content: center;
  padding: 6px 4px;
  font-size: 11px;
  white-space: nowrap;
}

.split-lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}
.split-lightbox-veil {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(8px);
}
.split-lightbox-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 0;
  border: 1px solid rgba(148, 197, 255, 0.18);
  border-radius: 18px;
  background: #0b111a;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.split-lightbox-img {
  width: 100%;
  max-height: calc(88vh - 72px);
  object-fit: contain;
  background:
    linear-gradient(45deg, #121820 25%, transparent 25%),
    linear-gradient(-45deg, #121820 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #121820 75%),
    linear-gradient(-45deg, transparent 75%, #121820 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  display: block;
}
.split-lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid rgba(148, 197, 255, 0.12);
  background: #101822;
}
.split-lightbox-bar strong { margin-right: 8px; }
.split-lightbox-bar span { color: var(--muted); font-size: 12px; }
.split-lightbox-actions { display: flex; gap: 8px; }
.split-lightbox-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(148, 197, 255, 0.22);
  background: rgba(7, 11, 18, 0.72);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.split-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 197, 255, 0.22);
  background: rgba(7, 11, 18, 0.72);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.split-lightbox-nav.is-prev { left: 10px; }
.split-lightbox-nav.is-next { right: 10px; }

body.is-split { overflow: hidden; }
body.is-split .site-footer { display: none; }
body.is-split #app {
  height: 100vh;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}
body.is-split .view {
  flex: 1;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
body.is-split .page.split-page { flex: 1; height: 100%; }

@media (max-width: 900px) {
  body.is-split { overflow: auto; }
  body.is-split #app { height: auto; min-height: 100dvh; overflow: visible; }
  body.is-split .view { width: 100%; min-width: 0; }
  .page.split-page {
    height: auto;
    min-height: calc(100dvh - 64px);
    overflow: auto;
    width: 100%;
    max-width: none;
    padding: 0;
  }
  .split-layout,
  .split-layout.is-results-collapsed {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "panel"
      "stage"
      "results";
    height: auto;
    width: 100%;
  }
  .split-panel {
    position: static;
    max-height: none;
    width: 100%;
    box-sizing: border-box;
    border-right: none;
    border-bottom: 1px solid rgba(148, 197, 255, 0.12);
    padding: 16px 14px 18px;
    gap: 14px;
  }
  .split-brand strong { font-size: 18px; }
  .split-brand span { font-size: 13px; }
  .split-drop {
    padding: 18px 14px;
    border-radius: 12px;
  }
  .split-drop strong { font-size: 16px; }
  .split-drop span { font-size: 14px; }
  .split-modes, .split-presets { gap: 10px; }
  .split-panel .chip {
    font-size: 14px;
    padding: 10px 14px;
    min-height: 40px;
  }
  .split-field { font-size: 14px; gap: 8px; }
  .split-field input,
  .split-field select {
    font-size: 16px;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 10px;
  }
  .split-actions { gap: 10px; }
  .split-actions .btn {
    flex: 1 1 calc(50% - 10px);
    min-height: 44px;
    font-size: 15px;
    padding: 12px 14px;
  }
  .split-note, .split-hint { font-size: 14px; line-height: 1.6; }
  .split-stage {
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 10px 10px 14px;
    place-items: center;
    overflow: visible;
  }
  .split-empty {
    font-size: 15px;
    padding: 36px 16px;
    text-align: center;
  }
  .split-canvas-wrap {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
  }
  .split-results {
    border-left: none;
    border-top: 1px solid rgba(148, 197, 255, 0.14);
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 14px 12px 28px;
    box-sizing: border-box;
  }
  .split-results.is-collapsed {
    padding: 12px 14px;
  }
  .split-results.is-collapsed .split-results-head {
    writing-mode: horizontal-tb;
    flex-direction: row;
    align-items: center;
  }
  .split-results-head h2 { font-size: 17px; }
  .split-results-head span { font-size: 13px; }
  .split-results-tools .btn {
    min-height: 40px;
    font-size: 14px;
    padding: 8px 12px;
  }
  .split-results-empty {
    font-size: 15px;
    min-height: 120px;
    padding: 28px 16px;
  }
  .split-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    overflow: visible;
  }
  .split-card {
    gap: 8px;
    padding: 10px;
    border-radius: 12px;
  }
  .split-card img,
  .split-card-thumb img {
    height: auto;
    min-height: 140px;
    max-height: 220px;
    aspect-ratio: 1;
    object-fit: contain;
  }
  .split-card-meta {
    font-size: 13px;
    gap: 6px;
  }
  .split-card-actions { gap: 8px; }
  .split-card-actions .btn {
    min-height: 40px;
    font-size: 14px;
    padding: 10px 8px;
  }
  .split-lightbox { padding: 12px; }
  .split-lightbox-bar strong { font-size: 15px; }
  .split-lightbox-bar span { font-size: 13px; }
  .split-lightbox-actions .btn {
    min-height: 40px;
    font-size: 14px;
  }
}

@media (max-width: 420px) {
  .split-grid { grid-template-columns: 1fr; }
  .split-card img,
  .split-card-thumb img {
    min-height: 180px;
    max-height: 280px;
  }
  .split-actions .btn { flex: 1 1 100%; }
}

.assets-page .page-head { margin-bottom: 16px; }
.assets-drop {
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  padding: 22px 18px;
  text-align: center;
  color: var(--muted);
  background: rgba(255,255,255,.02);
  display: grid;
  gap: 8px;
  justify-items: center;
  margin-bottom: 16px;
  transition: border-color .15s ease, background .15s ease;
}
.assets-drop strong { color: var(--text); font-size: 15px; }
.assets-drop span { font-size: 13px; }
.assets-drop.is-drag {
  border-color: #5eead4;
  background: rgba(94, 234, 212, 0.06);
}
.assets-drop.is-busy { opacity: .95; pointer-events: none; }
.assets-drop.is-uploading {
  border-style: solid;
  border-color: rgba(94, 234, 212, 0.45);
  background: rgba(94, 234, 212, 0.06);
}
.assets-upload-status {
  display: grid;
  gap: 8px;
  justify-items: center;
  width: min(420px, 100%);
}
.assets-upload-status strong { color: var(--text); font-size: 15px; }
.assets-upload-status span {
  font-size: 12px;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.assets-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.assets-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eead4, #7dd3fc);
  transition: width .12s linear;
}
.assets-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.assets-grid .cover video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.cover-audio { letter-spacing: .08em; }
.assets-audio {
  width: 100%;
  margin-top: 8px;
  height: 32px;
}
.assets-card .card-desc {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.assets-cover {
  cursor: zoom-in;
}
.assets-cover.is-video { cursor: pointer; }
.assets-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.assets-play svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,.45));
}
.assets-grid .cover video {
  pointer-events: none;
}

@media (hover: none) {
  .cover-hint {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 760px) {
  .assets-page .page-head h1 { font-size: 24px; }
  .assets-drop { padding: 18px 14px; margin-bottom: 14px; }
  .assets-drop strong { font-size: 16px; }
  .assets-drop span { font-size: 14px; }
  .assets-tabs { gap: 10px; margin-bottom: 14px; }
  .assets-tabs .chip {
    font-size: 14px;
    min-height: 40px;
    padding: 10px 14px;
  }
  .assets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .assets-card .card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .assets-card .card-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 40px;
    font-size: 14px;
  }
  .assets-play svg { width: 48px; height: 48px; }
  .imglog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .imglog-batch {
    flex-wrap: wrap;
    gap: 8px;
  }
  .imglog-batch button {
    min-height: 36px;
    font-size: 13px;
    padding: 0 12px;
  }
  .imglog-actions {
    flex-wrap: wrap;
    gap: 6px;
  }
  .imglog-icon {
    width: 36px;
    height: 36px;
  }
  .lightbox {
    padding: 12px 10px 18px;
    align-items: end;
  }
  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-caption {
    width: 100%;
    border-radius: 12px;
    padding: 10px 12px;
  }
  .lightbox-caption strong {
    white-space: normal;
    max-width: none;
    font-size: 14px;
  }
  .lightbox-hint { font-size: 12px; }
  .lightbox-frame {
    border-radius: 14px;
    padding: 8px;
  }
  .lightbox-frame img,
  .lightbox-frame video,
  .lightbox-frame .lightbox-media {
    max-width: calc(100vw - 36px);
    max-height: min(68vh, 640px);
    border-radius: 10px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .card-actions .btn { min-height: 40px; font-size: 14px; }
}

@media (max-width: 480px) {
  .assets-grid,
  .imglog-grid,
  .grid { grid-template-columns: 1fr; }
  .igen-canvas[data-n="1"],
  .igen-canvas[data-n="2"],
  .igen-canvas[data-n="3"],
  .igen-canvas[data-n="4"] { grid-template-columns: 1fr; }
  .composer-tools {
    gap: 8px;
  }
  .composer-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }
  .composer-meta .filename-field,
  .composer-meta .group-field {
    width: 100%;
    max-width: none;
  }
  .composer-meta .filename-field input,
  .composer-meta .group-field .field-value {
    width: auto;
    max-width: none;
  }
}

/* Video studio — unified reference media strip */
.composer-media-refs .ref-media {
  position: relative;
}
.composer-media-refs .ref-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-style: normal;
  line-height: 1.4;
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  pointer-events: none;
}
.composer-media-refs .ref-video .ref-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}
.composer-media-refs .ref-audio-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.06);
}
.igen-canvas-video {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-height: 0;
}
.igen-canvas-video .igen-shot-video {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}
.igen-canvas-video .igen-shot-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(56vh, 520px);
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(148, 197, 255, 0.16);
  background: #000;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.igen-canvas-video .igen-shot-actions {
  position: static;
  inset: auto;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  opacity: 1;
  pointer-events: auto;
}
.igen-canvas-video .igen-shot-actions .btn {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(16, 24, 36, 0.92);
  border-color: rgba(148, 197, 255, 0.22);
  color: #e8f1ff;
}
.log-cover.is-video {
  background: #000;
}
.log-cover.is-video video,
.imglog-card .cover.is-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.imglog-card .cover.is-video {
  background: #000;
}
.igen-field-hint {
  margin: 0;
  padding: 0 2px 8px;
}

