:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #18202a;
  --muted: #617080;
  --line: #d8e0e8;
  --accent: #146c5f;
  --accent-dark: #0c4c43;
  --danger: #b3261e;
  --code: #101820;
}

* {
  box-sizing: border-box;
}

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

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar,
.panel-heading,
.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

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

.home-link {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 700;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  margin-top: 16px;
}

.input-panel {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--text);
  background: #fff;
}

textarea {
  resize: vertical;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.state,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.message {
  margin-top: 12px;
  color: var(--muted);
}

.error {
  color: var(--danger);
  font-weight: 700;
  min-height: 20px;
}

.candidate-focus,
.candidate-list,
.images,
.metadata {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.candidate {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.candidate.blocked {
  border-color: #e2a9a4;
}

.candidate h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.candidate dl,
.metadata dl {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
  font-size: 13px;
}

.candidate dt,
.metadata dt {
  color: var(--muted);
  font-weight: 700;
}

.candidate dd,
.metadata dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.json {
  margin: 14px 0 0;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--code);
  color: #eef6f3;
  font-size: 12px;
  line-height: 1.5;
}

.debug-toggle {
  display: flex;
  grid-template-columns: unset;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.debug-toggle input {
  width: auto;
}

.images {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.images figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfd;
}

.images img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.images figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .topbar,
  .panel-heading,
  .actions,
  .grid.two {
    grid-template-columns: 1fr;
    display: grid;
    align-items: stretch;
  }

  .candidate dl,
  .metadata dl {
    grid-template-columns: 1fr;
  }
}
