/* Sprint39: K.I.R.I.N. dashboard batch-action recovery */
.kirin-header-tools .dre-batch-collector-toggle{
  margin-left:0;
  min-height:36px;
  white-space:nowrap;
}
.kirin-header-tools .dre-batch-collector-toggle>.dre-header-action-icon{
  width:18px;
  height:18px;
  flex:0 0 18px;
  fill:none;
  stroke:currentColor;
  stroke-width:2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.kirin-nav>button{font-size:12px;}
@media(max-width:768px){
  .kirin-nav{
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:6px;
    overflow:hidden;
    scrollbar-width:none;
  }
  .kirin-nav::-webkit-scrollbar{
    display:none;
  }
  .dre-batch-collector{
    top:max(66px,env(safe-area-inset-top));
  }
}
@media(max-width:480px){
  .kirin-header-build{
    display:none;
  }
  .kirin-header-tools{
    gap:4px;
  }
  .kirin-header-tools .dre-mobile-batch-action>.dre-header-action-icon{
    display:block;
    width:18px;
    height:18px;
    margin:0;
    transform:none;
    transform-origin:center;
    fill:none;
    stroke:currentColor;
    stroke-width:2;
    stroke-linecap:round;
    stroke-linejoin:round;
  }
  .kirin-header-tools .dre-mobile-batch-action{
    display:grid;
    place-items:center;
    flex:0 0 34px;
    width:34px;
    height:34px;
    min-height:34px;
    margin:0;
    padding:0;
    border:1px solid var(--line-soft);
    border-radius:50%;
    background:#0c0f0d;
    color:var(--gold-soft);
    box-shadow:none;
    font-size:0;
    line-height:1;
  }
  .kirin-header-tools .dre-mobile-batch-action:hover,
  .kirin-header-tools .dre-mobile-batch-action[aria-expanded="true"]{
    border-color:var(--gold);
    background:#15180f;
    color:var(--gold-soft);
  }
  .kirin-header-tools .dre-mobile-batch-action>span{
    display:none;
  }
  .kirin-header-tools .dre-mobile-batch-action.dre-result-batch-toggle{
    border-color:rgba(183,70,63,.72);
    background:linear-gradient(180deg,#3b1b19,#241313);
    color:#ffb0a6;
  }
  .kirin-header-tools .dre-mobile-batch-action.dre-result-batch-toggle:hover,
  .kirin-header-tools .dre-mobile-batch-action.dre-result-batch-toggle[aria-expanded="true"]{
    border-color:#ef6e60;
    background:linear-gradient(180deg,#52221f,#311615);
    color:#ffd2cc;
  }
  .kirin-nav>button{
    grid-column:auto;
    border-color:var(--line-soft);
    background:#0c0f0d;
    color:#cdd5ce;
  }
  .kirin-nav>button.is-active{
    border-color:var(--gold);
    background:linear-gradient(90deg,rgba(215,181,74,.14),transparent);
    color:var(--gold-soft);
  }
  .kirin-sidebar{
    padding-block:8px;
  }
  .kirin-nav>button{
    padding-block:8px;
  }
  .kirin-race-header{
    padding:10px 12px;
  }
  .kirin-race-header h1{
    margin-top:6px;
  }
  .kirin-race-meta{
    margin-top:5px;
  }
  .kirin-time-card{
    min-height:44px;
    padding:5px 9px;
  }
  .kirin-time-card--close .kirin-time-rule{
    font-size:17px;
  }
}
@media(max-width:390px){
  .kirin-header-tools .dre-mobile-batch-action{
    flex-basis:32px;
    width:32px;
    height:32px;
    min-height:32px;
  }
  .kirin-time-card--close .kirin-time-rule{
    font-size:16px;
  }
}

@media(min-width:481px){
  .kirin-header-tools .dre-batch-collector-toggle:not(.dre-result-batch-toggle){
    order:1;
  }
  .kirin-header-tools .dre-result-batch-toggle{
    order:2;
  }
}
@media(max-width:480px){
  .kirin-header-tools .dre-batch-collector-toggle:not(.dre-result-batch-toggle){
    order:1;
  }
  .kirin-header-tools .dre-result-batch-toggle{
    order:2;
  }
}


/* Sprint39 phase10: restore tablet/desktop header geometry without touching phone */
@media(min-width:481px){
  .kirin-header-actions{
    flex:0 1 auto;
    min-width:0;
    margin-left:auto;
  }
  .kirin-header-build{
    flex:0 0 112px;
  }
  .kirin-header-tools{
    flex-wrap:nowrap;
    align-items:center;
    justify-content:flex-end;
    gap:8px;
  }
  .kirin-header-tools .dre-batch-collector-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    flex:0 0 auto;
    height:36px;
    min-height:36px;
    margin:0;
    padding:0 12px;
    border-radius:11px;
    line-height:1;
  }
}
@media(min-width:721px) and (max-width:900px){
  .kirin-header{
    padding-inline:16px;
  }
  .kirin-brand{
    gap:10px;
  }
  .kirin-brand img{
    width:34px;
    height:34px;
  }
  .kirin-brand-copy strong{
    font-size:14px;
  }
  .kirin-brand-copy small{
    font-size:8px;
  }
  .kirin-header-actions{
    gap:8px;
  }
  .kirin-header-build{
    flex-basis:92px;
    min-width:92px;
  }
  .kirin-header-tools{
    gap:6px;
  }
  .kirin-header-tools .dre-batch-collector-toggle{
    height:34px;
    min-height:34px;
    gap:5px;
    padding-inline:8px;
    font-size:11px;
  }
  .kirin-header-tools .dre-batch-collector-toggle>.dre-header-action-icon{
    width:15px;
    height:15px;
    flex-basis:15px;
  }
}
