html{
    width:100%;
    overflow-x:hidden;
}

body{
    width:100%;
    overflow-x:hidden;
}

img,
svg,
video,
canvas{
    max-width:100%;
}

button,
a,
input,
textarea,
select{
    -webkit-tap-highlight-color:transparent;
}

pre,
code{
    max-width:100%;
    white-space:pre-wrap;
    overflow-wrap:anywhere;
}

.topbar,
.page-form-header,
.result-header,
.wallet-hero,
.api-docs-toolbar,
.modal-header{
    min-width:0;
}

.topbar > *,
.page-form-header > *,
.result-header > *,
.wallet-hero > *,
.api-docs-toolbar > *,
.modal-header > *{
    min-width:0;
}

.topbar h1,
.hero h1,
.page-form-header h2,
.result-header h2,
.modal-header h2,
.wallet-balance,
.stat-value,
.wallet-stat-value{
    overflow-wrap:anywhere;
}

.api-table{
    width:100%;
}

.card{
    max-width:100%;
}

@media (max-width:1200px){
    .main-content{
        padding:34px;
    }

    .topbar h1{
        font-size:clamp(34px,4vw,46px);
    }

    .stats-grid,
    .wallet-stats{
        grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
    }
}

@media (max-width:1024px){
    body{
        min-height:100vh;
    }

    .hero,
    .workflow,
    .experience,
    .pages-shell{
        grid-template-columns:1fr !important;
    }

    .console-preview,
    .api-picker,
    .page-form-card,
    .result-panel,
    .selected-api-panel{
        width:100%;
    }

    .api-picker{
        position:static !important;
    }

    .api-page-list{
        max-height:none !important;
    }

    .feature-band,
    .experience-grid{
        grid-template-columns:1fr !important;
    }

    .bonus-band,
    .final-cta,
    .wallet-hero{
        align-items:flex-start;
        flex-direction:column;
    }

    .wallet-hero .recharge-btn,
    .final-cta a,
    .bonus-band a{
        width:100%;
    }
}

@media (max-width:900px){
    body{
        height:auto !important;
        min-height:100vh;
        display:block !important;
        overflow:auto !important;
    }

    .sidebar{
        width:100% !important;
        height:auto !important;
        min-height:72px;
        position:sticky;
        top:0;
        z-index:80;
        flex-direction:row !important;
        align-items:center;
        gap:12px;
        padding:12px !important;
        overflow-x:auto !important;
        overflow-y:hidden !important;
        border-right:none !important;
        border-bottom:1px solid rgba(255,255,255,0.08);
    }

    .sidebar.expanded{
        width:100% !important;
    }

    .sidebar > div{
        min-width:0;
    }

    .top-sidebar{
        display:none !important;
    }

    .menu{
        flex:1;
        min-width:0;
        flex-direction:row !important;
        align-items:center !important;
        gap:10px !important;
        margin-top:0 !important;
        overflow-x:auto;
        padding-bottom:2px;
    }

    .menu button,
    .sidebar.expanded .menu button,
    .logout-btn,
    .sidebar.expanded .logout-btn{
        width:48px !important;
        height:48px !important;
        min-width:48px;
        flex:0 0 48px;
        justify-content:center !important;
        padding:0 !important;
    }

    .menu .text,
    .sidebar.expanded .text,
    .logout-btn .text{
        display:none !important;
    }

    .main-content{
        width:100%;
        height:auto !important;
        min-height:calc(100vh - 72px);
        overflow:visible !important;
        padding:28px 18px !important;
    }

    .topbar{
        align-items:flex-start;
        gap:16px;
        flex-wrap:wrap;
        margin-bottom:26px;
    }

    .topbar h1{
        font-size:clamp(30px,8vw,42px) !important;
        line-height:1.08;
    }

    .theme-toggle{
        width:44px;
        height:44px;
        border-radius:14px;
    }

    .api-docs-toolbar{
        align-items:flex-start;
        flex-direction:column;
        padding:20px;
    }

    .api-search{
        width:100% !important;
    }

    .stats-grid,
    .wallet-stats{
        grid-template-columns:1fr;
        gap:16px;
    }

    .card{
        border-radius:20px !important;
        overflow-x:auto !important;
    }

    .api-table{
        min-width:720px;
    }

    .modal{
        width:calc(100vw - 28px) !important;
        max-width:calc(100vw - 28px) !important;
        max-height:calc(100vh - 28px) !important;
        border-radius:22px !important;
    }

    .add-btn{
        position:static !important;
        right:auto !important;
        min-width:150px;
    }
}

