/* ByTheWay · demo — sistema de diseño de la v1.0 (utils/theme.js) */
@font-face { font-family: 'League Spartan'; src: url(fonts/league-spartan-latin.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215; }
@font-face { font-family: 'League Spartan'; src: url(fonts/league-spartan-latin-ext.woff2) format('woff2'); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --black: #0B0C0C; --yellow: #FFD60A; --orange: #FF8F35;
  --gray100: #F1F1F1; --gray500: #CCCCCC; --gray700: #6b6b6b; --white: #FFFFFF;
  --success: #4CAF50; --error: #F44336; --info: #2196F3;
  --radius: 12px; --shadow: 0 2px 8px rgba(0,0,0,.10);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Tamaño por defecto de los iconos; las reglas posteriores lo ajustan por contexto */
svg[aria-hidden="true"]:not(.leaflet-zoom-animated):not(.leaflet-zoom-hide) { width: 22px; height: 22px; flex: none; }
html, body { margin: 0; height: 100%; font-family: 'League Spartan', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--black); background: #e8e6df; }
body { display: flex; align-items: center; justify-content: center; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* Marco del teléfono en escritorio; pantalla completa en móvil */
.stage { display: flex; gap: 32px; align-items: center; justify-content: center; padding: 16px; width: 100%; }
.side { max-width: 280px; font-size: 15px; line-height: 1.45; display: none; }
.side h1 { font-size: 26px; margin: 0 0 8px; }
.side p { margin: 0 0 10px; color: #3b3b3b; }
.side .tag { display: inline-block; background: var(--black); color: var(--yellow); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 99px; margin-bottom: 10px; letter-spacing: .04em; }
.side a { color: var(--black); font-weight: 600; }
@media (min-width: 900px) { .side { display: block; } }
.phone { position: relative; width: 390px; height: min(820px, calc(100vh - 32px)); background: var(--white); border-radius: 38px; border: 10px solid var(--black); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25); display: flex; flex-direction: column; }
@media (max-width: 520px) { .stage { padding: 0; } .phone { width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; box-shadow: none; } }
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.demo-pill { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--black); color: var(--yellow); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 99px; letter-spacing: .04em; pointer-events: none; opacity: .92; }

/* Pantallas */
.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--white); animation: slide .25s cubic-bezier(0,0,.2,1); }
@keyframes slide { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.scroll.gray { background: var(--gray100); }
.topbar { display: flex; align-items: center; gap: 8px; padding: max(30px, calc(env(safe-area-inset-top) + 12px)) 16px 10px; }
.topbar h2 { margin: 0; font-size: 20px; font-weight: 600; flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--gray100); display: grid; place-items: center; position: relative; flex: none; }
.icon-btn svg { width: 22px; height: 22px; }
.badge-n { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 99px; background: var(--orange); color: var(--black); font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
h1.title { font-size: 28px; font-weight: 700; line-height: 36px; margin: 0 0 6px; }
.sub { color: var(--gray700); font-size: 14px; margin: 0 0 16px; }
.section-title { font-size: 16px; font-weight: 600; margin: 18px 0 8px; }
.caption { font-size: 12px; color: var(--gray700); }

/* Botones */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 24px; border-radius: 8px; border: 1px solid var(--black); background: var(--black); color: var(--white); font-weight: 600; font-size: 16px; transition: transform .15s, opacity .15s; }
.btn:active { transform: scale(.95); }
.btn.secondary { background: transparent; color: var(--black); }
.btn.yellow { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.btn.danger { background: var(--error); border-color: var(--error); }
.btn.small { width: auto; padding: 8px 14px; font-size: 14px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.stack { display: grid; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.link { background: none; border: 0; padding: 4px; font-weight: 600; text-decoration: underline; }

/* Campos */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; }
.input, .select { width: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--gray500); background: var(--white); font-size: 16px; }
.input:focus, .select:focus { outline: 2px solid var(--yellow); border-color: var(--black); }
.error-text { color: var(--error); font-size: 13px; margin-top: -8px; margin-bottom: 10px; }
input[type=range] { accent-color: var(--black); width: 100%; }

/* Tarjetas */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.card.click { cursor: pointer; transition: transform .15s; }
.card.click:active { transform: scale(1.02); }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--gray100); flex: none; }
.avatar.lg { width: 84px; height: 84px; }
.avatar.xl { width: 104px; height: 104px; }
.name { font-weight: 600; font-size: 16px; line-height: 1.1; }
.uname { font-size: 12px; color: var(--gray700); }
.rating { display: inline-flex; align-items: center; gap: 4px; background: var(--gray100); border-radius: 99px; padding: 3px 8px; font-size: 13px; font-weight: 600; }
.rating svg { width: 14px; height: 14px; fill: var(--yellow); stroke: var(--black); }
.route { display: grid; grid-template-columns: 16px 1fr; gap: 2px 8px; margin: 12px 0; align-items: center; }
.route .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--black); justify-self: center; }
.route .dot.end { background: var(--yellow); border: 2px solid var(--black); }
.route .line { width: 2px; height: 12px; background: var(--gray500); justify-self: center; }
.route span { font-size: 15px; font-weight: 500; }
.info { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: #3b3b3b; }
.info span { display: inline-flex; align-items: center; gap: 4px; }
.info svg { width: 16px; height: 16px; }
.price { background: var(--yellow); border-radius: 8px; padding: 6px 10px; font-weight: 700; font-size: 18px; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 10px; font-size: 13px; font-weight: 600; }
.status svg { width: 16px; height: 16px; }
.st-open { background: var(--yellow); color: var(--black); } .st-pending, .st-request { background: var(--orange); color: var(--black); }
.st-confirmed { background: var(--info); color: var(--white); } .st-live { background: var(--black); color: var(--white); }
.st-done { background: var(--gray500); color: var(--black); } .st-cancelled { background: var(--error); color: var(--white); }
.compat { color: var(--success); font-weight: 600; }

/* Chips y tarjetas de selección (TagSelector / RoleCard / AvatarSelector) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--gray500); background: var(--white); border-radius: 99px; padding: 8px 14px; font-weight: 500; font-size: 15px; }
.chip.on { background: var(--yellow); border-color: var(--black); font-weight: 600; }
.role { display: flex; gap: 12px; align-items: center; border: 1px solid var(--gray500); border-radius: var(--radius); padding: 12px; background: var(--white); text-align: left; width: 100%; margin-bottom: 8px; }
.role.on { border: 2px solid var(--black); background: #fffbe0; }
.role svg { width: 28px; height: 28px; }
.role b { display: block; } .role small { color: var(--gray700); }
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatars button { border: 3px solid transparent; border-radius: 50%; padding: 0; background: none; }
.avatars button.on { border-color: var(--black); }
.avatars img { width: 100%; border-radius: 50%; display: block; }
.stepper { display: flex; gap: 6px; margin: 4px 0 14px; }
.stepper i { flex: 1; height: 6px; border-radius: 99px; background: var(--gray500); }
.stepper i.on { background: var(--yellow); }

/* Pestañas inferiores */
.tabbar { display: flex; border-top: 1px solid var(--gray100); background: var(--white); padding: 6px 4px max(10px, env(safe-area-inset-bottom)); }
.tab { flex: 1; border: 0; background: none; display: grid; gap: 2px; justify-items: center; font-size: 11px; font-weight: 600; color: var(--gray700); padding: 4px 0; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--black); }
.tab.on::before { content: ''; position: absolute; top: -7px; width: 28px; height: 4px; border-radius: 99px; background: var(--yellow); }
.tab.plus .circle { width: 46px; height: 46px; border-radius: 50%; background: var(--black); color: var(--yellow); display: grid; place-items: center; margin-top: -18px; box-shadow: var(--shadow); }
.tab.plus .circle svg { width: 26px; height: 26px; }
.tab.plus.on::before { display: none; }

