/* L33t CSS Styles */

:root {
    --color-bg:          #050505;
    --color-bg-item:     rgba(18, 18, 18, 0.95);
    --color-fg:          #00ff00;
    --color-fg-dim:      #33ff33;
    --color-accent:      #7dcfff;
    --color-heading:     #c678dd;
    --color-heading-glow:#bb9af7;
    --color-border:      #33ff33;
    --font-mono:         'Courier New', Courier, monospace;
}

.leet-theme {
    font-family: var(--font-mono);
    background: linear-gradient(90deg, var(--color-bg), #0d0d0d);
    background-color: var(--color-bg);
    color: var(--color-fg);
    text-shadow: 0px 0px 8px var(--color-fg);
    animation: flicker 2s infinite alternate;
}

/* --- Navigation --- */

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

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

.leet-page-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

/* --- Index page --- */

.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leet-h1 {
    font-size: 3rem;
    color: var(--color-heading);
    text-shadow: 0 0 8px var(--color-heading-glow), 0 0 25px var(--color-heading-glow);
    text-align: center;
}

.leet-list-item {
    background: var(--color-bg-item);
    color: var(--color-fg-dim);
    border: 1px dashed var(--color-border);
    font-size: 1.2rem;
    text-shadow: 0px 0px 4px var(--color-fg-dim);
    animation: scroll 0.5s linear forwards;
    padding: 0.8rem;
    margin: 0.5rem auto;
    width: 50%;
}

.leet-description {
    font-size: 1rem;
    padding-left: 20px;
}

/* --- Container --- */

.leet-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

/* --- Prose (rendered markdown) --- */

.prose {
    color: var(--color-fg-dim);
    line-height: 1.7;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: var(--color-heading);
    text-shadow: 0 0 8px var(--color-heading-glow);
    margin: 1.5rem 0 0.5rem;
}

.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }

.prose p {
    margin: 0.75rem 0;
}

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

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

.prose ul,
.prose ol {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.prose li {
    margin: 0.25rem 0;
}

.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
}

.prose th,
.prose td {
    border: 1px dashed var(--color-border);
    padding: 0.4rem 0.75rem;
    text-align: left;
}

.prose th {
    color: var(--color-heading);
    text-shadow: 0 0 6px var(--color-heading-glow);
}

