:root{
  --bg:#f7f8fc;
  --card:#fff;
  --text:#20242b;
  --muted:#737985;
  --line:#e6e8ee;
  --accent:#4f46e5;
}

*{
  box-sizing:border-box;
}

body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

header{
  position:sticky;
  top:0;
  z-index:10;
  background:rgba(255,255,255,.94);
  backdrop-filter:blur(12px);
  border-bottom:1px solid var(--line);
}

.header-inner{
  max-width:1100px;
  margin:auto;
  padding:16px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.logo{
  font-size:21px;
  font-weight:800;
  letter-spacing:-.5px;
}

.logo span{
  color:var(--accent);
}

.home{
  color:var(--muted);
  text-decoration:none;
  font-size:14px;
}

main{
  max-width:1100px;
  margin:0 auto;
  padding:28px 20px 60px;
}

.hero{
  margin-bottom:22px;
}

h1{
  margin:0 0 8px;
  font-size:30px;
  letter-spacing:-1px;
}

.hero p{
  margin:0;
  color:var(--muted);
}

.progress-card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  margin:22px 0;
  box-shadow:0 5px 18px rgba(20,25,40,.04);
}

.progress-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:12px;
}

.progress-number{
  font-size:24px;
  font-weight:800;
}

.progress-label{
  font-size:13px;
  color:var(--muted);
}

.bar{
  height:10px;
  background:#eceef4;
  border-radius:999px;
  overflow:hidden;
}

.bar-fill{
  height:100%;
  width:0;
  background:var(--accent);
  border-radius:999px;
  transition:width .25s;
}

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
}

button{
  border:1px solid var(--line);
  background:#fff;
  color:var(--text);
  border-radius:10px;
  padding:9px 12px;
  cursor:pointer;
  font-weight:650;
}

button:hover{
  background:#f7f7fb;
}

button.primary{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
}

.category{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  margin:12px 0;
  overflow:hidden;
}

.category-head{
  padding:15px 17px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  cursor:pointer;
}

.category-title{
  font-weight:800;
  flex:1;
}

.category-count{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
}

.items{
  border-top:1px solid var(--line);
}

label.item{
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:11px 17px;
  cursor:pointer;
  border-bottom:1px solid #f0f1f5;
}

label.item:last-child{
  border-bottom:0;
}

label.item:hover{
  background:#fafaff;
}

input[type=checkbox]{
  width:18px;
  height:18px;
  margin:1px 0 0;
  accent-color:var(--accent);
  cursor:pointer;
  flex:none;
}

.item-text{
  line-height:1.45;
}

.item.done .item-text{
  text-decoration:line-through;
  color:#9a9faa;
}

.chevron{
  transition:transform .2s;
  color:var(--muted);
}

.category.closed .chevron{
  transform:rotate(-90deg);
}

.category.closed .items{
  display:none;
}

.footer{
  text-align:center;
  color:var(--muted);
  font-size:13px;
  margin-top:30px;
}

#firebaseStatus{
  position:fixed;
  right:14px;
  bottom:14px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:12px;
  padding:9px 12px;
  font-size:12px;
  box-shadow:0 5px 18px rgba(20,25,40,.08);
  z-index:99;
}

@media(max-width:600px){

  h1{
    font-size:25px;
  }

  main{
    padding:22px 13px 45px;
  }

  .header-inner{
    padding:14px;
  }

  .category-head{
    padding:14px;
  }

  label.item{
    padding:11px 14px;
  }
}
.review-filter{display:flex;align-items:center;gap:10px;font-size:14px;margin:16px 0}
.review-filter select{padding:9px;border:1px solid var(--line);border-radius:10px;background:#fff;font:inherit}
.item-copy{flex:1;min-width:0}.review-note{display:block;margin-top:5px;color:var(--muted);font-size:12px;line-height:1.5;text-decoration:none}
.review-note a{color:var(--accent)}.review-note.complete{color:#397344}
label.item[hidden],.category[hidden]{display:none}

/* Five-step review controls */
.stage-button{flex:none;min-width:120px;text-align:center;padding:8px 10px;font-size:12px;border-radius:999px;transition:background .15s}
.stage-0{background:#f0f1f4;color:#626a78}
.stage-1{background:#fff2d8;color:#825300;border-color:#ead9aa}
.stage-2{background:#e6efff;color:#264c9c;border-color:#c9d9fc}
.stage-3{background:#eee8ff;color:#6542b0;border-color:#ded0ff}
.stage-4{background:#e0f4e7;color:#17613a;border-color:#bde4cc}
.item.done .item-text{text-decoration:none;color:#397344}
@media(max-width:600px){label.item{gap:8px}.stage-button{min-width:105px;font-size:11px;padding:8px 6px}}
