/* CreateAI: latar netral, satu warna aksen. Warna kategori hanya di kotak beranda dan ikon menu. */
@font-face {
  font-family: "Lora";
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/lora-italic.ttf") format("truetype");
}

/* ---------- Warna: mode siang ---------- */
:root {
  --ink: #15131f;
  /* Permukaan (kotak isian, kartu, menu): ikut berganti di mode malam */
  --surface: #ffffff;
  --surface-2: #eef0f5;
  --line: rgba(21, 19, 31, .22);
  --muted: #5d6273;
  --danger: #a3200c;
  --marigold: #f4b41a;
  --c-wall: #e6e9f0;   --c-wall-fg: #15131f;
  --c-foto: #2a41e0;
  --c-video: #cf3a22;
  --c-upscale: #0b7a5a;
  --c-riwayat: #5a2a82;
  --c-gold: #f4b41a;   --c-gold-fg: #15131f;
  --good: #0b7a5a;
  --r: 10px;
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
/* ---------- Warna: mode malam ---------- */
:root[data-theme="malam"] {
  --c-wall: #14131b;   --c-wall-fg: #eceaf4;
  --c-foto: #141c66;
  --c-video: #6b1c10;
  --c-upscale: #073f2f;
  --c-riwayat: #2c1543;
  --c-gold: #4a3705;   --c-gold-fg: #fff1cc;
  --surface: #1f1d2a;
  --surface-2: #2b2938;
  --line: rgba(236, 234, 244, .2);
  --muted: #a7a4b6;
  --danger: #ff8c7a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  --bg: var(--c-wall);
  --fg: var(--c-wall-fg);
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--body);
}
body.menu-open { overflow: hidden; }
/* Sebelum server menjawab, isi halaman disembunyikan. Tamu hanya melihat logo dan halaman masuk. */
body.booting main, body.booting .foot { visibility: hidden; }
body.guest .bar > .menu, body.guest .switch, body.guest .pill, body.guest .foot a, body.guest #drawer, body.guest #shade { display: none !important; }

button, textarea, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

