/* Telefon: jeden panel naraz (Mapa · Miejsca · Obok · Trasa) przełączany dolnym paskiem, rozwijane sekcje,
   przewijane chipy zamiast zawijanych przycisków. Na szerokich ekranach działa tylko część „acc/metro/plan”. */

/* --- rozwijane sekcje (wszędzie) */
details.acc {
  border-top: 1px solid var(--line, #d0d0d0);
  margin: 10px 0 0;
}
details.acc > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 2px;
  font-weight: 600;
  -webkit-user-select: none;
  user-select: none;
}
details.acc > summary::-webkit-details-marker {
  display: none;
}
details.acc > summary::after {
  content: "▾";
  font-size: 12px;
  color: #666;
  transition: transform 0.2s;
}
details.acc[open] > summary::after {
  transform: rotate(180deg);
}
details.acc > summary .sum-meta {
  font-weight: 400;
  font-size: 12px;
  color: #666;
  margin-left: auto;
  text-align: right;
}
details.acc > :not(summary) {
  margin-bottom: 8px;
}
.mta-d summary {
  cursor: pointer;
}

/* --- metro na żywo */
.metro-box .metro-station {
  margin: 6px 0 10px;
}
.metro-box h4 {
  margin: 0 0 4px;
  font-size: 14px;
}
.metro-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #eee;
  font-size: 13px;
}
.metro-row .dest {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metro-row .mins {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  white-space: nowrap;
}
.bullet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font: 700 12px/1 system-ui, sans-serif;
  flex: none;
}
.metro-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- plan dnia */
.timeline {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e8;
}
.timeline .t-time {
  font: 700 17px/1.1 var(--serif, Georgia, serif);
  font-variant-numeric: tabular-nums;
}
.timeline .textbutton {
  font: 700 16px/1.25 system-ui, sans-serif;
  padding: 0;
  text-align: left;
  min-height: 0;
}
.timeline .walk {
  color: #555;
  font-size: 12px;
}
.timeline .t-body p {
  margin: 4px 0;
}
.timeline .t-flag {
  font-size: 12px;
  color: #8a1c1c;
}
.plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
}
.plan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.plan-b {
  background: #f6f4ee;
  border: 1px solid #e3dfd3;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 10px 0;
}
.plan-b h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.plan-b p {
  margin: 4px 0;
  font-size: 13px;
}
.plan-b-item {
  color: #555;
}
.plan-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.plan-item-actions button {
  font-size: 13px;
  padding: 6px 10px;
}
.plan-swap {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  background: #fafafa;
}
.plan-swap .chips {
  margin: 4px 0 8px;
}
.plan-swap .chip {
  text-align: left;
  white-space: normal;
  max-width: 100%;
}
.plan-nav {
  margin: 10px 0;
}
.plan-nav a.alt {
  background: #fff;
  color: #111;
  border: 1px solid #111;
}
.plan-undo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin: 10px 0;
  background: #171717;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
}
.plan-undo .textbutton {
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  min-height: 0;
}
.timeline li.done {
  color: #888;
}
.timeline li.done .t-body strong {
  text-decoration: line-through;
}

/* --- mapa offline, powiadomienia */
.offline-card progress {
  width: 100%;
  height: 12px;
}
.offline-card .areas {
  display: grid;
  gap: 2px;
}
.push-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 6px 0;
}

/* --- okno „Więcej” (bottom sheet) */
dialog.sheet {
  margin: auto 0 0;
  width: 100%;
  max-width: none;
  border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
}
dialog.sheet .sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
dialog.sheet button {
  min-height: 48px;
  text-align: left;
}
dialog.sheet .sheet-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
}

/* --- elementy tylko-telefon domyślnie ukryte */
.cat-chips,
.map-fab,
.mobile-nav {
  display: none;
}
body.is-ios .ios-only {
  display: block;
}

