:root{--blue:#244fc0;--muted:#7188b5;--line:#dce4f2}*{box-sizing:border-box}body{margin:0;background:#fff;color:var(--blue);font-family:'Courier New',Courier,monospace;font-size:13px}button,a{-webkit-tap-highlight-color:transparent}header{margin:0 5%;height:114px;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:38px}.logo{font-size:34px;letter-spacing:-2px;font-weight:bold;color:inherit;text-decoration:none}.logo span{font-weight:normal;vertical-align:top;font-size:26px}.subtitle{font-size:11px}.edition{margin-left:auto;color:var(--muted);font-size:10px}main{margin:0 5%;display:grid;grid-template-columns:220px minmax(330px,1fr) 265px;min-height:720px}.people{padding:48px 28px 30px 0}.section-label{text-transform:uppercase;letter-spacing:1.4px;font-size:10px;color:var(--muted)}h1{font-size:25px;line-height:1.4;font-weight:normal;letter-spacing:-1px;margin:35px 0 18px}.intro,.visits-intro{font-size:11px;line-height:1.9;color:var(--muted)}nav{margin-top:44px;display:flex;flex-direction:column;gap:7px}nav button{width:100%;background:none;border:0;text-align:left;color:var(--blue);font:inherit;padding:15px 12px;cursor:pointer;display:flex;gap:15px;align-items:center}nav button small{font-size:10px;color:var(--muted)}nav button.active{background:#eff3fb}nav button .arrow{margin-left:auto}nav button:hover{background:#f5f7fc}button:focus-visible,a:focus-visible{outline:2px solid var(--blue);outline-offset:4px}.sample{font-size:10px;line-height:1.8;color:var(--muted);margin-top:70px}.atlas{border-left:1px solid var(--line);border-right:1px solid var(--line);padding:30px 20px;display:flex;flex-direction:column;justify-content:center;min-width:0}.map-top,.map-bottom{display:flex;justify-content:space-between;font-size:9px;color:var(--muted);gap:10px}.map-top{padding:0 10px 15px}.map-bottom{padding:20px 10px 0;font-size:8px}.map-bottom i{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--blue);margin-right:6px}svg{width:100%;height:auto;overflow:visible}.countries path{fill:white;stroke:#95abd1;stroke-width:1.2;stroke-linejoin:round}.countries .poland{fill:#f8faff;stroke:var(--blue);stroke-width:1.8}.country-labels text{font-size:9px;text-anchor:middle;fill:#8199c0;letter-spacing:1px}.country-labels .poland-label{fill:var(--blue);font-size:13px}.country-labels .sea{font-style:italic;font-size:11px;fill:#9cafcc}.compass path{stroke:#8199c0;fill:none}.compass text{font-size:10px;text-anchor:middle;fill:#8199c0}.marker{cursor:pointer;outline:none}.marker circle{fill:var(--blue);stroke:white;stroke-width:2}.marker .halo{fill:#244fc018;stroke:none}.marker text{fill:var(--blue);font-size:11px;paint-order:stroke;stroke:white;stroke-width:4px}.marker:hover .halo,.marker.selected .halo,.marker:focus .halo{fill:#244fc038}.visits{padding:48px 0 30px 30px}.person-heading{display:flex;align-items:center;justify-content:space-between;margin-top:36px;gap:10px}h2{font-size:24px;font-weight:normal;letter-spacing:-1px;margin:0}#count{font-size:10px;white-space:nowrap}.visits-intro{margin:18px 0 25px}ol{padding:0;margin:0;list-style:none}ol li{border-bottom:1px solid var(--line)}.visit-button{display:flex;align-items:center;gap:13px;padding:20px 0;width:100%;text-align:left;border:0;background:none;color:var(--blue);font:inherit;cursor:pointer}.visit-button:hover,.visit-button.selected{background:#f5f7fc}.visit-number{font-size:9px;color:var(--muted)}.city-info{display:flex;flex-direction:column;gap:8px}.city-info time{font-size:10px;color:var(--muted)}.visit-arrow{margin-left:auto;font-size:15px}.note{margin-top:37px;font-size:10px;line-height:1.9;color:var(--muted);position:relative}.note span{position:absolute;right:0;top:0;font-size:23px}footer{margin:0 5%;border-top:1px solid var(--line);padding:25px 0;display:flex;justify-content:space-between;font-size:9px;color:var(--muted)}@media(min-width:1500px){main{min-height:780px;grid-template-columns:260px minmax(330px,1fr) 300px}.atlas svg{max-height:690px}}@media(max-width:1000px){main{grid-template-columns:170px minmax(280px,1fr) 220px}.people{padding-right:15px}.visits{padding-left:20px}.atlas{padding:25px 10px}.edition{display:none}h1{font-size:22px}}@media(max-width:760px){header{height:90px;gap:20px}.subtitle{font-size:9px}main{display:flex;flex-wrap:wrap}.people{width:100%;padding:28px 0 20px}h1{margin:20px 0 10px}h1 br{display:none}.intro,.sample{display:none}nav{margin-top:20px;flex-direction:row;flex-wrap:wrap;gap:5px}nav button{width:auto;padding:12px}.atlas{width:100%;border:1px solid var(--line);padding:20px 10px}.atlas svg{max-height:540px}.visits{width:100%;padding:30px 0}.person-heading{margin-top:20px}.visits-intro{margin-bottom:10px}.note{margin-top:25px}footer{gap:20px;line-height:1.7}.map-bottom{font-size:8px}}

/* Liczba wizyt obejmuje także powroty do tych samych miejsc. */
nav button .person-count{margin-left:auto;font-size:10px;color:var(--muted)}
nav button.visited-person .person-name{text-decoration:underline;text-underline-offset:5px;text-decoration-thickness:1px}

/* Nieruchoma mapa i niezależne przewijanie list. */
#people,
#visits {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

@media (min-width: 761px) {
  body {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  header,
  footer {
    flex-shrink: 0;
  }

  main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }

  .people,
  .visits {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-top: clamp(16px, 4vh, 48px);
    padding-bottom: 16px;
  }

  .people > :not(#people),
  .visits > :not(#visits) {
    flex-shrink: 0;
  }

  #people,
  #visits {
    flex: 1;
  }

  #people {
    display: block;
    margin-top: 20px;
  }

  #people button + button {
    margin-top: 7px;
  }

  .sample,
  .note {
    margin-top: 20px;
  }

  .atlas {
    min-height: 0;
  }

  .atlas svg {
    flex: 1;
    min-height: 0;
    max-height: 100%;
  }

  .map-top,
  .map-bottom {
    flex-shrink: 0;
  }
}

