:root {
  color-scheme: dark;
  --bg: #020204;
  --panel: rgba(255, 255, 255, 0.064);
  --panel-strong: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.13);
  --text: #f7f7f4;
  --muted: rgba(247, 247, 244, 0.64);
  --faint: rgba(247, 247, 244, 0.4);
  --savills: #ffd765;
  --blue: #2f6fff;
  --violet: #2a2350;
  --pink: #ff7a2f;
  --amber: #ffd765;
  --orange: #ff8b2d;
  --danger: #ff8a8a;
  --ok: #98f5bb;
  --accent-grad: linear-gradient(135deg, #fff0a4 0%, #ffc04d 38%, #ff7a2f 76%, #f0522b 100%);
  --shadow: 0 28px 84px rgba(0, 0, 0, 0.48);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 210, 98, 0.08), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(255, 119, 42, 0.07), transparent 26rem),
    linear-gradient(180deg, #060606 0%, var(--bg) 58%, #000 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
textarea,
select,
input {
  font: inherit;
}

button {
  color: inherit;
  user-select: none;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 86px 86px;
  mask-image: radial-gradient(circle at center, black, transparent 72%);
  opacity: 0.32;
}

.welcome {
  position: relative;
  min-height: 100svh;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  --mx: 50%;
  --my: 50%;
}

.welcome,
.welcome * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='9' height='9' viewBox='0 0 9 9'%3E%3Ccircle cx='4.5' cy='4.5' r='2.4' fill='black'/%3E%3C/svg%3E") 4 4, auto;
}

.welcome::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(16px) saturate(1.05) brightness(0.82);
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.08), transparent 18rem),
    rgba(0, 0, 0, 0.24);
  opacity: 0.46;
  transition: opacity 180ms ease;
}

.welcome:hover::before {
  opacity: 0.62;
}

.welcome::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, 0.26), transparent 0 17rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.62)),
    radial-gradient(circle at center, transparent 0 34%, rgba(0, 0, 0, 0.58) 100%);
}

.welcome-mosaic {
  position: absolute;
  inset: -10vh -6vw -18vh;
  display: grid;
  grid-template-columns: repeat(8, minmax(132px, 1fr));
  grid-auto-rows: minmax(124px, 15vh);
  gap: clamp(10px, 1.3vw, 18px);
  transform: rotate(-1.3deg) scale(1.04);
  z-index: 1;
}

