/* ============================================================
   HISTORY TIMELINE - MAIN SECTION
   ============================================================ */

#sm-history {
    position: relative;
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    /* Height is set dynamically by JS */
}

/* ============================================================
   STICKY CONTAINER - FULL WIDTH & HEIGHT
   ============================================================ */

.sm-history__sticky {
    position: sticky;
    top: 0;
    left: 0;
    width: 100% !important;
    min-width: 100%;
    max-width: 100%;
    height: 100vh;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    background: #f8fafc;
    z-index: 10;
    padding-top: 90px;
    box-sizing: border-box;
}

/* When capturing - only z-index changes */
.sm-history__sticky.is-capturing {
    z-index: 9999;
}

/* ============================================================
   HEADER
   ============================================================ */

.sm-history__header {
    text-align: center;
    padding: 30px 20px 30px;
    position: relative;
    z-index: 5;
    width: 100%;
}

.sm-history__eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #f59e0b;
    margin-bottom: 14px;
    font-weight: 700;
}

.sm-history__header h2 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: #1e293b;
    margin: 0 0 12px;
    font-weight: 800;
}

.sm-history__header h2 strong {
    color: #f59e0b;
}

.sm-history__header p {
    font-size: 1rem;
    color: #64748b;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================================
   GRID - FULL WIDTH
   ============================================================ */

.sm-history__grid {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    padding: 0 20px 80px;
    will-change: transform;
    position: relative;
}

/* ============================================================
   SVG ROAD
   ============================================================ */

.sm-history__road {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible;
}

/* ============================================================
   SNAKE ROWS
   ============================================================ */

.sm-history__row {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-evenly;
    align-items: flex-start;
    position: relative;
    z-index: 2;
    margin-bottom: 70px;
}

.sm-history__row:last-of-type {
    margin-bottom: 0;
}

.sm-history__row--reverse {
    flex-direction: row-reverse;
}

/* ============================================================
   MILESTONE ITEMS
   ============================================================ */

.sm-history__item {
    flex: 0 1 240px;
    width: 280px;
    max-width: 280px;
    min-width: 240px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
}

.sm-history__item--split {
    width: 560px;
    max-width: 560px;
    min-width: 560px;
    flex: 0 0 560px;
    align-items: center;
}

.sm-history__item--split .sm-history__year {
    margin-left: auto;
    margin-right: auto;
}

.sm-history__item--split .sm-history__box {
    width: 560px;
    max-width: 560px;
    min-width: 560px;
    padding: 0;
    overflow: hidden;
}

.sm-history__split {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sm-history__split-left,
.sm-history__split-right {
    flex: 1 1 50%;
    width: 50%;
    min-width: 0;
    padding: 20px 16px;
    text-align: center;
    box-sizing: border-box;
}

.sm-history__split-right {
    border-left: 1px solid rgba(30, 41, 59, 0.25);
}

/* ============================================================
   YEAR CIRCLE
   ============================================================ */

.sm-history__year {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #ffffff;
    color: #f59e0b;
    font-size: 0.85rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    position: relative;
    z-index: 5;
    border: 3px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    transition: all 0.4s ease;
}

.sm-history__item.is-active .sm-history__year {
    background: #f59e0b;
    border-color: #d97706;
    color: #ffffff;
    transform: scale(1.18);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25), 0 0 20px rgba(245, 158, 11, 0.3);
}

/* ============================================================
   CONTENT CARD
   ============================================================ */

.sm-history__box {
    background: #fbbf24;
    box-sizing: border-box;
    border-radius: 14px;
    padding: 20px 16px;
    text-align: center;
    width: 100%;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border: 2px solid transparent;
    transform-origin: top center;
    transition: all 0.4s ease;
    opacity: 0.5;
    transform: scale(0.92) translateY(10px);
}

.sm-history__item--split .sm-history__box {
    padding: 0;
}

.sm-history__item.is-active .sm-history__box {
    border-color: #d97706;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* ============================================================
   MONTH BADGE
   ============================================================ */

.sm-history__month {
    display: inline-block;
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    background: #1e293b;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

/* ============================================================
   CARD TYPOGRAPHY
   ============================================================ */

.sm-history__box h3 {
    font-size: 0.95rem;
    margin: 0 0 8px;
    color: #1e293b;
    font-weight: 700;
    line-height: 1.3;
}

.sm-history__box p {
    font-size: 0.92rem;
    color: #334155;
    margin: 0;
    line-height: 1.5;
}

/* ============================================================
   CAR
   ============================================================ */

.sm-history__car {
    position: absolute;
    z-index: 20;
    width: 100px;
    height: auto;
    padding-bottom: 20px;
    will-change: left, top;
    pointer-events: none;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25));
}

.sm-history__car-svg {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.2s ease;
}

/* ============================================================
   CAR SPEECH BUBBLE
   ============================================================ */

.sm-history__car-bubble {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    width: 190px;
    min-height: 65px;
    box-sizing: border-box;
    padding: 16px 20px;
    background: #fef08a;
    border: 3px solid #d97706;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #1e293b;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.4;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(251, 191, 36, 0.15);
    z-index: 50;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.sm-history__car-bubble.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

.sm-history__car-bubble::after {
    content: "";
    position: absolute;
    left: 30%;
    bottom: -13px;
    width: 22px;
    height: 22px;
    background: #fef08a;
    border-right: 3px solid #d97706;
    border-bottom: 3px solid #d97706;
    transform: translateX(-50%) rotate(45deg);
    z-index: -1;
}

.sm-history__car-bubble-text {
    display: block;
    max-width: 150px;
    color: #1e293b;
    transform: none !important;
}

/* ============================================================
   BOTTOM STATUS BAR - FULL WIDTH
   ============================================================ */

.sm-history__status {
    text-align: center;
    padding: 20px 20px 30px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 5;
    background: linear-gradient(transparent, #f8fafc 40%);
}

.sm-history__status span {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
}

.sm-history__status strong {
    display: block;
    font-size: 1.4rem;
    margin: 8px 0 18px;
    color: #1e293b;
    font-weight: 800;
}

.sm-history__loader {
    width: 200px;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin: 0 auto 10px;
    overflow: hidden;
}

.sm-history__loader span {
    display: block;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #d97706);
    border-radius: 3px;
    transition: width 0.1s linear;
}

.sm-history__status small {
    font-size: 0.85rem;
    color: #f59e0b;
    font-weight: 700;
}

/* ============================================================
   SCROLL HINT
   ============================================================ */

.sm-history__scroll-hint {
    position: absolute;
    top: 15px;
    right: 20px;
    z-index: 100;
    background: rgba(30, 41, 59, 0.85);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

#sm-history.is-active .sm-history__scroll-hint {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   STICKY NOTES
   ============================================================ */

.sm-history__box,
.sm-history__split-left,
.sm-history__split-right {
    position: relative;
}

.sm-history__item--notes .sm-history__box {
    overflow: visible !important;
}

.sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before {
    content: attr(data-note);
    position: absolute;
    top: -10px;
    right: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    box-sizing: border-box;
    background: #fef08a;
    border: 1px solid #eab308;
    box-shadow: 2px 2px 0 #fde047, 4px 4px 0 #facc15, 5px 5px 8px rgba(0, 0, 0, 0.15);
    border-radius: 6px;
    color: #713f12;
    font-family: "Comic Sans MS", "Segoe Print", cursive;
    font-size: 7px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(12deg);
    z-index: 20;
    pointer-events: none;
}

.sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after {
    content: "";
    position: absolute;
    top: -18px;
    right: 22px;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    border-radius: 50%;
    border: 1px solid #991b1b;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 21;
    pointer-events: none;
}

.sm-history__item--notes.sm-history__item--split .sm-history__split-left::before {
    content: attr(data-note);
    position: absolute;
    top: -8px;
    left: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    box-sizing: border-box;
    background: #fef08a;
    border: 1px solid #eab308;
    box-shadow: 1.5px 1.5px 0 #fde047, 3px 3px 0 #facc15, 4px 4px 6px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    color: #713f12;
    font-family: "Comic Sans MS", "Segoe Print", cursive;
    font-size: 6px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(-12deg);
    z-index: 20;
    pointer-events: none;
}

.sm-history__item--notes.sm-history__item--split .sm-history__split-left::after {
    content: "";
    position: absolute;
    top: -14px;
    left: 18px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    border-radius: 50%;
    border: 1px solid #991b1b;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 21;
    pointer-events: none;
}

.sm-history__item--notes.sm-history__item--split .sm-history__split-right::before {
    content: attr(data-note);
    position: absolute;
    top: -8px;
    right: 8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    box-sizing: border-box;
    background: #fef08a;
    border: 1px solid #eab308;
    box-shadow: 1.5px 1.5px 0 #fde047, 3px 3px 0 #facc15, 4px 4px 6px rgba(0, 0, 0, 0.15);
    border-radius: 2px;
    color: #713f12;
    font-family: "Comic Sans MS", "Segoe Print", cursive;
    font-size: 6px;
    font-weight: 700;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
    transform: rotate(12deg);
    z-index: 20;
    pointer-events: none;
}

.sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
    content: "";
    position: absolute;
    top: -14px;
    right: 18px;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle at 30% 30%, #f87171, #dc2626);
    border-radius: 50%;
    border: 1px solid #991b1b;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    z-index: 21;
    pointer-events: none;
}

/* ============================================================
   RESPONSIVE - LARGE DESKTOP (1401px+)
   ============================================================ */

@media (min-width: 1401px) {
    .sm-history__grid {
        max-width: 1200px;
    }
}

/* ============================================================
   RESPONSIVE - MEDIUM DESKTOP (1101px - 1400px)
   ============================================================ */

@media (min-width: 1101px) and (max-width: 1400px) {
    .sm-history__grid {
        max-width: 1100px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .sm-history__item {
        width: 260px;
        max-width: 260px;
        min-width: 220px;
        flex: 0 1 260px;
    }

    .sm-history__item--split {
        width: 520px;
        max-width: 520px;
        min-width: 520px;
        flex: 0 0 520px;
    }

    .sm-history__item--split .sm-history__box {
        width: 520px;
        max-width: 520px;
        min-width: 520px;
    }

    .sm-history__row {
        justify-content: space-evenly;
    }
}

/* ============================================================
   RESPONSIVE - TABLET LANDSCAPE (960px - 1100px)
   ============================================================ */

@media (min-width: 960px) and (max-width: 1100px) {
    .sm-history__grid {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }

    .sm-history__row {
        justify-content: space-between;
        gap: 12px;
    }

    .sm-history__item {
        width: 220px;
        min-width: 0;
        max-width: 220px;
        flex: 0 1 220px;
    }

    .sm-history__item--split {
        width: 220px;
        min-width: 0;
        max-width: 220px;
        flex: 0 1 220px;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .sm-history__split {
        flex-direction: column;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 100%;
        min-width: 0;
        padding: 16px 12px;
    }

    .sm-history__split-right {
        border-left: none;
        border-top: 1px solid rgba(30, 41, 59, 0.25);
    }

    .sm-history__box h3 {
        font-size: 0.85rem;
    }

    .sm-history__box p {
        font-size: 0.78rem;
    }

    .sm-history__car {
        width: 70px;
    }

    .sm-history__car-bubble {
        width: 160px;
        min-height: 55px;
        padding: 12px 14px;
        font-size: 0.68rem;
    }

    .sm-history__car-bubble-text {
        max-width: 130px;
    }
}

/* ============================================================
   RESPONSIVE - TABLET PORTRAIT (769px - 959px)
   ============================================================ */

@media (min-width: 769px) and (max-width: 959px) {
    .sm-history__sticky {
        padding-top: 80px;
    }

    .sm-history__grid {
        max-width: 100%;
        padding-left: 16px;
        padding-right: 16px;
        padding-bottom: 70px;
    }

    .sm-history__header {
        padding: 20px 16px 20px;
    }

    .sm-history__row {
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 55px;
    }

    .sm-history__item {
        width: 200px;
        min-width: 0;
        max-width: 200px;
        flex: 0 1 200px;
    }

    .sm-history__item--split {
        width: 200px;
        min-width: 0;
        max-width: 200px;
        flex: 0 1 200px;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .sm-history__split {
        flex-direction: column;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 100%;
        min-width: 0;
        padding: 14px 12px;
    }

    .sm-history__split-right {
        border-left: none;
        border-top: 1px solid rgba(30, 41, 59, 0.25);
    }

    .sm-history__year {
        width: 52px;
        height: 52px;
        font-size: 0.78rem;
        margin-bottom: 10px;
    }

    .sm-history__box {
        padding: 16px 12px;
    }

    .sm-history__box h3 {
        font-size: 0.82rem;
    }

    .sm-history__box p {
        font-size: 0.74rem;
    }

    .sm-history__car {
        width: 65px;
    }

    .sm-history__car-bubble {
        width: 150px;
        min-height: 50px;
        padding: 10px 12px;
        font-size: 0.65rem;
    }

    .sm-history__car-bubble-text {
        max-width: 120px;
    }

    .sm-history__status strong {
        font-size: 1.2rem;
    }

    .sm-history__loader {
        width: 160px;
    }

    /* Hide sticky notes on smaller tablets - they overflow */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE LANDSCAPE / LARGE PHONE (641px - 768px)
   ============================================================ */

@media (min-width: 641px) and (max-width: 768px) {
    .sm-history__sticky {
        padding-top: 75px;
    }

    .sm-history__header {
        padding: 18px 16px 16px;
    }

    .sm-history__header h2 {
        font-size: 1.6rem;
    }

    .sm-history__header p {
        font-size: 0.9rem;
    }

    .sm-history__grid {
        max-width: 100%;
        padding: 0 16px 90px;
    }

    .sm-history__row,
    .sm-history__row--reverse {
        flex-direction: column;
        align-items: center;
        gap: 45px;
        margin-bottom: 50px;
    }

    .sm-history__item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .sm-history__split {
        flex-direction: row;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 50%;
        min-width: 0;
        flex: 1 1 50%;
        padding: 16px 10px;
    }

    .sm-history__split-right {
        border-left: 1px solid rgba(30, 41, 59, 0.25);
        border-top: none;
    }

    .sm-history__year {
        width: 52px;
        height: 52px;
        font-size: 0.75rem;
        margin-bottom: 10px;
    }

    .sm-history__box {
        padding: 16px 14px;
    }

    .sm-history__box h3 {
        font-size: 0.88rem;
    }

    .sm-history__box p {
        font-size: 0.78rem;
    }

    .sm-history__car {
        width: 65px;
    }

    .sm-history__car-bubble {
        width: 155px;
        min-height: 52px;
        padding: 12px 14px;
        font-size: 0.65rem;
    }

    .sm-history__car-bubble-text {
        max-width: 120px;
    }

    .sm-history__status strong {
        font-size: 1.15rem;
    }

    .sm-history__loader {
        width: 160px;
    }

    /* Hide sticky notes */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - MOBILE PORTRAIT (481px - 640px)
   ============================================================ */

@media (min-width: 481px) and (max-width: 640px) {
    .sm-history__sticky {
        padding-top: 70px;
    }

    .sm-history__header {
        padding: 16px 14px 14px;
    }

    .sm-history__header h2 {
        font-size: 1.5rem;
    }

    .sm-history__header p {
        font-size: 0.85rem;
    }

    .sm-history__grid {
        max-width: 100%;
        padding: 0 14px 85px;
    }

    .sm-history__row,
    .sm-history__row--reverse {
        flex-direction: column;
        align-items: center;
        gap: 40px;
        margin-bottom: 45px;
    }

    .sm-history__item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .sm-history__split {
        flex-direction: row;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 50%;
        min-width: 0;
        flex: 1 1 50%;
        padding: 14px 8px;
    }

    .sm-history__split-right {
        border-left: 1px solid rgba(30, 41, 59, 0.25);
        border-top: none;
    }

    .sm-history__year {
        width: 50px;
        height: 50px;
        font-size: 0.72rem;
        margin-bottom: 8px;
    }

    .sm-history__box {
        padding: 14px 12px;
    }

    .sm-history__box h3 {
        font-size: 0.84rem;
    }

    .sm-history__box p {
        font-size: 0.74rem;
    }

    .sm-history__month {
        font-size: 0.6rem;
        padding: 3px 10px;
    }

    .sm-history__car {
        width: 58px;
    }

    .sm-history__car-bubble {
        width: 140px;
        min-height: 48px;
        padding: 10px 12px;
        font-size: 0.6rem;
    }

    .sm-history__car-bubble-text {
        max-width: 110px;
    }

    .sm-history__status {
        padding: 16px 16px 24px;
    }

    .sm-history__status strong {
        font-size: 1.1rem;
        margin: 6px 0 14px;
    }

    .sm-history__loader {
        width: 150px;
    }

    /* Hide sticky notes */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - SMALL MOBILE (381px - 480px)
   ============================================================ */

@media (min-width: 381px) and (max-width: 480px) {
    .sm-history__sticky {
        padding-top: 65px;
    }

    .sm-history__header {
        padding: 14px 12px 12px;
    }

    .sm-history__header h2 {
        font-size: 1.35rem;
    }

    .sm-history__header p {
        font-size: 0.8rem;
        max-width: 300px;
    }

    .sm-history__grid {
        max-width: 100%;
        padding: 0 12px 80px;
    }

    .sm-history__row,
    .sm-history__row--reverse {
        flex-direction: column;
        align-items: center;
        gap: 35px;
        margin-bottom: 40px;
    }

    .sm-history__item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .sm-history__split {
        flex-direction: row;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 50%;
        min-width: 0;
        flex: 1 1 50%;
        padding: 12px 7px;
    }

    .sm-history__split-right {
        border-left: 1px solid rgba(30, 41, 59, 0.25);
        border-top: none;
    }

    .sm-history__year {
        width: 48px;
        height: 48px;
        font-size: 0.68rem;
        margin-bottom: 8px;
        border-width: 2px;
    }

    .sm-history__box {
        padding: 12px 10px;
        border-radius: 10px;
    }

    .sm-history__box h3 {
        font-size: 0.8rem;
        margin-bottom: 6px;
    }

    .sm-history__box p {
        font-size: 0.7rem;
    }

    .sm-history__month {
        font-size: 0.55rem;
        padding: 3px 8px;
        margin-bottom: 8px;
    }

    .sm-history__car {
        width: 50px;
    }

    .sm-history__car-bubble {
        width: 125px;
        min-height: 44px;
        padding: 8px 10px;
        font-size: 0.55rem;
        border-width: 2px;
        border-radius: 14px;
    }

    .sm-history__car-bubble-text {
        max-width: 100px;
    }

    .sm-history__car-bubble::after {
        width: 16px;
        height: 16px;
        bottom: -10px;
        border-width: 2px;
    }

    .sm-history__status {
        padding: 14px 14px 20px;
    }

    .sm-history__status span {
        font-size: 0.6rem;
    }

    .sm-history__status strong {
        font-size: 1rem;
        margin: 5px 0 12px;
    }

    .sm-history__loader {
        width: 130px;
        height: 5px;
    }

    .sm-history__status small {
        font-size: 0.75rem;
    }

    .sm-history__scroll-hint {
        font-size: 0.6rem;
        padding: 6px 12px;
        top: 10px;
        right: 12px;
    }

    /* Hide sticky notes */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - VERY SMALL MOBILE (max 380px)
   ============================================================ */

@media (max-width: 380px) {
    .sm-history__sticky {
        padding-top: 55px;
    }

    .sm-history__header {
        padding: 10px 10px 8px;
    }

    .sm-history__eyebrow {
        font-size: 0.65rem;
        margin-bottom: 8px;
    }

    .sm-history__header h2 {
        font-size: 1.2rem;
        margin-bottom: 8px;
    }

    .sm-history__header p {
        font-size: 0.75rem;
        max-width: 260px;
    }

    .sm-history__grid {
        max-width: 100%;
        padding: 0 8px 70px;
    }

    .sm-history__row,
    .sm-history__row--reverse {
        flex-direction: column;
        align-items: center;
        gap: 28px;
        margin-bottom: 35px;
    }

    .sm-history__item {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .sm-history__item--split .sm-history__box {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .sm-history__split {
        flex-direction: column;
    }

    .sm-history__split-left,
    .sm-history__split-right {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
        padding: 10px 8px;
    }

    .sm-history__split-right {
        border-left: none;
        border-top: 1px solid rgba(30, 41, 59, 0.25);
    }

    .sm-history__year {
        width: 44px;
        height: 44px;
        font-size: 0.62rem;
        margin-bottom: 6px;
        border-width: 2px;
    }

    .sm-history__box {
        padding: 10px 8px;
        border-radius: 8px;
    }

    .sm-history__box h3 {
        font-size: 0.74rem;
        margin-bottom: 4px;
    }

    .sm-history__box p {
        font-size: 0.66rem;
        line-height: 1.4;
    }

    .sm-history__month {
        font-size: 0.5rem;
        padding: 2px 7px;
        margin-bottom: 6px;
    }

    .sm-history__car {
        width: 42px;
    }

    .sm-history__car-bubble {
        width: 105px;
        min-height: 38px;
        padding: 7px 8px;
        font-size: 0.5rem;
        border-width: 2px;
        border-radius: 12px;
        bottom: calc(100% + 8px);
    }

    .sm-history__car-bubble-text {
        max-width: 85px;
    }

    .sm-history__car-bubble::after {
        width: 14px;
        height: 14px;
        bottom: -8px;
        border-width: 2px;
    }

    .sm-history__status {
        padding: 10px 10px 16px;
    }

    .sm-history__status span {
        font-size: 0.55rem;
    }

    .sm-history__status strong {
        font-size: 0.9rem;
        margin: 4px 0 10px;
    }

    .sm-history__loader {
        width: 110px;
        height: 4px;
    }

    .sm-history__status small {
        font-size: 0.7rem;
    }

    .sm-history__scroll-hint {
        font-size: 0.55rem;
        padding: 5px 10px;
        top: 8px;
        right: 8px;
    }

    /* Hide sticky notes */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   RESPONSIVE - SHORT VIEWPORT HEIGHT FIX
   Prevents content clipping on landscape phones / short screens
   ============================================================ */

@media (max-height: 600px) and (orientation: landscape) {
    .sm-history__sticky {
        padding-top: 50px;
    }

    .sm-history__header {
        padding: 8px 16px 6px;
    }

    .sm-history__eyebrow {
        font-size: 0.6rem;
        margin-bottom: 4px;
    }

    .sm-history__header h2 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .sm-history__header p {
        font-size: 0.8rem;
    }

    .sm-history__grid {
        padding-bottom: 50px;
    }

    .sm-history__row {
        margin-bottom: 35px;
    }

    .sm-history__year {
        width: 40px;
        height: 40px;
        font-size: 0.6rem;
        margin-bottom: 6px;
        border-width: 2px;
    }

    .sm-history__box {
        padding: 8px 10px;
    }

    .sm-history__box h3 {
        font-size: 0.75rem;
        margin-bottom: 3px;
    }

    .sm-history__box p {
        font-size: 0.68rem;
    }

    .sm-history__car {
        width: 45px;
    }

    .sm-history__car-bubble {
        display: none;
    }

    .sm-history__status {
        padding: 8px 16px 12px;
    }

    .sm-history__status strong {
        font-size: 0.9rem;
        margin: 3px 0 8px;
    }

    .sm-history__loader {
        width: 120px;
        height: 4px;
    }

    /* Hide sticky notes */
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::before,
    .sm-history__item--notes:not(.sm-history__item--split) .sm-history__box::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-left::after,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::before,
    .sm-history__item--notes.sm-history__item--split .sm-history__split-right::after {
        display: none;
    }
}

/* ============================================================
   SAFE AREA - NOTCH DEVICES (iPhone X+)
   ============================================================ */

@supports (padding: env(safe-area-inset-top)) {
    .sm-history__sticky {
        padding-top: calc(90px + env(safe-area-inset-top));
    }

    .sm-history__status {
        padding-bottom: calc(30px + env(safe-area-inset-bottom));
    }

    @media (max-width: 768px) {
        .sm-history__sticky {
            padding-top: calc(70px + env(safe-area-inset-top));
        }
    }

    @media (max-width: 480px) {
        .sm-history__sticky {
            padding-top: calc(65px + env(safe-area-inset-top));
        }
    }

    @media (max-width: 380px) {
        .sm-history__sticky {
            padding-top: calc(55px + env(safe-area-inset-top));
        }
    }

    @media (max-height: 600px) and (orientation: landscape) {
        .sm-history__sticky {
            padding-top: calc(50px + env(safe-area-inset-top));
        }
    }
}

/* ============================================================
   REDUCED MOTION - ACCESSIBILITY
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .sm-history__year,
    .sm-history__box,
    .sm-history__car-svg,
    .sm-history__car-bubble,
    .sm-history__loader span {
        transition: none !important;
    }

    .sm-history__grid {
        will-change: auto;
    }
}
/* ============================================================
   BOTTOM STATUS BAR - FULL COLOR FIX
   ============================================================ */

.sm-history__status {
    text-align: center;
    padding: 20px 20px 30px;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 5;
    /* FIX: Removed the dull "transparent to grey" fade gradient. 
       Now it is a solid, clean background so your cards stay in full color */
    background: #f8fafc; 
}