.sprite { position: absolute; }
.logo { flex: none; width: 18px; height: 18px; fill: currentColor; }
.ico { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Bilah atas ---------- */
.bar { display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 16px; max-width: 1152px; margin: 0 auto; }
.bar .mark { margin-right: auto; }
.mark { display: inline-flex; align-items: center; gap: 8px; font: italic 700 20px/1 var(--display); letter-spacing: -.01em; text-decoration: none; }
.menu {
  display: grid; place-items: center; width: 40px; height: 40px; margin-left: -9px;
  background: none; border: 0; border-radius: 8px; color: var(--fg);
}
.menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 6px;
  border: 1.5px solid var(--fg); border-radius: 999px; font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.pill .ico { width: 16px; height: 16px; }
.switch { display: none; align-items: center; gap: 20px; margin-left: 24px; }
.switch a {
  padding: 4px 0 3px; border-bottom: 2px solid transparent;
  font-size: 14.5px; font-weight: 600; text-decoration: none; white-space: nowrap; opacity: .8;
}
.switch a.active { border-bottom-color: currentColor; opacity: 1; }
.themeBtn { display: grid; place-items: center; width: 34px; height: 34px; background: none; border: 0; border-radius: 8px; color: var(--fg); }

/* ---------- Menu samping ---------- */
.shade {
  position: fixed; inset: 0; z-index: 20; background: rgba(10, 9, 20, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 21;
  width: min(80vw, 290px); padding: 8px 16px 20px; overflow-y: auto;
  background: var(--surface); color: var(--fg); box-shadow: 0 0 24px rgba(0, 0, 0, .2);
  transform: translateX(-100%); visibility: hidden;
  transition: transform .22s ease, visibility 0s .22s;
}
body.menu-open .shade { opacity: 1; pointer-events: auto; }
body.menu-open .drawer { transform: none; visibility: visible; transition: transform .22s ease; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 6px; }
.drawer-top .menu { margin: 0 -9px 0 0; }
.item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 7px 0;
  border: 0; background: none; color: inherit;
  font-size: 15.5px; font-weight: 600; text-decoration: none; text-align: left;
}
.item small { margin-left: auto; font-size: 12px; font-weight: 400; opacity: .65; }
.item.active { background: var(--surface-2); border-radius: var(--r); margin: 0 -6px; padding-left: 6px; padding-right: 6px; width: calc(100% + 12px); }
.group2 { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.sw { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; }
.sw .ico { width: 17px; height: 17px; }
.sw-beranda { background: #e6e9f0; color: #15131f; }
.sw-foto { background: #2a41e0; }
.sw-video { background: #cf3a22; }
.sw-upscale { background: #0b7a5a; }
.sw-riwayat { background: #5a2a82; }
.sw-tips { background: var(--marigold); color: #15131f; }
.sw-line { border: 1.5px solid var(--line); color: var(--fg); }

main { max-width: 1152px; margin: 0 auto; padding: 0 16px 28px; }

h1 { font: italic 600 28px/1.1 var(--display); letter-spacing: -.01em; margin: 8px 0 14px; }
h2 { font: italic 600 19px/1.2 var(--display); margin: 0; }
h2.gap { margin-top: 26px; }
.say { font-size: 15px; line-height: 1.45; max-width: 40ch; margin: 0 0 16px; }
.say .sub { font-size: 13px; opacity: .8; }
.say a { margin-left: 8px; font-size: 14px; }

/* ---------- Halaman masuk ---------- */
.auth-art { display: grid; grid-template-columns: repeat(4, 1fr); height: 5px; margin: 0 -16px; }
.auth-art span:nth-child(1) { background: var(--c-foto); }
.auth-art span:nth-child(2) { background: var(--c-video); }
.auth-art span:nth-child(3) { background: var(--c-upscale); }
.auth-art span:nth-child(4) { background: var(--c-gold); }
.auth-art p { display: none; }
.auth-main { max-width: 400px; }
.auth-main .banner { margin-top: 16px; }
.auth-main h1 { margin: 22px 0 4px; }
.auth-main .say { margin-bottom: 18px; opacity: .85; }
.note-box { margin: -6px 0 16px; padding: 8px 12px; border-left: 3px solid var(--c-gold); border-radius: 4px; background: var(--surface); color: var(--fg); font-size: 13.5px; }

/* ---------- Beranda ---------- */
.banner { margin: 4px 0 14px; padding: 12px 14px; border-radius: var(--r); background: var(--fg); color: var(--bg); }
.banner h2 { font-size: 17px; }
.banner p { margin: 2px 0 0; font-size: 13.5px; white-space: pre-line; }
.banner h2:empty, .banner p:empty { display: none; }
.rolls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.roll {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 116px; padding: 12px 14px; border-radius: var(--r); color: #fff; text-decoration: none;
}
.roll-foto { background: var(--c-foto); }
.roll-video { background: var(--c-video); }
.roll-upscale { background: var(--c-upscale); }
.roll-tips { background: var(--c-gold); color: var(--c-gold-fg); }
.roll-name { font: italic 600 22px/1.1 var(--display); }
.roll-say { margin-top: 2px; font-size: 12.5px; opacity: .9; }
.roll-ico { position: absolute; top: 12px; right: 12px; width: 24px; height: 24px; }
.roll.closed { opacity: .82; }
.roll:focus-visible { outline-offset: 2px; }

/* ---------- Form ---------- */
.lbl { display: block; font-weight: 600; font-size: 13px; margin: 0 0 6px; }
textarea {
  display: block; width: 100%; min-height: 92px; resize: vertical; padding: 11px 12px;
  font-size: 16px; line-height: 1.4; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
textarea::placeholder, .field::placeholder { color: var(--muted); }
.under { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; margin: 6px 0 14px; }

.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 64px; padding: 8px 8px 7px; background: none; border: 1.5px solid var(--fg); border-radius: var(--r);
  color: var(--fg); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.chip .ico { width: 18px; height: 18px; }
/* Halaman Foto: tab jenis, pilihan Model (keluarga), tombol Versi, keterangan */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 0 0 16px; padding: 4px; border-radius: calc(var(--r) + 4px); background: var(--surface); }
.mode {
  display: flex; align-items: center; justify-content: center; gap: 7px; padding: 10px 6px;
  border: 0; border-radius: var(--r); background: none; color: var(--fg); font: 600 13.5px var(--body); opacity: .7;
}
.mode .ico { width: 17px; height: 17px; }
.mode.active { background: var(--fg); color: var(--bg); opacity: 1; }
.mode:disabled { opacity: .35; cursor: not-allowed; }
.selectwrap { position: relative; margin-bottom: 14px; }
.selectwrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--fg); border-bottom: 2px solid var(--fg); transform: rotate(45deg); pointer-events: none;
}
.field.select { appearance: none; -webkit-appearance: none; margin: 0; padding-right: 40px; font-weight: 600; background: var(--surface); }
.vers { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 8px; }
.ver {
  padding: 10px 6px; border: 1.5px solid var(--line); border-radius: var(--r); background: var(--surface);
  color: var(--fg); font: 600 13.5px var(--body); text-align: center;
}
.ver.active { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.minfo { margin: 0 0 16px; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.minfo em { display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--fg); font-style: normal; font-size: 10.5px; font-weight: 700; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; margin-bottom: 18px; }
.rgrid .chip { min-width: 0; width: 100%; }
.chip.active { background: var(--fg); color: var(--bg); }
.chip:focus-visible, .ratio:focus-visible { outline-offset: -4px; outline-color: currentColor; }

.ratios { display: flex; border: 1.5px solid var(--fg); border-radius: var(--r); overflow: hidden; margin-bottom: 16px; }
.ratio {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 4px; background: none; border: 0; color: var(--fg); font-weight: 600; font-size: 13.5px;
}
.ratio + .ratio { border-left: 1.5px solid var(--fg); }
.ratio.active { background: var(--fg); color: var(--bg); }
.r { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
.r11 { width: 12px; height: 12px; }
.r916 { width: 9px; height: 14px; }
.r169 { width: 16px; height: 9px; }

.go {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 22px; border: 0; border-radius: 999px;
  background: var(--marigold); color: var(--ink); font-weight: 700; font-size: 15.5px;
  text-align: center; text-decoration: none;
}
.go .ico { width: 18px; height: 18px; }
.go.alt { background: var(--fg); color: var(--bg); }
.go:disabled { opacity: .6; cursor: wait; }
.go.inline { display: inline-flex; width: auto; }
.error { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--surface); color: var(--danger); font-weight: 600; font-size: 13.5px; }
.error.good { color: var(--good); }
.quota { margin: 8px 0 0; font-size: 12.5px; text-align: center; opacity: .85; }
.link { background: none; border: 0; padding: 2px 0; color: var(--fg); font-size: 13.5px; text-decoration: underline; }
.swap { margin: 16px 0 0; font-size: 14px; }
.swap .link { font-size: inherit; font-weight: 700; }

.stack { max-width: 400px; }
.stack h2 { margin: 6px 0 12px; }
.field {
  display: block; width: 100%; margin-bottom: 12px; padding: 10px 12px;
  font-size: 16px; color: var(--fg);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.hintline { margin: -4px 0 12px; font-size: 12.5px; opacity: .85; }
.swap + .hintline, #closedNote + .hintline { margin: 6px 0 0; }

/* ---------- Foto referensi dan rasio ---------- */
.opt { font-weight: 400; opacity: .7; }
.refs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ref { position: relative; width: 68px; height: 68px; border-radius: var(--r); overflow: hidden; background: var(--surface-2); }
.ref img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ref-x {
  position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 15px; line-height: 22px;
}
.ref-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  border: 1.5px dashed var(--line); background: var(--surface); color: var(--fg); font-size: 12px; font-weight: 600;
}
.ref-add b { font-size: 22px; line-height: 1; font-weight: 500; }
.chip.rt { min-width: 52px; padding: 7px 8px 6px; gap: 5px; }
.chip.rt .r { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
#resList { max-width: 320px; }

/* ---------- Riwayat: kartu Proses / Selesai / Gagal ---------- */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.gitem { display: block; padding: 4px; border: 0; border-radius: 6px; background: var(--surface); color: var(--fg); text-align: left; min-width: 0; font: inherit; }
.gthumb { position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden; background: var(--surface-2); }
.gthumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gwait { position: absolute; inset: 0; }
.is-proses .gwait {
  background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--fg) 9%, transparent) 50%, transparent 70%) var(--surface-2);
  background-size: 220% 100%; animation: sweep 1.4s linear infinite;
}
@keyframes sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.is-gagal .gwait { background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--fg) 6%, transparent) 8px 9px); }
.gst {
  position: absolute; left: 6px; top: 6px; padding: 1px 8px; border-radius: 999px;
  background: var(--surface); color: var(--fg); font-size: 11px; font-weight: 700;
}
.is-proses .gst { background: var(--fg); color: var(--bg); }
.is-gagal .gst { background: var(--danger); color: #fff; }
.is-selesai .gst { opacity: .92; }
.gitem span {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 5px 2px 0; font: italic 500 12.5px/1.3 var(--display);
}
.gitem small { display: block; margin: 1px 2px 2px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-gagal small { color: var(--danger); }

/* Foto referensi yang masih diunggah */
.ref.sending img { opacity: .45; }
.ref-up { position: absolute; inset: auto 0 4px; text-align: center; font-size: 10.5px; font-weight: 700; color: var(--fg); }

/* Penampil hasil */
.viewer {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 10px; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--fg); overflow: auto;
}
.viewer::backdrop { background: rgba(6, 6, 14, .72); }
.v-frame { display: grid; place-items: center; min-height: 160px; border-radius: 6px; overflow: hidden; background: var(--surface-2); }
.v-frame img { display: block; width: 100%; height: auto; max-height: 72dvh; object-fit: contain; }
.v-fail { margin: 0; padding: 24px 16px; text-align: center; color: var(--danger); font-weight: 600; font-size: 13.5px; }
.v-pbox { margin: 8px 2px 0; }
.v-pbox summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--muted); }
.v-pbox[open] summary { margin-bottom: 4px; }
.v-prompt { margin: 0 0 2px; font: italic 500 14.5px/1.4 var(--display); overflow-wrap: anywhere; }
.v-meta { margin: 0 2px 10px; font-size: 12px; color: var(--muted); }
.v-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.v-btn {
  padding: 7px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: none; color: var(--fg);
  font: 600 13px var(--body); text-decoration: none;
}
.v-btn.primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.v-btn.danger { color: var(--danger); }
.viewer { position: fixed; }
.v-close {
  position: absolute; top: 16px; right: 16px; z-index: 1; width: 34px; height: 34px; border: 0; border-radius: 999px;
  background: rgba(10, 10, 20, .6); color: #fff; font-size: 22px; line-height: 1;
}

/* ---------- Tips prompt ---------- */
.anatomy { font: italic 500 19px/1.6 var(--display); margin: 0 0 14px; max-width: 30em; }
.part { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.parts { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; margin: 0 0 24px; max-width: 520px; font-size: 13.5px; }
.parts dt { font-weight: 700; }
.parts dd { margin: 0; }
.examples { margin-top: 8px; }
.ex { padding: 10px 0 12px; border-top: 1px solid var(--fg); }
.ex b { font-size: 13px; }
.ex p { margin: 2px 0 8px; font-size: 14px; max-width: 60ch; }
.ex button { padding: 6px 14px; border: 0; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 12.5px; }

/* Kode gaya */
.codes-hint { margin: 2px 0 10px; }
.codes { display: grid; gap: 8px; margin: 0 0 24px; }
.codes-h { grid-column: 1 / -1; margin: 8px 0 0; font-size: 14px; font-weight: 700; }
.codes-h:first-child { margin-top: 0; }
.code button.done { background: var(--good); color: #fff; }
section[data-view="belajar"] { padding-bottom: 72px; }
.codebar {
  position: fixed; left: 50%; bottom: 14px; z-index: 5; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px);
  padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--fg); color: var(--bg); font-size: 13px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
}
.codebar a { padding: 6px 14px; border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 700; text-decoration: none; white-space: nowrap; }
.code { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 9px 12px; border-radius: var(--r); background: var(--surface); }
.code b { font-size: 13.5px; }
.code code { grid-column: 1; font: 12.5px/1.4 var(--body); color: var(--muted); overflow-wrap: anywhere; }
.code button { grid-column: 2; grid-row: 1 / span 2; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--fg); color: var(--bg); font-weight: 700; font-size: 12.5px; }

