/* TUN Reference Premium: matches approved desktop/mobile layout. Loaded last. */
:root{--tr-bg:#020d25;--tr-card:#051b3b;--tr-border:#11569b;--tr-cyan:#13b9ff;--tr-text:#f3f8ff;--tr-muted:#a7c4ec}
html{background:#010819}body.tun-ref{font-family:Inter,ui-sans-serif,system-ui,Arial,sans-serif!important;background:radial-gradient(ellipse at 80% 0%,#102c6a 0%,transparent 42%),#020b20!important;color:var(--tr-text)!important;min-height:100vh}
body.tun-ref > aside{width:252px!important;position:fixed!important;top:0!important;bottom:0!important;left:0!important;background:linear-gradient(155deg,#041633 0%,#03112d 55%,#071b44 100%)!important;border-right:1px solid #0c3d88!important;padding:24px 15px 235px!important;z-index:50!important;overflow-y:auto!important}
body.tun-ref > aside .brand{display:flex;align-items:center;gap:12px;font-size:23px!important;color:#fff!important;margin:0 8px 3px!important;white-space:nowrap}.tun-logo-bolt{font-size:37px;line-height:1;color:#54baff;text-shadow:0 0 14px #087aff}body.tun-ref > aside .brand+.muted{font-size:11px!important;margin-left:60px!important;color:#9fcaff!important}
body.tun-ref aside .group{font-weight:800!important;color:#43b4ff!important;font-size:11px!important;letter-spacing:1.2px!important;margin:29px 10px 12px!important}
body.tun-ref aside .nav,body.tun-ref aside .role-nav{border:1px solid transparent!important;border-radius:11px!important;padding:12px 13px!important;margin:4px 0!important;background:transparent!important;color:#d4e6ff!important;font-size:14px!important;box-shadow:none!important}
body.tun-ref aside .nav.active,body.tun-ref aside .role-nav.active{background:linear-gradient(105deg,#087de9,#1149c7)!important;border-color:#14caff!important;box-shadow:0 0 0 1px #1768ff,0 0 16px #006fff77!important;color:#fff!important}
body.tun-ref aside #roleNav{display:none!important}#tunRefSideRoles .role-nav{width:100%;text-align:left}body.tun-ref #tunSidebarBottomGif{position:fixed!important;left:26px!important;bottom:40px!important;width:185px!important;max-width:185px!important;max-height:195px!important;object-fit:contain!important;z-index:10!important;pointer-events:none!important;filter:drop-shadow(0 0 16px #155dff66)}
body.tun-ref > main{max-width:none!important;margin-left:252px!important;padding:24px 24px 35px!important;min-width:0!important}body.tun-ref > main > header{display:none!important}body.tun-ref #notice{margin:0!important;min-height:0!important;font-size:13px!important}body.tun-ref #roles{display:block}body.tun-ref #roles[hidden],body.tun-ref #api[hidden]{display:none!important}
.tun-ref-top{display:flex;gap:20px;align-items:center;justify-content:space-between;margin:0 0 20px}.tun-search{height:44px;max-width:590px;flex:1;display:flex;align-items:center;gap:10px;padding:0 16px;background:#071d44;border:1px solid #2a5793;border-radius:13px}.tun-search span,.tun-list-search span{font-size:26px;color:#b6d6ff;line-height:1}.tun-search input,.tun-list-search input{background:transparent!important;border:0!important;outline:none!important;box-shadow:none!important;color:#eaf5ff!important;padding:5px!important;font-size:13px!important}.tun-top-right{display:flex;gap:14px;align-items:center}.tun-top-right button,.tun-top-bell{display:grid;place-items:center;position:relative;width:42px;height:42px;border:1px solid #1d4b86;border-radius:12px;background:#09245b;color:#ffd441;font-size:22px}.tun-top-bell{color:#d4e8ff}.tun-top-bell i{position:absolute;right:6px;top:5px;width:8px;height:8px;border-radius:50%;background:#ff5269}.tun-top-account{border:1px solid #21518b;background:#092050;border-radius:28px;padding:7px 12px;font-size:13px;white-space:nowrap}.tun-top-account b{background:#076afa;padding:4px 9px;border-radius:10px;margin-left:7px}
.tun-ref-hero{position:relative;min-height:146px;border-radius:17px;border:1px solid #1454ba;background:radial-gradient(circle at 63% 50%,#173c9e 0%,transparent 35%),linear-gradient(115deg,#0b3b9d,#061b48 65%,#061739);overflow:hidden;display:flex;align-items:center;justify-content:space-between;padding:20px 24px;margin-bottom:15px;box-shadow:inset 0 0 45px #0868ff22}.tun-hero-copy{position:relative;z-index:2;max-width:56%}.tun-hero-copy h1{font-size:clamp(24px,2.3vw,34px)!important;line-height:1.2!important;letter-spacing:-.7px!important;margin:0 0 8px!important}.tun-hero-copy p{font-size:14px;color:#c5ddff;line-height:1.55;margin:0}.tun-hero-art{position:absolute;right:18%;height:155px;width:205px;object-fit:contain;filter:drop-shadow(0 0 15px #376cff)}.tun-hero-clock{position:relative;z-index:2;margin-left:auto;border-left:1px solid #255397;padding-left:22px;min-width:190px;display:flex;flex-direction:column;gap:5px}.tun-hero-clock small{color:#b9ceee;font-size:12px}.tun-hero-clock strong{font-size:29px;line-height:1.2}.tun-hero-clock span{color:#15f49c;font-size:12px}
body.tun-ref #tunDeviceStats{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:14px!important;margin:0 0 8px!important}.tun-ref .tun-stat{position:relative!important;min-height:64px!important;padding:20px 17px 15px 95px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;border-radius:17px!important;overflow:hidden!important;border:1px solid #18baff!important;background:linear-gradient(115deg,#06336d,#0c4bc7)!important;box-shadow:inset 0 0 25px #008aff44!important}.tun-ref .tun-stat:nth-child(2){border-color:#02efbd!important;background:linear-gradient(115deg,#02434b,#065744)!important}.tun-ref .tun-stat:nth-child(3){border-color:#bc70ff!important;background:linear-gradient(115deg,#302264,#4b348f)!important}.tun-ref .tun-stat:before{content:'▣';position:absolute;left:18px;top:31px;width:58px;height:58px;display:grid;place-items:center;background:#087aff;border-radius:17px;color:#fff;font-size:32px;box-shadow:0 0 20px #1599ff}.tun-ref .tun-stat:nth-child(2):before{content:'◉';background:#00aa9e;box-shadow:0 0 18px #04f4d0}.tun-ref .tun-stat:nth-child(3):before{content:'♧';background:#7042cb;box-shadow:0 0 18px #bd78ff}.tun-ref .tun-stat small{color:#c9e2ff!important;font-size:13px!important;margin:0 0 3px!important}.tun-ref .tun-stat strong{font-size:35px!important;line-height:1.1!important}.tun-ref #tunDeviceStatsMessage{font-size:11px!important;color:#7c9cc6!important;margin:0 0 13px!important;min-height:13px!important}
#tunRefGrid{display:grid;grid-template-columns:minmax(280px,.93fr) minmax(360px,1.07fr);gap:12px;align-items:stretch}.tun-ref-panel{border:1px solid #0e509b!important;background:linear-gradient(155deg,#061d40,#05132f)!important;border-radius:17px!important;padding:18px 14px!important;box-shadow:0 8px 24px #0004!important;min-width:0;min-height:410px}.tun-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 17px}.tun-panel-heading h2{font-size:18px!important;font-weight:800!important;margin:0!important;min-width:0}.tun-panel-heading h2 span{font-size:12px;padding:4px 10px;background:#17396c;border-radius:20px;margin-left:5px}.tun-ref-primary{flex-shrink:0;padding:11px 14px;border:1px solid #149cff;border-radius:11px;background:linear-gradient(120deg,#13aeff,#0454ee);box-shadow:0 0 12px #0077ff33;color:white;font-weight:700;font-size:12px;cursor:pointer}.tun-list-search{display:flex;align-items:center;gap:8px;border:1px solid #23568f;border-radius:12px;background:#0c2b58;padding:5px 12px;margin:0 0 12px;height:43px}body.tun-ref #tunRefGrid #roleNav{display:flex!important;flex-direction:column;gap:9px}body.tun-ref #tunRefGrid #roleNav .role-nav{display:block!important;text-align:left!important;width:100%!important;min-height:67px!important;padding:14px 16px!important;border-radius:12px!important;border:1px solid #174783!important;background:#0a2450!important;color:#eaf3ff!important;font-size:14px!important;font-weight:700!important;margin:0!important}body.tun-ref #tunRefGrid #roleNav .role-nav.active{border-color:#08bfff!important;background:linear-gradient(100deg,#104fa3,#0b2757)!important;box-shadow:0 0 0 1px #077aff!important}body.tun-ref #tunRefGrid #roleNav .role-nav[hidden]{display:none!important}
.tun-ref-editor .fields{gap:15px!important}.tun-ref-editor label{font-size:12px!important;color:#d5e6ff!important;margin-bottom:8px!important}.tun-ref-editor input,.tun-ref-editor select,.tun-ref-editor textarea{border:1px solid #295a98!important;border-radius:11px!important;background:#0c2a55!important;color:#f0f7ff!important;padding:12px 13px!important;font-size:13px!important}.tun-ref-editor textarea{min-height:120px!important}.tun-ref-editor .muted{font-size:12px!important;color:#9cb9dd!important}.tun-ref-editor #saveRole{background:linear-gradient(120deg,#0bb9fa,#0657e9)!important}.tun-mobile-nav{display:none}
@media(max-width:1180px){.tun-hero-art{opacity:.7;right:16%}.tun-ref .tun-stat{padding-left:73px!important}.tun-ref .tun-stat:before{width:44px;height:44px;left:14px;top:38px;font-size:24px}#tunRefGrid{grid-template-columns:minmax(240px,.9fr) minmax(330px,1.1fr)}}
@media(max-width:850px){body.tun-ref > aside{display:none!important}body.tun-ref > main{margin:0!important;padding:12px 12px 95px!important}.tun-ref-top{display:none!important}.tun-ref-hero{min-height:120px!important;padding:18px!important}.tun-hero-copy{max-width:75%}.tun-hero-copy h1{font-size:24px!important}.tun-hero-copy p{font-size:12px}.tun-hero-art{right:-10px;opacity:.8;height:130px;width:135px}.tun-hero-clock{display:none}#tunRefGrid{grid-template-columns:1fr}.tun-ref-panel{min-height:0!important}.tun-mobile-nav{position:fixed;z-index:999;display:flex;bottom:0;left:0;right:0;justify-content:space-around;gap:4px;background:#03132f;border-top:1px solid #164e99;padding:8px 6px max(9px,env(safe-area-inset-bottom));box-shadow:0 -6px 28px #0009}.tun-mobile-nav button{border:0;color:#c7dfff;background:transparent;display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0;flex:1;font-size:23px}.tun-mobile-nav button:first-child{color:#24aaff}.tun-mobile-nav small{font-size:10px;white-space:nowrap}}
@media(max-width:550px){body.tun-ref #tunDeviceStats{gap:7px!important}.tun-ref .tun-stat{min-height:64px!important;padding:40px 8px 9px!important;border-radius:12px!important;align-items:flex-start!important}.tun-ref .tun-stat:before{width:28px;height:28px;top:9px;left:9px;font-size:17px;border-radius:9px}.tun-ref .tun-stat small{font-size:10px!important;white-space:nowrap}.tun-ref .tun-stat strong{font-size:24px!important}.tun-ref-panel{padding:14px 12px!important}.tun-panel-heading h2{font-size:16px!important}.tun-ref-primary{padding:10px!important;font-size:11px}.tun-ref-editor .fields{grid-template-columns:1fr!important}.tun-hero-copy{max-width:78%}.tun-hero-copy h1{font-size:21px!important}}

.tun-mobile-brand{display:none}body.tun-ref:has(#app[hidden]) .tun-mobile-nav{display:none!important}
@media(max-width:850px){.tun-mobile-brand{display:flex;align-items:center;gap:10px;font-size:20px;font-weight:800;padding:7px 4px 15px}.tun-mobile-brand span{color:#55bfff;font-size:30px;text-shadow:0 0 13px #006eff}.tun-mobile-brand b{margin-left:auto;background:#075ee3;padding:5px 16px;border-radius:22px;font-size:12px}}


/* FIX 2026-10-11: original 21 GIFs in hero, no sidebar mascot or redundant toolbar. */
body.tun-ref .tun-ref-top{display:none!important}
body.tun-ref #tunRefShell>.tun-ref-hero{margin-top:0!important}
body.tun-ref #tunSidebarBottomGif.tun-ref-hero-emoji{
 position:absolute!important;left:auto!important;right:20%!important;top:50%!important;
 bottom:auto!important;transform:translateY(-50%)!important;
 width:150px!important;height:150px!important;max-width:150px!important;max-height:150px!important;
 object-fit:contain!important;z-index:1!important;pointer-events:none!important;
 border:0!important;border-radius:0!important;background:transparent!important;
 filter:drop-shadow(0 0 18px rgba(58,122,255,.72))!important;
}
body.tun-ref .tun-hero-copy{max-width:54%!important}
body.tun-ref .tun-hero-clock{min-width:178px!important}
/* Device counters: real icons, labels and counts always visible. */
body.tun-ref #tunDeviceStats .tun-stat{
 display:grid!important;grid-template-columns:66px minmax(0,1fr)!important;
 grid-template-rows:auto auto auto!important;align-content:center!important;
 column-gap:12px!important;row-gap:3px!important;
 padding:17px 14px!important;min-height:120px!important;position:relative!important;
}
body.tun-ref #tunDeviceStats .tun-stat:before{
 position:static!important;grid-column:1!important;grid-row:1/4!important;
 width:58px!important;height:58px!important;align-self:center!important;
 font-size:29px!important;line-height:1!important;border-radius:15px!important;
 content:'📱'!important;
}
body.tun-ref #tunDeviceStats .tun-stat:nth-child(2):before{content:'📶'!important}
body.tun-ref #tunDeviceStats .tun-stat:nth-child(3):before{content:'🔕'!important}
body.tun-ref #tunDeviceStats .tun-stat small{
 grid-column:2!important;grid-row:1!important;display:block!important;
 margin:0!important;font-size:13px!important;line-height:1.25!important;
 opacity:1!important;position:static!important;transform:none!important;
}
body.tun-ref #tunDeviceStats .tun-stat strong{
 grid-column:2!important;grid-row:2!important;display:block!important;
 margin:0!important;font-size:34px!important;line-height:1.05!important;
 opacity:1!important;position:static!important;transform:none!important;
 color:#fff!important;
}
body.tun-ref #tunDeviceStats .tun-stat-description{
 grid-column:2!important;grid-row:3!important;font-size:10px!important;
 color:#b8d3f2!important;line-height:1.3!important;
}
/* Avoid previous floating fixed mascot and overlapping sidebar content. */
body.tun-ref aside .tun-aside-bottom{display:none!important}
@media(max-width:1180px){
 body.tun-ref #tunDeviceStats .tun-stat{grid-template-columns:48px minmax(0,1fr)!important;column-gap:9px!important;padding:14px 10px!important}
 body.tun-ref #tunDeviceStats .tun-stat:before{width:45px!important;height:45px!important;font-size:23px!important}
 body.tun-ref #tunDeviceStats .tun-stat-description{font-size:9px!important}
}
@media(max-width:850px){
 body.tun-ref #tunSidebarBottomGif.tun-ref-hero-emoji{right:0!important;width:110px!important;height:110px!important;max-width:110px!important;max-height:110px!important}
 body.tun-ref .tun-hero-copy{max-width:calc(100% - 105px)!important}
 body.tun-ref #tunDeviceStats .tun-stat{grid-template-columns:1fr!important;grid-template-rows:29px auto auto!important;min-height:64px!important;row-gap:4px!important;padding:9px!important}
 body.tun-ref #tunDeviceStats .tun-stat:before{grid-column:1!important;grid-row:1!important;width:28px!important;height:28px!important;font-size:16px!important;border-radius:9px!important}
 body.tun-ref #tunDeviceStats .tun-stat small{grid-column:1!important;grid-row:2!important;font-size:10px!important}
 body.tun-ref #tunDeviceStats .tun-stat strong{grid-column:1!important;grid-row:3!important;font-size:24px!important}
 body.tun-ref #tunDeviceStats .tun-stat-description{display:none!important}
}

/* TUN_STATS_COMPACT_V1 */
@media (min-width: 700px) {
  .tun-ref-stats {
    gap: 12px !important;
  }

  .tun-ref-stat {
    min-height: 72px !important;
    height: 72px !important;
    padding: 10px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
  }

  .tun-ref-stat-icon {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    font-size: 23px !important;
  }

  .tun-ref-stat-label {
    font-size: 13px !important;
  }

  .tun-ref-stat-value {
    font-size: 26px !important;
    line-height: 1 !important;
  }

  .tun-ref-stat-desc {
    display: none !important;
  }
}
