:root{
  --paper: #F2EEE3;
  --paper-alt: #E8E1D0;
  --ink: #292521;
  --ink-soft: #6b6459;
  --indigo: #33495C;
  --indigo-deep: #22323F;
  --vermilion: #AE3B27;
  --moss: #6E7A55;
  --line: #D8CFBB;
  --line-soft: #E3DCC9;
  --radius: 3px;
}

* { box-sizing: border-box; }

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Zen Kaku Gothic New', sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 24px;
}

h1,h2,.serif{
  font-family:'Shippori Mincho', serif;
}

a{ color:inherit; }

/* ---------- HEADER ---------- */
header{
  position:relative;
  padding: 28px 20px 22px;
  background: var(--indigo);
  color: #F2EEE3;
  overflow:hidden;
}

header::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:0;
  height:6px;
  background: repeating-linear-gradient(90deg, var(--vermilion) 0 14px, transparent 14px 28px);
  opacity:.85;
}

.header-row{
  display:flex;
  align-items:flex-start;
  gap:16px;
}

.date-badge{
  flex:0 0 auto;
  width:56px; height:56px;
  border:1.5px solid rgba(242,238,227,.5);
  border-radius:50%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1;
}
.date-badge .num{ font-family:'Shippori Mincho', serif; font-size:22px; font-weight:700; }
.date-badge .mon{ font-size:9px; letter-spacing:.05em; opacity:.8; margin-top:2px;}

.header-text h1{
  margin:0 0 3px;
  font-size:21px;
  font-weight:700;
  line-height:1.25;
}
.header-text .sub{
  font-size:12.5px;
  opacity:.78;
  letter-spacing:.02em;
}

.back-link{
  display:inline-block;
  margin-bottom:10px;
  font-size:11.5px;
  opacity:.75;
  text-decoration:none;
}

.progress-wrap{
  margin-top:18px;
}
.progress-track{
  height:4px;
  background:rgba(242,238,227,.22);
  border-radius:2px;
  overflow:hidden;
}
.progress-fill{
  height:100%;
  background:#F2EEE3;
  width:0%;
  transition:width .35s ease;
}
.progress-label{
  margin-top:7px;
  font-size:11.5px;
  opacity:.75;
}

/* ---------- MAP ---------- */
#map{
  margin: 14px 16px 0;
  height: 220px;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--paper-alt);
}
.leaflet-popup-content-wrapper{
  border-radius: var(--radius);
  font-family:'Zen Kaku Gothic New', sans-serif;
}
.leaflet-popup-content{
  font-size:12.5px;
  margin: 8px 10px;
}
.pin-icon{
  width:22px; height:22px;
  border-radius:50% 50% 50% 0;
  transform: rotate(-45deg);
  border:1.5px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
}
.pin-icon.pending{ background: var(--indigo); }
.pin-icon.extra{ background: #B8935A; }
.pin-icon.done{ background: var(--moss); }
.pin-icon.skip{ background: var(--ink-soft); }
.pin-icon.me{ background: var(--vermilion); border-radius:50%; transform:none; }

.pin-icon.routed{
  border-radius:50%;
  transform:none;
  border-color: var(--vermilion);
  border-width:2px;
}
.pin-num{
  font-family:'Shippori Mincho', serif;
  font-size:11px;
  font-weight:700;
  color:#fff;
  line-height:1;
}

/* ---------- SECTION LABEL ---------- */
.section-label{
  margin: 16px 16px 6px;
  display:flex;
  align-items:baseline;
  justify-content:space-between;
}
.section-label h2,
.section-label h3{
  font-size:13px;
  font-weight:700;
  margin:0;
}
.section-label .hint{
  font-size:10px;
  color:var(--ink-soft);
}

/* ---------- DAY SECTION (transit hop + walking route) ---------- */
.section-block{
  margin: 22px 0 28px;
  padding-top: 16px;
  border-top: 2px solid var(--indigo);
}
.section-block:first-child{ margin-top: 8px; }

.section-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin: 0 16px 4px;
}
.section-header-text h2{
  font-size:16.5px;
  font-weight:700;
  margin:0;
  line-height:1.3;
}
.section-progress{
  font-size:10.5px;
  color: var(--ink-soft);
}

