  * {
    box-sizing: border-box;
  }

  body {
    font-family: Arial, Helvetica, sans-serif;
    margin: 2px 3px 2px 3px;
    padding: 0 0 0 0;
  }

  figure {
    margin: 0 0 0 0;
    display: inline;
    float: left;
  }

  .img-one-wide {
    width: 98%;
  }

  .img-two-wide {
    width: 49%;
  }

  .map-comment {
    font-weight: bold;
    margin-left: 50px;
  }

  .bind-two-pix {
    display: inline;
    float: left;
  }

  .sectionBgColor {
    background-color: gainsboro;
  }

  .legBgColor {
    /* slightly lighter than bisque for non-bar rows */
    background-color: #FFEAD6;
  }

  .sleepLegBgColor {
    /* darker version of legBgColor (#FFEAD6) */
    background-color: #EDD5BD;
  }

  .barLegBgColor {
    /* use bisque for rows with a bar */
    background-color: bisque;
  }

  .noteTitleBgColor {
    background-color: ivory;
  }

  /* Style disclosure triangles for notes to be less prominent */
  .noteTitleBgColor summary,
  .noteBgColor summary {
    color: #666;
  }

  .noteTitleBgColor summary::marker,
  .noteBgColor summary::marker {
    color: #999;
    font-size: 0.85em;
  }

  /* For browsers that use ::-webkit-details-marker */
  .noteTitleBgColor summary::-webkit-details-marker,
  .noteBgColor summary::-webkit-details-marker {
    color: #999;
  }

  /* Hotel link button styling */
  .hotel-link-btn {
    background: #fff;
    border: 1px solid #2980b9;
    color: #2980b9;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 150ms ease;
    text-decoration: none;
  }

  .hotel-link-btn:hover {
    background: #2980b9;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .hotel-link-btn:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
  }

    .statsBgColor {
      background-color: silver;
    }

    .statsBarBgColor {
      background-color: bisque;
    }

    .statsHighlightColor {
      color: lightcoral;
  }

  .noteTextBgColor {
    background-color: BlanchedAlmond;
  }

  .redText {
    color: red;
  }

  .greenText {
    color: green;
  }

  .toTownText {
    color: black;
    font-weight: normal;
  }

  .townPopulation {
    font-size: 0.8em;
  }

  .blackBackground {
    background-color: black;
  }

  .row {
    margin: 0 0 0 0;
    padding: 0 0 0 0;
  }

  .cell {
    display: inline-block;
    padding: 0 0 0 2px;
    margin: 0 0 0 0;
    text-align: left;
    border: 1px outset gray;
    text-wrap: wrap;
    font-size: 14;
  }

  .cell-border-both {
    border-top: 1px outset black;
    border-bottom: 1px outset black;
  }

  .cell-border-top {
    border-top: 1px outset black;
    border-bottom: 1px outset gray;
  }

  .cell-border-bottom {
    border-top: 1px outset gray;
    border-bottom: 1px outset black;
  }

  /* Row spacing percentages */
  .legWeekday {
    width: 3.8%;
  }

  .legDate {
    width: 6.7%;
  }

  .legFromTownTown {
    width: 14.3%;
  }

  .legTransportIcon {
    width: 1.9%;
  }

  .fa-taxi-small {
    font-size: 0.8em;
  }

  .walk-icon-muted {
    opacity: 0.45;
  }
  .material-icons.walk-icon {
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
  }

  .legFromTownTownToDistance {
    width: 6.0%;
    text-align: right;
    font-weight: 600;
  }

  .legToTown {
    width: 29.7%;
  }

