/*
 * The sat page (sat.js): /sat/<n> shows one pane, a header and cards: where
 * the sat is now, the marketplace, its sales and its ordinal details (a side
 * column on a wide screen, under the rest on a narrow one). Links to sats
 * everywhere else (.sat-link) are styled here too. Built on app.css's
 * tokens, light, dark and auto; the badges are badges.css's.
 */

/* The sat pane alone, whatever the width (as the address pane). */
.panes.is-sat {
    display: flex;
}

.panes.is-sat > .pane:not(.pane--sat),
.panes:not(.is-sat) > .pane--sat {
    display: none;
}

.pane--sat {
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* ------------------------------------------------------------- links */

a.sat-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--underline);
    text-underline-offset: 2px;
}

a.sat-link:hover {
    color: var(--series-1);
    text-decoration-color: currentColor;
}

/* A sat range's copy control beside its linked ends (the address page). */
.sat-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0 0 0 2px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--muted);
    vertical-align: -4px;
    cursor: pointer;
}

.sat-copy svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.sat-copy:hover {
    background: var(--hover);
    color: var(--ink);
}

.sat-copy.is-copied {
    color: var(--good);
}

.sat-copy.is-copy-failed {
    color: var(--critical);
}

/* ------------------------------------------------------------- header */

.sat-head {
    display: grid;
    gap: 6px;
    align-items: start;
    padding: 12px 20px 14px;
    border-bottom: 1px solid var(--grid);
}

.sat-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
}

.sat-nav > :last-child {
    justify-self: end;
}

.sat-step {
    color: var(--ink-2);
    text-decoration: none;
    white-space: nowrap;
}

.sat-step:hover {
    color: var(--series-1);
}

.sat-kicker {
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sat-title-line {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.pane--sat .sat-head h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.sat-lede {
    color: var(--ink-2);
    font-size: 13px;
}

.sat-lede .sep,
.sat-kvs .sep {
    margin: 0 6px;
    color: var(--muted);
}

.sat-name {
    color: var(--ink);
}

.sat-types {
    margin-top: 2px;
}

.sat-rows {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.sat-rows-label {
    color: var(--ink-2);
    font-size: 12px;
    margin-right: 2px;
}

.sat-row {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 2px 9px 2px 5px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--chip);
    color: var(--ink);
    font-size: 12.5px;
    text-decoration: none;
}

.sat-row:hover {
    border-color: var(--control-border);
    background: var(--hover);
}

/* --------------------------------------------------------------- body */

.sat-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    align-items: start;
    gap: 16px;
    padding: 16px 20px 24px;
}

.sat-main,
.sat-side {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.sat-side {
    position: sticky;
    top: 0;
}

.sat-card {
    min-width: 0;
    padding: 12px 14px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}

.sat-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.sat-card-head h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 650;
}

.sat-card-meta {
    color: var(--ink-2);
    font-size: 12px;
}

.sat-note {
    color: var(--ink-2);
    font-size: 13px;
}

.sat-note + .sat-note {
    margin-top: 8px;
}

.sat-note--error {
    color: var(--ink);
}

.sat-note--own {
    margin-top: 10px;
}

.sat-muted {
    color: var(--ink-2);
}

.sat-ext {
    white-space: nowrap;
}

/* Where it is now: a status, then label/value pairs. */
.sat-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 10px;
    margin-bottom: 12px;
}

.sat-status-text {
    color: var(--ink-2);
    font-size: 13px;
}

/* Where an unconfirmed transaction takes the sat (sat.js pendingLine). */
.sat-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: -4px 0 12px;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.sat-sales tr.is-pending td {
    background: color-mix(in srgb, var(--warning) 6%, var(--surface));
}

.sat-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.sat-pill--good {
    background: color-mix(in srgb, var(--good) 10%, var(--surface));
    border-color: color-mix(in srgb, var(--good) 40%, transparent);
}

.sat-pill--serious {
    background: color-mix(in srgb, var(--serious) 14%, var(--surface));
    border-color: color-mix(in srgb, var(--serious) 55%, transparent);
}

.sat-pill--critical {
    background: color-mix(in srgb, var(--critical) 12%, var(--surface));
    border-color: color-mix(in srgb, var(--critical) 50%, transparent);
}

.sat-pill--neutral {
    background: var(--chip);
}

.sat-kvs {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 7px 16px;
    margin: 0;
    font-size: 13px;
}

.sat-kv {
    display: contents;
}

.sat-kv dt {
    color: var(--ink-2);
}

