:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1f23;
  --muted: #5b616b;
  --border: #d9d6cf;
  --accent: #1f5f8b;
  --accent-text: #ffffff;
  --ok: #2d6a3e;
  --error: #a3312a;
  --notice: #f2efe6;
  --quote: #9aa0a8;
  /* Sukima Labs brand tokens (sukima-labs/marca v1.1, 03_DIGITAL/Web/brand_tokens.css).
     Only the brand mark uses them: cian on white is under 2:1, too faint for text or
     buttons, so Descargo keeps its own accent for the interface. */
  --sukima-grafito: #10131c;
  --sukima-cian: #14c6d4;
  --sukima-violeta: #7148f5;
  --sukima-marfil: #f5f4f0;
  --sukima-blanco: #ffffff;
  --brand-frame: var(--sukima-grafito);
  --brand-panel: var(--sukima-cian);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e7e5e0;
    --muted: #a3a8b0;
    --border: #3a3e44;
    --accent: #7db3db;
    --accent-text: #0f1215;
    --ok: #7cc68e;
    --error: #f08a80;
    --notice: #23262b;
    --quote: #6b717a;
    /* On a dark background the manual's white isotype (isotipo_white.svg). */
    --brand-frame: var(--sukima-blanco);
    --brand-panel: var(--sukima-blanco);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

header.top,
main,
footer {
  max-width: 52rem;
  margin: 0 auto;
  padding: 0 16px;
}

header.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
}

.brand:hover,
.brand:focus-visible {
  text-decoration: underline;
}

.isotype-frame {
  fill: var(--brand-frame);
}

.isotype-panel {
  fill: var(--brand-panel);
}

h1 {
  margin: 0;
  font-size: 1.75rem;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.4rem 0.8rem;
}

button:disabled {
  cursor: progress;
  opacity: 0.6;
}

button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  margin-top: 0.5rem;
}

.languages button[aria-pressed="true"] {
  border-color: var(--accent);
  font-weight: 600;
}

.notice {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--notice);
  border-radius: 8px;
}

.notice p {
  margin: 0.2rem 0;
}

.status {
  min-height: 1.5em;
  color: var(--muted);
}

.status[data-kind="ok"] {
  color: var(--ok);
}

.status[data-kind="error"] {
  color: var(--error);
  white-space: pre-wrap;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.tabs button {
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: none;
}

.tabs button[aria-selected="true"] {
  border-color: var(--border);
  background: var(--surface);
  font-weight: 600;
  margin-bottom: -1px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 1rem;
}

form label,
.tools {
  display: block;
  margin: 0.6rem 0;
}

form label > span:first-child,
.tools > span:first-child {
  display: block;
  font-weight: 600;
}

input:not([type="checkbox"]),
select,
textarea {
  font: inherit;
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}

small {
  display: block;
  color: var(--muted);
}

.row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0 1rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 1rem 0;
}

legend {
  font-weight: 600;
  padding: 0 0.3rem;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.checks label {
  display: inline-block;
  margin: 0.2rem 0;
  font-weight: normal;
}

details {
  margin: 0.6rem 0;
}

summary {
  cursor: pointer;
  color: var(--accent);
}

.result {
  margin: 1.5rem 0;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
}

.result-head h2 {
  margin: 0;
}

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.warnings:empty {
  display: none;
}

.warnings {
  color: var(--error);
}

.document {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 1.25rem 1rem;
  overflow-wrap: anywhere;
}

.document p {
  white-space: pre-line;
}

.document blockquote {
  margin: 0.75rem 0;
  padding-left: 0.9rem;
  border-left: 3px solid var(--quote);
}

.document hr {
  border: none;
  border-top: 1px solid var(--border);
}

footer {
  color: var(--muted);
  font-size: 0.875rem;
  padding-bottom: 2rem;
}

.demo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.start h2 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.25rem;
}

.start-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.start-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  text-align: left;
}

.start-card:hover,
.start-card:focus-visible {
  border-color: var(--accent);
}

.start-card span {
  color: var(--muted);
  font-size: 0.925rem;
}

.about h2 {
  margin: 1.25rem 0 0.25rem;
  font-size: 1.25rem;
}

.about h3 {
  margin: 0.9rem 0 0.2rem;
  font-size: 1rem;
}

.about ol,
.about ul {
  margin: 0.3rem 0;
  padding-left: 1.4rem;
}

.about .beta {
  color: var(--muted);
  font-size: 0.925rem;
}

label.inline {
  display: block;
  margin: 0.5rem 0;
}

textarea.message {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.875rem;
}

a.button {
  display: inline-block;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  padding: 0.4rem 0.8rem;
  text-decoration: none;
}

a.button[hidden] {
  display: none;
}

/* Procedure guides (guides.json). A wide table scrolls inside its box, never the page. */
.guide-pick select {
  max-width: 20rem;
}

.guide h3 {
  margin: 1.4rem 0 0.3rem;
  font-size: 1.15rem;
}

.guide h4 {
  margin: 1rem 0 0.2rem;
  font-size: 1rem;
}

.guide li {
  margin: 0.25rem 0;
}

.guide li > p {
  margin: 0.2rem 0;
}

.table-scroll {
  overflow-x: auto;
  margin: 0.75rem 0;
}

.guide table {
  border-collapse: collapse;
  font-size: 0.925rem;
  min-width: 100%;
}

.guide th,
.guide td {
  border: 1px solid var(--border);
  padding: 0.35rem 0.5rem;
  text-align: left;
  vertical-align: top;
  overflow-wrap: normal;
}

.guide th {
  background: var(--notice);
}

.guide-source {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: 0.875rem;
}

.guide a {
  color: var(--accent);
}

/* Static guide pages (guias/, en/guides/): no JavaScript, same look as the tab. */
.cta,
.others {
  margin: 1.5rem 0;
}

.cta a.button {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
}

.others a,
footer a {
  color: var(--accent);
}

.others ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  padding-left: 0;
  list-style: none;
}