.transit-btn{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  font-weight:500;
  color: var(--indigo);
  background: var(--paper-alt);
  border:1px solid var(--line);
  border-radius: 14px;
  padding: 6px 11px;
  text-decoration:none;
  white-space:nowrap;
}
.transit-btn:active{ transform: scale(.96); }

.section-walk-btn{
  display:block;
  margin: 12px 16px 0;
  width: calc(100% - 32px);
}

.note-callout{
  margin: 0 16px 4px;
  padding: 8px 10px;
  background: #EFE2D8;
  border-left: 3px solid var(--vermilion);
  border-radius: 2px;
  font-size: 11px;
  line-height:1.5;
  color: #5c3a2c;
}

/* ---------- LIST ---------- */
.stop-list{
  margin: 2px 16px 0;
  position:relative;
}
.stop-list::before{
  content:"";
  position:absolute;
  left:23px; top:6px; bottom:6px;
  width:1.5px;
  background: var(--line);
}

.stop{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  padding: 9px 0;
  border-bottom:1px solid var(--line-soft);
}
.stop:last-child{ border-bottom:none; }

.stop-marker{
  flex:0 0 auto;
  width:24px; height:24px;
  border-radius:50%;
  background:var(--paper);
  border:1.5px solid var(--line);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:10.5px;
  font-weight:500;
  color: var(--ink-soft);
  position:relative;
  z-index:1;
  cursor:pointer;
  transition: all .15s ease;
  user-select:none;
}
.stop-marker.selected{
  background: var(--indigo);
  border-color: var(--indigo);
  color:#F2EEE3;
  font-family:'Shippori Mincho', serif;
  font-weight:700;
}

.stop-body{ flex:1; min-width:0; cursor:pointer; }

