.app-shell {
  min-height: 100vh;
  overflow: hidden;
}

.studio-header {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 26px;
  align-items: center;
  min-height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 0 32px;
}

.brand,
.product-title,
.header-controls,
.brand-copy,
.product-title > span:last-child,
.key-status,
.batch-summary,
.storage-status,
.selected-meta {
  display: flex;
  align-items: center;
}

.brand {
  width: max-content;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.brand-copy,
.product-title > span:last-child {
  align-items: flex-start;
  flex-direction: column;
  min-width: 0;
  margin-left: 11px;
}

.brand-copy strong {
  font-size: 20px;
  line-height: 1.1;
}

.brand-copy small,
.product-title small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.product-title {
  min-width: max-content;
  border-left: 1px solid var(--line);
  padding-left: 26px;
}

.product-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--deep);
  color: var(--cyan);
}

.product-mark svg {
  width: 21px;
  height: 21px;
}

.product-title strong {
  font-size: 17px;
  line-height: 1.1;
}

.header-controls {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.preview-badge {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-color: #eed6a7;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.key-status.is-ready {
  border-color: #bfe8d8;
  background: var(--green-soft);
  color: var(--green);
}

.key-status {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  padding: 0 9px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #aab4c2;
  box-shadow: 0 0 0 3px rgba(170, 180, 194, 0.13);
}

.is-ready .status-dot,
.storage-status[data-mode="compatible"] .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(22, 143, 100, 0.12);
}

.storage-status[data-mode="compat-readonly"] .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(184, 108, 18, 0.12);
}

.storage-status[data-mode="unavailable"] .status-dot {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(189, 63, 80, 0.12);
}

.key-status .status-dot {
  margin-right: 7px;
}

.icon-button,
.tool-button,
.field-icon-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-soft);
  padding: 0;
  text-decoration: none;
}

.icon-button {
  grid-auto-flow: column;
  width: 42px;
  height: 42px;
  gap: 3px;
}

.icon-button svg,
.tool-button svg,
.field-icon-button svg,
.command-button svg,
.generate-button svg,
.dialog-icon svg {
  width: 17px;
  height: 17px;
}

.icon-button:hover,
.tool-button:hover,
.field-icon-button:hover {
  border-color: #96a8bd;
  background: var(--paper);
  color: var(--ink);
}

#language-label {
  font-size: 11px;
  font-weight: 850;
}

.history-trigger {
  position: relative;
}

.history-count {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 999px;
  background: var(--blue);
  color: var(--white);
  padding: 0 4px;
  font-size: 9px;
  font-weight: 850;
}

.mobile-view-tabs,
.mobile-generate-bar {
  display: none;
}

.studio-layout {
  position: relative;
  display: grid;
  grid-template-columns: var(--composer-width) minmax(0, 1fr);
  height: calc(100vh - var(--header-height));
  min-height: 540px;
}

.composer-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--white);
  overflow: hidden;
}

#generation-form {
  display: block;
  min-height: 0;
  padding: 4px 28px 38px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.form-section {
  padding: 25px 0;
  border-bottom: 1px solid var(--line);
}

.form-section:last-of-type {
  border-bottom: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 30px;
  margin-bottom: 16px;
}

.section-heading > div,
.section-actions {
  display: flex;
  align-items: center;
}

.section-heading > div {
  align-items: baseline;
  min-width: 0;
}

.section-actions {
  gap: 10px;
}

.section-index {
  margin-right: 11px;
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
  font-weight: 850;
}

.section-heading h2,
.workspace-header h1,
.history-header h2,
.confirm-dialog h2 {
  margin: 0;
  color: var(--ink);
  letter-spacing: 0;
}

.section-heading h2 {
  font-size: 16px;
  line-height: 1.2;
}

.text-button {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 4px 0;
  font-size: 12px;
  font-weight: 800;
}

.danger-text {
  color: var(--red);
}

.input-with-actions {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

input[type="password"],
input[type="text"],
input[type="url"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  outline: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input[type="password"],
input[type="text"],
input[type="url"],
select {
  min-height: 46px;
  padding: 9px 12px;
  font-size: 14px;
}

#api-key {
  padding-right: 48px;
  padding-left: 40px;
  font-family: ui-monospace, "Cascadia Code", monospace;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(50, 103, 214, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: #95a0b0;
}

.field-icon-button {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 36px;
  height: 36px;
  border-color: transparent;
}

.check-control,
.switch-control {
  display: grid;
  align-items: center;
  cursor: pointer;
}

.check-control {
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 12px;
  color: var(--ink-soft);
  font-size: 12px;
}

.check-control input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--blue);
}

.check-control small {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
}

.counter {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
}

textarea {
  min-height: 172px;
  resize: vertical;
  padding: 14px 15px;
  font-size: 14px;
  line-height: 1.62;
}

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.reference-actions,
.result-commands,
.workspace-actions,
.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.command-button,
.small-button,
.danger-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-soft);
  padding: 8px 13px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.command-button:hover,
