/* AnimeKai v1.20 final parity fixes: geometry, report modal and comments. */

/* Keep circular heading icons circular even when the heading is long/narrow. */
.shead .stitle > i{
  flex:0 0 2rem!important;
  min-width:2rem!important;
  width:2rem!important;
  height:2rem!important;
  aspect-ratio:1/1;
  line-height:2rem;
  box-sizing:border-box;
}
#trending-anime .shead .stitle > .fa-trophy{flex-shrink:0!important}

/* Report modal: match the existing modal theme but guarantee visible stacking. */
#report-modal.ak-report-open{
  display:block!important;
  z-index:1060!important;
  overflow-x:hidden;
  overflow-y:auto;
}
#report-modal.ak-report-open .modal-dialog{
  transform:none!important;
  opacity:1!important;
}
#report-modal.ak-report-open .modal-content{position:relative;z-index:1}
.ak-report-backdrop{z-index:1055!important}
body.ak-report-modal-open{overflow:hidden!important;padding-right:0!important}
@media(max-width:575.98px){
  #report-modal .modal-dialog{width:calc(100% - 2rem);margin:1rem auto!important}
  #report-modal .modal-content{border-radius:1.2rem}
}

/* Comment rows use the reference CSS class structure; these are compatibility guards. */
#cm-widget .cm-item .main .detail .header{display:flex;align-items:center;gap:.45rem;min-width:0}
#cm-widget .cm-item .main .detail .header .username{color:#f2f2f2;max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#cm-widget .cm-item .main .detail .header time{color:rgba(255,255,255,.45);font-size:.8rem}
#cm-widget .cm-item .main .detail .content{overflow-wrap:anywhere}
#cm-widget .ak-comment-like{display:inline-flex;align-items:center;gap:.25rem}
#cm-widget .ak-comment-like i{font-size:.9rem}
#cm-widget .ak-comment-like.active{color:#e45f3a!important}
#cm-widget .ak-editor-avatar{display:flex;width:100%;height:100%;align-items:center;justify-content:center;background:rgba(228,95,58,.4);color:#fff;font-weight:600}
#cm-widget .ak-signin-note{margin:.45rem .9rem .7rem;color:rgba(255,255,255,.5);font-size:.9rem}
#cm-widget .ak-signin-note a{color:#36cb68}
#cm-widget .cm-loading[hidden],#cm-widget .cm-foot [hidden]{display:none!important}
#cm-widget .toolbar .tb-item{border:0;background:transparent;line-height:1.5}

/* Prevent narrow mobile controls/icons from being squeezed by flex layouts. */
#player-control .ctrl>.btn i,.shead .tab-nav .btn i,.schedule-prev i,.schedule-next i{flex-shrink:0}
#cm-widget .cm-editor .preview:not([hidden]){display:block!important}


