:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 60px rgba(23, 32, 51, .10);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

button,
input {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 9px 14px;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  border-color: #aab4c3;
}

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

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

.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  width: 100%;
  margin-top: 4px;
}

.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  padding: 34px clamp(18px, 4vw, 54px) 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
  margin-bottom: 8px;
}

.base-url {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  word-break: break-all;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 22px;
  padding: 12px clamp(18px, 4vw, 54px) 54px;
}

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

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 700;
}

input[type="file"] {
  width: 100%;
  border: 1px dashed #aab4c3;
  border-radius: 6px;
  padding: 18px;
  background: #f8fafc;
  color: var(--text);
}

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

.template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}

.template-card:hover,
.template-card.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.template-card input {
  margin: 0;
}

.template-name {
  font-weight: 800;
  font-size: 17px;
}

.template-description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
  font-weight: 500;
}

.status {
  min-height: 24px;
  margin-top: 16px;
  font-weight: 700;
  color: var(--muted);
}

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

.result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

.project-list {
  display: grid;
  gap: 12px;
}

.project-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  display: grid;
  gap: 9px;
}

.project-item.selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

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

.project-id {
  font-weight: 900;
  font-size: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.badge {
  border-radius: 999px;
  padding: 5px 9px;
  background: #e6f4f1;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.failed {
  background: #fee4e2;
  color: var(--danger);
}

.project-meta {
  color: var(--muted);
  font-size: 14px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

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

@media (max-width: 680px) {
  .topbar,
  .section-title {
    display: grid;
  }

  .panel {
    padding: 18px;
  }
}