/* Splash y acceso */
.splash { background: var(--yellow); align-items: center; justify-content: center; text-align: center; display: flex; flex-direction: column; gap: 14px; }
.splash img { width: 240px; }
.splash .loader { width: 120px; height: 6px; background: rgba(0,0,0,.15); border-radius: 99px; overflow: hidden; }
.splash .loader i { display: block; height: 100%; width: 0; background: var(--black); animation: load 1.4s ease-out forwards; }
@keyframes load { to { width: 100%; } }
.hero { background: var(--yellow); padding: 56px 24px 28px; text-align: center; border-radius: 0 0 28px 28px; }
.hero img { width: 210px; }
.hero p { margin: 6px 0 0; font-weight: 600; font-size: 18px; }

/* Home */
.greet { display: flex; align-items: center; gap: 12px; padding: max(32px, calc(env(safe-area-inset-top) + 14px)) 16px 6px; }
.greet .hi { flex: 1; } .greet small { color: var(--gray700); display: block; }
.greet b { font-size: 22px; }
.quick { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--gray100); border: 0; border-radius: 99px; padding: 14px 18px; font-size: 16px; color: var(--gray700); text-align: left; }
.quick svg { width: 22px; height: 22px; color: var(--black); }
.mapbox { position: relative; border-radius: var(--radius); overflow: hidden; background: #eef0ea; margin: 10px 0 14px; box-shadow: var(--shadow); }
.leafmap { position: relative; z-index: 0; isolation: isolate; width: 100%; background: #e8e6df; font-family: inherit; }
.leaflet-container { font-family: inherit; }
.btw-pin-wrap { background: none; border: 0; }
.btw-pin { display: block; width: 18px; height: 18px; border-radius: 50%; background: var(--yellow); border: 3px solid var(--black); box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.btw-pin.campus { background: var(--black); border-color: var(--yellow); }
.btw-av { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--white); border: 3px solid var(--yellow); box-shadow: 0 2px 8px rgba(0,0,0,.4); overflow: hidden; cursor: pointer; transition: transform .15s; }
.btw-av.mine { border-color: var(--orange); }
.btw-av:hover { transform: scale(1.12); }
.btw-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.btw-car { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--black); color: var(--yellow); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.btw-car svg { width: 20px; height: 20px; }
.btw-tip { font-family: inherit; font-weight: 700; font-size: 11px; border: 0; border-radius: 6px; padding: 2px 6px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.leaflet-control-attribution { font-size: 9px !important; }
.map-full { position: absolute; top: 8px; right: 8px; z-index: 5; width: 38px; height: 38px; border-radius: 10px; border: 2px solid rgba(0,0,0,.25); background: var(--white); display: grid; place-items: center; box-shadow: 0 1px 5px rgba(0,0,0,.3); padding: 0; }
.map-full svg { width: 20px; height: 20px; }
.mapbox.full { position: absolute; inset: 0; z-index: 45; margin: 0; border-radius: 0; box-shadow: none; background: #e8e6df; }
.mapbox.full .leafmap { height: 100%; }
.mapbox.full .map-full { top: 34px; background: var(--yellow); border-color: var(--black); }
.mapnote { position: absolute; right: 8px; bottom: 6px; font-size: 10px; background: rgba(255,255,255,.85); padding: 2px 6px; border-radius: 6px; color: var(--gray700); }
.seg { display: flex; background: var(--gray100); border-radius: 99px; padding: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 99px; font-weight: 600; }
.seg button.on { background: var(--black); color: var(--white); }
.banner { background: var(--black); color: var(--white); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.banner b { color: var(--yellow); }
.empty { text-align: center; padding: 28px 10px; color: var(--gray700); }
.empty img { width: 90px; opacity: .9; margin-bottom: 8px; }

/* Chats */
.chatrow { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--gray100); cursor: pointer; }
.chatrow .t { flex: 1; min-width: 0; }
.chatrow p { margin: 2px 0 0; color: var(--gray700); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msgs { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 80%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.3; }
.bubble.me { align-self: flex-end; background: var(--black); color: var(--white); border-bottom-right-radius: 4px; }
.bubble.other { align-self: flex-start; background: var(--gray100); border-bottom-left-radius: 4px; }
.bubble small { display: block; opacity: .6; font-size: 11px; margin-top: 3px; }
.composer { display: flex; gap: 8px; padding: 10px 12px 14px; border-top: 1px solid var(--gray100); }
.composer .input { border-radius: 99px; }

/* Universo */
.level { background: var(--black); color: var(--white); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.level b.n { color: var(--yellow); font-size: 22px; }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.2); margin: 10px 0 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--yellow); border-radius: 99px; transition: width .4s; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--gray100); border-radius: var(--radius); padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 20px; } .stat span { font-size: 12px; color: var(--gray700); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reward { text-align: center; padding: 14px 8px; }
.reward svg { width: 34px; height: 34px; }
.reward .cost { font-weight: 700; margin: 4px 0 8px; }
.badge-i { text-align: center; padding: 12px 6px; border-radius: var(--radius); background: var(--gray100); }
.badge-i.off { opacity: .45; filter: grayscale(1); }
.badge-i svg { width: 30px; height: 30px; }
.menu { list-style: none; margin: 0; padding: 0; }
.menu li { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--gray100); cursor: pointer; font-weight: 500; }
.menu li svg { width: 22px; height: 22px; }
.menu li .go { margin-left: auto; opacity: .4; }

/* Seguimiento */
.followmap { position: relative; background: #eef0ea; }
.steps { display: grid; gap: 10px; margin: 14px 0; }
.step { display: flex; gap: 10px; align-items: center; opacity: .4; font-weight: 500; }
.step i { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--black); display: grid; place-items: center; flex: none; }
.step.on { opacity: 1; font-weight: 700; } .step.on i { background: var(--yellow); }
.step.done { opacity: 1; } .step.done i { background: var(--black); color: var(--yellow); }
.step i svg { width: 12px; height: 12px; }
.stars { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
.stars button { border: 0; background: none; padding: 2px; }
.stars svg { width: 34px; height: 34px; fill: none; stroke: var(--black); }
.stars button.on svg { fill: var(--yellow); }

/* Hoja modal y avisos */
.overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--white); border-radius: 24px 24px 0 0; padding: 18px 16px 22px; width: 100%; max-height: 88%; overflow-y: auto; animation: up .25s cubic-bezier(0,0,.2,1); }
@keyframes up { from { transform: translateY(30px); opacity: .6; } }
.sheet h3 { margin: 0 0 4px; font-size: 20px; }
.toast { position: absolute; left: 16px; right: 16px; bottom: 82px; z-index: 60; background: var(--black); color: var(--white); padding: 12px 14px; border-radius: 10px; font-weight: 500; animation: up .25s; display: flex; gap: 8px; align-items: center; }
.toast svg { width: 18px; height: 18px; color: var(--yellow); flex: none; }
.note { font-size: 12px; color: var(--gray700); background: #fff9d6; border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.seats { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 14px 0; }
.seats b { font-size: 40px; min-width: 50px; text-align: center; }
.seats button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--black); background: var(--white); font-size: 24px; font-weight: 700; }
.bigcard { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; border: 1px solid var(--gray500); background: var(--white); border-radius: var(--radius); padding: 14px; margin-bottom: 10px; }
.bigcard svg { width: 30px; height: 30px; flex: none; }
.bigcard b { display: block; } .bigcard small { color: var(--gray700); }

/* Servicio real */
.tab .badge-n { top: 0; right: calc(50% - 22px); }
.pending-box { background: var(--gray100); border-radius: 10px; padding: 10px 12px; margin-top: 10px; }
.pending-box .row { margin-top: 6px; }
.live-line { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(76,175,80,.6); animation: pulse 1.6s infinite; flex: none; }
.live-dot.off { background: var(--gray500); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(76,175,80,0); } 100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); } }
.countdown { font-size: 34px; font-weight: 700; text-align: center; margin: 4px 0; }
.offline { position: absolute; top: 0; left: 0; right: 0; z-index: 70; background: var(--error); color: #fff; text-align: center; font-size: 13px; font-weight: 600; padding: 4px; }

/* Servicio real: la app ocupa la pantalla (móvil) o se muestra con marco de teléfono (escritorio) */
body.standalone-app { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; }
body.standalone-app .phone { margin: 0; }
@media (max-width: 520px) { body.standalone-app { display: block; } body.standalone-app .phone { padding-top: env(safe-area-inset-top); } .tabbar { padding-bottom: env(safe-area-inset-bottom); } }
.offline { background: var(--black); color: #fff; font-size: 13px; text-align: center; padding: 6px 10px; position: relative; z-index: 5; }
