.generation-shell {
  min-height: 100vh;
  background: var(--bg);
}

.nav-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.generation-grid {
  display: grid;
  grid-template-columns: 330px minmax(460px, 1fr) 360px;
  gap: 0;
  min-height: calc(100vh - 74px);
}

.generation-panel {
  min-width: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 20px;
  overflow: auto;
}

.generation-panel:last-child {
  border-right: 0;
}

.main-generation {
  background: #f8fafc;
}

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

.generation-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini-copy {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.logo-settings {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
  margin-bottom: 14px;
}

.logo-control {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.logo-preview-box {
  display: grid;
  place-items: center;
  width: 112px;
  height: 72px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(-45deg, #f8fafc 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f8fafc 75%),
    linear-gradient(-45deg, transparent 75%, #f8fafc 75%);
  background-color: #fff;
  background-position:
    0 0,
    0 6px,
    6px -6px,
    -6px 0;
  background-size: 12px 12px;
}

.logo-preview {
  max-width: 96px;
  max-height: 56px;
  object-fit: contain;
}

.logo-placeholder {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.logo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.request-input {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 14px;
  outline: none;
  font: inherit;
  line-height: 1.55;
}

.request-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.08);
}

.generation-mode {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mode-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px;
  cursor: pointer;
}

.mode-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.08);
}

.mode-card input {
  margin-top: 3px;
  accent-color: var(--primary);
}

.mode-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
}

.mode-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.quick-prompts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 14px 0;
}

.quick-prompt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.saved-prompts {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px;
  margin-bottom: 14px;
}

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

.saved-prompts-row:first-child {
  grid-template-columns: minmax(0, 1fr) auto;
}

.saved-prompt-name,
.saved-prompt-select {
  min-width: 0;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  padding: 0 10px;
}

.saved-prompt-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
}

.payload-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.payload-preview h2 {
  margin-bottom: 10px;
}

.payload-preview pre,
.task-output {
  max-height: 460px;
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
  font-size: 12px;
  line-height: 1.55;
}

.task-output {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  color: #dbeafe;
  padding: 12px;
  min-height: 280px;
}

.task-links {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.task-links:empty {
  display: none;
}

.task-links-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.task-link {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
  text-decoration: none;
  word-break: break-word;
}

.task-link:hover {
  border-color: var(--primary);
}

@media (max-width: 1180px) {
  .generation-grid {
    grid-template-columns: 1fr;
  }

  .generation-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .generation-mode {
    grid-template-columns: 1fr;
  }

  .quick-prompts {
    align-items: flex-start;
    flex-direction: column;
  }

  .logo-control,
  .saved-prompts-row,
  .saved-prompts-row:first-child {
    grid-template-columns: 1fr;
  }
}
