/* Fleet Dashboard v2 — U.S. Graphics / Berkeley Mono TX-02 */

@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Berkeley Mono';
    src: url('/static/fonts/BerkeleyMono-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #f4f3f0;
    --bg-card: #ffffff;
    --bg-hover: #eceae5;
    --border: #1a1a18;
    --border-dotted: dotted;
    --text: #1a1a18;
    --text-muted: #75715e;
    --green: #a6e22e;
    --red: #f92672;
    --yellow: #e6db74;
    --blue: #66d9ef;
    --radius: 0px;

    --ink: #1a1a18;
    --dot-size: 0.8px;
    --dot-gap: 4px;
    --dot-green: radial-gradient(circle, #a6e22e var(--dot-size), transparent var(--dot-size));
    --dot-red: radial-gradient(circle, #f92672 var(--dot-size), transparent var(--dot-size));
    --dot-blue: radial-gradient(circle, #66d9ef var(--dot-size), transparent var(--dot-size));
    --dot-muted: radial-gradient(circle, #75715e var(--dot-size), transparent var(--dot-size));
    --dot-accent: radial-gradient(circle, #b0a99e var(--dot-size), transparent var(--dot-size));
}

[data-theme="dark"] {
    --bg: #272822;
    --bg-card: #1e1f1c;
    --bg-hover: #3e3d32;
    --border: #49483e;
    --text: #f8f8f2;
    --text-muted: #75715e;
    --ink: #f8f8f2;
    --dot-accent: radial-gradient(circle, #49483e var(--dot-size), transparent var(--dot-size));
    --dot-green: radial-gradient(circle, #a6e22e var(--dot-size), transparent var(--dot-size));
    --dot-red: radial-gradient(circle, #f92672 var(--dot-size), transparent var(--dot-size));
    --dot-blue: radial-gradient(circle, #66d9ef var(--dot-size), transparent var(--dot-size));
    --dot-muted: radial-gradient(circle, #75715e var(--dot-size), transparent var(--dot-size));
    --green: #a6e22e;
    --red: #f92672;
    --yellow: #e6db74;
    --blue: #66d9ef;
}

[data-theme="dark"] .nav-brand {
    color: #e6db74;
}

[data-theme="dark"] .summary-label,
[data-theme="dark"] .metric-label,
[data-theme="dark"] .card-updated {
    color: #e6db74;
}

[data-theme="dark"] .chart-header h2 {
    color: #e6db74;
}

[data-theme="dark"] .detail-section h2 {
    color: #e6db74;
}

[data-theme="dark"] .log-unit {
    color: #e6db74;
}

[data-theme="dark"] .log-entry:nth-child(even) {
    background: #2d2e27;
}

[data-theme="dark"] .logs-header h1 {
    background: #f8f8f2;
    color: #272822;
}

[data-theme="dark"] .stale-tag {
    color: #272822;
}

[data-theme="dark"] .chart-btn.active,
[data-theme="dark"] .chart-tab.active {
    color: #272822;
}

[data-theme="dark"] .chart-axis line,
[data-theme="dark"] .chart-axis path {
    stroke: #49483e;
}

[data-theme="dark"] .chart-grid line {
    stroke: #49483e;
}

/* Theme toggle */

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    padding: 2px 8px;
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--text);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-color: var(--border) var(--bg);
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
    border-radius: 0;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

body {
    background-color: var(--bg);
    background-image: var(--dot-accent);
    background-size: 7px 7px;
    color: var(--text);
    font-family: 'Berkeley Mono', 'SF Mono', 'Cascadia Code', monospace;
    font-size: 13px;
    line-height: 1.5;
}

a {
    color: var(--blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Nav */

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.nav-brand:hover {
    text-decoration: none;
    color: var(--green);
}

.nav-right {
    display: flex;
    gap: 20px;
}

.nav-right a {
    color: var(--text-muted);
    font-size: 13px;
}

.nav-right a:hover {
    color: var(--text);
    text-decoration: none;
}

/* Main */

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Summary bar */

.summary-bar {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
    flex: 1;
}

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

.summary-value {
    font-size: 18px;
    font-weight: 600;
}

/* Card grid */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.daemon-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: border-color 0.15s;
}

.daemon-card:hover {
    border-color: var(--text);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    flex: 1;
}

.card-header h3 a {
    color: var(--text);
}

.card-header h3 a:hover {
    color: var(--blue);
    text-decoration: none;
}

.card-strategy {
    font-size: 11px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: 0;
}

/* Wallet badge */

.wallet-badge {
    font-size: 11px;
    color: var(--blue);
    background: rgba(102, 217, 239, 0.1);
    border: 1px solid rgba(102, 217, 239, 0.3);
    padding: 2px 8px;
    border-radius: 0;
    white-space: nowrap;
}

.wallet-address {
    font-size: 12px;
    color: var(--text-muted);
}

.wallet-address-sm {
    font-size: 10px;
    color: var(--text-muted);
}

/* Status dots */

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-ok {
    background: var(--green);
}

.dot-reduce {
    background: var(--yellow);
}

.dot-stop {
    background: var(--red);
}

.dot-offline {
    background: var(--text-muted);
}

.dot-blink {
    animation: dot-pulse 0.4s ease-out;
}

@keyframes dot-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.8); }
    100% { transform: scale(1); }
}

/* Card legend */

.card-legend {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 8px 4px 0;
    grid-column: 1 / -1;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Card body — metrics left, sunburst right */

.card-body {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

/* Card metrics */

.card-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metric-label {
    font-size: 11px;
    color: var(--text-muted);
}

.metric-value {
    font-size: 14px;
    font-weight: 500;
}

/* Budget bar */

.card-budget-bar {
    height: 12px;
    background: var(--bg);
    border-radius: 0;
    margin-bottom: 12px;
    overflow: hidden;
}

.budget-fill {
    height: 100%;
    background-image: radial-gradient(circle, #4a4a4a 0.75px, transparent 0.75px);
    background-size: 3px 3px;
    background-color: transparent;
    border-radius: 0;
    transition: width 0.3s ease;
}

/* Card footer */

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.card-updated {
    font-size: 11px;
    color: var(--text-muted);
}

.detail-link {
    font-size: 12px;
    color: var(--blue);
}

.card-offline {
    color: var(--text-muted);
    font-style: italic;
    padding: 12px 0;
}

/* Value colors */

.positive {
    color: var(--green);
}

.negative {
    color: var(--red);
}

.cb-ok {
    color: var(--green);
}

.cb-reduce {
    color: var(--yellow);
}

.cb-stop, .cb-permanent_stop {
    color: var(--red);
}

/* Detail page */

.detail-page {
    max-width: 100%;
}

.detail-header {
    margin-bottom: 24px;
}

.back-link {
    font-size: 13px;
    color: var(--text-muted);
    display: inline-block;
    margin-bottom: 8px;
}

.back-link:hover {
    color: var(--text);
}

.detail-header h1 {
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-links {
    display: flex;
    gap: 16px;
    margin-top: 8px;
    align-items: center;
}

.detail-links a {
    font-size: 13px;
}

/* Data source badge */

.data-source-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 0;
    font-weight: 600;
}

/* Detail sections */

.detail-section {
    margin-top: 24px;
}

.detail-section h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-muted);
}

/* Tables */

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

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

thead th {
    text-align: left;
    padding: 8px 12px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 6px 12px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

.table-note {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Login */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 360px;
    text-align: center;
}

.login-box h1 {
    font-size: 24px;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 14px;
}

.login-error {
    background: rgba(249, 38, 114, 0.1);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.login-success {
    background: rgba(166, 226, 46, 0.1);
    border: 1px solid var(--green);
    color: var(--green);
    padding: 8px 12px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.login-box input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
    outline: none;
}

.login-box input:focus {
    border-color: var(--blue);
}

.login-box button {
    width: 100%;
    padding: 10px 14px;
    background: var(--green);
    color: var(--bg-card);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.login-box button:hover {
    opacity: 0.9;
}

.login-btn-secondary {
    background: var(--bg-hover) !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--border) !important;
}

.login-btn-secondary:hover {
    color: var(--text) !important;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--text-muted);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.login-divider span {
    padding: 0 12px;
}

/* Charts — D3 */

.chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 24px;
}

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

.chart-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-controls {
    display: flex;
    gap: 6px;
}

.chart-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    line-height: 1.4;
}

.chart-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
    text-decoration: none;
}

.chart-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.chart-btn.active {
    background: var(--blue);
    color: var(--bg-card);
    border-color: var(--blue);
}

.chart-container {
    height: 280px;
    position: relative;
}

.chart-container svg {
    width: 100%;
    height: 100%;
}

.chart-axis text {
    fill: var(--text-muted);
    font-size: 11px;
    font-family: 'Berkeley Mono', 'SF Mono', 'Cascadia Code', monospace;
}

.chart-section svg text,
.chart-container svg text,
.chart-container-sm svg text {
    font-family: 'Berkeley Mono', 'SF Mono', 'Cascadia Code', monospace;
}

.chart-axis line, .chart-axis path {
    stroke: #d5d0c8;
}

.chart-grid line {
    stroke: #d5d0c8;
    stroke-dasharray: 2,2;
}

.chart-tooltip {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.chart-line {
    fill: none;
    stroke-width: 2;
}

.chart-area {
    opacity: 0.15;
}

.chart-crosshair {
    pointer-events: none;
}

/* Log viewer */

.logs-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 90px);
}

.logs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.logs-header h1 {
    font-size: 14px;
    font-weight: 600;
    background: #000;
    color: var(--bg-card);
    padding: 2px 8px;
}

.logs-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.log-search-input {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 10px;
    outline: none;
    min-width: 200px;
}

.log-search-input:focus {
    border-color: var(--blue);
}

.log-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 8px;
    outline: none;
}

.log-select:focus {
    border-color: var(--blue);
}

.log-toggle {
    font-size: 12px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.log-toggle input[type="checkbox"] {
    accent-color: var(--text);
}

.log-container {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    font-size: 12px;
    line-height: 1.6;
}

.log-container-sm {
    max-height: 300px;
    flex: none;
}

.log-entry {
    display: flex;
    gap: 8px;
    padding: 1px 8px;
    margin: 0 -8px;
    border-radius: 0;
}

.log-entry:nth-child(even) {
    background: #f7f6f4;
}

.log-entry:hover {
    background: var(--bg-hover);
}

.log-entry-new {
    animation: log-slide-in 0.3s ease-out, log-highlight 1.5s ease-out;
}

@keyframes log-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes log-highlight {
    from { background: rgba(102, 217, 239, 0.1); }
    to { background: transparent; }
}

.log-ts {
    color: var(--text-muted);
    flex-shrink: 0;
    min-width: 95px;
}

.log-unit {
    color: var(--blue);
    flex-shrink: 0;
    min-width: 120px;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-sev {
    flex-shrink: 0;
    min-width: 48px;
    font-weight: 600;
    text-align: center;
}

.log-msg {
    white-space: pre-wrap;
    word-break: break-all;
    flex: 1;
}

.log-err { color: var(--red); }
.log-warn { color: var(--yellow); }
.log-info { color: var(--text-muted); }
.log-debug { color: #a8a29e; }

/* Log search results */

.log-search-results {
    margin-bottom: 12px;
}

.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.search-results-header h3 {
    font-size: 14px;
    color: var(--text-muted);
}

.search-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Log charts row */

.log-charts-row {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 12px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.log-chart-card {
    margin-bottom: 0;
    padding: 12px;
    min-height: 280px;
    overflow: hidden;
}

.log-chart-wide {
    overflow-x: auto;
}

.chart-container-sm {
    height: 240px;
    position: relative;
    overflow: hidden;
    max-width: 100%;
}

.order-dot {
    cursor: pointer;
}

/* Chart tabs */

.chart-tabs {
    display: flex;
    gap: 4px;
}

.chart-tab {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 3px 10px;
    border-radius: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}

.chart-tab:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.chart-tab.active {
    background: var(--blue);
    color: var(--bg-card);
    border-color: var(--blue);
}

.chart-tab-content {
    display: none;
}

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

/* Heartbeat table */

.heartbeat-table {
    width: 100%;
    font-size: 12px;
}

.heartbeat-table thead th {
    font-size: 10px;
    padding: 4px 8px;
}

.heartbeat-table tbody td {
    padding: 4px 8px;
    white-space: nowrap;
}

.heartbeat-table .status-dot {
    width: 8px;
    height: 8px;
    margin-right: 4px;
    vertical-align: middle;
}

.stale-tag {
    font-size: 9px;
    background: var(--red);
    color: var(--bg-card);
    padding: 1px 4px;
    border-radius: 0;
    font-weight: 700;
    margin-left: 4px;
}

/* Daemon description */

.daemon-description {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
}

.description-text {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.7;
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    background: none;
    border: none;
    padding: 0;
}

/* Analytics page */

.analytics-page .card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.analytics-page .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.analytics-page .card-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.analytics-page select {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text);
    font-size: 13px;
    padding: 4px 8px;
    outline: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 10px;
    text-transform: uppercase;
}

.data-table td {
    padding: 5px 10px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

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

.clickable-row {
    cursor: pointer;
}

.alert-banner {
    background: rgba(230, 219, 116, 0.1);
    border: 1px solid var(--yellow);
    color: var(--yellow);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 16px;
}

.btn-close {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-muted);
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
}

.btn-close:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.empty-state {
    color: var(--text-muted);
    font-style: italic;
    padding: 20px;
    text-align: center;
}

#daemon-detail h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-top: 16px;
}

/* Info icon tooltip */

.info-icon {
    color: var(--text-muted);
    font-size: 14px;
    cursor: help;
    position: relative;
    flex-shrink: 0;
    line-height: 1;
}

.info-icon:hover {
    color: var(--blue);
}

.info-icon:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text);
    white-space: normal;
    width: 260px;
    line-height: 1.5;
    z-index: 20;
    pointer-events: none;
}

/* Sunburst */

.sunburst-container {
    position: relative;
    flex-shrink: 0;
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sunburst-tooltip {
    position: absolute;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0;
    padding: 6px 10px;
    font-size: 11px;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive */

@media (max-width: 768px) {
    main {
        padding: 16px;
    }

    .summary-bar {
        gap: 12px;
    }

    .summary-item {
        min-width: 80px;
    }

    .summary-value {
        font-size: 15px;
    }

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

    .top-nav {
        padding: 12px 16px;
    }

    .log-charts-row {
        grid-template-columns: 1fr;
    }

    .logs-toolbar {
        flex-wrap: wrap;
    }

    .logs-page {
        height: auto;
    }

    .log-container {
        min-height: 60vh;
    }

    .log-charts-row {
        max-height: none;
    }
}

/* HiDPI dot pattern adjustment */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    :root { --dot-size: 1.2px; }
}

/* Paper Lab page */
#paper-status {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-pre {
    font-size: 11px;
    overflow-x: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 12px;
    line-height: 1.5;
}

.paper-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 8px;
}

.paper-legend .swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    margin-right: 6px;
    vertical-align: middle;
}

.gate-why {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    max-width: 220px;
}