@media (max-width: 700px) {
  /* nagłówek: tylko marka + konto; reszta przez dolny pasek i „Więcej” */
  header {
    min-height: 0;
    flex-wrap: nowrap;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  }
  header nav,
  .trip {
    display: none;
  }
  .brand {
    font-size: 26px;
  }
  .brand span {
    font-size: 15px;
    padding: 9px;
  }
  .account-btn {
    position: static;
    margin-left: auto;
  }
  .infobar {
    padding: 6px 14px;
    font-size: 12px;
    gap: 2px 12px;
  }

  /* panele: jeden naraz */
  .workspace {
    display: block;
    height: auto;
    min-height: 0;
  }
  .workspace > .map-column,
  .workspace > .catalog,
  .workspace > .route-column {
    display: none;
  }
  body:not([data-mp]) .workspace > .map-column,
  body[data-mp="map"] .workspace > .map-column {
    display: flex;
  }
  body[data-mp="list"] .workspace > .catalog {
    display: block;
  }
  body[data-mp="near"] .workspace > .route-column,
  body[data-mp="route"] .workspace > .route-column {
    display: block;
  }
  body[data-mp="near"] .route-box {
    display: none;
  }
  body[data-mp="route"] .near-box {
    display: none;
  }
  .route-column {
    border-left: 0;
  }

  /* mapa */
  .map-column {
    height: auto;
    overflow: visible;
  }
  .map-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 12px;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .map-actions::-webkit-scrollbar {
    display: none;
  }
  .map-actions button {
    flex: none;
    white-space: nowrap;
    min-height: 38px;
  }
  .map-legend {
    font-size: 11px;
    padding: 4px 12px;
    overflow-x: auto;
    white-space: nowrap;
  }
  .map-wrap {
    height: 46vh;
    min-height: 280px;
    flex: none;
  }
  .map-fab {
    display: flex;
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 800;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: #171717;
    color: #fff;
    border: 2px solid #fff;
    box-shadow: 0 2px 10px #0006;
    padding: 0;
    font-size: 22px;
  }
  .map-hint {
    max-width: calc(100% - 80px);
  }
  .recent {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 8px 12px 0;
    scrollbar-width: none;
  }
  .recent .chip {
    flex: none;
    white-space: nowrap;
  }

  /* lista miejsc: bez zagnieżdżonego przewijania, chipy kategorii zawsze pod ręką */
  .catalog {
    overflow: visible;
    border-top: 0;
  }
  .catalog-head {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 10px 12px 6px;
  }
  .catalog-title h1 {
    font-size: 20px;
    margin-bottom: 6px;
  }
  .personal-views {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }
  .personal-views button {
    flex: none;
    white-space: nowrap;
  }
  .cat-chips {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding: 6px 0;
    scrollbar-width: none;
  }
  .cat-chips .chip {
    flex: none;
    white-space: nowrap;
    min-height: 34px;
    font-size: 13px;
  }
  .cat-chips .chip.active {
    background: #171717;
    color: #fff;
    border-color: #171717;
  }
  .place-list {
    max-height: none;
    overflow: visible;
    padding: 0 12px;
  }
  .more {
    margin: 12px;
    width: calc(100% - 24px);
  }

  /* trasa i okolica */
  .route-box,
  .near-box {
    padding: 14px 14px 18px;
  }
  .radius-quick {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
  }
  .radius-quick button {
    flex: none;
    white-space: nowrap;
  }

  /* karty w widokach pobocznych: pierwszy akapit, reszta po stuknięciu */
  .program-card .more-body[hidden] {
    display: none;
  }
  .card-toggle {
    width: 100%;
    margin-top: 6px;
    background: #f4f4f4;
  }
  .secondary {
    padding: 16px 12px 24px;
  }

  /* dolny pasek */
  body {
    padding-bottom: calc(66px + env(safe-area-inset-bottom));
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: #171717;
  }
  .mobile-nav button {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    padding: 4px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #cfcfcf;
    font-size: 11px;
    line-height: 1.1;
  }
  .mobile-nav button svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .mobile-nav button.active {
    background: #fff;
    color: #171717;
    font-weight: 700;
  }
  .mobile-nav .nav-badge {
    position: absolute;
    top: 3px;
    right: calc(50% - 22px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e85d04;
    color: #fff;
    font-size: 10px;
    line-height: 17px;
    text-align: center;
  }
  [data-view="ai"][data-count]:not([data-count=""])::after {
    display: none;
  }
  .mobile-nav [data-view="ai"][data-count]:not([data-count=""]) .nav-badge {
    display: block;
  }
  .chat-log {
    max-height: none;
  }
  .timeline li {
    grid-template-columns: 52px 1fr;
  }
}

.route-stop .textbutton {
  text-align: left;
  font-size: 15px;
  font-weight: 600;
  padding-left: 0;
}

/* --- toalety, Dziś */
.wc-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.wc-info {
  min-width: 0;
}
.wc-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: none;
}
.wc-actions .btn,
.wc-actions button {
  display: block;
  text-align: center;
  padding: 7px 12px;
  border: 1px solid #bcbcbc;
  border-radius: 7px;
  background: #fff;
  color: #171717;
  text-decoration: none;
  font-size: 13px;
  min-height: 36px;
}
.point-pin {
  background: #171717;
  font-size: 15px !important;
}
.dis-item {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}
.dis-item .bullet {
  vertical-align: middle;
}
.dis-item.sev-Extreme,
.dis-item.sev-Severe {
  border-left: 3px solid #b00;
  padding-left: 10px;
}
#today h3 {
  font-family: var(--serif, Georgia, serif);
  margin: 14px 0 4px;
}
.timeline li.next {
  background: #f4f4f4;
  margin: 0 -8px;
  padding: 10px 8px;
}
.sheet-main {
  grid-column: 1 / -1;
  background: #171717;
  color: #fff;
}
.back-list { position: fixed; top: calc(78px + env(safe-area-inset-top)); left: 10px; z-index: 900; background: #171717; color: #fff; border: 2px solid #fff; border-radius: 20px; padding: 7px 12px; box-shadow: 0 2px 10px #0006; font-weight: 600; }
@media (min-width: 701px) { .back-list { display: none; } }

/* Baner NOWE: jedna linia + rząd krótkich przycisków (nie zasłania listy) */
@media (max-width: 700px) {
  .new-banner { margin: 8px 12px; padding: 8px 10px; font-size: 14px; }
  .new-banner .pair { display: flex; gap: 6px; margin-top: 6px; }
  .new-banner .pair button { flex: 1 1 auto; min-height: 44px; padding: 6px 10px; }
  .new-banner #newShowAll { flex: 0 0 44px; font-size: 20px; }
}
