/* Q-Labs lab pages (Lab 01 Difficulty, Lab 02 Order timing): header, toolbar, section cards, legends, tables and caveats.
   Global rather than scoped so that every lab page shares them; the ld- prefix keeps them to the labs. */

.ld-crumbs {
    font-size: 0.82rem;
    color: var(--qb-muted);
    margin-bottom: 10px;
}

.ld-crumbs a {
    color: var(--qb-muted);
    text-decoration: none;
}

.ld-crumbs a:hover {
    color: #fff;
}

.ld-crumbs span {
    margin: 0 4px;
}

.ld-eyebrow {
    color: #ff5d63;
}

.ld-title-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.ld-title-row h1 {
    margin: 2px 0 0;
}

.ld-badge {
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb0b3;
    border: 1px solid rgba(255, 93, 99, 0.45);
    background: rgba(255, 93, 99, 0.1);
    border-radius: 999px;
    padding: 3px 9px;
}

.ld-header .lede a {
    color: #4fd1c5;
    white-space: nowrap;
}

.ld-loading {
    padding: 24px;
    color: var(--qb-muted);
}

/* Section 1's card top: a tall tab with the controls, a sloped edge and a lower shelf with the report month. The pieces use solid
   colours (the panel's 5% white fill and 10% white border over the page) so they meet without overlaps showing, and the tab overlaps
   the panel's top border by 1px so the two read as one card. A hairline under the controls and slope sets them off from the chart;
   the month shelf stays open to it. --ld-shelf is the shelf's height, where the slope ends. */
.ld-toolbar {
    --ld-fill: #252532;
    --ld-line: #31313d;
    --ld-shelf: 64px;
    --ld-divider: #3e3e4c;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    margin: 4px 0 -1px;
}

.ld-toolbar-main {
    flex: none;
    padding: 14px 18px 16px;
    background: var(--ld-fill);
    border: 1px solid var(--ld-line);
    border-right: 0;
    border-bottom-color: var(--ld-divider);
    border-radius: 10px 0 0 0;
}

.ld-toolbar-slope {
    position: relative;
    flex: none;
    width: 60px;
    background: var(--ld-line);
    clip-path: polygon(0 0, 100% calc(100% - var(--ld-shelf)), 100% 100%, 0 100%);
}

.ld-toolbar-slope::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--ld-fill);
    clip-path: polygon(0 1.5px, 100% calc(100% - var(--ld-shelf) + 1.5px), 100% calc(100% - 1px), 0 calc(100% - 1px));
}

.ld-toolbar-slope::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ld-divider);
}

/* The Q-Labs artwork stands on the month shelf, in the space above it; the shelf hides the artwork's glow below its edge. */
.ld-toolbar-logo {
    position: absolute;
    right: 26px;
    bottom: calc(var(--ld-shelf) - 6px);
    z-index: 0;
    line-height: 0;
}

.ld-toolbar-logo img {
    width: 140px;
    height: 140px;
}

.ld-toolbar-month {
    flex: 1;
    align-self: flex-end;
    height: var(--ld-shelf);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    z-index: 1;
    gap: 2px;
    padding: 0 22px;
    background: var(--ld-fill);
    border-top: 1px solid var(--ld-line);
    border-right: 1px solid var(--ld-line);
    border-radius: 0 10px 0 0;
    box-shadow: inset 0 2px 0 #4fd1c5;
}

.ld-controls {
    display: grid;
    gap: 10px;
}

.ld-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.ld-control-label {
    width: 72px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--qb-muted);
}

.ld-controls .chart-corner-toggle {
    gap: 3px;
    padding: 3px;
}

.ld-controls .chart-corner-toggle-button {
    padding: 8px 16px;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.ld-controls .chart-corner-toggle-button:not(.selected):hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.ld-controls .ld-switch {
    margin-left: 10px;
}

.ld-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--qb-muted);
    cursor: pointer;
    user-select: none;
}

.ld-switch input {
    appearance: none;
    width: 30px;
    height: 17px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    position: relative;
    cursor: pointer;
    margin: 0;
}

.ld-switch input::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #cfd5e3;
    transition: left 0.15s;
}

.ld-switch input:checked {
    background: #4fd1c5;
}

.ld-switch input:checked::after {
    left: 15px;
    background: #03121d;
}

.ld-month-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--qb-muted);
}

.ld-month-label i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4fd1c5;
    box-shadow: 0 0 8px rgba(79, 209, 197, 0.8);
}

.ld-toolbar-month b {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.ld-toolbar-month select {
    background: rgba(5, 11, 24, 0.62);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    padding: 4px 8px;
    font: inherit;
    font-size: 1rem;
    font-weight: 800;
}

.ld-view {
    padding: 18px 20px;
    margin-top: 10px;
}

.ld-view.ld-view-tabbed {
    margin-top: 0;
    margin-bottom: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Section 2 sits just under section 1, so the report-month tab reads as covering both. */
.ld-view.ld-view-joined {
    margin-top: 4px;
}

.ld-h-measure {
    color: #4fd1c5;
}

/* Section 1's headline: a strip across the panel's foot naming the firms with the hardest and easiest orders. */
.ld-ticker {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 18px -20px -18px;
    padding: 13px 20px;
    border-top: 1px solid var(--qb-border);
    border-radius: 0 0 var(--qb-card-radius) var(--qb-card-radius);
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 6px),
        linear-gradient(90deg, rgba(255, 138, 142, 0.1), rgba(255, 255, 255, 0.015) 50%, rgba(79, 209, 165, 0.1));
}

.ld-ticker-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 3px 10px 3px 8px;
    border: 1px solid rgba(79, 209, 197, 0.4);
    border-radius: 999px;
    color: #4fd1c5;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ld-ticker-tag i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #4fd1c5;
    animation: ld-ticker-ping 2s ease-in-out infinite;
}

