/* MeyKey UI migration layer — keeps v3.2.110 DOM/controller contracts intact. */
:root{
  --mk2-ink:#19253b;--mk2-muted:#657187;--mk2-blue:#2356d8;--mk2-navy:#182742;
  --mk2-line:#e4e9f0;--mk2-page:#f5f7fa;--mk2-surface:#ffffff;--mk2-soft:#f8fafc;
  --mk2-success:#287a57;--mk2-warning:#a96d13;--mk2-danger:#b24755;--mk2-shadow:0 18px 45px -35px rgba(28,48,82,.34);
}
html[data-theme="dark"]{
  --mk2-ink:#eef3fb;--mk2-muted:#9aa8bd;--mk2-blue:#8aa8ff;--mk2-navy:#101b2e;
  --mk2-line:#2b3a50;--mk2-page:#0b1422;--mk2-surface:#101b2c;--mk2-soft:#0d1726;
  --mk2-success:#72d4a1;--mk2-warning:#e4b764;--mk2-danger:#ff8a98;--mk2-shadow:0 18px 50px -28px rgba(0,0,0,.68);
}
html{background:var(--mk2-page);color-scheme:light}
html[data-theme="dark"]{color-scheme:dark}
body.meykey-v2{margin:0!important;background:var(--mk2-page)!important;color:var(--mk2-ink)!important;font-family:Manrope,Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;line-height:1.55}
body.meykey-v2 *{box-sizing:border-box}
body.meykey-v2 a{color:inherit}
body.meykey-v2 .mk2-icon{width:20px;height:20px;flex:0 0 20px}
body.mk2-shell-ready>.mk2-legacy-header{display:none!important}

