@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;600;700;800&display=swap');
:root{font-family:Vazirmatn,Tahoma,sans-serif;color:#29243b;background:#f6f4fb;font-synthesis:none}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:radial-gradient(circle at 12% 8%,#eee8ff 0,transparent 28%),#f7f6fa}.app{width:min(680px,calc(100% - 32px));margin:0 auto;padding:28px 0 24px}.top{display:flex;justify-content:space-between;align-items:center}.brand{display:flex;align-items:center;gap:10px}.mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#7656d6;color:white;font-size:23px;font-weight:800;box-shadow:0 7px 18px #7656d644}.brand b,.brand small{display:block}.brand b{font-size:15px}.brand small,.today{font-size:12px;color:#918ba2}.hero{margin:36px 0 22px;display:flex;align-items:center;justify-content:space-between}.eyebrow{font-size:12px;color:#7656d6;font-weight:700;margin:0 0 8px}.hero h1{font-size:clamp(22px,5vw,29px);margin:0 0 8px;letter-spacing:-.7px}.sub{color:#8b8599;font-size:13px;margin:0}.spark{font-size:48px;color:#b5a2ef;animation:float 3s ease-in-out infinite}@keyframes float{50%{transform:translateY(-8px) rotate(12deg)}}.panel{background:white;border:1px solid #eeeaf5;border-radius:24px;padding:22px;box-shadow:0 15px 45px #35215b0b}form{display:flex;gap:9px}input{min-width:0;flex:1;border:1px solid #e9e5f0;background:#faf9fc;border-radius:14px;padding:14px 15px;font:inherit;font-size:13px;outline:none;transition:.2s}input:focus{border-color:#9a83e6;box-shadow:0 0 0 3px #7656d616}form button{border:0;border-radius:14px;width:50px;background:#7656d6;color:white;font-size:28px;cursor:pointer;transition:.2s}form button:hover{transform:translateY(-2px);background:#6545c4}.progress-head,.list-head{display:flex;justify-content:space-between;align-items:center}.progress-head{font-size:12px;color:#817b90;margin:23px 0 9px}.progress-head strong{color:#7656d6;font-size:11px}.track{height:7px;border-radius:20px;background:#f0edf6;overflow:hidden}.track div{height:100%;width:0;background:linear-gradient(90deg,#9b83e9,#7656d6);border-radius:20px;transition:width .35s}.list-head{margin:27px 0 12px}.list-head h2{font-size:15px;margin:0}.list-head span{font-size:11px;color:#9a94a8}.tasks{list-style:none;padding:0;margin:0}.task{display:flex;align-items:center;gap:12px;padding:13px 4px;border-bottom:1px solid #f1eef5;animation:appear .25s ease}.task:last-child{border:0}@keyframes appear{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}.check{appearance:none;width:21px;height:21px;border:1.6px solid #d6d0e3;border-radius:7px;cursor:pointer;flex:none;display:grid;place-items:center;transition:.2s}.check:checked{background:#7656d6;border-color:#7656d6}.check:checked:after{content:'✓';color:white;font-size:14px}.task-title{font-size:13px;line-height:1.8;overflow-wrap:anywhere;transition:.2s}.task.done .task-title{color:#aaa5b3;text-decoration:line-through}.empty{text-align:center;color:#a29cad;font-size:12px;padding:27px 5px}footer{text-align:center;color:#aaa4b4;font-size:11px;padding:20px}#toast{position:fixed;bottom:20px;left:50%;transform:translate(-50%,15px);background:#302a40;color:white;padding:10px 16px;border-radius:12px;font-size:12px;opacity:0;pointer-events:none;transition:.25s}#toast.show{opacity:1;transform:translate(-50%,0)}@media(max-width:480px){.app{padding-top:18px}.hero{margin-top:29px}.panel{padding:17px;border-radius:20px}.spark{font-size:38px}}


/* Fix checkbox sizing so the global input styles do not stretch checkboxes. */
.check {
  flex: 0 0 21px;
  min-width: 21px;
  width: 21px;
  height: 21px;
  padding: 0;
  margin: 0;
  background: #fff;
  font: inherit;
}
.check:disabled { cursor: wait; opacity: .75; }
.task-title { flex: 1; min-width: 0; }
.task-actions { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.task-actions button {
  width: 31px; height: 31px; border: 0; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer;
  font: inherit; font-size: 17px; transition: .2s;
}
.edit-btn { background: #f2effa; color: #7656d6; }
.edit-btn:hover { background: #e8e1fa; }
.save-btn { background: #e8f7ef; color: #218653; }
.cancel-btn { background: #fff0f0; color: #c44b4b; }
.edit-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 13px; }
.task.editing .task-title { display: none; }
.task.is-loading .task-title { opacity: .65; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid #ded7f2; border-top-color: #7656d6;
  border-radius: 50%; vertical-align: middle;
  animation: spin .7s linear infinite;
}
.loading-message { display: flex; justify-content: center; align-items: center; gap: 9px; }
.is-loading-check { position: relative; border-color: #b7a8e7; }
.is-loading-check:checked { color: transparent; }
.is-loading-check::after {
  content: ''; width: 10px; height: 10px;
  border: 2px solid #fff; border-left-color: transparent;
  border-radius: 50%; animation: spin .65s linear infinite;
}
.is-loading-button { position: relative; color: transparent !important; pointer-events: none; }
.is-loading-button::after {
  content: ''; position: absolute; width: 17px; height: 17px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; color: #fff; animation: spin .65s linear infinite;
}
.save-btn.is-loading-button::after { color: #218653; }
@keyframes spin { to { transform: rotate(360deg); } }

.delete-btn { background: #fff0f0; color: #c44b4b; }
.delete-btn:hover { background: #ffe1e1; }
.delete-btn:disabled { cursor: wait; opacity: .65; }


/* Refined trash icon and custom delete confirmation dialog */
.delete-btn svg, .confirm-icon svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.delete-btn { background: #fff1f1; color: #d6535c; }
.delete-btn:hover { background: #ffe3e4; color: #bd3540; }
.delete-btn:focus-visible, .confirm-actions button:focus-visible {
  outline: 3px solid #b9a8ef; outline-offset: 2px;
}
body.modal-open { overflow: hidden; }
.confirm-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 20px; background: rgba(31, 25, 47, .48);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  animation: modalFade .18s ease both;
}
.confirm-modal {
  width: min(100%, 360px); padding: 25px 22px 20px; text-align: center;
  background: #fff; border: 1px solid #f0eaf5; border-radius: 24px;
  box-shadow: 0 24px 80px rgba(28, 18, 48, .22);
  animation: modalPop .22s cubic-bezier(.2,.8,.2,1) both;
}
.confirm-icon {
  width: 56px; height: 56px; margin: 0 auto 13px; display: grid; place-items: center;
  border-radius: 18px; color: #d6535c; background: #fff0f0;
}
.confirm-icon svg { width: 25px; height: 25px; stroke-width: 1.8; }
.confirm-modal h3 { margin: 0 0 8px; color: #302a40; font-size: 17px; }
.confirm-modal p { margin: 0; color: #8e879b; font-size: 12px; line-height: 1.9; }
.confirm-task {
  margin: 15px 0 19px; padding: 11px 13px; border-radius: 12px;
  background: #f8f6fb; color: #514a61; font-size: 12px; line-height: 1.8;
  overflow-wrap: anywhere;
}
.confirm-actions { display: flex; gap: 9px; }
.confirm-actions button {
  flex: 1; min-height: 43px; border: 0; border-radius: 12px;
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; transition: .18s;
}
.confirm-cancel { color: #70697d; background: #f2f0f5; }
.confirm-cancel:hover { background: #e9e5ef; }
.confirm-delete { color: #fff; background: #d6535c; }
.confirm-delete:hover { background: #bd3540; transform: translateY(-1px); }
.confirm-overlay.closing { animation: modalFadeOut .16s ease both; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalFadeOut { to { opacity: 0; } }
@keyframes modalPop { from { opacity: 0; transform: translateY(9px) scale(.97); } to { opacity: 1; transform: none; } }
@media (max-width: 380px) {
  .confirm-modal { padding: 22px 17px 17px; border-radius: 21px; }
}
