:root {
  color-scheme: light;
  --cream: #f6d38e;
  --cream-light: #fff5df;
  --cream-soft: #f9e6bd;
  --red: #781b24;
  --red-soft: #a63a44;
  --blue: #244d9a;
  --blue-soft: #7aa7bb;
  --orange: #f28610;
  --ink: #1f252c;
  --muted: #6d665b;
  --line: rgba(120, 27, 36, 0.18);
  --panel: rgba(255, 248, 232, 0.86);
  --shadow: 0 22px 60px rgba(120, 27, 36, 0.14);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  background: #fff8e8;
  color: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 16%, rgba(120, 27, 36, 0.16), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.45), transparent 26%),
    linear-gradient(120deg, #fff8e8 0%, #f7d895 48%, #f2c77a 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 86px minmax(340px, 410px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.side-rail {
  padding: 18px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 245, 222, 0.55);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  gap: 18px;
  min-height: 0;
}

.avatar-button {
  width: 54px;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 248, 232, 0.98) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 76%, rgba(255, 248, 232, 0.98) 0 30%, transparent 31%),
    var(--red);
  color: #fff5df;
  box-shadow: 0 14px 34px rgba(120, 27, 36, 0.24);
  transition:
    box-shadow 150ms ease,
    transform 150ms ease;
}

.avatar-button:hover,
.rail-button:hover {
  transform: translateY(-2px);
}

.avatar-button.active,
.avatar-button:active {
  box-shadow:
    0 0 0 5px rgba(120, 27, 36, 0.1),
    0 16px 36px rgba(120, 27, 36, 0.26);
}

.rail-main,
.rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail-button {
  width: 54px;
  min-height: 54px;
  border: 1px solid rgba(120, 27, 36, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--red);
  display: grid;
  place-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    0 10px 24px rgba(120, 27, 36, 0.08);
  transition:
    background 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.rail-button:hover {
  background: rgba(255, 255, 255, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 14px 30px rgba(120, 27, 36, 0.16);
}

.rail-button.active {
  border-color: rgba(120, 27, 36, 0.24);
  background: rgba(120, 27, 36, 0.92);
  color: #fff7e8;
  box-shadow:
    0 0 0 5px rgba(120, 27, 36, 0.08),
    0 16px 32px rgba(120, 27, 36, 0.2);
}

.rail-button svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.control-pane {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background: rgba(255, 246, 225, 0.68);
  border-right: 1px solid rgba(120, 27, 36, 0.12);
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.app-header h1 {
  margin: 0;
  color: var(--blue);
  font-size: 26px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}

.app-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.prompt-field {
  border-radius: 26px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.prompt-field::after {
  content: "edit";
  position: absolute;
  right: -10px;
  top: 8px;
  color: rgba(120, 27, 36, 0.07);
  font-size: 76px;
  line-height: 1;
  font-weight: 950;
}

.prompt-field > span,
.source-image-header,
.negative-field > span,
.section-title {
  color: var(--red);
  font-weight: 950;
}

.prompt-field > span,
.negative-field > span {
  position: relative;
  z-index: 1;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid rgba(120, 27, 36, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
  outline: none;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--red) 50%) calc(100% - 20px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--red) 50%, transparent 50%) calc(100% - 15px) 52% / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  padding-right: 40px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(120, 27, 36, 0.06);
  cursor: pointer;
}

select:hover {
  background:
    linear-gradient(45deg, transparent 50%, var(--blue) 50%) calc(100% - 20px) 52% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--blue) 50%, transparent 50%) calc(100% - 15px) 52% / 6px 6px no-repeat,
    rgba(255, 255, 255, 0.86);
  border-color: rgba(120, 27, 36, 0.24);
  transform: translateY(-1px);
}

select option {
  background: #fff8e8;
  color: var(--ink);
}

textarea {
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  line-height: 1.62;
  position: relative;
  z-index: 1;
}

.negative-field textarea {
  min-height: 82px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(36, 77, 154, 0.44);
  box-shadow: 0 0 0 4px rgba(36, 77, 154, 0.12);
}

.source-image-panel {
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.36);
  border: 1px dashed rgba(120, 27, 36, 0.24);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.source-image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.source-image-header button,
.secondary,
.tool-button,
.icon-button {
  min-height: 32px;
  border: 1px solid rgba(120, 27, 36, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--red);
  padding: 0 11px;
  font-weight: 800;
}

.tool-button {
  min-width: 38px;
  height: 36px;
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.tool-button:hover {
  background: rgba(255, 255, 255, 0.72);
}

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

.zoom-label {
  min-width: 66px;
  color: var(--red);
}

.source-image-drop {
  display: block;
  border: 1px solid rgba(120, 27, 36, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--muted);
  padding: 12px;
  cursor: pointer;
  font-size: 13px;
  text-align: center;
}

.source-image-drop input {
  display: none;
}

.source-image-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.source-image-preview[hidden] {
  display: none;
}

.source-image-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: 0 12px 26px rgba(120, 27, 36, 0.13);
}

