/* Guide UI v33: compact spoilers, a stable timeline rail and sticky day switching. */

.ai-guide__result { overflow: visible; }

.ai-guide__section-spoiler,
.ai-guide__meals-spoiler {
    overflow: hidden;
    border: 1px solid #e4e9ed;
    border-radius: 15px;
    background: #fff;
}

.ai-guide__section-spoiler > summary,
.ai-guide__meals-spoiler > summary {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 64px;
    padding: 10px 14px;
    list-style: none;
    cursor: pointer;
}

.ai-guide__section-spoiler > summary::-webkit-details-marker,
.ai-guide__meals-spoiler > summary::-webkit-details-marker { display: none; }
.ai-guide__section-spoiler > summary:hover,
.ai-guide__meals-spoiler > summary:hover { background: #fffaf7; }

.ai-guide__section-spoiler-copy {
    display: grid;
    flex: 1;
    gap: 4px;
    min-width: 0;
}

.ai-guide__section-spoiler-copy strong {
    color: #203747;
    font-size: 16px;
    line-height: 1.25;
}

.ai-guide__section-spoiler-copy small {
    overflow: hidden;
    color: #7e8c94;
    font-size: 11px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-guide__section-spoiler-action {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    color: #c25b38;
    font-size: 10px;
    font-weight: 800;
}

.ai-guide__section-spoiler-action::after {
    content: '＋';
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #c55b37;
    background: #fff0e8;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
}

.ai-guide__section-spoiler[open] .ai-guide__section-spoiler-action::after,
.ai-guide__meals-spoiler[open] .ai-guide__section-spoiler-action::after {
    content: '−';
}

.ai-guide__section-spoiler-body { padding: 0 13px 13px; }
.ai-guide__section-spoiler-body > .ai-guide__journey-grid { margin-top: 0; }

.ai-guide__journey { padding: 0; }
.ai-guide__journey-spoiler > summary .ai-guide__section-icon,
.ai-guide__budget-spoiler > summary .ai-guide__icon-tile {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
}

.ai-guide__journey-spoiler > summary .ai-guide__section-icon .ai-guide__icon-image,
.ai-guide__budget-spoiler > summary .ai-guide__icon-image {
    width: 25px;
    height: 25px;
}

.ai-guide__budget-summary { padding: 0; }
.ai-guide__budget-spoiler > summary { min-height: 64px; }
.ai-guide__budget-spoiler .ai-guide__section-spoiler-body { padding: 0 16px 16px; }
.ai-guide__budget-spoiler .ai-guide__budget-title { min-height: 0; margin: 0 0 12px; }
.ai-guide__budget-spoiler .ai-guide__budget-switch { margin-left: auto; }

.ai-guide__meals-spoiler { margin: 0 0 14px; border-color: #e0eae4; }
.ai-guide__meals-spoiler > summary { min-height: 52px; padding: 8px 12px; }
.ai-guide__meals-spoiler > summary > strong { flex: 1; color: #273e4e; font-size: 12px; }
.ai-guide__meals-spoiler > summary .ai-guide__section-spoiler-action { font-size: 10px; }
.ai-guide__meals { margin: 0; padding: 0 12px 12px; border: 0; }

/* Keep the left rail inside the card at every width.  The old 43–72px
   rail could clip the first character of a time and pushed the node into
   the content column on narrow screens. */
.ai-guide__place,
.ai-guide__meal-stop {
    grid-template-columns: 82px minmax(0, 1fr);
    column-gap: 9px;
}

.ai-guide__timeline-time {
    min-width: 0;
    align-items: flex-end;
    padding-right: 12px;
    overflow: visible;
    white-space: nowrap;
}

.ai-guide__timeline-time strong,
.ai-guide__timeline-time span { white-space: nowrap; }
.ai-guide__timeline::before { left: 76px; }
.ai-guide__timeline-node { right: -7px; }

.ai-guide__segment { margin-bottom: 10px; }
.ai-guide__timeline > .ai-guide__segment:last-child { margin-bottom: 0; }

/* Tags sit on the title row, next to the place name. They wrap cleanly
   when a long title leaves no room, without adding a second indented row. */
.ai-guide__place-title { flex-wrap: wrap; align-items: center; }
.ai-guide__place-title h4 { flex: 1 1 180px; min-width: 0; }
.ai-guide__place-title > .ai-guide__chips {
    flex: 0 1 auto;
    justify-content: flex-end;
    max-width: 48%;
    margin: 0 0 0 auto;
    padding: 0;
}

/* The route switcher remains available while a long day is being read.
   Keep the top navigation and the section navigation above it. */
.ai-guide__day-tabs {
    position: sticky;
    top: calc(var(--tt-header-height, 64px) + 78px);
    z-index: 31;
    margin-top: 12px;
    padding: 8px 4px;
    border: 1px solid rgba(220, 228, 224, .94);
    border-radius: 14px;
    background: rgba(250, 252, 250, .96);
    box-shadow: 0 9px 24px rgba(30, 50, 45, .11);
    backdrop-filter: blur(14px);
    scrollbar-width: none;
}

.ai-guide__day-tabs::-webkit-scrollbar { display: none; }

@media (max-width: 700px) {
    .ai-guide__section-spoiler > summary { min-height: 58px; padding: 8px 11px; }
    .ai-guide__section-spoiler-copy strong { font-size: 14px; }
    .ai-guide__section-spoiler-copy small { font-size: 10px; }
    .ai-guide__section-spoiler-body { padding: 0 10px 10px; }
    .ai-guide__budget-spoiler .ai-guide__section-spoiler-body { padding: 0 10px 12px; }
    .ai-guide__journey-spoiler > summary .ai-guide__section-icon,
    .ai-guide__budget-spoiler > summary .ai-guide__icon-tile { flex-basis: 42px; width: 42px; height: 42px; }
    .ai-guide__journey-spoiler > summary .ai-guide__section-icon .ai-guide__icon-image,
    .ai-guide__budget-spoiler > summary .ai-guide__icon-image { width: 22px; height: 22px; }
    .ai-guide__place,
    .ai-guide__meal-stop { grid-template-columns: 58px minmax(0, 1fr); column-gap: 6px; }
    .ai-guide__timeline-time { padding-right: 10px; }
    .ai-guide__timeline::before { left: 52px; }
    .ai-guide__timeline-node { right: -7px; }
    .ai-guide__place-title > .ai-guide__chips { max-width: 55%; }
    .ai-guide__day-tabs {
        top: calc(var(--tt-header-height, 60px) + 72px);
        margin: 10px -4px 12px;
        padding: 8px 4px;
    }
}

@media (max-width: 420px) {
    .ai-guide__place,
    .ai-guide__meal-stop { grid-template-columns: 51px minmax(0, 1fr); column-gap: 5px; }
    .ai-guide__timeline-time { padding-right: 8px; }
    .ai-guide__timeline::before { left: 45px; }
    .ai-guide__place-title > .ai-guide__chips { max-width: 100%; margin-left: 31px; }
}