.small-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.command-button.compact {
  min-height: 32px;
  padding: 5px 9px;
}

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

.reference-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 12px;
}

.reference-preview {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  min-height: 78px;
  margin-top: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 9px;
  overflow: hidden;
}

.reference-preview:not(.is-empty) {
  border-style: solid;
  background: var(--white);
}

.reference-preview img,
.reference-placeholder {
  width: 58px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--white);
}

.reference-preview img {
  display: block;
  object-fit: cover;
}

.reference-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.reference-placeholder svg {
  width: 20px;
  height: 20px;
}

.reference-preview div {
  min-width: 0;
}

.reference-preview strong,
.reference-preview small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reference-preview strong {
  font-size: 13px;
}

.reference-preview small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.model-field {
  display: block;
  margin-bottom: 18px;
}

.model-field > span,
.option-field legend,
.select-grid label > span {
  display: block;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.model-field select {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-weight: 750;
}

.option-field {
  min-width: 0;
  margin: 0 0 18px;
  border: 0;
  padding: 0;
}

.segmented {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  gap: 1px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--line-strong);
  overflow: hidden;
}

.segmented label {
  position: relative;
  min-width: 0;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: grid;
  min-height: 42px;
  place-items: center;
  background: var(--white);
  color: var(--ink-soft);
  padding: 8px;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.segmented input:checked + span {
  background: var(--deep);
  color: var(--white);
}

.segmented input:focus-visible + span {
  box-shadow: inset 0 0 0 2px var(--cyan);
}

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

.select-grid label {
  min-width: 0;
}

.select-grid select {
  font-size: 13px;
}

.advanced-settings {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.advanced-settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings summary svg {
  width: 15px;
  height: 15px;
  transition: transform 150ms ease;
}

.advanced-settings[open] summary svg {
  transform: rotate(180deg);
}

.switch-control {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0 10px;
  margin-top: 14px;
}

.switch-control input {
  position: absolute;
  opacity: 0;
}

.switch-track {
  position: relative;
  grid-row: 1;
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #b9c3d0;
  transition: background 150ms ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 4px rgba(18, 23, 34, 0.2);
  transition: transform 150ms ease;
}

.switch-control input:checked + .switch-track {
  background: var(--blue);
}

.switch-control input:checked + .switch-track::after {
  transform: translateX(16px);
}

.switch-control > span:last-child {
  grid-column: 2;
  grid-row: 1;
}

.switch-control strong,
.switch-control small {
  display: block;
}

.switch-control strong {
  font-size: 13px;
}

.switch-control small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.form-alert {
  margin: 4px 0 12px;
  border: 1px solid #efc4ca;
  border-radius: var(--radius);
  background: var(--red-soft);
  color: var(--red);
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.generate-button {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #24b8d0;
  border-radius: var(--radius);
  background: var(--cyan);
  color: #06232a;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 8px 20px rgba(66, 214, 236, 0.2);
}

.generate-button:hover {
  background: #57def1;
  box-shadow: 0 10px 24px rgba(66, 214, 236, 0.28);
}

.generate-button:disabled {
  box-shadow: none;
}

.button-quantity {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  background: rgba(8, 12, 19, 0.12);
  padding: 0 6px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
}

.composer-footer {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 16px 24px;
  box-shadow: 0 -8px 24px rgba(18, 23, 34, 0.05);
}

.workspace-panel {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: var(--paper);
  overflow: hidden;
}

.workspace-header { grid-row: 1; }
.batch-strip { grid-row: 2; }
.result-stage { grid-row: 3; }
.result-toolbar { grid-row: 4; }

.workspace-header {
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 247, 250, 0.96);
  padding: 18px 28px;
}

.workspace-heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.workspace-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
  font-weight: 850;
}

.workspace-header h1,
.history-header h2 {
  font-size: 22px;
  line-height: 1.15;
}

.tool-button {
  width: 38px;
  height: 38px;
}

.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--line-strong);
}

.zoom-value {
  min-width: 42px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 11px;
  text-align: center;
}

.batch-strip {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 10px 24px;
}

.batch-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin-right: 10px;
  border: 2px solid #c7edf3;
  border-top-color: var(--cyan-dark);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.batch-strip.is-complete .batch-spinner {
  border-color: var(--green);
  background: var(--green-soft);
  animation: none;
}

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

.batch-summary strong,
.batch-summary small {
  display: block;
}

.batch-summary strong {
  font-size: 13px;
}

.batch-summary small {
  margin-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
}

.batch-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.batch-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan-dark);
  transition: width 180ms ease;
}

.result-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 26px 28px;
  overflow: auto;
}

.empty-state {
  position: absolute;
  inset: 26px 28px;
  display: grid;
  place-content: center;
  justify-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--cyan-dark);
  box-shadow: var(--shadow-sm);
}

.empty-mark svg {
  width: 32px;
  height: 32px;
}

.empty-state strong {
  color: var(--ink);
  font-size: 19px;
}

.empty-state small {
  margin-top: 8px;
  font-size: 13px;
}

