/* ===== Global Link Reset ===== */
#tripContent a { color: var(--text); text-decoration: underline; }
#tripContent a:visited { color: var(--text); }

/* ===== Section Card Style ===== */
#tripContent section { background: var(--card-bg); border-radius: 12px; margin-bottom: 12px; overflow: hidden; }
.day-header { border-radius: 12px 12px 0 0; }
footer { background: var(--card-bg); border-radius: 12px; padding: 16px; margin-bottom: 12px; text-align: center; }
footer h3 { font-size: var(--fs-lg); color: var(--blue); }
footer p { font-size: var(--fs-md); margin-top: 4px; }
.footer-budget { font-weight: 600; }
.footer-exchange { font-size: var(--fs-md); color: var(--gray); margin-top: 4px; }

.ov-card p { font-size: var(--fs-md); margin: 4px 0; line-height: 1.7; }
.ov-card a { color: var(--text); font-weight: 600; text-decoration: underline; }
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.ov-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ov-card { padding: 14px; background: var(--blue-light); border-radius: 10px; }
.ov-card h4 { margin-top: 0; position: relative; padding-left: 18px; }
.ov-card h4::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.flight-row { display: flex; align-items: center; padding: 10px 12px; border-radius: 12px; margin-bottom: 0; gap: 8px; }
.flight-row .flight-icon { font-size: 1.4rem; flex-shrink: 0; display: flex; align-items: center; }
.flight-row .flight-icon .svg-icon { width: 1.4rem; height: 1.4rem; }
.flight-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; flex: 1; min-width: 0; }
.flight-label { font-weight: 700; font-size: var(--fs-md); white-space: nowrap; }
.flight-route { font-weight: 600; font-size: var(--fs-lg); white-space: nowrap; }
.flight-time { font-size: var(--fs-md); color: var(--gray); white-space: nowrap; }
.weather-list { list-style: none; padding: 0; }
.weather-list li { font-size: var(--fs-md); padding: 3px 0; display: flex; align-items: baseline; gap: 6px; }
.weather-list li .list-icon { flex-shrink: 0; }

/* ===== Sticky Nav Card (override shared.css) ===== */
.sticky-nav { border-radius: 12px; padding: 12px 16px; gap: 12px; margin: 12px 0; top: 12px; background: var(--card-bg); }
@media (min-width: 768px) { .sticky-nav { max-width: var(--content-max-w); margin: 12px auto; } }

