/* Modern Chronologie / Timeline
   Scoped to .timeline-modern-view so legacy screens remain unchanged. */

body .timeline-modern-view.wbg,
.platform-webview .timeline-modern-view.wbg .scroll-content,
.platform-webview .timeline-modern-view.wbg .scroll,
.timeline-modern-view,
.timeline-modern-view .pane,
.timeline-modern-view .scroll-content,
.timeline-modern-view .timeline-modern-content {
    background: #f5f7fa !important;
    background-image: none !important;
}

.timeline-modern-view .scroll {
    min-height: 100%;
}

.timeline-modern-shell {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 20px 44px;
    box-sizing: border-box;
}

.timeline-filter-bar {
    display: -webkit-flex;
    display: flex;
    gap: 10px;
    margin: 2px 0 28px;
    padding: 5px;
    border-radius: 18px;
    background: #e9edf1;
}

.timeline-filter-button {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #596274;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}

.timeline-filter-button.is-active {
    background: #29444d;
    color: #fff;
    box-shadow: 0 5px 14px rgba(41, 68, 77, .18);
}

.timeline-filter-button:focus {
    outline: 2px solid rgba(41, 68, 77, .25);
    outline-offset: 2px;
}

.timeline-modern-list,
.timeline-modern-view .timeline-modern-list .list,
.timeline-modern-view .timeline-modern-list .item-container,
.timeline-modern-view .timeline-event-repeat {
    background: transparent;
}

.timeline-modern-list {
    margin: 0;
}

.timeline-day-section {
    margin: 0 0 30px;
}

.timeline-modern-view .timeline-day-header.item-divider,
.timeline-modern-view.timeline-view .timeline-modern-list .list .item-container .timeline-day-header.item.item-divider,
.timeline-modern-view.timeline-view .timeline-day-header.item.item-divider.tictac-sticky-header {
    display: -webkit-flex;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 52px;
    max-width: none;
    margin: 0 0 10px;
    padding: 0 4px;
    border: 0;
    background: #f5f7fa;
    color: #152036;
    white-space: normal;
}

.timeline-day-title {
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.25px;
}

.timeline-day-calendar {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-flex: 0 0 38px;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9edf1;
    color: #41505f;
    font-size: 20px;
}

.timeline-day-count {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e9edf1;
    color: #5c6575;
    font-size: 13px;
    font-weight: 600;
}

.timeline-modern-view .timeline-modern-transaction.item {
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.modern-timeline-item,
.modern-timeline-item .timeline-item {
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.timeline-event-card {
    display: -webkit-flex;
    display: flex;
    width: 100%;
    min-height: 104px;
    align-items: center;
    gap: 16px;
    position: relative;
    padding: 16px 18px;
    border: 1px solid rgba(27, 39, 51, .045);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(28, 39, 49, .065);
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: transform .15s ease, box-shadow .15s ease;
}

.timeline-event-card:active {
    transform: scale(.995);
    box-shadow: 0 3px 12px rgba(28, 39, 49, .07);
}

.timeline-event-icon {
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-flex: 0 0 66px;
    flex: 0 0 66px;
    width: 66px;
    height: 66px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    overflow: hidden;
}

.timeline-event-icon.is-arrival { background: #e9f8ec; }
.timeline-event-icon.is-departure { background: #fff0ed; }
.timeline-event-icon.is-unavailable {
    background: #edf0f3;
    color: #6d7683;
    font-size: 34px;
}

.timeline-event-icon img {
    display: block;
    width: 56px;
    height: 56px;
    object-fit: contain;
}

.timeline-event-copy {
    display: -webkit-flex;
    display: flex;
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
}

.timeline-event-kind {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 700;
}

.timeline-event-kind.arrival { color: #18812a; }
.timeline-event-kind.departure { color: #d52a24; }
.timeline-event-kind.unavailable { color: #626c78; }

.timeline-event-property {
    display: block;
    width: 100%;
    color: #152036;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.23;
    white-space: normal;
    overflow-wrap: anywhere;
}

.timeline-event-secondary {
    display: block;
    width: 100%;
    margin-top: 7px;
    color: #737d8c;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
}

.timeline-event-secondary .icon {
    margin-right: 5px;
    color: #8c95a3;
}

.timeline-event-actions {
    display: -webkit-flex;
    display: flex;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    align-items: center;
    gap: 12px;
    margin-left: 8px;
}

.timeline-event-time {
    display: -webkit-inline-flex;
    display: inline-flex;
    min-width: 62px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 11px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.timeline-event-time.arrival {
    background: #e8f8eb;
    color: #177d28;
}

.timeline-event-time.departure {
    background: #fff0ed;
    color: #cc2722;
}

.timeline-modern-chevron {
    color: #9ba3af;
    font-size: 27px;
}

.timeline-empty-state {
    max-width: 560px;
    margin: 56px auto;
    padding: 34px 28px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(28, 39, 49, .06);
    color: #66707e;
    text-align: center;
}

.timeline-empty-state.compact { margin-top: 28px; }

.timeline-empty-icon {
    display: -webkit-inline-flex;
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #edf1f4;
    color: #344954;
    font-size: 30px;
}

.timeline-empty-state h3 {
    margin: 0 0 7px;
    color: #182235;
    font-size: 20px;
    font-weight: 700;
}

.timeline-empty-state p {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.modern-timeline-item .timeline-item-extra-info-container {
    margin: 8px 18px 0 100px;
    border-radius: 12px;
}

.modern-timeline-item .timeline-item-extra-info-container.item,
.modern-timeline-item .timeline-item-extra-info-container .item {
    border-color: #e9edf1;
}

.modern-timeline-item .todoListContainer.timeline {
    margin: 8px 18px 0 100px;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

.timeline-modern-view .modern-timeline-item .todoListContainer.timeline.timeline-todos-panel {
    padding: 0;
    border: 1px solid #e4e9ee;
}

.timeline-todos-toggle {
    display: -webkit-flex;
    display: flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border: 0;
    background: transparent;
    color: #41505f;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.timeline-todos-toggle:focus-visible {
    outline: 2px solid #29444d;
    outline-offset: -3px;
    border-radius: 11px;
}

.timeline-todos-label,
.timeline-todos-summary {
    display: -webkit-flex;
    display: flex;
    align-items: center;
    gap: 9px;
}

.timeline-todos-label { min-width: 0; }
.timeline-todos-label > .icon { color: #778493; font-size: 20px; }
.timeline-todos-summary { -webkit-flex: 0 0 auto; flex: 0 0 auto; }

.timeline-todos-count {
    min-width: 24px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf1f4;
    color: #41505f;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
}

.timeline-todos-count.is-complete { background: #e8f8eb; color: #177d28; }

.timeline-todos-chevron {
    color: #778493;
    font-size: 18px;
    transition: transform .15s ease;
}

.timeline-todos-chevron.is-expanded { transform: rotate(180deg); }

.timeline-todos-body {
    padding: 8px 14px 12px;
    border-top: 1px solid #edf1f4;
}

.timeline-modern-view .timeline-todos-body .list {
    margin: 0;
    padding: 0;
    background: transparent;
}

.timeline-modern-view .timeline-todos-body .item.todo {
    min-height: 44px;
    display: -webkit-flex;
    display: flex;
    align-items: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
    .timeline-todos-chevron { transition: none; }
}

.timeline-modern-view .tictac-sticky-header { box-shadow: none; }

@media (max-width: 767px) {
    .timeline-modern-shell { padding: 14px 12px 32px; }
    .timeline-filter-bar { margin-bottom: 20px; }
    .timeline-filter-button { min-height: 42px; font-size: 14px; }
    .timeline-day-header.item-divider { padding-left: 2px; padding-right: 2px; }
    .timeline-day-title { gap: 8px; font-size: 17px; }
    .timeline-day-calendar { -webkit-flex-basis: 34px; flex-basis: 34px; width: 34px; height: 34px; font-size: 18px; }
    .timeline-day-count { padding: 6px 9px; font-size: 12px; }
    .timeline-event-card { min-height: 94px; gap: 12px; padding: 14px 13px; border-radius: 16px; }
    .timeline-event-icon { -webkit-flex-basis: 56px; flex-basis: 56px; width: 56px; height: 56px; }
    .timeline-event-icon img { width: 48px; height: 48px; }
    .timeline-event-kind { font-size: 13px; }
    .timeline-event-property { font-size: 17px; }
    .timeline-event-secondary { margin-top: 5px; font-size: 13px; }
    .timeline-event-actions { gap: 7px; margin-left: 3px; }
    .timeline-event-time { min-width: 52px; height: 30px; padding: 0 8px; font-size: 13px; }
    .timeline-modern-chevron { font-size: 23px; }
    .modern-timeline-item .timeline-item-extra-info-container,
    .modern-timeline-item .todoListContainer.timeline { margin-left: 12px; margin-right: 12px; }
}

@media (max-width: 430px) {
    .timeline-day-count span { display: none; }
    .timeline-event-card { gap: 10px; padding-left: 11px; padding-right: 10px; }
    .timeline-event-icon { -webkit-flex-basis: 50px; flex-basis: 50px; width: 50px; height: 50px; }
    .timeline-event-icon img { width: 44px; height: 44px; }
    .timeline-event-property { font-size: 16px; }
    .timeline-event-secondary { display: none; }
    .timeline-event-actions { gap: 4px; }
    .timeline-modern-chevron { font-size: 21px; }
}
