/* app.css sets body { overflow: hidden; height: 100vh } for chat layout */
html:has(body.debug-page),
body.debug-page {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
}

.debug-page {
    background: #0f0f1a;
    color: #ddd;
    min-height: 100vh;
    padding-bottom: 48px;
}

.debug-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    border-bottom: 1px solid #1a2744;
    background: #16213e;
}

.debug-header a {
    color: #9b7fd4;
    text-decoration: none;
}

.debug-header h1 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}

.debug-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: #12121f;
    border-bottom: 1px solid #1a2744;
    flex-wrap: wrap;
}

.debug-tabs button {
    background: transparent;
    border: 1px solid #2a3a5c;
    color: #aaa;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.debug-tabs button.active {
    background: #1a2744;
    color: #e94560;
    border-color: #e94560;
}

.debug-main {
    padding: 16px 20px 40px;
    max-width: 1200px;
    margin: 0 auto;
    overflow: visible;
}

.debug-panel {
    display: none;
}

.debug-panel.active {
    display: block;
}

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

.debug-grid label,
.debug-main > label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 10px;
}

.debug-grid input,
.debug-grid select,
.debug-main textarea,
.debug-main input,
.debug-main select {
    background: #1a1a2e;
    border: 1px solid #0f3460;
    color: #eee;
    border-radius: 6px;
    padding: 8px;
    font-family: inherit;
}

.debug-main textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: ui-monospace, monospace;
    font-size: 0.85rem;
}

.debug-btn {
    background: #1a2744;
    border: 1px solid #3a5080;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 12px;
}

.debug-btn.primary {
    background: #e94560;
    border-color: #e94560;
    color: #fff;
}

.debug-btn:hover {
    filter: brightness(1.1);
}

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

.debug-out {
    background: #0a0a14;
    border: 1px solid #1a2744;
    border-radius: 8px;
    padding: 12px;
    overflow: auto;
    max-height: 420px;
    font-size: 0.8rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.debug-out.compact {
    max-height: 160px;
}

.debug-out.small {
    max-height: 240px;
}

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

@media (max-width: 800px) {
    .debug-split {
        grid-template-columns: 1fr;
    }
}

.debug-split h3,
.debug-main h3 {
    font-size: 0.9rem;
    color: #9b7fd4;
    margin: 16px 0 8px;
}

.debug-img-wrap {
    margin: 12px 0;
}

.debug-img-wrap img {
    max-width: 100%;
    max-height: 512px;
    border-radius: 8px;
    border: 1px solid #333;
}

.debug-img-wrap.hidden {
    display: none;
}

.model-list-block {
    margin-bottom: 8px;
}

.model-list-block summary {
    cursor: pointer;
    color: #9b7fd4;
}

.model-list-block ul {
    margin: 4px 0 0;
    padding-left: 1.2rem;
    font-size: 0.8rem;
    max-height: 120px;
    overflow: auto;
}
