/* ======================================================
   HOME PAGE FINAL APP STYLE
====================================================== */

.mjv2-home-page{
  padding-top:8px;
}

/* ======================================================
   HERO
====================================================== */

.mjv2-hero{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  margin-bottom:18px;
}

.mjv2-hero > *{
  min-width:0;
}

.mjv2-hero.mjv2-hero-compact{
  margin-bottom:18px;
}

.mjv2-search-inline{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
}

.mjv2-search-inline input{
  flex:1 1 auto;
  min-width:0;
}

/* ======================================================
   MAIN TABS
====================================================== */

.mjv2-home-main-tabs{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:12px;
  margin-bottom:18px;
}

.mjv2-home-main-tab{
  appearance:none;
  border:1px solid var(--mjv2-border);
  background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.02));
  color:var(--mjv2-text-soft);
  min-height:72px;
  padding:12px 10px;
  border-radius:22px;
  cursor:pointer;
  transition:
    background .18s ease,
    border-color .18s ease,
    color .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-align:center;
  box-shadow:0 8px 20px rgba(0,0,0,.12);
}

.mjv2-home-main-tab:hover{
  color:var(--mjv2-text);
  border-color:var(--mjv2-border-strong);
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  transform:translateY(-1px);
}

.mjv2-home-main-tab.is-active{
  background:linear-gradient(135deg,var(--mjv2-primary),var(--mjv2-primary-2));
  color:#08111f;
  border-color:transparent;
  box-shadow:0 12px 26px rgba(42,171,238,.22);
}

.mjv2-home-main-tab-icon{
  width:22px;
  height:22px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.mjv2-home-main-tab-icon svg{
  width:22px;
  height:22px;
  display:block;
}

.mjv2-home-main-tab-label{
  display:block;
  font-size:11px;
  line-height:1.2;
  font-weight:800;
  letter-spacing:.01em;
  white-space:nowrap;
}

/* ======================================================
   PANEL
====================================================== */

.mjv2-home-panel{
  margin-top:2px;
}

.mjv2-home-panel-wrap{
  min-width:0;
}

.mjv2-home-panel-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:14px;
}

.mjv2-home-panel-heading{
  min-width:0;
}

.mjv2-home-section-title{
  margin:0;
  font-size:19px;
  font-weight:800;
  line-height:1.2;
  color:var(--mjv2-text);
}

/* ======================================================
   SEGMENTED CONTROL BASE
====================================================== */

.mjv2-segmented-control{
  display:inline-flex;
  align-items:stretch;
  border:1px solid var(--mjv2-border);
  background:rgba(255,255,255,.04);
  border-radius:999px;
  padding:4px;
  gap:0;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.03);
}

.mjv2-segmented-control > *{
  position:relative;
}

.mjv2-segmented-control > * + *::before{
  content:"";
  position:absolute;
  left:0;
  top:18%;
  width:1px;
  height:64%;
  background:rgba(255,255,255,.08);
}

.mjv2-segmented-control button{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--mjv2-text-soft);
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  cursor:pointer;
  transition:
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-size:13px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
}

.mjv2-segmented-control button:hover{
  color:var(--mjv2-text);
}

.mjv2-segmented-control button.is-active{
  background:linear-gradient(135deg,var(--mjv2-primary),var(--mjv2-primary-2));
  color:#08111f;
  box-shadow:0 8px 18px rgba(42,171,238,.16);
}

.mjv2-segmented-control button.is-active::before{
  opacity:0;
}

.mjv2-segment-icon{
  width:16px;
  height:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
}

.mjv2-segment-icon svg{
  width:16px;
  height:16px;
  display:block;
}

.mjv2-segment-label{
  display:inline-block;
  font-size:12px;
  font-weight:800;
  line-height:1.2;
}

/* ======================================================
   VIEW TOGGLE
====================================================== */

.mjv2-home-view-toggle{
  flex:0 0 auto;
}

/* ======================================================
   TYPE SEGMENT / FILTER HOME
====================================================== */

.mjv2-home-chip-group{
  display:flex;
  align-items:center;
  overflow-x:auto;
  max-width:100%;
  margin-bottom:18px;
  scrollbar-width:none;
  -webkit-overflow-scrolling:touch;
}

.mjv2-home-chip-group::-webkit-scrollbar{
  display:none;
}

.mjv2-home-chip-group.mjv2-type-segment{
  display:inline-flex;
  max-width:100%;
}

.mjv2-home-chip{
  appearance:none;
  border:0;
  background:transparent;
  color:var(--mjv2-text-soft);
  min-height:42px;
  padding:0 16px;
  border-radius:999px;
  cursor:pointer;
  white-space:nowrap;
  transition:
    background .16s ease,
    color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
  font-size:13px;
  font-weight:700;
  line-height:1.2;
  position:relative;
}

.mjv2-home-chip + .mjv2-home-chip::before{
  content:"";
  position:absolute;
  left:0;
  top:18%;
  width:1px;
  height:64%;
  background:rgba(255,255,255,.08);
}

