/* Page-scoped scan boards. Linked with ?v= from owned pages only.
   Pipes, timelines, meters. No invented totals. */

.cu-scan-page {
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

.cu-scan-page .cu-diagram,
.cu-scan-page .cu-civic-diagram,
.cu-scan-page img {
    max-width: 100%;
}

.cu-scan-pipe {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.2rem;
    margin: 0.75rem 0 1rem;
    padding: 0;
    max-width: 100%;
    min-width: 0;
}

.cu-scan-pipe__step {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0.35rem 0.8rem 0.35rem 0.4rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.4);
    background: rgba(13, 148, 136, 0.14);
    color: #f5f0e6;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.cu-scan-pipe__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #0f766e;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 750;
}

.cu-scan-pipe__join {
    width: 1.15rem;
    height: 2px;
    flex: 0 0 auto;
    background: repeating-linear-gradient(90deg, #5eead4 0 4px, transparent 4px 7px);
}

.cu-scan-pipe--stack {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-top: 0.35rem;
    margin-bottom: 0.75rem;
}

.cu-scan-pipe--stack .cu-scan-pipe__step {
    border-radius: 0.7rem;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
}

.cu-scan-pipe--stack .cu-scan-pipe__join {
    width: 2px;
    height: 0.7rem;
    margin-left: 1.15rem;
    background: repeating-linear-gradient(#5eead4 0 4px, transparent 4px 7px);
}

.cu-scan-kicker {
    display: block;
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: none;
    color: #f3efe4;
}

.cu-markets-page .cu-scan-kicker {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: none;
    line-height: 1.35;
    color: #f5f0e6;
}

.cu-markets-page .cu-official-card__office {
    color: #f5f0e6;
}

.cu-shell[data-theme="light"] .cu-markets-page .cu-scan-kicker,
.cu-shell[data-theme="light"] .cu-markets-page .cu-official-card__office {
    color: #1a1a1a;
}

.cu-scan-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 15.5rem), 1fr));
    gap: 0.75rem;
    margin: 0 0 1rem;
    min-width: 0;
}

.cu-scan-cell {
    min-width: 0;
    padding: 0.85rem 0.95rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(94, 234, 212, 0.28);
    border-left: 4px solid #0d9488;
    background: #161616;
    color: #f5f0e6;
}

.cu-scan-figure {
    margin: 0.2rem 0 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.35rem, 4vw, 1.85rem);
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.cu-scan-cell p,
.cu-scan-cell .cu-empty {
    overflow-wrap: anywhere;
}

.cu-scan-meter {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    height: 0.7rem;
    margin: 0.55rem 0 0.35rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(245, 240, 230, 0.12);
}