/* v1.20.1: account dropdown parity + report closed-state hardening. */
#report-modal[hidden],#report-modal:not(.ak-report-open){display:none!important;visibility:hidden!important;pointer-events:none!important;opacity:0!important}
#report-modal.ak-report-open{visibility:visible!important;pointer-events:auto!important;opacity:1!important}
body:not(.ak-report-modal-open)>.ak-report-backdrop{display:none!important}
.nav-user,.acc-wrap,.acc-wrap .pathway{position:relative;overflow:visible!important}
.nav-user{z-index:10020;flex:0 0 auto}
.acc-wrap .pathway .ak-account-trigger{display:flex!important;align-items:center;justify-content:center;flex:0 0 2.2rem}
.acc-wrap .pathway .ak-account-menu[hidden]{display:none!important}
.acc-wrap .pathway .ak-account-menu:not([hidden]){display:block!important;position:absolute!important;top:calc(100% + 1.15rem)!important;right:0!important;left:auto!important;z-index:10030!important;width:250px!important;min-width:250px!important;margin:0!important;padding:0 0 .2rem!important;background:#181d22!important;border:0!important;border-radius:1.2rem!important;box-shadow:0 12px 34px rgba(0,0,0,.45)!important;overflow:hidden!important;transform:none!important}
.acc-wrap .pathway .ak-account-menu .head{background:#0c1116;display:flex;align-items:center;justify-content:space-between;margin:0 0 .8rem;padding:1.25rem 1.5rem}
.acc-wrap .pathway .ak-account-menu .head>div{min-width:0;margin-right:1rem;overflow:hidden}
.acc-wrap .pathway .ak-account-menu .head>div>div{color:#fff;font-size:1.05rem;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acc-wrap .pathway .ak-account-menu .head>div>span{display:block;color:rgba(255,255,255,.5);font-size:.85rem;margin-top:.12rem}
.acc-wrap .pathway .ak-account-menu .head>.btn{display:flex!important;align-items:center;justify-content:center;width:2.3rem!important;height:2.3rem!important;flex:0 0 2.3rem;border-radius:.4rem!important;background:#181d22!important;color:rgba(255,255,255,.6)!important}
.acc-wrap .pathway .ak-account-menu .head>.btn:hover{color:#fff!important}
.acc-wrap .pathway .ak-account-menu .dropdown-item{display:flex!important;align-items:center;width:100%!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:rgba(255,255,255,.6)!important;font-size:1.05rem!important;text-align:left!important;text-decoration:none!important}
.acc-wrap .pathway .ak-account-menu .dropdown-item>span{display:block;width:100%;margin:0 .8rem;padding:.58rem 1rem;border-radius:.4rem;white-space:nowrap}
.acc-wrap .pathway .ak-account-menu .dropdown-item i{width:1.8rem;text-align:left}
.acc-wrap .pathway .ak-account-menu .dropdown-item:hover{color:#fff!important;background:transparent!important}
.acc-wrap .pathway .ak-account-menu .dropdown-item:hover>span{background:rgba(255,255,255,.05)!important}
.acc-wrap .pathway .ak-account-menu .ak-account-logout{margin:0;padding:0}
@media(max-width:575.98px){.acc-wrap .pathway .ak-account-menu:not([hidden]){position:fixed!important;top:5.7rem!important;right:1rem!important;left:auto!important;width:min(250px,calc(100vw - 2rem))!important;min-width:0!important;max-width:calc(100vw - 2rem)!important}}


/* v1.21 Watch History upgrade */
.ak-history-page{min-height:38vh}.ak-history-head{gap:1rem}.ak-history-heading{display:flex;align-items:center;gap:.7rem;min-width:0}.ak-history-count{display:inline-flex;align-items:center;justify-content:center;min-width:1.8rem;height:1.55rem;padding:0 .45rem;border-radius:999px;background:rgba(255,255,255,.08);color:rgba(255,255,255,.62);font-size:.76rem;font-weight:700}.ak-history-clear{display:inline-flex;align-items:center;gap:.42rem;background:transparent!important;color:rgba(255,255,255,.62)!important;border:0!important;padding:.35rem .15rem!important;font-size:.86rem}.ak-history-clear:hover,.ak-history-clear:focus-visible{color:#fff!important}.ak-history-subhead{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:-.15rem 0 1.15rem;color:rgba(255,255,255,.45);font-size:.83rem}.ak-history-home{color:var(--primary,#f15b38);white-space:nowrap}.ak-history-grid .ak-history-item{position:relative}.ak-history-grid .ak-history-item .ctrl{position:absolute;z-index:4;right:.4rem;top:.4rem}.ak-history-grid .ak-history-item .watching-delete{width:1.75rem;height:1.75rem;border:0;border-radius:50%;display:grid;place-items:center;background:rgba(10,13,17,.82);color:rgba(255,255,255,.8);backdrop-filter:blur(6px);cursor:pointer}.ak-history-grid .ak-history-item .watching-delete:hover,.ak-history-grid .ak-history-item .watching-delete:focus-visible{background:#e95735;color:#fff}.ak-history-grid .ak-history-item .info{display:flex;gap:.42rem;align-items:center;min-width:0;flex-wrap:wrap}.ak-history-grid .ak-history-item .ak-history-when{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:rgba(255,255,255,.38);font-size:.72rem}.ak-history-grid .ak-history-item .progress-bar{height:3px;margin-top:.45rem;border-radius:9px;background:rgba(255,255,255,.09);overflow:hidden}.ak-history-grid .ak-history-item .progress-bar>div{height:100%;background:var(--primary,#f15b38);border-radius:inherit}.ak-history-local{display:contents}.ak-history-empty{grid-column:1/-1}.ak-history-item.ak-removing{opacity:.35;transform:scale(.98);pointer-events:none;transition:.18s ease}
@media(max-width:575.98px){.ak-history-head{align-items:flex-start}.ak-history-clear span{display:none}.ak-history-clear{font-size:1rem;padding:.25rem!important}.ak-history-subhead{align-items:flex-start;font-size:.76rem;margin-bottom:.8rem}.ak-history-grid .ak-history-item .ak-history-when{font-size:.66rem}.ak-history-grid .ak-history-item .watching-delete{width:1.65rem;height:1.65rem}}