@media (max-width:640px){
    .login-container{
        min-height:100vh;
        align-items:flex-start;
        padding:18px;
    }

    .login-card{
        width:100% !important;
        max-width:440px;
        padding:32px 22px !important;
        border-radius:20px;
    }

    .logo{
        font-size:clamp(26px,9vw,32px) !important;
        line-height:1.1;
        overflow-wrap:anywhere;
    }

    .logo .brand-logo{
        width:min(250px,78vw) !important;
        max-height:76px !important;
    }

    .logo .auth-brand-icon{
        width:82px !important;
        height:82px !important;
    }

    .subtitle{
        text-align:center;
        margin-bottom:28px;
    }

    .button-row,
    .nav-actions,
    .hero-actions{
        width:100%;
        flex-direction:column;
    }

    .nav-link,
    .nav-button,
    .primary-action,
    .secondary-action{
        width:100%;
    }

    .site-header,
    .hero,
    .bonus-band,
    .feature-band,
    .experience,
    .workflow,
    .final-cta,
    footer{
        width:min(100% - 28px,1180px) !important;
    }

    .site-header{
        align-items:flex-start;
        flex-direction:column;
        padding:16px 0;
    }

    .brand{
        font-size:26px !important;
    }

    .brand .brand-logo{
        width:180px !important;
        max-height:56px !important;
    }

    .hero{
        min-height:auto;
        padding:38px 0 54px;
        gap:28px;
    }

    .hero h1{
        font-size:clamp(40px,14vw,54px) !important;
        line-height:1 !important;
    }

    .hero p,
    .bonus-band p,
    .experience-copy p,
    .final-cta p{
        font-size:16px !important;
        line-height:1.62;
    }

    .eyebrow{
        width:100%;
        border-radius:16px;
        line-height:1.35;
    }

    .console-preview,
    .bonus-band,
    .feature-band article,
    .experience,
    .workflow,
    .final-cta,
    .api-picker,
    .page-form-card,
    .result-panel,
    .selected-api-panel{
        border-radius:20px !important;
    }

    .bonus-band,
    .experience,
    .workflow,
    .final-cta,
    .api-picker,
    .page-form-card,
    .result-panel{
        padding:18px !important;
    }

    .preview-grid,
    .dynamic-fields,
    .result-grid,
    .flexible-field-row,
    .result-item{
        grid-template-columns:1fr !important;
    }

    .preview-result div,
    .wallet-hero,
    .page-form-header,
    .result-header{
        align-items:flex-start;
        flex-direction:column;
    }

    .preview-result strong{
        text-align:left;
    }

    .api-drawer-header{
        align-items:flex-start !important;
        flex-direction:column !important;
    }

    .api-drawer-body,
    .api-drawer.drawer-open .api-drawer-body{
        padding-left:18px !important;
        padding-right:18px !important;
    }

    .doc-block pre{
        font-size:12px;
    }

    .topbar{
        flex-direction:column;
    }

    .add-btn,
    .recharge-btn,
    .save-btn,
    .check-btn,
    .try-btn,
    .chatgpt-btn{
        width:100% !important;
        justify-content:center;
    }

    .chatgpt-btn{
        margin-left:0;
        margin-top:12px;
    }

    .modal-header{
        padding:22px 20px !important;
    }

    .modal-header h2{
        font-size:24px !important;
    }

    .modal-body{
        padding:22px 20px 26px !important;
    }

    .advanced-toggle{
        height:auto !important;
        min-height:58px;
        gap:16px;
    }

    .advanced-left{
        min-width:0;
        line-height:1.35;
    }

    .bonus-popup{
        padding:26px 20px;
    }

    footer{
        gap:12px;
        align-items:flex-start;
        flex-direction:column;
        padding:20px 0;
    }
}

@media (max-width:420px){
    .main-content{
        padding:22px 14px !important;
    }

    .login-card{
        padding:28px 18px !important;
    }

    .logo{
        font-size:26px !important;
    }

    .hero h1{
        font-size:38px !important;
    }

    .stat-box,
    .wallet-stat-card,
    .api-drawer-header,
    .api-drawer-body,
    .card,
    .wallet-hero{
        padding-left:16px !important;
        padding-right:16px !important;
    }

    .api-table{
        min-width:640px;
    }

    .modal{
        width:calc(100vw - 18px) !important;
        max-width:calc(100vw - 18px) !important;
    }
}