.cu-scan-meter__fill {
    display: block;
    height: 100%;
    min-width: 0;
    background: linear-gradient(90deg, #0f766e, #5eead4);
}

.cu-scan-meter__fill--maj {
    background: #0d9488;
}

.cu-scan-meter__fill--min {
    background: #d97706;
}

.cu-scan-price {
    margin: 0.15rem 0 0;
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.6rem, 5vw, 2.15rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.cu-scan-frame__bars {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin: 0 0 0.55rem;
}

.cu-scan-frame__bars i {
    display: block;
    height: 0.42rem;
    border-radius: 999px;
    background: rgba(13, 148, 136, 0.28);
}

.cu-scan-frame__bars i:nth-child(1) { width: 92%; background: #0d9488; }
.cu-scan-frame__bars i:nth-child(2) { width: 68%; }
.cu-scan-frame__bars i:nth-child(3) { width: 40%; background: rgba(217, 119, 6, 0.75); }

.cu-ground-cards {
    grid-template-columns: 1fr;
}

@media (min-width: 720px) {
    .cu-ground-cards {
        grid-template-columns: 1fr 1fr;
    }
}

.cu-ground-card {
    border-left: 4px solid #0d9488;
    min-width: 0;
}

.cu-scan-rail {
    position: relative;
    display: grid;
    gap: 0.75rem;
    margin: 0.35rem 0 1rem;
    padding-left: 1.25rem;
    min-width: 0;
}

.cu-scan-rail:not(.cu-rail)::before {
    content: "";
    position: absolute;
    left: 0.28rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 2px;
    background: rgba(13, 148, 136, 0.65);
}

.cu-trust .cu-trust__card {
    position: relative;
    margin-left: 1.15rem;
    max-width: calc(100% - 1.15rem);
}

.cu-trust .cu-trust__card::before {
    content: "";
    position: absolute;
    left: -0.95rem;
    top: 0;
    bottom: -0.85rem;
    width: 2px;
    background: rgba(13, 148, 136, 0.65);
}

.cu-trust .cu-trust__card::after {
    content: "";
    position: absolute;
    left: -1.02rem;
    top: 1.2rem;
    width: 0.62rem;
    height: 0.62rem;
    border-radius: 50%;
    background: #5eead4;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.35);
}

.cu-rail.cu-scan-rail {
    padding-left: 0.15rem;
}

.cu-rail.cu-scan-rail .cu-scan-outcome {
    min-width: 0;
    border-left: 4px solid #0d9488;
    background: #1c1c1c;
    color: #f5f0e6;
}

.cu-shell[data-theme="light"] .cu-scan-outcome,
html[data-theme="light"] .cu-scan-outcome {
    background: #fffdf8;
    color: #1c1917;
    border-color: rgba(15, 118, 110, 0.4);
}

.cu-shell[data-theme="light"] .cu-scan-outcome .cu-official-card__office,
.cu-shell[data-theme="light"] .cu-scan-outcome .cu-pill,
.cu-shell[data-theme="light"] .cu-scan-outcome .cu-empty,
.cu-shell[data-theme="light"] .cu-scan-outcome .cu-card-title,
html[data-theme="light"] .cu-scan-outcome .cu-official-card__office,
html[data-theme="light"] .cu-scan-outcome .cu-pill,
html[data-theme="light"] .cu-scan-outcome .cu-empty,
html[data-theme="light"] .cu-scan-outcome .cu-card-title {
    color: #1c1917;
}

.cu-shell[data-theme="dark"] .cu-scan-outcome .cu-official-card__office,
.cu-shell[data-theme="dark"] .cu-scan-outcome .cu-pill,
.cu-shell[data-theme="dark"] .cu-scan-outcome .cu-empty,
.cu-shell[data-theme="dark"] .cu-scan-outcome .cu-card-title,
html[data-theme="dark"] .cu-scan-outcome .cu-official-card__office,
html[data-theme="dark"] .cu-scan-outcome .cu-pill,
html[data-theme="dark"] .cu-scan-outcome .cu-empty,
html[data-theme="dark"] .cu-scan-outcome .cu-card-title {
    color: #f5f0e6;
}

.cu-scan-empty {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    margin: 0.35rem 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px dashed rgba(94, 234, 212, 0.45);
    background: transparent;
    max-width: 100%;
}

.cu-scan-empty__node {
    width: 0.7rem;
    height: 0.7rem;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid #5eead4;
    background: transparent;
}

.cu-scan-empty .cu-empty {
    margin: 0;
}

.cu-network-rank-list.cu-scan-ladder {
    margin-left: 0.15rem;
    padding-left: 0.85rem;
    border-left: 2px solid rgba(13, 148, 136, 0.55);
}

.cu-scan-ladder .cu-network-rank__btn {
    min-height: 44px;
}

.cu-scan-ladder .cu-network-rank__order {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    border: 2px solid #0d9488;
    background: rgba(13, 148, 136, 0.16);
}

.cu-scan-piperow {
    display: grid;
    grid-template-columns: 0.55rem minmax(0, 1fr);
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgba(94, 234, 212, 0.28);
    background: #161616;
    color: #f5f0e6;
}

.cu-scan-piperow__lane {
    background: linear-gradient(180deg, #0f766e, #5eead4);
}

.cu-scan-piperow__body {
    min-width: 0;
    padding: 0.8rem 0.9rem 0.95rem;
}

.cu-scan-piperow .cu-empty,
.cu-scan-piperow p {
    overflow-wrap: anywhere;
}

.cu-pipe-tree__link,
.cu-pipe-minimap__chip,
.cu-gloss-index .cu-gloss-chip {
    min-height: 44px;
    box-sizing: border-box;
}

.cu-gloss-grid.cu-scan-gloss {
    grid-template-columns: 1fr;
}

.cu-gloss-grid.cu-scan-gloss > .cu-gloss-entry {
    min-height: 0;
    height: auto;
    position: relative;
    padding-left: 1.15rem;
    border-left: 4px solid #0d9488;
}

.cu-scan-page .cu-home__path-step {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(94, 234, 212, 0.45);
    background: rgba(13, 148, 136, 0.12);
}

.cu-scan-page .cu-home__path {
    gap: 0.45rem 0.4rem;
}

.cu-shell[data-theme="light"] .cu-scan-pipe__step,
.cu-shell[data-theme="light"] .cu-scan-cell,
.cu-shell[data-theme="light"] .cu-scan-piperow {
    background: #fffdf8;
    color: #1a1a1a;
    border-color: rgba(15, 118, 110, 0.4);
}

.cu-shell[data-theme="light"] .cu-scan-kicker {
    color: #0f766e;
}

.cu-shell[data-theme="light"] .cu-scan-meter {
    background: rgba(18, 18, 18, 0.08);
}

.cu-shell[data-theme="light"] .cu-gloss-grid.cu-scan-gloss > .cu-gloss-entry,
.cu-shell[data-theme="light"] .cu-ground-card {
    background: #fffdf8;
    color: #1a1a1a;
}

@media (max-width: 420px) {
    .cu-scan-pipe:not(.cu-scan-pipe--stack) {
        flex-direction: column;
        align-items: stretch;
    }

    .cu-scan-pipe:not(.cu-scan-pipe--stack) .cu-scan-pipe__join {
        width: 2px;
        height: 0.65rem;
        margin-left: 1.15rem;
        background: repeating-linear-gradient(#5eead4 0 4px, transparent 4px 7px);
    }

    .cu-scan-board {
        grid-template-columns: 1fr;
    }

    .cu-scan-ladder .cu-network-rank__btn {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .cu-scan-ladder .cu-network-rank__meta {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}
