body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-color, #f8fafc);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary, #0f172a);
    -webkit-font-smoothing: antialiased;
}

.hero-section {
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}

.status-badge.disconnected {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.05);
    border-color: rgba(220, 38, 38, 0.2);
}

.status-badge:not(.disconnected) .status-dot {
    animation: status-pulse 2s infinite;
}

.status-badge.disconnected .status-dot {
    background-color: #dc2626;
    animation: none;
}

@keyframes status-pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.2);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Button styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-shadow: none !important;
}

.btn.primary {
    background: #4f46e5;
    color: #ffffff;
}

.btn.primary:hover {
    background: #4338ca;
}

.btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border-color: #e2e8f0;
}

.btn.secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn.small {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
}

/* Main app area */
.app-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 0.5rem 1rem;
    flex: 1;
    min-height: 0;
    gap: 0.75rem;
}

.url-container {
    width: 100%;
    margin-bottom: 1.25rem;
    display: flex;
    justify-content: center;
}

.url-card {
    width: 100%;
    max-width: 1200px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 6px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.url-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    width: 100%;
}

.endpoint-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.01em;
    margin-bottom: 0.5rem;
}

.url-box-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.5rem 0.5rem 0.75rem;
    border-radius: 4px;
    background: rgba(79, 70, 229, 0.03); /* Subtle Indigo Glow */
    border: 1px solid rgba(79, 70, 229, 0.2);
    transition: all 0.2s ease;
    max-width: 900px;
}

.url-box-inner:focus-within {
    background: #ffffff;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.url-input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.url-box-inner input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: #4f46e5;
    font-weight: 700;
    text-align: left;
    width: 100%;
    letter-spacing: -0.01em;
}

