.instructions-trigger {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    margin: 0;
    padding: 0.45rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 9999px;
    background: rgba(30, 30, 30, 0.85);
    color: white;
    cursor: pointer;
    font: inherit;
    font-size: 0.875rem;
    text-decoration: underline;
}

.instructions-trigger:hover,
.instructions-trigger:focus-visible {
    background: rgba(255, 255, 255, 0.2);
}

.instructions-trigger:focus-visible,
.instructions-close:focus-visible {
    outline: 2px solid #86efac;
    outline-offset: 2px;
}

.instructions-dialog {
    display: none;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 1rem;
    border: 0;
    background: transparent;
    color: white;
}

.instructions-dialog[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

.instructions-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
}

.instructions-dialog-panel {
    display: flex;
    width: min(44rem, 100%);
    max-height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 0.75rem;
    background: rgba(30, 30, 30, 0.97);
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.55);
}

.instructions-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions-dialog-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.instructions-close {
    margin: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.35rem;
    background: transparent;
    color: white;
    cursor: pointer;
    font: inherit;
}

.instructions-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.instructions-dialog-body {
    overflow-y: auto;
    padding: 1.25rem;
}

.instructions-list {
    display: flex;
    margin: 0;
    padding-left: 1.35rem;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}

.instructions-list li {
    padding-left: 0.2rem;
    line-height: 1.45;
}

.instructions-figure {
    margin: 1.5rem 0 0;
    text-align: left;
}

.instructions-figure figcaption {
    margin-bottom: 0.65rem;
    font-size: 0.9rem;
}

.turn-flow-diagram,
.timeline-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
}

.turn-flow-step {
    padding: 0.45rem 0.55rem;
    border: 1px solid #86efac;
    border-radius: 0.35rem;
    color: #dcfce7;
    font-size: 0.85rem;
    text-align: center;
}

.turn-flow-arrow {
    color: #86efac;
    font-size: 1.25rem;
}

.timeline-diagram {
    justify-content: safe center;
    overflow-x: auto;
}

.timeline-label {
    flex: 0 0 auto;
    color: #d1d5db;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.timeline-slot {
    display: grid;
    width: 1.5rem;
    height: 4.5rem;
    flex: 0 0 auto;
    place-items: center;
    border: 2px dashed #86efac;
    border-radius: 0.3rem;
    color: #86efac;
    font-size: 1.25rem;
}

.timeline-card {
    display: flex;
    width: 6rem;
    height: 4.5rem;
    box-sizing: border-box;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.45rem;
    border: 1px solid white;
    border-radius: 0.3rem;
    background: rgba(109, 40, 217, 0.7);
    font-size: 0.8rem;
    text-align: center;
}

.timeline-card small {
    color: #f3e8ff;
    font-size: 0.7rem;
}

@media (max-width: 30rem) {
    .instructions-dialog {
        padding: 0.5rem;
    }

    .instructions-dialog-body {
        padding: 1rem;
    }

    .turn-flow-diagram {
        flex-wrap: wrap;
    }
}