@media (max-width: 760px) {
  #people {
    max-height: 200px;
    max-height: 30dvh;
  }

  #visits {
    max-height: 360px;
    max-height: 45dvh;
  }
}

/* Zwarte listy osób i miejsc. */
#people {
  gap: 2px;
}
#people button {
  padding-top: 8px;
  padding-bottom: 8px;
}
#people button + button {
  margin-top: 2px;
}
#visits .visit-button {
  padding-top: 10px;
  padding-bottom: 10px;
}

/* Niższy nagłówek i listy bez tekstów instrukcji. */
header { height: 76px; }
.logo { font-size: 28px; }
.logo span { font-size: 22px; }
#visits { margin-top: 20px; }
@media (max-width: 760px) {
  header { height: 64px; }
}

/* Data obok nazwy miejsca. */
#visits .city-info {
  flex: 1;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 10px;
  min-width: 0;
}
#visits .city-info time { white-space: nowrap; }

/* Wybrane miejsca na mapie wyróżnione czerwienią. */
.marker.selected circle:not(.halo) {
  fill: #d32f2f;
}
.marker.selected .halo {
  fill: #d32f2f26;
}
.marker.selected text {
  fill: #d32f2f;
}

/* Czerwone wyróżnienie powiązanych osób i wyjazdów. */
#people button.active,
#people button.visited-person,
#visits .visit-button.selected {
  color: #d32f2f;
  background: #d32f2f0d;
}
#people button.active small,
#people button.active .person-count,
#people button.visited-person small,
#people button.visited-person .person-count,
#visits .visit-button.selected .visit-number,
#visits .visit-button.selected time {
  color: #d32f2f;
}