.endpoint-hint {
    font-size: 0.7rem;
    color: var(--text-secondary, #64748b);
    line-height: 1.4;
    margin: 0.25rem 0 0 0;
    opacity: 0.7;
    font-weight: 500;
}

/* Split layout */
.split-view {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.list-pane {
    width: 260px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.list-pane::-webkit-scrollbar {
    display: none;
}

.empty-session .list-pane {
    display: none !important;
}

.payload-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.06));
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.payload-item:hover {
    background: var(--surface-hover, rgba(0, 0, 0, 0.03));
}

.payload-item.selected {
    background: rgba(79, 70, 229, 0.06) !important;
    border-left: 4px solid var(--brand-primary, #4f46e5);
    padding-left: calc(0.75rem - 4px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.payload-item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.method-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: var(--surface-hover, rgba(0, 0, 0, 0.05));
    color: var(--text-secondary, #475569);
    min-width: 42px;
    text-align: center;
}

.method-badge.POST {
    background: #4f46e5;
    color: #ffffff;
}

.method-badge.GET {
    background: #10b981;
    color: #ffffff;
}

.method-badge.PUT {
    background: #f59e0b;
    color: #ffffff;
}

.method-badge.DELETE {
    background: #ef4444;
    color: #ffffff;
}

.payload-ip {
    font-size: 0.65rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-muted, #94a3b8);
    background: transparent;
    padding: 0;
    border-radius: 0;
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-text {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    margin-left: auto;
    font-family: 'JetBrains Mono', monospace;
}

.format-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    text-transform: uppercase;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary, #475569);
}

.format-badge.json {
    background: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
}

.format-badge.ndjson {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.format-badge.xml {
    background: rgba(234, 88, 12, 0.1);
    color: #ea580c;
}

.format-badge.form {
    background: rgba(22, 163, 74, 0.1);
    color: #16a34a;
}

.format-badge.text {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
}

/* Detail pane */
.detail-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 0.75rem;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.detail-pane::-webkit-scrollbar {
    display: none;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.detail-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.detail-section {
    margin-bottom: 0.75rem;
}

.detail-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.code-block {
    background: #fcfcfc;
    color: #334155;
    padding: 1.25rem;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.code-block::-webkit-scrollbar {
    display: none;
}

.section-header.collapsible:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

.collapsed .section-content {
    display: none;
}

.collapsed .chevron {
    transform: rotate(0deg);
}

.detail-section:not(.collapsed) .chevron {
    transform: rotate(90deg);
}

/* renderjson specific styling */
.renderjson a {
    text-decoration: none;
    outline: none;
    cursor: default;
}

.renderjson a:hover,
.renderjson a:focus {
    outline: none;
    box-shadow: none;
}

.renderjson .disclosure {
    color: #94a3b8;
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0 4px;
    transition: color 0.2s;
}

.renderjson .disclosure:hover {
    color: #6366f1;
    outline: none;
}

.renderjson .string {
    color: #166534;
}

/* Subtle Green */
.renderjson .number {
    color: #0369a1;
}

/* Subtle Blue */
.renderjson .key {
    color: #4338ca;
    font-weight: 600;
}

/* Subtle Indigo */
.renderjson .keyword {
    color: #9a3412;
    font-weight: 600;
}

/* Subtle Rust */
.renderjson .boolean {
    color: #9a3412;
}

/* Rest of Headers Table */
.headers-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

.headers-table th,
.headers-table td {
    padding: 0.5rem;
    text-align: left;
    border-bottom: 1px solid var(--surface-hover, rgba(0, 0, 0, 0.05));
    vertical-align: top;
}

.row-key {
    color: var(--brand-primary, #4f46e5);
    font-weight: 600;
    width: 1%;
    white-space: nowrap;
    padding-right: 2rem !important;
}

.row-value {
    color: var(--text-primary, #0f172a);
    word-break: break-all;
    white-space: pre-wrap;
}

.hidden-row {
    display: none !important;
}

.show-more-row td {
    text-align: center;
    color: var(--brand-primary, #4f46e5);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.02);
    border: 1px dashed rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 0.6rem !important;
    transition: all 0.2s;
}

.show-more-row td:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--brand-primary);
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted, #525252);
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Guide Section */
.guide-section {
    padding: 2.5rem 5% 4rem 5%;
    scroll-margin-top: 64px;
    display: flex;
    justify-content: center;
    background: var(--bg-color, #f8fafc);
}

.guide-container {
    max-width: 1200px;
    width: 100%;
    padding: 3rem;
    border-radius: 6px;
    border: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
    background: var(--glass-bg, rgba(255, 255, 255, 0.5));
}

.guide-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary, #0f172a);
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.guide-card {
    display: flex;
    flex-direction: column;
}

.guide-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    background: var(--surface-hover, rgba(0, 0, 0, 0.05));
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.guide-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #0f172a);
}

.guide-card p {
    font-size: 0.9rem;
    color: var(--text-secondary, #475569);
    line-height: 1.5;
}

.guide-docs {
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border, rgba(0, 0, 0, 0.1));
}

.guide-docs h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #0f172a);
}

.guide-docs p {
    font-size: 0.95rem;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
}

.docs-list {
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    color: var(--text-secondary, #475569);
}

.docs-list li {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.docs-list code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.ui-guide-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.ui-feature {
    padding-left: 1rem;
    border-left: 3px solid var(--surface-hover, rgba(0, 0, 0, 0.1));
}

.ui-feature strong {
    display: block;
    font-size: 1rem;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.25rem;
}

/* Utility */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Navbar */
.navbar-wrapper {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.navbar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    color: #0f172a;
    font-weight: 700;
    font-size: 1.25rem;
    gap: 0.6rem;
}

.logo-img {
    height: 28px;
}

.nav-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary, #475569);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

.btn-expose {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: rgba(79, 70, 229, 0.08);
    color: #4338ca;
    border: none;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-expose:hover {
    background: rgba(79, 70, 229, 0.12);
}

/* Empty States & Padded Sections */
.empty-state.padded {
    padding: 2rem;
}

.empty-state svg {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Detail Headers & Metadata */
.detail-meta {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.detail-meta .format-badge {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.detail-time {
    color: var(--text-muted, #64748b);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}

.body-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.25rem;
}

.body-header h3 {
    margin: 0 !important;
}

.body-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 2px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.toggle-btn {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.7rem !important;
    border-radius: 6px !important;
    border: none !important;
    background: transparent !important;
    color: #64748b !important;
    font-weight: 600 !important;
}

.toggle-btn.active {
    background: #ffffff !important;
    color: #4f46e5 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.h-hidden {
    display: none !important;
}

.parsed-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.parsed-table th,
.parsed-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.parsed-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 30%;
}

.parsed-table td {
    color: #0f172a;
    word-break: break-all;
}

/* Collapsible Sections */
.section-header.collapsible {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.45rem 0.6rem;
    border-radius: 3px;
    transition: background 0.15s ease;
    user-select: none;
}

.section-header.collapsible:hover {
    background: rgba(0, 0, 0, 0.03);
}

.chevron {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    color: var(--text-muted);
    transform: rotate(90deg);
    /* Default open */
    flex-shrink: 0;
}

.detail-section.collapsed .chevron {
    transform: rotate(0deg);
}

.section-header h3 {
    margin: 0 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}

.no-query {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: none;
    padding: 0.5rem 1.5rem;
}

/* Component Overrides */
#send-sample-btn {
    padding: 0.75rem 2rem;
    font-weight: 600;
}

#copy-btn {
    padding: 0.4rem 1.25rem;
}

#copy-raw-btn {
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Shared View Banner */
.shared-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(79, 70, 229, 0.05);
    color: #4338ca;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.shared-banner-link {
    display: inline-flex;
    align-items: center;
    background: rgba(79, 70, 229, 0.1);
    color: #4338ca;
    padding: 0.25rem 0.75rem;
    border-radius: 3px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}


.shared-banner-link:hover {
    background: rgba(79, 70, 229, 0.15);
    transform: translateY(-1px);
}

#mobile-back-btn {
    display: none;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        width: 100%;
    }

    .hero-section {
        height: auto;
        min-height: calc(100vh - 120px);
    }

    .app-container {
        padding: 0.75rem;
        margin-bottom: 1.5rem;
    }

    .url-container {
        margin-bottom: 1rem;
    }

    .url-card {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .url-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .endpoint-title {
        font-size: 0.85rem;
    }

    .url-box-inner {
        width: 100%;
        min-width: 0;
        padding: 0.4rem 0.5rem 0.4rem 0.75rem;
        gap: 0.15rem;
    }

    .url-input-row {
        gap: 0.5rem;
    }

    .url-box-inner input {
        font-size: 0.85rem;
    }

    .endpoint-hint {
        font-size: 0.65rem;
        margin-top: 0.15rem;
    }

    .url-box input {
        width: 100%;
        margin-bottom: 0.5rem;
        font-size: 0.8rem;
    }

    .split-view {
        flex-direction: column;
        height: 600px;
        /* Fallback height */
        max-height: 80vh;
    }

    .list-pane,
    .detail-pane {
        width: 100% !important;
        max-width: none !important;
    }

    /* Toggle logic */
    .split-view.viewing-detail .list-pane {
        display: none !important;
    }

    .split-view:not(.viewing-detail) .detail-pane {
        display: none !important;
    }

    #mobile-back-btn {
        display: inline-flex;
        margin-right: 0.5rem;
        padding: 0.4rem 0.8rem;
    }

    .detail-header {
        flex-wrap: wrap;
    }

    .detail-header h2 {
        font-size: 1rem;
        flex: 1;
        min-width: 150px;
    }

    .detail-meta {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: space-between;
    }

    .code-block {
        padding: 1rem;
        font-size: 0.75rem;
    }
}