/* Demo bar */
.demo-bar{position:sticky;top:0;z-index:100;height:var(--demo-h);display:flex;align-items:center;gap:var(--s-2);padding:0 var(--s-3);background:var(--demo-bar);border-bottom:1px solid var(--line);color:#F3F4F6}
.demo-bar .brand{font:700 13px/1 var(--f-display);letter-spacing:.06em;white-space:nowrap;display:flex;align-items:center;gap:8px}
.demo-bar .brand::before{content:"";width:3px;height:14px;background:var(--red)}
.demo-bar select{min-height:36px;background:#181B20;border:1px solid #2A2F38;border-radius:var(--r-sm);padding:0 8px;color:#F3F4F6;min-width:0;flex:0 1 240px}
.demo-bar .ib{flex:none}
.demo-bar .sp{flex:1}
.demo-bar .ib{width:36px;height:36px;display:grid;place-items:center;border-radius:var(--r-sm);color:#D1D5DB;border:1px solid #2A2F38}
.demo-bar .ib:hover{border-color:var(--red);color:#fff}
.stage{min-height:calc(100vh - var(--demo-h))}
/* Creator: phone frame */
.stage.creator{display:flex;justify-content:center;align-items:flex-start;padding:24px 16px;background:radial-gradient(ellipse at 50% 0,var(--bg-3),var(--bg-0) 70%)}
.phone{width:390px;height:min(820px,calc(100vh - var(--demo-h) - 48px));display:flex;flex-direction:column;background:var(--bg-1);border:1px solid var(--line-focus);border-radius:36px;overflow:hidden;box-shadow:0 24px 60px rgba(0,0,0,.45)}
.phone-top{height:44px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 24px;font:600 12px/1 var(--f-display);color:var(--tx-hi)}
.phone-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:var(--s-4);scrollbar-width:none}
.phone-body::-webkit-scrollbar{display:none}
.tabbar{flex:none;display:flex;border-top:1px solid var(--line);background:var(--bg-2);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.tabbar a{flex:1;min-height:48px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font:600 10px/1 var(--f-display);color:var(--tx-faint);letter-spacing:.04em;text-transform:uppercase;transition:color .15s}
.tabbar a.on{color:var(--red-tx)}
.app-head{display:flex;align-items:center;gap:var(--s-2);margin-bottom:var(--s-4)}
.app-head .back{width:44px;height:44px;margin-left:-10px;display:grid;place-items:center;color:var(--tx-hi)}
@media(max-width:767px){
  .stage.creator{padding:0;background:var(--bg-1)}
  .phone{width:100%;height:calc(100dvh - var(--demo-h));border:0;border-radius:0;box-shadow:none}
  .phone-top{display:none}
  .tabbar{position:sticky;bottom:0}
}
/* Console (Admin, Client, Agency) */
.console{display:grid;grid-template-columns:var(--rail) minmax(0,1fr);min-height:calc(100vh - var(--demo-h))}
.rail{position:sticky;top:var(--demo-h);height:calc(100vh - var(--demo-h));background:var(--bg-1);border-right:1px solid var(--line);display:flex;flex-direction:column;gap:2px;padding:12px 8px;overflow-y:auto;overflow-x:hidden;width:var(--rail);transition:width .25s var(--ease);z-index:50}
.rail:hover,.rail.open{width:var(--drawer)}
.rail a{display:flex;align-items:center;gap:12px;min-height:44px;padding:0 12px;border-radius:var(--r);color:var(--tx-mute);font:600 13px/1 var(--f-display);white-space:nowrap;border-left:2px solid transparent}
.rail a span{opacity:0;transition:opacity .15s}
.rail:hover a span,.rail.open a span{opacity:1}
.rail a:hover{background:var(--bg-3);color:var(--tx-hi)}
.rail a.on{background:var(--bg-3);color:var(--tx-hi);border-left-color:var(--red)}
.console-main{padding:var(--s-8) 40px;min-width:0;max-width:1400px;width:100%}
.page-h{display:flex;justify-content:space-between;align-items:flex-end;gap:var(--s-4);flex-wrap:wrap;margin-bottom:var(--s-6)}
.menu-btn{display:none}
@media(max-width:1279px){.console-main{padding:var(--s-6)}}
@media(max-width:767px){
  .console{grid-template-columns:minmax(0,1fr)}
  .rail{position:fixed;left:0;top:var(--demo-h);bottom:0;height:auto;width:var(--drawer);transform:translateX(-100%);transition:transform .25s var(--ease)}
  .rail span{opacity:1!important}
  .rail.open{transform:none;box-shadow:8px 0 24px rgba(0,0,0,.4)}
  .console-main{padding:var(--s-4)}
  .menu-btn{display:grid}
  .page-h .btn:not(.menu-btn){width:100%}
  .menu-btn{width:44px;padding:0}
  .demo-bar .brand{font-size:0;gap:0}
  .demo-bar .brand::before{height:20px}
  .demo-bar select{flex:1 1 auto}
  .demo-bar .sp{display:none}
}
/* Inside the creator app, stat pairs stay two-up at every width */
.phone-body .g2{grid-template-columns:repeat(2,minmax(0,1fr))}
.phone-body .kpi .v{font-size:24px;line-height:28px}