/* Większa mapa, z mniejszym marginesem przy kolumnach. */
.atlas { padding-left: 6px; padding-right: 6px; }

/* Rok i miesiąc oraz nazwa noclegu przy wyjeździe. */
#visits .trip-details { font-size: 10px; line-height: 1.6; color: var(--muted); }
#visits .visit-button.selected .trip-details { color: #d32f2f; }

/* Data bezpośrednio po nazwie miejsca, oddzielona myślnikiem. */
#visits .city-info { display: block; }
#visits .trip-details { margin-left: 6px; }

/* Krótka notatka o wybranym wyjeździe pod mapą. */
.trip-description {
  flex-shrink: 0;
  margin: 20px 10px 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.trip-description h3 { margin: 0 0 8px; font-size: 12px; font-weight: normal; }
.trip-description p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
  max-height: 100px;
  overflow-y: auto;
}

/* Linie do podpisów blisko położonych miejsc w Tatrach. */
.marker .label-leader { fill: none; stroke: #95abd1; stroke-width: .8; }
.marker.selected .label-leader { stroke: #d32f2f; }

/* Czerwone punkty i poświata na mapie. */
.marker.selected circle:not(.halo) { fill: #d32f2f; }
.marker.selected .label-leader { stroke: #d32f2f; }

#edit-data { border: 0; background: none; padding: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
#editor { width: min(760px, 94vw); max-height: 85dvh; padding: 28px; border: 1px solid var(--line); color: var(--blue); font: inherit; overflow-y: auto; }
#editor::backdrop { background: #172b5266; }
#editor [hidden] { display: none; }
#editor h2 { font-size: 21px; margin-bottom: 20px; }
#editor h3 { margin-top: 28px; }
#editor label { display: block; margin: 12px 0; line-height: 1.6; }
#editor input:not([type=checkbox]), #editor select, #editor textarea { display: block; width: 100%; padding: 8px; border: 1px solid var(--line); background: white; color: var(--blue); font: inherit; }
#editor button { padding: 8px 12px; border: 1px solid var(--line); color: var(--blue); background: #eff3fb; font: inherit; cursor: pointer; }
#editor fieldset { border: 1px solid var(--line); margin: 20px 0; padding: 16px; }
.editor-help { color: var(--muted); font-size: 11px; line-height: 1.8; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
#editor .participant-options { display: flex; flex-wrap: wrap; gap: 4px 18px; }
#editor .participant-options label { margin: 4px 0; }
#login-error, #save-error { color: #d32f2f; }
#load-status { margin: 8px 5%; font-size: 11px; color: #d32f2f; }
#load-status[hidden] { display: none; }
#editor button:disabled, #edit-data:disabled { opacity: .5; cursor: wait; }

/* Pełna edycja osób, miejsc i wyjazdów. */
.editor-person-row { display: flex; align-items: end; gap: 12px; margin-bottom: 10px; }
.editor-person-row label { flex: 1; min-width: 0; }
#editor .editor-person-row button { margin-bottom: 12px; }
#editor [data-position-place][aria-pressed="true"] { color: #d32f2f; border-color: #d32f2f; }
#editor [data-remove-person], #editor [data-remove-place], #editor [data-remove-trip] { color: #b32626; }
#editor-map-panel { border: 1px solid var(--line); margin-top: 18px; padding: 12px; }
#editor-map { max-width: 500px; margin: auto; }
#editor-map svg { display: block; max-height: 330px; cursor: crosshair; }
#editor-map svg:focus-visible { outline: 2px solid var(--blue); }

/* Odsunięte podpisy, widoczne również na telefonach. */
.marker text { font-size: 12px; stroke-width: 6px; }
.marker .label-leader { stroke-width: 1px; stroke-opacity: .65; }
#editor [data-position-label][aria-pressed="true"] { color: #d32f2f; border-color: #d32f2f; }