/* Main application shell */
.mk2-workspace{min-height:100vh;background:var(--mk2-page)}
.mk2-sidebar{position:fixed;z-index:80;inset:0 auto 0 0;width:280px;background:var(--mk2-surface);border-right:1px solid var(--mk2-line);padding:18px 14px;display:flex;flex-direction:column;overflow-y:auto;transition:width .2s ease,transform .2s ease}
.mk2-sidebar-head{display:flex;align-items:center;gap:8px;min-height:54px;padding:0 4px 12px}
.mk2-brand{display:flex;align-items:center;gap:9px;min-width:0;flex:1;text-decoration:none;font-size:22px;font-weight:800;letter-spacing:-.7px;color:var(--mk2-ink)}
.mk2-brand>strong>span{color:var(--mk2-blue)}
.mk2-brand-logo{position:relative;width:42px;height:42px;flex:0 0 42px;display:block}
.mk2-brand-logo img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;border-radius:9px}
.mk2-logo-dark{display:none}.mk2-logo-light{display:block}
html[data-theme="dark"] .mk2-logo-light{display:none}html[data-theme="dark"] .mk2-logo-dark{display:block}
.mk2-collapse,.mk2-mobile-menu,.mk2-theme{appearance:none;border:1px solid var(--mk2-line);background:var(--mk2-surface);color:var(--mk2-ink);display:grid;place-items:center;border-radius:8px;cursor:pointer}
.mk2-collapse{width:34px;height:34px;flex:0 0 34px}.mk2-mobile-menu,.mk2-theme{width:40px;height:40px}
.mk2-collapse:hover,.mk2-mobile-menu:hover,.mk2-theme:hover{background:var(--mk2-soft);border-color:#b8c5d8}
html[data-theme="dark"] .mk2-collapse:hover,html[data-theme="dark"] .mk2-mobile-menu:hover,html[data-theme="dark"] .mk2-theme:hover{border-color:#475a74}
.mk2-profile{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:2px 4px 14px;padding:16px 6px;border-top:1px solid var(--mk2-line);border-bottom:1px solid var(--mk2-line)}
.mk2-profile-text{min-width:0;display:grid;gap:1px}.mk2-profile-text small{font-size:10px;font-weight:800;letter-spacing:.13em;color:var(--mk2-muted)}.mk2-profile-text strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mk2-profile-email{font-size:11px;color:var(--mk2-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:155px}
.mk2-profile-slot{display:flex;align-items:center;gap:7px;flex:0 0 auto}
.mk2-nav{display:block}.mk2-nav-group{margin:0 0 17px}.mk2-nav-group>p{margin:0 0 6px;padding:0 10px;color:var(--mk2-muted);font-size:10px;letter-spacing:.13em;font-weight:800}
.mk2-nav-group>a{display:flex;align-items:center;gap:11px;min-height:42px;padding:9px 11px;border-radius:8px;text-decoration:none;color:var(--mk2-muted);font-size:13px;font-weight:680;transition:background .13s,color .13s}
.mk2-nav-group>a:hover{background:var(--mk2-soft);color:var(--mk2-ink)}.mk2-nav-group>a.active{background:#eaf0ff;color:#264fbb}html[data-theme="dark"] .mk2-nav-group>a.active{background:#182a49;color:#a8c0ff}
.mk2-sidebar-bottom{margin-top:auto;padding:14px 10px 2px;border-top:1px solid var(--mk2-line)}.mk2-sidebar-bottom a{font-size:12px;color:var(--mk2-muted);text-decoration:none}.mk2-sidebar-bottom a:hover{color:var(--mk2-blue)}
.mk2-content{margin-left:280px;min-height:100vh;display:flex;flex-direction:column;transition:margin-left .2s ease}
.mk2-topbar{height:72px;position:sticky;top:0;z-index:60;background:color-mix(in srgb,var(--mk2-page) 90%,transparent);backdrop-filter:blur(12px);border-bottom:1px solid var(--mk2-line);padding:0 34px;display:flex;align-items:center;gap:14px}
.mk2-mobile-menu{display:none}.mk2-page-context{display:grid;gap:1px}.mk2-page-context small{font-size:10px;font-weight:800;letter-spacing:.14em;color:var(--mk2-blue)}.mk2-page-context strong{font-size:15px}.mk2-top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.mk2-main-slot{flex:1;min-width:0}.mk2-footer{display:flex;justify-content:space-between;gap:20px;padding:22px 36px;color:var(--mk2-muted);font-size:11px;border-top:1px solid var(--mk2-line)}
.mk2-overlay{display:none}
body.mk2-collapsed .mk2-sidebar{width:78px;padding-inline:10px}body.mk2-collapsed .mk2-content{margin-left:78px}body.mk2-collapsed .mk2-brand strong,body.mk2-collapsed .mk2-profile-text,body.mk2-collapsed .mk2-nav-group>p,body.mk2-collapsed .mk2-nav-group>a span,body.mk2-collapsed .mk2-sidebar-bottom{display:none}body.mk2-collapsed .mk2-sidebar-head{justify-content:center;flex-wrap:wrap}body.mk2-collapsed .mk2-brand{flex:0 0 auto}body.mk2-collapsed .mk2-brand-logo{width:40px;height:40px;flex-basis:40px}body.mk2-collapsed .mk2-profile{justify-content:center;padding:12px 0}body.mk2-collapsed .mk2-nav-group>a{justify-content:center;padding-inline:0}

/* Preserve profile/notification functionality while matching the new shell. */
body.meykey-v2 .profile-shell{position:relative!important;display:block!important}
body.meykey-v2 .profile-button{width:38px!important;height:38px!important;border-radius:10px!important;border:1px solid var(--mk2-line)!important;background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;padding:0!important}
body.meykey-v2 .profile-avatar{width:100%!important;height:100%!important;border-radius:9px!important;display:grid!important;place-items:center!important;font-size:12px!important;font-weight:800!important;color:var(--mk2-ink)!important;background:transparent!important}
body.meykey-v2 .profile-avatar img{width:100%;height:100%;object-fit:cover;border-radius:9px}
body.meykey-v2 .profile-menu{right:0!important;left:auto!important;top:46px!important;min-width:225px!important;border:1px solid var(--mk2-line)!important;background:var(--mk2-surface)!important;color:var(--mk2-ink)!important;box-shadow:var(--mk2-shadow)!important;border-radius:12px!important;padding:8px!important;z-index:300!important}
body.meykey-v2 .profile-menu a,body.meykey-v2 .profile-menu button{color:var(--mk2-ink)!important;background:transparent!important;border:0!important;border-radius:7px!important;padding:9px 10px!important}
body.meykey-v2 .profile-menu a:hover,body.meykey-v2 .profile-menu button:hover{background:var(--mk2-soft)!important}
body.meykey-v2 .profile-menu-head{color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}
body.meykey-v2 .profile-menu-head span{color:var(--mk2-muted)!important}
body.meykey-v2 .mk-notify-button{width:38px!important;height:38px!important;border-radius:10px!important;background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .mk-notify-panel{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;box-shadow:var(--mk2-shadow)!important}
body.meykey-v2 .mk-notify-item{background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}.mk2-profile-slot>.mk-notify-shell{position:relative!important}

/* Existing functional page contents */
body.mk2-shell-ready .account-page,body.mk2-shell-ready .simple-page{min-height:0!important;background:transparent!important;padding:32px 34px 56px!important;margin:0!important}
body.mk2-shell-ready .account-wrap{width:min(1240px,100%)!important;max-width:1240px!important;margin:0 auto!important;padding:0!important}
body.mk2-shell-ready .account-wrap.core-wide{max-width:1380px!important}
body.meykey-v2 .account-head{display:flex!important;align-items:flex-end!important;justify-content:space-between!important;gap:22px!important;margin:0 0 24px!important;padding:0!important;border:0!important}
body.meykey-v2 .account-head h1{margin:0!important;color:var(--mk2-ink)!important;font-size:clamp(30px,4vw,44px)!important;letter-spacing:-.04em!important;line-height:1.05!important;font-weight:780!important}
body.meykey-v2 .account-head p,body.meykey-v2 .core-muted,body.meykey-v2 .core-copy{color:var(--mk2-muted)!important}
body.meykey-v2 h1,body.meykey-v2 h2,body.meykey-v2 h3,body.meykey-v2 strong{color:var(--mk2-ink)}
body.meykey-v2 .panel,body.meykey-v2 .core-panel,body.meykey-v2 .video-panel,body.meykey-v2 .provider-info-catalog,body.meykey-v2 .provider-info-detail{background:var(--mk2-surface)!important;border:1px solid var(--mk2-line)!important;border-radius:13px!important;box-shadow:none!important;color:var(--mk2-ink)!important}
body.meykey-v2 .panel{padding:24px!important}
body.meykey-v2 .core-section-gap{margin-top:20px!important}
body.meykey-v2 .core-divider{border-color:var(--mk2-line)!important}
body.meykey-v2 .dashboard-overview-grid,body.meykey-v2 .api-summary-grid{gap:14px!important}
body.meykey-v2 .api-summary-grid .panel,body.meykey-v2 .dashboard-summary-grid .panel{min-height:120px!important;display:flex!important;flex-direction:column!important;justify-content:center!important}
body.meykey-v2 .api-summary-grid .panel>span,body.meykey-v2 .dashboard-summary-grid .panel>span{color:var(--mk2-muted)!important;font-size:12px!important}
body.meykey-v2 .api-summary-grid .panel>strong,body.meykey-v2 .dashboard-summary-grid .panel>strong{font-size:26px!important;letter-spacing:-.03em!important;margin-top:7px!important}
body.meykey-v2 .balance-mini{color:var(--mk2-ink)!important;font-size:30px!important}

/* Controls */
body.meykey-v2 .btn,body.meykey-v2 button.btn,body.meykey-v2 a.btn{min-height:38px!important;border-radius:8px!important;font-weight:700!important;font-size:13px!important;padding:9px 14px!important;box-shadow:none!important;text-decoration:none!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important}
body.meykey-v2 .btn-primary,body.meykey-v2 .btn.btn-primary{background:var(--mk2-blue)!important;border:1px solid var(--mk2-blue)!important;color:#fff!important}
body.meykey-v2 .btn-primary:hover,body.meykey-v2 .btn.btn-primary:hover{filter:brightness(.94)}
body.meykey-v2 .btn-ghost,body.meykey-v2 .btn.btn-ghost{background:var(--mk2-surface)!important;border:1px solid var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .btn-ghost:hover{background:var(--mk2-soft)!important}
body.meykey-v2 input,body.meykey-v2 select,body.meykey-v2 textarea{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border:1px solid var(--mk2-line)!important;border-radius:8px!important;box-shadow:none!important;outline:none!important}
body.meykey-v2 input,body.meykey-v2 select{min-height:42px!important;padding:8px 11px!important}body.meykey-v2 textarea{padding:11px!important}
body.meykey-v2 input:focus,body.meykey-v2 select:focus,body.meykey-v2 textarea:focus{border-color:#7190e8!important;box-shadow:0 0 0 3px rgba(65,97,202,.10)!important}
body.meykey-v2 label,body.meykey-v2 .field label{color:var(--mk2-ink)!important;font-weight:650!important}
body.meykey-v2 .form-message,body.meykey-v2 .core-message{color:var(--mk2-danger)!important}
body.meykey-v2 .account-notice{border-radius:8px!important}

/* Tables and list-heavy admin pages */
body.meykey-v2 .table-wrap,body.meykey-v2 .model-catalog-table-wrap,body.meykey-v2 .provider-info-catalog-wrap{border:1px solid var(--mk2-line)!important;border-radius:10px!important;overflow:auto!important;background:var(--mk2-surface)!important}
body.meykey-v2 table{width:100%;border-collapse:collapse!important;color:var(--mk2-ink)!important;background:transparent!important}
body.meykey-v2 th{background:var(--mk2-soft)!important;color:var(--mk2-muted)!important;font-size:10px!important;text-transform:uppercase!important;letter-spacing:.06em!important;font-weight:800!important;border-color:var(--mk2-line)!important;padding:11px 13px!important}
body.meykey-v2 td{color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important;padding:12px 13px!important;background:transparent!important}
body.meykey-v2 tbody tr:hover td{background:color-mix(in srgb,var(--mk2-soft) 80%,transparent)!important}
body.meykey-v2 .badge,body.meykey-v2 .status-pill,body.meykey-v2 .core-badge{border-radius:999px!important;font-size:11px!important}
body.meykey-v2 .tier-tabs,body.meykey-v2 .model-catalog-tabs{gap:7px!important;border:0!important;background:transparent!important;margin-bottom:14px!important}
body.meykey-v2 .tier-tabs button,body.meykey-v2 .tier-tabs a{border:1px solid var(--mk2-line)!important;background:var(--mk2-surface)!important;color:var(--mk2-muted)!important;border-radius:8px!important;padding:8px 12px!important}.tier-tabs .active{color:var(--mk2-blue)!important;border-color:#b9c8ed!important;background:#eef3ff!important}
html[data-theme="dark"] body.meykey-v2 .tier-tabs .active{background:#192946!important;border-color:#3c578a!important}

/* Charts / histories */
body.meykey-v2 .api-chart{background:var(--mk2-soft)!important;border:1px solid var(--mk2-line)!important;border-radius:10px!important;padding:14px!important}
body.meykey-v2 .api-chart-bar,body.meykey-v2 .chart-bar{background:var(--mk2-blue)!important}
body.meykey-v2 .api-history>*,body.meykey-v2 .api-breakdown>*,body.meykey-v2 .video-ledger-list-v3296>*{border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}

/* Model catalog keeps production capability/availability DOM but uses the new visual system. */
body.meykey-v2 .model-catalog-panel{padding:0!important;overflow:hidden!important}
body.meykey-v2 .model-catalog-summary{padding:18px 20px!important;border-bottom:1px solid var(--mk2-line)!important}
body.meykey-v2 .model-catalog-refreshbar-v3251{display:flex!important;align-items:center!important;gap:10px!important;margin-top:12px!important}
body.meykey-v2 .model-catalog-refreshbtn-v3251{border:1px solid var(--mk2-line)!important;background:var(--mk2-surface)!important;color:var(--mk2-ink)!important;border-radius:8px!important;padding:8px 12px!important}
body.meykey-v2 .model-health-number-v32109{color:var(--mk2-ink)!important}

/* Custom Router, Video AI, Files and other rich old modules. Layout remains controller-compatible. */
body.meykey-v2 .custom-router-page *,body.meykey-v2 [data-custom-router],body.meykey-v2 .video-ai-page *,body.meykey-v2 .video-professional-page *{border-color:var(--mk2-line)}
body.meykey-v2 .router-card,body.meykey-v2 .routing-card,body.meykey-v2 .custom-router-card,body.meykey-v2 .video-card,body.meykey-v2 .media-card,body.meykey-v2 .file-card{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;border-radius:11px!important}
body.meykey-v2 .files-grid .card,body.meykey-v2 #filesGrid .card{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;border-radius:12px!important}
body.meykey-v2 .preview{background:var(--mk2-soft)!important}

/* Provider admin has a dedicated legacy stylesheet; these final overrides retain its layout but migrate its palette. */
body.meykey-v2 .provider-info-page-head,body.meykey-v2 .provider-info-source-section,body.meykey-v2 .provider-info-workspace{color:var(--mk2-ink)!important}
body.meykey-v2 .provider-info-input,body.meykey-v2 .provider-info-search{background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .provider-info-offer-header,body.meykey-v2 .provider-info-offer-rows>*{border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .provider-info-empty-detail{color:var(--mk2-muted)!important}

/* Authentication / verification pages: same user's final visual language, old IDs + controllers untouched. */
body.mk2-auth-page{min-height:100vh!important;background:var(--mk2-page)!important;padding:20px!important}
body.mk2-auth-page .site-header{width:min(1240px,100%)!important;height:64px!important;margin:0 auto!important;border:0!important;background:transparent!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:space-between!important}
body.mk2-auth-page .site-header .brand{font-size:23px!important;color:var(--mk2-ink)!important}
body.mk2-auth-page .site-header .brand img{width:40px!important;height:40px!important;object-fit:contain!important}
body.mk2-auth-page .nav-actions{display:flex!important;align-items:center!important;gap:8px!important}
body.mk2-auth-page .simple-page{min-height:calc(100vh - 90px)!important;display:grid!important;place-items:center!important;background:transparent!important;padding:26px 0 44px!important}
body.mk2-auth-page .auth-shell{width:min(1160px,100%)!important;min-height:650px!important;display:grid!important;grid-template-columns:1fr 1fr!important;border:1px solid var(--mk2-line)!important;border-radius:26px!important;overflow:hidden!important;background:var(--mk2-surface)!important;box-shadow:var(--mk2-shadow)!important;padding:0!important;margin:0!important}
body.mk2-auth-page .auth-art{padding:68px 62px 54px!important;background:linear-gradient(145deg,#203459,#14233d)!important;color:#f7f9ff!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important}
body.mk2-auth-page .auth-art h1{font-size:clamp(46px,5vw,68px)!important;line-height:1.03!important;letter-spacing:-.05em!important;color:#fff!important;margin:0 0 24px!important}
body.mk2-auth-page .auth-art p{color:#c5d4ed!important;font-size:18px!important;line-height:1.55!important}
body.mk2-auth-page section.auth-form{display:flex!important;flex-direction:column!important;justify-content:center!important;padding:58px 62px!important;background:var(--mk2-surface)!important;color:var(--mk2-ink)!important}
body.mk2-auth-page section.auth-form h2{font-size:40px!important;letter-spacing:-.04em!important;margin:0 0 10px!important;color:var(--mk2-ink)!important}
body.mk2-auth-page section.auth-form>p{color:var(--mk2-muted)!important;margin:0 0 28px!important}
body.mk2-auth-page section.auth-form form{display:grid!important;gap:17px!important}
body.mk2-auth-page .field{display:grid!important;gap:7px!important}
body.mk2-auth-page .field input{min-height:52px!important}
body.mk2-auth-page .google-btn{min-height:50px!important;border:1px solid var(--mk2-line)!important;background:var(--mk2-surface)!important;color:var(--mk2-ink)!important;border-radius:8px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:10px!important;text-decoration:none!important}
body.mk2-auth-page .auth-switch{color:var(--mk2-muted)!important;text-align:center!important;margin-top:24px!important}.auth-switch a{color:var(--mk2-blue)!important;font-weight:800!important}
body.mk2-auth-page .verify-card{width:min(560px,100%)!important;background:var(--mk2-surface)!important;color:var(--mk2-ink)!important;border:1px solid var(--mk2-line)!important;border-radius:20px!important;padding:36px!important;box-shadow:var(--mk2-shadow)!important;text-align:center!important}
body.mk2-auth-page .verify-card p{color:var(--mk2-muted)!important}
/* User 2FA page has strong inline legacy CSS; migrate only its palette while preserving form contract. */
body.mk2-auth-page.u2fa-page{display:grid!important;place-items:center!important;background:var(--mk2-page)!important;padding:28px!important}
body.mk2-auth-page .u2fa-card{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;box-shadow:var(--mk2-shadow)!important}.u2fa-card p,.u2fa-help{color:var(--mk2-muted)!important}.u2fa-brand{color:var(--mk2-ink)!important}.u2fa-field input{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}

/* Admin logout button is moved into the sidebar profile area but its original JS listener stays intact. */
body.meykey-v2 .mk2-logout{min-width:0!important;width:38px!important;height:38px!important;padding:0!important;font-size:0!important;border-radius:10px!important}
body.meykey-v2 .mk2-logout:after{content:'↪';font-size:18px;line-height:1;color:#fff}

@media(max-width:1000px){
  .mk2-sidebar{width:230px}.mk2-content{margin-left:230px}.mk2-brand{font-size:19px}.mk2-brand-logo{width:38px;height:38px;flex-basis:38px}.mk2-topbar{padding-inline:24px}
  body.mk2-collapsed .mk2-sidebar{width:72px}body.mk2-collapsed .mk2-content{margin-left:72px}
}
@media(max-width:760px){
  .mk2-sidebar{width:min(290px,86vw);transform:translateX(-102%);box-shadow:0 20px 60px rgba(0,0,0,.2)}.mk2-content{margin-left:0}.mk2-collapse{display:none}.mk2-mobile-menu{display:grid}.mk2-topbar{height:64px;padding-inline:16px}.mk2-footer{padding-inline:18px;flex-direction:column;gap:4px}.mk2-overlay{display:block;position:fixed;z-index:70;inset:0;border:0;background:rgba(10,20,35,.38);opacity:0;pointer-events:none;transition:opacity .2s}.mk2-menu-open .mk2-sidebar{transform:translateX(0)}.mk2-menu-open .mk2-overlay{opacity:1;pointer-events:auto}
  body.mk2-shell-ready .account-page,body.mk2-shell-ready .simple-page{padding:22px 14px 42px!important}.account-head{align-items:flex-start!important;flex-direction:column!important}.mk2-profile-email{max-width:130px}
  body.mk2-auth-page{padding:14px!important}body.mk2-auth-page .auth-shell{grid-template-columns:1fr!important;min-height:auto!important}body.mk2-auth-page .auth-art{min-height:220px!important;padding:34px 30px!important}body.mk2-auth-page .auth-art h1{font-size:40px!important}body.mk2-auth-page section.auth-form{padding:38px 28px!important}body.mk2-auth-page section.auth-form h2{font-size:34px!important}
}
@media(max-width:520px){
  .mk2-page-context small{display:none}.mk2-page-context strong{font-size:13px}.mk2-topbar{gap:9px}.mk2-theme{width:36px;height:36px}.mk2-footer span:last-child{display:none}
  body.meykey-v2 .panel{padding:18px!important}body.meykey-v2 .account-head h1{font-size:31px!important}
}

/* Rich production modules — palette migration only, no DOM/ID changes. */
body.meykey-v2 .cr-wrap{max-width:1380px!important;margin:0 auto!important;padding:0!important}
body.meykey-v2 .cr-head{margin-bottom:22px!important}.cr-head h1{color:var(--mk2-ink)!important}.cr-muted,.cr-tier-line,.cr-details-title span,.cr-field-label,.cr-score-help,.cr-pool-note,.cr-custom-cell small{color:var(--mk2-muted)!important}
body.meykey-v2 .cr-card,body.meykey-v2 .cr-metric,body.meykey-v2 .cr-token-top,body.meykey-v2 .cr-details,body.meykey-v2 .cr-score-line,body.meykey-v2 .cr-settings-strip,body.meykey-v2 .cr-inspector-config,body.meykey-v2 .cr-custom-row,body.meykey-v2 .cr-actions,body.meykey-v2 .cr-image-status{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;box-shadow:none!important}
body.meykey-v2 .cr-details summary:after{background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .cr-input,body.meykey-v2 .cr-select,body.meykey-v2 .cr-field input,body.meykey-v2 .cr-field select{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important;border-radius:8px!important}
body.meykey-v2 .cr-custom-cell{color:var(--mk2-ink)!important}.cr-divider{background:var(--mk2-line)!important}.cr-summary-option{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}

body.meykey-v2 .video-ai-shell,body.meykey-v2 .video-ai-page{background:transparent!important;color:var(--mk2-ink)!important}
body.meykey-v2 .video-ai-panel,body.meykey-v2 .video-price-card-v3291,body.meykey-v2 .video-ai-runtime-message,body.meykey-v2 .video-library,body.meykey-v2 .video-empty{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;box-shadow:none!important}
body.meykey-v2 .video-ai-label,body.meykey-v2 .video-ai-heading p,body.meykey-v2 .video-empty p{color:var(--mk2-muted)!important}
body.meykey-v2 .video-ai-select,body.meykey-v2 .video-ai-prompt{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}
body.meykey-v2 .video-generate{background:var(--mk2-blue)!important;color:#fff!important;border-color:var(--mk2-blue)!important}

body.meykey-v2 .gw-card,body.meykey-v2 .gw-model-card,body.meykey-v2 .gw-route-row,body.meykey-v2 .gw-public-row,body.meykey-v2 .gw-kpi>div,body.meykey-v2 .gw-image-row,body.meykey-v2 .gw-image-empty,body.meykey-v2 .gw-api-chip,body.meykey-v2 .gw-add-api{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .gw-input{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}.gw-divider{background:var(--mk2-line)!important}.gw-note,.gw-status,.gw-image-caption,.gw-image-count,.gw-image-public-id,.gw-pagination-left,.gw-model-summary span{color:var(--mk2-muted)!important}.gw-public-badge,.gw-image-badge{background:var(--mk2-soft)!important;color:var(--mk2-ink)!important;border-color:var(--mk2-line)!important}

body.meykey-v2 .fm-grid>* ,body.meykey-v2 .fm-kpi>* ,body.meykey-v2 .fm-note{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .finance-summary>*,body.meykey-v2 .core-health-grid>*{background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .payment-settings-grid>*,body.meykey-v2 .payment-add-row{border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}

body.meykey-v2 .meyvideo-infra-v3290,body.meykey-v2 .meyvideo-metrics>*,body.meykey-v2 .meyvideo-node-list>*{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.meykey-v2 .meyvideo-infra-v3290 p,body.meykey-v2 .meyvideo-node-empty,body.meykey-v2 .meyvideo-notice{color:var(--mk2-muted)!important}

/* Old inline dark helper text is deliberately normalized under the new theme. */
body.meykey-v2 [style*="color:#9eb0ca"],body.meykey-v2 [style*="color: #9eb0ca"],body.meykey-v2 [style*="color:#9fb0c7"],body.meykey-v2 [style*="color:#8fa2bd"],body.meykey-v2 [style*="color:#b7c4d8"]{color:var(--mk2-muted)!important}
body.meykey-v2 [style*="color:#f4f7ff"],body.meykey-v2 [style*="color:#fff"],body.meykey-v2 [style*="color: #fff"]{color:var(--mk2-ink)!important}
body.meykey-v2 pre{background:var(--mk2-soft)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.mk2-shell-ready .mk2-main-slot>.wrap{width:min(1240px,100%)!important;max-width:1240px!important;margin:0 auto!important;padding:32px 34px 56px!important}
body.mk2-shell-ready .mk2-main-slot>.wrap>.top{display:none!important}
body.mk2-shell-ready .mk2-main-slot>.wrap>.hero{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important;box-shadow:none!important}
body.mk2-shell-ready .mk2-main-slot>.wrap>.hero p{color:var(--mk2-muted)!important}
body.mk2-shell-ready .mk2-main-slot>.wrap .tab{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-muted)!important}
body.mk2-shell-ready .mk2-main-slot>.wrap .tab.active{background:#eef3ff!important;border-color:#b9c8ed!important;color:var(--mk2-blue)!important}
html[data-theme="dark"] body.mk2-shell-ready .mk2-main-slot>.wrap .tab.active{background:#182a49!important;border-color:#3c578a!important}
body.mk2-shell-ready .mk2-main-slot>.wrap .card{background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.mk2-shell-ready .mk2-main-slot>.wrap .small,body.mk2-shell-ready .mk2-main-slot>.wrap .empty,body.mk2-shell-ready .mk2-main-slot>.wrap .status{color:var(--mk2-muted)!important}

/* Docs keeps its own internal docs sidebar/content, but the outer MeyKey shell becomes the primary application navigation. */
body.mk2-shell-ready .docs-shell{min-height:0!important;background:transparent!important;color:var(--mk2-ink)!important}
body.mk2-shell-ready .docs-shell .sidebar{position:sticky!important;top:90px!important;height:max-content!important;background:var(--mk2-surface)!important;border-color:var(--mk2-line)!important;color:var(--mk2-ink)!important}
body.mk2-shell-ready .docs-shell .content{background:transparent!important;color:var(--mk2-ink)!important}
body.mk2-shell-ready .docs-shell .doc-section,body.mk2-shell-ready .docs-shell pre,body.mk2-shell-ready .docs-shell .flow-card,body.mk2-shell-ready .docs-shell .callout{border-color:var(--mk2-line)!important}
@media(max-width:760px){body.mk2-shell-ready .mk2-main-slot>.wrap{padding:22px 14px 42px!important}body.mk2-shell-ready .docs-shell .sidebar{position:static!important}}

/* MeyKey UI layout R3 — approved Parts 1–4 only. */
/* Part 1: Admin logout lives by itself at the bottom, directly above Beranda MeyKey. */
body.mk2-admin .mk2-sidebar-bottom{display:grid;gap:11px}
body.mk2-admin .mk2-sidebar-bottom-actions{display:grid;gap:8px}
body.mk2-admin .mk2-logout-bottom{width:100%!important;height:40px!important;padding:0 12px!important;font-size:12px!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;border-radius:9px!important}
body.mk2-admin .mk2-logout-bottom:after{content:'Keluar  ↪';font-size:12px;line-height:1;font-weight:800;color:#fff}

/* Part 1: Info Provider gets the width it needs; visual language stays unchanged. */
body.mk2-provider-page .account-page{padding-left:24px!important;padding-right:24px!important}
body.mk2-provider-page .account-wrap.core-wide{width:min(1680px,100%)!important;max-width:1680px!important}
body.mk2-provider-page .provider-info-workspace{grid-template-columns:minmax(330px,.56fr) minmax(0,1.44fr)!important;gap:12px!important}
body.mk2-provider-page .provider-info-detail{overflow:visible!important}
@media(max-width:1280px){body.mk2-provider-page .provider-info-workspace{grid-template-columns:minmax(310px,.52fr) minmax(0,1.48fr)!important}}
@media(max-width:1080px){body.mk2-provider-page .provider-info-workspace{grid-template-columns:1fr!important}body.mk2-provider-page .provider-info-detail{position:static!important}}

/* Part 2: Per-user request pagination, placed above the cost/right side of the table. */
body.meykey-v2 .au-request-pagination-r3{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;margin:0 0 9px auto;min-height:34px}
body.meykey-v2 .au-request-pagination-r3 button{appearance:none;min-width:34px;height:34px;padding:0 9px;border:1px solid var(--mk2-line);border-radius:8px;background:var(--mk2-surface);color:var(--mk2-ink);font:inherit;font-size:11px;font-weight:750;cursor:pointer}
body.meykey-v2 .au-request-pagination-r3 button:hover:not(:disabled){background:var(--mk2-soft);border-color:#668ef4}
body.meykey-v2 .au-request-pagination-r3 button.active{background:var(--mk2-blue);border-color:var(--mk2-blue);color:#fff;cursor:default}
body.meykey-v2 .au-request-pagination-r3 button:disabled{opacity:.48;cursor:default}
body.meykey-v2 .au-request-pagination-r3 .nav{padding-inline:11px}
body.meykey-v2 .au-request-pagination-status-r3{font-size:11px;color:var(--mk2-muted);margin-right:4px}

/* Part 3: keep the user avatar and notification control intact in collapsed mode. */
body.mk2-user.mk2-collapsed .mk2-profile-slot{flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:7px!important}
body.mk2-user.mk2-collapsed .mk2-profile-slot>.profile-shell,
body.mk2-user.mk2-collapsed .mk2-profile-slot>.mk-notify-shell{flex:0 0 auto!important;width:38px!important;height:38px!important}
body.mk2-user.mk2-collapsed .profile-button,
body.mk2-user.mk2-collapsed .mk-notify-button{width:38px!important;height:38px!important;min-width:38px!important}

/* Part 3: button only. Live Chat behavior intentionally comes in a later release. */
.mk2-live-chat{appearance:none;height:40px;padding:0 14px;border:1px solid var(--mk2-line);background:var(--mk2-surface);color:var(--mk2-ink);border-radius:8px;font:inherit;font-size:12px;font-weight:780;cursor:pointer;white-space:nowrap}
.mk2-live-chat:hover{background:var(--mk2-soft);border-color:#b8c5d8}
html[data-theme="dark"] .mk2-live-chat:hover{border-color:#475a74}
@media(max-width:520px){.mk2-live-chat{height:36px;padding:0 10px;font-size:11px}}

/* Part 4: one unified user catalog; the legacy tier tabs/panel stay hidden, controllers stay intact. */
body.meykey-v2 .user-model-catalog #tierTabs,
body.meykey-v2 .user-model-catalog .model-catalog-panel{display:none!important}
body.meykey-v2 .model-unified-section-r3{margin-top:0!important}
body.meykey-v2 .model-unified-count-r3{font-size:12px;color:var(--mk2-muted);font-weight:700;white-space:nowrap}
body.mk2-admin.mk2-collapsed .mk2-sidebar-bottom{display:grid!important;place-items:center;padding:14px 0 2px!important}
body.mk2-admin.mk2-collapsed .mk2-sidebar-bottom>a{display:none!important}
body.mk2-admin.mk2-collapsed .mk2-logout-bottom{width:38px!important;height:38px!important;padding:0!important;font-size:0!important}
body.mk2-admin.mk2-collapsed .mk2-logout-bottom:after{content:'↪';font-size:18px}