.stop-name{
  font-size:13.5px;
  font-weight:500;
  margin:0;
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.stop-cat{
  font-size:10.5px;
  color: var(--ink-soft);
  margin-top:1px;
}

.stop.state-done .stop-name{ color: var(--moss); text-decoration: line-through; text-decoration-color: rgba(110,122,85,.5);}
.stop.state-done .stop-cat{ color: var(--moss); opacity:.7; }
.stop.state-done .stop-marker{ opacity:.55; }

.stop.state-skip .stop-name{ color: var(--ink-soft); }
.stop.state-skip { opacity:.5; }

.stop.is-extra .stop-marker{ font-size:12px; background: var(--paper-alt); }
.stop.is-extra .stop-cat{ color: #8a6b3f; }

.stop-actions{
  flex:0 0 auto;
  display:flex;
  gap:5px;
  align-items:center;
}

.icon-btn{
  width:24px; height:24px;
  border-radius:50%;
  border:1px solid var(--line);
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  color: var(--ink-soft);
  font-size:11px;
  line-height:1;
  transition: all .15s ease;
  padding:0;
}
.icon-btn:active{ transform:scale(.92); }
.icon-btn.done.active{ background: var(--moss); border-color:var(--moss); color:#fff; }
.icon-btn.skip.active{ background: var(--ink-soft); border-color:var(--ink-soft); color:#fff; }
.icon-btn.map{ color: var(--indigo); }
.icon-btn.map svg{ width:11px; height:11px; }

.order-btn{ font-size:9px; color:var(--ink-soft); }
.order-btn:disabled{ opacity:.25; cursor:default; }
.order-btn:disabled:active{ transform:none; }

.empty-hint{
  margin: 0 16px 4px;
  padding: 14px 0;
  text-align:center;
  font-size:11.5px;
  color: var(--ink-soft);
  border-bottom:1px solid var(--line-soft);
}

/* ---------- BUTTONS ---------- */
.route-btn{
  background: var(--vermilion);
  color:#fff;
  border:none;
  padding: 11px 18px;
  border-radius: 22px;
  font-size:13px;
  font-weight:700;
  font-family:'Zen Kaku Gothic New', sans-serif;
  cursor:pointer;
  letter-spacing:.01em;
}
.route-btn:disabled{
  background: rgba(174,59,39,.35);
  cursor:default;
}
.route-btn:active:not(:disabled){ transform: scale(.97); }

footer.meta{
  text-align:center;
  font-size:10.5px;
  color: var(--ink-soft);
  padding: 18px 20px 10px;
}

/* ---------- DAY MENU: kalendář (index.html) ---------- */
.menu-list{ padding: 4px 16px 0; display:grid; gap:22px; max-width:1200px; margin:0 auto; }
.cal-month-head{
  display:flex; align-items:baseline; justify-content:space-between;
  padding-bottom:6px; border-bottom:2px solid var(--indigo); margin-bottom:8px;
}
.cal-month-head h3{ margin:0; font-size:17px; text-transform:capitalize; font-family:'Shippori Mincho', serif; }
.cal-month-head span{ font-size:11px; color:var(--ink-soft); }
.cal-grid{ display:grid; grid-template-columns:repeat(2,1fr); gap:12px; }
@media (min-width: 640px){ .cal-grid{ grid-template-columns:repeat(3,1fr); } }
@media (min-width: 900px){ .cal-grid{ grid-template-columns:repeat(4,1fr); } }

.cal-day{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.cal-day.has-trip{
  padding:16px 16px 14px; background:#fff; border:1px solid var(--line-soft); border-radius:var(--radius);
  text-decoration:none; color:inherit; min-height:140px; transition:border-color .12s, transform .12s;
}
.cal-day.has-trip:hover{ border-color:var(--indigo); transform:translateY(-1px); }
.cal-num{
  font-family:'Shippori Mincho', serif; font-size:34px; font-weight:700; line-height:1;
  display:flex; align-items:baseline; gap:6px;
}
.cal-dow{ font-family:'Zen Kaku Gothic New', sans-serif; font-size:11px; font-weight:500; color:var(--ink-soft); letter-spacing:.04em; }
.cal-head{ display:flex; align-items:baseline; gap:10px; }
.cal-loc{ font-size:14px; font-weight:700; line-height:1.25; }
.cal-sections{ list-style:none; margin:8px 0 0; padding:0; font-size:12.5px; line-height:1.4; color:var(--ink-soft); }
.cal-sections li::before{ content:"· "; color:var(--vermilion); }
.cal-title{
  font-size:15px; font-weight:500; line-height:1.3; margin-top:6px;
}
.cal-sub{ margin-top:auto; padding-top:8px; font-size:11px; color:var(--ink-soft); }
.cal-day.is-past{ opacity:.55; }
.cal-day.is-today{ border-color:var(--vermilion); box-shadow:0 0 0 1px var(--vermilion) inset; }
.cal-day.is-today .cal-sub{ color:var(--vermilion); font-weight:700; }

/* ---------- DESKTOP: mapa a seznam side by side ---------- */
@media (min-width: 860px){
  body{ padding-bottom: 0; }

  header{ padding: 28px 32px 22px; }

  .content{
    display:flex;
    align-items:flex-start;
    gap:24px;
    padding: 0 32px;
    max-width: 1280px;
    margin: 0 auto;
  }

  .map-col{
    flex: 1 1 50%;
    min-width: 0;
    position: sticky;
    top: 16px;
    align-self: flex-start;
  }

  .lists-col{
    flex: 1 1 50%;
    min-width: 0;
  }

  #map{
    margin: 14px 0 0;
    height: calc(100vh - 150px);
    min-height: 320px;
  }

  .lists-col .note-callout,
  .lists-col .section-header,
  .lists-col .section-label,
  .lists-col .stop-list,
  .lists-col .empty-hint{
    margin-left: 0;
    margin-right: 0;
  }

  .lists-col .section-walk-btn{
    margin-left: 0;
    margin-right: 0;
    width: 100%;
  }

  .lists-col footer.meta{ text-align:left; padding: 12px 0 24px; }
}