.prose code {
    background: var(--color-bg-item);
    border: 1px dashed var(--color-border);
    padding: 0.1rem 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.prose pre {
    background: var(--color-bg-item);
    border: 1px dashed var(--color-border);
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.prose pre code {
    border: none;
    padding: 0;
}

.prose blockquote {
    border-left: 3px solid var(--color-border);
    margin: 1rem 0;
    padding-left: 1rem;
    color: var(--color-fg);
    opacity: 0.75;
}

/* --- Breaker Panel --- */

.breaker-panel {
    background: #080808;
    border: 2px solid var(--color-border);
    padding: 1.5rem;
    margin: 1.5rem 0;
    max-width: 700px;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 15px rgba(0, 255, 0, 0.05);
}

.breaker-slots {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.3rem 0;
}

.breaker-row-num {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.75rem;
    font-size: 0.7rem;
    color: var(--color-fg);
    opacity: 0.35;
}

.breaker-slot {
    display: flex;
    align-items: center;
    padding: 0.35rem 0.6rem;
    border: 1px solid;
    font-size: 0.85rem;
    min-height: 2rem;
    margin: 0.15rem 0;
    min-width: 0;
}

.breaker-slot-left {
    flex-direction: row-reverse;
    text-align: right;
}

.breaker-slot-right {
    flex-direction: row;
    text-align: left;
}

.breaker-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.breaker-known {
    border-color: var(--color-fg);
    color: var(--color-fg);
    background: rgba(0, 255, 0, 0.04);
}

.breaker-unlabeled {
    border-color: #cc8800;
    color: #cc8800;
    background: rgba(204, 136, 0, 0.05);
}

.breaker-unused {
    border-color: rgba(128, 128, 128, 0.2);
    color: rgba(128, 128, 128, 0.3);
    background: none;
}

.breaker-unknown {
    border-color: #cc8800;
    color: #cc8800;
    background: rgba(204, 136, 0, 0.05);
}

/* --- Breaker Detail Panel --- */

@keyframes breaker-detail-open {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes breaker-detail-close {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-4px); }
}

.breaker-row-detail {
    grid-column: 1 / -1;
    display: none;
}

.breaker-row-detail:not(:empty) {
    display: block;
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    margin: 0.15rem 0 0.4rem;
    background: rgba(0, 255, 0, 0.03);
}

.breaker-row-detail.breaker-opening {
    animation: breaker-detail-open 150ms ease-out;
}

.breaker-row-detail.breaker-closing {
    display: block;
    animation: breaker-detail-close 150ms ease-in forwards;
}

.breaker-clickable {
    cursor: pointer;
}

.breaker-clickable:hover {
    background: rgba(0, 255, 0, 0.08);
}

.breaker-detail-content {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.breaker-detail-close {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: none;
    color: var(--color-fg);
    opacity: 0.5;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 0 0.2rem;
    line-height: 1;
}

.breaker-detail-close:hover {
    opacity: 1;
}

.breaker-detail-key {
    color: var(--color-heading);
    margin-right: 0.5rem;
}

.breaker-detail-field {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.breaker-detail-devices {
    margin: 0;
    padding-left: 1.2rem;
    list-style: disc;
}

.breaker-detail-devices li {
    margin: 0.15rem 0;
}

.breaker-detail-empty {
    opacity: 0.45;
    font-style: italic;
}

/* --- Coupled Breakers --- */

.breaker-coupled-primary {
    border-bottom: none;
    margin-bottom: 0;
}

.breaker-coupled-secondary {
    border-top: 1px dashed var(--color-fg);
    margin-top: 0;
    opacity: 0.75;
}

/* --- Breaker Todos --- */

.breaker-todos {
    margin: 1.5rem 0 0;
    color: var(--color-fg-dim);
}

.breaker-todos h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-fg);
    opacity: 0.45;
    margin: 0 0 0.4rem;
}

.breaker-todos ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.breaker-todos li {
    font-size: 0.85rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed rgba(51, 255, 51, 0.12);
    opacity: 0.6;
}

.breaker-todos li::before {
    content: "[ ] ";
    opacity: 0.5;
}

/* --- QR Form --- */

.leet-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.leet-input {
    font-family: var(--font-mono);
    font-size: 1rem;
    background: var(--color-bg-item);
    color: var(--color-fg);
    border: 1px dashed var(--color-border);
    padding: 0.6rem 0.8rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.leet-input:focus {
    border-style: solid;
}

.leet-button {
    font-family: var(--font-mono);
    font-size: 1rem;
    background: transparent;
    color: var(--color-fg);
    border: 1px dashed var(--color-border);
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    align-self: flex-start;
}

.leet-button:hover {
    border-style: solid;
    background: rgba(0, 255, 0, 0.05);
}

.qr-result {
    margin: 1rem 0;
}

.qr-result svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* --- Footer --- */

.leet-footer {
    font-size: 0.75rem;
    color: var(--color-fg);
    opacity: 0.4;
    text-align: right;
    margin-top: 2rem;
    text-shadow: none;
}

/* --- Responsive --- */

@media (max-width: 600px) {
    .leet-container {
        padding: 0.25rem;
    }

    .leet-list-item {
        width: 100%;
        margin: 0.10rem 0;
        box-sizing: border-box;
    }

    .leet-h1 {
        font-size: 2rem;
    }

    .breaker-panel {
        padding: 0.5rem;
        margin: 0.75rem 0;
    }

    .breaker-slot {
        font-size: 0.75rem;
        padding: 0.25rem 0.3rem;
    }

    .breaker-row-num {
        padding: 0 0.4rem;
    }

    /* devices table — hide timestamp columns; truncate device id */
    .col-first-seen,
    .col-last-seen {
        display: none;
    }

    .devices-table {
        table-layout: fixed;
    }

    /* integration: fixed narrow width */
    .devices-table th:nth-child(1),
    .devices-table td:nth-child(1) {
        width: 28%;
    }

    /* messages: fixed narrow width */
    .devices-table th:nth-child(5),
    .devices-table td:nth-child(5) {
        width: 12%;
    }

    /* device id: takes remaining ~60%, truncates with ellipsis */
    .devices-table th:nth-child(2),
    .devices-table td:nth-child(2) {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* --- Animations --- */

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

@keyframes scroll {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0); }
}

/* --- Tailscale Page --- */

.ts-status-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ts-state {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.15rem 0.5rem;
    border: 1px solid;
}

.ts-state-running {
    border-color: var(--color-fg);
    color: var(--color-fg);
}

.ts-state-stopped,
.ts-state-needslogin,
.ts-state-nostate {
    border-color: #cc3300;
    color: #cc3300;
}

.ts-daemon-version {
    font-size: 0.8rem;
    opacity: 0.45;
}

.ts-section {
    margin-bottom: 2rem;
}

.ts-h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-heading);
    margin: 0 0 0.75rem;
    border-bottom: 1px solid rgba(198, 120, 221, 0.2);
    padding-bottom: 0.3rem;
}