@media (max-width:900px){
    .sidebar{
        position:fixed !important;
        top:auto !important;
        right:12px;
        bottom:12px;
        left:12px;
        width:auto !important;
        min-height:66px;
        max-width:calc(100vw - 24px);
        border:1px solid rgba(148,163,184,0.14) !important;
        border-radius:24px;
        background:rgba(15,23,42,0.86) !important;
        box-shadow:0 22px 60px rgba(0,0,0,0.42);
        backdrop-filter:blur(22px);
    }

    body.light-mode .sidebar{
        background:rgba(255,255,255,0.92) !important;
        border-color:rgba(15,23,42,0.08) !important;
        box-shadow:0 18px 48px rgba(15,23,42,0.16);
    }

    .menu{
        justify-content:space-between;
        overflow-x:auto;
        scrollbar-width:none;
    }

    .menu::-webkit-scrollbar{
        display:none;
    }

    .menu button,
    .sidebar.expanded .menu button,
    .logout-btn,
    .sidebar.expanded .logout-btn{
        width:46px !important;
        height:46px !important;
        min-width:46px;
        flex-basis:46px;
        border-radius:17px !important;
    }

    .brand-icon{
        width:32px !important;
        height:32px !important;
    }

    .main-content{
        min-height:100vh !important;
        padding-bottom:104px !important;
    }

    .topbar,
    .analytics-topbar{
        padding:18px;
        border:1px solid rgba(255,255,255,0.07);
        border-radius:24px;
        background:rgba(15,23,42,0.42);
        box-shadow:0 18px 44px rgba(0,0,0,0.2);
        backdrop-filter:blur(18px);
    }

    body.light-mode .topbar,
    body.light-mode .analytics-topbar{
        background:rgba(255,255,255,0.86);
        border-color:#e2e8f0;
        box-shadow:0 16px 36px rgba(15,23,42,0.08);
    }

    .topbar h1{
        font-size:clamp(28px,7vw,38px) !important;
    }

    .topbar p{
        max-width:52ch;
        font-size:14px;
        line-height:1.55;
    }

    .glass-card,
    .api-docs-toolbar,
    .api-drawer,
    .metric-card,
    .analytics-panel,
    .analytics-controls,
    .wallet-hero,
    .wallet-stat-card,
    .recharge-card,
    .card,
    .page-form-card,
    .result-panel,
    .selected-api-panel{
        border-radius:24px !important;
    }
}

@media (max-width:700px){
    .analytics-controls{
        padding:16px !important;
    }

    .analytics-stats{
        gap:14px !important;
    }

    .metric-card{
        min-height:126px;
        padding:18px !important;
    }

    .metric-card strong{
        font-size:clamp(28px,10vw,36px) !important;
    }

    .analytics-panel{
        padding:18px !important;
    }

    .line-chart{
        min-height:240px !important;
    }

    .line-chart svg{
        height:238px !important;
    }

    .analytics-table-wrap{
        border:1px solid rgba(255,255,255,0.07);
        border-radius:18px;
        background:rgba(2,6,23,0.18);
    }

    body.light-mode .analytics-table-wrap{
        border-color:#e2e8f0;
        background:#f8fafc;
    }
}

@media (max-width:640px){
    body{
        background:
        radial-gradient(circle at 18% 0%,rgba(37,99,235,0.28),transparent 34%),
        radial-gradient(circle at 88% 8%,rgba(34,197,94,0.12),transparent 30%),
        #020617;
    }

    .login-container{
        align-items:center;
        padding:20px 14px;
    }

    .login-card{
        padding:30px 20px !important;
        border-radius:26px !important;
        background:rgba(15,23,42,0.78) !important;
        box-shadow:0 24px 70px rgba(0,0,0,0.42) !important;
    }

    .logo .brand-logo{
        width:min(270px,82vw) !important;
        max-height:82px !important;
    }

    .logo .auth-brand-icon{
        width:84px !important;
        height:84px !important;
    }

    .input-group input,
    .login-btn{
        min-height:52px;
        border-radius:16px;
    }

    .site-header{
        align-items:center !important;
        flex-direction:row !important;
        justify-content:space-between;
        gap:14px;
    }

    .brand .brand-logo{
        width:min(176px,48vw) !important;
    }

    .nav-actions{
        width:auto;
        flex-direction:row;
        gap:8px;
    }

    .nav-link,
    .nav-button{
        width:auto;
        min-height:42px;
        padding:0 14px;
        border-radius:14px;
        font-size:13px;
    }

    .hero{
        padding-top:28px;
    }

    .hero-copy{
        text-align:left;
    }

    .trust-strip{
        align-items:stretch;
        display:grid !important;
        grid-template-columns:1fr;
    }

    .console-preview{
        padding:16px !important;
    }
}

@media (max-width:420px){
    .sidebar{
        right:8px;
        bottom:8px;
        left:8px;
        max-width:calc(100vw - 16px);
        padding:10px !important;
        border-radius:22px;
    }

    .menu{
        gap:8px !important;
    }

    .menu button,
    .sidebar.expanded .menu button,
    .logout-btn,
    .sidebar.expanded .logout-btn{
        width:43px !important;
        height:43px !important;
        min-width:43px;
        flex-basis:43px;
        border-radius:15px !important;
    }

    .main-content{
        padding:18px 12px 96px !important;
    }

    .topbar,
    .analytics-topbar{
        padding:16px;
        border-radius:22px;
    }

    .brand .brand-logo{
        width:min(156px,46vw) !important;
    }

    .nav-link,
    .nav-button{
        padding:0 11px;
    }
}