/* ---------- Kaki halaman (hanya layar lebar) ---------- */
.foot { display: none; }

/* ---------- Tablet ---------- */
@media (min-width: 600px) {
  .bar, main, .foot { padding-left: 24px; padding-right: 24px; }
  .auth-art { margin: 0 -24px; }
  .rolls { grid-template-columns: repeat(4, 1fr); }
  .roll { min-height: 140px; }
  .chips { margin: 0 0 14px; padding: 0 0 2px; flex-wrap: wrap; }
  .go { width: auto; min-width: 200px; }
  .quota { text-align: left; }
  .examples { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; }
  .codes { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* ---------- PC / laptop: menu tampil langsung di atas, tanpa tombol garis tiga ---------- */
@media (min-width: 960px) {
  .bar { height: 64px; }
  .bar > .menu { display: none; }
  .switch { display: flex; }
  h1 { font-size: 32px; margin: 12px 0 16px; }
  .roll { min-height: 170px; padding: 16px 18px; }
  .roll-name { font-size: 26px; }
  .roll-ico { width: 28px; height: 28px; top: 16px; right: 16px; }
  .foot {
    display: flex; align-items: center; gap: 8px 18px;
    max-width: 1152px; margin: 0 auto; padding: 18px 24px 24px; font-size: 13px; opacity: .85;
  }
  .foot span { margin-right: auto; font-weight: 600; }

  #form { max-width: 600px; }
  .examples { grid-template-columns: 1fr 1fr 1fr; }
  .codes { grid-template-columns: 1fr 1fr 1fr; }
  .gallery { grid-template-columns: repeat(5, 1fr); }

  /* Halaman masuk di layar lebar: blok warna di kiri, formulir di kanan */
  .auth { display: grid; grid-template-columns: 1fr minmax(0, 380px); column-gap: 64px; align-items: center; margin-top: 12px; }
  .auth-art { position: relative; height: 440px; margin: 0; border-radius: 14px; overflow: hidden; grid-template-columns: 1fr; grid-template-rows: 3fr 1fr 1fr 1fr; }
  .auth-art p { display: block; position: absolute; left: 28px; top: 24px; right: 28px; margin: 0; color: #fff; font: italic 600 40px/1.08 var(--display); }
  .auth-main h1 { font-size: 32px; margin-top: 0; }
  .auth-main .banner { margin: 0 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  body, .shade, .drawer, body.menu-open .drawer { transition: none; }
  .is-proses .gwait { animation: none; }
}

/* =====================================================================
   Penyempurnaan tampilan (elegan, HP lebih dulu)
   - Garis tipis menggantikan garis tebal; satu aksen kuning hanya untuk Generate.
   - Formulir dikelompokkan dalam panel; tombol Generate menempel di bawah layar HP.
   ===================================================================== */
:root { --r: 12px; --line: rgba(21, 19, 31, .13); --line-strong: rgba(21, 19, 31, .28); --shadow: 0 1px 2px rgba(21, 19, 31, .05), 0 8px 24px rgba(21, 19, 31, .06); }
:root[data-theme="malam"] { --line: rgba(236, 234, 244, .12); --line-strong: rgba(236, 234, 244, .3); --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25); }

/* Bilah atas menempel di atas saat digulir */
.bar {
  position: sticky; top: 0; z-index: 15;
  background: var(--bg);
  box-shadow: 0 0 0 100vmax var(--bg), 0 1px 0 100vmax var(--line);
  clip-path: inset(0 -100vmax -1px);
}
.pill { border-width: 1px; border-color: var(--line-strong); }

/* Judul halaman */
h1 { letter-spacing: -.015em; }

/* Panel formulir */
.panel {
  margin: 0 0 12px; padding: 14px 14px 4px; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow);
}
.panel .lbl { font-size: 12.5px; letter-spacing: .01em; color: var(--muted); }
.panel textarea, .panel .field.select { background: var(--surface-2); border-color: transparent; }
.panel textarea:focus, .panel .field.select:focus { border-color: var(--line-strong); outline: none; background: var(--surface); }
.prompt-panel textarea { min-height: 110px; }
.prompt-panel .under { margin: 8px 0 10px; color: var(--muted); }
.prompt-panel .under a { color: var(--fg); font-weight: 600; }

/* Tab jenis */
.modes { border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 16px; padding: 5px; margin-bottom: 12px; }
.mode { border-radius: 11px; }

/* Pilihan: garis tipis, terpilih = tinta penuh */
.ver, .chip, .rgrid .chip { border: 1px solid var(--line); background: var(--surface-2); }
.ver.active, .chip.active { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.ratios { border: 1px solid var(--line); background: var(--surface-2); padding: 3px; gap: 3px; border-radius: var(--r); }
.ratio { border-radius: 9px; }
.ratio + .ratio { border-left: 0; }
.ratio.active { box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.rgrid { margin-bottom: 12px; }
#resList { max-width: none; }
.ref-add { border: 1px dashed var(--line-strong); background: var(--surface-2); }
.minfo { margin-bottom: 10px; }

/* Tombol Generate */
.go { box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 18px rgba(244, 180, 26, .35); letter-spacing: .01em; }
:root[data-theme="malam"] .go { box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 6px 20px rgba(244, 180, 26, .2); }
.go:active { transform: translateY(1px); }

/* HP: Generate menempel di bawah layar, selalu terjangkau ibu jari */
.actionbar {
  position: sticky; bottom: 0; z-index: 5; margin: 8px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--line);
}
.actionbar .quota { margin-top: 6px; }
@media (min-width: 960px) {
  .actionbar { position: static; margin: 4px 0 0; padding: 0; background: none; border: 0; }
  .actionbar .go { width: auto; min-width: 220px; }
  .actionbar .quota { text-align: left; }
}

/* Riwayat dan kartu lain ikut garis tipis */
.gitem { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.gthumb { border-radius: 10px; }
.viewer { border: 1px solid var(--line); border-radius: 18px; }
.code { border: 1px solid var(--line); }
.ex { border-top-color: var(--line-strong); }

/* Beranda: kotak netral, warna hanya di ikon (sama seperti menu samping) */
.roll { background: var(--surface) !important; color: var(--fg) !important; border: 1px solid var(--line); box-shadow: var(--shadow); }
.roll-say { color: var(--muted); opacity: 1; }
.roll-ico { box-sizing: content-box; padding: 7px; border-radius: 10px; color: #fff; }
.roll-foto .roll-ico { background: #2a41e0; }
.roll-video .roll-ico { background: #cf3a22; }
.roll-upscale .roll-ico { background: #0b7a5a; }
.roll-tips .roll-ico { background: var(--marigold); color: #15131f; }
.roll.closed { opacity: 1; }
.roll.closed .roll-ico { filter: saturate(.35); opacity: .75; }
.keepnote { margin: -6px 0 12px; color: var(--muted); }
