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

html, body {
    height: 100%;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #0f0f10;
}

.layout {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.browser-chrome {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    background: #191a1d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.topbar-status {
    flex: 1;
    min-width: 0;
    color: #c7cbd5;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.progress-bar {
    height: 2px;
    background: transparent;
    flex-shrink: 0;
    overflow: hidden;
}

.progress-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ff7a18, #ffcf4d, #ff7a18, transparent);
    background-size: 280% 100%;
    animation: progress-slide 1.3s ease-in-out infinite;
}

@keyframes progress-slide {
    0% { background-position: 100% center; }
    100% { background-position: -100% center; }
}

.iframe-container {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: #ffffff;
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.loading-overlay,
.error-panel {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

.loading-overlay {
    gap: 16px;
    background: #111214;
}

.loading-overlay p {
    color: #7e8594;
    font-size: 13px;
}

.spinner {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.09);
    border-top-color: #ff7a18;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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

.error-panel {
    gap: 12px;
    padding: 32px;
    background: #111214;
}

.error-icon {
    font-size: 40px;
}

.error-panel h2 {
    color: #ff7a18;
    font-size: 1.2rem;
    font-weight: 700;
}

.error-panel p {
    max-width: 480px;
    color: #949aa7;
    font-size: 0.92rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.retry-btn {
    margin-top: 4px;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    background: #ff7a18;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease;
}

.retry-btn:hover {
    background: #e5680f;
}

.save-filter-btn {
    border: none;
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #ff8a22 0%, #ff6b18 100%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 14px 28px rgba(255, 122, 24, 0.26);
}

.save-filter-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(255, 122, 24, 0.32);
}

.save-filter-btn:disabled {
    cursor: default;
    opacity: 0.74;
    box-shadow: none;
}

.save-filter-btn.is-success {
    background: linear-gradient(135deg, #2fb770 0%, #21945a 100%);
}

.save-filter-btn.is-error {
    background: linear-gradient(135deg, #da5b5b 0%, #bb3838 100%);
}

.topbar-save-btn {
    width: auto;
    min-width: 250px;
    flex-shrink: 0;
    padding: 12px 18px;
}

.topbar-status.is-success {
    color: #7be09b;
}

.topbar-status.is-error {
    color: #ff9c9c;
}

.topbar-status.is-muted {
    color: #a4acb8;
}

@media (max-width: 640px) {
    .topbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }

    .topbar-status {
        white-space: normal;
    }

    .topbar-save-btn {
        width: 100%;
        min-width: 0;
        padding: 13px 14px;
        font-size: 13px;
    }
}