.ts-peer-count {
    font-size: 0.75rem;
    opacity: 0.6;
}

.ts-peer {
    border: 1px solid rgba(51, 255, 51, 0.2);
    padding: 0.8rem 1rem;
    margin-bottom: 1.5rem;
}

.ts-peer-online {
    border-color: rgba(51, 255, 51, 0.35);
}

.ts-peer-offline {
    border-color: rgba(51, 255, 51, 0.1);
    opacity: 0.6;
}

.ts-self {
    border-color: var(--color-accent);
    opacity: 1;
}

.ts-peer-header {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.ts-hostname {
    font-size: 1rem;
    color: var(--color-fg);
}

.ts-badge {
    font-size: 0.75rem;
}

.ts-badge-online {
    color: var(--color-fg);
}

.ts-badge-offline {
    opacity: 0.4;
}

.ts-fields {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ts-field {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

.ts-key {
    color: var(--color-fg);
    font-size: 0.7rem;
    min-width: 6rem;
    opacity: 0.4;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ts-key::after {
    content: ":";
}

.ts-key-sep {
    min-width: unset;
    margin-left: 0.5rem;
}

.ts-val {
    color: var(--color-fg);
    text-shadow: 0 0 6px rgba(0, 255, 0, 0.5);
}

.ts-timestamp {
    opacity: 0.65;
    font-size: 0.8rem;
}

.ts-field-flags {
    gap: 0.35rem;
    flex-direction: row;
    padding-left: 6.4rem;
}

.ts-flag {
    font-size: 0.7rem;
    padding: 0.1rem 0.35rem;
    border: 1px solid rgba(125, 207, 255, 0.4);
    color: var(--color-accent);
}

/* --- Notes Vault --- */

.notes-section {
    margin-bottom: 2rem;
}

.notes-h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-heading);
    margin: 0 0 0.75rem;
    border-bottom: 1px solid rgba(198, 120, 221, 0.2);
    padding-bottom: 0.3rem;
}

.notes-empty {
    opacity: 0.5;
    font-size: 0.9rem;
}

.notes-dead-link {
    opacity: 0.4;
    text-decoration: line-through;
}

.notes-detail {
    max-width: 72ch;
    margin-top: 1.5rem;
}

/* Secret / redacted content — present in DOM for future auth, hidden by CSS */

.notes-secret {
    position: relative;
    margin: 1rem 0;
    padding: 0.5rem 0.75rem;
    border: 1px dashed rgba(198, 120, 221, 0.25);
}

.notes-secret::before {
    content: "gm only";
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-heading);
    opacity: 0.55;
    margin-bottom: 0.4rem;
    user-select: none;
}

.notes-secret > * {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
    opacity: 0.7;
}

/* Future: add this class (e.g. via JS after auth) to reveal content */
.notes-secret.notes-secret-revealed::before {
    content: "gm only (revealed)";
    opacity: 0.35;
}

.notes-secret.notes-secret-revealed > * {
    filter: none;
    user-select: auto;
    pointer-events: auto;
    opacity: 1;
}

.notes-secret-badge {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-left: 0.25rem;
    vertical-align: middle;
    user-select: none;
}

/* --- Auth --- */

.leet-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
}

