:root {
    --bg: #0a0e1a;
    --bg-alt: #141829;
    --panel: rgba(20, 24, 41, 0.75);
    --panel-border: rgba(255, 107, 53, 0.25);
    --text: #f5f5f5;
    --muted: #a0a0a0;
    --accent: #ff6b35;
    --warning: #ffa500;
    --danger: #ff4444;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: radial-gradient(circle at top left, #2a2a3e 0%, var(--bg) 48%, #0a0a0f 100%);
    font-family: "Space Grotesk", "Segoe UI", sans-serif;
    min-height: 100vh;
    position: relative;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: linear-gradient(rgba(255, 107, 53, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 107, 53, 0.06) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 100%);
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.5;
    z-index: 0;
    pointer-events: none;
}

.orb-a {
    width: 300px;
    height: 300px;
    background: #ff6b35;
    top: 7%;
    left: 4%;
}

.orb-b {
    width: 260px;
    height: 260px;
    background: #ff8c42;
    right: 7%;
    bottom: 10%;
}

.layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 28px 16px 48px;
    position: relative;
    z-index: 1;
}

.hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 14px;
    align-items: end;
    margin-bottom: 20px;
}

.kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent);
    font-size: 12px;
}

h1 {
    margin: 6px 0;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1;
}

.subtitle {
    margin: 0;
    color: var(--muted);
}

.hero-meta {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-card {
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(9, 45, 79, 0.84), var(--panel));
    padding: 10px 12px;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.stat-card span {
    color: var(--muted);
    font-size: 12px;
}

.stat-link {
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    padding: 0;
    margin: 0;
    width: auto;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    cursor: pointer;
}

.stat-link:hover {
    color: #ffd8c7;
}

.stat-card strong {
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.02em;
    word-break: break-word;
    overflow-wrap: break-word;
}

.panel {
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--panel);
    backdrop-filter: blur(5px);
}

.panel.split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.panel-head h2 {
    margin: 0;
    font-size: 20px;
}

.panel-head p {
    margin: 2px 0 10px;
    color: var(--muted);
    font-size: 13px;
}


.mobile-accordion summary {
    display: none;
}

.mobile-accordion .accordion-content {
    margin-top: 0;
}


.stats-accordion .stats-grid {
    margin-bottom: 0;
}

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

input,
button {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font: inherit;
    padding: 10px 11px;
}

input {
    flex: 1;
    min-width: 0;
}

button {
    cursor: pointer;
    background: linear-gradient(120deg, #ff6b35, #ff8c42);
    color: #fff;
    font-weight: 700;
    transition: opacity 0.2s;
}

button:hover {
    opacity: 0.9;
}

.muted {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 10px;
}

pre {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.28);
    overflow-x: auto;
}

