/* Hallmark · shape: app screen · genre: playful · theme: Hum · v2.0.0 */
/* The entry emphasizes the invitation, while the dashboard emphasizes live distance. */
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 var(--font); }
[hidden] { display: none !important; }
.shell { width: min(100% - 2rem, 69rem); margin-inline: auto; }
.topbar { border-bottom: 1px solid var(--line); background: var(--card); }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.2rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; }
.brand img { border-radius: var(--radius-control); }
#driver-access h1 { margin-bottom: .65rem; }
main { padding-block: clamp(1.8rem, 4vw, 3.5rem) 3rem; }
h1, h2, summary, .big { font-family: var(--font-display); }
h1, h2 { margin: 0; line-height: 1.07; letter-spacing: -.035em; overflow-wrap: break-word; min-width: 0; text-wrap: balance; }
h1 { font-size: 2.35rem; font-weight: 760; margin-bottom: 1.25rem; }
h2 { font-size: 1.43rem; }
p { margin: .65rem 0 0; }
.small, .hint, figcaption { font-size: 1rem; color: var(--muted); }
.badge { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: .3rem .85rem; font-size: 1rem; font-weight: 700; text-align: center; }
.dark-badge { background: var(--pale); border-color: var(--pale); color: var(--navy); }
.dark-badge[data-active="true"] { background: var(--mint); border-color: var(--mint); }
.welcome { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr); align-items: stretch; border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-panel); }
.welcome-copy { padding: clamp(1.6rem, 5vw, 4rem); }
.welcome h1 { font-size: clamp(2.4rem, 5vw, 4.3rem); margin-bottom: 1rem; }
.welcome-copy > p:not(.small, .feedback) { font-size: 1.08rem; max-width: 32ch; color: var(--muted); }
.welcome-copy > button { margin-block: 1.5rem .4rem; }
.welcome-art { position: relative; min-height: 18rem; overflow: clip; background: var(--pale); border-radius: 0 var(--radius-panel) var(--radius-panel) 0; }
.art-ring, .art-home { position: absolute; inset: 50% auto auto 50%; translate: -50% -50%; aspect-ratio: 1; border-radius: 50%; }
.art-ring { width: var(--ring-width); border: 1px solid var(--ring-stroke); }
.ring-wide { --ring-width: 106%; }
.ring-mid { --ring-width: 75%; }
.ring-inner { --ring-width: 44%; background: var(--primary); border-color: var(--primary-edge); }
.art-home { width: 4.3rem; background: var(--navy); display: grid; place-items: center; }
.art-home span { width: 1.44rem; height: 1.44rem; background: var(--cream); clip-path: polygon(50% 0, 100% 42%, 90% 42%, 90% 100%, 60% 100%, 60% 65%, 40% 65%, 40% 100%, 10% 100%, 10% 42%, 0 42%); }
.art-bus { width: clamp(3rem, 8vw, 5rem); position: absolute; top: 20%; left: 66%; rotate: 10deg; border-radius: var(--radius-control); border: 2px solid var(--ink); }
.overview { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--navy); color: var(--cream); border-radius: var(--radius-panel); align-items: center; }
.overview-copy { padding: clamp(1.5rem, 4vw, 3.25rem); }
.overview h2 { font-size: clamp(1.95rem, 4vw, 3.25rem); margin: .8rem 0 .55rem; }
.overview p { color: var(--pale); }
.parent-overview { display: block; }
.parent-overview .overview-copy { padding: clamp(1.1rem, 3vw, 2rem); }
.driver-overview { grid-template-columns: 1fr; }
.map-panel { margin-top: 1rem; }
.map-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .8rem; }
#live-map { height: clamp(20rem, 49vh, 33rem); border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--pale); isolation: isolate; }
#live-map .leaflet-control-attribution { color: var(--ink); background: var(--card); font-family: var(--font); }
#live-map .leaflet-control-attribution a { color: var(--focus); text-decoration: underline; }
#live-map .leaflet-bar a { display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); background: var(--card); border-color: var(--line); }
#live-map .leaflet-bar a:focus-visible { outline: 3px solid var(--focus); outline-offset: -4px; }
#live-map.map-picking, #live-map.map-picking .leaflet-grab { cursor: crosshair; }
.map-instructions { margin: 0 0 .7rem; }
.map-footer .feedback { margin-bottom: 0; }
.map-pin { display: grid; place-items: center; border: 2px solid var(--ink); border-radius: var(--radius-control); color: var(--ink); background: var(--card); font: 750 .8rem/1 var(--font); }
.map-pin-servis { background: var(--primary); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 1rem; margin-top: 1rem; }
.stack { display: grid; gap: 1rem; }
.panel { border: 1px solid var(--line); background: var(--card); border-radius: var(--radius-panel); padding: clamp(1.1rem, 3vw, 1.65rem); }
.guide p { max-width: 46ch; }
form { display: grid; gap: .9rem; margin-top: 1rem; }
form > button { justify-self: start; }
form > .actions, form > .small { margin-top: 0; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .65rem; }
.clock { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: .4rem; }
.clock legend { margin-bottom: .3rem; }
label, legend { display: block; font-size: 1rem; font-weight: 700; }
input:not([type="checkbox"]), select { width: 100%; min-height: 44px; padding: .55rem .7rem; margin-top: .3rem; border: 1px solid var(--input-line); border-radius: var(--radius-control); color: var(--ink); background: var(--card); font: inherit; }
input[type="checkbox"] { accent-color: var(--navy); width: 1.5rem; height: 1.5rem; margin: 0; flex: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice { display: flex; align-items: center; min-height: 44px; gap: .55rem; }
.days { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.days label { display: flex; align-items: center; gap: .4rem; padding: .3rem .65rem; min-height: 48px; border: 1px solid var(--input-line); border-radius: var(--radius-control); background: var(--card); cursor: pointer; }
.days label:has(input:checked) { background: var(--primary); border-color: var(--primary-edge); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; transition: filter .15s var(--ease), translate .15s var(--ease), background-color .2s var(--ease); min-height: 48px; padding: .65rem 1rem; border-radius: var(--radius-control); font: inherit; font-size: 1.05rem; font-weight: 720; text-align: center; text-decoration: none; cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
.primary { color: var(--ink); background: var(--primary); border: 1px solid var(--primary-edge); box-shadow: 0 2px var(--primary-edge); }
.secondary { color: var(--ink); background: var(--card); border: 1px solid var(--input-line); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.overview :focus-visible { outline-color: var(--cream); }
button:not(:disabled):active { translate: 0 1px; }
@media (hover: hover) { button:not(:disabled):hover { filter: brightness(.96); } }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .85rem; }
.feedback { font-size: 1rem; font-weight: 650; }
.feedback:empty { display: none; }
.feedback[data-error="true"], .connection { color: var(--error); }
.overview .feedback[data-error="true"] { color: var(--cream); font-weight: 700; }
.connection { margin: 0 0 .75rem; font-weight: 650; }
.history { margin-top: 1rem; }
#events { margin: .75rem 0 0; padding: 0; list-style: none; }
#events li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem 1rem; padding-block: .65rem; border-top: 1px solid var(--line); }
#events time { color: var(--muted); font-size: .875rem; }
.big { width: 100%; min-height: 64px; font-size: 1.3rem; margin-top: 1rem; }
.go { color: var(--on-color); background: var(--go); border: 2px solid var(--cream); box-shadow: 0 3px var(--go-edge); }
.stop { color: var(--on-color); background: var(--stop); border: 2px solid var(--cream); box-shadow: 0 3px var(--stop-edge); }
.welcome .big { width: auto; padding-inline: 2.5rem; }
.whatsapp { color: var(--on-color); background: var(--go); border: 1px solid var(--go-edge); box-shadow: 0 2px var(--go-edge); }
.keep-open { margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--radius-control); background: rgb(255 255 255 / .1); color: var(--cream) !important; }
.driver-overview .badge { margin-top: 0; }
details.panel { margin-top: 1rem; }
summary { min-height: 48px; display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; font-weight: 760; cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; margin-left: auto; width: .7rem; height: .7rem; border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); rotate: 45deg; translate: 0 -.2rem; flex: none; }
details[open] > summary::after { rotate: 225deg; translate: 0 .2rem; }
.optional { font-size: 1rem; font-weight: 600; color: var(--muted); }
.steps { list-style: none; margin: .6rem 0 0; padding: 0; display: grid; gap: 0; }
.step { padding-block: 1.25rem; border-top: 1px solid var(--line); }
.step h2 { display: flex; align-items: center; gap: .65rem; font-size: 1.25rem; }
.step-mark { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: none; border-radius: 50%; background: var(--navy); color: var(--cream); font-size: 1.1rem; letter-spacing: 0; }
.step[data-done="true"] .step-mark { background: var(--go); color: var(--on-color); }
.field-label { margin-top: 1.1rem; }
.ios-guide { margin-top: .9rem; padding: .9rem 1rem; border: 2px solid var(--primary-edge); border-radius: var(--radius-control); background: var(--cream); }
.ios-guide p { margin: 0; }
.ios-guide ol { margin: .5rem 0 0; padding-left: 1.4rem; display: grid; gap: .4rem; }
.share-icon { width: 1.5rem; height: 1.5rem; vertical-align: -.35rem; margin-left: .2rem; color: var(--focus); }
.schedule > p { color: var(--muted); }
#live-map { position: relative; }
#live-map.map-picking::after { content: ""; position: absolute; inset: 50% auto auto 50%; width: 2.5rem; height: 2.5rem; translate: -50% -50%; z-index: 1000; pointer-events: none;
  background: linear-gradient(var(--stop), var(--stop)) center / 3px 100% no-repeat, linear-gradient(var(--stop), var(--stop)) center / 100% 3px no-repeat; }