.mosaic-tile {
  min-height: 120px;
  border-radius: clamp(16px, 2vw, 30px);
  background:
    var(--tile-bg),
    linear-gradient(135deg, #181818, #070707);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 20px 60px rgba(0, 0, 0, 0.35);
  filter: saturate(0.78) brightness(0.74) contrast(1.05);
  overflow: hidden;
  transform: translateZ(0);
  transition: filter 260ms ease, transform 260ms ease;
}

.mosaic-tile:nth-child(3n) {
  transform: translateY(24px);
}

.mosaic-tile:nth-child(4n) {
  filter: saturate(0.78) brightness(0.68) contrast(1.1);
}

.mosaic-tile:nth-child(5n) {
  transform: translateY(-18px);
}

.mosaic-tile.wide {
  grid-column: span 2;
}

.mosaic-tile.tall {
  grid-row: span 2;
}

.tile-office { --tile-bg: linear-gradient(160deg, rgba(0,0,0,.1), rgba(0,0,0,.58)), repeating-linear-gradient(90deg, transparent 0 42px, rgba(255,255,255,.1) 42px 45px), linear-gradient(135deg, #2b2f2b, #9a8e72 42%, #111); }
.tile-facade { --tile-bg: linear-gradient(180deg, rgba(0,0,0,.12), rgba(0,0,0,.62)), repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 7px, transparent 7px 44px), linear-gradient(135deg, #0d1115, #37404a); }
.tile-atrium { --tile-bg: radial-gradient(circle at 50% 22%, rgba(255,225,148,.5), transparent 18%), linear-gradient(135deg, #151515 0 34%, #3b3933 34% 38%, #090909 38% 100%); }
.tile-lounge { --tile-bg: radial-gradient(circle at 64% 30%, rgba(255,211,120,.32), transparent 24%), linear-gradient(150deg, #141414, #393229 56%, #090909); }
.tile-grid { --tile-bg: linear-gradient(180deg, rgba(0,0,0,.04), rgba(0,0,0,.6)), repeating-linear-gradient(0deg, rgba(255,255,255,.12) 0 2px, transparent 2px 52px), repeating-linear-gradient(90deg, rgba(255,255,255,.09) 0 2px, transparent 2px 70px), #1c211f; }
.tile-stair { --tile-bg: linear-gradient(140deg, transparent 0 35%, rgba(255,255,255,.18) 36% 39%, transparent 40%), repeating-linear-gradient(160deg, #1b1b1b 0 28px, #2b2721 28px 34px); }
.tile-desk { --tile-bg: radial-gradient(circle at 62% 42%, rgba(255,202,86,.34), transparent 20%), linear-gradient(180deg, #252525 0 48%, #7d6642 49% 55%, #0a0a0a 56%); }
.tile-gallery { --tile-bg: linear-gradient(90deg, rgba(255,255,255,.12) 0 1px, transparent 1px 20%), linear-gradient(160deg, #262626, #111 64%, #060606); }
.tile-light { --tile-bg: radial-gradient(circle at 48% 18%, rgba(255,237,180,.76), transparent 12%), linear-gradient(160deg, #28251e, #111 58%, #000); }
.tile-tower { --tile-bg: repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 8px, transparent 8px 36px), linear-gradient(150deg, #111820, #3e3f39 44%, #050505); }
.tile-campus { --tile-bg: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.62)), linear-gradient(150deg, #1e2a25 0 38%, #736342 39% 55%, #0a0a0a 56%); }
.tile-object { --tile-bg: radial-gradient(ellipse at 52% 60%, #b48a50 0 17%, transparent 18%), radial-gradient(ellipse at 52% 78%, rgba(0,0,0,.65) 0 24%, transparent 25%), linear-gradient(135deg, #262626, #0a0a0a); }
.tile-material { --tile-bg: repeating-linear-gradient(135deg, #c2b59a 0 12px, #84745d 12px 15px, #161616 15px 44px); }
.tile-boardroom { --tile-bg: linear-gradient(180deg, #161616 0 42%, #624a2d 43% 51%, #090909 52%), radial-gradient(circle at 50% 12%, rgba(255,224,150,.4), transparent 20%); }
.tile-podium { --tile-bg: radial-gradient(ellipse at 50% 58%, #8f7a55 0 22%, transparent 23%), linear-gradient(160deg, #1b1b1b, #090909); }
.tile-ceiling { --tile-bg: repeating-linear-gradient(90deg, #242424 0 38px, #555047 38px 40px), radial-gradient(circle at 30% 30%, rgba(255,220,132,.42), transparent 18%); }
.tile-courtyard { --tile-bg: linear-gradient(150deg, #26312b 0 34%, #89704b 35% 46%, #121212 47%); }
.tile-stone { --tile-bg: linear-gradient(135deg, rgba(255,255,255,.08), transparent), repeating-linear-gradient(35deg, #716b61 0 12px, #2a2825 12px 28px, #9f9278 28px 32px); }
.tile-library { --tile-bg: repeating-linear-gradient(90deg, #171717 0 20px, #6d5130 20px 25px, #111 25px 48px), radial-gradient(circle at 50% 20%, rgba(255,214,101,.3), transparent 20%); }
.tile-skyline { --tile-bg: linear-gradient(180deg, #101216 0 42%, transparent 43%), repeating-linear-gradient(90deg, #343b42 0 34px, #151719 34px 56px), #050505; }
.tile-chair { --tile-bg: radial-gradient(ellipse at 50% 48%, #ac8350 0 20%, transparent 21%), linear-gradient(180deg, #202020, #070707); }
.tile-night { --tile-bg: radial-gradient(circle at 72% 28%, rgba(255,199,88,.36), transparent 20%), repeating-linear-gradient(90deg, rgba(255,255,255,.12) 0 5px, transparent 5px 44px), linear-gradient(135deg, #07090d, #1a1a1a); }

.welcome:hover .mosaic-tile {
  filter: saturate(1.08) brightness(0.76);
}

.welcome-content {
  position: relative;
  z-index: 6;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: clamp(14px, 2vw, 24px);
  width: min(920px, 100%);
  text-shadow: 0 14px 44px rgba(0, 0, 0, 0.58);
}

.welcome-kicker {
  margin: 0;
  color: var(--savills);
  font-size: clamp(11px, 1.2vw, 15px);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.welcome-title {
  margin: 0;
  max-width: min(1280px, 96vw);
  color: #fff;
  font-size: clamp(74px, 14vw, 184px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
  text-shadow: 0 22px 80px rgba(0, 0, 0, 0.9);
}

.welcome-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2.2vw, 32px);
  font-weight: 750;
  letter-spacing: 0;
}

.app-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.start-button,
.generate-button {
  border: 0;
  min-height: 52px;
  border-radius: 999px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #130f05;
  background: var(--accent-grad);
  box-shadow: 0 18px 42px rgba(255, 139, 45, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  cursor: pointer;
  font-weight: 750;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.start-button:hover,
.generate-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 54px rgba(255, 139, 45, 0.24), 0 0 38px rgba(255, 215, 101, 0.15);
}

.welcome .start-button {
  position: relative;
  z-index: 12;
  min-width: min(360px, 82vw);
  color: #161006;
  background: linear-gradient(135deg, rgba(255, 242, 176, 0.96), rgba(255, 192, 77, 0.94), rgba(255, 122, 47, 0.92));
  border: 1px solid rgba(255, 231, 151, 0.58);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(16px) saturate(1.1);
}

.welcome .start-button:hover {
  background: linear-gradient(135deg, rgba(255, 246, 194, 1), rgba(255, 203, 91, 1), rgba(255, 137, 55, 1));
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 26px 78px rgba(0, 0, 0, 0.52), 0 0 44px rgba(255, 216, 0, 0.12);
}

.app-shell {
  position: relative;
  min-height: 100svh;
  width: min(1500px, calc(100% - clamp(24px, 5vw, 72px)));
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) 0 42px;
}

.app-header {
  position: sticky;
  top: 0;
  min-height: 74px;
  margin-bottom: clamp(18px, 3vw, 30px);
  justify-content: center;
  border-radius: 24px;
  padding: 8px 66px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.app-title {
  text-align: center;
  min-width: 0;
  cursor: pointer;
  border-radius: 18px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-title:hover,
.app-title:focus-visible {
  opacity: 0.88;
  transform: translateY(-1px);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--savills);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 2px;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4.8vw, 66px);
  font-weight: 500;
  line-height: 0.95;
}

.app-wordmark {
  display: block;
  color: #fff;
  font-size: clamp(36px, 6vw, 78px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 16px 40px rgba(0, 0, 0, 0.54);
}

.runtime-pill {
  display: none;
  align-items: center;
  min-height: 28px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid rgba(255, 216, 0, 0.45);
  border-radius: 999px;
  background: rgba(255, 216, 0, 0.12);
  color: var(--savills);
  font-size: 12px;
  font-weight: 750;
}

h2 {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 600;
}

.menu-wrap {
  position: relative;
  position: absolute;
  top: 8px;
  right: 0;
}

.burger-button,
.icon-button,
.soft-button,
.filter-tabs button,
.menu-item,
.history-actions button,
.mini-upload {
  border: 1px solid rgba(255, 213, 101, 0.24);
  background:
    linear-gradient(180deg, rgba(255, 215, 101, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.burger-button {
  width: 48px;
  height: 44px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 11px 14px;
  background:
    linear-gradient(rgba(255, 215, 101, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.burger-button span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: var(--text);
  transition: transform 260ms cubic-bezier(0.2, 0.9, 0.2, 1.2), opacity 180ms ease, width 260ms ease, background 260ms ease;
}

.burger-button[aria-expanded="true"] {
  border-color: rgba(255, 31, 121, 0.48);
  background: linear-gradient(135deg, rgba(47, 111, 255, 0.28), rgba(141, 68, 255, 0.2), rgba(255, 31, 121, 0.24));
  box-shadow: 0 0 32px rgba(141, 68, 255, 0.22);
  transform: rotate(90deg) scale(1.03);
}

.burger-button[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  width: 21px;
}

.burger-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger-button[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 21px;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 190px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(8, 8, 12, 0.9);
  backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
  transform-origin: top right;
  animation: menuReveal 180ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

.menu-item {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  text-align: left;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
}

.menu-item.active,
.menu-item:hover,
.filter-tabs button.active,
.filter-tabs button:hover,
.soft-button.active,
.soft-button:hover,
.icon-button:hover,
.history-actions button:hover,
.mini-upload:hover {
  color: var(--text);
  border-color: rgba(255, 190, 72, 0.48);
  background: rgba(255, 178, 62, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero-result {
  position: relative;
  width: min(1120px, 100%);
  min-height: clamp(220px, 34vw, 520px);
  margin: 0 auto clamp(16px, 2vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.34)),
    radial-gradient(circle at 82% 18%, rgba(255, 214, 101, 0.16), transparent 20rem),
    linear-gradient(135deg, #1b1c1b 0%, #070707 64%, #000 100%);
  box-shadow: var(--shadow);
}

#resultImage {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 260ms ease;
}

#resultImage.has-image {
  opacity: 1;
}

.image-empty,
.loading-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.76);
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.54));
}

.image-empty p,
.loading-layer p,
.status,
.gemma-heading p {
  margin: 0;
}

.loading-layer {
  z-index: 4;
  align-content: center;
  gap: 14px;
  background: rgba(2, 2, 4, 0.72);
}

.loader {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--savills);
  animation: spin 840ms linear infinite;
}

.stage-actions {
  position: absolute;
  z-index: 5;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
}

.glass-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.038));
  box-shadow: 0 18px 62px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(28px) saturate(120%);
}

.prompt-studio {
  width: min(980px, 100%);
  margin: 0 auto 16px;
  padding: clamp(12px, 2vw, 18px);
  display: grid;
  justify-items: center;
}

.prompt-studio.drag-source-active {
  border-color: rgba(255, 216, 0, 0.65);
  box-shadow: 0 0 0 4px rgba(255, 216, 0, 0.1), 0 20px 70px rgba(255, 216, 0, 0.08);
}

.prompt-studio.drag-source-active textarea {
  border-color: rgba(255, 216, 0, 0.72);
  background: rgba(255, 216, 0, 0.08);
}

.prompt-label {
  display: block;
  margin: 0 0 9px 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.prompt-text-wrap,
.chat-input-wrap {
  position: relative;
  width: min(820px, 100%);
}

textarea,
select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  outline: 0;
  color: var(--text);
  background: rgba(0, 0, 0, 0.28);
}

textarea {
  resize: vertical;
  min-height: 84px;
  max-height: 260px;
  padding: 15px 58px 15px 15px;
  line-height: 1.5;
  overflow: hidden;
}

textarea::placeholder {
  color: rgba(255, 255, 255, 0.36);
}

textarea:focus,
select:focus {
  border-color: rgba(255, 190, 72, 0.46);
  box-shadow: 0 0 0 4px rgba(255, 190, 72, 0.1);
}

.prompt-tools {
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.soft-button,
.mini-upload {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 13px;
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.soft-button.compact {
  min-width: 0;
  padding-inline: 14px;
}

.mini-upload {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 12px;
}

.mic-button {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.82);
  transition: color 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.mic-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.mic-button.is-listening {
  color: #ff2d2d;
  border-color: rgba(255, 45, 45, 0.9);
  background: radial-gradient(circle at 50% 45%, rgba(255, 45, 45, 0.28), rgba(255, 45, 45, 0.1) 58%, rgba(20, 2, 2, 0.72));
  box-shadow: 0 0 0 3px rgba(255, 45, 45, 0.16), 0 0 20px rgba(255, 45, 45, 0.58);
  animation: mic-vibrance 760ms ease-in-out infinite;
}

.mic-button.is-listening svg {
  stroke-width: 2.4;
}

.source-thumb {
  width: 44px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.source-preview {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}

.source-item {
  position: relative;
  display: inline-flex;
}

.source-item img {
  width: 46px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  cursor: zoom-in;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.source-item button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 19px;
  min-height: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 8, 8, 0.88);
  font-size: 11px;
  cursor: pointer;
}

.grok-model-picker {
  width: min(820px, 100%);
  min-inline-size: 0;
  margin: 14px 0 0;
  padding: 0;
  border: 0;
}

.grok-model-picker legend {
  margin: 0 auto;
  padding: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  text-align: center;
}

.grok-model-hint {
  margin: 4px 0 10px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.grok-model-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.grok-model-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.grok-model-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.grok-model-card {
  min-height: 62px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  column-gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.grok-model-name,
.grok-model-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grok-model-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.grok-model-meta {
  margin-top: 3px;
  color: var(--faint);
  font-size: 12px;
}

.grok-model-badge {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  padding: 4px 7px;
  border: 1px solid rgba(255, 216, 0, 0.24);
  border-radius: 999px;
  color: rgba(255, 231, 139, 0.94);
  background: rgba(255, 216, 0, 0.08);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.grok-model-choice:hover .grok-model-card {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.grok-model-radio:checked + .grok-model-card {
  border-color: rgba(255, 214, 101, 0.78);
  color: var(--text);
  background: linear-gradient(180deg, rgba(255, 216, 0, 0.13), rgba(255, 139, 45, 0.07));
  box-shadow: 0 0 0 2px rgba(255, 190, 72, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.grok-model-radio:checked + .grok-model-card .grok-model-name::before {
  content: "✓";
  margin-right: 6px;
  color: rgba(255, 226, 108, 0.96);
}

.grok-model-radio:focus-visible + .grok-model-card {
  outline: 3px solid rgba(255, 216, 0, 0.72);
  outline-offset: 3px;
}

.grok-model-picker:disabled .grok-model-choice {
  cursor: not-allowed;
}

.grok-model-picker:disabled .grok-model-card {
  opacity: 0.5;
  transform: none;
}

.settings-inline {
  width: min(1180px, 100%);
  margin: 12px auto 0;
  display: grid;
  grid-template-columns: 0.75fr 0.75fr minmax(150px, 1.3fr) 0.9fr;
  gap: 10px;
  align-items: end;
}

.settings-inline label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.settings-inline label span {
  color: var(--faint);
  font-weight: 500;
}

.prompt-studio > .generate-button {
  min-width: 190px;
  min-height: 46px;
  margin: 14px auto 0;
  display: flex;
}

.presets-panel,
.chat-panel {
  padding: clamp(12px, 2vw, 18px);
}

.presets-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.panel-title,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.panel-title {
  justify-content: center;
  position: relative;
}

.panel-title .preset-reset {
  position: absolute;
  right: 0;
}

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.preset-reset {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}

.preset-reset:not(:disabled):hover {
  color: var(--text);
}

.preset-reset:disabled {
  opacity: 0.34;
  cursor: default;
}

.filter-tabs button {
  min-height: 34px;
  border-radius: 999px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 10px;
  max-height: min(39svh, 420px);
  overflow: auto;
  padding-right: 2px;
}

.preset-card {
  position: relative;
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.preset-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, var(--preset-tint, transparent), transparent 54%),
    linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.76));
  mix-blend-mode: screen;
  opacity: 0.7;
}

.preset-card img {
  width: 100%;
  height: 100%;
  min-height: 104px;
  object-fit: cover;
  display: block;
  filter: var(--preset-filter, saturate(0.92) brightness(0.78));
  transition: transform 240ms ease, filter 240ms ease;
}

.preset-card span {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 28px 9px 9px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.86));
  font-size: 11px;
  font-weight: 750;
  z-index: 2;
}

.preset-card.active {
  border-color: rgba(255, 214, 101, 0.8);
  box-shadow: 0 0 0 2px rgba(255, 190, 72, 0.22), 0 0 30px rgba(255, 139, 45, 0.16);
}

.preset-card:hover img {
  transform: scale(1.05);
  filter: saturate(1.05) brightness(0.95);
}

select {
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--savills);
}

.status {
  width: min(980px, 100%);
  min-height: 20px;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.status.error {
  color: var(--danger);
}

.status.ok {
  color: var(--ok);
}

.section-heading {
  width: min(1180px, 100%);
  margin: 0 auto 16px;
}

.history-grid {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.history-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.history-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.history-body {
  padding: 13px;
  display: grid;
  gap: 8px;
}

.history-body strong {
  font-size: 14px;
}

.history-body span {
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-actions button {
  min-height: 30px;
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.empty-list {
  width: min(1180px, 100%);
  min-height: 220px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 20px;
  color: var(--muted);
}

.gemma-heading {
  width: min(1040px, 100%);
  margin: 0 auto 16px;
  text-align: center;
}

.gemma-heading p:last-child {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.chat-panel {
  width: min(1040px, 100%);
  min-height: min(620px, calc(100svh - 210px));
  margin: 0 auto;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.chat-log {
  min-height: 290px;
  max-height: calc(100svh - 355px);
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding-right: 4px;
}

.message {
  max-width: min(760px, 86%);
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--text);
  line-height: 1.52;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.message.has-images {
  display: grid;
  gap: 10px;
}

.message-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.message-images img,
.gemma-source-preview img {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.message.assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.message.pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 64px;
  min-height: 46px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  animation: typingPulse 920ms ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dot:nth-child(3) {
  animation-delay: 240ms;
}

.message.user {
  justify-self: end;
  background: rgba(255, 216, 0, 0.15);
  border: 1px solid rgba(255, 216, 0, 0.25);
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-items: center;
  align-items: end;
}

.chat-form textarea {
  min-height: 76px;
  max-height: 150px;
}

.chat-tools {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.gemma-source-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.gemma-source-item {
  position: relative;
}

.gemma-source-item button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  border-radius: 999px;
  padding: 0;
  font-size: 11px;
  background: rgba(12, 12, 13, 0.86);
}

#chatSendButton {
  grid-column: 1 / -1;
  grid-row: auto;
  min-width: 190px;
  justify-self: center;
}

.button-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  vertical-align: -2px;
  animation: spin 720ms linear infinite;
}

.lightbox {
  width: min(1180px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(4, 4, 7, 0.92);
  padding: 12px;
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.lightbox img {
  display: block;
  width: 100%;
  max-height: 82svh;
  object-fit: contain;
  border-radius: 18px;
}

#closeLightboxButton {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.generate-button:disabled,
.soft-button:disabled,
.icon-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes mic-vibrance {
  0%,
  100% {
    transform: translateY(0) scale(1);
    filter: saturate(1);
  }
  35% {
    transform: translateY(-1px) scale(1.08);
    filter: saturate(1.55);
  }
  70% {
    transform: translateY(1px) scale(1.02);
    filter: saturate(1.25);
  }
}

@keyframes typingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.38;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes menuReveal {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  .welcome-mosaic {
    grid-template-columns: repeat(5, minmax(116px, 1fr));
    grid-auto-rows: minmax(116px, 17vh);
  }

  .app-title {
    text-align: center;
  }

  .settings-inline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .welcome-mosaic {
    inset: -4vh -22vw;
    grid-template-columns: repeat(4, minmax(118px, 1fr));
  }

  .app-shell {
    width: min(100% - 22px, 1500px);
    padding-top: 14px;
  }

  .app-header {
    justify-content: center;
    padding: 8px 58px;
  }

  .app-title {
    text-align: left;
  }

  h1 {
    font-size: clamp(36px, 12vw, 58px);
  }

  .hero-result {
    min-height: 190px;
    border-radius: 22px;
  }

  textarea {
    min-height: 78px;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-tools,
  #chatSendButton {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .settings-inline {
    grid-template-columns: 1fr 1fr;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 360px;
  }

  .message {
    max-width: 100%;
  }
}

/* v22 source gallery, zoomable images and icon-only history actions. */
#resultImage.has-image,
.history-card img,
.message-images img,
.gemma-source-preview img,
.source-item img {
  cursor: zoom-in;
}

.history-actions {
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;
}

.history-actions button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}

.history-actions .button-glyph {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.lightbox {
  cursor: zoom-out;
}

.lightbox img {
  cursor: zoom-out;
}

.prompt-tools .source-preview {
  max-width: min(100%, 360px);
}

/* v20 focused polish: softer cursor blur, smaller menu, reference preview, icon buttons. */
.welcome::before {
  z-index: 7;
  backdrop-filter: blur(18px) saturate(1.05) brightness(0.84);
  background: rgba(0, 0, 0, 0.18);
  mask-image:
    radial-gradient(
      circle 285px at var(--mx) var(--my),
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.72) 32%,
      rgba(0, 0, 0, 0.34) 58%,
      transparent 82%
    );
  opacity: 0;
}

.welcome:hover::before {
  opacity: 0.78;
}

.welcome .start-button {
  position: relative;
  z-index: 12;
}

.burger-button {
  width: 52px;
  height: 52px;
  padding: 15px;
  gap: 4px;
}

.burger-button span {
  width: 18px;
  height: 2px;
}

.burger-button[aria-expanded="true"] {
  transform: none;
}

.burger-button[aria-expanded="true"] span:nth-child(1) {
  width: 19px;
  transform: translateY(6px) rotate(45deg);
}

.burger-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger-button[aria-expanded="true"] span:nth-child(3) {
  width: 19px;
  transform: translateY(-6px) rotate(-45deg);
}

.menu-panel {
  top: clamp(92px, 13vh, 145px);
  right: clamp(14px, 3vw, 42px);
  width: min(462px, calc(100vw - 32px));
  padding: clamp(16px, 2vw, 26px);
  border-width: 2px;
  border-radius: 42px;
}

.menu-item {
  min-height: clamp(74px, 8vw, 96px);
  margin-bottom: 14px;
  border-width: 2px;
  border-radius: 24px;
  padding: 0 clamp(20px, 3vw, 34px);
  gap: 22px;
  font-size: clamp(28px, 3.2vw, 40px);
}

.menu-item:last-child {
  margin-bottom: 0;
}

.menu-item::before {
  content: none !important;
}

.button-icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-icon {
  width: clamp(30px, 3.3vw, 42px);
  height: clamp(30px, 3.3vw, 42px);
  color: var(--green);
}

.soft-button,
.mini-upload,
.generate-button,
.preset-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.with-icon::before,
.button-glyph {
  content: "";
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  display: inline-block;
  background: currentColor;
  color: var(--green-2);
  mask: var(--button-icon) center / contain no-repeat;
}

[data-icon="spark"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2l1.7 5.1L19 9l-5.3 1.9L12 16l-1.7-5.1L5 9l5.3-1.9L12 2Zm6 11l.9 2.6L22 16.5l-3.1.9L18 20l-.9-2.6-3.1-.9 3.1-.9L18 13ZM5 14l1.1 3.1L9 18l-2.9.9L5 22l-1.1-3.1L1 18l2.9-.9L5 14Z'/%3E%3C/svg%3E");
}

[data-icon="trash"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 7h16M10 11v6M14 11v6M6 7l1 14h10l1-14M9 7V4h6v3'/%3E%3C/svg%3E");
}

[data-icon="upload"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 16V4m0 0 5 5m-5-5L7 9M4 15v5h16v-5'/%3E%3C/svg%3E");
}

[data-icon="camera"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M4 8h4l2-3h4l2 3h4v11H4V8Zm8 8a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7Z'/%3E%3C/svg%3E");
}

[data-icon="reset"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M20 12a8 8 0 1 1-2.34-5.66M20 4v6h-6'/%3E%3C/svg%3E");
}

[data-icon="send"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='m4 12 15-7-4 14-3-6-8-1Z'/%3E%3C/svg%3E");
}

[data-icon="download"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 3v12m0 0 5-5m-5 5-5-5M5 20h14'/%3E%3C/svg%3E");
}

[data-icon="edit"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M12 20h9M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5Z'/%3E%3C/svg%3E");
}

[data-icon="source"] {
  --button-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M5 7h7a4 4 0 0 1 0 8H7m0 0 3-3m-3 3 3 3M15 7h2a4 4 0 0 1 0 8h-2'/%3E%3C/svg%3E");
}

.image-empty {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.28)),
    url("/assets/reference-preview.jpg") center / cover no-repeat;
}

.image-empty::before,
.image-empty p {
  display: none;
}

.hero-result::after {
  border-color: rgba(255, 255, 255, 0.12);
}

@media (max-width: 720px) {
  .menu-panel {
    top: 82px;
    border-radius: 34px;
  }

  .menu-item {
    min-height: 72px;
    font-size: clamp(25px, 8vw, 34px);
  }

  .menu-icon {
    width: 30px;
    height: 30px;
  }

  .grok-model-options {
    grid-template-columns: 1fr;
  }

  .grok-model-card {
    min-height: 58px;
    padding-inline: 13px;
  }
}

/* v22 final overrides after legacy theme. */
#resultImage.has-image,
.history-card img,
.message-images img,
.gemma-source-preview img,
.source-item img {
  cursor: zoom-in;
}

.source-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.source-item {
  position: relative;
  display: inline-flex;
}

.source-item img {
  width: 46px;
  height: 34px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.source-item button {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 19px;
  min-height: 19px;
  height: 19px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 8, 8, 0.88);
  font-size: 11px;
}

.history-actions {
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 9px;
}

.history-actions button {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}

.history-actions .button-glyph {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

.lightbox,
.lightbox img {
  cursor: zoom-out;
}

/* v21 final responsive layer - intentionally last. */
html {
  scrollbar-gutter: stable both-edges;
}

.app-shell {
  margin-inline: auto;
}

.hero-result {
  aspect-ratio: 16 / 9;
  min-height: 0;
  height: auto;
}

.prompt-tools,
.chat-tools,
.filter-tabs {
  width: 100%;
}

.soft-button,
.mini-upload,
.filter-tabs button,
.generate-button,
.preset-reset,
.icon-button {
  touch-action: manipulation;
}

.soft-button,
.mini-upload {
  white-space: nowrap;
}

.preset-card {
  aspect-ratio: 1 / 1.08;
  min-height: 0;
}

.preset-card img {
  height: 100%;
  min-height: 0;
}

.preset-card span::after {
  content: "";
}

@media (min-width: 1180px) {
  .app-shell {
    width: min(1248px, calc(100% - 64px));
  }

  .preset-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 1179px) {
  .app-shell {
    width: min(100% - 36px, 980px);
    padding-top: 22px;
  }

  .app-header {
    min-height: 76px;
    padding-inline: 18px 74px;
  }

  .app-wordmark {
    font-size: clamp(42px, 7vw, 62px);
  }

  .hero-result,
  .prompt-studio,
  .presets-panel,
  .chat-panel,
  .history-grid,
  .empty-list {
    width: 100%;
  }

  .preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .welcome-content {
    width: min(94vw, 430px);
    gap: 16px;
  }

  .welcome-title {
    font-size: clamp(56px, 18vw, 94px);
    line-height: 0.88;
  }

  .welcome-subtitle {
    font-size: clamp(11px, 3.2vw, 15px);
    letter-spacing: clamp(1.5px, 0.8vw, 3px);
  }

  .welcome .start-button {
    min-width: 0;
    width: min(360px, 88vw);
    height: 54px;
    font-size: clamp(16px, 4.4vw, 20px);
  }

  .app-shell {
    width: min(100% - 16px, 620px);
    padding-top: 14px;
  }

  .app-header {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 0 58px 0 2px;
  }

  .app-wordmark {
    font-size: clamp(30px, 9.2vw, 42px);
    line-height: 1;
  }

  .burger-button {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    padding: 13px;
  }

  .menu-panel {
    top: 70px;
    right: 8px;
    width: min(390px, calc(100vw - 16px));
    padding: 14px;
    border-radius: 28px;
  }

  .menu-item {
    min-height: 62px;
    margin-bottom: 10px;
    border-radius: 18px;
    gap: 16px;
    padding-inline: 18px;
    font-size: clamp(22px, 7vw, 30px);
  }

  .menu-icon {
    width: 26px;
    height: 26px;
  }

  .hero-result {
    width: 100%;
    border-radius: 18px;
  }

  .stage-actions {
    top: 9px;
    right: 9px;
    gap: 6px;
  }

  .stage-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .prompt-studio,
  .presets-panel,
  .chat-panel {
    width: 100%;
    border-radius: 18px;
    padding: 14px;
  }

  .prompt-tools,
  .chat-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .mini-upload[for="fileInput"],
  .mini-upload[for="gemmaFileInput"] {
    grid-column: 1 / -1;
  }

  .soft-button,
  .mini-upload {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
    font-size: 11px;
  }

  .prompt-text-wrap,
  .chat-input-wrap {
    width: 100%;
  }

  textarea {
    min-height: 94px;
    max-height: 190px;
    padding: 13px 50px 13px 13px;
    font-size: 14px;
  }

  #chatInput {
    min-height: 96px;
    font-size: 15px;
  }

  .mic-button {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .prompt-studio > .generate-button,
  #chatSendButton {
    width: min(230px, 100%);
    min-width: 0;
    min-height: 44px;
    margin-top: 12px;
  }

  .panel-title {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .panel-title .preset-reset {
    position: static;
  }

  .panel-title h2 {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 8px;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding-inline: 14px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .preset-card {
    width: 100%;
  }

  .preset-card span {
    padding-inline: 8px;
    font-size: 10px;
  }

  .status {
    margin-top: 10px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .gemma-heading {
    margin-top: 18px;
    margin-bottom: 12px;
  }

  .gemma-heading h2 {
    font-size: 28px;
  }

  .gemma-heading p:last-child {
    font-size: 13px;
  }

  .chat-panel {
    min-height: calc(100svh - 170px);
  }

  .chat-log {
    min-height: 220px;
    max-height: 44svh;
  }

  .message {
    max-width: 100%;
    border-radius: 18px;
    font-size: 13px;
  }

  .section-heading {
    margin-top: 18px;
    align-items: center;
  }

  .history-grid,
  .empty-list {
    width: 100%;
    min-height: 360px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    width: min(100% - 12px, 390px);
  }

  .app-header {
    padding-right: 52px;
  }

  .app-wordmark {
    font-size: clamp(27px, 8.6vw, 34px);
  }

  .burger-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .prompt-tools,
  .chat-tools {
    grid-template-columns: 1fr;
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }

  .preset-card {
    aspect-ratio: 16 / 9;
  }
}

/* v21 responsive pass: desktop, tablet and phone spacing. */
html {
  scrollbar-gutter: stable both-edges;
}

.app-shell {
  margin-inline: auto;
}

.hero-result {
  aspect-ratio: 16 / 9;
  min-height: 0;
  height: auto;
}

.prompt-tools,
.chat-tools,
.filter-tabs {
  width: 100%;
}

.soft-button,
.mini-upload,
.filter-tabs button,
.generate-button,
.preset-reset,
.icon-button {
  touch-action: manipulation;
}

.soft-button,
.mini-upload {
  white-space: nowrap;
}

.preset-card {
  aspect-ratio: 1 / 1.08;
  min-height: 0;
}

.preset-card img {
  height: 100%;
  min-height: 0;
}

@media (min-width: 1180px) {
  .app-shell {
    width: min(1248px, calc(100% - 64px));
  }

  .preset-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 721px) and (max-width: 1179px) {
  .app-shell {
    width: min(100% - 36px, 980px);
    padding-top: 22px;
  }

  .app-header {
    min-height: 76px;
    padding-inline: 18px 74px;
  }

  .app-wordmark {
    font-size: clamp(42px, 7vw, 62px);
  }

  .hero-result {
    width: 100%;
  }

  .prompt-studio,
  .presets-panel,
  .chat-panel,
  .history-grid,
  .empty-list {
    width: 100%;
  }

  .preset-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background-attachment: scroll;
  }

  .welcome-content {
    width: min(94vw, 430px);
    gap: 16px;
  }

  .welcome-title {
    font-size: clamp(56px, 18vw, 94px);
    line-height: 0.88;
  }

  .welcome-subtitle {
    font-size: clamp(11px, 3.2vw, 15px);
    letter-spacing: clamp(1.5px, 0.8vw, 3px);
  }

  .welcome .start-button {
    min-width: 0;
    width: min(360px, 88vw);
    height: 54px;
    font-size: clamp(16px, 4.4vw, 20px);
  }

  .app-shell {
    width: min(100% - 16px, 620px);
    padding-top: 14px;
  }

  .app-header {
    min-height: 58px;
    margin-bottom: 10px;
    padding: 0 58px 0 2px;
  }

  .app-wordmark {
    font-size: clamp(30px, 9.2vw, 42px);
    line-height: 1;
  }

  .burger-button {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    padding: 13px;
  }

  .menu-panel {
    top: 70px;
    right: 8px;
    width: min(390px, calc(100vw - 16px));
    padding: 14px;
    border-radius: 28px;
  }

  .menu-item {
    min-height: 62px;
    margin-bottom: 10px;
    border-radius: 18px;
    gap: 16px;
    padding-inline: 18px;
    font-size: clamp(22px, 7vw, 30px);
  }

  .menu-icon {
    width: 26px;
    height: 26px;
  }

  .hero-result {
    width: 100%;
    border-radius: 18px;
  }

  .stage-actions {
    top: 9px;
    right: 9px;
    gap: 6px;
  }

  .stage-actions .icon-button {
    width: 34px;
    height: 34px;
  }

  .prompt-studio,
  .presets-panel,
  .chat-panel {
    width: 100%;
    border-radius: 18px;
    padding: 14px;
  }

  .prompt-label {
    margin-bottom: 9px;
  }

  .prompt-tools,
  .chat-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  .mini-upload[for="fileInput"],
  .mini-upload[for="gemmaFileInput"] {
    grid-column: 1 / -1;
  }

  .soft-button,
  .mini-upload {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 0 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
    font-size: 11px;
  }

  .prompt-text-wrap,
  .chat-input-wrap {
    width: 100%;
  }

  textarea {
    min-height: 94px;
    max-height: 190px;
    padding: 13px 50px 13px 13px;
    font-size: 14px;
  }

  #chatInput {
    min-height: 96px;
    font-size: 15px;
  }

  .mic-button {
    right: 10px;
    bottom: 10px;
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .prompt-studio > .generate-button,
  #chatSendButton {
    width: min(230px, 100%);
    min-width: 0;
    min-height: 44px;
    margin-top: 12px;
  }

  .panel-title {
    display: grid;
    justify-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .panel-title .preset-reset {
    position: static;
  }

  .panel-title h2 {
    font-size: clamp(28px, 9vw, 36px);
    line-height: 1;
  }

  .filter-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 0 2px 8px;
    scrollbar-width: none;
  }

  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .filter-tabs button {
    flex: 0 0 auto;
    min-height: 34px;
    padding-inline: 14px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .preset-card span {
    padding-inline: 8px;
    font-size: 10px;
  }

  .status {
    margin-top: 10px;
    padding-inline: 8px;
    font-size: 12px;
  }

  .gemma-heading {
    margin-top: 18px;
    margin-bottom: 12px;
  }

  .gemma-heading h2 {
    font-size: 28px;
  }

  .gemma-heading p:last-child {
    font-size: 13px;
  }

  .chat-panel {
    min-height: calc(100svh - 170px);
  }

  .chat-log {
    min-height: 220px;
    max-height: 44svh;
  }

  .message {
    max-width: 100%;
    border-radius: 18px;
    font-size: 13px;
  }

  .section-heading {
    margin-top: 18px;
    align-items: center;
  }

  .history-grid,
  .empty-list {
    width: 100%;
    min-height: 360px;
  }
}

@media (max-width: 390px) {
  .app-shell {
    width: min(100% - 12px, 390px);
  }

  .app-header {
    padding-right: 52px;
  }

  .app-wordmark {
    font-size: clamp(27px, 8.6vw, 34px);
  }

  .burger-button {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .prompt-tools,
  .chat-tools {
    grid-template-columns: 1fr;
  }

  .preset-grid {
    grid-template-columns: 1fr;
  }

  .preset-card {
    aspect-ratio: 16 / 9;
  }
}

@media (max-width: 460px) {
  .welcome {
    padding: 16px 12px;
  }

  .welcome-mosaic {
    inset: -3vh -42vw;
    grid-template-columns: repeat(3, minmax(132px, 1fr));
    grid-auto-rows: 132px;
  }

  .welcome-subtitle {
    max-width: 280px;
  }

  .settings-inline,
  .preset-grid {
    grid-template-columns: 1fr;
  }

  .generate-button {
    width: 100%;
  }

  .filter-tabs {
    display: grid;
    justify-content: stretch;
  }

  .prompt-tools {
    align-items: stretch;
  }

  .soft-button,
  .mini-upload {
    justify-content: center;
    width: 100%;
  }
}

/* SAVILLS FLOW v19 - noir, verre fume, vert lime */
:root {
  --bg: #030503;
  --panel: rgba(15, 18, 16, 0.86);
  --panel-strong: rgba(15, 18, 16, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f7f7f5;
  --muted: #a7a7a1;
  --faint: #888a84;
  --savills: #9dc045;
  --green: #95c83a;
  --green-2: #a6d441;
  --green-dark: rgba(18, 23, 12, 0.92);
  --accent-grad: linear-gradient(90deg, #a6d441 0%, #94c832 100%);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.58);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background:
    linear-gradient(rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.94)),
    url("/assets/grok/app-bg.jpg") center / cover fixed,
    #030503;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 4%, rgba(157, 192, 69, 0.08), transparent 22rem),
    linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.78));
}

.ambient {
  opacity: 0.08;
}

.welcome {
  padding: 0;
  background: #000;
}

.welcome::before {
  z-index: 7;
  backdrop-filter: blur(14px) saturate(1.04) brightness(0.84);
  background: rgba(0, 0, 0, 0.2);
  mask-image: radial-gradient(circle 190px at var(--mx) var(--my), black 0 48%, transparent 78%);
  opacity: 0;
}

.welcome:hover::before {
  opacity: 0.92;
}

.welcome::after {
  z-index: 2;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(0, 0, 0, 0.28), transparent 0 28rem),
    linear-gradient(rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.52));
}

.welcome-mosaic {
  inset: 0;
  display: block;
  transform: none;
  background: url("/assets/grok/hero-mosaic.jpg") center / cover no-repeat;
  filter: saturate(1.04) contrast(1.05) brightness(0.9);
}

.welcome-content {
  z-index: 6;
  width: min(980px, 94vw);
  gap: 24px;
}

.welcome-title {
  display: grid;
  gap: clamp(4px, 0.8vw, 12px);
  font-size: clamp(82px, 13.6vw, 158px);
  line-height: 0.84;
  letter-spacing: 1px;
  color: #fefdfe;
  text-shadow: 0 14px 48px rgba(0, 0, 0, 0.78);
}

.welcome-title span {
  display: block;
}

.welcome-subtitle {
  position: relative;
  z-index: 6;
  color: #d8d8d8;
  font-size: clamp(14px, 1.3vw, 22px);
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.welcome-subtitle strong {
  color: #76a435;
}

.welcome .start-button {
  z-index: 10;
  min-width: min(430px, 86vw);
  height: 64px;
  color: #f7f7f5;
  background: rgba(37, 39, 36, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  font-size: clamp(18px, 2.2vw, 34px);
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.welcome .start-button:hover {
  background: rgba(48, 51, 46, 0.96);
  border-color: rgba(149, 200, 58, 0.48);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.42), 0 0 22px rgba(149, 200, 58, 0.16);
}

.app-shell {
  width: min(1248px, calc(100% - 44px));
  padding-top: 28px;
}

.app-header {
  min-height: 88px;
  margin-bottom: 18px;
  padding: 0 78px;
}

.app-wordmark {
  font-size: clamp(46px, 5.4vw, 74px);
  font-weight: 900;
  color: #fdfdfb;
  text-shadow: none;
}

.app-wordmark strong {
  color: var(--green-2);
}

.menu-wrap {
  top: 8px;
  right: 0;
}

.burger-button {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border-color: rgba(164, 212, 61, 0.68);
  background: rgba(14, 18, 13, 0.92);
  box-shadow: none;
}

.burger-button span {
  width: 20px;
  background: var(--green-2);
}

.burger-button[aria-expanded="true"] {
  border-color: #90c53a;
  background: rgba(20, 24, 18, 0.92);
  box-shadow: 0 0 22px rgba(144, 197, 58, 0.12);
  transform: none;
}

.menu-panel {
  position: fixed;
  top: clamp(110px, 18vh, 220px);
  right: clamp(22px, 4vw, 72px);
  width: min(655px, calc(100vw - 44px));
  padding: clamp(22px, 3vw, 44px);
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-radius: clamp(36px, 5vw, 72px);
  background: rgba(18, 21, 19, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  z-index: 80;
}

.menu-item {
  min-height: clamp(84px, 11vw, 158px);
  margin-bottom: 18px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-radius: clamp(24px, 3vw, 40px);
  padding: 0 clamp(28px, 4vw, 52px);
  display: flex;
  align-items: center;
  gap: 34px;
  color: #e8e8e4;
  background: rgba(12, 14, 13, 0.64);
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 500;
}

.menu-item::before {
  width: 58px;
  color: var(--green);
  font-size: 44px;
  line-height: 1;
}

.menu-item[data-view="generate"]::before { content: "++"; }
.menu-item[data-view="history"]::before { content: "◷"; }
.menu-item[data-view="gemma"]::before { content: "▣"; }

.menu-item.active,
.menu-item:hover {
  color: #f1f1ed;
  border-color: rgba(146, 196, 58, 0.7);
  background: linear-gradient(90deg, rgba(137, 176, 45, 0.22) 0%, rgba(126, 160, 38, 0.18) 100%);
  box-shadow: inset 0 0 24px rgba(145, 197, 58, 0.06);
}

.hero-result {
  width: min(872px, 100%);
  min-height: clamp(255px, 26vw, 325px);
  border-radius: 24px;
  background: rgba(15, 18, 16, 0.86);
  border-color: var(--line);
  backdrop-filter: blur(12px);
}

.hero-result::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  pointer-events: none;
}

.image-empty {
  gap: 14px;
  background: rgba(15, 18, 16, 0.28);
}

.image-empty::before {
  content: "▱";
  display: block;
  color: var(--green);
  font-size: 54px;
  line-height: 1;
}

.stage-actions .icon-button {
  border-color: rgba(141, 189, 46, 0.45);
  color: #9fc241;
  background: rgba(20, 22, 18, 0.95);
}

.glass-panel {
  border-color: var(--line);
  border-radius: 24px;
  background: rgba(15, 18, 16, 0.9);
  backdrop-filter: blur(12px);
}

.prompt-studio {
  width: min(833px, 100%);
  padding: 16px 34px 22px;
}

.prompt-label {
  margin: 0 0 10px;
  text-align: center;
  font-size: 14px;
  color: var(--text);
}

.prompt-tools,
.chat-tools {
  gap: 10px;
}

.soft-button,
.mini-upload,
.filter-tabs button,
.history-actions button {
  min-height: 34px;
  border-radius: 999px;
  border-color: rgba(141, 189, 46, 0.42);
  background: rgba(18, 21, 17, 0.9);
  color: #d0d0c8;
  font-size: 12px;
  font-weight: 600;
}

textarea,
select {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(8, 10, 9, 0.78);
}

textarea {
  min-height: 118px;
  border-radius: 18px;
  color: var(--text);
  font-size: 15px;
}

textarea::placeholder {
  color: #7f817e;
}

.mic-button {
  border-color: rgba(164, 212, 61, 0.6);
  background: rgba(14, 18, 13, 0.88);
  color: var(--green-2);
}

.prompt-studio > .generate-button,
#chatSendButton {
  min-width: 195px;
  min-height: 45px;
  color: #f7f7f5;
  background: var(--accent-grad);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  font-weight: 800;
}

.presets-panel {
  width: min(1049px, 100%);
  min-height: 397px;
  margin-top: 18px;
  padding: 22px;
}

.panel-title h2 {
  font-size: clamp(27px, 3vw, 38px);
  font-weight: 900;
}

.preset-reset {
  color: var(--green);
  font-weight: 700;
}

.filter-tabs {
  margin: 8px 0 16px;
}

.filter-tabs button.active {
  color: #f7f7f5;
  border-color: transparent;
  background: var(--accent-grad);
}

.preset-grid {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px;
  max-height: none;
}

.preset-card {
  min-height: 132px;
  border-radius: 12px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(15, 18, 16, 0.92);
}

.preset-card img {
  min-height: 132px;
  filter: saturate(0.95) brightness(0.86);
}

.preset-card::after {
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.82));
  mix-blend-mode: normal;
}

.preset-card span {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.preset-card span::after {
  content: "≡";
  color: var(--green);
  font-size: 16px;
}

.section-heading {
  margin-top: 36px;
}

.eyebrow {
  color: var(--green);
}

.history-grid {
  min-height: 520px;
  padding: 16px;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: rgba(12, 14, 12, 0.78);
  backdrop-filter: blur(12px);
}

.empty-list {
  min-height: 520px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 12, 0.78);
  color: #b6b6b0;
}

.gemma-heading {
  margin-top: 34px;
}

.gemma-heading h2 {
  font-size: 35px;
  font-weight: 900;
}

.gemma-heading p:last-child {
  color: #d1d1cd;
  font-size: 16px;
}

.chat-panel {
  width: min(1026px, 100%);
  min-height: min(582px, calc(100svh - 230px));
  padding: 28px;
  border-radius: 28px;
  background: rgba(15, 18, 16, 0.84);
}

.message.assistant {
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  font-weight: 700;
}

.message.user {
  border-color: rgba(164, 212, 61, 0.28);
  background: rgba(164, 212, 61, 0.12);
}

#chatInput {
  min-height: 106px;
  border-radius: 22px;
  font-size: 18px;
}

.status {
  color: var(--faint);
}

@media (max-width: 720px) {
  .welcome-title {
    font-size: clamp(58px, 19vw, 104px);
  }

  .welcome-subtitle {
    letter-spacing: 2px;
  }

  .app-shell {
    width: min(100% - 20px, 1248px);
  }

  .app-header {
    min-height: 72px;
    padding: 0 66px 0 0;
  }

  .app-wordmark {
    font-size: clamp(36px, 10vw, 52px);
  }

  .menu-panel {
    top: 92px;
  }

  .prompt-studio {
    padding: 16px;
  }

  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* v20 final overrides must stay after the legacy appended block. */
.welcome::before {
  z-index: 7;
  backdrop-filter: blur(18px) saturate(1.05) brightness(0.84);
  background: rgba(0, 0, 0, 0.18);
  mask-image: radial-gradient(circle 285px at var(--mx) var(--my), rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.72) 32%, rgba(0, 0, 0, 0.34) 58%, transparent 82%);
  opacity: 0;
}

.welcome:hover::before {
  opacity: 0.78;
}

.welcome .start-button {
  position: relative;
  z-index: 12;
}

.burger-button {
  width: 52px;
  height: 52px;
  padding: 15px;
  gap: 4px;
}

.burger-button span {
  width: 18px;
  height: 2px;
}

.burger-button[aria-expanded="true"] {
  transform: none;
}

.burger-button[aria-expanded="true"] span:nth-child(1) {
  width: 19px;
  transform: translateY(6px) rotate(45deg);
}

.burger-button[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.burger-button[aria-expanded="true"] span:nth-child(3) {
  width: 19px;
  transform: translateY(-6px) rotate(-45deg);
}

.menu-panel {
  top: clamp(92px, 13vh, 145px);
  right: clamp(14px, 3vw, 42px);
  width: min(462px, calc(100vw - 32px));
  padding: clamp(16px, 2vw, 26px);
  border-width: 2px;
  border-radius: 42px;
}

.menu-item {
  min-height: clamp(74px, 8vw, 96px);
  margin-bottom: 14px;
  border-width: 2px;
  border-radius: 24px;
  padding: 0 clamp(20px, 3vw, 34px);
  gap: 22px;
  font-size: clamp(28px, 3.2vw, 40px);
}

.menu-item:last-child {
  margin-bottom: 0;
}

.menu-item::before {
  content: none !important;
}

.menu-icon {
  width: clamp(30px, 3.3vw, 42px);
  height: clamp(30px, 3.3vw, 42px);
  color: var(--green);
}

.image-empty {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.02), rgba(0, 0, 0, 0.28)),
    url("/assets/reference-preview.jpg") center / cover no-repeat;
}

.image-empty::before,
.image-empty p {
  display: none !important;
}

@media (max-width: 720px) {
  .menu-panel {
    top: 82px;
    border-radius: 34px;
  }

  .menu-item {
    min-height: 72px;
    font-size: clamp(25px, 8vw, 34px);
  }

  .menu-icon {
    width: 30px;
    height: 30px;
  }
}
