:root {
  --bg: #f2f5ef;
  --card: #ffffff;
  --ink: #132027;
  --line: #d4ddd2;
  --accent: #197c87;
  --comp-map-backdrop-z: 1200;
  --comp-map-layer-backdrop-z: 1301;
  --comp-help-backdrop-z: 1302;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Segoe UI", Tahoma, sans-serif; }
.wrap { max-width: 620px; margin: 0 auto; padding: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
h1 { margin: 0 0 12px 0; font-size: 30px; }
h2 { margin: 0 0 12px 0; font-size: 28px; }
label { display: block; margin: 8px 0 6px; font-weight: 700; font-size: 16px; }
input, select, textarea, button {
  width: 100%; border-radius: 10px; border: 1px solid #c9d4c8; padding: 12px; font-size: 22px;
}
textarea { min-height: 110px; }
button { background: var(--accent); color: #fff; border: 0; font-weight: 700; cursor: pointer; }
button.secondary { background: #6f9498; }
button:disabled { opacity: 0.5; }
.hidden { display: none !important; }
.msg { margin-top: 8px; padding: 10px; border-radius: 10px; border: 1px solid transparent; font-size: 19px; }
.ok { background: #e3f9e9; border-color: #8fd0a0; }
.err { background: #ffe5e5; border-color: #e4aaaa; }
.reqStar { color: #d93025; font-weight: 800; margin-left: 4px; }
#answerMsg.msg {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 23px;
  font-weight: 800;
}
.topRow { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.small { width: 120px; }
.headline { font-size: 23px; font-weight: 700; margin-bottom: 6px; }
.subline { font-size: 19px; color: #4f5a61; margin-bottom: 10px; }
.mainHead {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 12px;
}
.mainHeadLeft { flex: 1; min-width: 0; }
.mainCompName { font-size: 30px; font-weight: 800; line-height: 1.15; margin-bottom: 4px; }
.mainCompDesc { font-size: 16px; color: #4f5a61; margin-bottom: 6px; }
.mainAlias { font-size: 24px; font-weight: 700; }
.competitorRouteCard {
  padding-top: 12px;
  padding-bottom: 12px;
}
.competitorRouteSummary {
  font-size: 19px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.competitorMassStartSummary {
  margin-top: 6px;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.35;
  color: #4f5a61;
  overflow-wrap: anywhere;
}
.competitorRouteSummaryLabel {
  font-weight: 400;
}
.competitorRouteSummaryDistance,
.competitorMassStartValue {
  font-weight: 700;
  color: var(--ink);
}
.competitorRouteActions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.competitorRouteActions button {
  width: min(280px, 100%);
}
.mainHeadRight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  min-height: 100%;
  gap: 8px;
  padding-top: 10px;
  flex: 0 0 auto;
}
.smallActionBtn {
  width: 74px !important;
  min-width: 74px;
  padding: 8px 14px;
  font-size: 18px;
  line-height: 1.2;
  border-radius: 10px;
  text-align: center;
}
.langCompact {
  margin-top: auto;
  width: 74px;
  min-width: 74px;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1.2;
  border-radius: 10px;
}
@media (max-width: 520px) {
  .mainHeadLeft { padding-right: 84px; }
  .mainHeadRight {
    padding-top: 34px;
    gap: 10px;
  }
  .smallActionBtn {
    padding: 7px 12px;
  }
  .langCompact {
    min-width: 70px;
    width: 70px;
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (max-width: 420px) {
  .mainCompName { font-size: 28px; }
  .mainHeadLeft { padding-right: 94px; }
  .mainHeadRight { padding-top: 38px; }
  .smallActionBtn { font-size: 17px; }
  .competitorRouteSummary { font-size: 18px; }
  .competitorMassStartSummary { font-size: 18px; }
}
.progressBox {
  margin-top: 10px;
  border: 1px solid #cfe0d1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f7fbf7;
  font-size: 22px;
  font-weight: 700;
}
.answerCardBig { padding: 18px; }
.optionBtn { margin-bottom: 10px; text-align: left; font-size: 24px; font-weight: 700; padding: 16px; }
.opt0 { background: #dff7e4; color: #13321a; }
.opt1 { background: #ffe8c2; color: #3a2a08; }
.opt2 { background: #dcefff; color: #102a44; }
.opt3 { background: #f8dcff; color: #34103f; }
.opt4 { background: #ffe1dc; color: #461a10; }
.opt5 { background: #ebffd6; color: #1f3811; }

.modalBackdrop {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 999;
}
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
#helpBackdrop {
  /* Help must open above the fullscreen map and its layer picker. */
  z-index: var(--comp-help-backdrop-z);
}
.busyBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(19, 32, 39, 0.24);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1400;
}
.busyCard {
  min-width: min(320px, 92vw);
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid #d4ddd2;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
}
.busySpinner {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 4px solid #d4ddd2;
  border-top-color: var(--accent);
  animation: busySpin 0.9s linear infinite;
}
.busyText {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  color: #253238;
  text-align: center;
}
@keyframes busySpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.modal {
  width: 100%; max-width: 560px; background: #fff; border-radius: 14px; padding: 16px;
}
.modal h3 { margin: 0 0 10px 0; font-size: 28px; }
.joinLangRow {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.joinLangSelect {
  width: 86px;
  min-width: 86px;
  padding: 8px 10px;
  font-size: 18px;
  line-height: 1.2;
}
.joinReadonlyHint {
  margin-top: 6px;
  font-size: 16px;
  line-height: 1.35;
  color: #4f5a61;
}
.joinReadonlyCode {
  background: #edf4f2;
  color: #3a464c;
  cursor: default;
}
.competitorAppPromptBackdrop {
  z-index: 1100;
}
.competitorAppPromptModal {
  max-width: 520px;
}
.competitorAppPromptBody,
.competitorAppPromptHint {
  font-size: 20px;
  line-height: 1.45;
  color: #253238;
}
.competitorAppPromptHint {
  margin-top: 10px;
  color: #4f5a61;
}
.competitorAppPromptActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.competitorAppPromptActions button {
  flex: 1 1 220px;
}
.joinSwitchWarningBody {
  font-size: 20px;
  line-height: 1.45;
  color: #253238;
}
.joinSwitchWarningActions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.joinSwitchWarningActions button {
  flex: 1 1 220px;
}
.introCta { margin-top: 10px; font-size: 17px; color: #3f4b52; line-height: 1.35; }
.introCta a { color: #145a8a; font-weight: 700; text-decoration: underline; cursor: pointer; }
.introModal {
  width: min(960px, 96vw);
  max-width: 96vw;
}
.introModalTitle {
  margin: 0 0 10px 0;
  font-size: 30px;
}
.introBody { font-size: 18px; line-height: 1.45; color: #1d2830; }
.introBody img { max-width: 100%; height: auto; }
.introBodyScroll {
  border: 1px solid #d4ddd2;
  border-radius: 10px;
  padding: 10px;
  max-height: 62vh;
  overflow: auto;
}
.introActions {
  display: flex;
  justify-content: flex-end;
}
.introCloseBtn {
  width: auto !important;
  min-width: 90px;
  padding: 8px 14px;
  font-size: 16px;
  line-height: 1.2;
}
.termsBody {
  border: 1px solid #d4ddd2;
  border-radius: 10px;
  padding: 10px;
  max-height: 42vh;
  overflow: auto;
  font-size: 18px;
}
.termsBody p { margin: 0 0 10px 0; }
.termsBody p:last-child { margin-bottom: 0; }
.termsBody ul, .termsBody ol { margin: 0 0 10px 20px; }
.termsBody img { max-width: 100%; height: auto; }
.joinCaptchaIntro {
  margin: 0 0 12px 0;
  font-size: 18px;
  line-height: 1.4;
  color: #33424a;
}
.joinCaptchaWidgetWrap {
  display: flex;
  justify-content: center;
  margin: 0 0 12px 0;
  min-height: 82px;
}
#joinCaptchaWidget {
  min-width: 304px;
}
.feedback-ok { background: #0b7a35; color: #fff; }
.feedback-err { background: #d92424; color: #fff; }
.feedback-ok button, .feedback-err button { background: #fff; color: #000; }
#feedbackBackdrop { z-index: 1304; }
#feedbackBody,
#feedbackAnswerLine,
#feedbackDistanceLine,
#feedbackElapsedLine,
#feedbackRankLine {
  margin: 0 0 10px 0;
}
#feedbackRankLine {
  margin-bottom: 18px;
}
.mapBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: none;
  z-index: var(--comp-map-backdrop-z);
}
.mapPanel {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}
#compMapCanvas { flex: 1; min-height: 260px; }
.mapPanel .leaflet-control-scale {
  margin: 0 0 12px 12px;
}
.mapPanel .leaflet-control-scale-line {
  position: relative;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.15;
  text-shadow:
    -2px 0 0 #fff,
    2px 0 0 #fff,
    0 -2px 0 #fff,
    0 2px 0 #fff,
    -1.5px -1.5px 0 #fff,
    1.5px -1.5px 0 #fff,
    -1.5px 1.5px 0 #fff,
    1.5px 1.5px 0 #fff;
}
.mapPanel .leaflet-control-scale-line::before {
  content: "";
  position: absolute;
  inset: 0;
  border-left: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  pointer-events: none;
  filter:
    drop-shadow(-1px 0 0 #fff)
    drop-shadow(1px 0 0 #fff)
    drop-shadow(0 -1px 0 #fff)
    drop-shadow(0 1px 0 #fff);
}
.cp-special-div-icon {
  background: transparent;
  border: 0;
}
.cp-special-div-icon svg {
  display: block;
  overflow: visible;
}
.leaflet-tooltip.cp-order-tooltip {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  padding: 0 3px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  text-shadow:
    -2px 0 0 #fff,
    2px 0 0 #fff,
    0 -2px 0 #fff,
    0 2px 0 #fff,
    -1.5px -1.5px 0 #fff,
    1.5px -1.5px 0 #fff,
    -1.5px 1.5px 0 #fff,
    1.5px 1.5px 0 #fff;
}
.leaflet-tooltip.cp-order-tooltip.cp-order-red {
  color: #c0392b;
}
.leaflet-tooltip.cp-order-tooltip.cp-order-purple {
  color: #7d3c98;
}
.leaflet-tooltip-right.cp-order-tooltip:before,
.leaflet-tooltip-left.cp-order-tooltip:before,
.leaflet-tooltip-top.cp-order-tooltip:before,
.leaflet-tooltip-bottom.cp-order-tooltip:before {
  display: none;
}
.leaflet-popup.cpPopup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  padding: 0;
}
.leaflet-popup.cpPopup .leaflet-popup-content {
  margin: 0;
  min-width: 160px;
  max-width: 220px;
}
.cpPopupContent {
  padding: 10px 12px;
}
.cpPopupLine + .cpPopupLine {
  margin-top: 10px;
}
.cpPopupPoints {
  font-size: 17px;
  line-height: 1.2;
  color: #253238;
}
.cpPopupAction {
  display: flex;
}
.cpPopupAnswerBtn {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 600;
  text-align: center;
}
.cpPopupNoQuestion {
  width: 100%;
  padding: 2px 0;
  color: #5b6b73;
  font-size: 15px;
  line-height: 1.25;
}
.mapHeadingFab {
  position: absolute;
  right: 14px;
  bottom: 116px;
  width: 46px;
  height: 46px;
  border: 1px solid #cfd8dc;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 1250;
}
.mapHeadingFab svg {
  width: 24px;
  height: 24px;
  stroke: #607d8b;
  fill: none;
  stroke-width: 1.8;
}
.mapHeadingFab svg path {
  fill: #90a4ae;
  stroke: none;
}
.mapHeadingFab.is-off { opacity: 0.82; }
.mapHeadingFab.is-on {
  opacity: 1;
  background: #197c87;
  border-color: #197c87;
  box-shadow: 0 2px 12px rgba(25, 124, 135, 0.45);
}
.mapHeadingFab.is-on svg {
  stroke: #ffffff;
}
.mapHeadingFab.is-on svg path {
  fill: #ffffff;
}
.mapHeadingFab.is-waiting {
  border-color: #b0bec5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.mapHeadingDebug {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 1250;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: none;
  white-space: nowrap;
  max-width: calc(100vw - 120px);
  overflow: hidden;
  text-overflow: ellipsis;
}
.mapNorthIndicator {
  position: absolute;
  right: 10px;
  top: 52px;
  z-index: 1250;
  width: 68px;
  height: 68px;
  display: none;
  filter:
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 0 1px #ffffff)
    drop-shadow(0 0 1px #ffffff);
}
.mapNorthIndicator svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.mapNorthRing {
  fill: none;
  stroke: #61aef1;
  stroke-width: 8;
}
.mapNorthArrow {
  fill: #f14b16;
}
.mapStatusNote {
  position: absolute;
  left: 10px;
  bottom: 58px;
  z-index: 1250;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  line-height: 1.25;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  display: none;
  white-space: pre-line;
}
.compMapNotice {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 24px));
  margin: 0;
  z-index: 1251;
  display: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.compMapNotice.busy {
  padding-left: 44px;
  position: absolute;
}
.compMapNotice.busy::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  border: 3px solid rgba(25, 124, 135, 0.22);
  border-top-color: #197c87;
  border-radius: 50%;
  animation: busySpin 0.9s linear infinite;
}
@media (max-width: 520px) {
  .mapNorthIndicator {
    top: 56px;
    width: 62px;
    height: 62px;
  }
}
.mapActions {
  display: flex;
  gap: 8px;
  padding: 10px;
  padding-bottom: calc(10px + max(env(safe-area-inset-bottom, 0px), var(--funo-bottom-viewport-inset, 0px)));
  border-top: 1px solid #d4ddd2;
}
.mapActions button {
  width: auto;
  min-width: 0;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.2;
}
#compMapFollowBtn {
  flex: 0 1 auto;
  max-width: 132px;
  padding-inline: 10px;
  white-space: normal;
  word-break: keep-all;
}
.iconBtn {
  width: 42px !important;
  height: 42px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px !important;
}
.mapLayerList { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.mapLayerItem {
  width: 100%;
  text-align: left;
  background: #eef4ef;
  color: #132027;
  border: 1px solid #c9d4c8;
  padding: 10px 12px;
  font-size: 18px;
}
.mapLayerItem.active {
  background: #dff0f2;
  border-color: #6f9498;
  font-weight: 700;
}
#compMapLayerBackdrop { z-index: var(--comp-map-layer-backdrop-z); }
#mapQuestionBackdrop { z-index: 1303; }
.layerIconSvg {
  width: 22px;
  height: 22px;
  display: block;
}
.mapQuestionText {
  margin: 0 0 14px 0;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}
.mapQuestionActions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
.mapQuestionActions button {
  width: auto;
  min-width: 120px;
}
.myResCard { display:none; }
.myResCollapsed { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.myResCollapsed button {
  width: auto;
  min-width: 180px;
  display: block;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.myResProgress {
  border: 1px solid #cfe0d1;
  border-radius: 12px;
  padding: 10px 12px;
  background: #f7fbf7;
  font-size: 22px;
  font-weight: 700;
}
.myResInfoLine {
  font-size: 14px;
  color: #4f5a61;
  text-align: center;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}
.myResInfoLine a {
  color: #145a8a;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.myResExpanded { display: none; padding: 14px; }
.myResHead { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.myResTitle { margin:0; font-size:24px; }
.miniBtn {
  width: auto;
  min-width: 0;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 8px;
}
.myResTitleWrap {
  min-width: 0;
  flex: 1;
}
.myResSummary {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.35;
  color: #4f5a61;
  display: none;
}
.myResSummary strong {
  font-weight: 700;
  color: var(--ink);
}
.myResTable { width:100%; border-collapse: collapse; table-layout: fixed; }
.myResTable th, .myResTable td { border-bottom: 1px solid #e6ece5; padding: 8px 6px; text-align:left; vertical-align: top; font-size: 16px; }
.myResTable th { font-size: 15px; }
.myResTable th:nth-child(1),
.myResTable td:nth-child(1) {
  width: 26%;
}
.myResTable th:nth-child(2),
.myResTable td:nth-child(2) {
  width: 30%;
}
.myResTable th:nth-child(3) {
  white-space: normal;
  overflow-wrap: anywhere;
}
.myResTable th:nth-child(4) {
  white-space: nowrap;
}
.myResTable td:nth-child(3),
.myResTable td:nth-child(4) {
  white-space: nowrap;
}
.myResTable th:nth-child(3),
.myResTable td:nth-child(3) {
  width: 22%;
}
.myResTable th:nth-child(4),
.myResTable td:nth-child(4) {
  width: 22%;
}
.myResTable td:nth-child(4) {
  text-align: right;
}
.myResTable th > span {
  display: block;
}
.myResTable th .sortTiny {
  display: block;
  margin-top: 4px;
  margin-left: 0;
}
.sortTiny {
  width: auto;
  min-width: 0;
  display: inline;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  padding: 0;
  margin-left: 4px;
  border-radius: 0;
}
.kpLink { color:#145a8a; text-decoration: underline; background:none; border:0; padding:0; font:inherit; cursor:pointer; text-align:left; }
.ansList { list-style:none; padding:0; margin:10px 0 0; }
.ansList li { margin:5px 0; font-size:19px; }
.ansPicked { font-weight: 700; }
.okI { color:#198754; font-weight:800; margin-right:6px; }
.noI { color:#d93025; font-weight:800; margin-right:6px; }
