/*
  Neodisco / RAS stüdyo dili. Referans: vggtq/src/site.css ve vgpu-umaps/index.html.
  Kullanıcının seçimi: Foundry Gridnik, mutlak siyah, monokrom gri rampası,
  keskin köşeler ve ince ölçüm çizgileri. Kişisel Cobanov ev stili burada uygulanmaz.
  Renk yalnızca üretilen görüntüde; vurgu #d8d8d8 / #000 kontrastı 14.7:1.
  Etkileşim tek merkezde kalır: kadraj, prompt, üretim, geçmiş.
*/
@font-face {
  font-family: "Foundry Gridnik";
  src: url("fonts/FoundryGridnik-Light.woff2") format("woff2");
  font-weight: 300;
  font-display: swap;
}
@font-face {
  font-family: "Foundry Gridnik";
  src: url("fonts/FoundryGridnik-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Foundry Gridnik";
  src: url("fonts/FoundryGridnik-Medium.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #000;
  --surface: #0a0a0a;
  --surface-2: #141414;
  --ink: #d8d8d8;
  --muted: #999;
  --line: #1e1e1e;
  --line-strong: #2e2e2e;
  --accent: #d8d8d8;
  --accent-hover: #fff;
  --accent-quiet: rgb(216 216 216 / 8%);
  --on-accent: #000;
  --gutter: 24px;
  --measure: 1360px;
  --prose: 66ch;
  --radius: 2px;
  --radius-sm: 2px;
  --pill: 2px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --section-y: 24px;
  --step--1: 0.8125rem;
  --step-0: 0.875rem;
  --step-1: 1rem;
  --step-2: 1.25rem;
  --step-3: 1.75rem;
  --step-4: 2.5rem;
  --sans:
    "Foundry Gridnik", "Gridnik", ui-monospace, SFMono-Regular, Menlo, monospace;
  --mono: var(--sans);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::after {
  content: none;
}
[hidden] {
  display: none !important;
}

button,
input,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
textarea {
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
::selection {
  background: rgb(216 216 216 / 28%);
}
.mono,
.ratios {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2 {
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: 8px;
  left: -9999px;
  z-index: 200;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 16px;
}
.skip:focus {
  left: 16px;
}
.masthead {
  height: 88px;
  display: flex;
  align-items: flex-start;
  padding: 16px 42px 0;
  gap: 24px;
}
.wordmark {
  display: inline-block;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
}
.wordmark svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}
.masthead-caption {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
}
.nav-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.nav-icon svg {
  fill: currentColor;
  width: 19px;
  height: 19px;
}
.studio {
  width: min(var(--measure), 100% - 112px);
  margin: 0 auto;
  height: calc(100dvh - 120px);
  min-height: 640px;
  display: flex;
  flex-direction: column;
}
.stage {
  flex: 1;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  padding-top: 24px;
}
.canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state {
  text-align: center;
  padding: 24px;
}
.empty-state h1 {
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 300;
  letter-spacing: 0.16em;
  line-height: 1.4;
}
.empty-state p {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  margin-top: 16px;
}
.image-area {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#artwork {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: none;
}
.image-loading {
  position: absolute;
  padding: 8px 16px;
  border-radius: var(--pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
}
.canvas-status {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#result-meta {
  color: var(--muted);
  font-size: 10px;
}
.text-button {
  padding: 10px 0;
  min-height: 44px;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.text-button:hover:not(:disabled) {
  color: var(--accent);
}
.secondary {
  min-height: 44px;
  border: 1px solid var(--line-strong);
  background: none;
  color: var(--ink);
  border-radius: var(--pill);
  padding: 8px 16px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.secondary:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: var(--muted);
}
.progress {
  width: min(440px, 100%);
}
.progress-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}
.progress-heading .mono {
  color: var(--muted);
  font-size: 10px;
}
#progress-step {
  margin-left: auto;
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}
progress {
  display: block;
  width: 100%;
  height: 2px;
  margin: 10px 0 0;
  border: 0;
  border-radius: var(--pill);
  background: var(--surface-2);
  accent-color: var(--accent);
}
progress::-webkit-progress-bar {
  background: var(--surface-2);
}
progress::-webkit-progress-value {
  background: var(--accent);
}
progress::-moz-progress-bar {
  background: var(--accent);
}
.composer {
  width: min(780px, 100%);
  margin: 0 auto;
  flex: none;
  padding: 0 0 20px;
}
fieldset {
  margin: 0 0 16px;
  padding: 0;
  border: 0;
  min-width: 0;
}
.ratios {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.ratios button {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--pill);
  font: 11px var(--mono);
  padding: 0 16px;
}
.ratios i {
  display: block;
  height: 13px;
  max-width: 23px;
  border: 1px solid currentColor;
  border-radius: 2px;
}
.ratios button[aria-pressed="true"] {
  color: var(--on-accent);
  border-color: var(--accent);
  background: var(--accent);
}
.ratios button:hover:not(:disabled) {
  background: var(--surface-2);
}
.prompt-box {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 16px 16px 24px;
  background: #080808;
  border: 1px solid #333;
  border-radius: 2px;
  transition: border-color 0.2s var(--ease);
}
.prompt-box:focus-within {
  border-color: #888;
}
textarea {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 4px 0;
  height: 56px;
  resize: none;
  line-height: 1.6;
  font-size: 15px;
  max-height: 116px;
}
.prompt-box textarea:focus-visible {
  outline: none;
}
textarea::placeholder {
  color: var(--muted);
}
.primary {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: var(--accent);
  color: #000;
  padding: 0 20px;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.primary svg {
  width: 20px;
  height: 20px;
}
.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}
.prompt-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 2px 8px 0;
}
.hint {
  color: var(--muted);
  font-size: 10px;
}
.error {
  padding: 12px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-top: 8px;
  overflow-wrap: anywhere;
}
.history {
  flex: none;
  padding: 8px 0 16px;
  border-top: 1px solid var(--line);
}
.history-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  height: 44px;
  margin-bottom: 4px;
}
.history h2 {
  font-size: 11px;
  letter-spacing: 0;
  font-weight: 500;
}
#history-count {
  font-size: 10px;
  color: var(--muted);
}
#new {
  margin-left: auto;
}
#refresh {
  margin-left: 12px;
}
.rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 3px 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.thumb {
  flex: 0 0 110px;
  height: 72px;
  border: 2px solid transparent;
  padding: 2px;
  background: transparent;
  border-radius: var(--radius-sm);
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.thumb[aria-pressed="true"] {
  border-color: var(--accent);
}
.thumb:hover:not(:disabled) {
  border-color: var(--muted);
}
.history-empty {
  color: var(--muted);
  font-size: 11px;
  padding: 16px 0 24px;
}
dialog {
  background: var(--surface);
  color: var(--ink);
  width: min(560px, calc(100% - 32px));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
  max-height: 85dvh;
}
dialog::backdrop {
  background: rgb(0 0 0 / 70%);
  backdrop-filter: blur(6px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.dialog-head h2 {
  font-size: 20px;
}
#rec-prompt {
  font-size: 13px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
dl {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px 16px;
  font-size: 12px;
  margin: 24px 0;
}
dt {
  color: var(--muted);
}
dd {
  margin: 0;
  overflow-wrap: anywhere;
  font: 11px/1.6 var(--mono);
  white-space: pre-line;
}
summary {
  cursor: pointer;
  font-size: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
@keyframes pulse {
  50% {
    opacity: 0.4;
  }
}
@media (max-height: 800px) and (min-width: 901px) {
  .stage {
    padding-top: 16px;
  }
  .empty-state h1 {
    font-size: 32px;
  }
  .empty-state p {
    margin-top: 12px;
  }
  .composer {
    padding-bottom: 12px;
  }
  fieldset {
    margin-bottom: 8px;
  }
}
@media (max-width: 900px) {
  .masthead {
    height: 56px;
    padding: 0 20px;
  }
  .masthead-caption {
    font-size: 10px;
    padding-left: 12px;
  }
  .masthead {
    gap: 12px;
  }
  .header-actions {
    gap: 0;
  }
  .studio {
    width: calc(100% - 32px);
    height: calc(100dvh - 56px);
    min-height: 640px;
  }
  .stage {
    padding-top: 16px;
    min-height: 240px;
  }
  .empty-state {
    padding: 16px;
  }
  .empty-state h1 {
    font-size: 22px;
  }
  .empty-state p {
    font-size: 12px;
    margin-top: 12px;
  }
  .composer {
    padding-bottom: 12px;
  }
  .ratios {
    gap: 2px;
  }
  .ratios button {
    flex: 1;
    padding: 0 6px;
    font-size: 10px;
    gap: 6px;
  }
  .ratios i {
    height: 10px;
    max-width: 18px;
  }
  fieldset {
    margin-bottom: 12px;
  }
  .prompt-box {
    gap: 12px;
    padding: 12px 12px 12px 16px;
    border-radius: 2px;
  }
  textarea {
    font-size: 16px;
    height: 58px;
  }
  .primary {
    min-width: 48px;
    padding: 0 14px;
    gap: 8px;
    font-size: 12px;
  }
  .primary svg {
    width: 18px;
  }
  .prompt-footer {
    padding: 2px 0 0;
    gap: 8px;
  }
  .prompt-footer .text-button {
    font-size: 10px;
  }
  .hint {
    font-size: 9px;
  }
  .canvas-status {
    height: 54px;
  }
  .result-actions {
    gap: 12px;
  }
  #result-meta {
    font-size: 9px;
  }
  .result-actions .secondary {
    padding: 8px 12px;
    font-size: 10px;
  }
  .history {
    padding-bottom: 8px;
  }
  .thumb {
    flex-basis: 92px;
    height: 64px;
  }
}
@media (max-width: 380px) {
  .masthead-caption {
    display: none;
  }
  .ratios i {
    display: none;
  }
  .primary {
    padding: 0 12px;
  }
  .primary svg {
    display: none;
  }
  .empty-state h1 {
    font-size: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.waiting-state h1 {
  font-size: clamp(23px, 2.8vw, 36px);
}

.frame-title {
  margin-left: auto;
  text-align: right;
}
.frame-kicker {
  display: block;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.2em;
}
.frame-name {
  display: block;
  margin-top: 2px;
  font-size: 25px;
  font-weight: 300;
  letter-spacing: 0.1em;
}
.frame-rail {
  position: fixed;
  top: 120px;
  writing-mode: vertical-rl;
  font-size: 9px;
  color: #999;
  letter-spacing: 0.2em;
  pointer-events: none;
}
.frame-rail-left {
  left: 12px;
  transform: rotate(180deg);
}
.frame-rail-right {
  right: 12px;
}
.frame-ticks {
  position: fixed;
  top: 90px;
  bottom: 60px;
  left: 34px;
  width: 5px;
  pointer-events: none;
  background: repeating-linear-gradient(
    180deg,
    #2e2e2e 0 1px,
    transparent 1px 140px
  );
}
.frame-credit {
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 42px;
  color: #999;
  font-size: 9px;
  letter-spacing: 0.2em;
}
.history h2 {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.thumb img {
  opacity: 0.6;
  transition: opacity 0.2s var(--ease);
}
.thumb:hover img,
.thumb[aria-pressed="true"] img {
  opacity: 1;
}
.waiting-state h1 {
  font-size: clamp(20px, 2vw, 28px);
}
@media (max-height: 800px) and (min-width: 901px) {
  .empty-state h1 {
    font-size: 24px;
  }
}
@media (max-width: 900px) {
  .masthead {
    height: 76px;
    padding: 14px 20px 0;
    gap: 8px;
  }
  .wordmark {
    font-size: 10px;
    letter-spacing: 0.12em;
  }
  .masthead-caption {
    border: 0;
    padding: 0;
    margin-top: 6px;
    font-size: 8px;
  }
  .frame-title {
    display: none;
  }
  .header-actions {
    margin-left: auto;
  }
  .studio {
    width: calc(100% - 40px);
    height: calc(100dvh - 108px);
    min-height: 620px;
  }
  .frame-rail,
  .frame-ticks {
    display: none;
  }
  .frame-credit {
    margin: 0 20px;
    font-size: 8px;
  }
  .empty-state h1 {
    font-size: 22px;
    letter-spacing: 0.12em;
  }
  .empty-state p {
    font-size: 10px;
  }
  .prompt-box {
    border-radius: 2px;
  }
  .primary {
    font-size: 10px;
  }
}

/* The compose frame is fitted to available space without stretching old results. */
#empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.frame-preview {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid #333;
  background: #050505;
  color: var(--ink);
}
#frame-size {
  font-size: 13px;
  letter-spacing: 0.12em;
}
.frame-hint {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.16em;
}

/* Workspace: shared outer alignment, separated header, readable side panels. */
.masthead {
  height: 88px;
  margin: 0 32px;
  padding: 0;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line-strong);
}
.frame-brand {
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.wordmark {
  border: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.12em;
}
.masthead-caption {
  margin: 0;
  padding: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
}
.frame-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.1em;
}
.header-actions {
  margin-left: 0;
}
.studio {
  width: calc(100% - 64px);
  max-width: none;
  height: calc(100dvh - 152px);
  min-height: 500px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 280px;
  grid-template-areas: "history work record";
  gap: 0;
  margin: 24px 32px 0;
}
.frame-credit {
  height: 40px;
  margin: 0 32px;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.work-area {
  grid-area: work;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 24px;
}
.stage {
  padding: 0;
  min-height: 180px;
}
.image-area,
#empty {
  align-items: flex-end;
}
.canvas-status {
  height: auto;
  min-height: 0;
  padding: 0;
}
.canvas-status:has(.progress:not([hidden])) {
  padding-top: 12px;
}
.composer {
  width: min(840px, 100%);
  padding: 8px 0 0;
  margin: 0 auto;
}
fieldset {
  margin: 0 0 8px;
}
.ratios button {
  font-size: 12px;
}
.prompt-box {
  padding: 10px 12px 10px 16px;
  gap: 16px;
}
textarea {
  height: 48px;
}
.primary {
  font-size: 12px;
  letter-spacing: 0.1em;
}
.prompt-footer {
  min-height: 44px;
  padding: 0;
  gap: 12px;
}
.prompt-footer .text-button {
  min-height: 44px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
#next-size {
  margin-left: auto;
  font-size: 11px;
}
#new {
  margin-left: 8px;
  white-space: nowrap;
}
.history {
  grid-area: history;
  min-height: 0;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 12px 0 0;
  display: flex;
  flex-direction: column;
}
.history-heading {
  flex: none;
  height: 68px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  align-content: flex-start;
  gap: 0 6px;
  margin: 0;
  padding-top: 2px;
}
.history h2,
.record h2,
.record h3 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#history-count {
  font-size: 11px;
}
#refresh {
  margin: 0;
  min-height: 44px;
  width: 100%;
  padding: 8px 0;
  text-align: left;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.rail {
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2px;
  gap: 12px;
}
.thumb {
  flex: none;
  width: 100%;
  height: auto;
  min-height: 48px;
  padding: 2px;
}
.thumb img {
  height: auto;
  max-height: 144px;
  object-fit: contain;
}
.history-empty {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.record {
  grid-area: record;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 0 0 24px;
  border-left: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.record-heading {
  flex: none;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding-top: 2px;
}
.record-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.record-body::-webkit-scrollbar {
  width: 4px;
}
.record-body::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 2px;
}
#rec-id {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
#rec-prompt {
  font-size: 14px;
  line-height: 1.65;
}
.record dl {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 20px 0;
  font-size: 13px;
}
.record dd {
  font-size: 13px;
  line-height: 1.6;
}
.record-model {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.result-actions {
  flex: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
}
#rec-png {
  grid-column: 1 / -1;
}
.result-actions .secondary {
  min-width: 0;
  padding: 8px;
}
.result-actions .secondary {
  font-size: 12px;
  letter-spacing: 0.06em;
}
.frame-rail,
.frame-ticks {
  display: none;
}
@media (min-width: 1700px) {
  .studio {
    grid-template-columns: 120px minmax(0, 1fr) 296px;
  }
}
@media (min-width: 901px) and (max-width: 1200px) {
  .masthead {
    margin: 0 24px;
  }
  .studio {
    width: calc(100% - 48px);
    margin: 24px 24px 0;
    grid-template-columns: 100px minmax(0, 1fr) 256px;
  }
  .record {
    padding-left: 16px;
  }
  .work-area {
    padding: 0 16px;
  }
  .ratios {
    gap: 0;
  }
  .ratios button {
    flex: 1;
    padding: 0 6px;
    gap: 4px;
  }
  .ratios i {
    display: none;
  }
  .frame-credit {
    margin: 0 24px;
  }
  #history-count {
    display: none;
  }
  .prompt-footer {
    flex-wrap: wrap;
    gap: 0 12px;
  }
}
@media (max-width: 900px) {
  .masthead {
    height: 80px;
    margin: 0 16px;
    gap: 12px;
  }
  .frame-brand {
    display: block;
  }
  .wordmark {
    font-size: 20px;
  }
  .masthead-caption {
    display: block;
    font-size: 10px;
    margin-top: 6px;
  }
  .frame-title {
    display: none;
  }
  .header-actions {
    margin-left: auto;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "work" "history" "record";
    height: auto;
    min-height: 0;
    width: calc(100% - 32px);
    margin: 20px 16px 0;
  }
  .work-area {
    padding: 0;
    height: auto;
    min-height: 0;
  }
  .stage {
    flex: none;
    height: min(60dvh, calc((100vw - 32px) / var(--canvas-ratio, 1.666667)));
    min-height: 180px;
    padding: 0;
  }
  .composer {
    padding: 8px 0 0;
  }
  .ratios {
    gap: 0;
  }
  .ratios button {
    padding: 0 4px;
    gap: 4px;
  }
  .prompt-box {
    padding: 10px 10px 10px 14px;
  }
  .prompt-footer {
    gap: 0 10px;
    flex-wrap: wrap;
  }
  #new {
    margin-left: 0;
  }
  #next-size {
    width: auto;
    margin-left: auto;
    padding: 0;
    text-align: right;
  }
  .history {
    border-right: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 20px;
    margin-top: 12px;
  }
  .history-heading {
    height: 44px;
    align-items: baseline;
    align-content: center;
    gap: 8px;
    padding: 0;
  }
  #refresh {
    width: auto;
    margin-left: auto;
  }
  .rail {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    height: 88px;
    flex: none;
  }
  .thumb {
    width: auto;
    height: 80px;
    min-width: 48px;
  }
  .thumb img {
    width: auto;
    height: 100%;
    max-height: none;
  }
  .record {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 24px 0 0;
    overflow: visible;
  }
  .record-heading {
    min-height: 64px;
  }
  .record dl {
    grid-template-columns: 112px minmax(0, 1fr);
    font-size: 14px;
  }
  .record dd {
    font-size: 14px;
  }
  #rec-prompt {
    max-height: none;
  }
  .record-body {
    overflow: visible;
    flex: none;
  }
  .result-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .frame-credit {
    height: 56px;
    margin: 0 16px;
    font-size: 9px;
  }
}
