  :root {
    --petroleo-noturno: #0D3350; --amarelo-ladeira: #FFC21A; --creme: #F4F2EB; --azul-petroleo: #144A72;
    --laranja: #E8592B; --azul-nevoa: #DCE9EF; --grafite: #263439; --grafite-claro: #455c64; --teal-medio: #1A5C8E; --branco: #ffffff; --azul-brilhante: #3A9BDC;
    color-scheme: light; --page-bg: #f4f4f5;
  }
  html { font-size: 100%; }
  * { box-sizing: border-box; }
  body {
    margin: 0; min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 24px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(to bottom, rgba(0, 103, 192, .14), rgba(0, 103, 192, 0)) no-repeat, var(--page-bg); background-size: 100% 100vh, auto; color: #18181b;
  }
  h1 { margin: 0; font-size: 2rem; letter-spacing: .5px; }
  h1 { font-family: 'Monomaniac One', system-ui, sans-serif; font-weight: 400; font-size: 2.4rem; letter-spacing: 1px; }
  .app-logo { width: 88px; height: 88px; }
  .gpsa-blue-f { fill: #1A5C8E; }
  .version { margin: 0 0 24px; font-size: .9rem; opacity: .6; }
  .welcome { margin: 0 0 16px; font-size: 1rem; font-weight: 600; }
  .actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 280px; }
  button, .btn {
    padding: 16px; border: none; border-radius: 10px;
    background: #696d75; color: #fff; font-size: 1rem; font-weight: 600; letter-spacing: .5px;
    cursor: pointer; text-decoration: none;
    display: flex; align-items: center; justify-content: center; gap: 10px;
  }
  button:hover, .btn:hover { background: var(--teal-medio); }
  button:disabled { opacity: .45; cursor: not-allowed; }
  button:disabled:hover { background: #696d75; }
  .toggle-btn { justify-content: space-between; }
  .toggle-btn.on { background: #16a34a; }
  .toggle-btn.on:hover { background: #15803d; }
  .toggle-label { display: flex; align-items: center; gap: 10px; text-align: left; }
  .toggle-switch {
    position: relative; flex: none; width: 52px; height: 30px; border-radius: 999px;
    background: rgba(255, 255, 255, .3); transition: background .15s ease;
  }
  .toggle-switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px;
    border-radius: 50%; background: #fff; transition: transform .15s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  }
  .toggle-btn.on .toggle-switch { background: rgba(255, 255, 255, .5); }
  .toggle-btn.on .toggle-switch::after { transform: translateX(22px); }
  .split-btn { padding: 0; align-items: stretch; gap: 0; overflow: hidden; }
  .split-btn .split-icon {
    display: flex; align-items: center; justify-content: center;
    padding: 0 18px; background: rgba(0, 0, 0, .18);
    border-right: 3px solid var(--azul-brilhante);
    color: color-mix(in srgb, var(--azul-brilhante) 70%, white);
  }
  .split-org .split-icon { border-right-color: var(--laranja); color: color-mix(in srgb, var(--laranja) 70%, white); }
  .split-btn .split-label { flex: 1; min-width: 0; padding: 16px 12px 16px 10px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .split-btn .split-label small { display: block; margin-top: 2px; font-size: .72em; font-weight: 500; opacity: .85; }
  .split-btn .split-label small[hidden] { display: none; }
  #btn-continuar-mapa { border: 2px solid var(--laranja); }
  #btn-continuar-mapa .split-label { white-space: normal; line-height: 1.15; padding-top: 7px; padding-bottom: 7px; }
  #btn-continuar-mapa .split-label small { margin-top: 0; font-size: .88em; font-weight: 600; opacity: 1; }
  #btn-continuar-mapa .mapa-l1 { display: block; }
  #btn-continuar-mapa .mapa-off { font-size: .72em; font-weight: 500; opacity: .85; }
  #btn-continuar-mapa .mapa-off[hidden] { display: none; }
  .split-admin .split-label { color: color-mix(in srgb, var(--laranja) 70%, white); }
  .material-symbols-outlined { font-size: 1.375rem; line-height: 1; display: inline-block; width: 1em; overflow: hidden; white-space: nowrap; }
  .material-symbols-outlined.fill { font-variation-settings: 'FILL' 1; }
  .android-banner {
    position: fixed; left: 50%; bottom: 56px;
    transform: translate(-50%, 0) translateZ(0);
    display: flex; align-items: center; gap: 10px;
    width: max-content; max-width: calc(100% - 32px);
    padding: 10px 14px; border-radius: 10px;
    background: var(--grafite); color: #fff; text-decoration: none;
    z-index: 500;
  }
  .android-banner .material-symbols-outlined { color: #3DDC84; font-size: 1.625rem; }
  .android-banner .ab-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
  .android-banner .ab-title { font-size: .82rem; font-weight: 600; }
  .android-banner .ab-title b { color: #3DDC84; font-weight: 800; }
  .android-banner .ab-sub { font-size: .72rem; font-weight: 700; letter-spacing: .04em; color: #3DDC84; }
  .download-text { max-width: 320px; margin: 0 0 24px; font-size: .92rem; line-height: 1.4; opacity: .8; }
  .download-options { display: flex; gap: 14px; width: 100%; max-width: 320px; }
  .download-card {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px;
    padding: 36px 12px 20px; border-radius: 12px; color: #fff;
    background: linear-gradient(to top, var(--teal-medio), rgba(26, 92, 142, 0));
    text-shadow: 0 1px 3px rgba(0, 0, 0, .35);
  }
  .download-card .material-symbols-outlined { font-size: 2.125rem; }
  .download-card .apple-logo { color: #fff; }
  .download-card .dc-title { font-weight: 700; font-size: .95rem; }
  .download-card .dc-sub { font-size: .75rem; opacity: .85; text-align: center; }
  .download-footer { margin-top: 24px; }
  .sub { margin-top: 4px; padding-top: 12px; border-top: 1px dashed rgba(128,128,128,.4); }
  [hidden] { display: none !important; }
  form.actions input, form.actions select {
    padding: 12px 14px; border: 1px solid rgba(128,128,128,.4); border-radius: 8px;
    font-size: 1rem; background: #fff; color: #18181b;
  }
  .err { color: #dc2626; font-size: .9rem; margin: 0 0 4px; text-align: center; }
  .muted { opacity: .6; font-size: .85rem; margin-top: 16px; text-align: center; }
  a.link { color: inherit; opacity: .6; font-size: .85rem; }
  body:has(.back-pill) { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  a.back-pill {
    position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 400; padding: 10px 26px; border-radius: 999px;
    background: #696d75; color: #fff; font-size: .9rem; font-weight: 600; letter-spacing: .5px;
    text-decoration: none; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  }
  a.back-pill:hover { background: var(--teal-medio); }
    body.has-session-badge { padding-top: 56px; }
  .session-badge {
    position: fixed; top: 0; left: 0; right: 0;
    display: flex; align-items: center; gap: 10px;
    width: 100%; box-sizing: border-box;
    padding: 10px 14px;
    background: var(--teal-medio); color: #fff;
    border-bottom: 2px solid var(--amarelo-ladeira);
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
    z-index: 1000;
  }
  .sb-avatar {
    display: flex; align-items: center; justify-content: center; flex: none;
    width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.18);
    color: #fff; text-decoration: none;
    border: 2px solid #fff; box-sizing: border-box;
  }
  .sb-avatar.org { border-color: var(--laranja); }
  .sb-avatar:active { background: rgba(255,255,255,.32); }
  .sb-avatar .material-symbols-outlined { font-size: 1.25rem; }
  .sb-initials { font-size: .8rem; font-weight: 700; letter-spacing: .02em; }
  .sb-info { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
  .sb-info b { font-size: .92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-info small { font-size: .7rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; opacity: .85; }
  .sb-logout {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; flex: none;
    padding: 2px 10px; border-radius: 10px; border: 1px solid rgba(255,255,255,.55);
    color: #fff; text-decoration: none; font-size: .6rem; font-weight: 700; line-height: 1.1;
  }
  .sb-logout:active { background: rgba(255,255,255,.15); }
  .sb-logout .material-symbols-outlined { font-size: .95rem; }

  .modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, .45);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; z-index: 2000;
  }
  .modal-card {
    background: #fff; border-radius: 14px; padding: 24px; max-width: 340px; width: 100%;
    display: flex; flex-direction: column; gap: 14px; text-align: center;
  }
  .modal-card p { margin: 0; font-size: .95rem; color: var(--grafite); }
  .modal-card .warn-icon { font-size: 2.5rem; color: var(--laranja); }
  .modal-card a.link { color: var(--grafite); opacity: .75; }

  #competidor-extra { display: flex; flex-direction: column; gap: 12px; }
  .field { position: relative; width: 100%; display: flex; flex-direction: column; }
  .field .frame {
    display: flex; align-items: center; gap: 10px;
    border: 1.5px solid #c9c9cf; border-radius: 10px;
    padding: 14px 14px 12px; background: #fff;
    transition: border-color .15s ease;
  }
  .field .ic {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; color: #8b8b93; flex: none;
    transition: color .15s ease;
  }
  .field .ic svg { width: 18px; height: 18px; }
  .field .frame input, .field .frame select {
    flex: 1; min-width: 0; border: none; outline: none; background: transparent;
    font-size: 1rem; color: #18181b; font-family: inherit; letter-spacing: .02em;
    padding: 2px 0 0; border-radius: 0;
  }
  .field input::placeholder { color: transparent; }
  .field label {
    position: absolute; left: 38px; top: 21px; transform: translateY(-50%);
    font-size: 1rem; color: #8b8b93; pointer-events: none; background: transparent;
    padding: 0 5px; transition: all .15s ease; max-width: calc(100% - 50px); overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .field:has(input:focus) label,
  .field:has(input:not(:placeholder-shown)) label,
  .field:has(select:focus) label,
  .field:has(select option:checked:not(:empty)) label {
    top: 0; transform: translateY(-50%) scale(.78); left: 10px; padding: 0 6px;
    background: var(--page-bg); color: var(--teal-medio); font-weight: 600; max-width: none;
  }
  .field:has(input:focus) .frame,
  .field:has(select:focus) .frame { border-color: var(--teal-medio); box-shadow: 0 0 0 3px #1A5C8E1A; }
  .field:has(input:focus) .ic,
  .field:has(select:focus) .ic { color: var(--teal-medio); }
  .field:has(input:disabled) .frame,
  .field:has(select:disabled) .frame { background: #f2f3f5; }
  .field input:disabled, .field select:disabled {
    color: #8b8b93; opacity: 1; -webkit-text-fill-color: #8b8b93;
  }
  .field:has(input:disabled) .ic,
  .field:has(select:disabled) .ic { opacity: .6; }
  .ev-logo { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
  .ev-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
    margin: 0; padding: 6px; list-style: none; max-height: 264px; overflow-y: auto;
    background: #fff; border: 1.5px solid #c9c9cf; border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16); text-align: left;
  }
  .ev-list li {
    display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
    font-size: .95rem; color: #18181b; cursor: pointer;
  }
  .ev-list li:hover, .ev-list li.sel { background: var(--azul-nevoa); }
  .ev-list img { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; flex: none; }
  .ev-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .field-hint { font-size: .75rem; margin: -6px 2px 0; text-align: left; color: #8b8b93; min-height: 1em; }
  .field-hint.ok { color: #16a34a; }
  .field-hint.err { color: #dc2626; }
  .theme-switch {
    position: fixed; top: 12px; right: 12px; z-index: 900;
    display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .08);
  }
  :is(.session-badge, .event-bar) .theme-switch { position: static; flex: none; padding: 2px; background: rgba(255, 255, 255, .18); }
  :is(.session-badge, .event-bar) .theme-switch button { width: 24px; height: 24px; color: #fff; }
  :is(.session-badge, .event-bar) .theme-switch button .material-symbols-outlined { font-size: .95rem; }
  :is(.session-badge, .event-bar) .theme-switch button:hover { background: rgba(255, 255, 255, .18); }
  :is(.session-badge, .event-bar) .theme-switch button.on, :is(.session-badge, .event-bar) .theme-switch button.on:hover { background: #fff; color: var(--teal-medio); }
  .event-bar .theme-switch { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
  .theme-switch button {
    width: 34px; height: 34px; padding: 0; border-radius: 50%;
    background: transparent; color: #696d75;
  }
  .theme-switch button:hover { background: rgba(0, 0, 0, .08); }
  .theme-switch button.on, .theme-switch button.on:hover { background: var(--teal-medio); color: #fff; }
  body.has-event-bar { padding-top: 56px; }
  .event-bar {
    position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: var(--teal-medio); border-bottom: 2px solid var(--amarelo-ladeira);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
  }
  .eb-logo {
    height: calc(100% - 4px); aspect-ratio: 1; border-radius: 50%; background: #fff;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
  }
  .eb-logo img { width: 78%; height: 78%; object-fit: contain; }
  .session-badge .eb-logo { position: absolute; left: 50%; top: 2px; transform: translateX(-50%); z-index: 1; }

#splash {
  position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(to bottom, rgba(0, 103, 192, .14), rgba(0, 103, 192, 0)) no-repeat, var(--page-bg); background-size: 100% 100vh, auto;
  transition: opacity .3s ease;
}
#splash img { width: 160px; height: 160px; }
#splash p { margin: 0; font-size: 1rem; opacity: .6; }
#splash.out { opacity: 0; pointer-events: none; }
:root[data-theme="dark"] #splash { background: linear-gradient(to bottom, rgba(26, 92, 142, .45), rgba(26, 92, 142, 0)) no-repeat, var(--page-bg); background-size: 100% 100vh, auto; }

:root[data-theme="dark"] { color-scheme: dark; --page-bg: var(--petroleo-noturno); }
:root[data-theme="dark"] .gpsa-blue-f { fill: #FFFFFF; }
:root[data-theme="dark"] .gpsa-hub { fill: #3A9BDC; }
:root[data-theme="dark"] body {
  background: linear-gradient(to bottom, rgba(26, 92, 142, .45), rgba(26, 92, 142, 0)) no-repeat, var(--page-bg);
  background-size: 100% 100vh, auto; color: var(--creme);
}
:root[data-theme="dark"] button, :root[data-theme="dark"] .btn {
  background: var(--teal-medio); color: var(--creme); font-weight: 700;
}
:root[data-theme="dark"] button:hover, :root[data-theme="dark"] .btn:hover { background: #FFD24D; color: var(--azul-petroleo); }
:root[data-theme="dark"] button:disabled:hover { background: var(--amarelo-ladeira); }
:root[data-theme="dark"] .split-btn .split-icon { background: rgba(13, 51, 80, .42); border-right-color: var(--azul-brilhante); color: color-mix(in srgb, var(--azul-brilhante) 70%, white); }
:root[data-theme="dark"] .split-org .split-icon { border-right-color: var(--laranja); color: color-mix(in srgb, var(--laranja) 70%, white); }
:root[data-theme="dark"] .split-btn:hover .split-icon { color: color-mix(in srgb, var(--azul-brilhante) 60%, white); }
:root[data-theme="dark"] .split-org:hover .split-icon { color: color-mix(in srgb, var(--laranja) 60%, white); }
:root[data-theme="dark"] .split-admin .split-label { color: color-mix(in srgb, var(--laranja) 70%, white); }
:root[data-theme="dark"] .split-admin:hover .split-label { color: color-mix(in srgb, var(--laranja) 60%, white); }
:root[data-theme="dark"] .err { color: #FF9B7A; }
:root[data-theme="dark"] .field:has(input:focus) label,
:root[data-theme="dark"] .field:has(input:not(:placeholder-shown)) label,
:root[data-theme="dark"] .field:has(select:focus) label,
:root[data-theme="dark"] .field:has(select option:checked:not(:empty)) label { color: var(--amarelo-ladeira); }
:root[data-theme="dark"] .field:has(input:focus) .frame,
:root[data-theme="dark"] .field:has(select:focus) .frame { border-color: var(--amarelo-ladeira); box-shadow: 0 0 0 3px #FFC21A33; }
:root[data-theme="dark"] .field-hint { color: rgba(244, 242, 235, .65); }
:root[data-theme="dark"] .field-hint.ok { color: #6EE7A0; }
:root[data-theme="dark"] .field-hint.err { color: #FF9B7A; }
:root[data-theme="dark"] .session-badge { background: var(--grafite); color: var(--creme); border-bottom: 2px solid var(--amarelo-ladeira); }
:root[data-theme="dark"] .theme-switch { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .theme-switch button { background: transparent; color: var(--creme); }
:root[data-theme="dark"] .theme-switch button:hover { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] .theme-switch button.on,
:root[data-theme="dark"] .theme-switch button.on:hover { background: var(--amarelo-ladeira); color: var(--petroleo-noturno); }
:root[data-theme="dark"] :is(.session-badge, .event-bar) .theme-switch { background: rgba(255, 255, 255, .12); }
:root[data-theme="dark"] :is(.session-badge, .event-bar) .theme-switch button { color: var(--creme); }
:root[data-theme="dark"] :is(.session-badge, .event-bar) .theme-switch button.on,
:root[data-theme="dark"] :is(.session-badge, .event-bar) .theme-switch button.on:hover { background: var(--amarelo-ladeira); color: var(--petroleo-noturno); }
:root[data-theme="dark"] .event-bar { background: var(--grafite); }

  body:has(.page-center) { justify-content: flex-start; }
  .page-center {
    flex: 1; width: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  }
  .about-wrap { position: relative; display: flex; justify-content: center; width: 100%; padding-top: 16px; }
  .about-btn {
    width: 40px; height: 40px; padding: 0; border-radius: 50%;
    background: transparent; color: #696d75;
  }
  .about-btn .material-symbols-outlined { width: 1.3em; text-align: center; }
  .about-btn:hover { background: rgba(20, 74, 114, .1); color: var(--azul-petroleo); }
  .about-pop {
    position: absolute; left: 50%; bottom: calc(100% - 4px); z-index: 600;
    width: max-content; max-width: calc(100% - 32px);
    padding: 18px 22px; border-radius: 16px; background: #fff; color: #18181b;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .22), 0 1px 4px rgba(0, 0, 0, .12);
    text-align: center; line-height: 1.4;
    transform: translateX(-50%);
  }
  .about-pop::after {
    content: ""; position: absolute; left: 50%; bottom: -7px; width: 14px; height: 14px;
    background: #fff; transform: translateX(-50%) rotate(45deg);
    box-shadow: 3px 3px 6px rgba(0, 0, 0, .1);
  }
  .about-pop .ap-timer { position: absolute; top: 0; left: 14px; right: 14px; height: 2px; border-radius: 0 0 2px 2px; background: var(--azul-petroleo); transform-origin: left; }
  .about-pop.run .ap-timer { animation: ap-countdown 5s linear forwards; }
  @keyframes ap-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
  .about-pop .ap-head { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--azul-petroleo); font-weight: 700; letter-spacing: .06em; font-size: .8rem; }
  .about-pop .ap-head .material-symbols-outlined { font-size: 20px; }
  .about-pop .ap-name { margin-top: 10px; font-size: 1.1rem; font-family: 'Monomaniac One', system-ui, sans-serif; font-weight: 400; letter-spacing: 1px; }
  .about-pop a { color: var(--azul-petroleo); text-decoration: none; }
  .about-pop .ap-meta { font-size: .8rem; opacity: .65; }
  .about-pop .ap-dev { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e4e4e7; font-size: .85rem; color: #8b909a; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; }
  .about-pop .ap-dev a { color: inherit; }
  .about-pop .ap-dev .material-symbols-outlined { font-size: 16px; }

  body:has(#event-bar[data-always]) { padding-top: 56px; }
