:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #14202e;
  --muted: #55636f;
  --border: #d8dfe6;
  --primary: #0b2545;
  --on-primary: #ffffff;
  --ok: #1d6b3a;
  --ok-bg: #e2f3e8;
  --fail: #a4262c;
  --fail-bg: #fbe7e8;
  --wait: #6b5400;
  --wait-bg: #fbf1cf;
  --info: #24527a;
  --info-bg: #e3edf6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d151e;
    --surface: #17222e;
    --text: #e8eef4;
    --muted: #a3b1bd;
    --border: #2d3b49;
    --primary: #8db8e8;
    --on-primary: #0b2545;
    --ok: #8fdcaa;
    --ok-bg: #173a26;
    --fail: #f5a9ad;
    --fail-bg: #472024;
    --wait: #f2d675;
    --wait-bg: #3d3313;
    --info: #a9cdf0;
    --info-bg: #1d3347;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.top,
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
}

main {
  padding-top: 0;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.2;
}

h2,
h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
}

h3 {
  font-size: 1rem;
}

p,
ol {
  margin: 8px 0;
}

ol {
  padding-left: 20px;
}

.top p {
  color: var(--muted);
}

.top .context {
  color: var(--text);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
  padding: 16px;
}

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

.head.sub {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.pill {
  background: var(--wait-bg);
  border-radius: 999px;
  color: var(--wait);
  flex: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 2px 10px;
}

.pill[data-state="ok"] {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill[data-state="falha"] {
  background: var(--fail-bg);
  color: var(--fail);
}

.pill[data-state="info"] {
  background: var(--info-bg);
  color: var(--info);
}

button,
.button {
  background: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--on-primary);
  cursor: pointer;
  display: block;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 16px;
  text-align: center;
  width: 100%;
}

button.secondary {
  background: transparent;
  color: var(--primary);
}

.row {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr 1fr;
}

.file {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

button:focus-visible,
.button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

label {
  display: block;
  margin: 8px 0;
}

textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  display: block;
  font: 16px/1.4 ui-monospace, Menlo, monospace;
  margin-top: 8px;
  padding: 10px;
  width: 100%;
}

.detail {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0;
  min-height: 1.4em;
  overflow-wrap: anywhere;
}
