/* Mobile-first. Semantic tokens only (from tokens.css). Single accent: --accent. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--rule);
}
.logo { height: 22px; width: auto; }
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-3);
}

.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 64px; }
.title { font-size: 28px; font-weight: 400; letter-spacing: -0.02em; margin: 0 0 8px; }
.sub { color: var(--fg-2); margin: 0 0 24px; line-height: 1.5; }

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-paper);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 20px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 13px; font-weight: 600; color: var(--fg-2); }

input[type=text], textarea, select, input[type=file] {
  font: inherit;
  color: var(--fg-1);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 12px;
  min-height: 44px;
  width: 100%;
}
textarea { resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  font: inherit;
  font-weight: 600;
  color: var(--fg-inverse);
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 14px 20px;
  min-height: 48px;
  cursor: pointer;
  transition: filter 200ms cubic-bezier(0.2, 0, 0, 1);
}
.btn:active { filter: brightness(0.92); }
.btn:disabled { opacity: 0.5; cursor: default; }

.locate-row { display: flex; gap: 8px; margin-bottom: 8px; }
.locate-row input { flex: 1; }
.row-rm {
  font: inherit; font-size: 13px; color: var(--fg-3);
  background: var(--bg); border: 1px solid var(--rule); border-radius: 6px;
  padding: 0 12px; min-height: 44px; cursor: pointer;
}
.btn-ghost {
  font: inherit; font-size: 14px; font-weight: 600; color: var(--accent);
  background: none; border: 1px dashed var(--rule); border-radius: 6px;
  padding: 10px 14px; min-height: 40px; cursor: pointer; align-self: flex-start;
}

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; color: var(--fg-2); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.status {
  margin-top: 20px;
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  color: var(--fg-2);
  background: var(--bg-paper);
}
.status.error { border-left-color: var(--accent-3); color: var(--fg-1); }

.results { margin-top: 24px; display: flex; flex-direction: column; gap: 24px; }
.result-block { display: flex; flex-direction: column; gap: 8px; }
.h2 { font-size: 18px; font-weight: 600; margin: 0; }
.meta { font-size: 13px; font-weight: 400; color: var(--fg-3); }
canvas { max-width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 8px; }
.cosmos-text {
  margin: 0;
  line-height: 1.6;
  color: var(--fg-1);
  background: var(--bg-paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
}
.raw { color: var(--fg-3); font-size: 13px; }
.raw pre { white-space: pre-wrap; word-break: break-word; color: var(--fg-2); }