.sat-kv dd {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.sat-kv dd .addr-copy-btn {
    width: 22px;
    height: 22px;
    vertical-align: -6px;
}

.sat-kv dd .addr-copy-btn svg {
    width: 13px;
    height: 13px;
}

.sat-flag {
    margin-left: 8px;
}

.sat-utxo {
    display: grid;
    gap: 6px;
}

.sat-ranges {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 2px;
    font-size: 12.5px;
}

.sat-here {
    color: var(--series-1);
    font-size: 11.5px;
    font-weight: 600;
}

.sat-tier {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
}

.sat-tier-supply {
    flex-basis: 100%;
    font-size: 12px;
}

.sat-groups {
    display: grid;
    justify-items: start;
    gap: 4px;
}

/* Marketplace: the listing's card, at a card's width. */
.sat-listing {
    max-width: 280px;
}

/* ----------------------------------------------------------- sales */

.sat-chart {
    margin: 0 0 10px;
    min-height: 150px;
}

.sat-chart-svg {
    display: block;
    overflow: visible;
}

.sat-chart-grid {
    stroke: var(--grid);
    stroke-width: 1;
}

.sat-chart-axis {
    stroke: var(--axis);
    stroke-width: 1;
}

.sat-chart-label {
    fill: var(--ink-2);
    font: 11px var(--font);
    font-variant-numeric: tabular-nums;
}

.sat-chart-line {
    fill: none;
    stroke: var(--series-1);
    stroke-width: 1.5;
    stroke-linejoin: round;
    opacity: 0.55;
}

.sat-chart-dot {
    fill: var(--series-1);
    stroke: var(--surface);
    stroke-width: 1.5;
}

.sat-chart-dot.is-outlier {
    fill: var(--surface);
    stroke: var(--series-1);
}

.sat-chart-dot.is-inscribed {
    fill: var(--series-2);
}

.sat-sales td {
    vertical-align: top;
}

.sat-sales tr.is-muted td {
    color: var(--ink-2);
}

.sat-unit {
    display: inline-grid;
    gap: 1px;
}

.sat-bundle {
    color: var(--ink-2);
    font-size: 11.5px;
}

/* "Alpha uncommon + Black omega": the sale's own row, then the rest it sold. */
.sat-sold-with {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.sat-sold-with .sale-with {
    margin-left: 0;
}

.sat-mark {
    margin-left: 4px;
    color: var(--ink-2);
}

.sat-parties,
.sale-parties {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 6px;
}

.sat-arrow,
.sale-parties .sale-arrow {
    color: var(--muted);
}

/* In a table row, seller and buyer stay on one line (the table scrolls). */
.data-table .sat-parties,
.data-table .sale-parties {
    flex-wrap: nowrap;
}

.sat-more {
    margin-top: 10px;
}

.sat-foot {
    margin-top: 10px;
    color: var(--ink-2);
    font-size: 11.5px;
}

/* ----------------------------------------------------- narrow screens */

@media (max-width: 1099.98px) {
    .sat-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .sat-side {
        position: static;
    }
}

@media (max-width: 719.98px) {
    .pane--sat .sat-head h2 {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
        white-space: normal;
        font-size: 21px;
    }

    .sat-head {
        padding: 10px 12px 12px;
    }

    .sat-body {
        gap: 12px;
        padding: 12px 10px 18px;
    }

    .sat-main,
    .sat-side {
        gap: 12px;
    }

    .sat-card {
        padding: 10px 12px 12px;
    }

    .sat-kvs {
        grid-template-columns: minmax(84px, max-content) minmax(0, 1fr);
        gap: 6px 12px;
        font-size: 12.5px;
    }

    .sat-listing {
        max-width: none;
    }

    /* The sales table as a stack of cards: each cell labelled. */
    .sat-sales-x {
        overflow: visible;
    }

    .sat-sales,
    .sat-sales tbody,
    .sat-sales tr,
    .sat-sales td {
        display: block;
        width: 100%;
    }

    .sat-sales thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
    }

    .sat-sales tr {
        padding: 8px 0;
        border-bottom: 1px solid var(--grid);
    }

    .sat-sales td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 8px;
        padding: 2px 0;
        border: 0;
        text-align: left;
        white-space: normal;
    }

    .sat-sales td::before {
        content: attr(data-label);
        color: var(--ink-2);
        font-size: 11.5px;
    }

    .sat-sales .sat-parties {
        flex-wrap: wrap;
    }
}

/* ------------------------------------------------- name-forward sats */

/* A sat known by its name (a bounty3 name, satlabel.js): the name, in a
   name's style; the number on hover, and on keyboard focus below it. */
a.sat-link--name {
    position: relative;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration-style: dotted;
}

a.sat-link--name::before {
    content: "“";
    color: var(--muted);
    font-weight: 400;
}

a.sat-link--name::after {
    content: "”";
    color: var(--muted);
    font-weight: 400;
}

a.sat-link--name:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    z-index: 5;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: var(--shadow);
    color: var(--ink);
    font: 12px var(--font);
    white-space: nowrap;
}

.sat-title--name .sat-headline-name {
    font-family: var(--mono);
    letter-spacing: 0;
}

.sat-subnumber {
    gap: 6px;
    color: var(--ink-2);
    font-size: 14px;
}

.sat-number-sub {
    color: var(--ink);
    font-size: 15px;
}

/* A listing card of a name leads with it. */
.lcard-name {
    font-size: 16px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A name-forward collection's Activity: its names sold, then the table. */
.names-sold {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px 24px;
    padding: 12px 16px 14px;
    border-bottom: 1px solid var(--grid);
}

.names-list h4 {
    margin: 0 0 6px;
    color: var(--ink-2);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.names-list ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.name-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--chip);
    font-size: 12.5px;
}

.coll-name {
    font-size: 13px;
}
