:root {
  color-scheme: light;
  --bg: #f4f3ef;
  --panel: #fffdf8;
  --ink: #1d1a18;
  --muted: #6d6760;
  --line: #ddd6cb;
  --accent: #1967d2;
  --accent-2: #0f8f6f;
  --warning: #b35c00;
  --danger: #b42318;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
select,
input {
  font: inherit;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(420px, 1fr) minmax(300px, 400px);
  min-height: 100vh;
  gap: 1px;
  background: var(--line);
}

.panel {
  background: var(--panel);
  padding: 24px;
  overflow: auto;
}

.panel-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.subtle {
  color: var(--muted);
}

#assetInput {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.upload-zone {
  display: grid;
  gap: 12px;
  min-height: 150px;
  padding: 20px;
  border: 1px dashed #aaa194;
  border-radius: var(--radius);
  background: #faf7f0;
  cursor: pointer;
}

.upload-zone strong,
button {
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  text-align: center;
  cursor: pointer;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.asset-list,
.agent-output {
  display: grid;
  gap: 12px;
}

.asset-card,
.agent-card,
.page-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.asset-card {
  display: grid;
  gap: 10px;
  padding: 10px;
}

.asset-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #f7f4ef;
  border-radius: 6px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.control-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.control-grid select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 10px;
}

.full-row {
  grid-column: 1 / -1;
}

#generateButton {
  grid-column: 1 / -1;
}

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

.page-preview {
  min-height: 260px;
  padding: 18px;
}

.empty-state {
  color: var(--muted);
}

.agent-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.agent-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: #eaf4ff;
  color: #1557b0;
}

.status.warning {
  background: #fff2dc;
  color: var(--warning);
}

.status.danger {
  background: #ffe8e5;
  color: var(--danger);
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.pill-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: #fbfaf7;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f7f4ef;
  border-radius: var(--radius);
  padding: 12px;
}

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

  .panel {
    overflow: visible;
  }
}

@media (max-width: 640px) {
  .panel {
    padding: 16px;
  }

  .control-grid,
  .detail-module-grid,
  .agent-flow,
  .mockup-grid,
  .output-summary {
    grid-template-columns: 1fr;
  }
}

.asset-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  color: var(--muted);
  padding: 14px;
}

.asset-card.primary {
  border-color: var(--accent-2);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 30%, transparent);
}

.asset-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.asset-card input,
.asset-card select,
.prompt-editor textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 9px 10px;
}

.asset-meta {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.asset-actions,
.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.secondary-button {
  background: #eef3fb;
  color: #174ea6;
}

.danger-button {
  background: #fff0ee;
  color: var(--danger);
}

.prompt-editor {
  display: grid;
  gap: 8px;
}

.prompt-editor textarea {
  min-height: 116px;
  resize: vertical;
  line-height: 1.5;
}

.prompt-editor textarea[readonly] {
  background: #f7f4ef;
  color: var(--muted);
}

.detail-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.detail-module {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  padding: 14px;
}

.detail-module span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.detail-module h4 {
  margin: 0;
}

.detail-module p {
  color: var(--muted);
  margin: 0;
}

.detail-module pre {
  max-height: 140px;
  overflow: auto;
  margin: 0;
}

.project-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.project-bar span {
  color: var(--muted);
  font-size: 12px;
  margin-right: auto;
}

.agent-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.flow-step {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  color: var(--muted);
  padding: 10px;
}

.flow-step span {
  color: var(--accent-2);
  font-size: 11px;
  font-weight: 800;
}

.flow-step strong {
  color: var(--ink);
  font-size: 13px;
}

.flow-step.active {
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  background: #f3f7ff;
}

.flow-step.danger {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  background: #fff7f5;
}

.compliance-list {
  display: grid;
  gap: 8px;
}

.compliance-item {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #fffefa;
  padding: 10px;
}

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

.compliance-item.ready {
  border-left-color: var(--accent-2);
}

.compliance-item.warning {
  border-left-color: var(--warning);
}

.compliance-item.danger {
  border-left-color: var(--danger);
}

.access-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.access-shell.is-hidden,
.workspace.is-locked {
  display: none;
}

.access-card {
  display: grid;
  gap: 18px;
  width: min(760px, 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 28px;
}

.access-card h1,
.access-card h2 {
  margin-bottom: 0;
}

.access-form {
  display: grid;
  gap: 12px;
}

.access-form.compact {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.access-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.access-form input,
.access-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
  padding: 10px;
}

.access-form textarea {
  min-height: 90px;
  resize: vertical;
}

.access-divider {
  border-top: 1px solid var(--line);
}

.admin-panel summary {
  cursor: pointer;
  font-weight: 800;
}

.admin-requests {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.admin-request {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  padding: 14px;
}

.admin-request p {
  color: var(--muted);
  margin: 4px 0 0;
}

.admin-request pre {
  grid-column: 1 / -1;
  margin: 0;
}

.access-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.access-message.success {
  color: var(--accent-2);
}

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

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.product-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: white;
}

.product-table th,
.product-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.product-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #fbfaf7;
}

.product-table td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.selectable-row,
.selectable-card {
  cursor: pointer;
}

.selectable-row.selected {
  background: #eef7f3;
  box-shadow: inset 4px 0 0 var(--accent-2);
}

.mini-select-button {
  margin-top: 8px;
  background: #eef3fb;
  color: #174ea6;
  padding: 6px 9px;
  font-size: 12px;
}

.selectable-row.selected .mini-select-button {
  background: #dff3ec;
  color: #0d6f58;
}

.direction-grid,
.variant-grid {
  display: grid;
  gap: 12px;
}

.direction-card,
.variant-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  padding: 14px;
}

.direction-card.selected,
.variant-card.selected {
  border-color: var(--accent-2);
  background: #f3fbf8;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 26%, transparent);
}

.direction-card mark,
.variant-card mark {
  justify-self: start;
  border-radius: 999px;
  background: #dff3ec;
  color: #0d6f58;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.direction-card span,
.variant-card span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.output-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.output-summary div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfaf7;
  padding: 10px;
}

.output-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.output-summary strong {
  font-size: 14px;
}

.reference-brief {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: #f7fbff;
  padding: 12px;
}

.reference-brief span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.reference-brief strong,
.reference-brief p {
  min-width: 0;
  overflow-wrap: anywhere;
  margin: 0;
}

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

.mockup-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fffefa;
  padding: 14px;
}

.mockup-card.selected {
  border-color: var(--accent-2);
  background: #f3fbf8;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 26%, transparent);
}

.mockup-card mark {
  justify-self: start;
  border-radius: 999px;
  background: #dff3ec;
  color: #0d6f58;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
}

.mockup-card span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.mockup-card h4,
.mockup-card p,
.mockup-card pre {
  margin: 0;
}

.generation-status {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f3f7ff;
  color: #174ea6;
  padding: 10px;
  font-size: 13px;
}

.generation-status.error {
  background: #fff0ee;
  color: var(--danger);
}

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

.generated-images figure {
  display: grid;
  gap: 8px;
  margin: 0;
}

.generated-images img {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f4ef;
}

.generated-images a {
  color: var(--accent);
  font-weight: 700;
}

.direction-card h4,
.variant-card h4 {
  margin: 0;
}

.direction-card p,
.variant-card p {
  color: var(--muted);
  margin: 0;
}

.direction-card pre,
.variant-card pre {
  max-height: 150px;
  margin: 0;
  overflow: auto;
}
