/* XinXin Aurora 12.5.0 — unified responsive system.
   This file is loaded LAST to avoid increasing legacy !important cascade debt.
   Narrow layouts are an actual composition, not scaled-down desktop columns. */

/* Unified surfaces, typography and spacing for the public-facing app. */
body.public-surface{
  --aurora-primary:#5267dc; --aurora-ink:#233251; --aurora-muted:#65768f;
  --aurora-border:#e4e9f2; --aurora-paper:#fff;
  background:#f5f7fc;
}
body.public-surface .app-mesh {opacity:.24}
body.public-surface .app-frame {width:100%;max-width:1520px}
body.public-surface :is(.user-page-content,.user-console-shell,.key-workspace-grid,.key-workspace-grid>*,.module-section,.card,.chart-card,.model-public-grid,.home-pool-grid){min-width:0;max-width:100%}
body.public-surface :is(.user-page-content,.card,.module-card,.metric-card,.home-pool-card,.public-model-card) {box-sizing:border-box}
body.public-surface :is(.user-page-content,.module-section,.chart-card) :is(pre,code){max-width:100%;overflow-wrap:anywhere}
body.public-surface .mobile-top-balance{display:none}

/* Desktop: less inflated header, coherent elevation, readable data cards. */
@media (min-width:821px){
  body.public-surface.ui-desktop .user-hero-v7 {grid-template-columns:minmax(0,1.4fr) minmax(300px,.8fr);align-items:center;gap:24px;padding:26px 30px;border-radius:26px}
  body.public-surface.ui-desktop .user-hero-panels {grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
  body.public-surface.ui-desktop .user-hero-panels article {padding:13px 14px;border-radius:16px;min-height:105px}
  body.public-surface.ui-desktop .user-hero-panels strong{font-size:clamp(14px,1.2vw,18px);overflow-wrap:anywhere}
  body.public-surface.ui-desktop .user-hero-main h1 {font-size:clamp(26px,3vw,38px)}
  body.public-surface.ui-desktop .user-workspace-hero{padding:16px 20px;border-radius:20px}
  body.public-surface.ui-desktop .user-workspace-hero h2{font-size:23px}
  body.public-surface.ui-desktop .user-workspace-hero p{font-size:13px}
  body.public-surface.ui-desktop .user-page-content .module-card{border-radius:22px}
  body.public-surface.ui-desktop .key-workspace-grid {gap:16px}
  body.public-surface.ui-desktop .user-page-sidebar{border-radius:22px}
  body.public-surface.ui-desktop .premium-overview .metric-card{background:#fff;min-height:156px}
  body.public-surface.ui-desktop .premium-overview .metric-card.featured{background:linear-gradient(135deg,#f0f2ff,#fff);border-color:#d5ddf9}
  body.public-surface.ui-desktop .metric-card>strong{line-height:1.1;font-size:clamp(23px,2.4vw,38px)}
}
@media (min-width:821px) and (max-width:1280px){
  body.public-surface.ui-desktop .user-hero-v7{grid-template-columns:1fr}
  body.public-surface.ui-desktop .user-hero-panels{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* MOBILE/TABLET: radically reduced vertical chrome and a single light visual language. */
@media (max-width:820px){
  html:not([data-mobile-theme="obsidian"]) body.public-surface.ui-mobile{color-scheme:light}
  body.public-surface.ui-mobile{
    --theme-bg:#f5f7fb; --theme-bg2:#f5f7fb; --theme-panel:#fff;
    --theme-panel-solid:#fff; --theme-text:#233251; --theme-muted:#65768f;
    --theme-line:#e4e9f2; --theme-shadow:0 5px 16px rgba(37,54,89,.035);
    --accent:#5369e8; --accent-soft:#eff1ff;
    background:#f5f7fb!important;color:#233251;
  }
  body.public-surface.ui-mobile .app-mesh{display:none!important}
  body.public-surface.ui-mobile .wrap.app-frame{padding:7px 12px max(24px,env(safe-area-inset-bottom))!important}
  body.public-surface.ui-mobile .page-main{display:block!important;min-height:0}
  body.public-surface.ui-mobile .topbar{
    position:relative!important;top:0!important;margin:0 0 9px!important;
    min-height:52px!important;padding:8px 11px!important;border-radius:17px!important;
    border:1px solid #e4e9f2!important;background:#fff!important;
    box-shadow:0 4px 14px rgba(37,54,89,.04)!important;backdrop-filter:none!important;
  }
  body.public-surface.ui-mobile .brand-mark {width:33px;height:33px;border-radius:10px;box-shadow:none}
  body.public-surface.ui-mobile .brand-copy strong {font-size:15px;font-weight:850;letter-spacing:-.02em}
  body.public-surface.ui-mobile .navlinks {gap:7px;align-items:center;min-width:0}
  body.public-surface.ui-mobile .mobile-top-balance {display:block;max-width:100px;padding:7px 9px;border:1px solid #e5e8fc;border-radius:10px;background:#f2f4ff;color:#475fce;font-size:12px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  body.public-surface.ui-mobile .navlinks button {min-height:33px!important;padding:7px 10px!important;border:1px solid #e4e9f2!important;border-radius:10px!important;background:#fff!important;color:#54647d!important;font-size:12px!important;box-shadow:none!important}
  /* Remove *both* redundant overview introductions. Current page has its own heading. */
  body.public-surface.ui-mobile .mobile-console-head,
  body.public-surface.ui-mobile .user-workspace-hero {display:none!important}
  body.public-surface.ui-mobile .user-hero-v7{display:none!important}
  body.public-surface.ui-mobile .user-console-shell {display:flex!important;flex-direction:column;gap:11px!important}
  body.public-surface.ui-mobile .user-page-content {display:block!important;width:100%;min-width:0}
  /* Subnavigation is a white scrollable pill row, not a dark sticky slab. */
  body.public-surface.ui-mobile .user-page-sidebar{
    display:flex!important;position:relative!important;top:auto!important;z-index:3!important;
    width:100%!important;min-width:0!important;max-width:100%!important;
    min-height:48px!important;margin:0!important;padding:5px!important;gap:3px!important;
    border:1px solid #e4e9f2!important;border-radius:15px!important;
    background:#fff!important;box-shadow:0 4px 14px rgba(37,54,89,.04)!important;
    overflow-x:auto!important;overflow-y:hidden!important;backdrop-filter:none!important;
    scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none;
  }
  body.public-surface.ui-mobile .user-page-sidebar::-webkit-scrollbar{display:none}
  body.public-surface.ui-mobile .user-page-sidebar .side-link{
    flex:0 0 auto!important;min-width:unset!important;min-height:36px!important;
    padding:9px 12px!important;font-size:12px!important;font-weight:750!important;
    border-radius:11px!important;color:#61708a!important;white-space:nowrap!important;
    background:transparent!important;border:1px solid transparent!important;box-shadow:none!important;
    transform:none!important;
  }
  body.public-surface.ui-mobile .user-page-sidebar .side-link.active{
    background:#edf0ff!important;color:#455ed0!important;border-color:#dfe5ff!important;box-shadow:none!important;
  }
  body.public-surface.ui-mobile .user-page-sidebar .side-link span,
  body.public-surface.ui-mobile .user-page-sidebar .side-title,
  body.public-surface.ui-mobile .user-page-sidebar .sidebar-endpoint{display:none!important}
  /* The full announcement list remains available via modal, only one ticker entry is shown. */
  body.public-surface.ui-mobile .announcement-rail-v1110{
    display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;align-items:center!important;
    position:relative!important;top:auto!important;gap:7px!important;
    min-height:39px!important;height:39px!important;margin:0 0 9px!important;padding:4px 9px!important;
    border:1px solid #e4e9f2!important;border-radius:12px!important;
    background:#fff!important;box-shadow:none!important;overflow:hidden!important;
  }
  body.public-surface.ui-mobile .announcement-rail-label{padding:0!important;gap:5px;font-size:10px;white-space:nowrap}
  body.public-surface.ui-mobile .announcement-rail-label small{display:none!important}
  body.public-surface.ui-mobile .announcement-preview-grid{display:block!important;min-width:0!important;max-width:100%!important;overflow:hidden!important}
  body.public-surface.ui-mobile .announcement-preview-item{display:flex!important;align-items:center!important;gap:7px!important;padding:0!important;width:100%!important;max-width:100%!important;min-height:26px!important;border:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;overflow:hidden!important}
  body.public-surface.ui-mobile .announcement-preview-item:nth-child(n+2){display:none!important}
  body.public-surface.ui-mobile .announcement-preview-item .announcement-preview-index{display:none!important}
  body.public-surface.ui-mobile .announcement-preview-item img{width:28px!important;height:26px!important;border-radius:7px!important}
  body.public-surface.ui-mobile .announcement-preview-item>div{min-width:0!important;max-width:100%!important}
  body.public-surface.ui-mobile .announcement-preview-item b{font-size:11px!important;overflow:hidden!important;white-space:nowrap!important;text-overflow:ellipsis!important}
  body.public-surface.ui-mobile .announcement-preview-item>div>span{display:none!important}
  body.public-surface.ui-mobile .announcement-all-button{width:auto!important;min-height:28px!important;padding:4px 7px!important;font-size:11px!important;border-radius:8px!important;white-space:nowrap}
  /* Main panels use restrained radius, white surfaces, consistent ink and shadow. */
  body.public-surface.ui-mobile .user-page-content :is(.card,.module-card,.module-section>.card,.chart-card),
  body.public-surface.ui-mobile .premium-overview .metric-card{
    border:1px solid #e4e9f2!important;background:#fff!important;
    border-radius:18px!important;box-shadow:0 4px 14px rgba(38,54,88,.035)!important;
    backdrop-filter:none!important;
  }
  body.public-surface.ui-mobile .user-page-content .module-card{padding:16px!important}
  body.public-surface.ui-mobile .user-page-content .module-heading{gap:8px!important;margin:0 0 14px!important}
  body.public-surface.ui-mobile .user-page-content .module-heading h2{
    margin:0!important;font-size:23px!important;line-height:1.2!important;
    color:#233251!important;letter-spacing:-.035em!important;
  }
  body.public-surface.ui-mobile .user-page-content .module-heading p{
    margin:6px 0 0!important;font-size:12px!important;line-height:1.65!important;
    color:#71809a!important;max-width:100%;
  }
  body.public-surface.ui-mobile .user-page-content .eyebrow{font-size:10px!important;letter-spacing:.12em!important;color:#5269d7!important}
  /* Explicitly defeat the old flex!important conflict that placed range tabs next to heading. */
  body.public-surface.ui-mobile .user-page-content .module-heading.range-heading{
    display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:13px!important;
  }
  body.public-surface.ui-mobile .user-page-content .range-switcher{
    display:grid!important;width:100%!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:3px!important;padding:4px!important;margin:0!important;border-radius:12px!important;
    border:1px solid #e4e9f2!important;background:#f3f5fa!important;
    box-shadow:none!important;overflow:hidden!important;
  }
  body.public-surface.ui-mobile .user-page-content .range-switcher a{
    min-width:0!important;min-height:36px!important;padding:7px 2px!important;
    border-radius:9px!important;font-size:11px!important;color:#63738c!important;
  }
  body.public-surface.ui-mobile .user-page-content .range-switcher a.active{
    background:#5269e8!important;color:#fff!important;box-shadow:none!important;
  }
  body.public-surface.ui-mobile .premium-overview{padding:0!important;background:none!important;border:0!important;box-shadow:none!important}
  body.public-surface.ui-mobile .premium-overview .metric-grid{
    display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:9px!important;margin:0!important;
  }
  body.public-surface.ui-mobile .premium-overview .metric-card{
    min-width:0!important;min-height:124px!important;padding:14px!important;overflow:hidden!important;
  }
  body.public-surface.ui-mobile .premium-overview .metric-card.featured{
    background:#f0f2ff!important;border-color:#dde3ff!important;
  }
  body.public-surface.ui-mobile .premium-overview .metric-card strong{
    display:block!important;margin:16px 0 10px!important;font-size:clamp(22px,6.2vw,29px)!important;
    line-height:1.16!important;color:#233251!important;overflow-wrap:anywhere;
  }
  body.public-surface.ui-mobile .premium-overview .metric-top span{font-size:11px!important;color:#64748b!important}
  body.public-surface.ui-mobile .premium-overview .metric-top i{font-size:9px!important;color:#9ca9bc!important}
  body.public-surface.ui-mobile .premium-overview .metric-card small{font-size:10px!important;line-height:1.55!important;color:#8190a6!important}
  body.public-surface.ui-mobile .premium-overview .premium-chart-grid{display:grid!important;gap:10px!important;margin-top:12px!important}
  body.public-surface.ui-mobile .premium-overview .chart-card{padding:14px!important}
  body.public-surface.ui-mobile .premium-overview .chart-host{min-height:200px!important;height:200px!important}
  body.public-surface.ui-mobile .premium-overview .chart-host.tall{min-height:225px!important;height:225px!important}
  body.public-surface.ui-mobile .premium-overview .donut-host{height:220px!important;min-height:220px!important}
  body.public-surface.ui-mobile .user-page-content :is(input,select,textarea){font-size:16px!important}
  body.public-surface.ui-mobile .user-page-content :is(.code-panel,pre){max-width:100%;overflow-x:auto;white-space:pre-wrap;overflow-wrap:anywhere}
  body.public-surface.ui-mobile .user-page-content .key-workspace-grid{display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:11px!important}
  body.public-surface.ui-mobile .key-workspace-grid>.card{padding:15px!important}
  body.public-surface.ui-mobile .key-command-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  body.public-surface.ui-mobile .key-command-grid article{padding:10px!important;border-radius:12px!important;background:#f7f8fc!important}
  body.public-surface.ui-mobile .key-command-grid article span{font-size:10px!important;line-height:1.45!important}
  body.public-surface.ui-mobile .key-command-grid article strong{font-size:23px!important}
  body.public-surface.ui-mobile .key-create-grid{padding:11px!important;border-radius:14px!important}
  body.public-surface.ui-mobile .key-pool-item{padding:12px!important;border-radius:15px!important;background:#fff!important}
  body.public-surface.ui-mobile .key-pool-switch-form{display:grid!important;grid-template-columns:minmax(0,1fr)!important}
  body.public-surface.ui-mobile .key-pool-switch-form :is(select,button){width:100%!important}
  body.public-surface.ui-mobile .home-pool-grid{grid-template-columns:minmax(0,1fr)!important}
  body.public-surface.ui-mobile .aurora-home-hero{padding:18px 16px!important;border-radius:20px!important}
  body.public-surface.ui-mobile .aurora-home-hero .hero-copy h1{font-size:clamp(33px,9vw,45px)!important}
  body.public-surface.ui-mobile .footer{padding-bottom:22px!important}
  /* Animate on entry only, not every scroll/hover/touch event. */
  body.public-surface.ui-mobile :is(.metric-card,.chart-card,.home-pool-card):hover{transform:none!important}
  body.public-surface.ui-mobile :is(.card,.module-card,.chart-card){backdrop-filter:none!important;filter:none!important}
}
@media(max-width:365px){
  body.public-surface.ui-mobile .wrap.app-frame{padding-left:8px!important;padding-right:8px!important}
  body.public-surface.ui-mobile .brand-copy strong{font-size:13px!important}
  body.public-surface.ui-mobile .mobile-top-balance{max-width:77px;font-size:11px}
  body.public-surface.ui-mobile .premium-overview .metric-card{padding:11px!important}
  body.public-surface.ui-mobile .key-command-grid{grid-template-columns:1fr!important}
}
@media(prefers-reduced-motion:reduce){
  body.public-surface *,body.public-surface *::before,body.public-surface *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
}
/* Desktop simplification: module heading itself is the page title; no duplicate overview card. */
@media(min-width:821px){
  body.public-surface.ui-desktop .user-workspace-hero{display:none!important}
  body.public-surface.ui-desktop .user-hero-v7{grid-template-columns:minmax(0,1.45fr) minmax(340px,.7fr);padding:23px 28px}
  body.public-surface.ui-desktop .user-hero-main h1{font-size:clamp(30px,3.1vw,40px)}
  body.public-surface.ui-desktop .user-hero-main p{font-size:13px}
  body.public-surface.ui-desktop .user-hero-panels{grid-template-columns:repeat(2,minmax(0,1fr))}
  body.public-surface.ui-desktop .user-hero-panels article:nth-child(3){display:none}
  body.public-surface.ui-desktop .user-hero-panels article{min-height:98px}
  body.public-surface.ui-desktop .user-page-content .module-section:first-child{margin-top:0}
}
@media(min-width:821px) and (max-width:1160px){
  body.public-surface.ui-desktop .user-hero-v7{grid-template-columns:1fr}
  body.public-surface.ui-desktop .user-hero-panels article:nth-child(3){display:block}
  body.public-surface.ui-desktop .user-hero-panels{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Legacy desktop-command-head forced display:flex!important; fix actual two-column hero. */
@media(min-width:821px){
  body.public-surface.ui-desktop .user-hero-v7.desktop-command-head{
    display:grid!important;grid-template-columns:minmax(0,1.3fr) minmax(360px,.78fr)!important;
    gap:28px!important;align-items:center!important;
  }
  body.public-surface.ui-desktop .user-hero-panels{width:100%;justify-self:stretch}
  body.public-surface.ui-desktop .premium-overview .metric-card strong{font-size:clamp(22px,2.1vw,34px)!important;word-break:break-word}
}
@media(min-width:821px) and (max-width:1160px){
  body.public-surface.ui-desktop .user-hero-v7.desktop-command-head{grid-template-columns:minmax(0,1fr)!important}
}