code {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
    line-height: 1.45;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table-controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.table-toggle {
    width: auto;
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(141, 206, 255, 0.13);
    font-size: 13px;
    vertical-align: top;
}

td {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

th {
    color: #ff8c42;
    font-weight: 600;
}

.pill {
    border-radius: 99px;
    padding: 2px 9px;
    display: inline-block;
    font-size: 11px;
    text-transform: uppercase;
}

.pill.immature,
.pill.pending {
    background: rgba(249, 202, 104, 0.25);
    color: var(--warning);
}

.pill.confirmed,
.pill.paid,
.pill.success {
    background: rgba(120, 230, 200, 0.2);
    color: var(--accent);
}

.pill.orphan,
.pill.failed,
.pill.rejected {
    background: rgba(255, 127, 136, 0.2);
    color: var(--danger);
}

.empty {
    color: var(--muted);
}

.txid-link {
    color: var(--accent);
    text-decoration: none;
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
}
.txid-link:hover {
    text-decoration: underline;
}

.debug-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.mono {
    font-family: "Courier New", Courier, monospace;
    word-break: break-all;
}

.hash-cell {
    font-family: "Courier New", Courier, monospace;
    font-size: 12px;
}

.hash-prefix {
    color: #ffa500;
}

.hash-middle {
    color: var(--muted);
}

.hash-suffix {
    color: #8de0ff;
}

.hash-link {
    color: var(--text);
    text-decoration: none;
}

.hash-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.hash-link .hash-prefix,
.hash-link .hash-middle,
.hash-link .hash-suffix {
    display: inline;
}

.debug-note {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 14px;
}

.debug-refresh {
    color: var(--muted);
    font-size: 13px;
}

@media (min-width: 920px) {
    .panel.split {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 850px) {
    .layout {
        padding: 20px 12px 36px;
    }

    .hero {
        align-items: flex-start;
    }

    .hero-meta {
        width: 100%;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    }
}

@media (max-width: 720px) {
    .layout {
        padding: 14px 10px 24px;
    }

    .hero {
        margin-bottom: 12px;
    }

    .search-row {
        flex-direction: column;
    }

    button {
        width: 100%;
    }

    .stats-grid,
    .stats-grid.compact {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }

    .stat-card {
        padding: 8px 9px;
    }

    .stat-card strong {
        font-size: 17px;
    }

    .panel {
        margin-bottom: 10px;
        padding: 9px;
    }

    .mobile-accordion {
        padding: 0;
        overflow: hidden;
    }

    .mobile-accordion summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        cursor: pointer;
        list-style: none;
        padding: 10px 12px;
        font-weight: 700;
        color: var(--accent);
        border-bottom: 1px solid rgba(255, 107, 53, 0.2);
        background: rgba(0, 0, 0, 0.14);
    }

    .mobile-accordion summary::marker,
    .mobile-accordion summary::-webkit-details-marker {
        display: none;
    }

    .mobile-accordion summary::after {
        content: "+";
        font-size: 18px;
        line-height: 1;
    }

    .mobile-accordion[open] summary::after {
        content: "-";
    }

    .mobile-accordion .accordion-content {
        padding: 9px;
    }

    .mobile-accordion .panel-head {
        display: none;
    }

    .stats-accordion .accordion-content {
        padding: 7px;
    }

    .stats-accordion .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .stats-accordion .stat-card {
        padding: 6px 7px;
        border-radius: 10px;
    }

    .stats-accordion .stat-card span {
        font-size: 10px;
    }

    .stats-accordion .stat-card strong {
        font-size: 13px;
    }
}

@media (max-width: 620px) {
    h1 {
        font-size: clamp(24px, 8vw, 32px);
    }

    .subtitle {
        font-size: 13px;
    }

    .stats-grid,
    .stats-grid.compact {
        grid-template-columns: 1fr;
    }

    .stats-accordion .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel {
        padding: 8px;
    }

    .table-wrap {
        overflow: visible;
    }

    table {
        min-width: 0;
        width: 100%;
    }

    thead {
        display: none;
    }

    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    tr {
        border: 1px solid rgba(255, 107, 53, 0.2);
        border-radius: 12px;
        margin-bottom: 10px;
        padding: 6px 8px;
        background: rgba(40, 30, 20, 0.4);
    }

    td {
        border: 0;
        border-bottom: 1px dashed rgba(255, 107, 53, 0.15);
        padding: 7px 0;
        display: grid;
        grid-template-columns: minmax(90px, 35%) 1fr;
        gap: 8px;
        align-items: center;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    td:last-child {
        border-bottom: 0;
    }

    td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .empty {
        display: block;
        border: 0;
        padding: 8px 0;
    }

    .empty::before {
        content: none;
    }
}

.footer {
    text-align: center;
    padding: 20px 0;
    color: var(--muted);
    font-size: 14px;
}
.footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.link {
    color: var(--accent);
}

.link:hover {
    text-decoration: underline;
    color: #ff8c42;
}

.inline-code {
    font-family: "Courier New", Courier, monospace;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 12px;
}

.setup-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.setup-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--panel-border);
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    background: linear-gradient(120deg, #ff6b35, #ff8c42);
    transition: opacity 0.2s;
}

.setup-link:hover {
    opacity: 0.9;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 20, 0.72);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 14px;
    z-index: 50;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(460px, 100%);
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: linear-gradient(170deg, rgba(15, 22, 36, 0.98), rgba(23, 18, 13, 0.96));
    padding: 14px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.modal-head h3 {
    margin: 0;
    font-size: 20px;
}

.modal-copy {
    margin-top: 6px;
}

.modal-card label {
    display: block;
    margin: 8px 0 6px;
    font-size: 13px;
    color: var(--muted);
}

#hashrateInput::-webkit-outer-spin-button,
#hashrateInput::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#hashrateInput[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.reward-estimate {
    margin: 8px 0 0;
    font-size: 14px;
    font-weight: 600;
}

.ghost-btn {
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    padding: 8px 10px;
}

@media (max-width: 620px) {
    .modal-card {
        padding: 12px;
    }

    .modal-head h3 {
        font-size: 17px;
    }
}