.leet-nav-user {
    opacity: 0.5;
    font-size: 0.8rem;
    letter-spacing: 0.03em;
}

.leet-nav-form {
    margin: 0;
}

.leet-nav-btn {
    background: transparent;
    border: 1px solid var(--color-accent, #00ff88);
    color: var(--color-accent, #00ff88);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: 0.05em;
    border-radius: 2px;
    transition: background 0.15s;
}

.leet-nav-btn:hover {
    background: rgba(0,255,136,0.12);
}

.leet-error {
    color: var(--color-error, #ff4444);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.leet-hint {
    opacity: 0.5;
    font-size: 0.8rem;
    margin-top: 1rem;
}

/* --- Shared interactive button primitive ---
   Transparent bg, dashed green border, hover → solid. Used by any small
   monospace button across the app (pagination, topic chips, etc.).
   Compose with a size modifier (.leet-btn-sm / .leet-btn-lg) as needed. */

.leet-btn {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    background: transparent;
    color: var(--color-fg-dim);
    border: 1px dashed rgba(51, 255, 51, 0.3);
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    user-select: none;
}

.leet-btn:hover:not(:disabled) {
    border-style: solid;
    color: var(--color-fg);
}

.leet-btn:disabled {
    opacity: 0.25;
    cursor: default;
}

.leet-btn-active {
    border-style: solid;
    color: var(--color-accent);
}

/* --- Shared utility --- */

.leet-muted {
    opacity: 0.5;
}

.leet-badge-warn {
    font-size: 0.72rem;
    color: #e0af68;
    text-shadow: 0 0 6px #e0af68;
    margin-left: 0.4rem;
    white-space: nowrap;
}

/* --- Generic table --- */

.leet-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.leet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.leet-table th {
    text-align: left;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-heading);
    text-shadow: 0 0 6px var(--color-heading-glow);
    white-space: nowrap;
}

.leet-table td {
    padding: 0.3rem 0.6rem;
    border-bottom: 1px solid rgba(51, 255, 51, 0.12);
    vertical-align: middle;
}

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

/* --- MQTT devices page --- */

tr.device-row {
    cursor: pointer;
    transition: background 0.1s;
    touch-action: manipulation;
    user-select: none;
}

tr.device-row:hover {
    background: rgba(0, 255, 0, 0.04);
}

tr.device-row[data-panel-open] {
    background: rgba(125, 207, 255, 0.06);
}

.device-panel-row td {
    padding: 0;
    border-bottom: 1px solid var(--color-border);
}

.device-panel {
    padding: 0.75rem 1rem;
    max-height: 22rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* --- MQTT live-feed page --- */

.mqtt-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.75rem 0 0.75rem;
    font-size: 0.85rem;
}

.mqtt-dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.mqtt-dot-connecting { background: var(--color-fg-dim); box-shadow: 0 0 4px var(--color-fg-dim); animation: mqtt-blink 1.2s ease-in-out infinite; }
.mqtt-dot-connected  { background: #00ff88; box-shadow: 0 0 6px #00ff88; }
.mqtt-dot-error      { background: #ff4444; box-shadow: 0 0 6px #ff4444; }

@keyframes mqtt-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

.mqtt-status-text {
    opacity: 0.65;
    font-size: 0.8rem;
}

.mqtt-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.6rem;
}

.mqtt-topics:empty {
    display: none;
}

.mqtt-filter-bar {
    margin-bottom: 0.75rem;
}

.mqtt-filter {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--font-mono);
    font-size: 1rem;
    background: var(--color-bg-item);
    color: var(--color-fg);
    border: 1px dashed var(--color-border);
    padding: 0.55rem 0.75rem;
    outline: none;
}

.mqtt-filter:focus {
    border-style: solid;
}

.mqtt-filter::placeholder {
    opacity: 0.3;
}

.mqtt-feed {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.mqtt-msg {
    background: var(--color-bg-item);
    border: 1px solid rgba(51, 255, 51, 0.15);
    padding: 0.6rem 0.75rem;
    min-width: 0;
}

@keyframes mqtt-flash {
    from { border-color: rgba(0, 255, 136, 0.7); }
    to   { border-color: rgba(51, 255, 51, 0.15); }
}

.mqtt-msg-new {
    animation: mqtt-flash 0.8s ease-out forwards;
}

.mqtt-msg-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0;
    min-width: 0;
    cursor: pointer;
    user-select: none;
}

.mqtt-msg-header::after {
    content: '▸';
    color: var(--color-fg);
    opacity: 0.25;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.mqtt-msg-expanded .mqtt-msg-header {
    margin-bottom: 0.35rem;
}

.mqtt-msg-expanded .mqtt-msg-header::after {
    content: '▾';
}

.mqtt-msg-topic {
    color: var(--color-accent);
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.mqtt-msg-time {
    color: var(--color-fg);
    opacity: 0.35;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.mqtt-msg-body,
.mqtt-msg-expand {
    display: none;
}

.mqtt-msg-expanded .mqtt-msg-body,
.mqtt-msg-expanded .mqtt-msg-expand {
    display: block;
}

.mqtt-msg-body {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-fg-dim);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.45;
}

.mqtt-msg-toggle {
    background: transparent;
    border: none;
    color: var(--color-accent);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.2rem 0;
    opacity: 0.55;
    display: block;
    margin-top: 0.25rem;
}

.mqtt-msg-toggle:hover {
    opacity: 1;
}

/* Expand/collapse for truncated payloads — no JS, pure HTML <details> */
.mqtt-msg-expand {
    margin: 0;
}

.mqtt-msg-expand > summary {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--color-fg-dim);
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.45;
    cursor: pointer;
    list-style: none;
}

.mqtt-msg-expand > summary::marker,
.mqtt-msg-expand > summary::-webkit-details-marker {
    display: none;
}

.mqtt-msg-expand > summary::after {
    content: ' ▸';
    color: var(--color-accent);
    font-size: 0.72rem;
    opacity: 0.6;
}

.mqtt-msg-expand[open] > summary::after {
    content: ' ▾';
}

/* Key-value grid — shown when the payload is a JSON object */
.mqtt-msg-kv {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.05rem 0.75rem;
    margin: 0;
    padding: 0;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.5;
}

.mqtt-kv-key {
    color: var(--color-fg-dim);
    opacity: 0.5;
    white-space: nowrap;
    user-select: none;
}

.mqtt-kv-value {
    color: var(--color-fg);
    word-break: break-all;
    min-width: 0;
}

/* --- MQTT Pagination Controls --- */

.mqtt-controls { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.75rem; }

/* .mqtt-page-btn and .mqtt-page-active compose with .leet-btn / .leet-btn-active */

.mqtt-page-ellipsis {
    font-family: var(--font-mono); font-size: 0.78rem;
    color: var(--color-fg-dim); opacity: 0.4; padding: 0.2rem 0.25rem;
}

.mqtt-page-new { color: var(--color-accent); font-size: 0.7rem; margin-left: 0.15rem; }

/* --- Device command form (inside device panel) --- */

.device-cmd-sep {
    border: none;
    border-top: 1px dashed rgba(51, 255, 51, 0.2);
    margin: 0.6rem 0;
}

.device-cmd-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.device-cmd-fields {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.device-cmd-topic,
.device-cmd-payload {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    background: var(--color-bg-item);
    color: var(--color-fg);
    border: 1px dashed rgba(51, 255, 51, 0.3);
    padding: 0.35rem 0.55rem;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    width: 100%;
}

.device-cmd-topic:focus,
.device-cmd-payload:focus {
    border-style: solid;
}

.device-cmd-topic::placeholder,
.device-cmd-payload::placeholder {
    opacity: 0.3;
}

.device-cmd-payload {
    min-height: 3.5rem;
}

.device-cmd-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.device-cmd-status {
    font-size: 0.75rem;
    opacity: 0.65;
}
