:root{
  --bg:#f4f6fb;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --border:rgba(17,24,39,.10);
  --shadow:0 18px 45px rgba(17,24,39,.08);
  --radius:22px;
  --primary:#e74c3c;
  --primary2:#ff6b5c;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar{
  max-width:1100px;
  margin:0 auto;
  padding:18px 18px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.2px;
}
.logo{
  width:34px;
  height:34px;
  border-radius:12px;
  background: linear-gradient(135deg,var(--primary),var(--primary2));
  box-shadow: 0 10px 30px rgba(231,76,60,.25);
}
.icon-btn{
  border:none;
  background:transparent;
  cursor:pointer;
  font-size:18px;
  padding:10px 12px;
  border-radius:12px;
}
.icon-btn:hover{background:rgba(0,0,0,.05)}

.app{
  max-width:1100px;
  margin:0 auto;
  padding:18px;
  display:grid;
  grid-template-columns: 1.1fr .9fr;
  gap:18px;
}
@media(max-width:900px){
  .app{grid-template-columns:1fr}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow: var(--shadow);
  padding:18px;
}

.timer-card{
  position:relative;
  overflow:hidden;
}
.timer-card::before{
  content:"";
  position:absolute;
  inset:-120px -120px auto auto;
  width:260px;
  height:260px;
  background: radial-gradient(circle at 30% 30%, rgba(231,76,60,.20), transparent 60%);
  transform: rotate(25deg);
}

.modes{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.mode-btn{
  border:1px solid var(--border);
  background:transparent;
  padding:10px 14px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  color:var(--muted);
}
.mode-btn.active{
  background: rgba(231,76,60,.12);
  border-color: rgba(231,76,60,.20);
  color: var(--text);
}

.time{
  font-size:84px;
  font-weight:900;
  letter-spacing:-1px;
  text-align:center;
  margin:26px 0 14px;
}

.progress{
  height:10px;
  background: rgba(17,24,39,.06);
  border-radius:999px;
  overflow:hidden;
}
.progress-bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg,var(--primary),var(--primary2));
  border-radius:999px;
  transition: width .3s ease;
}

.actions{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:16px;
  flex-wrap:wrap;
}
button.primary{
  border:none;
  background: linear-gradient(135deg,var(--primary),var(--primary2));
  color:white;
  padding:12px 18px;
  font-weight:900;
  border-radius:16px;
  cursor:pointer;
  box-shadow: 0 12px 25px rgba(231,76,60,.20);
}
button.ghost{
  border:1px solid var(--border);
  background:transparent;
  padding:12px 16px;
  font-weight:800;
  border-radius:16px;
  cursor:pointer;
}
button.ghost:hover{background:rgba(0,0,0,.04)}
button.primary:active, button.ghost:active{transform:translateY(1px)}

.meta{
  display:flex;
  justify-content:space-between;
  margin-top:16px;
  color:var(--muted);
  font-weight:700;
}
.hint{
  margin-top:12px;
  font-size:13px;
  color:var(--muted);
  text-align:center;
}

.tasks-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.tasks-head h2{
  margin:0;
  font-size:20px;
}
.task-add{
  display:flex;
  gap:10px;
  margin-top:14px;
}
.task-add input{
  flex:1;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:16px;
  outline:none;
}
.tasks{
  list-style:none;
  padding:0;
  margin:14px 0 0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.task{
  border:1px solid var(--border);
  border-radius:18px;
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
}
.task.dragging{opacity:.6}
.task.active{
  border-color: rgba(231,76,60,.35);
  box-shadow: 0 12px 30px rgba(231,76,60,.12);
}

.chk{
  width:20px;
  height:20px;
  cursor:pointer;
}
.task-main{
  flex:1;
  min-width:0;
}
.task-title{
  font-weight:900;
  margin:0;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.task-title.done{
  text-decoration:line-through;
  color:var(--muted);
}
.task-sub{
  margin-top:6px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}

.pomos{
  display:flex;
  align-items:center;
  gap:8px;
}
.pomo-btn{
  border:1px solid var(--border);
  background:transparent;
  padding:6px 10px;
  border-radius:12px;
  cursor:pointer;
  font-weight:900;
}
.pomo-pill{
  padding:6px 10px;
  border-radius:999px;
  background: rgba(17,24,39,.06);
  font-weight:900;
}

.task-actions{
  display:flex;
  gap:8px;
}
.small{
  border:1px solid var(--border);
  background:transparent;
  padding:8px 10px;
  border-radius:14px;
  cursor:pointer;
  font-weight:900;
}

.modal-backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.40);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  z-index:999;
}
.hidden{display:none}
.modal{
  width:min(620px, 100%);
  background:var(--card);
  border-radius:22px;
  border:1px solid var(--border);
  box-shadow: var(--shadow);
  padding:16px;
}
.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}
.modal-head h3{margin:0;font-size:18px}
.grid{
  margin-top:14px;
  display:grid;
  grid-template-columns: repeat(2, 1fr);
  gap:12px;
}
@media(max-width:520px){
  .grid{grid-template-columns:1fr}
}
.field span{
  display:block;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  margin-bottom:6px;
}
.field input, .field select{
  width:100%;
  padding:12px 12px;
  border:1px solid var(--border);
  border-radius:16px;
  outline:none;
}
.toggles{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.toggle{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  color:var(--text);
}
.modal-foot{
  margin-top:14px;
  display:flex;
  justify-content:flex-end;
}