.source-image-preview span {
  min-width: 0;
  color: var(--blue);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

select,
input {
  min-height: 42px;
  padding: 0 14px;
}

.current-model {
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  padding: 0 2px;
}

.generate-button,
button:not(.rail-button):not(.avatar-button):not(.tool-button):not(.icon-button):not(.secondary):not(.danger) {
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  color: #fff8ed;
  background: var(--red);
  font-weight: 950;
  box-shadow: 0 18px 38px rgba(120, 27, 36, 0.26);
}

button:disabled {
  opacity: 0.62;
  cursor: wait;
}

button.danger,
.danger {
  background: var(--red-soft);
  color: #fff7e8;
}

.status {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: var(--red);
  padding: 11px 12px;
  font-size: 13px;
}

.status.running {
  border-color: rgba(242, 134, 16, 0.28);
  background: rgba(242, 134, 16, 0.1);
  color: #7a3f00;
}

.status.success {
  border-color: rgba(36, 77, 154, 0.18);
  background: rgba(255, 255, 255, 0.5);
  color: var(--blue);
}

.status.error {
  border-color: rgba(120, 27, 36, 0.32);
  background: rgba(120, 27, 36, 0.08);
  color: var(--red);
}

.model-note {
  margin-top: 0;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.config-drawer {
  position: absolute;
  left: 86px;
  top: 14px;
  z-index: 30;
  width: min(390px, calc(100vw - 110px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 26px;
  background: rgba(255, 248, 232, 0.94);
  box-shadow: 0 26px 70px rgba(120, 27, 36, 0.2);
  padding: 16px;
}

.config-drawer[hidden] {
  display: none;
}

.drawer-header,
.section-title,
.button-row,
.dialog-actions,
.dialog-header,
.history-header,
.preview-toolbar,
.preview-actions {
  display: flex;
  align-items: center;
}

.drawer-header,
.section-title,
.dialog-header,
.history-header,
.preview-toolbar {
  justify-content: space-between;
  gap: 12px;
}

.drawer-header {
  margin-bottom: 12px;
  color: var(--red);
}

.management-stack,
.management-body,
.user-list,
.drawer-panel,
.settings-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-panel {
  animation: drawerPanelIn 160ms ease both;
}

.drawer-panel[hidden],
.button-row[hidden],
.settings-block[hidden] {
  display: none;
}

.account-card,
.account-stat,
.settings-block,
.model-panel {
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.4);
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.account-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.account-avatar {
  width: 58px;
  min-height: 58px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 248, 232, 0.98) 0 18%, transparent 19%),
    radial-gradient(circle at 50% 76%, rgba(255, 248, 232, 0.98) 0 30%, transparent 31%),
    var(--red);
  box-shadow: 0 14px 30px rgba(120, 27, 36, 0.2);
}

.account-card strong,
.settings-user strong,
.account-stat strong {
  display: block;
  color: var(--red);
  font-size: 20px;
  line-height: 1.2;
}

.account-card span,
.settings-user span,
.account-stat span {
  color: var(--muted);
  font-size: 12px;
}

.account-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.account-stat strong {
  color: var(--blue);
  font-size: 30px;
}

.wide-button {
  width: 100%;
  min-height: 42px;
}

.management-body {
  padding-top: 10px;
}

.settings-user {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.switch {
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: rgba(120, 27, 36, 0.12);
  padding: 3px;
  display: inline-flex;
  align-items: center;
}

.switch input {
  display: none;
}

.switch span {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 10px rgba(120, 27, 36, 0.16);
}

.disabled-switch {
  opacity: 0.52;
}

@keyframes drawerPanelIn {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.button-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.button-row button[hidden] {
  display: none;
}

.button-row button,
.dialog-actions button,
.mini-form button,
.history-delete {
  min-height: 36px;
  font-size: 13px;
}

.mini-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
}

.user-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  padding: 9px;
}

.user-item strong,
.user-item span,
.history-meta strong,
.history-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-item span,
.history-meta span,
.model-status {
  color: var(--muted);
  font-size: 12px;
}

.model-status.running {
  color: #7a3f00;
}

.model-status.success {
  color: var(--blue);
}

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

.preview-pane {
  min-width: 0;
  padding: 22px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  min-height: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.preview-toolbar {
  color: var(--red);
  font-weight: 950;
}

.preview-toolbar > span {
  font-size: 24px;
}

.preview-actions {
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.download.disabled {
  color: var(--muted);
  pointer-events: none;
}

.canvas {
  min-height: 0;
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px),
    rgba(255, 246, 225, 0.42);
  background-size: 34px 34px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: auto;
}

.canvas::before {
  content: "Red before edit";
  position: absolute;
  left: 38px;
  top: 34px;
  color: rgba(120, 27, 36, 0.1);
  font-size: clamp(42px, 8vw, 104px);
  font-weight: 950;
  pointer-events: none;
}

.canvas-actions {
  position: absolute;
  right: 22px;
  bottom: 18px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-action {
  min-height: 38px;
  border: 0;
  border-radius: 999px;
  padding: 0 15px;
  background: var(--red);
  color: #fff8ed;
  font-size: 13px;
  font-weight: 950;
  box-shadow: 0 14px 30px rgba(120, 27, 36, 0.28);
  text-decoration: none;
  display: inline-grid;
  place-items: center;
}

.canvas-action.download {
  width: 40px;
  padding: 0;
}

.canvas-action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canvas-action.disabled,
.canvas-action:disabled {
  opacity: 0.55;
  pointer-events: none;
}

.empty-state {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.52);
  padding: 10px 14px;
  border-radius: 999px;
  position: relative;
  z-index: 1;
}

.single-result-frame {
  position: relative;
  display: grid;
  place-items: center;
  max-width: 100%;
  max-height: calc(100vh - 130px);
  z-index: 1;
}

.single-result-frame[hidden],
.result-grid[hidden] {
  display: none;
}

#resultImage {
  max-width: 100%;
  max-height: calc(100vh - 130px);
  object-fit: contain;
  border-radius: 30px;
  box-shadow: 0 30px 80px rgba(120, 27, 36, 0.24);
  transform-origin: center;
  transition: transform 160ms ease;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: element;
}

#resultImage.zoomed {
  max-width: none;
  max-height: none;
  cursor: move;
}

.result-grid {
  width: 100%;
  height: 100%;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(var(--result-tile-size, 180px), 1fr));
  gap: 14px;
  align-content: start;
  overflow: auto;
  z-index: 1;
}