.empty-stats {
  display: flex;
  gap: 7px;
  margin-top: 20px;
}

.empty-stats span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  padding: 6px 10px;
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 100%;
}

.result-grid[data-count="1"] {
  grid-template-columns: minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  place-items: center;
}

.result-grid[data-count="1"] .result-card {
  width: min(100%, 820px);
  height: min(100%, 600px);
  min-height: 0;
}

.result-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 260px;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}

.result-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(50, 103, 214, 0.14), var(--shadow-sm);
}

.result-image-wrap {
  position: relative;
  display: grid;
  min-height: 0;
  place-items: center;
  background-color: #eef2f6;
  background-image: linear-gradient(45deg, #e3e8ee 25%, transparent 25%), linear-gradient(-45deg, #e3e8ee 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e3e8ee 75%), linear-gradient(-45deg, transparent 75%, #e3e8ee 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  overflow: hidden;
}

.result-card img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: scale(var(--image-scale, 1));
  transform-origin: center;
  transition: transform 150ms ease;
}

.result-card footer {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
}

.result-number {
  color: var(--ink);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
  font-weight: 800;
}

.result-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--green);
  font-size: 9px;
  font-weight: 800;
}

.result-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.result-placeholder {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
}

.result-placeholder.is-error {
  color: var(--red);
}

.result-placeholder .batch-spinner {
  margin: 0 0 10px;
}

.result-placeholder svg {
  width: 28px;
  height: 28px;
  margin-bottom: 10px;
}

.result-placeholder strong,
.result-placeholder small {
  display: block;
  text-align: center;
}

.result-placeholder small {
  max-width: 220px;
  margin-top: 5px;
  font-size: 9px;
  line-height: 1.4;
}

.result-toolbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 10px 24px;
}

.selected-meta {
  min-width: 0;
  align-items: flex-start;
  flex-direction: column;
}

.selected-meta strong {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 10px;
}

.selected-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.history-drawer {
  position: absolute;
  z-index: 50;
  top: 0;
  right: 0;
  bottom: 0;
  display: grid;
  width: min(420px, 92vw);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border-left: 1px solid var(--line);
  background: var(--white);
  box-shadow: -16px 0 40px rgba(18, 23, 34, 0.12);
  transform: translateX(105%);
  transition: transform 180ms ease;
}

.history-drawer.is-open {
  transform: translateX(0);
}

.drawer-scrim {
  position: absolute;
  z-index: 40;
  inset: 0;
  border: 0;
  background: rgba(8, 12, 19, 0.35);
}

.history-header {
  display: flex;
  min-height: 75px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 15px 18px;
}

.storage-status {
  gap: 10px;
  margin: 14px 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 10px 11px;
}

.storage-status > div {
  min-width: 0;
}

.storage-status strong,
.storage-status small {
  display: block;
}

.storage-status strong {
  font-size: 11px;
}

.storage-status small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.history-list {
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 0;
  margin-top: 12px;
  background: var(--line);
  overflow: auto;
}

.history-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--muted);
  font-size: 11px;
}

.history-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 94px;
  background: var(--white);
  padding: 10px 12px;
}

.history-item img,
.history-corrupt-thumb {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper);
  object-fit: cover;
}

.history-corrupt-thumb {
  display: grid;
  place-items: center;
  color: var(--red);
}

.history-item-copy {
  min-width: 0;
}

.history-item-copy strong,
.history-item-copy span,
.history-item-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-copy strong {
  font-size: 11px;
}

.history-item-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 9px;
}

.history-item-copy small {
  margin-top: 4px;
  color: var(--blue);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 8px;
}

.history-item-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item-actions .tool-button {
  width: 30px;
  height: 30px;
}

.history-footer {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding: 10px 18px;
}

.history-footer span {
  color: var(--muted);
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 9px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink-soft);
  padding: 11px 12px;
  box-shadow: var(--shadow-md);
  font-size: 11px;
  line-height: 1.45;
  animation: toast-in 160ms ease-out;
}

.toast > svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.toast.is-error { border-left-color: var(--red); }
.toast.is-success { border-left-color: var(--green); }
.toast.is-warning { border-left-color: var(--amber); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.confirm-dialog {
  width: min(390px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-md);
}

.confirm-dialog::backdrop {
  background: rgba(8, 12, 19, 0.5);
}

.confirm-dialog form {
  padding: 22px;
}

.dialog-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--amber-soft);
  color: var(--amber);
}

.confirm-dialog h2 {
  margin-top: 14px;
  font-size: 16px;
}

.confirm-dialog p {
  margin: 9px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

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

body.workspace-maximized .studio-header,
body.workspace-maximized .composer-panel,
body.workspace-maximized .mobile-view-tabs,
body.workspace-maximized .mobile-generate-bar {
  display: none !important;
}

body.workspace-maximized .studio-layout {
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
}

body.workspace-maximized .workspace-panel {
  display: grid !important;
}

body.workspace-maximized .result-stage {
  padding: 14px;
}

body.workspace-maximized .result-toolbar {
  min-height: 56px;
}
