/* Owner: tasks feature. Use tokens from app.css only. */

/* ---- day navigation ---- */
.day-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.day-nav-main { flex: 1; text-align: center; }
.day-date { font-weight: 800; font-size: 1.15rem; color: var(--lilac-600); }
.day-today-link { font-size: .82rem; font-weight: 800; color: var(--pink-600); text-decoration: none; }
.day-arrow {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--paper); box-shadow: var(--shadow-sm); color: var(--lilac-600);
  font-size: 1.7rem; line-height: 1; text-decoration: none; transition: transform .25s var(--bounce);
}
.day-arrow:active { transform: scale(.88); }

#day-sections { display: flex; flex-direction: column; gap: 16px; }
.day-summary .progress { margin-bottom: 8px; }
.day-bonus { margin: 6px 0 0; font-weight: 800; color: var(--ink-soft); text-align: center; }
.day-bonus:empty { display: none; }
.day-bonus.is-on { color: var(--pink-600); }
.day-nothing { margin: 0; text-align: center; }
.goal-card { display: block; color: inherit; text-decoration: none; transition: transform .25s var(--bounce); }
.goal-card:active { transform: scale(.98); }
.goal-head { margin-bottom: 8px; color: var(--lilac-600); }
.task-section .section-title { margin-bottom: 8px; }
.day-links { justify-content: center; margin-top: 8px; }

/* ---- task cards ---- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-card {
  background: var(--paper); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-sm); border: 1.5px solid var(--lilac-100);
  transition: transform .25s var(--bounce), opacity .3s;
}
.task-top { display: flex; align-items: center; gap: 12px; }
.task-icon { font-size: 1.7rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; background: var(--grad-soft); flex: none; }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 800; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .82rem; color: var(--ink-soft); font-weight: 700; }
.task-streak { color: var(--pink-600); }
.task-streak-rule { color: var(--ink-faint); font-weight: 600; }
.task-side { display: flex; align-items: center; gap: 10px; flex: none; }
.task-reward { font-size: .95rem; }
.task-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.task-actions:empty { display: none; }
.task-actions form { margin: 0; }
.task-card.is-done { background: var(--mint-light); border-color: transparent; }
.task-card.is-done .task-title { text-decoration: line-through; color: var(--ink-soft); }
.task-card.is-done .task-icon { background: var(--paper); }
.task-card.is-missed { opacity: .65; }
.task-card.is-overdue { border-color: var(--danger-light); }

.task-proof { display: flex; gap: 10px; align-items: center; margin: 8px 0 0 58px; }
.proof-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); display: block; box-shadow: var(--shadow-sm); }
.task-proof-text { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.task-comment { margin: 0; font-style: italic; color: var(--ink-soft); }

/* ---- round check button ---- */
.check-form { margin: 0; }
.check-btn {
  width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--lilac-200);
  background: var(--paper); color: transparent; font-size: 1.5rem; font-weight: 800;
  display: grid; place-items: center; cursor: pointer; padding: 0; touch-action: manipulation;
  transition: transform .25s var(--bounce), background .2s, border-color .2s, color .2s;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.check-btn:hover { border-color: var(--pink-300); color: var(--pink-300); }
.check-btn:active { transform: scale(.82); background: var(--pink-100); }
.check-btn:focus-visible { outline: 3px solid var(--lilac-300); outline-offset: 2px; }
.check-btn.check-done {
  cursor: default; color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--mint), #3dae85);
  box-shadow: 0 4px 12px rgba(61, 174, 133, .4);
}
.check-btn.check-done.pop { animation: check-pop .65s var(--bounce); }
@keyframes check-pop {
  0% { transform: scale(.4) rotate(-30deg); box-shadow: 0 0 0 0 rgba(255, 200, 61, .8); }
  45% { transform: scale(1.35) rotate(8deg); box-shadow: 0 0 0 14px rgba(255, 200, 61, 0); }
  100% { transform: scale(1) rotate(0); }
}
.htmx-request .check-btn { opacity: .6; }

/* ---- floating +N and celebration helpers (celebrate.js) ---- */
.st-float {
  position: fixed; z-index: 1001; pointer-events: none; font-weight: 800; font-size: 1.5rem;
  color: var(--gold-dark); text-shadow: 0 2px 0 var(--paper), 0 0 12px rgba(255, 200, 61, .9);
  animation: st-float-up 1.4s ease-out forwards; will-change: transform, opacity;
}
@keyframes st-float-up { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.2); } 100% { opacity: 0; transform: translate(-50%, -80px) scale(1); } }
.st-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 1000; pointer-events: none; }
.st-pulse { position: fixed; inset: 0; z-index: 1000; pointer-events: none; background: radial-gradient(circle at 50% 30%, rgba(255, 200, 61, .35), transparent 60%); animation: st-pulse 1.2s ease-out forwards; }
@keyframes st-pulse { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }

/* ---- plan sheet, forms ---- */
.plan-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.task-form .modal-actions { margin-top: 8px; }
.form-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.form-two .input { min-width: 0; max-width: 100%; }
.icon-input { font-size: 1.5rem; text-align: center; max-width: 100px; }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 8px; }
.emoji-btn { font-size: 1.4rem; min-height: 42px; border: 2px solid transparent; border-radius: var(--radius-sm); background: var(--lilac-50); cursor: pointer; transition: transform .2s var(--bounce); }
.emoji-btn:active { transform: scale(.85); }
.emoji-btn.is-active { border-color: var(--pink-400); background: var(--pink-100); }
.segmented-wrap { flex-wrap: wrap; border-radius: var(--radius-sm); }
.wd-row { display: flex; flex-wrap: wrap; gap: 6px; }
.wd-chip { position: relative; cursor: pointer; }
.wd-chip input { position: absolute; opacity: 0; pointer-events: none; }
.wd-chip span { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--lilac-100); color: var(--lilac-600); font-weight: 800; transition: transform .2s var(--bounce), background .2s; }
.wd-chip input:checked + span { background: var(--grad-primary); color: #fff; transform: scale(1.08); }
.wd-chip input:focus-visible + span { outline: 3px solid var(--lilac-300); outline-offset: 2px; }
.streak-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 700; }
.streak-row .input { width: 76px; text-align: center; }

/* ---- management lists ---- */
.manage-row { padding: 0 8px 0 0; gap: 4px; }
.manage-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 8px 12px 16px; color: inherit; text-decoration: none; }
.manage-form { margin: 0; flex: none; }
.proposals-banner { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.proposals-banner .row-chevron { margin-left: auto; }
.proposal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.proposal-desc { color: var(--ink-soft); white-space: pre-line; }
.reject-form { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  .check-btn.check-done.pop { animation: none; }
  .st-float { animation-duration: 1.6s; }
}