@media (max-width:640px){
    .site-header{
        width:calc(100% - 28px) !important;
        min-height:72px !important;
        align-items:center !important;
        flex-direction:row !important;
        justify-content:space-between !important;
        padding:12px 0 6px !important;
        gap:8px !important;
    }

    .site-header .brand{
        min-width:0;
        flex:0 1 142px;
    }

    .site-header .brand-logo{
        width:min(142px,38vw) !important;
        max-height:54px !important;
        object-position:left center;
    }

    .site-header .nav-actions{
        width:max-content !important;
        max-width:calc(100% - 150px) !important;
        flex:0 0 auto;
        display:flex !important;
        flex-direction:row !important;
        align-items:center !important;
        gap:8px !important;
        justify-content:flex-end !important;
        padding:0 !important;
        border:none !important;
        background:transparent !important;
        box-shadow:none !important;
        overflow:visible !important;
    }

    .site-header .nav-link{
        width:auto !important;
        min-width:0 !important;
        min-height:38px !important;
        padding:0 6px !important;
        color:#dbeafe !important;
        font-size:14px !important;
        font-weight:800 !important;
        line-height:1 !important;
        white-space:nowrap !important;
    }

    .site-header .nav-button{
        width:auto !important;
        min-width:92px !important;
        min-height:44px !important;
        padding:0 14px !important;
        border-radius:18px !important;
        font-size:15px !important;
        line-height:1 !important;
        white-space:nowrap !important;
        box-shadow:0 12px 30px rgba(37,99,235,0.32) !important;
    }

    .hero{
        width:calc(100% - 28px) !important;
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:24px !important;
        min-height:auto !important;
        padding:30px 0 42px !important;
    }

    .hero-copy{
        width:100%;
    }

    .eyebrow{
        width:100% !important;
        justify-content:center;
        margin-bottom:28px !important;
        padding:13px 16px !important;
        border-radius:22px !important;
        font-size:18px !important;
    }

    .hero h1{
        max-width:11ch;
        margin-bottom:22px !important;
        font-size:clamp(41px,11.7vw,54px) !important;
        line-height:1.05 !important;
    }

    .hero p{
        margin-bottom:30px !important;
        color:#dbeafe !important;
        font-size:18px !important;
        line-height:1.55 !important;
    }

    .hero-actions{
        width:100% !important;
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:14px !important;
    }

    .primary-action,
    .secondary-action{
        min-height:58px !important;
        border-radius:22px !important;
        font-size:21px !important;
    }

    .secondary-action{
        background:rgba(255,255,255,0.055) !important;
        border-color:rgba(219,234,254,0.16) !important;
    }

    .trust-strip{
        display:grid !important;
        grid-template-columns:1fr !important;
        gap:12px !important;
        margin-top:28px !important;
    }

    .trust-strip span{
        min-height:58px;
        display:flex;
        align-items:center;
        padding:0 20px !important;
        border-radius:20px !important;
        font-size:17px !important;
    }

    .console-preview{
        display:block !important;
        width:100% !important;
        max-width:none !important;
        justify-self:stretch !important;
        border-radius:24px !important;
        opacity:1 !important;
        animation:none !important;
        transform:none !important;
    }

    .preview-topbar{
        height:42px !important;
        padding:0 16px !important;
    }

    .preview-grid{
        grid-template-columns:1fr 1fr !important;
        gap:12px !important;
        padding:14px !important;
    }

    .preview-card,
    .preview-result{
        padding:14px !important;
        border-radius:16px !important;
    }

    .preview-card strong{
        font-size:24px !important;
    }

    .preview-card span,
    .preview-result span{
        font-size:12px !important;
    }

    .endpoint-row{
        min-height:46px !important;
        align-items:flex-start !important;
        flex-direction:column !important;
        gap:4px !important;
        padding:10px 12px !important;
    }

    .preview-result div{
        align-items:flex-start !important;
        flex-direction:column !important;
        gap:3px !important;
    }

    .preview-result strong{
        text-align:left !important;
        font-size:13px !important;
    }
}

@media (max-width:380px){
    .site-header .brand-logo{
        width:min(124px,34vw) !important;
    }

    .site-header .nav-link{
        padding:0 4px !important;
        font-size:13px !important;
    }

    .site-header .nav-button{
        min-width:82px !important;
        min-height:42px !important;
        padding:0 11px !important;
        border-radius:16px !important;
        font-size:14px !important;
    }

    .hero h1{
        font-size:39px !important;
    }

    .hero p{
        font-size:18px !important;
    }
}
