:root{
  --bg:#f5f7fb;
  --card:#ffffff;
  --border:#dde3f0;
  --accent:#3b82f6;
  --accent-soft:rgba(59,130,246,0.08);
  --accent-soft-strong:rgba(59,130,246,0.16);
  --danger:#ef4444;
  --danger-soft:rgba(239,68,68,0.06);
  --warn:#f59e0b;
  --warn-soft:rgba(245,158,11,0.06);
  --success:#22c55e;
  --success-soft:rgba(34,197,94,0.06);
  --text:#111827;
}

*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
  padding:16px;
}
.container{
  max-width:1200px;
  margin:0 auto;
}
h1{
  font-size:24px;
  margin-bottom:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.card{
  background:var(--card);
  border-radius:16px;
  padding:14px 16px;
  box-shadow:0 8px 24px rgba(15,23,42,0.08);
  margin-bottom:10px;
  border:1px solid var(--border);
}
.controls{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:flex-start;
  margin-bottom:10px;
}
.btn{
  border-radius:999px;
  border:none;
  padding:8px 16px;
  font-size:14px;
  cursor:pointer;
  background:var(--accent);
  color:white;
  display:inline-flex;
  align-items:center;
  gap:6px;
}
.btn.ghost{
  background:transparent;
  color:var(--accent);
  border:1px solid var(--accent-soft);
}
.btn:hover{
  filter:brightness(0.97);
}
.details{
  margin-bottom:8px;
}
.details > summary{
  list-style:none;
  cursor:pointer;
  padding:8px 10px;
  border-radius:10px;
  background:var(--accent-soft);
  margin-bottom:6px;
}
.details[open] > summary{
  background:rgba(59,130,246,0.12);
}
.details > summary::-webkit-details-marker{display:none}

.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
  margin-bottom:6px;
}
.table th,
.table td{
  border:1px solid #e1e5f0;
  padding:6px 8px;
  text-align:left;
  font-size:13px;
  vertical-align:middle;
}
.table th{
  background:#f3f6f9;
}

.progress{
  height:12px;
  background:#eee;
  border-radius:8px;
  overflow:hidden;
}
.progress > span{
  height:100%;
  display:block;
  background:linear-gradient(90deg,#36d07b,#7c8cff);
  width:0%;
}
.badge{
  display:inline-block;
  padding:4px 8px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--border);
  font-size:13px;
}
.small{font-size:13px}
.footer{
  color:#666;
  text-align:center;
  margin-top:18px;
  font-size:13px;
}
.refresh-btn{
  background:none;
  border:0;
  font-size:20px;
  cursor:pointer;
}
.note{
  width:100%;
  padding:6px;
  border:1px solid var(--border);
  border-radius:6px;
}
.row-overdue{
  background:linear-gradient(90deg, rgba(255,107,107,0.06), rgba(255,107,107,0.02));
}
.row-due-soon{
  background:linear-gradient(90deg, rgba(255,184,107,0.05), rgba(255,184,107,0.02));
}
.row-done{
  background:linear-gradient(90deg, rgba(54,208,123,0.06), rgba(124,140,255,0.02));
}

/* NEW: highlight tasks inside the leave / final-revision window */
.row-intense{
  box-shadow:inset 0 0 0 1px rgba(59,130,246,0.6);
  background:var(--accent-soft-strong);
}

.date-cell{white-space:nowrap;font-size:13px}
.note-field{width:100%}
.star{color:#f5b301;margin-left:6px;font-size:14px}
.legend{font-size:13px;color:#444}
.subtopic-wrap{display:flex;align-items:center;gap:8px}
.subtopic-name{flex:1}
@media (max-width:760px){
  .table th,
  table td{font-size:12px}
}

/* --- Mobile & touch improvements --- */
.subtopic-wrap{flex-wrap:wrap}
.btn{padding:10px 14px}
.table{
  display:block;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  width:100%;
}
.table th,
table td{
  min-width:140px;
}
.table thead{display:block}
.table tbody{display:block}
.table tr{
  display:table;
  width:100%;
  table-layout:fixed;
}
.note-field{font-size:14px}
.date-cell{white-space:normal}
@media (max-width:760px){
  body{padding:10px}
  .container{padding:0 8px}
  .controls{
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  .controls .btn,
  .controls .ghost{
    width:100%;
    text-align:center;
  }
  .legend{
    margin-left:0;
    margin-top:8px;
  }
  h1{font-size:20px}
  .card{padding:10px}
  .table th,
  table td{
    font-size:13px;
    min-width:120px;
  }
  .table{border:0}
  .table th{background:transparent}
  .footer{font-size:13px}
  details summary{font-size:15px;padding:10px}
  .archery-plan-detailed td{font-size:13px}
  .note-field{font-size:14px}
}
/* Daily revision calendar rows */
.rev-day {
  background: #f8fafc;
}

.rev-intense {
  background: #fff4d6 !important;
  border-left: 3px solid #f59e0b;
}

.rev-task {
  font-size: 13px;
  line-height: 1.4em;
}

.mock-badge {
  background: #3b82f6;
  padding: 4px 8px;
  color: white;
  border-radius: 8px;
  font-size: 12px;
  display: inline-block;
}