/* ===== Day Header (section divider) ===== */
.day-header { position: relative; z-index: 100; background: var(--blue); color: var(--white); padding: 8px 12px; display: flex; align-items: center; gap: 8px; }
.day-header h2 { font-size: var(--fs-lg); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dh-date { font-size: var(--fs-md); opacity: 0.9; margin-left: auto; white-space: nowrap; }
.dh-nav-wrap { position: relative; flex: 1; display: flex; align-items: center; min-width: 0; }
.dh-nav { display: flex; gap: 6px; flex: 1; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.dh-nav::-webkit-scrollbar { display: none; }
.dn { background: var(--blue-light); color: var(--blue); border: none; padding: 6px 12px; border-radius: 12px; font-size: var(--fs-lg); font-family: inherit; cursor: pointer; font-weight: 600; }
.dn:hover { background: var(--blue); color: var(--white); }
.dn.active { background: var(--blue); color: var(--white); }

/* ===== Nav Pills Overflow: Gradient Fade Masks ===== */
.dh-nav-wrap::before,
.dh-nav-wrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.2s;
}
.dh-nav-wrap::before { left: 0; background: linear-gradient(to right, var(--card-bg), transparent); }
.dh-nav-wrap::after { right: 0; background: linear-gradient(to left, var(--card-bg), transparent); }
.dh-nav-wrap.can-scroll-left::before { opacity: 1; }
.dh-nav-wrap.can-scroll-right::after { opacity: 1; }

/* ===== Nav Pills Overflow: Arrow Buttons ===== */
.dh-nav-arrow {
    display: none;
    background: none;
    border: none;
    color: var(--blue);
    cursor: pointer;
    padding: 0 4px;
    font-size: 1.2rem;
    line-height: 1;
    flex-shrink: 0;
    z-index: 2;
    visibility: visible;
    transition: visibility 0s;
}
.dh-nav-arrow[aria-hidden="true"] { visibility: hidden; }
@media (min-width: 768px) {
    .dh-nav-arrow { display: flex; align-items: center; }
    .dh-nav { justify-content: flex-start; }
}

/* ===== Day Content ===== */
.day-content { padding: 0 16px 16px; }

/* ===== Hourly Weather ===== */
.hourly-weather { padding: 12px 0; overflow: hidden; }
.hourly-weather-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hourly-weather-title { font-size: var(--fs-md); font-weight: 600; color: var(--gray); }
.hw-update-time { font-size: var(--fs-md); color: var(--gray); opacity: 0.7; }
.hw-grid { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-top: 2px; padding-bottom: 4px; scroll-behavior: smooth; }
.hw-block { background: var(--white); border-radius: 10px; padding: 8px 6px; text-align: center; min-width: calc((100% - 42px) / 8); flex-shrink: 0; }
.hw-block.hw-now { background: var(--blue-light); box-shadow: 0 0 0 2px var(--blue); }
.hw-block-time { font-size: var(--fs-md); font-weight: 600; color: var(--gray); margin-bottom: 2px; }
.hw-block-loc { font-size: var(--fs-md); color: var(--white); border-radius: 4px; padding: 1px 5px; display: inline-block; margin-bottom: 2px; white-space: nowrap; }
.hw-loc-0 { background: var(--blue); }
.hw-loc-1 { background: var(--sand); }
.hw-loc-2 { background: var(--text); }
.hw-loc-3 { background: var(--gray); }
.hw-block-icon { font-size: 1.4rem; line-height: 1.3; display: flex; align-items: center; justify-content: center; }
.hw-block-icon .svg-icon { width: 1.4rem; height: 1.4rem; }
.hw-block-temp { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.hw-block-rain { font-size: var(--fs-md); color: var(--blue); }
.hw-block-rain.hw-rain-high { color: var(--text); font-weight: 700; }
.hw-loading { text-align: center; padding: 10px; color: var(--gray); font-size: var(--fs-md); }
.hw-error { text-align: center; padding: 10px; color: var(--text); font-size: var(--fs-md); background: var(--blue-light); border-radius: 8px; }

/* ===== Collapsible Row (Hotel / Budget) ===== */
.col-row { display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 0; cursor: pointer; user-select: none; }
.col-row:hover { background: var(--blue-light); }
.col-row .arrow { margin-left: auto; color: var(--gray); font-size: var(--fs-md); }
.col-detail { display: none; padding: 10px 0; font-size: var(--fs-md); line-height: 1.7; }
.col-detail.open { display: block; }
.col-detail a { color: var(--text); font-weight: 600; text-decoration: underline; }
.status-tag { font-size: var(--fs-md); padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.status-tag.pending { background: var(--sand-light); color: var(--sand); }
.status-tag.paid { background: var(--blue-light); color: var(--blue); }
.hotel-detail-grid { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 8px; }
.hotel-sub { margin-top: 8px; padding: 8px 10px; background: var(--blue-light); border-radius: 8px; }

/* ===== Timeline ===== */
.timeline { position: relative; padding-left: 18px; margin: 8px 0 0 10px; border-left: 2px solid var(--blue-light); }

/* ===== Timeline Event ===== */
.tl-event { position: relative; padding: 6px 0; }
.tl-event::before { content: ''; position: absolute; left: -22px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); border: 2px solid var(--white); z-index: 1; }
.tl-head { display: flex; align-items: baseline; gap: 8px; padding: 4px 8px; border-radius: 8px; }
.tl-time { font-weight: 700; font-size: var(--fs-md); color: var(--blue); min-width: 95px; flex-shrink: 0; }
.tl-title { font-weight: 600; font-size: var(--fs-lg); }
.tl-title a { color: var(--text); text-decoration: none; }
.tl-title a:hover { text-decoration: underline; }
.tl-body { display: block; padding: 4px 8px 8px; font-size: var(--fs-md); line-height: 1.7; }
.tl-desc { color: var(--gray); margin-bottom: 6px; }
.tl-transit { padding: 1px 8px 1px 0; margin-left: 0; font-size: var(--fs-md); color: var(--gray); }

/* ===== Nav Group (Map Links) ===== */
.nav-links { margin: 6px 0; }
.map-link, .map-link-inline { text-decoration: none !important; }
.map-link { display: inline-flex; align-items: center; gap: 3px; background: transparent; color: var(--blue); padding: 3px 8px; border-radius: 6px; font-size: var(--fs-md); text-decoration: none; margin-right: 4px; margin-bottom: 3px; height: 28px; vertical-align: middle; }
.map-link:hover { background: #333; color: #fff; opacity: 1; }
.map-link .g-icon { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #4285F4; color: #fff; font-size: 10px; font-weight: 700; font-family: 'Google Sans', Arial, sans-serif; line-height: 1; flex-shrink: 0; }
.map-link.apple { color: #333; }
.map-link.apple:hover { background: #333; color: #fff; }
.map-link.apple:hover .apple-icon svg { fill: #fff; }
.map-link .apple-icon { display: inline-flex; align-items: center; width: 14px; height: 14px; flex-shrink: 0; }
.map-link .apple-icon svg { width: 14px; height: 14px; fill: #333; }
.map-link.mapcode { color: var(--sand); }
.map-link.mapcode:hover { background: #333; color: #fff; }
.map-link-inline { font-size: var(--fs-md); padding: 1px 6px; height: 22px; }
.map-link-inline .g-icon { width: 13px; height: 13px; font-size: 8px; }
.map-link-inline .apple-icon, .map-link-inline .apple-icon svg { width: 11px; height: 11px; }

/* ===== Info Boxes ===== */
.info-box { margin: 6px 0; padding: 8px 12px; border-radius: 8px; font-size: var(--fs-md); line-height: 1.7; }
.info-box a { color: var(--text); font-weight: 600; text-decoration: underline; }
.info-box strong { font-weight: 600; }
.restaurant-choice { padding: 6px 0; line-height: 1.7; }
.restaurant-choice strong { color: var(--sand); }
.restaurant-choice a:not(.map-link) { color: var(--text); font-weight: 600; text-decoration: underline; }
.restaurant-meta { display: block; margin-top: 3px; font-size: var(--fs-md); color: var(--gray); }
.restaurant-meta a { color: var(--text); font-weight: 600; text-decoration: underline; }

/* ===== Budget ===== */
.budget-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.budget-table td { padding: 3px 0; }
.budget-table td:last-child { text-align: right; font-weight: 600; color: var(--text); }
.budget-total { margin-top: 6px; padding-top: 6px; font-weight: 700; color: var(--text); }
.notes-list { list-style: none; padding: 0; margin-top: 8px; }
.notes-list li { padding: 2px 0; font-size: var(--fs-md); display: flex; align-items: baseline; gap: 6px; }
.notes-list li .list-icon { flex-shrink: 0; }

/* ===== Driving Stats ===== */
.driving-stats { margin: 10px 0; padding: 10px 0; border-radius: 8px; background: transparent; font-size: var(--fs-md); }
.driving-stats-warning { background: transparent; }
.driving-stats-badge { display: inline-block; background: #DC2626; color: #fff; font-size: 0.8em; padding: 1px 8px; border-radius: 10px; font-weight: 600; margin-left: 6px; }
.driving-stats-detail { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--gray); font-size: 0.9em; }
.transport-type-group { margin-bottom: 4px; }
.transport-type-label { font-weight: 600; margin-bottom: 2px; }
.transport-type-summary { padding: 2px 0; font-weight: 600; font-size: var(--fs-md); }

/* ===== Trip Driving Summary ===== */
.driving-summary { margin: 8px 0; }
.driving-summary-day { padding: 4px 0; font-size: var(--fs-md); border-radius: 8px; }

/* ===== Trip Warnings ===== */
.trip-warnings { background: #FFEBEE; padding: 10px 14px; margin: 8px 0; border-radius: 6px; font-size: var(--fs-md); color: #D32F2F; }
.trip-warnings ul { margin: 4px 0 0 16px; }
.trip-warning-item { background: #FEE2E2; padding: 8px 12px; border-radius: 6px; margin-bottom: 6px; font-size: var(--fs-md); }

/* ===== Suggestions ===== */
.suggestion-card { padding: 8px 0; border-radius: 0; margin-bottom: 0; }
.suggestion-card h4 { margin: 0 0 6px; display: flex; align-items: center; }
.suggestion-card p { font-size: var(--fs-md); margin: 3px 0; line-height: 1.7; }
.sg-priority-high { background: rgba(239, 68, 68, 0.08); border-radius: 6px; padding: 8px 10px; }
.sg-priority-medium { background: rgba(234, 179, 8, 0.08); border-radius: 6px; padding: 8px 10px; }
.sg-priority-high h4::before,
.sg-priority-medium h4::before,
.sg-priority-low h4::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
}
.sg-priority-high h4::before { background: #EF4444; }
.sg-priority-medium h4::before { background: #EAB308; }
.sg-priority-low h4::before { background: #F97316; }

/* ===== Error Messages ===== */
.trip-error { text-align: center; padding: 40px; color: #D32F2F; }

/* ===== FAB Button ===== */
.edit-fab {
    position: fixed; bottom: 20px; right: 20px;
    width: 56px; height: 56px; border-radius: 50%;
    background: #DA7756; color: #fff; border: none;
    font-size: 1.8rem; font-weight: 300; text-decoration: none;
    display: flex; align-items: center; justify-content: center;
    z-index: 300; box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}
.edit-fab:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.3); }
body.dark .edit-fab { background: #C4704F; }
.print-mode .edit-fab { display: none !important; }
@media print { .edit-fab { display: none !important; } }

/* ===== Print Mode ===== */
.print-mode { --blue: #C4704F; --blue-light: #F5EDE8; --sand: #C4956A; --sand-light: #F5EDE0; --white: #FFFFFF; --gray: #6B6B6B; --gray-light: #FAF9F7; --text: #1A1A1A; background: var(--gray-light) !important; }
.print-mode .container { max-width: 210mm; margin: 0 auto; box-shadow: 0 0 20px rgba(0,0,0,0.1); }
.print-mode .tl-body, .print-mode .col-detail { display: block !important; }
.print-mode .tl-arrow, .print-mode .col-row .arrow { display: none !important; }
.print-mode .dh-nav { display: none !important; }
.print-mode .sticky-nav { display: none; }
.print-mode .top-bar, .print-mode .day-header { position: relative !important; }
.print-mode .day-header { flex-wrap: wrap; padding: 8px 12px; }
.print-mode .hourly-weather { display: none !important; }
.print-mode .map-link { color: #333 !important; background: #eee !important; }
.print-mode .status-tag { background: #ddd !important; color: #333 !important; }
.print-exit-btn { display: none; position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 9999; background: #D32F2F; color: #fff; border: none; padding: 10px 24px; border-radius: 8px; font-size: var(--fs-md); font-family: inherit; cursor: pointer; font-weight: 600; box-shadow: 0 2px 12px rgba(0,0,0,0.3); }
.print-exit-btn:hover { background: #B71C1C; }
.print-mode .print-exit-btn { display: block; }
@media print {
    @page { size: A4; margin: 12mm; }
    body { --blue: #C4704F; --blue-light: #F5EDE8; --sand: #C4956A; --sand-light: #F5EDE0; --white: #FFFFFF; --gray: #6B6B6B; --gray-light: #FAF9F7; --text: #1A1A1A; background: #fff !important; }
    .sticky-nav, .dh-nav, .print-exit-btn, .hourly-weather, .info-panel { display: none !important; }
    .container { max-width: 100% !important; box-shadow: none !important; }
    .tl-body, .col-detail { display: block !important; }
    .tl-arrow, .col-row .arrow { display: none !important; }
    .top-bar, .day-header { position: relative !important; }
    .day-header { background: var(--white) !important; }
    .day-content { break-inside: avoid; }
}

/* ===== Mobile ===== */
@media (max-width: 600px) {
    .day-header { top: 0; padding: 6px 8px; gap: 4px; flex-wrap: wrap; }
    .dh-nav { gap: 2px; }
    .tl-head { flex-wrap: wrap; }
    .tl-time { min-width: 75px; }
    .hw-grid { gap: 5px; scroll-snap-type: x mandatory; }
    .hw-block { min-width: calc((100% - 10px) / 3); scroll-snap-align: start; }
    .ov-grid { grid-template-columns: 1fr; }
}

/* ===== Weather Collapsible ===== */
.hw-summary { display: flex; justify-content: flex-start; align-items: center; gap: 8px; padding: 8px 0; cursor: pointer; font-size: var(--fs-md); color: var(--gray); user-select: none; }
.hw-summary:hover { color: var(--blue); }
.hw-summary-arrow { margin-left: auto; flex-shrink: 0; font-weight: 700; }
.hw-detail { display: none; }
.hw-open .hw-detail { display: block; }

/* ===== Info Header ===== */
.info-header { background: var(--text) !important; color: var(--white) !important; }

/* ===== Desktop Content Centering ===== */
@media (min-width: 768px) {
    #tripContent { max-width: var(--content-max-w); margin: 0 auto; }
}

/* ===== Info Panel (hidden by default) ===== */
.info-panel { display: none; background: var(--card-bg); }

/* ===== Desktop Three-Column Layout (≥1200px) ===== */
@media (min-width: 1200px) {
    #tripContent { max-width: none; }
    .info-panel {
        display: block;
        width: var(--info-panel-w);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding: 12px;
    }
}

/* ===== Info Cards ===== */
.info-card { background: var(--card-bg); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.countdown-card { text-align: center; }
.countdown-number { font-size: 2.5rem; font-weight: 700; color: var(--blue); line-height: 1.2; }
.countdown-label { font-size: var(--fs-md); color: var(--gray); margin-top: 4px; }
.countdown-date { font-size: var(--fs-md); color: var(--gray); margin-top: 2px; opacity: 0.7; }
.stats-card-title { font-weight: 700; font-size: var(--fs-lg); margin-bottom: 10px; }
.stats-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: var(--fs-md); }
.stats-label { color: var(--gray); }
.stats-value { font-weight: 600; }
.info-label { font-weight: 700; font-size: var(--fs-lg); margin-bottom: 10px; }
.sg-summary { display: flex; flex-direction: column; gap: 4px; }
.sg-summary-row { font-size: var(--fs-md); padding: 4px 8px; border-radius: 4px; display: flex; align-items: center; }

/* ===== Print / Info Panel ===== */
.print-mode .info-panel { display: none !important; }

/* ===== Dark Mode (trip-specific) ===== */
body.dark .info-header { background: #3D3A37 !important; color: #E8E5E0 !important; }
body.dark .map-link:hover { background: #5A5651; color: #fff; }
body.dark .map-link.apple { color: #9B9590; }
body.dark .map-link.apple .apple-icon svg { fill: #9B9590; }
body.dark .map-link.apple:hover .apple-icon svg { fill: #fff; }
body.dark .hw-block { background: #3D3A37; }
body.dark .info-box.reservation { background: #302A22; }
body.dark .info-box.parking { background: #302A25; }
body.dark .info-box.souvenir { background: #302A25; }
body.dark .info-box.restaurants { background: #302A22; }
body.dark .trip-warning-item { background: rgba(220, 38, 38, 0.12); }
body.dark .trip-warnings { background: rgba(220, 38, 38, 0.12); color: #FCA5A5; }
body.dark .sg-priority-high { background: rgba(239, 68, 68, 0.12); }
body.dark .sg-priority-medium { background: rgba(234, 179, 8, 0.12); }