.mjv2-home-chip:hover{
  color:var(--mjv2-text);
}

.mjv2-home-chip.is-active{
  background:linear-gradient(135deg,var(--mjv2-primary),var(--mjv2-primary-2));
  color:#08111f;
  box-shadow:0 8px 18px rgba(42,171,238,.16);
}

.mjv2-home-chip.is-active::before{
  opacity:0;
}

/* ======================================================
   ITEMS WRAPPER
====================================================== */

.mjv2-home-items{
  width:100%;
}

.mjv2-home-grid{
  width:100%;
}

/* ======================================================
   LOADING
====================================================== */

.mjv2-home-loading{
  width:100%;
  padding:26px 14px;
  text-align:center;
  border:1px dashed rgba(255,255,255,.08);
  border-radius:18px;
  background:rgba(255,255,255,.02);
}

.mjv2-home-loading-text{
  font-size:14px;
  line-height:1.5;
  color:var(--mjv2-muted);
}

.mjv2-home-card-chapter,
.mjv2-list-chapter.is-empty{
  opacity:.88;
}

/* ======================================================
   GRID MODE
====================================================== */

.mjv2-home-page[data-view-mode="grid"] .mjv2-home-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(170px,1fr));
  gap:18px;
}

.mjv2-home-grid .mjv2-card{
  height:100%;
}

.mjv2-home-grid .mjv2-manga-card{
  height:100%;
}

.mjv2-home-grid .mjv2-cover-link{
  aspect-ratio:3/4;
}

.mjv2-home-grid .mjv2-card-body{
  min-height:82px;
  gap:6px;
  padding:12px;
}

