@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

:root {
  --bg: #f3efe7;
  --ink: #141312;
  --muted: #6c625b;
  --accent: #e55c38;
  --accent-dark: #b44224;
  --panel: #ffffff;
  --line: #e1d7cc;
  --shadow: 0 20px 50px rgba(20, 19, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, #f9f1e5 0%, #f2e7dc 35%, #e9e4d8 70%, #efe6d8 100%);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Space Grotesk", sans-serif;
}

.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 32px 48px;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  margin: 0 0 8px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 36px;
  letter-spacing: -0.02em;
}

.subhead {
  margin: 10px 0 0;
  max-width: 520px;
  color: var(--muted);
}

.header-actions {
  display: flex;
  gap: 12px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(260px, 0.9fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.task-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fff7ec;
}

.task-panel h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

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

.canvas-shell {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px dashed #c7b9a8;
  background: #fdfaf4;
  min-height: 420px;
}

#canvas {
  display: block;
  width: 100%;
  height: auto;
}

.canvas-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  color: #7d7066;
  font-size: 14px;
  gap: 8px;
}

.canvas-overlay.hidden {
  display: none;
}

.canvas-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.api-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fff7ec;
}

.api-panel h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

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

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

.api-panel .field {
  margin-bottom: 0;
}

.status {
  color: var(--muted);
  font-size: 13px;
}

.side-panel h2,
.xml-panel h2 {
  margin: 0 0 10px;
  font-size: 16px;
  font-family: "Space Grotesk", sans-serif;
}

.section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field label {
  font-size: 13px;
  color: var(--muted);
}

.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "IBM Plex Sans", sans-serif;
}

.field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "IBM Plex Sans", sans-serif;
  resize: vertical;
}

.field.muted div {
  background: #faf6ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.queue-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.queue-list {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.queue-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 6px;
  background: #fffaf3;
  cursor: pointer;
}

.queue-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(229, 92, 56, 0.15);
}

.queue-card small {
  color: var(--muted);
  font-size: 12px;
}

.finding-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  background: #fffaf3;
}

.finding-info {
  display: grid;
  gap: 6px;
}

.finding-delete {
  align-self: start;
  border: 1px solid #dbcbbb;
  background: #f4ede4;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.finding-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(229, 92, 56, 0.15);
}

.finding-card small {
  color: var(--muted);
  font-size: 12px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(229, 92, 56, 0.25);
}

.button.ghost {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--accent-dark);
}

.button.light {
  background: #f4ede4;
  color: var(--ink);
  border: 1px solid #dbcbbb;
}

.button input {
  display: none;
}

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

.review-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 12px;
  background: #fff7ec;
}

.review-panel h2 {
  margin: 0 0 4px;
  font-size: 15px;
  font-family: "Space Grotesk", sans-serif;
}

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

.locked .side-panel,
.locked .xml-panel {
  filter: blur(6px);
  opacity: 0.5;
  pointer-events: none;
}

.locked .side-panel::after,
.locked .xml-panel::after {
  content: "Locked";
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border-radius: inherit;
}

.side-panel,
.xml-panel {
  position: relative;
}

.xml-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#xmlOutput {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  font-family: "Space Grotesk", monospace;
  resize: vertical;
  background: #fbf8f3;
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .header {
    flex-direction: column;
    align-items: flex-start;
  }
  .task-fields,
  .review-fields {
    grid-template-columns: 1fr;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel {
  animation: fadeIn 0.4s ease;
}
