:root{
  color-scheme:dark;
  --bg:#071b14;
  --panel:#0d2a20;
  --panel2:#12372a;
  --line:#275747;
  --text:#eef8f2;
  --muted:#9eb8aa;
  --good:#36d27f;
  --warn:#e0bb65;
  --bad:#e47f74;
}

*{box-sizing:border-box}

body{
  margin:0;
  background:
    radial-gradient(
      circle at 30% 0,
      #124432,
      var(--bg) 50%
    );
  color:var(--text);
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}

.top{
  padding:30px 38px 24px;
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  border-bottom:1px solid var(--line);
}

.eyebrow{
  font-size:12px;
  letter-spacing:.14em;
  color:#7de4aa;
  font-weight:800;
}

h1{
  margin:5px 0 8px;
  font-size:34px;
}

.top p{
  color:var(--muted);
  margin:0;
  max-width:760px;
  line-height:1.7;
}

.top-actions{
  display:flex;
  gap:10px;
}

.btn{
  border:1px solid #40c77b;
  background:#2dcf78;
  color:#032014;
  font-weight:800;
  padding:11px 16px;
  border-radius:11px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.btn.secondary{
  background:#163c30;
  color:var(--text);
  border-color:#426a5c;
}

.btn.warn{
  background:#35291d;
  color:#f2d58b;
  border-color:#715839;
}

.btn.danger{
  background:#35201e;
  color:#f0aaa3;
  border-color:#754944;
}

.btn:disabled{
  opacity:.45;
  cursor:not-allowed;
}

main{
  padding:26px 38px 42px;
}

.stats{
  display:grid;
  grid-template-columns:
    repeat(6,minmax(130px,1fr));
  gap:12px;
}

.stat{
  border:1px solid var(--line);
  background:rgba(17,54,41,.86);
  border-radius:15px;
  padding:17px;
}

.stat span{
  display:block;
  color:var(--muted);
  font-size:13px;
}

.stat strong{
  display:block;
  margin-top:6px;
  font-size:26px;
}

.stat.good strong{
  color:#70e6a7;
}

.stat.warn strong{
  color:#efcd7b;
}

.filters{
  margin-top:18px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}

select{
  background:#0d2b20;
  border:1px solid var(--line);
  border-radius:10px;
  color:var(--text);
  padding:10px 12px;
}

.policy{
  color:var(--muted);
  margin-left:auto;
  font-size:13px;
}

.workspace{
  margin-top:18px;
  display:grid;
  grid-template-columns:
    minmax(300px,390px)
    minmax(0,1fr);
  gap:18px;
  min-height:650px;
}

.queue,
.detail{
  border:1px solid var(--line);
  border-radius:18px;
  background:
    rgba(12,42,31,.92);
  overflow:hidden;
}

.queue{
  padding:18px 10px;
}

.section-head{
  padding:0 10px 12px;
}

.section-head h2{
  margin:0;
}

.section-head p{
  margin:5px 0 0;
  color:var(--muted);
}

.queue-list{
  display:grid;
  gap:8px;
  max-height:800px;
  overflow:auto;
}

.queue-item{
  padding:14px;
  border:1px solid #285343;
  border-radius:13px;
  cursor:pointer;
  background:#0f3024;
}

.queue-item:hover,
.queue-item.active{
  border-color:#49c986;
  background:#154132;
}

.queue-item strong{
  display:block;
}

.queue-item small{
  display:block;
  color:var(--muted);
  margin-top:7px;
  line-height:1.5;
}

.badge{
  display:inline-block;
  border:1px solid #376f58;
  background:#183f30;
  border-radius:999px;
  padding:4px 8px;
  margin:5px 5px 0 0;
  font-size:12px;
}

.badge.ready{
  color:#75e9aa;
}

.badge.hold{
  color:#efc372;
}

.badge.archive{
  color:#afd4c0;
}

.detail{
  padding:26px;
}

.empty{
  min-height:500px;
  display:grid;
  place-content:center;
  text-align:center;
  color:var(--muted);
}

.empty h2{
  color:var(--text);
}

.chapter-head{
  border-bottom:1px solid var(--line);
  padding-bottom:18px;
}

.chapter-head h2{
  margin:8px 0;
  font-size:30px;
}

.meta{
  color:var(--muted);
  line-height:1.8;
}

.progress{
  margin-top:14px;
  background:#061711;
  height:12px;
  border-radius:999px;
  overflow:hidden;
}

.progress span{
  display:block;
  height:100%;
  background:#35d381;
}

.action-bar{
  margin:20px 0;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  padding:16px;
  border-radius:14px;
  background:#071b14;
}

.notice{
  border:1px solid #665a34;
  background:#302d1b;
  color:#efd995;
  border-radius:12px;
  padding:12px 15px;
  line-height:1.6;
}

.sections{
  margin-top:22px;
}

.sections table{
  width:100%;
  border-collapse:collapse;
}

.sections th,
.sections td{
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  vertical-align:top;
}

.sections th{
  color:var(--muted);
  font-size:12px;
}

.chapter-text{
  margin-top:24px;
}

.chapter-text pre{
  white-space:pre-wrap;
  word-break:break-word;
  font:inherit;
  line-height:1.85;
  background:#071a13;
  border:1px solid var(--line);
  border-radius:14px;
  padding:22px;
  max-height:900px;
  overflow:auto;
}

.loading{
  color:var(--muted);
}

@media(max-width:1000px){
  .stats{
    grid-template-columns:
      repeat(2,minmax(130px,1fr));
  }

  .workspace{
    grid-template-columns:1fr;
  }

  .queue-list{
    max-height:430px;
  }

  .policy{
    width:100%;
    margin-left:0;
  }
}
