:root {
    color-scheme: dark;
    --bg: #121212;
    --card: #201d1b;
    --line: #2c2825;
    --text: #f1ede8;
    --muted: #9c958c;
    --accent: #2e8cca;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

main {
    width: 100%;
    max-width: 440px;
    padding: 24px 20px calc(96px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
}

h1 {
    font-size: 28px;
    margin: 24px 0 8px;
}

h2 {
    font-size: 19px;
    margin: 10px 0 4px;
}

.sub {
    color: var(--muted);
    margin: 0 0 24px;
    line-height: 1.4;
}

.muted {
    color: var(--muted);
}

label {
    display: block;
    font-weight: 600;
    margin: 16px 0 6px;
}

input,
select,
textarea {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid var(--accent);
    background: var(--card);
    color: var(--text);
    font-size: 16px;
    font-family: inherit;
}

textarea {
    resize: vertical;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    margin-top: 6px;
    line-height: 1.4;
}

button,
.boton {
    display: block;
    width: 100%;
    margin-top: 24px;
    padding: 15px;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
}

button:disabled {
    opacity: .6;
}

button.sec,
.boton.sec {
    background: var(--accent);
    border: 1px solid var(--line);
    color: var(--text);
}

button.sec:nth-child(4) {
    background-color: crimson;
}


.acciones {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.acciones button,
.acciones .boton {
    margin-top: 0;
}

.botones {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.botones button {
    margin-top: 0;
    flex: 1;
}

.pequeno {
    width: auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 14px;
}

.chips {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.chip {
    width: auto;
    margin: 0;
    padding: 9px 12px;
    font-size: 14px;
    flex: 1;
    background: var(--card);
    color: var(--muted);
    border: 1px solid var(--accent);
}

.chip.on {
    background: var(--card);
    color: var(--accent);
    border-color: var(--accent);
}

.tabs {
    display: grid;
    grid-template-columns: repeat(3, auto);
    grid-template-rows: repeat(2, auto);
    gap: 5px 3px;
}

.tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--accent);
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.tabs a.on {
    color: var(--text);
    border: var(--card) 1px solid;
    background-color: var(--accent);
}

.msg {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    font-size: 15px;
}

.err {
    background: #3a1718;
    color: #ffb4b6;
}

.ok {
    background: #14301f;
    color: #a7e8bf;
}

.card {
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 16px;
    padding: 6px 18px;
    margin-top: 20px;
}

.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.card .row:last-child {
    border-bottom: 0;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    background: #2c2825;
    color: var(--muted);
    white-space: nowrap;
}

.b-conf {
    background: #14301f;
    color: #7fdc9f;
}

.b-prog {
    background: #3a2a0c;
    color: #f5a623;
}

.b-canc {
    background: #3a1718;
    color: #ffb4b6;
}

.b-fin {
    background: #2c2825;
    color: var(--muted);
}

.rod {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-top: 12px;
}

.persona {
    margin-top: 12px;
}

.persona .row {
    border-bottom: 0;
    padding-bottom: 6px;
}

.link {
    display: block;
    text-align: center;
    color: var(--accent);
    margin-top: 24px;
    font-weight: 600;
    text-decoration: none;
}

.volver {
    display: inline-block;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    margin-top: 16px;
}

#mapa,
#mapaEditor {
    height: 300px;
    border-radius: 16px;
    margin-top: 16px;
    border: 1px solid var(--accent);
}

#mapaEditor {
    height: 340px;
}

.seccion-titulo {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    margin: 24px 0 8px;
}

.nota {
    background: var(--card);
    border: 1px solid var(--accent);
    height: auto;
    border-radius: 12px;
    padding: 14px;
    line-height: 1.4;
}

.parada {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.parada:last-child {
    border-bottom: 0;
}

.paradaEd {
    margin-top: 12px;
}

.paradaEd input,
.paradaEd select {
    margin-top: 10px;
}

.num {
    flex: 0 0 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--card);
    border: var(--accent) 1px solid;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.grid2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 12px 0;
}

.temp {
    font-size: 28px;
    font-weight: 700;
}

textarea#wa {
    font-size: 14px;
    line-height: 1.4;
}

#flotante {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: auto;
    margin: 0;
    padding: 12px 18px;
    border-radius: 999px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
    z-index: 1000;
    font-size: 15px;
}

.leaflet-tooltip {
    background: #201d1b;
    color: var(--text);
    border: 1px solid var(--accent);
    box-shadow: none;
    font-weight: 600;
}