.mjv2-home-grid .mjv2-card-title{
  margin:0;
  font-size:15px;
  line-height:1.35;
  font-weight:800;
  color:var(--mjv2-text);
  min-height:2.7em;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.mjv2-home-grid .mjv2-card-title a{
  color:var(--mjv2-text);
  text-decoration:none;
}

.mjv2-home-grid .mjv2-card-title a:hover{
  text-decoration:underline;
}

.mjv2-home-grid .mjv2-home-card-chapter,
.mjv2-home-grid .mjv2-meta-line,
.mjv2-home-grid .mjv2-meta-small{
  font-size:12px;
  line-height:1.35;
  color:var(--mjv2-muted);
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

/* ======================================================
   LIST MODE
====================================================== */

.mjv2-home-page[data-view-mode="list"] .mjv2-home-grid{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.mjv2-home-list-item,
.mjv2-list-item.mjv2-home-list-item{
  display:flex;
  align-items:center;
  gap:14px;
  padding:14px;
  border-radius:18px;
  background:linear-gradient(145deg, rgba(18,28,46,.95), rgba(12,18,32,.95));
  border:1px solid var(--mjv2-border);
  box-shadow:var(--mjv2-shadow-soft);
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    border-color .16s ease;
}

.mjv2-home-list-item:hover{
  transform:translateY(-2px);
  box-shadow:var(--mjv2-shadow);
  border-color:var(--mjv2-border-strong);
}

.mjv2-home-list-item .mjv2-list-cover-link{
  flex:0 0 auto;
  display:block;
}

.mjv2-home-list-item .mjv2-list-cover{
  width:84px;
  height:114px;
  border-radius:12px;
  object-fit:cover;
  display:block;
  background:var(--mjv2-image-bg);
}

.mjv2-home-list-item .mjv2-list-body{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:6px;
}

.mjv2-home-list-item .mjv2-list-title{
  margin:0;
  font-size:18px;
  font-weight:800;
  line-height:1.3;
  color:var(--mjv2-text);
}

.mjv2-home-list-item .mjv2-list-title a{
  color:var(--mjv2-text);
  text-decoration:none;
}

.mjv2-home-list-item .mjv2-list-title a:hover{
  text-decoration:underline;
}

.mjv2-list-chapters{
  display:flex;
  flex-direction:column;
  gap:5px;
}

.mjv2-list-chapter{
  font-size:14px;
  line-height:1.35;
  color:var(--mjv2-muted);
  text-decoration:none;
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.mjv2-list-chapter:hover{
  color:var(--mjv2-text);
}

.mjv2-list-chapter.is-empty{
  color:var(--mjv2-muted);
}

.mjv2-home-list-item .mjv2-list-actions{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.mjv2-home-list-item .mjv2-list-actions .mjv2-btn{
  min-width:90px;
}

/* ======================================================
   EMPTY STATE
====================================================== */

.mjv2-home-items .mjv2-empty-state{
  width:100%;
}

/* ======================================================
   LOAD MORE
====================================================== */

.mjv2-home-more{
  display:flex;
  justify-content:center;
  margin-top:20px;
}

.mjv2-home-more .mjv2-btn{
  padding-left:20px;
  padding-right:20px;
}

/* ======================================================
   TABLET
====================================================== */

@media (max-width:1024px){
  .mjv2-home-main-tabs{
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:10px;
  }

  .mjv2-home-main-tab{
    min-height:68px;
    border-radius:20px;
    padding:10px 8px;
  }

  .mjv2-home-section-title{
    font-size:18px;
  }

  .mjv2-home-page[data-view-mode="grid"] .mjv2-home-grid{
    grid-template-columns:repeat(auto-fill,minmax(160px,1fr));
    gap:16px;
  }
}

/* ======================================================
   MOBILE / TABLET
====================================================== */

@media (max-width:700px){
  .mjv2-hero{
    flex-direction:column;
    align-items:stretch;
    gap:14px;
    margin-bottom:16px;
  }

  .mjv2-search-inline{
    width:100%;
    flex-direction:column;
    align-items:stretch;
  }

  .mjv2-search-inline .mjv2-btn{
    width:100%;
  }

  .mjv2-home-main-tabs{
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:8px;
    margin-bottom:16px;
  }

  .mjv2-home-main-tab{
    min-height:64px;
    padding:10px 6px;
    border-radius:18px;
    gap:6px;
  }

  .mjv2-home-main-tab-icon{
    width:20px;
    height:20px;
  }

  .mjv2-home-main-tab-icon svg{
    width:20px;
    height:20px;
  }

  .mjv2-home-main-tab-label{
    font-size:10px;
  }

  .mjv2-home-panel-head{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }

  .mjv2-home-view-toggle{
    width:100%;
  }

  .mjv2-home-view-toggle.mjv2-segmented-control{
    width:100%;
  }

  .mjv2-home-view-toggle.mjv2-segmented-control button{
    flex:1 1 50%;
  }

  .mjv2-home-chip-group.mjv2-type-segment{
    display:flex;
    width:100%;
    min-width:0;
    overflow-x:auto;
  }

  .mjv2-home-page[data-view-mode="grid"] .mjv2-home-grid{
    grid-template-columns:repeat(auto-fill,minmax(138px,1fr));
    gap:14px;
  }

  .mjv2-home-grid .mjv2-card-body{
    min-height:72px;
    padding:10px;
    gap:5px;
  }

  .mjv2-home-grid .mjv2-card-title{
    font-size:14px;
  }

  .mjv2-home-grid .mjv2-home-card-chapter,
  .mjv2-home-grid .mjv2-meta-line,
  .mjv2-home-grid .mjv2-meta-small{
    font-size:11px;
  }

  .mjv2-home-list-item{
    gap:12px;
    padding:12px;
  }

  .mjv2-home-list-item .mjv2-list-cover{
    width:74px;
    height:102px;
  }

  .mjv2-home-list-item .mjv2-list-title{
    font-size:16px;
  }

  .mjv2-list-chapter{
    font-size:13px;
  }

  .mjv2-home-loading{
    padding:22px 12px;
    border-radius:16px;
  }

  .mjv2-home-loading-text{
    font-size:13px;
  }
}

/* ======================================================
   SMALL MOBILE
====================================================== */

@media (max-width:480px){
  .mjv2-home-page{
    padding-top:6px;
  }

  .mjv2-home-main-tabs{
    gap:8px;
    margin-bottom:14px;
  }

  .mjv2-home-main-tab{
    min-height:60px;
    padding:8px 4px;
    border-radius:16px;
    gap:5px;
  }

  .mjv2-home-main-tab-icon{
    width:18px;
    height:18px;
  }

  .mjv2-home-main-tab-icon svg{
    width:18px;
    height:18px;
  }

  .mjv2-home-main-tab-label{
    font-size:9px;
  }

  .mjv2-segmented-control{
    padding:3px;
  }

  .mjv2-segmented-control button{
    min-height:38px;
    padding:0 12px;
    font-size:12px;
  }

  .mjv2-segment-label{
    font-size:11px;
  }

  .mjv2-home-chip{
    min-height:38px;
    padding:0 12px;
    font-size:12px;
  }

  .mjv2-home-page[data-view-mode="grid"] .mjv2-home-grid{
    grid-template-columns:repeat(3,1fr);
    gap:12px;
  }

  .mjv2-home-grid .mjv2-card-body{
    min-height:64px;
    padding:9px;
    gap:4px;
  }

  .mjv2-home-grid .mjv2-card-title{
    font-size:12px;
    line-height:1.35;
    min-height:2.7em;
  }

  .mjv2-home-grid .mjv2-home-card-chapter,
  .mjv2-home-grid .mjv2-meta-line,
  .mjv2-home-grid .mjv2-meta-small{
    font-size:10px;
    line-height:1.3;
  }

  .mjv2-home-list-item{
    gap:12px;
    padding:12px;
    border-radius:16px;
    align-items:flex-start;
  }

  .mjv2-home-list-item .mjv2-list-cover{
    width:68px;
    height:94px;
  }

  .mjv2-home-list-item .mjv2-list-title{
    font-size:15px;
    line-height:1.3;
  }

  .mjv2-home-list-item .mjv2-list-actions .mjv2-btn{
    min-width:auto;
    padding:10px 12px;
  }

  .mjv2-home-loading{
    padding:20px 10px;
    border-radius:14px;
  }

  .mjv2-home-loading-text{
    font-size:12px;
  }
}