:root { --navy:#0b2545; --navy2:#13315c; --red:#c8102e; --red2:#a00d25; --white:#fff; --bg:#eef2f7; --ink:#0b2545; --muted:#5b6b82; --green:#1f8a4c; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; font-size: 18px; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
header.bar { background: var(--navy); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 5px solid var(--red); position: sticky; top: 0; z-index: 5; }
header.bar .brand { font-weight: 800; font-size: 20px; letter-spacing: .3px; flex: 1; }
header.bar .brand small { display: block; font-weight: 500; font-size: 14px; opacity: .85; }
header.bar .iconbtn { background: transparent; border: 2px solid rgba(255,255,255,.5); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 15px; }
main { padding: 14px; max-width: 640px; margin: 0 auto; }

/* login */
.login { min-height: 100vh; background: var(--navy); color: #fff; display: flex; flex-direction: column; align-items: center; padding: calc(28px + env(safe-area-inset-top)) 20px 24px; }
.login .logo { width: 86px; height: 86px; border-radius: 20px; }
.login h1 { margin: 12px 0 2px; font-size: 28px; }
.login .sub { opacity: .85; margin: 0 0 14px; font-size: 18px; }
.dots { display: flex; gap: 16px; margin: 10px 0 8px; }
.dots span { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; }
.dots span.on { background: #fff; }
.msg { min-height: 26px; color: #ffd0d6; font-weight: 600; text-align: center; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 330px; margin-top: 6px; }
.pad button { height: 72px; border-radius: 16px; border: 0; background: var(--navy2); color: #fff; font-size: 32px; font-weight: 700; }
.pad button:active { background: var(--red); }
.pad button.ghost { background: transparent; font-size: 20px; }
.install-hint { margin-top: 18px; background: rgba(255,255,255,.1); border: 2px dashed rgba(255,255,255,.4); border-radius: 14px; padding: 12px 14px; font-size: 16px; line-height: 1.4; max-width: 360px; }

/* status banners */
.banner { border-radius: 12px; padding: 10px 14px; font-weight: 700; margin-bottom: 12px; font-size: 17px; }
.banner.offline { background: #fff4d6; color: #7a5300; border: 2px solid #f0c24b; }
.banner.pending { background: #e5eefc; color: var(--navy); border: 2px solid #9fb8e6; }

/* progress */
.progress { background: #fff; border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.progress .row { display: flex; justify-content: space-between; align-items: baseline; }
.progress .big { font-size: 26px; font-weight: 800; }
.progress .route { color: var(--muted); font-size: 16px; }
.bar-outer { height: 14px; background: #dfe6f0; border-radius: 8px; overflow: hidden; margin-top: 8px; }
.bar-inner { height: 100%; background: var(--red); border-radius: 8px; transition: width .3s; }

/* current stop */
.current { background: #fff; border-radius: 18px; padding: 16px; border: 4px solid var(--navy); box-shadow: 0 4px 14px rgba(11,37,69,.18); margin-bottom: 16px; }
.current .label { display: inline-block; background: var(--red); color: #fff; font-weight: 800; border-radius: 8px; padding: 3px 10px; font-size: 15px; letter-spacing: .5px; }
.current h2 { font-size: 28px; margin: 10px 0 4px; line-height: 1.15; }
.current .addr { font-size: 20px; color: var(--navy2); margin-bottom: 14px; line-height: 1.3; }
.btn { display: block; width: 100%; border: 0; border-radius: 16px; font-weight: 800; text-align: center; text-decoration: none; }
.btn-dir { background: #fff; color: var(--navy); border: 4px solid var(--navy); font-size: 24px; padding: 16px; margin-bottom: 12px; }
.btn-check { background: var(--red); color: #fff; font-size: 32px; padding: 24px 16px; letter-spacing: 1px; box-shadow: 0 4px 0 var(--red2); }
.btn-check:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red2); }
.btn-check:disabled { background: #9aa6b6; box-shadow: none; }
textarea.notes { width: 100%; min-height: 70px; font: inherit; font-size: 19px; border: 2px solid #b8c4d6; border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; resize: vertical; }
.done-msg { text-align: center; padding: 22px 10px; }
.done-msg .check { font-size: 64px; }
.done-msg h2 { margin: 6px 0; font-size: 28px; }

/* list */
h3.list-title { margin: 6px 4px 8px; font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.stops { list-style: none; margin: 0; padding: 0; }
.stops li { background: #fff; border-radius: 14px; margin-bottom: 8px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; border: 2px solid transparent; }
.stops li .num { flex: 0 0 40px; height: 40px; border-radius: 50%; background: #dfe6f0; color: var(--navy); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 19px; }
.stops li .txt { flex: 1; min-width: 0; }
.stops li .nm { font-weight: 700; font-size: 19px; }
.stops li .ad { color: var(--muted); font-size: 15px; }
.stops li .tm { font-weight: 800; color: var(--green); font-size: 17px; white-space: nowrap; }
.stops li.done { opacity: .75; }
.stops li.done .num { background: var(--green); color: #fff; }
.stops li.active { border-color: var(--red); }
.stops li.active .num { background: var(--red); color: #fff; }
.stops li .wait { font-size: 13px; color: #7a5300; display: block; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--green); color: #fff; padding: 16px 22px; border-radius: 16px; font-weight: 800; font-size: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.25); z-index: 50; text-align: center; min-width: 260px; max-width: 94vw; white-space: nowrap; }
.toast.err { background: var(--red); }
.empty { background: #fff; border-radius: 16px; padding: 26px 18px; text-align: center; font-size: 20px; }
.routes-pick { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.routes-pick button { flex: 1; border: 3px solid var(--navy); background: #fff; color: var(--navy); border-radius: 12px; padding: 10px; font-weight: 700; }
.routes-pick button.on { background: var(--navy); color: #fff; }