#driver-link { margin-top: .8rem; }
@media (max-width: 43rem) {
  .welcome, .overview, .layout { grid-template-columns: minmax(0, 1fr); }
  .welcome-art { min-height: 15rem; border-radius: 0 0 var(--radius-panel) var(--radius-panel); }
  .overview-copy { padding-bottom: .75rem; }
  .driver-overview .overview-copy { padding-bottom: 1.4rem; }
  h1 { font-size: 2rem; }
}
@media (max-width: 28rem) {
  #schedule-form .fields { grid-template-columns: minmax(0, 1fr); }
}
.pick-actions { margin: 0 0 .8rem; }

/* Visual layer: flat, icon-led, friendly. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.3em; height: 1.3em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.role-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; border-radius: 99px; background: var(--pale); color: var(--navy); font-weight: 750; }
.welcome-copy > .eyebrow { display: inline-flex; align-items: center; gap: .45rem; margin: 0 0 1rem; padding: .35rem .8rem; border-radius: 99px; background: var(--pale); color: var(--navy); font-weight: 700; font-size: 1rem; }
.tile { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: var(--radius-control); font-size: 1.05rem; }
.tile-lg { width: 3.6rem; height: 3.6rem; font-size: 1.5rem; margin-bottom: .9rem; }
.tile-yellow { background: var(--primary); color: var(--ink); }
.tile-green { background: var(--go); color: var(--on-color); }
.tile-navy { background: var(--navy); color: var(--cream); }
.map-header h2, .history h2 { display: flex; align-items: center; gap: .7rem; }
summary .tile { width: 2.3rem; height: 2.3rem; }

.how { margin-top: 1.5rem; }
.how-list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.how-list li { display: grid; gap: .35rem; align-content: start; padding: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.how-list .tile { margin-bottom: .5rem; }
.how-list strong { font-family: var(--font-display); font-size: 1.15rem; }
.how-list span:last-child { color: var(--muted); }

.badge { display: inline-flex; align-items: center; gap: .5rem; }
.badge::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ring-stroke); flex: none; }
.badge[data-active="true"]::before { background: var(--go); box-shadow: 0 0 0 3px rgb(29 107 67 / .25); }
.parent-overview h2 { margin-top: .7rem; }

.route { position: relative; height: 3.4rem; margin: 1.2rem 0 .4rem; --bus: 0; --zone: 25%; }
.route-line { position: absolute; inset: 50% 1.7rem auto 1.7rem; height: 6px; translate: 0 -50%; border-radius: 3px; background: repeating-linear-gradient(90deg, var(--pale) 0 10px, transparent 10px 18px); opacity: .55; }
.route-zone { position: absolute; inset: -5px 0 -5px auto; width: var(--zone); border-radius: 8px; background: var(--primary); }
.route-bus, .route-home { position: absolute; top: 50%; display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%; translate: -50% -50%; font-size: 1.35rem; }
.route-home { left: calc(100% - 1.7rem); background: var(--cream); color: var(--navy); }
.route-bus { left: calc(1.7rem + (100% - 3.4rem) * var(--bus)); background: var(--primary); color: var(--ink); border: 3px solid var(--navy); z-index: 1; }
.route[data-state="idle"] .route-bus { background: var(--pale); color: var(--navy); }
.route[data-state="near"] .route-bus { box-shadow: 0 0 0 6px rgb(249 223 103 / .35); }
.geofence { display: flex; align-items: center; gap: .55rem; }
.geofence:has(#geofence-label:empty) { display: none; }

.driver-copy { display: grid; justify-items: start; }
.beacon { position: relative; display: grid; place-items: center; width: 5.5rem; height: 5.5rem; margin-bottom: 1.1rem; border-radius: 50%; background: var(--pale); color: var(--navy); font-size: 2.3rem; }
.beacon[data-wanted="true"] { background: var(--primary); color: var(--ink); }
.beacon::before, .beacon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--primary); opacity: 0; }
.beacon[data-active="true"]::before { opacity: .6; inset: -10px; }
.keep-open { display: flex; gap: .7rem; align-items: flex-start; }
.keep-open .icon { margin-top: .15rem; }

#events li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: .85rem; }
.event-mark { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--pale); color: var(--navy); }
#events li[data-kind="start"] .event-mark { background: var(--go); color: var(--on-color); }
#events li[data-kind="near"] .event-mark { background: var(--primary); color: var(--ink); }
#events li[data-kind="stop"] .event-mark { background: var(--navy); color: var(--cream); }
.event-body { display: grid; gap: .1rem; padding-top: .15rem; }

.map-pin { display: flex !important; align-items: center; justify-content: center; gap: .3rem; font: 750 .9rem/1 var(--font) !important; }
.map-pin .icon { width: 1.15rem; height: 1.15rem; }

@media (prefers-reduced-motion: no-preference) {
  .route-bus { transition: left .8s var(--ease); }
  .art-bus { animation: approach 3.5s var(--ease) infinite alternate; }
  .beacon[data-active="true"]::before, .beacon[data-active="true"]::after { inset: 0; opacity: 0; animation: pulse 2s ease-out infinite; }
  .beacon[data-active="true"]::after { animation-delay: 1s; }
  .badge[data-active="true"]::before { animation: blink 1.6s ease-in-out infinite; }
  details[open] > :not(summary) { animation: reveal .2s var(--ease); }
}
@keyframes approach { to { translate: -14% 22%; } }
@keyframes pulse { from { opacity: .7; scale: 1; } to { opacity: 0; scale: 1.6; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes reveal { from { opacity: 0; translate: 0 -4px; } }

@media (max-width: 43rem) {
  .how-list { grid-template-columns: minmax(0, 1fr); }
  .how-list li { grid-template-columns: auto minmax(0, 1fr); column-gap: .9rem; }
  .how-list .tile { grid-row: span 2; margin: 0; }
}

.background { margin-top: 1rem; }
.background h2 { display: flex; align-items: center; gap: .7rem; }
.bg-status { display: flex; align-items: center; gap: .55rem; font-weight: 700; }
.bg-status::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--ring-stroke); flex: none; }
.bg-status[data-on="true"] { color: var(--go); }
.bg-status[data-on="true"]::before { background: var(--go); box-shadow: 0 0 0 3px rgb(29 107 67 / .25); }
.bg-steps { margin: 1rem 0 0; padding-left: 1.4rem; display: grid; gap: 1.1rem; }
.bg-steps .actions { margin-top: .6rem; }
.manual-setup { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.manual-setup summary { font-size: 1.05rem; font-family: var(--font); font-weight: 700; min-height: 44px; }
.manual-setup dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem 1rem; align-items: center; margin: .8rem 0 0; }
.manual-setup dt { font-weight: 700; }
.manual-setup dd { margin: 0; }
.manual-setup input { margin-top: 0; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
