.history-page {
    min-height: 100vh;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.history-shell {
    width: min(1180px, calc(100% - 36px));
    margin: 0 auto;
    padding: clamp(56px, 9vw, 104px) 0 64px;
}

.history-header {
    max-width: 780px;
    margin-bottom: clamp(28px, 5vw, 48px);
}

.history-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin-bottom: 30px;
    color: var(--mk-accent-strong);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.history-back:hover,
.history-back:focus-visible {
    color: #fff8f1;
}

.history-back:focus-visible {
    outline: 2px solid var(--mk-accent);
    outline-offset: 4px;
}

.history-brand {
    margin-bottom: 24px;
    color: var(--mk-ink);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.history-brand span {
    display: block;
    margin-top: 3px;
    color: var(--mk-ink-muted);
    font-size: 0.58rem;
    letter-spacing: 0.28em;
}

.history-kicker,
.history-section-label {
    margin: 0 0 8px;
    color: var(--mk-accent-strong);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.history-header h1 {
    margin: 0;
    color: #fff9f2;
    font-size: clamp(3rem, 9vw, 6.5rem);
    line-height: 0.88;
    letter-spacing: -0.055em;
    text-transform: uppercase;
}

.history-intro {
    max-width: 640px;
    margin: 22px 0 0;
    color: var(--mk-ink-muted);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.6;
}

.history-surface {
    overflow: hidden;
    border: 1px solid rgba(255, 225, 194, 0.3);
    border-radius: 24px;
    background: #f5ede5;
    color: var(--mk-ink-dark);
    box-shadow: 0 24px 60px rgba(10, 3, 2, 0.35);
}

.history-surface-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding: clamp(22px, 4vw, 34px);
    border-bottom: 1px solid rgba(93, 64, 55, 0.18);
}

.history-section-label {
    color: #8a4d19;
}

.history-surface h2 {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    letter-spacing: -0.03em;
}

.history-count {
    margin: 0;
    color: var(--mk-ink-dark-muted);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.history-status {
    min-height: 180px;
    display: grid;
    place-items: center;
    padding: 32px;
    color: var(--mk-ink-dark-muted);
    text-align: center;
}

.history-status-card {
    max-width: 480px;
}

.history-status-card p {
    margin: 0 0 18px;
    line-height: 1.55;
}

.history-sign-in {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 22px;
    border-radius: 999px;
    background: #9b4f12;
    color: #fff;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
}

.history-sign-in:hover,
.history-sign-in:focus-visible {
    background: #71370c;
}

.history-results {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.history-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 17px clamp(16px, 3vw, 30px);
    border-bottom: 1px solid rgba(93, 64, 55, 0.14);
    text-align: left;
    white-space: nowrap;
}

.history-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #e8d8ca;
    color: #57362d;
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.history-table tbody tr:nth-child(even) {
    background: rgba(93, 64, 55, 0.045);
}

.history-table tbody tr:hover {
    background: rgba(197, 106, 27, 0.1);
}

.history-table tbody tr:last-child td {
    border-bottom: 0;
}

.history-table td:nth-child(3) {
    font-weight: 900;
}

.history-place {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 34px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #5d4037;
    color: #fff;
    font-weight: 900;
}

@media (max-width: 600px) {
    .history-shell {
        width: min(100% - 24px, 1180px);
        padding-top: 48px;
    }

    .history-back {
        margin-bottom: 22px;
    }

    .history-surface {
        border-radius: 18px;
    }

    .history-surface-header {
        align-items: start;
        flex-direction: column;
        gap: 8px;
    }

    .history-table th,
    .history-table td {
        padding: 15px 18px;
    }
}