.legMilesFromSleep {
    width: 22.9%;
    text-align: left;
    font-weight: normal;
  }

  .legSleepSummary {
    width: 14%;
  }

  .legActions {
    width: 6%;
    text-align: center;
  }
  .legActions .leg-action-btn { cursor: pointer; opacity: 1; pointer-events: auto; }

  /* Fix icon alignment in action buttons */
  .leg-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    padding: 0;
    line-height: 1;
  }
  .leg-action-btn i {
    display: block;
    line-height: 1;
  }
  .leg-transport-btn {
    border: 1px solid transparent;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .leg-transport-btn:focus { outline: 2px solid #6aa7ff; outline-offset: 2px; }
  /* Mode variants */
  .leg-transport-btn.transport-walk { background: rgba(0,0,0,0.035); border-color: rgba(0,0,0,0.06); }
  .leg-transport-btn.transport-walk:hover { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.1); }
  .leg-transport-btn.transport-taxi { background: #fff6ef; border-color: #ffd9b3; }
  .leg-transport-btn.transport-taxi:hover { background: #ffeede; border-color: #ffcfa0; }
  .leg-transport-btn.transport-train { background: #f3f7ff; border-color: #cfe0ff; }
  .leg-transport-btn.transport-train:hover { background: #e8f0ff; border-color: #bed4ff; }
  .leg-transport-btn.transport-bus { background: #f3f7ff; border-color: #cfe0ff; }
  .leg-transport-btn.transport-bus:hover { background: #e8f0ff; border-color: #bed4ff; }
  .leg-transport-btn.transport-plane { background: #f3f7ff; border-color: #cfe0ff; }
  .leg-transport-btn.transport-plane:hover { background: #e8f0ff; border-color: #bed4ff; }
  .leg-transport-btn.transport-skip { background: #fff4f4; border-color: #ffcaca; }
  .leg-transport-btn.transport-skip:hover { background: #ffe9e9; border-color: #ffb6b6; }

  /* Icon tinting per mode */
  .leg-transport-btn.transport-walk i { color: #5c6b7a; opacity: 0.75; }
  .leg-transport-btn.transport-taxi i { color: #e67e22; }
  .leg-transport-btn.transport-train i { color: #2980b9; }
  .leg-transport-btn.transport-bus i { color: #2980b9; }
  .leg-transport-btn.transport-plane i { color: #2980b9; }
  .leg-transport-btn.transport-skip i { color: #c0392b; }

  /* Dimming style for 'From last sleep' after a long day */
  .from-sleep-value.dim-after-long-day {
    opacity: 0.5;
  }

  

  /* Stage card style (day separator content) */
  .stage-card {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .stage-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #cfe7ff;
    color: #1f2d3d;
    padding: 2px 8px;
    border-radius: 999px;
    font-weight: 600;
  }

  /* Generic small pill badge for timestamps and labels */
  .update-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5fbff;
    border: 1px solid #cfe7ff;
    color: #2c3e50;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
  }

  .sync-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    }
  .sync-synced { background: #eefcf3; color: #176b3a; border-color: #c8f0d7; }
  .sync-syncing { background: #fff8e5; color: #8a6d1a; border-color: #ffe7ad; }
  .sync-out { background: #fff0f0; color: #8a1a1a; border-color: #ffc4c4; }

  /* Tiny inline spinner for syncing state */
  .sync-badge .spinner {
    width: 12px; height: 12px; margin-right: 6px;
    border: 2px solid rgba(0,0,0,0.15);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  .legStayNote {
    width: 79%;
  }

  /* Narrow versions of the row spacing percentages */
  .legWeekdayNarrow {
    width: 11.4%;
  }

  .legDateNarrow {
    width: 22.9%;
  }

  .legFromTownTownNarrow {
    width: 42.9%;
  }

  .legTransportIconNarrow {
    width: 5.7%;
  }

  .legFromTownTownToDistanceNarrow {
    width: 20%;
  }

  .legToTownNarrow {
    width: 39.3%;
  }

  .legMilesFromSleepNarrow {
    width: 63.8%;
  }

  .legSleepSummaryNarrow {
    width: 100%;
  }

  .section1 {
    width: 66%;
    text-align: left;

    font-size: 18;
    font-weight: bold;
  }

  .section2 {
    width: 34%;
    text-align: left;
  }

  .width100pc {
    width: 100%;
  }

  .flex-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: stretch;
    width: 100%;
    min-width: 100%;
    margin: 0;
    padding: 0;
  }

  .flex-container>.cell {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Zebra striping for leg rows - DISABLED per user request
  .leg-row.zebra .cell.legBgColor,
  .leg-row.zebra .cell.sleepLegBgColor,
  .leg-row.zebra .cell.barLegBgColor {
    filter: brightness(0.98);
  }
  */

  /* Ensure leg rows maintain full width */
  .flex-container.leg-row {
    min-width: 100%;
  }

  /* Sticky summary + header */
  .sticky-summary {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
    border-bottom: 1px solid #ddd;
  }

  .legHeader .cell {
    background: #f5f7fa;
    font-weight: 600;
    font-size: 13px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
  }

  /* Day Card - groups all legs + summary for one day */
  .day-card {
    border: 2px solid #555;
    border-radius: 12px;
    margin: 12px 4px;
    padding: 0;
    background: #fefefe;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    overflow: hidden;
  }

  /* Remove individual borders from leg rows inside day card */
  .day-card .leg-row .cell {
    border: none;
  }

  /* Day summary at bottom of card - styled like a leg badge but outdented */
  .day-summary .cell {
    background: #FFEAD6;
    font-size: inherit;
    color: #2c3e50;
    border-top: 1px solid #e0d0c0;
    border-bottom: none;
    padding: 8px 12px;
    border-radius: 0 0 10px 10px;
  }

  .day-summary-badge {
    display: inline-flex;
    align-items: center;
    /* Day summary pill: soft blue (color scheme "C", chosen Nov 2026) */
    background: #DCE6F5 !important;
    border: 1px solid #9DB3D6 !important;
    color: #2c3e50;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 15px;
  }

  /*
   * Day row pills (color scheme "C").
   * Each line inside a day is a rounded "pill". Legs and notes used to be
   * almost identical white pills; these colors make the three line types
   * (summary / leg / note) easy to tell apart. Layout (padding, radius,
   * flex) stays inline in buildRoute.js; only colors live here.
   */
  .leg-pill {
    /* Walking/transport leg: pale green */
    background: #E3F1E3;
    border: 1px solid #8DBF8D;
  }

  .note-pill {
    /* Note (hotel, food, route, travel): cream with dashed border,
       so it reads as an annotation rather than a step of the walk */
    background: #FBF6EE;
    border: 1px dashed #D8C4A6;
  }

  .day-summary-badge .separator {
    color: #c0a080;
    margin: 0 8px;
  }

  .day-summary-badge .day-miles {
    color: #27ae60;
    font-weight: 700;
  }

  .day-summary-badge .cumulative-miles {
    color: #2c3e50;
    font-weight: 600;
  }

  .day-date-label {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
  }

  /* Subtle appear animation for day cards */
  .day-card { opacity: 0; transform: translateY(-4px); animation: dayCardIn 250ms ease forwards; }
  @keyframes dayCardIn { to { opacity: 1; transform: translateY(0); } }

  /* Day box: groups date + legs + summary into a bordered unit */
  .day-box {
    display: flex;
    flex-direction: row;
    border: 2px solid #333;
    border-radius: 8px;
    margin: 6px 4px;
    overflow: hidden;
    background: #fefefe;
  }

  .day-box-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    max-width: 90px;
    padding: 8px 10px;
    background: #f0f4f8;
    border-right: 2px solid #333;
    flex-shrink: 0;
  }

  .day-date-number {
    font-size: 28px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1;
  }

  .day-weekday {
    font-size: 14px;
    font-weight: 500;
    color: #5a6c7d;
    margin-top: 4px;
    line-height: 1;
  }

  .day-box-content {
    flex: 1;
    min-width: 0;
  }

  /* Day separator styles inside day box */
  .day-separator .cell {
    background: #fff;
    font-size: inherit;
    color: #2c3e50;
    border-top: none;
    border-bottom: none;
    padding: 0 0 0 2px;
  }

  /* Day box appear animation */
  .day-box { opacity: 0; transform: translateY(-4px); animation: dayBoxIn 250ms ease forwards; }
  @keyframes dayBoxIn { to { opacity: 1; transform: translateY(0); } }

  /* Day summary row with disclosure button */
  .day-summary-row {
    display: flex;
    align-items: center;
  }

  /* Disclosure button for individual days (inside the blue badge) */
  .day-disclosure-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 6px;
    margin-right: 4px;
    color: blue;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 150ms ease, background 150ms ease;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .day-disclosure-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #0066cc;
  }

  .day-disclosure-btn:focus {
    outline: 2px solid #0066cc;
    outline-offset: 1px;
  }

  .day-disclosure-icon {
    font-size: 16px;
    transition: transform 200ms ease;
  }

  /* Collapsed state for icon (rotated) */
  .day-disclosure-btn[aria-expanded="false"] .day-disclosure-icon {
    transform: rotate(-90deg);
  }

  /* Day summary badge alignment */
  .day-summary-badge {
    display: inline-flex;
    align-items: center;
  }

  /* Collapsible container for day legs */
  .day-legs-container {
    overflow: hidden;
    transition: max-height 220ms ease-in-out, opacity 150ms ease;
    max-height: 2000px;
    background: #fff;
  }

  /* Override leg background colors inside day-legs-container to be white */
  .day-legs-container .legBgColor,
  .day-legs-container .sleepLegBgColor,
  .day-legs-container .barLegBgColor {
    background-color: #fff !important;
  }

  .day-legs-container.collapsed {
    max-height: 0;
    opacity: 0;
  }

  /* Global expand/collapse button */
  .global-disclosure-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #999;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    transition: all 150ms ease;
  }

  .global-disclosure-btn:hover {
    background: #f0f4f8;
    border-color: #2980b9;
    color: #2980b9;
  }

  .global-disclosure-btn:focus {
    outline: 2px solid #2980b9;
    outline-offset: 2px;
  }

  .global-disclosure-btn i {
    font-size: 12px;
  }

  @media (max-width: 600px) {
    .day-box-date {
      min-width: 50px;
      max-width: 60px;
      padding: 6px;
    }

    .day-date-number {
      font-size: 22px;
    }

    .day-weekday {
      font-size: 12px;
      margin-top: 2px;
    }

    .day-disclosure-btn {
      padding: 4px 6px;
    }

    .day-disclosure-icon {
      font-size: 14px;
    }
  }

  /* True zebra indicator - DISABLED per user request
  .leg-row.zebra { border-left: 3px solid #eaeef2; }
  */
  .leg-row .cell { border-right: 1px outset rgba(0,0,0,0.06); }

  /* Mobile legend under sticky header */
  .mobile-legend { display: none; }
  @media (max-width: 900px) {
    .legHeader { display: none; }
    .mobile-legend {
      display: block;
      background: #f5f7fa;
      border-bottom: 1px solid #ddd;
      padding: 6px 8px;
      font-size: 12px;
      color: #2c3e50;
    }
  }

  /* Legend chips under sticky header */
  .legend-row {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    background: #fbfcfd;
    border-bottom: 1px solid #e5e9ef;
  }
  .chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    color: #1f2d3d;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
  }
  .chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
  .chip.sleep .dot { background: powderblue; border: 1px solid #6aa7c9; }
  .chip.bar .dot { background: #DEB887; border: 1px solid #aa8455; }
  .chip.taxi { background: #fff6f2; }
  .chip.train { background: #f7f9ff; }
  .chip.skip { background: #fff4f4; }
  .chip.total { background: #eef7ff; border-color: #cfe7ff; }

  /* Section accordion headers */
  .section-accordion { display: flex; gap: 8px; align-items: center; cursor: pointer; }
  .section-accordion .caret { display: inline-block; transition: transform 0.2s ease, color 0.2s ease; color: #34495e; }
  .section-accordion.expanded .caret { transform: rotate(90deg); }
  .section-accordion .section-title { font-weight: 600; }
  .section-accordion .section-count { color: #5c6b7a; font-size: 12px; }
  .section-accordion .section-links { font-size: 12px; display: inline-flex; gap: 10px; }
  .section-accordion:hover { background: #f8fbff; }
  .section-accordion:hover .caret { color: #2980b9; }
  .section-accordion:hover .section-title { color: #2980b9; }
  .section-accordion:focus { outline: 2px solid #2980b9; outline-offset: 2px; border-radius: 6px; }
  .section-accordion:focus-visible { outline: 2px solid #2980b9; outline-offset: 2px; border-radius: 6px; }

  /* Section content collapse animation */
  .section-content { overflow: hidden; transition: max-height 220ms ease-in-out; }
  .section-content.collapsed { max-height: 0; }
  .section-content.expanded { max-height: 4000px; }

  /* Indent nested section headers and content */
  .section-content .section-accordion {
    padding-left: 20px;
  }

  /* Animated reveal for first rows when expanding sections */
  @keyframes scIn { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: translateY(0);} }
  .section-content.expanded .leg-row { opacity: 1; }
  .section-content.expanded .leg-row:nth-child(1) { animation: scIn 180ms ease forwards; }
  .section-content.expanded .leg-row:nth-child(2) { animation: scIn 220ms ease forwards; }
  .section-content.expanded .leg-row:nth-child(3) { animation: scIn 260ms ease forwards; }
  .section-content.expanded .leg-row:nth-child(4) { animation: scIn 300ms ease forwards; }
  .section-content.expanded .leg-row:nth-child(5) { animation: scIn 340ms ease forwards; }

  /* Responsive two-line layout for leg rows */
  @media (max-width: 900px) {
    .flex-container.leg-row { flex-wrap: wrap; }
    .legWeekday, .legDate, .legTransportIcon,
    .legFromTownTownToDistance, .legMilesFromSleep,
    .legToTown, .legFromTownTown, .legSleepSummary, .legActions { width: auto; }

    /* Reorder cells into two logical lines */
    .legWeekday { order: 1; min-width: 48px; }
    .legDate { order: 2; min-width: 84px; }
    .legFromTownTown { order: 3; flex: 1 1 40%; }
    .legToTown { order: 4; flex: 1 1 40%; }

    .legFromTownTownToDistance { order: 5; }
    .legMilesFromSleep { order: 6; flex: 1 1 60%; }
    .legTransportIcon { order: 7; }
    .legSleepSummary { order: 8; }
    .legActions { order: 9; }

    /* Make each row visually two-line */
    .leg-row .cell { padding: 4px 6px; font-size: 13px; }
  }

  /* Ensure segment rows maintain full width */
  .flex-container.segment-row {
    min-width: 100%;
  }

  select {
    margin: 0 0 0 0;
    font-family: Arial, Helvetica, sans-serif;
    outline: 0;
    background: #ccccff;
    color: black;
    border: 1px solid gray;
    padding: 4px;
    border-radius: 9px;
  }

  .url-page {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
    font-family: 'Segoe UI', Arial, sans-serif;
  }

  .content-container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .main-title {
    color: #2c3e50;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3498db;
  }

  .link-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #3498db;
  }


  .section-title {
    color: #e67e22;
    font-size: 1.1em;
    margin-bottom: 0px;
  }

  .split-title {
    /* color: blueviolet; */
    font-size: 1.1em;
    margin-bottom: 0px;
  }

  .link-list {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .link-item {
    margin-bottom: 10px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
  }

  .link-item:hover {
    transform: translateX(10px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .link-item a {
    color: #2980b9;
    text-decoration: none;
    display: block;
  }

  .link-item a:hover {
    color: #e67e22;
  }

  /* Different colors for different sections */
  .link-section:nth-child(3) {
    border-left-color: #e74c3c;
  }

  .link-section:nth-child(4) {
    border-left-color: #2ecc71;
  }

  .link-section:nth-child(5) {
    border-left-color: #9b59b6;
  }

  .link-section:nth-child(6) {
    border-left-color: #f1c40f;
  }

  /* Responsive design */
  @media (max-width: 768px) {
    .content-container {
      padding: 15px;
    }

    .main-title {
      font-size: 2em;
    }

    .link-section {
      padding: 15px;
    }
  }

  /* Notes Panel Styles (Option D) */
  .notes-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    transition: opacity 300ms ease;
  }

  .notes-panel-overlay.visible {
    opacity: 1;
  }

  .notes-panel {
    width: 450px;
    max-width: 90vw;
    height: 100%;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 300ms ease;
  }

  .notes-panel-overlay.visible .notes-panel {
    transform: translateX(0);
  }

  .notes-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #3498db;
    color: white;
  }

  .notes-panel-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
  }

  .notes-panel-header h2 i {
    margin-right: 8px;
  }

  .notes-panel-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 150ms;
  }

  .notes-panel-close:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .notes-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }

  .notes-section {
    margin-bottom: 20px;
  }

  .notes-section-header {
    font-weight: 600;
    font-size: 14px;
    color: #e67e22;
    padding: 8px 12px;
    background: #fef9f3;
    border-left: 3px solid #e67e22;
    margin-bottom: 8px;
    border-radius: 0 4px 4px 0;
  }

  .notes-section-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .note-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 150ms;
  }

  .note-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
  }

  .note-type {
    background: #3498db;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    text-transform: uppercase;
  }

  .note-title {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
  }

  .note-edit-btn {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 150ms;
  }

  .note-edit-btn:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
  }

  .note-content {
    color: #555;
    font-size: 13px;
    line-height: 1.5;
    padding: 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #eee;
  }

  /* Notes panel button styling */
  .notes-panel-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }

  .notes-panel-btn i {
    color: #f39c12;
  }

  /* Option C: Notes attached to legs (inline) */
  .note-attached {
    margin: 0 12px 4px 30px;
    padding: 8px 12px;
    background: #fffef5;
    border-left: 3px solid #f39c12;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
  }

  .note-attached-simple {
    align-items: center;
  }

  .note-attached-details {
    flex: 1;
    background: transparent;
  }

  .note-attached-details summary {
    cursor: pointer;
    color: #5d4e37;
    list-style: none;
  }

  .note-attached-details summary::-webkit-details-marker {
    display: none;
  }

  .note-attached-details summary::before {
    content: "▸ ";
    color: #ccc;
    font-size: 10px;
  }

  .note-attached-details[open] summary::before {
    content: "▾ ";
  }

  .note-attached-content {
    margin-top: 8px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #f0ead6;
    border-radius: 4px;
    color: #555;
    line-height: 1.5;
  }

  .note-type-badge {
    background: #f39c12;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    white-space: nowrap;
  }

  .note-inline-edit {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 150ms;
    flex-shrink: 0;
  }

  .note-inline-edit:hover {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
  }

  #toast {
    visibility: hidden;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 16px;
    border-radius: 4px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
  }

  #toast.show {
    visibility: visible;
  }

  /* Loading indicator styles */
  .route-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: opacity 0.2s ease;
  }

  .route-loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  .route-loading-text {
    margin-left: 10px;
    color: #666;
    font-size: 14px;
  }

  /* ==========================================================================
     Multi-Night Stay Feature Styles
     ========================================================================== */

  /* Text button for nights selection */
  .nights-text-btn {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all 150ms ease;
    white-space: nowrap;
  }

  .nights-text-btn.nights-zero {
    background: #fff5f5;
    border-color: #ffcaca;
    color: #c0392b;
  }

  .nights-text-btn.nights-zero:hover {
    background: #ffe9e9;
    border-color: #ffb6b6;
  }

  .nights-text-btn.nights-active {
    background: #eefcf3;
    border-color: #c8f0d7;
    color: #176b3a;
  }

  .nights-text-btn.nights-active:hover {
    background: #d4f5e2;
    border-color: #9de4b8;
  }

  /* Rest day card and row styling */
  .rest-day-card {
    background: linear-gradient(135deg, #fffef5 0%, #fff9e6 100%);
    border-color: #e8d88c;
  }

  .rest-day-row {
    background: transparent;
  }

  .rest-day-bg {
    background-color: transparent !important;
  }

  .rest-day-summary .cell {
    background: #fffef0;
    border-top: 1px solid #e8d88c;
  }

  .rest-day-badge {
    background: #fffef0 !important;
    border-color: #e8d88c !important;
    color: #8a7d3a;
  }

  /* Nights selection popup styling */
  .nights-popup {
    min-width: 280px;
    max-width: 350px;
  }

  .nights-popup .options-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .popup-close-btn {
    background: transparent;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
    line-height: 1;
  }

  .popup-close-btn:hover {
    color: #c0392b;
  }

  .nights-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
  }

  .nights-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 150ms ease;
  }

  .nights-option:hover {
    background: #f0f4f8;
  }

  .nights-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
  }

  .nights-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #2c3e50;
  }

  .nights-label i {
    font-size: 16px;
  }

  .nights-hint {
    color: #7f8c8d;
    font-size: 12px;
    font-style: italic;
  }

  .nights-option input[type="number"] {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
  }

  .nights-option input[type="number"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
  }

  /* Rest day add/remove button styles */
  .rest-day-add-btn,
  .rest-day-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    transition: all 150ms ease;
  }

  .rest-day-add-btn:hover {
    background: #d4f5e2 !important;
    border-color: #9de4b8 !important;
  }

  .rest-day-remove-btn:hover {
    background: #ffe9e9 !important;
    border-color: #ffb6b6 !important;
  }

  .rest-day-add-btn:focus,
  .rest-day-remove-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
  }

  /* Rest day row animation */
  .rest-day-row {
    animation: restDayIn 250ms ease forwards;
  }

  @keyframes restDayIn {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Skipped section styling */
  .section-skipped {
    opacity: 0.5;
  }
  .section-skipped .section-title {
    text-decoration: line-through;
  }

  /* Skipped leg rows (legs inside skipped sections) */
  .skipped-leg {
    opacity: 0.35;
  }

  /* Section skip toggle button */
  .section-skip-btn {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #ccc;
    background: #f8f9fa;
    color: #555;
    transition: all 150ms ease;
    margin-left: 6px;
  }
  .section-skip-btn:hover {
    background: #fff0f0;
    border-color: #ffb6b6;
    color: #c0392b;
  }
  .section-skip-btn.skipped {
    background: #eefcf3;
    border-color: #c8f0d7;
    color: #176b3a;
  }
  .section-skip-btn.skipped:hover {
    background: #d4f5e2;
    border-color: #9de4b8;
  }

  /* Chart button for section and day altitude charts */
  .chart-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 6px;
    font-size: 12px;
    color: #555;
    margin-left: 4px;
  }
  .chart-btn:hover {
    background: #e8f4f8;
    border-color: #999;
    color: #333;
  }

  /* Inline altitude chart styles */
  .inline-chart-container {
    margin: 8px 4px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  }
  .inline-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .inline-chart-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
  }
  .inline-chart-stats {
    font-size: 13px;
    color: #666;
    flex: 1;
    text-align: center;
  }
  .inline-chart-close {
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    color: #555;
  }
  .inline-chart-close:hover {
    background: #e0e0e0;
    border-color: #999;
  }
  /* Inline Google Map iframe */
  .inline-map-iframe {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .inline-chart-canvas {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
  }
