:root {
  --bg: #f6f7f9; --card: #fff; --text: #1d2330; --muted: #5d6676; --line: #d9dee6;
  --accent: #1f6feb; --bad: #c62828; --ok: #2e7d32;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #11151c; --card: #1a1f29; --text: #e6e9ef; --muted: #9aa3b2; --line: #2d3442; --accent: #4c8dff; --bad: #ff6b6b; --ok: #5cc26a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
header, footer { max-width: 1200px; margin: 0 auto; padding: 1.25rem 1rem 0; }
header h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
header p, footer p { color: var(--muted); max-width: 75ch; }
.toolbar { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
main { max-width: 1200px; margin: 0 auto; padding: 1rem; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 1rem; align-items: start; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
fieldset { background: var(--card); border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .75rem 1rem 1rem; }
legend { font-weight: 600; padding: 0 .4rem; }
.intro { margin: 0 0 .5rem; color: var(--muted); font-size: .9rem; }
.field { display: grid; grid-template-columns: 210px 1fr auto; gap: .2rem .75rem; align-items: center; padding: .4rem 0; border-top: 1px solid var(--line); }
.field:first-of-type { border-top: 0; }
.field small, .field .err, .field details { grid-column: 2 / -1; }
.field small { color: var(--muted); }
@media (max-width: 600px) { .field { grid-template-columns: 1fr auto; } .field label { grid-column: 1 / -1; } .field small, .field .err, .field details { grid-column: 1 / -1; } }
code { font-size: .9rem; }
input, select, button { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: .35rem .5rem; }
.field input, .field select { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; }
.field.invalid input, .field.invalid select { border-color: var(--bad); }
.err { color: var(--bad); font-size: .85rem; }
.err:empty { display: none; }
.counter { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.req { color: var(--bad); }
.tag { font-size: .7rem; background: var(--line); border-radius: 4px; padding: 0 .3rem; }
button, .btn { cursor: pointer; }
.btn { border: 1px solid var(--line); border-radius: 6px; padding: .35rem .6rem; background: var(--card); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
aside { position: sticky; top: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
aside h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
aside label { display: block; margin-bottom: .5rem; }
aside input { width: 100%; margin-top: .2rem; }
.actions { display: flex; gap: .5rem; margin-bottom: .75rem; }
pre { margin: 0; max-height: 65vh; overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: .75rem; font-size: .8rem; }
.msg { margin: .25rem 0 .75rem; font-size: .9rem; }
.msg.bad { color: var(--bad); } .msg.ok { color: var(--ok); }
details.helper { margin-top: .3rem; font-size: .9rem; }
details.helper summary { cursor: pointer; color: var(--accent); }
.helper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: .5rem 0; }
.helper-grid label { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); }
.helper-grid .wide { grid-column: 1 / -1; }
footer { padding-bottom: 2rem; font-size: .85rem; }

/* ---- Asistente ---- */
.topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; }
.lang { display: flex; gap: .4rem; align-items: center; color: var(--muted); }
.steps { max-width: 1200px; margin: .5rem auto 0; padding: 0 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.steps button { display: flex; align-items: center; gap: .4rem; border-radius: 999px; }
.steps button i { font-style: normal; }
.steps button span { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--line); font-size: .8rem; }
.steps button.current { border-color: var(--accent); }
.steps button.current span { background: var(--accent); color: #fff; }
.steps button.has-error span { background: var(--bad); color: #fff; }
#wizard { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.25rem; }
.step h2 { margin-top: .25rem; }
.hint { color: var(--muted); }
.q { display: flex; flex-direction: column; gap: .25rem; margin: 1rem 0; max-width: 34rem; }
.q input { font-family: ui-monospace, Menlo, Consolas, monospace; }
.q small, .grid small, .ctx, .beacon small { color: var(--muted); font-size: .85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .75rem; margin: 1rem 0; }
.card { position: relative; display: flex; flex-direction: column; gap: .35rem; border: 2px solid var(--line); border-radius: 10px; padding: 1rem 1rem 1rem 2.6rem; cursor: pointer; }
.card input { position: absolute; left: 1rem; top: 1.15rem; }
.card span { color: var(--muted); font-size: .92rem; }
.card:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; margin: .75rem 0; }
.grid label { display: flex; flex-direction: column; gap: .25rem; }
.map-tools { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.map-tools form { display: flex; gap: .4rem; flex: 1 1 320px; }
.map-tools form input { flex: 1; }
.geo-results { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
.geo-results button { text-align: left; font-size: .85rem; }
#map { height: 380px; border-radius: 8px; border: 1px solid var(--line); }
.beacon { margin: 1rem 0; }
.beacon .status-text { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; }
.beacon-out { display: block; padding: .4rem .5rem; background: var(--bg); border-radius: 6px; word-break: break-all; margin-top: .2rem; }
.warn { color: #b26a00; margin: .25rem 0; font-size: .9rem; }
.warn:empty { display: none; }
.summary { padding-left: 1.2rem; }
.summary li { margin: .2rem 0; }
.nav-buttons { display: flex; justify-content: space-between; margin-top: 1.25rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.actions { flex-wrap: wrap; align-items: end; }
.actions label { margin: 0; }
#expert { margin-top: 1.25rem; }
#expert > summary { cursor: pointer; font-weight: 600; }
.field.overridden code::after { content: " ✎"; color: var(--accent); }
.toolbar label.btn { display: inline-block; }
[hidden] { display: none !important; }
#wizard, aside { min-width: 0; }
@media (max-width: 600px) { #wizard { padding: .75rem; } main { padding: .5rem; } }

/* ---- Símbolos, PHG y balizas adicionales ---- */
.sym { position: relative; display: inline-block; width: 32px; height: 32px; flex: none; }
.sym-cell { position: absolute; inset: 0; background-size: 512px 192px; background-repeat: no-repeat; }
.sympick { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .5rem; margin: .4rem 0 .8rem; }
.sympick button { display: flex; gap: .6rem; align-items: center; text-align: left; padding: .5rem; border-width: 2px; }
.sympick button span { display: flex; flex-direction: column; line-height: 1.25; }
.sympick button small { color: var(--muted); font-size: .78rem; }
.sympick button code { font-size: .75rem; color: var(--muted); }
.sympick button.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.q.wide { max-width: none; }
.phg { margin: .5rem 0; }
.phg-title { font-weight: 600; display: block; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 600; margin: .25rem 0; }
.check.narrow { font-weight: 400; grid-column: 1 / -1; }
.inline { display: flex; gap: .4rem; }
.inline input { flex: 1; min-width: 0; }
.extra .kind { display: flex; flex-direction: column; gap: .25rem; max-width: 34rem; }
.x-body > * { margin-top: .75rem; }
.loc .map { height: 340px; border-radius: 8px; border: 1px solid var(--line); }
.x-loc-picker .map { height: 280px; }
.loc { margin-top: .5rem; }
.grid label.check { flex-direction: row; align-items: center; }
details.about { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .6rem 1rem; margin: .5rem 0 1rem; max-width: 75ch; }
details.about summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.about p, details.about li { color: var(--text); }
details.about li { margin: .4rem 0; }
details.about a { color: var(--accent); }
details.burn { max-width: none; margin-top: 1.25rem; }

.msg.warnbox { background: color-mix(in srgb, #f0b400 15%, transparent); border-left: 4px solid #f0b400; padding: .5rem .75rem; }
.trap-wrap { margin-top: .75rem; }

/* Verificación de la imagen .BIN */
.fwchecks { list-style: none; padding: 0; margin: .5em 0; }
.fwchecks li { margin: .2em 0; word-break: break-all; }
.fwchecks .ok { color: var(--ok, #1a7f37); }
.fwchecks .bad { color: var(--bad, #b42318); }
.fwtable-wrap { overflow-x: auto; }
.fwtable { border-collapse: collapse; font-size: .85em; width: 100%; }
.fwtable th, .fwtable td { border-bottom: 1px solid var(--line); padding: .25em .4em; text-align: left; vertical-align: top; }
.fwtable td code { word-break: break-all; }
.fwtable tr.kept td { background: rgba(255, 193, 7, .15); }
.fwconsole { background: var(--line); padding: .5em .75em; font-size: .85em; overflow-x: auto; white-space: pre-wrap; }
#a-trap { display: block; margin: .25rem 0 .4rem; max-width: 100%; }
