:root{
  --bg:#070a12;
  --panel:#0b1224;
  --panel2:#0a1020;
  --text:#e8ecff;
  --muted:#a7b0d6;
  --line:rgba(255,255,255,0.10);
  --ok:#65f0a2;
  --radius:18px;
  --shadow:0 10px 40px rgba(0,0,0,0.45);
}

body.theme-light{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --panel2:#f0f3fa;
  --text:#0b1224;
  --muted:#4b5675;
  --line:rgba(10,16,32,0.12);
  --shadow:0 10px 30px rgba(0,0,0,0.14);
}

*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

.container{
  width:min(1120px,calc(100% - 40px));
  margin:0 auto;
}

/* ===== SECTION ===== */

.section-head{
  margin:24px 0 12px;
}

.section-title{
  margin:0;
  font-size:26px;
}

.section-sub{
  color:var(--muted);
  font-size:14px;
  margin-top:6px;
}

/* ===== PANEL ===== */

.panel{
  background:linear-gradient(180deg,rgba(11,18,36,0.95),rgba(10,16,32,0.92));
  border:1px solid rgba(120,160,255,0.16);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

.panel-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 16px;
  border-bottom:1px solid var(--line);
}

.panel-title{
  font-weight:700;
  font-size:13px;
  color:var(--muted);
}

.panel-status{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:12px;
  color:var(--muted);
}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--ok);
}

/* ===== GRID FIX (IMPORTANT) ===== */

.panel-grid{
  display:grid;
  gap:14px;
  padding:14px;
  grid-template-columns:1fr;
}

@media (min-width:768px){
  .panel-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (min-width:1100px){
  .panel-grid{
    grid-template-columns:repeat(3,1fr);
  }
}

/* ===== BOX ===== */

.box{
  background:rgba(255,255,255,0.03);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  display:flex;
  flex-direction:column;
  height:100%;
}

.box-title{
  font-weight:700;
  font-size:13px;
  color:var(--muted);
  margin-bottom:10px;
}

/* ===== CONTENT ===== */

.output{
  background:rgba(0,0,0,0.25);
  border-radius:12px;
  padding:10px;
  font-size:13px;
  color:var(--muted);
  flex-grow:1;
}

/* ===== COMIC GRID ===== */

.comic-grid{
  display:grid;
  gap:14px;
  grid-template-columns:1fr;
}

@media (min-width:768px){
  .comic-grid{
    grid-template-columns:repeat(2,1fr);
  }
}

@media (min-width:1100px){
  .comic-grid{
    grid-template-columns:repeat(3,1fr);
  }
}

/* ===== COMIC CARD ===== */

.comic-card{
  background:rgba(255,255,255,0.03);
  border:1px solid rgba(255,255,255,0.10);
  border-radius:16px;
  padding:14px;
  transition:0.2s;
  display:flex;
  flex-direction:column;
}

.comic-card:hover{
  transform:translateY(-3px);
  border-color:rgba(120,160,255,0.45);
  background:rgba(120,160,255,0.08);
}

.comic-title{
  font-weight:700;
  font-size:15px;
  margin-bottom:6px;
}

.comic-meta{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
}

.comic-desc{
  font-size:13px;
  color:var(--muted);
  flex-grow:1;
}

/* ===== BUTTON ===== */

.mini-btn{
  margin-top:10px;
  padding:10px;
  border-radius:12px;
  border:1px solid rgba(120,160,255,0.30);
  background:rgba(120,160,255,0.06);
  color:var(--text);
  font-size:13px;
  text-align:center;
}

.mini-btn:hover{
  background:rgba(120,160,255,0.12);
}

/* ===== SMALL TEXT ===== */

.tiny{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
}

/* ===== MOBILE IMPROVEMENT ===== */

@media (max-width:480px){

  .section-title{
    font-size:22px;
  }

  .section-sub{
    font-size:13px;
  }

  .panel{
    border-radius:14px;
  }

  .box{
    padding:12px;
  }

  .comic-card{
    padding:12px;
  }
}