/* Layout: one reading column of phrase cards grouped by where they appear, under a sticky progress bar; signage type,
   safety amber used once. Shared by every language's page and the landing page. */
:root {
  --ground: #EDEFF1;
  --sheet: #FFFFFF;
  --ink: #1C2228;
  --muted: #59636E;
  --rule: #D5DAE0;
  --amber: #E8A800;
  --amber-ink: #7A5200;
  --ok: #1E7A4C;
  --change: #B4410D;
  --warn-soft: #FFF4D6;
  --focus: #1D5FD0;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.4rem;
  --step-3: 2.1rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #111417; --sheet: #1A1F24; --ink: #E7EAEE; --muted: #9AA4AF; --rule: #2C333B;
    --amber: #F2C033; --amber-ink: #F2C033; --ok: #5CC491; --change: #F08A5A; --warn-soft: #3A3018;
    --focus: #7AA7FF; color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[hidden] { display: none !important; }
img { max-width: 100%; }
a { color: var(--focus); }

.wrap { max-width: 46rem; margin: 0 auto; padding-block: 24px 64px; display: grid; gap: 28px; overflow-wrap: break-word; }
.wrap > *, section.area > * { min-width: 0; }

.brand { display: flex; align-items: center; gap: 10px; width: fit-content; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }

header.intro { display: grid; gap: 14px; }
.eyebrow {
  font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.95rem; color: var(--amber-ink); display: flex; align-items: center; gap: 10px; margin: 0;
}
.eyebrow::before { content: ""; width: 22px; height: 6px; background: repeating-linear-gradient(-45deg, var(--amber) 0 6px, var(--ink) 6px 12px); border-radius: 1px; }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); line-height: 1.05; margin: 0; text-wrap: balance; }
.lede { margin: 0; max-width: 62ch; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; max-width: 62ch; }
.note { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 62ch; }
.greeting { margin: 0; font-size: var(--step-1); }

.notice { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--rule); }

.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--ground);
  padding-block: 12px; border-bottom: 1px solid var(--rule); display: grid; gap: 10px;
}
.progress-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.count { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--rule); border-radius: 3px; overflow: hidden; }
.meter > i { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.3s ease; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 0.95rem; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
}
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--sheet); }
.copy {
  font: inherit; font-size: 0.95rem; border: 1px solid var(--ink); background: transparent; color: var(--ink);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.save-state { font-size: 0.9rem; color: var(--muted); margin: 0; }
.fallback { display: grid; gap: 8px; }

section.area { display: grid; gap: 14px; }
section.area h2 {
  font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); margin: 0;
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
}
section.area h2 small { font-family: var(--font-body); font-weight: 400; font-size: 0.9rem; color: var(--muted); font-variant-numeric: tabular-nums; }

article.item { background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 18px; display: grid; gap: 12px; }
article.item.is-ok { border-color: color-mix(in srgb, var(--ok) 45%, var(--rule)); }
article.item.is-change { border-color: color-mix(in srgb, var(--change) 45%, var(--rule)); }
.where { margin: 0; font-size: 0.9rem; color: var(--muted); }
.pair { display: grid; gap: 10px; }
.lang { display: grid; gap: 2px; min-width: 0; }
.lang b { font-weight: 700; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lang .en { margin: 0; color: var(--muted); white-space: pre-line; }
.lang .es { margin: 0; font-size: var(--step-1); white-space: pre-line; }
.check { margin: 0; font-size: 0.95rem; padding: 10px 12px; border-radius: 8px; background: var(--ground); }
.check strong { font-weight: 700; }
.fit { margin: 0; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { font: inherit; font-weight: 700; border-radius: 8px; padding: 9px 16px; cursor: pointer; border: 1.5px solid currentColor; background: transparent; }
.btn.ok { color: var(--ok); }
.btn.change { color: var(--change); }
.btn.ok[aria-pressed="true"] { background: var(--ok); color: var(--sheet); border-color: var(--ok); }
.btn.change[aria-pressed="true"] { background: var(--change); color: var(--sheet); border-color: var(--change); }
.undo { font: inherit; font-size: 0.9rem; background: none; border: none; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 4px; }
.status { margin-left: auto; font-size: 0.85rem; color: var(--muted); }

.edit { display: grid; gap: 10px; padding-top: 4px; }
label { font-size: 0.9rem; color: var(--muted); display: grid; gap: 4px; }
textarea {
  font: inherit; font-size: var(--step-0); color: var(--ink); background: var(--sheet); width: 100%; min-height: 4.5em;
  border: 1.5px solid var(--rule); border-radius: 8px; padding: 10px 12px; resize: vertical;
}
textarea.small { min-height: 3em; }
.save { justify-self: start; }

.empty { padding: 24px; text-align: center; color: var(--muted); background: var(--sheet); border: 1px dashed var(--rule); border-radius: 10px; }

.languages { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.languages a {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: var(--ink);
  background: var(--sheet); border: 1px solid var(--rule); border-radius: 10px; padding: 14px 16px; font-size: var(--step-1);
}
.languages a span { color: var(--muted); font-size: 0.95rem; }
footer.site { color: var(--muted); font-size: 0.85rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .meter > i { transition: none; } }
@media (min-width: 640px) { .pair { grid-template-columns: 1fr 1fr; } }
