/* Salvium Pool - Matching Explorer Theme */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #151525;
    --bg-hover: #1f1f35;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(26, 26, 46, 0.95);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    z-index: 101;
}

.logo img {
    height: 32px;
    width: 32px;
}

.logo-text {
    font-family: 'JetBrains Mono', monospace;
}

/* Hamburger menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 101;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 5px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    list-style: none;
}

.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav a:hover,
.nav a.active {
    color: var(--accent-primary);
}

.price-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', monospace;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Search Bar */
.search-container {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
    font-family: 'JetBrains Mono', monospace;
}

.search-input::placeholder {
    color: var(--text-muted);
    font-family: 'Inter', sans-serif;
}

.search-input:hover,
.search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), var(--shadow-md);
    background: var(--bg-hover);
}

.search-button {
    padding: 1rem 1.5rem;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
}

.search-button:hover {
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.search-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.stats-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.stats-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stat-card.clickable:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    cursor: pointer;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value.accent {
    color: var(--accent-primary);
}

.stat-value.success {
    color: var(--accent-success);
}

.stat-value.warning {
    color: var(--accent-warning);
}

.stat-value-small {
    font-size: 1.25rem;
}

.stat-subtext {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Section */
.section {
    margin-bottom: 2rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.section-link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.section-link:hover {
    text-decoration: underline;
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Three Column Layout */
.three-column {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Chart Container */
.chart-container {
    height: 200px;
    margin-top: 1rem;
}

/* Data Tables */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 0.95rem;
}

.table tbody tr {
    transition: background 0.2s;
}

.table tbody tr:hover {
    background: var(--bg-hover);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.link {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.link:hover {
    text-decoration: underline;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.badge.warning {
    background: rgba(245, 158, 11, 0.2);
    color: var(--accent-warning);
}

.badge.danger {
    background: rgba(239, 68, 68, 0.2);
    color: var(--accent-danger);
}

.badge.info {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

/* Workers Grid */
.workers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.worker-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.worker-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.worker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.worker-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.worker-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: var(--accent-success);
    box-shadow: 0 0 8px var(--accent-success);
}

.status-dot.offline {
    background: var(--accent-danger);
}

.worker-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.worker-stat {
    display: flex;
    flex-direction: column;
}

.worker-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.worker-stat-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* Blocks Grid */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.block-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.block-card:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.block-height {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 0.5rem;
}

.block-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.block-info span {
    color: var(--text-muted);
}

/* Ports Section */
.ports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.port-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.2s;
}

.port-card:hover {
    border-color: var(--accent-primary);
}

.port-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.port-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.port-difficulty {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.port-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.port-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.port-stat-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* Loading State */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-large {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Alert Messages */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert.info {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--accent-primary);
    color: var(--accent-primary);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
}

/* Miner Page Header */
.miner-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.miner-address {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    word-break: break-all;
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 300px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-top: 1rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination span {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--accent-primary);
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Connection Info */
.connection-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.connection-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.connection-code {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: var(--accent-success);
    overflow-x: auto;
    white-space: pre;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .blocks-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .three-column {
        grid-template-columns: repeat(2, 1fr);
    }

    .blocks-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .header-content {
        padding: 0 1rem;
    }

    .logo {
        font-size: 1rem;
        gap: 0.5rem;
    }

    .logo img {
        height: 24px;
        width: 24px;
    }

    .logo-text {
        font-size: 0.85rem;
    }

    .menu-toggle {
        display: block;
    }

    .header-content > nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--bg-secondary);
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: hidden;
    }

    .header-content > nav.active {
        transform: translateX(0);
    }

    .nav {
        width: 100%;
        height: 100%;
        flex-direction: column;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 4rem 1.5rem 1.5rem 1.5rem;
        gap: 0;
        overflow-y: auto;
    }

    .nav li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    .nav li:last-child {
        border-bottom: none;
    }

    .nav a {
        display: block;
        padding: 1rem 0;
        font-size: 1rem;
        width: 100%;
    }

    .container {
        padding: 1rem;
    }

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

    .stats-grid-3,
    .stats-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .two-column,
    .three-column {
        grid-template-columns: 1fr;
    }

    .blocks-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .search-input {
        width: 100%;
    }

    .search-button {
        width: 100%;
    }

    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .workers-grid {
        grid-template-columns: 1fr;
    }

    .miner-header {
        flex-direction: column;
        align-items: stretch;
    }

    .miner-address {
        min-width: 0;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .stats-grid-3,
    .stats-grid-4 {
        grid-template-columns: 1fr;
    }

    .blocks-grid {
        grid-template-columns: 1fr;
    }

    .tabs {
        overflow-x: auto;
    }

    .tab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }
}

/* Mining Status Grid */
.mining-status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mining-status-card .stat-value {
    font-size: 2rem;
}

/* Profit Grid */
.profit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Profit Cards */
.profit-card {
    position: relative;
    transition: all 0.3s;
}

.profit-card.most-profitable {
    border-color: var(--accent-success);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.profit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.profit-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.profit-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.profit-details span:first-child {
    color: var(--text-muted);
}

.profit-indicator {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.profit-indicator.active {
    background: var(--accent-success);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Coin Badges */
.coin-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

.coin-badge.sal {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
}

.coin-badge.xmr {
    background: linear-gradient(135deg, #f97316, #fb923c);
    color: white;
}

.coin-badge.qrl {
    background: linear-gradient(135deg, #0066cc, #00aaff);
    color: white;
}

.coin-badge.tari {
    background: linear-gradient(135deg, #9333ea, #c084fc);
    color: white;
}

.coin-badge.zeph {
    background: linear-gradient(135deg, #0ea5e9, #38bdf8);
    color: white;
}

/* Earnings Summary Grid */
.earnings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.earning-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
}
.earning-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.earning-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}
.earning-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}
.earning-pending {
    font-size: 0.75rem;
    color: var(--warning, #f59e0b);
    font-family: 'JetBrains Mono', monospace;
}

/* Shares Grid */
.shares-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.shares-card {
    padding: 1.25rem;
}

.shares-header {
    margin-bottom: 1rem;
}

.shares-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* Conversion Grid */
.conversion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Connection Note */
.connection-note {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Smaller labels */
.stat-label-small {
    font-size: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Responsive adjustments for new grids */
@media (max-width: 1200px) {
    .mining-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profit-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .conversion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .mining-status-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .profit-grid {
        grid-template-columns: 1fr;
    }

    .shares-grid {
        grid-template-columns: 1fr;
    }

    .conversion-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .mining-status-grid {
        grid-template-columns: 1fr;
    }

    .conversion-grid {
        grid-template-columns: 1fr;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--accent-success); }
.text-warning { color: var(--accent-warning); }
.text-danger { color: var(--accent-danger); }
.text-accent { color: var(--accent-primary); }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.hidden { display: none !important; }

/* ================================================
   COMPACT DASHBOARD STYLES
   ================================================ */

.compact-dashboard {
    padding: 1rem 2rem;
}

/* Compact Hero */
.hero-compact {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

.hero-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.hero-left {
    flex-shrink: 0;
}

.search-shell-compact {
    flex: 1;
    max-width: 500px;
}

.hero-title-compact {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle-compact {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.search-wrapper-compact {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.search-input-compact {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    outline: none;
    font-family: 'JetBrains Mono', monospace;
}

.search-input-compact:focus {
    border-color: var(--accent-primary);
}

.search-button-compact {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
}

.search-button-compact:hover {
    background: var(--accent-secondary);
}

.search-history-compact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
    min-height: 1.6rem;
}

.search-history-label {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.search-history-chip {
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(147, 51, 234, 0.28);
    border-radius: 999px;
    background: rgba(147, 51, 234, 0.1);
    color: var(--accent-primary);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.search-history-chip:hover {
    background: rgba(147, 51, 234, 0.16);
    border-color: rgba(147, 51, 234, 0.42);
    color: var(--accent-secondary);
}

/* Status Banner */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.status-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.status-divider {
    width: 1px;
    height: 30px;
    background: var(--border-color);
}

.update-time {
    margin-left: auto;
    font-size: 0.75rem;
}

/* P2Pool Grid */
.p2pool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.p2pool-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: border-color 0.4s ease, box-shadow 0.4s ease, background 0.2s ease;
    will-change: transform;
}

.p2pool-card.active {
    border-color: var(--accent-success);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.p2pool-card.featured {
    grid-column: 1 / -1;
    animation: cardPromote 0.5s ease-out;
}

@keyframes cardPromote {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

.p2pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 0.5rem;
}

.p2pool-tag {
    font-size: 0.6rem;
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.15);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: auto;
}

.p2pool-indicator {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.p2pool-indicator.active {
    background: var(--accent-success);
    color: white;
    animation: pulse 2s infinite;
}

.p2pool-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.p2pool-stats.six-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem 0.5rem;
}

.p2pool-stat {
    display: flex;
    flex-direction: column;
}

.p2pool-stat.highlight {
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    padding: 0.35rem;
    margin: -0.35rem;
}

.p2pool-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.six-stats .p2pool-label {
    font-size: 0.55rem;
}

.p2pool-value {
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.six-stats .p2pool-value {
    font-size: 0.8rem;
}

/* Compact Section */
.section-compact {
    margin-bottom: 1rem;
}

.section-header-compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-title-compact {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Side by Side Tables */
.tables-row {
    display: flex;
    gap: 1rem;
}

.table-half {
    flex: 1;
    min-width: 0;
}

/* Blocks Table */
.blocks-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.blocks-table {
    width: 100%;
    border-collapse: collapse;
}

.blocks-table.compact-table th,
.blocks-table.compact-table td {
    padding: 0.75rem 0.5rem !important;
    font-size: 0.75rem;
    line-height: 1.4;
    vertical-align: middle;
}

.tx-hash {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.tx-hash:hover {
    text-decoration: underline;
}

.blocks-table thead {
    background: var(--bg-secondary);
}

.blocks-table th {
    padding: 0.6rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blocks-table td {
    padding: 0.6rem 0.75rem;
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
}

.blocks-table.compact-table tbody tr {
    height: 2.5rem;
}

.blocks-table tbody tr:hover {
    background: var(--bg-hover);
}

/* Connection Compact */
.connection-compact {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-sm);
}

.connection-left,
.connection-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.guided-setup {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.4fr);
}

.connection-quickstart,
.guided-builder {
    min-width: 0;
}

.connection-quickstart {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-right: 1rem;
    border-right: 1px solid var(--border-color);
}

.connection-line {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.connection-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.connection-url,
.connection-example {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent-success);
    background: var(--bg-primary);
    padding: 0.35rem 0.6rem;
    border-radius: 4px;
}

.connection-note {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.port-chart-card {
    margin-top: 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.01)),
        var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.port-chart-grid {
    display: grid;
    grid-template-columns: 78px 92px 108px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
}

.port-chart-head {
    padding: 0.78rem 1rem;
    background: rgba(99, 102, 241, 0.08);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.port-chart-body {
    padding: 0.35rem;
}

.port-chart-row {
    padding: 0.78rem 0.65rem;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.port-chart-row + .port-chart-row {
    margin-top: 0.2rem;
}

.port-chart-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.port-chart-row.is-featured {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.05));
    border: 1px solid rgba(99, 102, 241, 0.28);
}

.port-chart-port,
.port-chart-diff {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-weight: 700;
}

.port-chart-tls,
.port-chart-use {
    color: var(--text-primary);
}

.port-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.18);
    border: 1px solid rgba(99, 102, 241, 0.35);
    margin-left: 0.45rem;
}

.port-summary {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.inline-code-strong {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    font-weight: 700;
}

.guided-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: space-between;
    height: 100%;
}

.guided-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.guided-controls {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    justify-content: flex-start;
}

.guided-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 600;
    user-select: none;
}

.guided-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.guided-switch-track {
    position: relative;
    width: 2.7rem;
    height: 1.5rem;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.3);
    transition: background 0.2s, border-color 0.2s;
}

.guided-switch-track::after {
    content: '';
    position: absolute;
    top: 0.14rem;
    left: 0.16rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.guided-switch input:checked + .guided-switch-track {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.55);
}

.guided-switch input:checked + .guided-switch-track::after {
    transform: translateX(1.15rem);
}

.guided-switch input:focus-visible + .guided-switch-track {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.guided-switch-label {
    color: var(--text-primary);
}

.guided-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.guided-label {
    color: var(--text-muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.guided-input {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.guided-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
    background: var(--bg-hover);
}

.guided-output {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    flex: 1;
}

.guided-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.guided-command {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-success);
    line-height: 1.7;
    font-size: 0.92rem;
}

.copy-command-button {
    border: 1px solid rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.14);
    color: var(--text-primary);
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.copy-command-button:hover {
    background: rgba(99, 102, 241, 0.24);
    border-color: rgba(99, 102, 241, 0.55);
}

.copy-command-button:active {
    transform: translateY(1px);
}

.guided-hint {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.guided-hint.warning {
    color: var(--accent-warning);
}

/* Footer Compact */
.footer-compact {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    text-align: center;
}

.footer-compact p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.footer-compact a {
    color: var(--accent-primary);
    text-decoration: none;
}

/* Responsive for compact dashboard */
@media (max-width: 1200px) {
    .p2pool-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .hero-row {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .search-wrapper-compact {
        max-width: 100%;
    }

    .status-banner {
        justify-content: center;
        gap: 1rem;
    }

    .status-divider {
        display: none;
    }

    .update-time {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .p2pool-grid {
        grid-template-columns: 1fr;
    }

    .p2pool-card.featured {
        grid-column: auto;
    }

    .connection-compact {
        flex-direction: column;
        gap: 0.75rem;
    }

    .guided-setup {
        grid-template-columns: 1fr;
    }

    .connection-quickstart {
        padding-right: 0;
        padding-bottom: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .connection-left,
    .connection-right {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .guided-grid {
        grid-template-columns: 1fr;
    }

    .connection-url,
    .connection-example {
        width: 100%;
        word-break: break-all;
    }

    .port-chart-grid {
        grid-template-columns: 72px 82px 96px minmax(0, 1fr);
        gap: 0.7rem;
    }

    .port-header {
        align-items: flex-start;
    }

    .port-badge {
        margin-top: 0.1rem;
    }
}

@media (max-width: 600px) {
    .port-chart-head {
        display: none;
    }

    .port-chart-grid {
        grid-template-columns: 72px 1fr;
        gap: 0.45rem 0.75rem;
    }

    .port-chart-row {
        padding: 0.8rem;
    }

    .port-chart-diff::before {
        content: 'Diff ';
        color: var(--text-muted);
        font-family: inherit;
    }

    .port-chart-tls::before {
        content: 'TLS ';
        color: var(--text-muted);
    }

    .port-chart-use::before {
        content: 'Use ';
        color: var(--text-muted);
    }

    .guided-controls {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 600px) {
    .compact-dashboard {
        padding: 0.75rem 1rem;
    }

    .hero-title-compact {
        font-size: 1.25rem;
    }

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

    .guided-output-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .copy-command-button {
        width: 100%;
    }

    .p2pool-stats.six-stats {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .blocks-table th,
    .blocks-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }
}

/* =============================================
   MINER DASHBOARD v2
   ============================================= */

.miner-dashboard {
    padding: 1.5rem;
    max-width: 1200px;
}

/* Header Row */
.miner-header-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.back-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.back-link:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
    background: var(--bg-hover);
}

.miner-address-box {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.miner-address-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.miner-address-value {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.copy-btn:hover {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}

.copy-btn.copied {
    color: var(--accent-success);
}

.miner-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid;
}

.miner-status-badge.online {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--accent-success);
}

.miner-status-badge.idle {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-warning);
}

.miner-status-badge.offline {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--accent-danger);
}

.status-dot.idle {
    background: var(--accent-warning);
}

/* Miner Meta Section */
.miner-meta-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.miner-meta-section.single-card {
    grid-template-columns: 1fr;
}

.miner-status-banner {
    margin-bottom: 1rem;
}

.miner-top-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.miner-top-row .miner-live-cards {
    margin-bottom: 0;
    height: 100%;
}

.miner-top-row .p2pool-card {
    height: 100%;
}

.miner-top-row .meta-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.miner-live-cards {
    grid-template-columns: 1fr;
}

.miner-live-cards .p2pool-card {
    display: none;
}

.miner-live-cards .p2pool-card.winner-visible {
    display: block;
}

.miner-live-cards .p2pool-card.winner-hidden {
    display: none;
}

.meta-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
}

.meta-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.meta-status {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.meta-status.fresh-ok {
    color: var(--accent-success);
}

.meta-status.fresh-warn {
    color: var(--accent-warning);
}

.meta-status.fresh-stale {
    color: var(--accent-danger);
}

.meta-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.meta-label {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.meta-value {
    display: block;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
    margin-top: 0.2rem;
}

.meta-value-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meta-inline-action {
    appearance: none;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border-radius: 999px;
    padding: 0.24rem 0.62rem;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.22);
}

.meta-inline-action:hover {
    filter: brightness(1.06);
}

.meta-inline-action:disabled {
    cursor: wait;
    opacity: 0.6;
}

.meta-value-secondary {
    margin-top: 0.35rem;
}

.meta-note {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.meta-progress {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    overflow: hidden;
}

.meta-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #22c55e);
    transition: width 0.2s ease;
}

.settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 1200;
}

.settings-modal {
    width: min(100%, 420px);
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
    padding: 1.1rem;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.settings-modal-header h3 {
    margin: 0;
    font-size: 1rem;
}

.settings-modal-close {
    appearance: none;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.settings-modal-copy {
    margin: 0 0 1rem 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.settings-modal-body {
    display: grid;
    gap: 0.85rem;
}

.settings-field {
    display: grid;
    gap: 0.35rem;
}

.settings-field-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.settings-field-input {
    width: 100%;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 0.7rem 0.8rem;
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
}

.settings-field-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.16);
}

.settings-error {
    font-size: 0.78rem;
    color: var(--accent-danger);
}

.settings-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.6rem;
    margin-top: 1rem;
}

.settings-secondary-btn,
.settings-primary-btn {
    appearance: none;
    border-radius: 12px;
    padding: 0.65rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-secondary-btn {
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
}

.settings-primary-btn {
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.22);
}

.settings-primary-btn:disabled,
.settings-secondary-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Primary Stats Row */
.miner-primary-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.primary-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.primary-stat:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.primary-stat-icon {
    display: none;
}

.primary-stat-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.primary-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    order: -1;
}

.primary-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.primary-stat-sub {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    min-width: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.sub-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.sub-value {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    display: inline-block;
    min-width: 0;
    white-space: nowrap;
}

.sub-value.muted {
    color: var(--text-muted);
    font-size: 0.7rem;
}

#estDailyUsd,
#estEdgeDetail {
    font-size: 0.72rem;
    letter-spacing: -0.01em;
    line-height: 1.1;
    white-space: nowrap;
}

/* Chart Section */
.miner-chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.chart-title {
    font-size: 1rem;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.25rem;
    border-radius: 8px;
}

.chart-range-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.chart-range-btn:hover {
    color: var(--text-primary);
}

.chart-range-btn.active {
    background: var(--accent-primary);
    color: white;
}

.chart-wrapper {
    margin-bottom: 1rem;
}

.miner-chart {
    height: 220px;
}

.chart-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
}

.chart-footer {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.chart-stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chart-stat-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chart-stat-value {
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
}

/* Payments Section */
.miner-payments-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
}

.payments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.payments-header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.payments-inline-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.payments-inline-control select {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.3rem 0.45rem;
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    text-transform: none;
}

.payments-title {
    font-size: 1rem;
    font-weight: 600;
}

.payments-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.payments-table-wrap {
    overflow-x: auto;
}

.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.payments-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.payments-table tr:last-child td {
    border-bottom: none;
}

.payments-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.tx-link {
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-primary);
    text-decoration: none;
}

.tx-link:hover {
    text-decoration: underline;
}

.payments-footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
}

.load-more-btn {
    padding: 0.625rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

/* Miner Dashboard Responsive */
@media (max-width: 1100px) {
    .miner-meta-section,
    .miner-top-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .miner-dashboard {
        padding: 1rem;
    }

    .miner-header-row {
        flex-direction: column;
        align-items: stretch;
    }

    .miner-address-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.25rem;
    }

    .miner-address-value {
        font-size: 0.75rem;
        word-break: break-all;
    }

    .primary-stat {
        padding: 1rem;
    }

    .primary-stat-value {
        font-size: 1.25rem;
    }

    .chart-footer {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .chart-stat-item {
        min-width: 45%;
    }

    .meta-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .primary-stat-value {
        font-size: 1.15rem;
    }
}

/* Data Staleness Indicators */
.data-stale {
    opacity: 0.7;
    position: relative;
}

.data-stale::after {
    content: '';
    position: absolute;
    top: 0;
    right: -8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-warning);
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.8); }
}

/* Connection Warning Banner */
.connection-warning {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--accent-warning);
    color: #000;
    padding: 8px 16px;
    text-align: center;
    z-index: 9999;
    font-size: 14px;
    font-weight: 500;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Offline indicator in status */
.update-time {
    transition: color 0.3s ease;
}

/* Loading skeleton animation for initial load */
.loading-skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    min-height: 1em;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