.result-item {
  position: relative;
  min-height: 0;
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.48);
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.result-item.selected {
  border-color: var(--red);
}

.result-item:focus-visible {
  outline: 3px solid rgba(120, 27, 36, 0.18);
  outline-offset: 2px;
}

.result-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.result-item span {
  position: absolute;
  top: 8px;
  left: 8px;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(120, 27, 36, 0.86);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 900;
}

.revised {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.history-panel {
  border-radius: 26px;
  background: rgba(255, 248, 232, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.52);
  padding: 12px;
  min-height: 0;
  overflow: hidden;
}

.history-header {
  color: var(--red);
  font-weight: 950;
  margin-bottom: 8px;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  max-height: 150px;
  overflow: auto;
  padding-right: 2px;
}

.history-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 10px 0;
}

.history-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  padding: 8px;
  position: relative;
}

.history-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: rgba(120, 27, 36, 0.16);
}

.history-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.history-thumb span {
  position: absolute;
  left: 6px;
  top: 6px;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(120, 27, 36, 0.86);
  color: #ffffff;
  font-size: 11px;
}

.history-delete {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  font-size: 0;
}

.history-delete::before {
  content: "×";
  font-size: 18px;
  line-height: 1;
}

.history-item:hover .history-delete,
.history-item:focus-within .history-delete {
  opacity: 1;
  transform: translateY(0);
}

.history-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-meta strong {
  color: var(--red);
  font-size: 13px;
}

dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 24px;
  padding: 0;
  box-shadow: 0 24px 80px rgba(120, 27, 36, 0.24);
}

dialog::backdrop {
  background: rgba(54, 19, 16, 0.32);
}

.dialog-panel,
.image-dialog-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--cream-light);
}

.dialog-header h2 {
  margin: 0;
  color: var(--red);
  font-size: 18px;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
}

.image-dialog {
  width: min(1200px, calc(100vw - 36px));
  height: min(900px, calc(100vh - 36px));
}

.image-dialog-panel {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.image-dialog-canvas {
  min-height: 0;
  border-radius: 24px;
  background: rgba(255, 246, 225, 0.5);
  display: grid;
  place-items: center;
  overflow: auto;
}

.image-dialog-canvas img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.login-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 16%, rgba(120, 27, 36, 0.16), transparent 28%),
    linear-gradient(120deg, #fff8e8 0%, #f7d895 100%);
  display: grid;
  place-items: center;
  padding: 18px;
}

.login-shell {
  width: min(420px, 100%);
}

.login-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 0;
  color: var(--blue);
  font-size: 26px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

  .control-pane {
    border-right: 0;
  }

  .grid,
  .grid.two,
  .mini-form {
    grid-template-columns: 1fr;
  }

  .preview-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .preview-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .config-drawer {
    left: 14px;
    width: calc(100vw - 28px);
  }
}
