:root {
    --navy: #071733;
    --navy-2: #0d1d3a;
    --bg: #f7f4f2;
    --card: #ffffff;
    --text: #0d1830;
    --muted: #7b879d;
    --border: #e6dfda;
    --soft: #f1ece8;
    --orange: #f28a2e;
    --orange-soft: #fde8d4;
    --shadow: 0 18px 50px rgba(10, 20, 40, 0.14);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

body.modal-open {
    overflow: hidden;
}

/* Floating button */
.track-fab {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(560px, calc(100% - 40px));
    height: 56px;
    border: 0;
    border-radius: 20px;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(7, 23, 51, 0.32);
    z-index: 1000;
}

.track-fab svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.track-fab .arrow {
    margin-left: 8px;
    transition: transform 0.25s ease;
}

.track-fab.active .arrow {
    transform: rotate(180deg);
}

/* Common modal */
#trackOverlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 14, 28, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999;
    opacity: 1;
}

#trackOverlay.show {
    display: flex;
}

.modal-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 0;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.track-modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 24px 10px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-logo {
    width: 106px;
    height: auto;
    object-fit: contain;
    display: block;
}

.track-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #7b8090;
    border-radius: 10px;
}

.icon-btn:hover {
    background: #f5f5f5;
}

.track-modal-body {
    padding: 0 24px 24px;
}

.track-subtitle {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 18px;
}

.field {
    width: 100%;
    height: 48px;
    border: 0;
    outline: none;
    background: #f2efed;
    border-radius: 10px;
    padding: 0 16px;
    font-size: 15px;
    color: var(--text);
    margin-bottom: 16px;
}

.field::placeholder {
    color: #7a8599;
}

.primary-btn {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--navy);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.error-text {
    min-height: 18px;
    margin: -6px 0 10px;
    font-size: 13px;
    color: #d83d3d;
}

/* Details popup */
.details-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 14, 28, 0.48);
    display: none;
    z-index: 1100;
}

.details-overlay.show {
    display: block;
}

.details-shell {
    position: absolute;
    inset: 20px;
    background: var(--bg);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.details-header-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    display: grid;
    place-items: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.details-scroll {
    overflow: auto;
    height: 100%;
}

.hero {
    text-align: center;
    padding: 42px 20px 70px;
    background: radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.02) 1px, transparent 1px) 0 0 / 22px 22px,
    #faf7f5;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    background: #f0ece8;
    color: var(--text);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 18px;
}

.hero h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 54px);
    line-height: 1.06;
    color: var(--text);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.hero p {
    margin: 14px auto 0;
    max-width: 760px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.content-wrap {
    max-width: 1000px;
    margin: -10px auto 48px;
    padding: 0 20px 30px;
}

.info-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 30px;
    margin-bottom: 26px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
}

.icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: #f4f1ef;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--text);
}

.info-list {
    width: 100%;
}

.info-row {
    display: grid;
    grid-template-columns: 210px 1fr;
    align-items: center;
    gap: 14px;
    min-height: 52px;
    border-bottom: 1px solid var(--border);
}

.info-row:last-child {
    border-bottom: 0;
}

.label {
    color: var(--muted);
    font-size: 15px;
}

.value {
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 6px;
}

.timeline:before {
    content: "";
    position: absolute;
    left: 18px;
    top: 16px;
    bottom: 16px;
    width: 2px;
    background: #ddd5cf;
}

.timeline-item {
    position: relative;
    display: flex;
    gap: 20px;
    padding: 0 0 26px 0;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: relative;
    z-index: 2;
    width: 26px;
    height: 26px;
    margin-top: 2px;
    border-radius: 50%;
    border: 2px solid #cfc6bf;
    background: #f6f2ef;
    flex: 0 0 auto;
}

.timeline-item.current .timeline-marker {
    width: 34px;
    height: 34px;
    margin-left: -4px;
    border: 5px solid var(--orange-soft);
    background: var(--orange);
    box-shadow: 0 0 0 2px rgba(242, 138, 46, 0.12);
}

.timeline-item.current .timeline-marker:after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
}

.timeline-content {
    padding-top: 1px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 500;
    color: #6d7d97;
    margin-bottom: 5px;
}

.timeline-item.current .timeline-title {
    color: var(--orange);
    font-size: 18px;
    font-weight: 400;
}

.timeline-date {
    font-size: 14px;
    color: #6d7d97;
    margin-bottom: 6px;
}

.timeline-note {
    font-size: 14px;
    color: #6d7d97;
    font-style: italic;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 26px;
}

.notes-box {
    min-height: 70px;
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.d-none {
    display: none;
}

@media (min-width: 860px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .details-shell {
        inset: 0;
        border-radius: 0;
    }

    .hero {
        padding: 34px 16px 44px;
    }

    .hero p {
        font-size: 16px;
    }

    .content-wrap {
        padding: 0 14px 24px;
    }

    .info-card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .info-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 0;
    }

    .value {
        text-align: left;
    }

    .modal-card {
        border-radius: 18px;
    }

    .track-title {
        white-space: normal;
    }
}
