/**
 * artGenerate.css
 * Lembar "Teks & ikon → art" (A8, ArtGenerateSheet.js).
 * HP: pratinjau menempel di atas, formulir bergulir, tombol di bawah.
 * ≥ 900 px: jendela tengah dua kolom — pratinjau kiri, formulir kanan.
 */

.ae-gen-sheet [hidden] { display: none !important; }
/* vh di HP = layar TERBESAR (tanpa bilah URL/tab) → lembar setinggi 92vh
   melewati layar yang terlihat dan kepalanya terdorong keluar. dvh = tinggi
   yang benar-benar terlihat; vh tetap sebagai cadangan peramban lama. */
.ae-gen-sheet { max-height: min(92vh, 820px); max-height: min(calc(100dvh - 16px), 820px); }
.ae-gen-sheet .bottom-sheet__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.ae-gen__layout {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ── Pratinjau ─────────────────────────────────────────────────────── */
.ae-gen__preview {
  position: sticky;
  top: 0;
  z-index: 1;
  flex-shrink: 0;
  padding: 4px 16px 10px;
  background: var(--wb-panel-raised);
  border-bottom: 1px solid var(--wb-rule);
}
.ae-gen__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.07) 0 25%, rgba(0, 0, 0, 0.14) 0 50%) 0 0 / 16px 16px,
    var(--bg-inset);
}
.ae-gen__canvas { display: block; flex-shrink: 0; image-rendering: pixelated; image-rendering: crisp-edges; }
.ae-gen__info {
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px;
  text-align: center;
}
.ae-gen__notices { margin-top: 8px; }

/* ── Formulir ──────────────────────────────────────────────────────── */
.ae-gen__form { display: flex; flex-direction: column; gap: 14px; padding: 12px 16px 18px; }
.ae-gen__tabs { width: 100%; }
.ae-gen__tabs .kit-seg__btn { flex: 1; justify-content: center; }
.ae-gen__form-body,
.ae-gen__group,
.ae-gen__finish { display: flex; flex-direction: column; gap: 12px; }
.ae-gen__text { min-height: 72px; font-family: var(--font-mono); resize: vertical; }
.ae-gen__note { margin: 0; font-size: 12px; }
.ae-gen__sharp { margin-top: -6px; }
.ae-gen__picked { margin: 0; color: var(--text-primary); font-weight: 600; }
.ae-gen__group-title {
  margin: 4px 0 -4px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ae-gen__color { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ae-gen__swatch {
  width: 44px;
  height: 32px;
  padding: 2px;
  flex-shrink: 0;
  border: 1px solid var(--wb-rule);
  border-radius: 8px;
  background: var(--bg-inset);
  cursor: pointer;
}
.ae-gen__optcolor { display: flex; flex-direction: column; gap: 8px; }

.ae-gen__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
  gap: 6px;
}
.ae-gen__grid--items { max-height: 232px; overflow-y: auto; padding: 2px; }
.ae-gen__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0;
  border: 1px solid var(--wb-rule);
  border-radius: 8px;
  background: var(--bg-inset);
  color: var(--text-primary);
  cursor: pointer;
}
.ae-gen__cell:hover { background: var(--bg-active); }
.ae-gen__cell:focus-visible { outline: 2px solid var(--focus-outline); outline-offset: 1px; }
.ae-gen__cell.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--bg-active); }
.ae-gen__cell .item-icon img { image-rendering: pixelated; }

.ae-gen__actions {
  display: flex;
  flex-shrink: 0;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--wb-rule);
}

/* ── Layar lebar: jendela tengah dua kolom ─────────────────────────── */
@media (min-width: 900px) {
  .ae-gen-sheet {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(980px, calc(100vw - 48px));
    height: min(760px, calc(100vh - 48px));
    max-height: none;
    border-bottom: 1px solid var(--wb-rule);
    border-radius: 18px;
    transform: translate(-50%, 110%);
  }
  .ae-gen-sheet.is-open { transform: translate(-50%, 0); }
  .ae-gen__layout { flex-direction: row; overflow: hidden; }
  .ae-gen__preview {
    position: static;
    display: flex;
    flex-direction: column;
    width: 44%;
    padding: 4px 16px 16px;
    border-right: 1px solid var(--wb-rule);
    border-bottom: 0;
    overflow-y: auto;
  }
  .ae-gen__stage { flex: 1; height: auto; min-height: 240px; }
  .ae-gen__form { flex: 1; min-width: 0; overflow-y: auto; }
}
