/* Readability and interaction refinements for the two-character template. */
.unit-header{grid-template-columns:92px minmax(0,1fr) auto;min-height:164px}
.unit-attributes{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}
.unit-attribute{display:grid;grid-template-columns:26px auto;grid-template-rows:auto auto;gap:0 7px;align-items:center;min-width:104px;padding:6px 8px;background:#0b1921;border:1px solid #29424f}
.unit-attribute img{grid-row:1/3;width:26px;height:26px;object-fit:contain;filter:drop-shadow(0 1px 2px #000)}
.unit-attribute strong{font-size:11px;line-height:1.15;white-space:nowrap}
.unit-attribute small{font-size:8px;color:#7f98a3}
.page-tabs{top:164px}

.skill-main>p{font-size:15px;line-height:1.72}
.level-strip div{font-size:12px;line-height:1.55;min-height:72px;padding:10px}
.level-strip b{font-size:11px;margin-bottom:4px}
.mechanics span{font-size:11px}
.stat span{font-size:14px;color:#c5d4da}
.stat i{font-size:11px;line-height:1.5;margin-top:4px}
.stat strong{font-size:28px}

.archive-section{display:block;scroll-margin-top:214px;padding-bottom:34px}
.archive-section+.archive-section{margin-top:28px;padding-top:12px;border-top:1px solid #29424f}
.archive-tabs button.active{background:#ff5b68;border-color:#ff5b68;color:#fff}

.spine-column{position:relative}
.spine-floating-tools{position:absolute;z-index:8;left:14px;top:50%;transform:translateY(-50%);display:grid;gap:8px}
.spine-tool{width:90px;padding:10px 8px;border:1px solid #4fdae9;background:rgba(8,27,36,.92);color:#66ddf2;font-size:11px;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.spine-tool span{display:block;font-size:20px;line-height:1;margin-bottom:4px}
.spine-tool.active{color:#fff;background:#ff5b68;border-color:#ff7b85}
.spine-tool-panel{display:none;position:absolute;left:102px;top:0;width:300px;max-height:360px;padding:12px;background:rgba(5,15,21,.97);border:1px solid #3c6472;box-shadow:0 16px 42px #000}
.spine-tool-panel.open{display:block}
.spine-tool-panel header{display:flex;justify-content:space-between;align-items:center;margin-bottom:10px;color:#fff;font-size:13px;font-weight:700}
.spine-tool-panel header button{border:0;background:transparent;color:#fff;font-size:22px;line-height:1}
.spine-tool-panel .control-pills{max-height:290px;overflow:auto}
.spine-console{padding:8px 15px}
.console-footer{border-top:0;padding-top:0}

@media(max-width:1350px){.unit-header{grid-template-columns:76px minmax(0,1fr) auto}.unit-attribute{min-width:96px}.spine-tool{width:78px}.spine-tool-panel{left:90px;width:270px}}
@media(max-width:980px){.spine-floating-tools{top:46%}}

/* 2026-08-21 polish pass: calmer surfaces, denser controls, no frozen anchors. */
.rail-brand.gamekee{background:transparent;border:0}
.rail-divider{opacity:.55}
.switch-character{border:0;border-radius:4px;background:linear-gradient(135deg,#12303b,#0c2029);box-shadow:inset 3px 0 0 var(--cyan);transition:.2s transform,.2s background}
.switch-character:hover{transform:translateX(3px);background:#153845}
.rail-tab{border:0;border-radius:4px;background:rgba(13,29,38,.72)}
.rail-tab.active{border:0;box-shadow:inset 3px 0 0 #ff9ca4,7px 0 22px rgba(255,91,104,.09)}

.unit-header{grid-template-columns:92px minmax(0,1fr) 170px;gap:14px;min-height:164px}
.unit-header>img{border:0;border-radius:3px;box-shadow:0 12px 30px rgba(0,0,0,.28)}
.unit-name-line{display:flex;align-items:flex-end;gap:13px;min-width:0}
.unit-title h1{margin:2px 0 7px;font-size:33px;white-space:nowrap}
.unit-rarity{display:flex;align-items:center;gap:6px;text-align:left;padding-bottom:8px;white-space:nowrap}
.unit-rarity strong{font-size:19px;line-height:1}.unit-rarity span{font-size:10px}.unit-rarity em{font-size:9px}
.unit-attributes{gap:6px;margin-top:3px;flex-wrap:nowrap}
.unit-attribute{min-width:0!important;grid-template-columns:25px auto;padding:5px 7px;border:0;border-radius:3px;background:linear-gradient(135deg,rgba(25,48,59,.94),rgba(10,25,33,.76))}
.unit-attribute img{width:25px;height:25px}.unit-attribute strong{font-size:10px}.unit-attribute small{font-size:7px}
.header-team{align-self:stretch;display:flex;align-items:center;justify-content:center;gap:10px;padding:15px;background:linear-gradient(145deg,rgba(22,43,53,.95),rgba(9,22,29,.72));border-left:2px solid rgba(93,215,244,.55)}
.header-team img{width:50px;height:50px;object-fit:contain;filter:drop-shadow(0 4px 8px #000)}
.header-team div{min-width:0}.header-team strong,.header-team small{display:block}.header-team strong{font-size:13px;line-height:1.25;white-space:nowrap}.header-team small{font-size:8px;color:var(--muted);margin-top:3px}

.page-tabs{position:static;top:auto;padding:0;background:none;margin:0 0 24px;gap:20px}
.page-tabs button{position:relative;padding:10px 3px;border:0;background:transparent;color:#7f949e}
.page-tabs button:after{content:"";position:absolute;left:0;right:100%;bottom:2px;height:2px;background:var(--red);transition:right .2s}
.page-tabs button.active{background:transparent!important;color:#fff!important}.page-tabs button.active:after{right:0}
.archive-section{scroll-margin-top:18px}

.skill-list{gap:14px}
.skill-card{border:0;border-radius:4px;background:linear-gradient(112deg,rgba(17,35,45,.92),rgba(7,20,27,.72));box-shadow:inset 3px 0 0 rgba(93,215,244,.28),0 10px 30px rgba(0,0,0,.08)}
.skill-card:after{display:none!important}
.skill-icon img{border:0;box-shadow:0 8px 18px rgba(0,0,0,.3)}
.mechanics span,.quick-levels button,.tag{border:0;border-radius:3px;background:rgba(20,54,67,.85)}
.level-strip div{border-top:1px solid rgba(93,215,244,.32);background:rgba(4,16,22,.45)}
.level-controller{border:0;border-radius:4px;box-shadow:inset 3px 0 0 var(--cyan)}
.stat{border:0;border-radius:4px;background:linear-gradient(135deg,#10212a,#0b1820)}
.data-note{border:0;border-left:2px solid #9e8c38}

.dossier{margin-top:16px;padding:19px;color:var(--text);background:linear-gradient(140deg,#10212a,#0b171e);box-shadow:none;border-radius:4px;border-left:2px solid rgba(93,215,244,.5)}
.dossier-head{border-bottom:1px solid #36505c;color:#b9cbd2}.dossier-head small{color:#667f8a}
.profile-fields{border:0;gap:1px;background:#203943}
.profile-field{border:0;background:#0b1820;font-size:12px}
.profile-field b{background:#132831;color:#b8cad1}.profile-field span{color:#e6f0f3}
.history-card,.crf-row,.voice-meta span,.voice-item{border:0;border-radius:4px;background:linear-gradient(135deg,#10212a,#0b1820)}
.team-sign img{border:0;background:#162c36}.voice-tools select,.voice-tools input,.voice-tools button{border:0;border-radius:3px}.crf-row{padding:14px}

.spine-stage #spine-player,.spine-stage #spine-player>div,.spine-stage #spine-player canvas{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;display:block!important}
.spine-floating-tools{left:12px;top:auto;bottom:122px;transform:none;gap:5px}
.spine-tool{width:62px;padding:7px 5px;border:0;border-radius:4px;background:rgba(8,28,37,.88);font-size:9px;box-shadow:0 7px 20px rgba(0,0,0,.22)}
.spine-tool span{font-size:15px;margin-bottom:3px}.spine-tool.active{border:0}
.spine-tool-panel{left:69px;top:auto;bottom:0;width:310px;border:0;border-left:2px solid var(--cyan);border-radius:4px}
.control-pills button{border:0;border-radius:3px;background:#122833}
#spine-models{display:grid;grid-template-columns:repeat(3,minmax(70px,1fr));gap:7px}
#spine-models .model-pill{padding:0;overflow:hidden;text-align:center;background:#132630}
#spine-models .model-pill img{display:block;width:100%;height:108px;object-fit:cover;object-position:top;image-rendering:auto;image-rendering:-webkit-optimize-contrast}
#spine-models .model-pill span{display:block;padding:6px 3px;font-size:9px}
.console-footer button{border:0;border-radius:3px}.spine-console{border-top:0}

.character-dialog{width:min(1080px,88vw);border:0;border-radius:6px;overflow:hidden}
.character-dialog header{border-bottom:0;box-shadow:inset 0 -1px rgba(93,215,244,.32)}
.character-filters{grid-template-columns:2fr repeat(4,minmax(120px,1fr));gap:7px}
.character-filters input,.character-filters select{border:0;border-radius:3px;background:#10232c}
.character-grid{grid-template-columns:repeat(8,minmax(82px,1fr));gap:8px}
.character-card{border:0;border-radius:4px;overflow:hidden;background:#102029;box-shadow:0 6px 16px rgba(0,0,0,.16)}
.character-card.active{border:0;box-shadow:inset 0 0 0 2px var(--cyan),0 8px 20px rgba(0,0,0,.28)}
.character-card img{aspect-ratio:3/4;object-fit:cover;object-position:top}
.character-card div{padding:7px}.character-card strong{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.character-card small{font-size:7px}

@media(max-width:1500px){.unit-header{grid-template-columns:76px minmax(0,1fr) 148px}.unit-title h1{font-size:28px}.unit-attribute strong{font-size:9px}.header-team strong{font-size:11px}.character-grid{grid-template-columns:repeat(7,minmax(78px,1fr))}}
@media(max-width:1180px){.unit-attributes{flex-wrap:wrap}.unit-title h1{font-size:25px}.character-filters{grid-template-columns:repeat(3,1fr)}.character-filters input{grid-column:1/-1}.character-grid{grid-template-columns:repeat(6,1fr)}}

/* Desktop continuity: the portrait is part of the same dark archive surface. */
.content-column{scrollbar-width:none;-ms-overflow-style:none}
.content-column::-webkit-scrollbar{width:0;height:0}
.spine-stage{background:radial-gradient(circle at 50% 34%,#142a34 0,#0b1921 42%,#071017 78%,#050c11 100%)}
#spine-models{display:flex;flex-flow:row nowrap;gap:7px;max-width:100%;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:thin;scrollbar-color:#365665 transparent}
#spine-models .model-pill{flex:0 0 108px;min-width:108px}
.spine-tool-panel:has(#spine-models){width:min(580px,calc(100vw - 110px))}

/* Phone experience: full-screen portrait first, archive content rises from below. */
@media(max-width:760px){
  html,body{height:auto;min-height:100%;overscroll-behavior-y:none;scrollbar-width:none;-ms-overflow-style:none}
  html::-webkit-scrollbar,body::-webkit-scrollbar{width:0;height:0}
  body{overflow-x:hidden;overflow-y:auto;background:#050c11}
  .archive-app{display:flex!important;flex-direction:column;height:auto;min-height:200svh;background:#050c11}
  .spine-column{order:0;position:fixed;inset:0;z-index:1;width:100%;height:100svh!important;min-height:100svh;display:block;background:#071017}
  .spine-stage{position:absolute;inset:0;min-height:100svh;background:radial-gradient(circle at 50% 36%,#18313c 0,#0b1b23 45%,#071017 76%,#050c11 100%)}
  .spine-topline{position:absolute;z-index:12;top:0;left:0;right:0;padding:12px 14px;border:0;background:linear-gradient(#050c11d9,transparent);transition:opacity .2s}
  .spine-console{position:absolute;z-index:12;left:0;right:0;bottom:0;padding:10px 12px 12px;background:linear-gradient(transparent,#050c11 38%);transition:opacity .2s}
  .spine-hint{display:none}
  .spine-floating-tools{z-index:14;left:12px;bottom:76px;gap:4px;transition:opacity .2s}
  .spine-tool{width:54px;padding:6px 4px;font-size:8px;background:rgba(5,20,27,.86);backdrop-filter:blur(8px)}
  .spine-tool span{font-size:14px}
  .spine-tool-panel{left:60px;bottom:0;width:min(310px,calc(100vw - 78px));max-height:240px;padding:10px;background:rgba(5,15,21,.96)}
  .spine-tool-panel:has(#spine-models){width:min(330px,calc(100vw - 78px))}
  #spine-models .model-pill{flex-basis:74px;min-width:74px}
  #spine-models .model-pill img{height:76px}
  .console-footer{padding-top:0}.console-footer button{font-size:12px;padding:6px 11px}.console-footer label{font-size:8px}.console-footer input{width:82px}
  .mobile-ui-hidden .spine-topline,.mobile-ui-hidden .spine-console,.mobile-ui-hidden .spine-floating-tools{opacity:0;pointer-events:none}

  .rail{order:1;position:relative!important;z-index:4;width:100%;height:auto!important;margin-top:100svh;padding:10px 12px;background:rgba(5,12,17,.98);border:0;border-top:1px solid #29424f;display:grid;grid-template-columns:112px 1fr;gap:8px}
  .rail-brand,.rail-divider,.rail-foot{display:none!important}
  .switch-character{height:48px;margin:0;padding:8px 10px;font-size:12px;letter-spacing:.04em}
  .switch-character span{font-size:16px;margin-right:5px}
  .rail-nav{display:grid;grid-template-columns:1fr 1fr;gap:7px}
  .rail-tab{min-height:48px;padding:7px;grid-template-columns:22px 1fr;column-gap:4px}
  .rail-tab>span{font-size:16px}.rail-tab b{font-size:12px}.rail-tab small{font-size:6px}

  .content-column{order:2;position:relative;z-index:3;width:100%;height:auto!important;min-height:100svh;background:#071017;border:0;overflow:visible}
  .unit-header{position:relative;top:auto;z-index:1;min-height:116px;padding:13px 12px;grid-template-columns:68px minmax(0,1fr) 72px;gap:9px;background:linear-gradient(135deg,#0c2029,#071017);backdrop-filter:none}
  .unit-header>img{width:68px;height:88px;border-radius:4px}
  .unit-title p{font-size:6px;letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .unit-name-line{display:block}.unit-title h1{margin:1px 0 6px;font-size:22px;line-height:1.08;white-space:normal}
  .unit-rarity{position:absolute;right:12px;top:12px;display:flex!important;gap:4px;padding:0;align-items:center}.unit-rarity strong{font-size:14px}.unit-rarity span{font-size:7px}.unit-rarity em{font-size:6px}
  .unit-attributes{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;margin-top:4px}
  .unit-attribute{display:flex;min-width:0!important;padding:3px;align-items:center;justify-content:center;background:rgba(20,48,59,.72)}
  .unit-attribute img{width:19px;height:19px}.unit-attribute strong{display:none}.unit-attribute small{display:none}
  .header-team{width:72px;min-width:72px;align-self:center;display:grid;place-items:center;gap:2px;padding:7px 4px;border:0;border-left:1px solid rgba(93,215,244,.55);background:rgba(16,38,47,.78);text-align:center}
  .header-team img{width:34px;height:34px}.header-team strong{font-size:8px;line-height:1.2;white-space:normal}.header-team small{font-size:6px}

  .content-page{padding:15px 12px 46px}.page-tabs{position:static!important;margin-bottom:14px;gap:15px}.page-tabs button{padding:8px 2px;font-size:13px}
  .skill-list{gap:10px}.skill-card{grid-template-columns:58px 1fr;padding:12px 10px;gap:10px}.skill-icon img{width:54px;height:54px}.skill-head h3{font-size:17px}.skill-main>p{font-size:13px;line-height:1.65}.level-strip{grid-template-columns:repeat(2,1fr);gap:4px}.level-strip div{min-height:58px;padding:8px;font-size:11px}
  .section-title{margin:22px 0 14px}.section-title h2{font-size:21px}.section-title span{font-size:7px}
  .stat-grid{grid-template-columns:repeat(2,1fr)}.stat{padding:12px}.stat strong{font-size:23px}.stat span{font-size:13px}.stat i{font-size:10px}
  .profile-fields{grid-template-columns:1fr}.profile-field{grid-template-columns:82px 1fr}.history-card{padding:15px}.history-card p{font-size:12px}.crf-list{grid-template-columns:1fr}.voice-meta{grid-template-columns:1fr 1fr}.voice-meta span:last-child{grid-column:1/-1}.voice-tools{flex-wrap:wrap}.voice-tools input{flex-basis:60%}.voice-item{grid-template-columns:34px 82px 1fr}.voice-item span{font-size:9px}

  .character-dialog{width:94vw;max-height:86svh}.character-filters{grid-template-columns:1fr 1fr;padding:10px}.character-filters input{grid-column:1/-1}.character-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:0 10px 12px}.character-card img{aspect-ratio:3/4}.character-card div{padding:5px}.character-card strong{font-size:9px}.character-card small{font-size:6px}
}

/* GAMEKEE comments: keep the plugin behaviour, restyle its surface to match
   the archive's dark CounterSide interface. */
.archive-comments{
  margin:0 28px 60px;
  padding-top:8px;
  border-top:1px solid rgba(93,215,244,.12);
}
.comment-frame{
  position:relative;
  padding:1px;
  overflow:hidden;
  border-radius:9px;
  background:linear-gradient(135deg,rgba(93,215,244,.72),rgba(93,215,244,.08) 32%,rgba(255,82,104,.42));
  box-shadow:0 18px 48px rgba(0,0,0,.22);
}
.comment-frame::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(115deg,rgba(93,215,244,.07),transparent 32%,rgba(255,82,104,.04));
}
#comment{position:relative;min-height:180px}
#comment .gamekee-comment-plugin-root{
  color:#d7e5e9!important;
  font-family:Inter,"Segoe UI","Microsoft YaHei",sans-serif!important;
}
#comment .gamekee-page-comment{
  padding:22px!important;
  color:#d7e5e9!important;
  background:linear-gradient(145deg,rgba(13,38,48,.98),rgba(5,20,28,.99))!important;
  border:1px solid rgba(93,215,244,.10)!important;
  border-radius:8px!important;
  box-shadow:none!important;
}
#comment .comment-title{
  margin-bottom:18px!important;
  padding-bottom:13px!important;
  color:#f1f8fa!important;
  font-size:18px!important;
  border-bottom:1px solid rgba(93,215,244,.16)!important;
}
#comment .comment-editor{
  background:#081820!important;
  border:1px solid rgba(93,215,244,.20)!important;
  border-radius:7px!important;
  box-shadow:inset 0 0 22px rgba(0,0,0,.22)!important;
}
#comment .comment-input{
  color:#eef8fb!important;
  background:transparent!important;
  caret-color:#5dd7f4!important;
}
#comment .comment-input:empty::after{color:#718a94!important}
#comment .send-btn{
  color:#fff!important;
  background:linear-gradient(100deg,#dc4f61,#a92f43)!important;
  border-color:rgba(255,122,139,.45)!important;
}
#comment .cancel-btn{
  color:#9eb4bb!important;
  background:#102832!important;
  border-color:#294753!important;
}
#comment .gamekee-page-comment-item{border-bottom-color:#203944!important}
#comment .user-name{color:#f2f8fa!important}
#comment .meta,
#comment .comment-actions,
#comment .child-actions{color:#78919a!important}
#comment .comment-content{color:#cbd9dd!important}
#comment .child-list{
  background:#081820!important;
  border:1px solid #1e3843!important;
  border-radius:6px!important;
}
#comment .child-content{color:#b9cbd1!important}
#comment .load-more{
  color:#5dd7f4!important;
  background:#102832!important;
  border:1px solid #294753!important;
  border-radius:5px!important;
}
#comment .no-more,
#comment .empty-box,
#comment .loading{color:#78919a!important}

@media(max-width:760px){
  .archive-comments{margin:0 12px 46px;padding-top:4px}
  #comment{min-height:150px}
  #comment .gamekee-page-comment{padding:14px!important}
  #comment .comment-title{margin-bottom:14px!important;font-size:17px!important}
  #comment .gamekee-page-comment-item{gap:9px!important;padding:15px 0!important}
  #comment .avatar{width:34px!important;height:34px!important;flex:0 0 34px!important}
}

/* 2026-08-21 control-deck pass: one uninterrupted portrait surface. */
.spine-column{display:block!important;position:relative;background:#071017}
.spine-stage{position:absolute;inset:0;min-height:0}
.spine-floating-tools{left:12px;top:auto;bottom:18px;transform:none;gap:5px}
.spine-tool-panel{left:69px;top:0;bottom:auto}
.spine-tool-panel:has(#spine-models){width:min(var(--model-width-desktop,310px),calc(100vw - 110px));max-width:none}
.spine-scale-control{position:absolute;z-index:9;right:14px;bottom:18px;display:flex;align-items:center;gap:8px;color:#8da3ad;font-size:9px;padding:4px 7px;border-radius:3px;background:rgba(5,17,23,.7);backdrop-filter:blur(7px)}
.spine-scale-control input{width:110px;accent-color:var(--red)}

@media(max-width:760px){
  html,body,.archive-app{width:100%;max-width:100%;min-width:0!important;overflow-x:hidden!important}
  .spine-column{position:fixed!important;inset:0!important;width:100vw;max-width:100vw}
  .spine-floating-tools{left:10px;bottom:12px;gap:4px}
  .spine-tool{width:48px;padding:5px 3px;font-size:7px}
  .spine-tool span{font-size:13px;margin-bottom:2px}
  .spine-tool-panel{left:55px;top:0;bottom:auto;max-height:230px}
  .spine-tool-panel:has(#spine-models){width:min(var(--model-width-mobile,300px),calc(100vw - 70px));max-width:none}
  #spine-models{gap:6px;overflow-x:auto!important;overflow-y:hidden!important}
  #spine-models .model-pill{flex:0 0 82px;min-width:82px}
  #spine-models .model-pill img{height:84px}
  #spine-models .model-pill span{padding:5px 2px;font-size:7px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .spine-scale-control{right:8px;bottom:12px;padding:3px 5px;font-size:7px}
  .spine-scale-control input{width:64px}
  .mobile-ui-hidden .spine-floating-tools,.mobile-ui-hidden .spine-scale-control,.mobile-ui-hidden .switch-character{opacity:0;pointer-events:none}

  .rail{display:block!important;width:100%;max-width:100%;margin-top:100svh;padding:9px 10px;overflow:hidden}
  .switch-character{position:fixed;z-index:18;top:10px;right:10px;width:auto;height:38px;margin:0;padding:7px 10px;border-radius:19px;background:rgba(5,20,27,.82);box-shadow:0 6px 20px rgba(0,0,0,.25),inset 2px 0 0 var(--cyan);backdrop-filter:blur(8px);transition:opacity .2s}
  .switch-character span{font-size:13px;margin-right:4px}
  .rail-nav{grid-template-columns:1fr 1fr}

  .content-column,.content-page,.unit-header,.unit-title,.skill-list,.skill-card,.skill-main{min-width:0;max-width:100%}
  .content-column{overflow-x:hidden!important}
  .content-page{width:100%;overflow-x:hidden}
  .skill-card{width:100%}
  .skill-main>p,.level-strip div{overflow-wrap:anywhere;word-break:break-word}
  .unit-header{width:100%;min-height:168px;padding:14px 12px;grid-template-columns:124px minmax(0,1fr);gap:12px;align-items:start;overflow:hidden}
  .unit-header>img{width:124px;height:142px;grid-row:1;border-radius:5px;object-fit:cover;object-position:top}
  .unit-title{min-width:0;padding-top:2px}
  .unit-title p{font-size:7px;letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .unit-name-line{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
  .unit-title h1{margin:2px 0 5px;font-size:24px;line-height:1.05;white-space:nowrap}
  .unit-rarity{position:static;display:flex!important;gap:4px;padding:0;align-items:center}
  .unit-rarity strong{font-size:14px}.unit-rarity span{font-size:7px}.unit-rarity em{font-size:6px}
  .unit-attributes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:7px}
  .unit-attribute{display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:auto auto;gap:0 4px;min-height:42px;padding:4px 5px;justify-content:stretch;text-align:left;background:linear-gradient(135deg,rgba(23,50,61,.9),rgba(10,26,34,.72))}
  .unit-attribute img{grid-row:1/3;width:22px;height:22px;align-self:center}
  .unit-attribute strong{display:block;font-size:8px;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .unit-attribute small{display:block;font-size:6px;line-height:1.1;color:#718b96}
  .header-team{position:absolute;right:12px;bottom:14px;width:calc((100% - 160px)/3);min-width:0;height:42px;display:grid;grid-template-columns:22px minmax(0,1fr);grid-template-rows:auto auto;gap:0 4px;align-items:center;justify-content:stretch;padding:4px 5px;border:0;border-radius:3px;background:linear-gradient(135deg,rgba(23,50,61,.9),rgba(10,26,34,.72));text-align:left}
  .header-team img{grid-row:1/3;width:22px;height:22px}.header-team strong{font-size:7px;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.header-team small{font-size:6px;margin:0}
}

/* 2026-08-24 premium visual pass. The 2026-08-24 satisfied build is kept as a
   complete external snapshot, so these rules remain a reversible skin layer. */
:root{
  --premium-surface:rgba(12,29,38,.72);
  --premium-surface-strong:rgba(15,35,45,.9);
  --premium-glow:rgba(93,215,244,.16);
  --premium-red-glow:rgba(255,91,104,.18);
  --premium-gold:#f5c85b;
}

body{
  background:
    radial-gradient(ellipse at 18% -10%,rgba(52,112,130,.14),transparent 38%),
    radial-gradient(ellipse at 76% 18%,rgba(43,91,108,.12),transparent 32%),
    #050d13;
}
.archive-app{
  background:
    radial-gradient(circle at 77% 7%,rgba(42,102,121,.17),transparent 28%),
    linear-gradient(120deg,#061017,#07131a 46%,#061017);
}
.rail{
  border-right:0;
  background:linear-gradient(180deg,rgba(4,12,18,.985),rgba(5,15,21,.96));
  box-shadow:18px 0 48px rgba(0,0,0,.16);
}
.rail:after{
  content:"";position:absolute;right:0;top:4%;bottom:4%;width:1px;
  background:linear-gradient(transparent,rgba(93,215,244,.22) 28%,rgba(255,91,104,.16) 70%,transparent);
}
.rail-brand img{transition:filter .28s ease,opacity .28s ease,transform .28s ease}
.rail-brand:hover img{transform:translateY(-2px);filter:drop-shadow(0 6px 15px rgba(93,215,244,.18));opacity:1}
.rail-brand.counterside img{opacity:.82}
.rail-divider{background:linear-gradient(90deg,transparent,rgba(93,215,244,.3),transparent)}
.switch-character{
  position:relative;overflow:hidden;border:0;border-radius:9px;
  background:linear-gradient(105deg,rgba(20,55,67,.82),rgba(9,28,37,.78));
  box-shadow:inset 0 0 0 1px rgba(93,215,244,.08),0 10px 30px rgba(0,0,0,.16);
}
.switch-character:after{
  content:"";position:absolute;inset:0;transform:translateX(-115%);
  background:linear-gradient(100deg,transparent,rgba(255,255,255,.1),transparent);transition:transform .55s ease;
}
.switch-character:hover{transform:translateY(-2px);background:linear-gradient(105deg,rgba(27,73,87,.92),rgba(12,35,45,.86))}
.switch-character:hover:after{transform:translateX(115%)}
.rail-tab{
  border:0;border-radius:9px;background:transparent;
  transition:color .25s ease,background .25s ease,transform .25s ease,box-shadow .25s ease;
}
.rail-tab:hover{color:#dcecef;background:rgba(20,47,58,.42);transform:translateX(3px)}
.rail-tab.active{
  background:linear-gradient(110deg,rgba(255,91,104,.9),rgba(146,43,58,.62) 62%,rgba(19,43,53,.25));
  box-shadow:0 12px 34px rgba(255,91,104,.13),inset 1px 0 rgba(255,255,255,.28);
}

.content-column{
  border-right:0;
  background-color:rgba(5,15,21,.92);
  background-image:
    linear-gradient(rgba(93,215,244,.018) 1px,transparent 1px),
    linear-gradient(90deg,rgba(93,215,244,.014) 1px,transparent 1px);
  background-size:32px 32px;
}
.unit-header{
  border-bottom:0;
  background:linear-gradient(112deg,rgba(7,18,25,.96),rgba(8,23,31,.89) 62%,rgba(7,17,23,.94));
  box-shadow:0 18px 48px rgba(0,0,0,.16),inset 0 -1px rgba(93,215,244,.13);
}
.unit-header:after{
  content:"";position:absolute;left:28px;right:28px;bottom:0;height:1px;
  background:linear-gradient(90deg,var(--red),rgba(93,215,244,.4) 32%,transparent 78%);opacity:.5;
}
.avatar-frame{
  position:relative;width:92px;height:104px;padding:4px;
  background:linear-gradient(145deg,rgba(245,200,91,.76),rgba(93,215,244,.5) 42%,rgba(255,91,104,.72));
  clip-path:polygon(0 0,88% 0,100% 12%,100% 100%,12% 100%,0 88%);
  filter:drop-shadow(0 13px 22px rgba(0,0,0,.36));
}
.avatar-frame:before{
  content:"";position:absolute;inset:1px;z-index:0;
  background:#08141b;clip-path:inherit;
}
.avatar-frame:after{
  content:attr(data-rarity);position:absolute;z-index:3;right:4px;bottom:4px;padding:1px 5px;
  color:#081017;background:var(--premium-gold);font-size:7px;font-weight:900;letter-spacing:.08em;
}
.avatar-frame img{position:relative;z-index:1;width:100%;height:100%;object-fit:cover;object-position:top;clip-path:inherit}
.avatar-frame i{position:absolute;z-index:4;left:1px;top:1px;width:23px;height:2px;background:#fff;box-shadow:0 4px 12px rgba(255,255,255,.5)}
.unit-title h1{text-shadow:0 4px 24px rgba(0,0,0,.42)}
.unit-title p{color:var(--premium-gold);text-shadow:0 0 16px rgba(245,200,91,.25)}
.unit-attribute{
  border:0!important;border-radius:7px;
  background:linear-gradient(135deg,rgba(25,55,67,.7),rgba(9,24,32,.26));
  box-shadow:none;transition:background .2s ease,transform .2s ease;
}
.unit-attribute:hover{background:linear-gradient(135deg,rgba(34,75,89,.78),rgba(11,31,40,.38));transform:translateY(-1px)}
.unit-attribute img{filter:drop-shadow(0 3px 8px rgba(0,0,0,.5))}
.header-team{
  position:relative;border:0;border-left:1px solid rgba(93,215,244,.45);border-radius:0;
  background:linear-gradient(90deg,rgba(20,48,59,.56),rgba(7,22,29,.12));
  box-shadow:none;overflow:hidden;
}
.header-team:after{content:"";position:absolute;right:-24px;bottom:-32px;width:90px;height:90px;border:1px solid rgba(93,215,244,.1);transform:rotate(45deg)}
.header-team img{filter:drop-shadow(0 0 12px rgba(255,255,255,.12)) drop-shadow(0 6px 9px #000)}

.page-tabs{gap:26px}
.page-tabs button{border:0!important;background:transparent!important;letter-spacing:.04em;transition:color .2s ease,transform .2s ease}
.page-tabs button:hover{color:#d7e8ed;transform:translateY(-1px)}
.page-tabs button:after{height:2px;box-shadow:0 0 12px rgba(255,91,104,.5)}
.section-title:after{background:linear-gradient(90deg,rgba(93,215,244,.38),transparent)}

.skill-list{gap:16px}
.skill-card{
  border:0;border-radius:13px;overflow:hidden;
  background:
    radial-gradient(circle at 5% 18%,rgba(93,215,244,.07),transparent 28%),
    linear-gradient(105deg,rgba(14,34,44,.9),rgba(7,22,29,.5) 70%,rgba(7,18,24,.18));
  box-shadow:inset 1px 0 rgba(93,215,244,.48),0 13px 38px rgba(0,0,0,.1);
  transition:transform .24s ease,box-shadow .24s ease,background .24s ease;
}
.skill-card:hover{
  transform:translateY(-2px);
  background:radial-gradient(circle at 5% 18%,rgba(93,215,244,.11),transparent 31%),linear-gradient(105deg,rgba(17,41,51,.94),rgba(8,24,31,.55) 72%,rgba(7,18,24,.16));
  box-shadow:inset 2px 0 var(--cyan),0 18px 44px rgba(0,0,0,.18);
}
.skill-icon img{border:0;border-radius:10px;box-shadow:0 10px 26px rgba(0,0,0,.45),0 0 0 1px rgba(255,255,255,.13)}
.skill-icon span{border-radius:4px 4px 4px 0;box-shadow:0 5px 14px rgba(255,91,104,.2)}
.mechanics span{border:0;border-radius:12px;background:rgba(14,54,68,.72);box-shadow:inset 0 0 0 1px rgba(93,215,244,.08)}
.level-strip{gap:0;border-top:1px solid rgba(93,215,244,.18)}
.level-strip div{border:0;border-right:1px solid rgba(93,215,244,.1);background:transparent}
.level-strip div:last-child{border-right:0}
.level-strip b{text-shadow:0 0 12px var(--premium-red-glow)}

.inner-section{border-top:0}
.level-controller{border:0;border-radius:11px;background:linear-gradient(105deg,rgba(17,41,51,.9),rgba(8,23,30,.5));box-shadow:inset 2px 0 var(--cyan)}
.quick-levels button,.tag{border:0!important;border-radius:12px;background:rgba(20,54,67,.74);transition:background .2s,transform .2s}
.quick-levels button:hover,.tag:hover{background:rgba(38,91,107,.74);transform:translateY(-1px)}
.stat{border:0!important;border-radius:11px;background:linear-gradient(135deg,rgba(17,42,52,.86),rgba(8,23,30,.62));box-shadow:0 10px 24px rgba(0,0,0,.08)}
.data-note{border:0;border-left:2px solid rgba(245,200,91,.6);border-radius:0 8px 8px 0;background:linear-gradient(90deg,rgba(74,61,21,.25),transparent)}

.archive-section+.archive-section{border-top:0}
.dossier{border:0;border-left:2px solid rgba(93,215,244,.55);border-radius:11px;background:linear-gradient(135deg,rgba(16,40,50,.9),rgba(7,21,28,.64));box-shadow:0 18px 44px rgba(0,0,0,.1)}
.dossier-head{border-bottom:1px solid rgba(93,215,244,.24)}
.profile-fields{border:0;background:transparent;gap:0}
.profile-field{border:0;border-bottom:1px solid rgba(93,215,244,.09);background:transparent}
.profile-field b{background:transparent;color:#7f99a4}.profile-field span{color:#e7f2f4}
.history-card,.crf-row,.voice-meta span,.voice-item{border:0!important;border-radius:10px;background:linear-gradient(125deg,rgba(16,39,49,.88),rgba(7,21,28,.58));box-shadow:0 10px 28px rgba(0,0,0,.07)}
.team-sign img{border:0;border-radius:50%;background:radial-gradient(circle,rgba(38,75,87,.65),rgba(9,24,31,.3));box-shadow:0 0 25px rgba(93,215,244,.09)}
.crf-bar{border-radius:5px;overflow:hidden}.crf-bar i{box-shadow:0 0 12px rgba(93,215,244,.28)}
.voice-tools select,.voice-tools input,.voice-tools button{border:0!important;border-radius:8px;background:rgba(15,36,46,.82);box-shadow:inset 0 0 0 1px rgba(93,215,244,.07)}
.voice-item{overflow:hidden;transition:background .2s ease,transform .2s ease}
.voice-item:hover{background:linear-gradient(125deg,rgba(22,52,63,.9),rgba(8,25,32,.62));transform:translateX(2px)}
.voice-item button{background:rgba(25,66,80,.7);transition:background .2s,color .2s}
.voice-item:hover button{background:rgba(36,91,107,.78);color:#fff}
.voice-item.no-translation>span:last-child{color:#6f8791;font-style:italic}

.spine-column{background:#061017}
.spine-stage{background:radial-gradient(ellipse at 54% 38%,#17313b 0,#0b1d25 38%,#07141b 68%,#050c11 100%)}
.spine-stage:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,rgba(4,12,17,.18),transparent 15%,transparent 84%,rgba(4,12,17,.12))}
.spine-tool{border:0!important;border-radius:9px;background:rgba(7,27,36,.74);box-shadow:0 10px 30px rgba(0,0,0,.17),inset 0 0 0 1px rgba(93,215,244,.06);backdrop-filter:blur(12px);transition:background .2s,transform .2s,box-shadow .2s}
.spine-tool:hover{transform:translateX(2px);background:rgba(18,55,66,.84);box-shadow:0 12px 30px rgba(0,0,0,.24),0 0 18px rgba(93,215,244,.06)}
.spine-tool.active{background:linear-gradient(135deg,#ff6572,#b63c4a)}
.spine-tool-panel{border:0!important;border-left:2px solid rgba(93,215,244,.75)!important;border-radius:10px;background:rgba(5,17,23,.94);box-shadow:0 22px 60px rgba(0,0,0,.48);backdrop-filter:blur(18px);animation:premium-panel-in .18s ease-out}
.control-pills button{border:0!important;border-radius:6px;background:rgba(18,48,60,.76)}
.spine-scale-control{border-radius:15px;background:rgba(5,17,23,.55);box-shadow:inset 0 0 0 1px rgba(93,215,244,.05)}

.character-modal .modal-backdrop{background:rgba(2,8,12,.72);backdrop-filter:blur(10px)}
.character-dialog{border:0!important;border-radius:14px;background:linear-gradient(145deg,rgba(12,34,43,.98),rgba(5,17,23,.98));box-shadow:0 32px 100px rgba(0,0,0,.62)}
.character-dialog header{background:linear-gradient(90deg,rgba(25,63,75,.66),rgba(10,30,38,.28));box-shadow:inset 0 -1px rgba(93,215,244,.16)}
.character-filters input,.character-filters select{border:0!important;border-radius:8px;background:rgba(17,43,53,.8);box-shadow:inset 0 0 0 1px rgba(93,215,244,.07)}
.character-card{border:0!important;border-radius:9px;background:linear-gradient(145deg,rgba(20,45,55,.9),rgba(8,23,30,.82));box-shadow:0 12px 30px rgba(0,0,0,.16);transition:transform .2s,box-shadow .2s}
.character-card:hover{transform:translateY(-3px);box-shadow:0 18px 38px rgba(0,0,0,.28)}
.character-card.active{box-shadow:0 0 0 1px var(--cyan),0 16px 38px rgba(0,0,0,.28),0 0 22px rgba(93,215,244,.08)}

@keyframes premium-panel-in{from{opacity:0;transform:translateX(-7px) scale(.985)}to{opacity:1;transform:none}}
@keyframes premium-content-in{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.content-page.active .skill-card,.content-page.active .archive-section{animation:premium-content-in .34s ease both}
.content-page.active .skill-card:nth-child(2){animation-delay:.035s}.content-page.active .skill-card:nth-child(3){animation-delay:.07s}.content-page.active .skill-card:nth-child(4){animation-delay:.105s}

@media(max-width:1500px){
  .avatar-frame{width:76px;height:88px}
}

@media(max-width:760px){
  .rail:after{display:none}
  .unit-header{grid-template-columns:124px minmax(0,1fr);box-shadow:0 18px 38px rgba(0,0,0,.2),inset 0 -1px rgba(93,215,244,.12)}
  .unit-header:after{left:12px;right:12px}
  .avatar-frame{width:124px;height:142px;padding:3px;grid-row:1}
  .avatar-frame:after{font-size:6px;right:3px;bottom:3px}
  .unit-attribute{border-radius:7px;background:linear-gradient(135deg,rgba(24,54,65,.84),rgba(9,25,32,.56))}
  .header-team{border-left:1px solid rgba(93,215,244,.34);border-radius:0;background:linear-gradient(90deg,rgba(20,48,59,.56),rgba(7,22,29,.16))}
  .skill-card{border-radius:11px;box-shadow:inset 2px 0 rgba(93,215,244,.38),0 10px 25px rgba(0,0,0,.08)}
  .level-strip{border-top:0;gap:4px}.level-strip div{border-right:0;border-top:1px solid rgba(93,215,244,.18)}
  .spine-tool{border-radius:8px}
  .spine-tool-panel{border-left:2px solid rgba(93,215,244,.75)!important}
  .character-dialog{border-radius:12px}
}

@media(prefers-reduced-motion:reduce){
  *,*:before,*:after{scroll-behavior:auto!important;animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}
}

/* Header composition v2: avatar / intelligence grid / independent rarity. */
.mobile-character-switch{display:none}
.unit-header{
  min-height:188px;
  grid-template-columns:132px minmax(0,1fr) 104px;
  gap:20px;
  padding:20px 28px;
  align-items:center;
}
.avatar-frame{width:132px;height:154px}
.unit-title{min-width:0}
.unit-name-line{display:flex;align-items:flex-end;gap:13px;min-width:0}
.unit-name-line h1{margin:2px 0 8px;font-size:32px;white-space:nowrap}
.unit-name-line>em{padding-bottom:10px;color:var(--muted);font-size:11px;font-style:normal;white-space:nowrap}
.classification-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(102px,1fr));
  gap:6px;
  max-width:470px;
}
.classification-grid .unit-attributes{display:contents}
.unit-attribute,.classification-grid .header-team{
  position:relative;
  min-width:0;
  min-height:48px;
  display:grid;
  grid-template-columns:29px minmax(0,1fr);
  grid-template-rows:auto auto;
  gap:0 7px;
  align-items:center;
  justify-content:stretch;
  padding:6px 8px;
  text-align:left;
  overflow:hidden;
}
.unit-attribute img,.classification-grid .header-team img{
  grid-row:1/3;
  width:29px;
  height:29px;
  object-fit:contain;
  margin:0;
}
.unit-attribute strong,.classification-grid .header-team strong{
  min-width:0;
  font-size:10px;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.unit-attribute small,.classification-grid .header-team small{
  min-width:0;
  margin:0;
  color:var(--muted);
  font-size:7px;
  line-height:1.1;
  white-space:nowrap;
}
.classification-grid .header-team{
  width:auto;
  height:auto;
  align-self:stretch;
  border:0;
  border-radius:7px;
  background:linear-gradient(135deg,rgba(25,55,67,.7),rgba(9,24,32,.26));
}
.classification-grid .header-team:after{display:none}
.classification-grid .header-team div{display:contents}
.unit-rarity{
  display:flex!important;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  align-self:center;
  min-width:0;
  text-align:center;
}
.unit-rarity strong{font-size:34px;line-height:1}
.unit-rarity span{margin-top:7px;font-size:13px;line-height:1}

@media(max-width:1500px) and (min-width:761px){
  .unit-header{grid-template-columns:112px minmax(0,1fr) 86px;gap:14px;padding-inline:20px}
  .avatar-frame{width:112px;height:134px}
  .unit-name-line h1{font-size:28px}
  .classification-grid{grid-template-columns:repeat(3,minmax(88px,1fr));gap:5px}
  .unit-attribute,.classification-grid .header-team{grid-template-columns:25px minmax(0,1fr);padding:5px 6px}
  .unit-attribute img,.classification-grid .header-team img{width:25px;height:25px}
  .unit-rarity strong{font-size:29px}
}

@media(max-width:760px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:100%!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y!important;
  }
  .archive-app{
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  .spine-stage{touch-action:pan-y!important}
  .rail{margin-top:100svh!important;overflow:visible!important}
  .content-column{height:auto!important;min-height:0!important;overflow:visible!important;pointer-events:auto}
  .rail .switch-character{display:none!important}
  .mobile-character-switch{
    position:fixed;
    z-index:80;
    top:max(10px,env(safe-area-inset-top));
    right:max(10px,env(safe-area-inset-right));
    display:flex;
    align-items:center;
    gap:4px;
    width:auto;
    height:34px;
    padding:0 10px;
    border:0;
    border-radius:18px;
    color:var(--cyan);
    background:rgba(5,20,27,.82);
    box-shadow:0 7px 22px rgba(0,0,0,.28),inset 0 0 0 1px rgba(93,215,244,.24);
    backdrop-filter:blur(10px);
    font-size:11px;
    font-weight:800;
    transition:opacity .2s ease;
  }
  .mobile-character-switch span{font-size:13px}
  .mobile-ui-hidden .mobile-character-switch{opacity:0;pointer-events:none}
  .unit-header{
    width:100%;
    min-height:132px;
    grid-template-columns:96px minmax(0,1fr) 43px;
    gap:8px;
    padding:10px;
    align-items:start;
    overflow:hidden;
  }
  .avatar-frame{grid-row:auto;width:96px;height:112px;padding:3px}
  .unit-title p{font-size:5.5px;letter-spacing:.08em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .unit-name-line{gap:5px;align-items:flex-end}
  .unit-name-line h1{margin:1px 0 4px;font-size:20px;line-height:1.05;white-space:nowrap}
  .unit-name-line>em{padding-bottom:5px;font-size:6px}
  .classification-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;max-width:none}
  .unit-attribute,.classification-grid .header-team{
    min-height:36px;
    grid-template-columns:18px minmax(0,1fr);
    padding:3px 4px;
    gap:0 3px;
    border-radius:5px;
  }
  .unit-attribute img,.classification-grid .header-team img{width:18px;height:18px}
  .unit-attribute strong,.classification-grid .header-team strong{font-size:6.5px}
  .unit-attribute small,.classification-grid .header-team small{font-size:5px}
  .unit-rarity{position:static!important;align-self:start;padding-top:4px}
  .unit-rarity strong{font-size:19px}
  .unit-rarity span{margin-top:4px;font-size:8px;letter-spacing:-1px}
}

/* Detail corrections: readable skill labels and desktop rarity alignment. */
.skill-icon{display:flex;flex-direction:column;align-items:center;align-self:start}
.skill-icon span{
  position:static;
  display:block;
  width:100%;
  margin-top:7px;
  padding:0;
  color:#a9c2cb;
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
  font-size:10px;
  font-weight:700;
  line-height:1.3;
  text-align:center;
  white-space:nowrap;
}
.unit-rarity{transform:translateY(19px)}
.spine-stage canvas{image-rendering:auto}

@media(max-width:760px){
  .unit-rarity{transform:none}
  .skill-icon span{margin-top:5px;font-size:8px}
}

/* Layout experiment, safely backed up before this pass. */
@media(min-width:1501px){
  .archive-app{grid-template-columns:220px minmax(560px,40vw) minmax(720px,1fr)}
}
@media(min-width:981px) and (max-width:1500px){
  .archive-app{grid-template-columns:190px minmax(500px,40vw) minmax(480px,1fr)}
}
.unit-attribute strong,.classification-grid .header-team strong{font-size:11px}
.unit-attribute small,.classification-grid .header-team small{font-size:8.5px;color:#9eb2ba}
.spine-column:before{
  content:"";
  position:absolute;
  z-index:6;
  top:0;
  bottom:0;
  left:0;
  width:96px;
  pointer-events:none;
  background:linear-gradient(90deg,#061017 0,rgba(6,16,23,.88) 20%,rgba(6,16,23,.48) 58%,transparent 100%);
}
.voice-item{--voice-progress:0%;position:relative}
.voice-item>span:last-child{
  background-image:linear-gradient(90deg,var(--cyan),var(--cyan)),linear-gradient(90deg,rgba(93,215,244,.14),rgba(93,215,244,.025));
  background-repeat:no-repeat;
  background-position:left bottom,left top;
  background-size:var(--voice-progress) 2px,var(--voice-progress) 100%;
  will-change:background-size;
}
.voice-item.playing>span:last-child{color:#eefbff}

@media(max-width:760px){
  .unit-attribute strong,.classification-grid .header-team strong{font-size:7.5px}
  .unit-attribute small,.classification-grid .header-team small{font-size:6px}
  .spine-column:before{display:none}
}

/* Portrait standard: every archive portrait keeps its source aspect ratio.
   Frames may crop overflow, but images are never stretched on either axis. */
.avatar-frame img,
.character-card img,
.switch-character-faces img{
  object-fit:cover!important;
  object-position:center top!important;
}

/* Desktop rail v2: navigation first, brands anchored at the bottom. */
@media(min-width:761px){
  .rail{gap:0}
  .rail .switch-character{order:1}
  .rail .rail-nav{order:2}
  .rail .rail-brand.counterside{order:10;margin-top:auto;height:76px}
  .rail .rail-brand.gamekee{order:11;height:58px}
  .rail .rail-divider{display:none}
  .rail .rail-foot{order:12;margin-top:8px;padding-top:10px}

  .switch-character{
    min-height:96px;
    margin:0 0 18px;
    padding:15px 13px;
    display:grid;
    grid-template-columns:30px minmax(0,1fr) auto 10px;
    grid-template-rows:auto auto;
    align-items:center;
    column-gap:9px;
    text-align:left;
    letter-spacing:0;
    background:
      radial-gradient(circle at 88% 20%,rgba(93,215,244,.2),transparent 35%),
      linear-gradient(135deg,rgba(20,63,77,.94),rgba(7,25,34,.96));
    box-shadow:inset 3px 0 0 var(--cyan),0 15px 34px rgba(0,0,0,.24);
  }
  .switch-character>span{margin:0}
  .switch-character-icon{
    grid-row:1/3;
    width:30px;height:30px;
    display:grid;place-items:center;
    border-radius:50%;
    color:#061017;background:var(--cyan);
    font-size:18px!important;font-weight:900;
    box-shadow:0 0 20px rgba(93,215,244,.26);
  }
  .switch-character-copy{display:flex;flex-direction:column;align-self:end;line-height:1.15}
  .switch-character-copy b{color:#f3fbfd;font-size:16px;letter-spacing:.06em}
  .switch-character-copy small{margin-top:6px;color:#8fb1bd;font-size:8px;letter-spacing:.13em}
  .switch-character-faces{
    grid-row:1/3;
    display:flex;
    align-items:center;
    padding-left:6px;
  }
  .switch-character-faces img{
    width:31px;height:39px;
    margin-left:-9px;
    border-radius:5px;
    box-shadow:0 0 0 2px #102b36,0 6px 14px rgba(0,0,0,.35);
  }
  .switch-character-faces:after{content:"•••";margin-left:5px;color:var(--cyan);font-size:9px;letter-spacing:1px}
  .switch-character>i{grid-row:1/3;color:var(--cyan);font-size:24px;font-style:normal;opacity:.8}
}

/* Character archive entrance v2: wide typography, no thumbnail clutter. */
@media(min-width:761px){
  .switch-character{
    min-height:126px;
    padding:14px 14px 12px;
    grid-template-columns:42px minmax(0,1fr) 13px;
    grid-template-rows:18px minmax(52px,1fr) 22px;
    column-gap:10px;
    row-gap:5px;
    border-radius:0;
    clip-path:polygon(0 0,calc(100% - 15px) 0,100% 15px,100% 100%,15px 100%,0 calc(100% - 15px));
    background:
      linear-gradient(90deg,rgba(93,215,244,.11) 1px,transparent 1px) 0 0/34px 100%,
      radial-gradient(circle at 88% 16%,rgba(93,215,244,.2),transparent 35%),
      linear-gradient(135deg,rgba(17,58,71,.96),rgba(6,24,33,.98));
    box-shadow:0 18px 42px rgba(0,0,0,.28);
  }
  .switch-character:before{
    content:"";
    position:absolute;
    z-index:0;
    left:0;top:0;bottom:0;
    width:4px;
    background:linear-gradient(var(--cyan),rgba(93,215,244,.12));
  }
  .switch-character:after{
    z-index:0;
    transform:none;
    background:linear-gradient(115deg,transparent 48%,rgba(255,255,255,.045) 49%,transparent 64%);
    transition:transform .45s ease;
  }
  .switch-character:hover:after{transform:translateX(12%)}
  .switch-character>*{position:relative;z-index:1}
  .switch-character-kicker{
    grid-column:1/-1;
    grid-row:1;
    color:#89dff3;
    font-size:7px!important;
    font-weight:800;
    letter-spacing:.21em;
    white-space:nowrap;
    opacity:.86;
  }
  .switch-character-icon{
    grid-column:1;
    grid-row:2;
    width:42px;height:42px;
    border:1px solid rgba(93,215,244,.58);
    color:var(--cyan);
    background:rgba(4,18,25,.5);
    font-size:22px!important;
    box-shadow:inset 0 0 18px rgba(93,215,244,.09),0 0 20px rgba(93,215,244,.08);
  }
  .switch-character-copy{
    grid-column:2;
    grid-row:2;
    align-self:center;
    min-width:0;
    line-height:1.2;
  }
  .switch-character-copy b{
    display:block;
    color:#f4fbfd;
    font-size:19px;
    letter-spacing:.05em;
    white-space:nowrap;
  }
  .switch-character-copy small{
    display:block;
    margin-top:5px;
    color:#8ba8b3;
    font-size:9px;
    letter-spacing:.09em;
    white-space:nowrap;
  }
  .switch-character>i{
    grid-column:3;
    grid-row:2;
    align-self:center;
    color:var(--cyan);
    font-size:27px;
    line-height:1;
  }
  .switch-character-meta{
    grid-column:1/-1;
    grid-row:3;
    align-self:end;
    padding-top:7px;
    border-top:1px solid rgba(93,215,244,.16);
    color:#7895a0;
    font-size:7.5px!important;
    letter-spacing:.08em;
    white-space:nowrap;
  }
  .switch-character:hover{
    transform:translateY(-2px);
    background:
      linear-gradient(90deg,rgba(93,215,244,.13) 1px,transparent 1px) 0 0/34px 100%,
      radial-gradient(circle at 88% 16%,rgba(93,215,244,.27),transparent 38%),
      linear-gradient(135deg,rgba(21,70,84,.98),rgba(8,30,40,.98));
  }
}

/* Keep voice labels compact while making the spoken subtitle readable. */
.voice-item>span:last-child{
  font-size:12px!important;
  line-height:1.6;
}
@media(max-width:760px){
  .voice-item>span:last-child{
    font-size:11px!important;
  }
}

@media(min-width:761px) and (max-width:1500px){
  .switch-character{padding-inline:10px;grid-template-columns:36px minmax(0,1fr) 10px;column-gap:7px}
  .switch-character-icon{width:36px;height:36px;font-size:19px!important}
  .switch-character-copy b{font-size:17px}
  .switch-character-copy small{font-size:8px}
  .switch-character-meta{font-size:6.5px!important;letter-spacing:.055em}
}

/* Character archive entrance v3: tall glass capsule inspired by the HUD. */
@media(min-width:761px){
  .switch-character{
    min-height:124px;
    padding:13px 12px;
    display:grid;
    grid-template-columns:44px minmax(0,1fr) 50px;
    grid-template-rows:32px 44px 18px;
    gap:5px 8px;
    align-items:center;
    border-radius:34px;
    clip-path:none;
    overflow:hidden;
    background:
      radial-gradient(ellipse at 35% 50%,rgba(186,233,246,.2),transparent 46%),
      linear-gradient(90deg,rgba(93,215,244,.26),rgba(186,224,235,.16) 50%,rgba(21,67,82,.68));
    box-shadow:
      0 0 0 1px rgba(155,235,255,.78),
      0 0 0 4px rgba(93,215,244,.12),
      inset 0 0 20px rgba(196,241,255,.24),
      inset 0 0 0 2px rgba(255,255,255,.12),
      0 14px 36px rgba(0,0,0,.28),
      0 0 26px rgba(93,215,244,.16);
  }
  .switch-character:before{
    content:"";
    position:absolute;
    inset:5px;
    width:auto;
    z-index:0;
    border:1px solid rgba(215,249,255,.3);
    border-radius:29px;
    background:linear-gradient(90deg,rgba(255,255,255,.13),transparent 32%,rgba(93,215,244,.08));
    pointer-events:none;
  }
  .switch-character:after{
    content:"";
    position:absolute;
    inset:-30% -60%;
    z-index:0;
    transform:translateX(-35%) rotate(-10deg);
    background:linear-gradient(100deg,transparent 42%,rgba(255,255,255,.16) 49%,transparent 56%);
    transition:transform .6s ease;
    pointer-events:none;
  }
  .switch-character:hover:after{transform:translateX(35%) rotate(-10deg)}
  .switch-character>*{position:relative;z-index:1}
  .switch-character-copy{
    grid-column:1/3;
    grid-row:1;
    display:flex;
    flex-direction:row;
    align-items:baseline;
    gap:7px;
    min-width:0;
    line-height:1;
    white-space:nowrap;
  }
  .switch-character-copy b{display:block;color:#f5fdff;font-size:18px;letter-spacing:.05em;text-shadow:0 0 13px rgba(210,247,255,.28)}
  .switch-character-copy small{display:block;margin:0;color:#9cd9e8;font-size:6px;letter-spacing:.11em}
  .switch-character-orbit{
    grid-column:1;
    grid-row:2;
    width:38px;height:38px;
    display:grid;
    place-items:center;
    margin:0!important;
    border:1px solid rgba(213,247,255,.62);
    border-radius:50%;
    color:#d5f8ff;
    background:rgba(131,209,228,.14);
    font-size:20px!important;
    font-weight:700;
    box-shadow:inset 0 0 14px rgba(211,247,255,.16),0 0 13px rgba(93,215,244,.12);
  }
  .switch-character-matrix{
    grid-column:2;
    grid-row:2;
    width:38px;
    display:grid;
    grid-template-columns:repeat(3,9px);
    grid-auto-rows:9px;
    gap:3px;
    justify-self:center;
    margin:0!important;
  }
  .switch-character-matrix i{display:block;border:1px solid rgba(197,242,252,.6);border-radius:2px;background:rgba(169,226,240,.13);box-shadow:inset 0 0 5px rgba(255,255,255,.1)}
  .switch-character-matrix i:nth-child(3){background:rgba(93,215,244,.8);box-shadow:0 0 10px rgba(93,215,244,.55)}
  .switch-character-current{
    grid-column:3;
    grid-row:1/4;
    width:48px;height:72px;
    align-self:center;
    justify-self:end;
    margin:0!important;
    padding:2px;
    border-radius:17px;
    background:linear-gradient(145deg,rgba(231,251,255,.88),rgba(93,215,244,.42),rgba(255,91,104,.5));
    box-shadow:0 0 16px rgba(93,215,244,.2),0 7px 16px rgba(0,0,0,.28);
    overflow:hidden;
  }
  .switch-character-current img{display:block;width:100%;height:100%;border-radius:15px;object-fit:cover;object-position:center top;background:#0c1d26}
  .switch-character-meta{
    grid-column:1/3;
    grid-row:3;
    align-self:center;
    margin:0!important;
    padding:0;
    border:0;
    color:#b3e7f2;
    font-size:7px!important;
    letter-spacing:.07em;
    white-space:nowrap;
    opacity:.78;
  }
  .switch-character:hover{
    transform:translateY(-2px);
    background:
      radial-gradient(ellipse at 35% 50%,rgba(199,240,250,.28),transparent 48%),
      linear-gradient(90deg,rgba(93,215,244,.32),rgba(189,228,238,.2) 50%,rgba(25,78,94,.76));
    box-shadow:0 0 0 1px rgba(196,245,255,.9),0 0 0 5px rgba(93,215,244,.13),inset 0 0 24px rgba(209,247,255,.3),0 18px 42px rgba(0,0,0,.32),0 0 31px rgba(93,215,244,.22);
  }
}

@media(min-width:761px) and (max-width:1500px){
  .switch-character{padding-inline:10px;grid-template-columns:39px minmax(0,1fr) 44px;column-gap:6px}
  .switch-character-copy{gap:5px}
  .switch-character-copy b{font-size:16px}
  .switch-character-copy small{font-size:5px}
  .switch-character-current{width:43px;height:66px}
  .switch-character-orbit{width:34px;height:34px;font-size:18px!important}
  .switch-character-matrix{transform:scale(.9)}
  .switch-character-meta{font-size:6px!important;letter-spacing:.045em}
}

/* Character archive entrance v4: console only, without duplicate portraits. */
@media(min-width:761px){
  .switch-character{grid-template-columns:44px minmax(0,1fr) 42px}
  .switch-character-copy{grid-column:1/-1}
  .switch-character-scan{
    grid-column:2;
    grid-row:2;
    position:relative;
    width:100%;
    height:28px;
    display:flex;
    align-items:center;
    justify-content:space-around;
    margin:0!important;
  }
  .switch-character-scan:before{
    content:"";
    position:absolute;
    left:0;right:0;top:50%;
    height:1px;
    background:linear-gradient(90deg,transparent,rgba(201,246,255,.68),transparent);
    box-shadow:0 0 9px rgba(93,215,244,.35);
  }
  .switch-character-scan i{
    position:relative;
    width:6px;height:6px;
    border-radius:50%;
    background:#d5f8ff;
    box-shadow:0 0 0 3px rgba(93,215,244,.12),0 0 10px rgba(93,215,244,.7);
  }
  .switch-character-matrix{grid-column:3;grid-row:2;justify-self:end}
  .switch-character-meta{grid-column:1/-1}
}

@media(min-width:761px) and (max-width:1500px){
  .switch-character{grid-template-columns:39px minmax(0,1fr) 38px}
  .switch-character-copy b{font-size:16px}
}

/* Character archive entrance v5: same console, integrated archive palette. */
@media(min-width:761px){
  .rail .rail-brand.counterside{margin-top:auto;height:82px}
  .rail .rail-brand.gamekee{height:70px;margin-bottom:2px}
  .rail .rail-foot{display:none!important}

  .switch-character{
    background:
      radial-gradient(ellipse at 24% 48%,rgba(93,215,244,.11),transparent 47%),
      linear-gradient(110deg,rgba(13,42,53,.98),rgba(7,23,31,.99) 58%,rgba(12,31,40,.98));
    box-shadow:
      0 0 0 1px rgba(93,215,244,.28),
      0 0 0 4px rgba(93,215,244,.035),
      inset 4px 0 0 rgba(93,215,244,.72),
      inset 0 0 22px rgba(93,215,244,.045),
      0 14px 34px rgba(0,0,0,.28);
  }
  .switch-character:before{
    border-color:rgba(93,215,244,.12);
    background:linear-gradient(100deg,rgba(255,255,255,.035),transparent 34%,rgba(255,91,104,.025));
  }
  .switch-character:after{background:linear-gradient(100deg,transparent 43%,rgba(93,215,244,.06) 49%,transparent 56%)}
  .switch-character-copy b{color:#edf8fb;text-shadow:none}
  .switch-character-copy small{color:#73cfe4;font-size:6.5px}
  .switch-character-orbit{
    color:var(--cyan);
    border-color:rgba(93,215,244,.34);
    background:rgba(5,20,27,.72);
    box-shadow:inset 0 0 14px rgba(93,215,244,.08),0 0 12px rgba(93,215,244,.06);
  }
  .switch-character-scan:before{
    background:linear-gradient(90deg,transparent,rgba(93,215,244,.65) 32%,rgba(255,91,104,.48) 68%,transparent);
    box-shadow:0 0 8px rgba(93,215,244,.2);
  }
  .switch-character-scan i{background:#b9edf7;box-shadow:0 0 0 3px rgba(93,215,244,.08),0 0 8px rgba(93,215,244,.4)}
  .switch-character-scan i:nth-child(3){background:var(--red);box-shadow:0 0 0 3px rgba(255,91,104,.08),0 0 9px rgba(255,91,104,.36)}
  .switch-character-matrix i{border-color:rgba(93,215,244,.32);background:rgba(93,215,244,.06);box-shadow:none}
  .switch-character-matrix i:nth-child(3){background:var(--red);border-color:rgba(255,91,104,.7);box-shadow:0 0 8px rgba(255,91,104,.28)}
  .switch-character-meta{
    color:#b6d1d9;
    font-size:9px!important;
    font-weight:600;
    letter-spacing:.055em;
    opacity:.9;
  }
  .switch-character:hover{
    background:
      radial-gradient(ellipse at 24% 48%,rgba(93,215,244,.16),transparent 49%),
      linear-gradient(110deg,rgba(15,49,61,.99),rgba(8,27,36,.99) 58%,rgba(15,37,47,.99));
    box-shadow:0 0 0 1px rgba(93,215,244,.42),0 0 0 4px rgba(93,215,244,.045),inset 4px 0 0 var(--cyan),0 17px 38px rgba(0,0,0,.32);
  }
}

@media(min-width:761px) and (max-width:1500px){
  .switch-character-meta{font-size:8px!important;letter-spacing:.035em}
}

/* Character archive entrance v6: compact dossier button matching rail tabs. */
@media(min-width:761px){
  .rail .switch-character{
    width:100%;min-height:62px;height:62px;margin:0 0 10px;padding:10px 12px;
    display:grid;grid-template-columns:34px minmax(0,1fr) 12px;grid-template-rows:1fr;
    column-gap:9px;align-items:center;overflow:hidden;border:1px solid rgba(93,215,244,.18);
    border-radius:8px;clip-path:none;color:#eef9fc;text-align:left;
    background:radial-gradient(circle at 5% 50%,rgba(93,215,244,.18),transparent 36%),radial-gradient(circle at 100% 35%,rgba(255,91,104,.13),transparent 42%),linear-gradient(100deg,#102c37 0,#0a1821 57%,#23151d 100%);
    box-shadow:inset 3px 0 0 rgba(93,215,244,.78),0 8px 20px rgba(0,0,0,.22);
    transition:transform .2s ease,border-color .2s ease,box-shadow .2s ease,background .2s ease;
  }
  .rail .switch-character:before{
    content:"";position:absolute;inset:0;width:auto;border:0;border-radius:inherit;
    background:linear-gradient(110deg,rgba(255,255,255,.055),transparent 36%,rgba(255,91,104,.025));pointer-events:none;
  }
  .rail .switch-character:after{
    content:"";position:absolute;left:auto;right:0;top:0;bottom:0;width:2px;transform:none;
    background:linear-gradient(transparent,rgba(255,91,104,.75),transparent);opacity:.72;pointer-events:none;
  }
  .rail .switch-character>*{position:relative;z-index:1;margin:0}
  .switch-character-id{
    grid-column:1;width:29px;height:25px;display:block;border:1.5px solid var(--cyan);
    border-radius:4px;color:var(--cyan);box-shadow:inset 0 0 10px rgba(93,215,244,.06),0 0 9px rgba(93,215,244,.07);
  }
  .switch-character-id:before{content:"";position:absolute;left:5px;top:6px;width:6px;height:6px;border:1.5px solid currentColor;border-radius:50%}
  .switch-character-id:after{content:"";position:absolute;left:4px;bottom:4px;width:9px;height:5px;border:1.5px solid currentColor;border-bottom:0;border-radius:7px 7px 0 0}
  .switch-character-id i:first-child{position:absolute;left:10px;top:-5px;width:8px;height:5px;border:1.5px solid currentColor;border-bottom:0;border-radius:2px 2px 0 0}
  .switch-character-id i:nth-child(2),.switch-character-id i:nth-child(3){position:absolute;left:17px;width:7px;height:1px;background:currentColor;box-shadow:0 0 5px rgba(93,215,244,.35)}
  .switch-character-id i:nth-child(2){top:9px}.switch-character-id i:nth-child(3){top:15px}
  .rail .switch-character-copy{
    grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;
    justify-content:center;gap:3px;min-width:0;line-height:1.08;white-space:nowrap;
  }
  .rail .switch-character-copy b{color:#f4fbfd;font-size:15px;font-weight:800;letter-spacing:.055em;text-shadow:none}
  .rail .switch-character-copy small{margin:0;color:#70cfe4;font-size:6.5px;font-weight:600;letter-spacing:.115em}
  .switch-character-arrow{grid-column:3;color:var(--cyan);font-size:26px!important;font-weight:300;line-height:1;opacity:.9}
  .rail .switch-character:hover{
    transform:translateX(3px);border-color:rgba(93,215,244,.4);
    background:radial-gradient(circle at 5% 50%,rgba(93,215,244,.24),transparent 38%),radial-gradient(circle at 100% 35%,rgba(255,91,104,.17),transparent 44%),linear-gradient(100deg,#143744 0,#0b1c25 57%,#2b1821 100%);
    box-shadow:inset 3px 0 0 var(--cyan),0 10px 24px rgba(0,0,0,.28),0 0 14px rgba(93,215,244,.07);
  }
}

@media(max-width:760px){
  .classification-grid .header-team{
    position:relative!important;
    inset:auto!important;
    width:auto!important;
    min-width:0!important;
    height:auto!important;
    min-height:36px!important;
    margin:0!important;
    align-self:stretch!important;
    transform:none!important;
    grid-column:auto!important;
    grid-row:auto!important;
  }
}

/* Mobile classification cards stay equal-width. Long values use a compact
   five-character-plus-ellipsis treatment instead of squeezing neighbours. */
@media(max-width:760px){
  .classification-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }
  .unit-attribute strong,
  .classification-grid .header-team strong{
    width:100%;
    max-width:6em;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    line-height:1.15;
  }
  .character-grid{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:4px;
  }
  .character-card{min-width:0;border-radius:5px}
  .character-card div{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    z-index:2;
    padding:15px 3px 4px;
    background:linear-gradient(transparent,rgba(3,10,14,.94));
    text-align:center;
  }
  .character-card strong{font-size:7.5px;line-height:1.15}
  .character-card em{right:3px;top:3px;padding:1px 3px;font-size:6px}
}

/* Character names belong to the portrait artwork on every viewport. */
.character-card div{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  z-index:2;
  padding:22px 7px 7px;
  background:linear-gradient(transparent,rgba(3,10,14,.94));
  text-align:center;
}
.character-card strong{color:#fff;text-shadow:0 1px 4px #000}

@media(max-width:760px){
  .character-card div{padding:15px 3px 4px}
  .character-card strong{font-size:7.5px}
}

/* Portrait labels float directly over the artwork without a dark backing. */
.character-card div{
  padding:4px 5px 5px;
  background:none;
}
.character-card strong{
  text-shadow:0 2px 4px #000,0 0 2px #000,1px 0 1px #000,-1px 0 1px #000;
}

@media(max-width:760px){
  .character-card div{padding:3px 2px 4px}
  .classification-grid .header-team strong,
  .classification-grid .header-team small{
    width:100%;
    margin:0!important;
    padding:0!important;
    justify-self:start;
    text-align:left!important;
  }
}

/* Spine toolbar: consistent rhythm and a clear primary costume action. */
.spine-tool{
  height:58px;
  min-height:58px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1.15;
}
.spine-tool.costume-featured{
  color:#fff;
  background:linear-gradient(145deg,#ff6673 0,#c94352 62%,#8e2f3d 100%);
  box-shadow:0 13px 32px rgba(255,91,104,.24),inset 0 0 0 1px rgba(255,255,255,.18);
}
.spine-tool.costume-featured:hover{
  background:linear-gradient(145deg,#ff7883 0,#d84a59 62%,#9b3342 100%);
  box-shadow:0 16px 36px rgba(255,91,104,.31),0 0 22px rgba(255,91,104,.12);
}
.spine-tool[hidden],
.spine-tool-panel[hidden]{display:none!important}

/* Portrait labels sit slightly higher and selected cards use an inset frame
   so the highlight can never be clipped by the card's overflow. */
.character-card div{bottom:7px}
.character-card strong{font-size:12px}
.character-card.active{
  transform:translateY(-2px);
  box-shadow:0 16px 36px rgba(0,0,0,.34),0 0 24px rgba(93,215,244,.13);
}
.character-card.active:after{
  content:"";
  position:absolute;
  z-index:5;
  inset:3px;
  pointer-events:none;
  border:1px solid rgba(116,226,249,.92);
  border-radius:6px;
  box-shadow:inset 0 0 15px rgba(93,215,244,.12),0 0 9px rgba(93,215,244,.12);
}
.character-card.active:before{
  content:"";
  position:absolute;
  z-index:6;
  left:8px;
  right:8px;
  top:3px;
  height:2px;
  pointer-events:none;
  background:linear-gradient(90deg,transparent,var(--cyan),transparent);
  box-shadow:0 0 9px rgba(93,215,244,.7);
}

@media(max-width:760px){
  .spine-tool{height:48px;min-height:48px}
  .character-card div{bottom:5px}
  .character-card strong{font-size:8.5px}
  .character-card.active:after{inset:2px;border-radius:4px}
  .character-card.active:before{left:5px;right:5px;top:2px}
}

/* 2026-08-26 portrait trial: keep the 192:256 source undistorted. The compact
   home-page frame crops a little from the top and bottom to avoid dark gaps. */
.avatar-frame{
  height:auto!important;
  aspect-ratio:6 / 7!important;
}
.avatar-frame img,
.character-card img,
#spine-models .model-pill img{
  width:100%!important;
  aspect-ratio:192 / 256!important;
  object-fit:cover!important;
  object-position:center top!important;
  image-rendering:auto!important;
}
#spine-models .model-pill img{
  height:auto!important;
}

/* Clearer portrait inset and higher-contrast secondary labels. */
.avatar-frame:before{
  background:linear-gradient(145deg,#214a58,#173743 58%,#244956)!important;
}
.switch-character-meta{
  color:#e8faff!important;
  text-shadow:0 1px 5px rgba(93,215,244,.24);
}
.unit-attribute small,
.classification-grid .header-team small{
  color:#c5d9df!important;
}

/* Costume strip: desktop never shows a scrollbar. On phones, up to four
   cards fit the panel; a visible scrollbar appears only from the fifth. */
#spine-models{
  scrollbar-width:none!important;
  -ms-overflow-style:none;
}
#spine-models::-webkit-scrollbar{
  display:none;
  width:0;
  height:0;
}
@media(max-width:760px){
  #spine-models:not(.needs-mobile-scroll) .model-pill{
    flex:1 1 0;
    min-width:0;
  }
  #spine-models.needs-mobile-scroll{
    scrollbar-width:thin!important;
    scrollbar-color:#5b8798 #0b1b23;
  }
  #spine-models.needs-mobile-scroll::-webkit-scrollbar{
    display:block;
    height:5px;
  }
  #spine-models.needs-mobile-scroll::-webkit-scrollbar-track{
    background:#0b1b23;
    border-radius:999px;
  }
  #spine-models.needs-mobile-scroll::-webkit-scrollbar-thumb{
    background:#5b8798;
    border-radius:999px;
  }
}

/* Voice availability is data-driven. Author layout rules must never override
   the hidden state on desktop or mobile. */
#archive-voices[hidden],
.archive-tabs [data-archive-jump="archive-voices"][hidden]{
  display:none!important;
}

/* Shared in-page filters avoid the mobile browser's native white picker. */
.character-search-row,.character-filter-fields{display:contents}
.filter-toggle{display:none}
.character-filters{min-width:0}
.character-filters input{min-width:0}
.filter-control{
  min-width:0;display:flex;align-items:stretch;overflow:hidden;
  border:1px solid rgba(93,215,244,.12);border-radius:8px;
  background:rgba(17,43,53,.8);color:#eaf4f7;
}
.filter-control select[hidden]{display:none!important}
.filter-trigger,.filter-action{
  border:0;background:none;color:inherit;min-width:0;font:inherit;
}
.filter-trigger{flex:1;text-align:left;padding:9px 5px 9px 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.filter-action{flex:0 0 30px;padding:0;font-size:19px}
.filter-control.has-value{border-color:rgba(93,215,244,.45)}
.filter-control:focus-within{outline:1px solid #89dbea;outline-offset:1px}
.filter-action:hover{background:rgba(93,215,244,.12);color:#fff}
.filter-trigger:focus-visible,.filter-action:focus-visible{outline:1px solid var(--cyan);outline-offset:-3px}
.character-filter-options{
  position:fixed;z-index:100;overflow:auto;overscroll-behavior:contain;
  padding:4px;background:#314852;border:1px solid #587581;border-radius:7px;
  box-shadow:0 14px 38px rgba(0,0,0,.5);color:#f1f7fa;
  scrollbar-width:thin;scrollbar-color:#6a8995 #213641;
}
.character-filter-options[hidden]{display:none!important}
.character-filter-options button{
  display:block;width:100%;padding:8px 10px;border:0;border-radius:3px;
  background:none;color:inherit;text-align:left;font:inherit;font-size:14px;line-height:1.35;
  white-space:normal;overflow-wrap:anywhere;
}
.character-filter-options button:hover,.character-filter-options button:focus-visible{
  background:#526c79;outline:none;
}
.character-filter-options button[aria-selected="true"]{background:#9ccaff;color:#102733}
.character-empty{grid-column:1/-1;margin:8px 0;padding:18px 8px;color:#b7ced7;text-align:center;font-size:13px}
@media(max-width:760px){
  .character-dialog{height:86svh;max-height:calc(100dvh - 20px)}
  .character-dialog>header{padding:6px 12px}
  .character-dialog>header span{display:none}
  .character-dialog>header h2{font-size:17px}
  .character-dialog>header button{width:34px;height:34px;padding:0;line-height:1}
  .character-filters{display:flex;flex-direction:column;padding:8px 10px 10px;gap:8px;width:100%}
  .character-search-row{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:6px;min-width:0}
  .character-search-row #character-search{grid-column:auto;width:100%;font-size:13px;padding:10px 8px}
  .filter-toggle{
    display:flex;align-items:center;justify-content:space-between;gap:4px;padding:8px;
    border:1px solid rgba(93,215,244,.16);border-radius:8px;background:#112b35;color:#eaf4f7;font-size:13px;
  }
  .filter-toggle i{font-style:normal;font-size:18px;line-height:1}
  .filter-toggle[aria-expanded="true"] i{transform:rotate(180deg)}
  .character-filter-fields{display:none}
  .filters-expanded .character-filter-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .filter-control{min-height:39px;border-radius:6px}
  .filter-trigger{padding:8px 0 8px 5px;font-size:11px}
  .filter-action{flex-basis:22px;font-size:17px}
  .character-grid{flex:1 1 auto}
  .character-filter-options button{min-height:40px}
}

/* Desktop rosters also scroll without compressing portrait rows. Keep their
   existing responsive column counts; only the portrait height is restored. */
@media(min-width:761px){
  .character-filters{grid-template-columns:minmax(0,2fr) repeat(4,minmax(0,1fr))}
  .character-filters #character-search{grid-column:1;grid-row:1}
  .filter-control[data-filter="rarity-filter"]{grid-column:2;grid-row:1}
  .filter-control[data-filter="role-filter"]{grid-column:3;grid-row:1}
  .filter-control[data-filter="employee-filter"]{grid-column:4;grid-row:1}
  .filter-control[data-filter="source-filter"]{grid-column:5;grid-row:1}
  .filter-control[data-filter="attack-filter"]{grid-column:2;grid-row:2}
  .filter-control[data-filter="team-filter"]{grid-column:3;grid-row:2}
  .filter-control[data-filter="cost-filter"]{grid-column:4;grid-row:2}
  .filter-control[data-filter="move-filter"]{grid-column:5;grid-row:2}
  .character-filter-options button{white-space:nowrap;overflow-wrap:normal}
  .character-dialog>header,
  .character-dialog>.character-filters{flex-shrink:0}
  .character-grid{
    min-height:0;
    grid-auto-rows:max-content;
    align-content:start;
    overflow-y:auto;
  }
  .character-card{
    width:100%;
    height:auto;
    aspect-ratio:192 / 256;
    align-self:start;
  }
  .character-card img{
    display:block;
    height:auto!important;
  }
}

/* A long mobile roster scrolls instead of compressing its portrait rows to
   fit the dialog. Keep the approved four-column, 192:256 card composition. */
@media(max-width:760px){
  .character-dialog>header,
  .character-dialog>.character-filters{flex-shrink:0}
  .character-grid{
    min-height:0;
    grid-template-columns:repeat(4,minmax(0,1fr));
    grid-auto-rows:max-content;
    align-content:start;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
  }
  .character-card{
    width:100%;
    height:auto;
    aspect-ratio:192 / 256;
    align-self:start;
  }
  .character-card img{
    display:block;
    height:auto!important;
  }
}

/* Restore the approved compact Spine size slider. The GameKee plugin injects
   global form styles, so every range part is defined explicitly here. */
.spine-scale-control{
  gap:8px!important;
  padding:3px 0!important;
  border-radius:0!important;
  background:transparent!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
}
.spine-scale-control input[type="range"]{
  -webkit-appearance:none!important;
  appearance:none!important;
  width:110px!important;
  height:14px!important;
  min-height:14px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.spine-scale-control input[type="range"]::-webkit-slider-runnable-track{
  width:100%;
  height:4px;
  border:1px solid #6b7477;
  border-radius:3px;
  background:linear-gradient(to right,var(--red) 0 var(--scale-progress,60%),#454e52 var(--scale-progress,60%) 100%);
}
.spine-scale-control input[type="range"]::-webkit-slider-thumb{
  -webkit-appearance:none!important;
  appearance:none!important;
  width:14px;
  height:14px;
  margin-top:-6px;
  border:0;
  border-radius:50%;
  background:var(--red);
  box-shadow:none;
}
.spine-scale-control input[type="range"]::-moz-range-track{
  height:4px;
  border:1px solid #6b7477;
  border-radius:3px;
  background:#454e52;
}
.spine-scale-control input[type="range"]::-moz-range-progress{
  height:4px;
  border-radius:3px;
  background:var(--red);
}
.spine-scale-control input[type="range"]::-moz-range-thumb{
  width:14px;
  height:14px;
  border:0;
  border-radius:50%;
  background:var(--red);
  box-shadow:none;
}

/* Keep the employee-level control rounded even after the comment plugin adds
   global form styles. The progress fill is updated by archive-app.js. */
.level-controller #level-range{
  -webkit-appearance:none!important;
  appearance:none!important;
  display:block!important;
  width:100%!important;
  height:18px!important;
  min-height:18px!important;
  margin:2px 0!important;
  padding:0!important;
  border:0!important;
  border-radius:999px!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
.level-controller #level-range::-webkit-slider-runnable-track{
  width:100%;
  height:7px;
  border:0;
  border-radius:999px;
  background:linear-gradient(to right,var(--red) 0 var(--level-progress,100%),#454e52 var(--level-progress,100%) 100%);
}
.level-controller #level-range::-webkit-slider-thumb{
  -webkit-appearance:none!important;
  appearance:none!important;
  width:16px;
  height:16px;
  margin-top:-4.5px;
  border:0;
  border-radius:50%;
  background:var(--red);
  box-shadow:none;
}
.level-controller #level-range::-moz-range-track{
  height:7px;
  border:0;
  border-radius:999px;
  background:#454e52;
}
.level-controller #level-range::-moz-range-progress{
  height:7px;
  border-radius:999px;
  background:var(--red);
}
.level-controller #level-range::-moz-range-thumb{
  width:16px;
  height:16px;
  border:0;
  border-radius:50%;
  background:var(--red);
  box-shadow:none;
}

/* Voice subtitles wrap vertically; the list only scrolls on the Y axis. */
@media(min-width:761px){
  .voice-list{
    overflow-x:hidden!important;
    overflow-y:auto!important;
  }
  .voice-item{
    grid-template-columns:36px 120px minmax(0,1fr)!important;
    min-width:0!important;
  }
  .voice-item>span:last-child{
    min-width:0!important;
    white-space:normal!important;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
}