@keyframes ld-ticker-ping {
    50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
    .ld-ticker-tag i {
        animation: none;
    }
}

.ld-ticker-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.ld-ticker-text b {
    font-weight: 800;
}

.ld-ticker-hard {
    color: #ff8a8e;
    text-shadow: 0 0 12px rgba(255, 138, 142, 0.35);
}

.ld-ticker-easy {
    color: #4fd1a5;
    text-shadow: 0 0 12px rgba(79, 209, 165, 0.35);
}

.ld-ticker-sep {
    margin: 0 8px;
    font-size: 0.6rem;
    vertical-align: 2px;
    color: rgba(255, 255, 255, 0.3);
}

.ld-view h2,
.ld-caveats h2 {
    font-size: 1.08rem;
    font-weight: 850;
    margin: 0 0 4px;
}

.ld-view-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.ld-sort {
    flex: none;
}

.ld-sub {
    color: var(--qb-muted);
    font-size: 0.84rem;
    margin: 0 0 12px;
    max-width: 900px;
}

/* A section's description wraps where the page's lede does: the lede's 760px less the panel's 1px border and 20px padding. An
   .ld-intro block holds the heading and description beside a side box (Lab 02). */
.ld-view > .ld-sub,
.ld-intro .ld-sub {
    max-width: 739px;
}

.ld-sub a {
    color: #4fd1c5;
}

.ld-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.78rem;
    color: var(--qb-muted);
    margin-top: 8px;
}

.ld-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ld-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.ld-legend i.ld-legend-minor {
    border: 1.5px solid #a9b0c0;
}

.ld-key {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 28px;
    margin: 10px 0 16px;
    padding: 12px 16px;
    border: 1px solid var(--qb-border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.82);
}

.ld-key > span {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.ld-key b {
    color: #fff;
    font-weight: 800;
}

.ld-key-raw {
    width: 15px;
    height: 15px;
    border: 2.5px solid #cfd5e3;
    border-radius: 50%;
    flex: none;
}

/* A filled dot on its 95% interval bar. */
.ld-key-adj {
    position: relative;
    width: 38px;
    height: 16px;
    flex: none;
}

.ld-key-adj::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 3px;
    background: rgba(207, 213, 227, 0.35);
}

.ld-key-adj > i {
    position: absolute;
    top: 0;
    left: 11px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #cfd5e3;
}

.ld-key-rank {
    font-style: normal;
    font-size: 0.8rem;
    letter-spacing: -0.05em;
    background: linear-gradient(90deg, #4fd1a5 50%, #ff8a8e 50%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.ld-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 12px;
    text-align: center;
}

.ld-foot .ld-foot-text {
    margin: 0;
}

.ld-link-button {
    background: none;
    border: 0;
    color: #4fd1c5;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    margin-top: 8px;
}

.ld-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.ld-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.ld-table th {
    text-align: right;
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--qb-muted);
    padding: 6px 8px;
    border-bottom: 1px solid var(--qb-border);
    white-space: nowrap;
}

.ld-table td {
    text-align: right;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.ld-table th:first-child,
.ld-table td:first-child {
    text-align: left;
}

.ld-table a {
    color: rgba(255, 255, 255, 0.88);
}

.ld-caveats {
    padding: 16px 20px;
    margin-top: 10px;
    border-left: 3px solid var(--qb-amber);
}

.ld-caveats ul {
    margin: 6px 0 10px;
    padding-left: 18px;
    font-size: 0.84rem;
    color: var(--qb-muted);
}

.ld-caveats li {
    margin: 4px 0;
}

.ld-caveats li a {
    color: rgba(255, 255, 255, 0.88);
}

/* Too narrow for the slope: the controls and the month stack into one header block on the card. */
@media (max-width: 1060px) {
    .ld-toolbar {
        flex-direction: column;
    }

    .ld-toolbar-main {
        border-right: 1px solid var(--ld-line);
        border-radius: 10px 10px 0 0;
    }

    .ld-toolbar-slope,
    .ld-toolbar-logo {
        display: none;
    }

    .ld-toolbar-month {
        align-self: stretch;
        height: auto;
        align-items: flex-start;
        padding: 0 18px 12px;
        border-top: 0;
        border-left: 1px solid var(--ld-line);
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 900px) {
    .ld-view {
        padding: 14px 12px;
    }

    .ld-view-head {
        flex-direction: column;
    }

    .ld-ticker {
        margin: 16px -12px -14px;
        padding: 12px;
    }

}

@media (max-width: 640px) {
    .ld-control {
        align-items: flex-start;
    }

    .ld-control-label {
        width: 100%;
    }

    .ld-controls .ld-switch {
        margin-left: 0;
    }

    .ld-control .chart-corner-toggle {
        flex-wrap: wrap;
        border-radius: 14px;
    }

    .ld-control .chart-corner-toggle-button {
        white-space: nowrap;
    }
}
