/* To-do app + the shared "Schedule activity" component (classes act-*). Tokens from admin.css only, logical properties, light + dark through the tokens, phone first (44px targets). */

/* ------------------------------------------------------------ shared: chips, avatars, round tick */
.act-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--info-soft); color: var(--info-ink); max-width: 100%; }
.act-chip > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.act-chip.tone-warn { background: var(--warn-soft); color: var(--warn-ink); }
.act-chip.tone-danger { background: var(--danger-soft); color: var(--danger-ink); }
.act-chip.tone-neutral { background: var(--panel-3); color: var(--muted); }
a.act-link { text-decoration: none; }
a.act-link:hover { text-decoration: underline; }
.act-avs { display: inline-flex; align-items: center; gap: 2px; }
.act-av { width: 24px; height: 24px; font-size: 10px; }
.act-check { position: relative; flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 2px solid var(--muted); border-radius: 50%; background: var(--panel); color: transparent; transition: background .15s, border-color .15s, color .15s; }
.act-check::after { content: ""; position: absolute; inset: -10px; }   /* 44px touch target around the 24px circle */
.act-check:hover:not(:disabled) { border-color: var(--ok); }
.act-check.on { background: var(--ok); border-color: var(--ok); color: var(--accent-on); }
.act-check:disabled { opacity: .45; cursor: not-allowed; }
.act-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.act-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.act-by { overflow-wrap: anywhere; }
.act-form { display: grid; gap: 12px; }
.act-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.act-undo { margin-inline-start: auto; min-height: 36px; padding: 0 12px; border: 1px solid currentColor; border-radius: var(--r-sm); background: transparent; color: inherit; font-weight: 700; }
.toast .act-undo:hover { background: color-mix(in srgb, currentColor 18%, transparent); }

/* ------------------------------------------------------------ To-do screen */
.act-page { display: grid; gap: 12px; align-content: start; }
.act-add { display: grid; gap: 10px; padding: 12px 14px; }
.act-add-row { display: flex; gap: 8px; align-items: center; }
.act-add-input { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); font-size: 15px; outline: 0; }
.act-add-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.act-add-row .btn { min-height: 44px; }
.act-due-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.act-pick { min-height: 44px; padding-inline: 12px; cursor: pointer; position: relative; }
.act-pick.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-d); }
.act-pick-date input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.act-clear { width: 36px; height: 36px; }
.act-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.act-bar .search-box { flex: 1 1 200px; max-width: 360px; }
.act-bar .seg { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.act-count { font-size: 11.5px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--panel-3); color: var(--muted); }
.seg.on .act-count { background: color-mix(in srgb, currentColor 22%, transparent); color: inherit; }
.act-sections { display: grid; gap: 14px; }
.act-section h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; color: var(--muted); }
.act-section.tone-danger h3 { color: var(--danger-ink); }
.act-section.tone-warn h3 { color: var(--warn-ink); }
.act-todos, .act-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.act-todo { display: flex; align-items: flex-start; gap: 14px; padding: 10px 14px; min-height: 52px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.act-todo.is-overdue { box-shadow: inset 3px 0 0 var(--danger); }
[dir="rtl"] .act-todo.is-overdue { box-shadow: inset -3px 0 0 var(--danger); }
.act-todo .act-check { margin-block-start: 2px; }
.act-name-btn { display: block; max-width: 100%; min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 650; text-align: start; overflow-wrap: anywhere; cursor: pointer; }
.act-name-btn:hover { text-decoration: underline; }
.act-todo.is-done .act-name-btn, .act-item.is-done .act-name { text-decoration: line-through; color: var(--muted); }
.act-todo.is-done { background: var(--panel-2); }

/* ------------------------------------------------------------ Activities card (record pages) */
.act-card { display: grid; gap: 10px; }
.act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.act-head h3 { font-size: 15.5px; }
.act-schedule { min-height: 44px; }
.act-item { display: flex; align-items: flex-start; gap: 12px; padding: 8px 2px; border-block-end: 1px solid var(--line-2); }
.act-item:last-child { border-block-end: 0; }
.act-item .act-check { margin-block-start: 3px; }
.act-name { overflow-wrap: anywhere; font-weight: 650; }
.act-item.is-overdue .act-name { color: var(--danger-ink); }
.act-done > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-weight: 650; }
.act-empty { padding-block: 4px; }
.act-error { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }

@media (max-width: 480px) {
  .act-two { grid-template-columns: 1fr; }
  .act-bar .search-box { max-width: none; }
}

/* ------------------------------------------------------------ tasks (spec 11): status, progress, reminders, repeat, record picker, history, team */
.act-chip.tone-ok { background: var(--ok-soft); color: var(--ok-ink); }
.act-progress { display: inline-flex; align-items: center; gap: 6px; min-width: 84px; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.act-progress-track { flex: 1 1 48px; max-width: 80px; height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.act-progress-track > i { display: block; height: 100%; background: var(--ok); border-radius: inherit; }
.act-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; color: var(--muted); }
.act-marks { display: inline-flex; align-items: center; gap: 2px; }
.act-edit { flex: none; align-self: center; color: var(--muted); }
.act-todo > .act-main { align-self: center; }
a.act-name-btn, .act-name-link { text-decoration: none; }
a.act-name-btn:hover, .act-name-link:hover { text-decoration: underline; }
.act-count.bad { background: var(--danger-soft); color: var(--danger-ink); }
.act-bar .chip-select { min-height: 40px; }
.act-bar .grow { flex: 1; }

/* ---- the fields of the task page and the New task dialog */
.act-field-box { display: grid; gap: 8px; min-width: 0; }
.act-by-line { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.act-prog-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.act-prog-row input[type=range] { flex: 1; min-width: 0; accent-color: var(--ok); }
.act-prog-num { width: 76px; }
.act-time-field input { width: 100%; }
.act-rem { display: grid; gap: 8px; min-width: 0; }
.act-rem-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.act-rem .act-pick { min-height: 36px; padding-inline: 12px; }
.act-rem-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.act-rem-num, .act-rep-num { width: 84px; min-height: 40px; padding-inline: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); }
.act-rep { display: grid; gap: 8px; }
.act-rep-on { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 650; cursor: pointer; }
.act-rep-on input { width: 20px; height: 20px; }
.act-rep-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.act-rep-row[hidden] { display: none; }
.act-rep-until { min-height: 40px; }
.act-rec { display: grid; gap: 8px; min-width: 0; }
.act-rec-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.act-rec-pick { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); }
.act-rec-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.act-rec-q { flex: 1 1 180px; min-width: 0; min-height: 40px; }
.act-rec-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.act-rec-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.act-rec-row:hover, .act-rec-row:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: 0; }
.act-rec-row span { overflow-wrap: anywhere; }
.act-rec-none { padding: 6px 2px; }
.act-overdue b { color: var(--danger-ink); }

/* ---- history */
.act-hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.act-hist-item { display: grid; gap: 4px; padding-block-end: 10px; border-block-end: 1px solid var(--line-2); }
.act-hist-item:last-child { border-block-end: 0; padding-block-end: 0; }
.act-hist-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; font-size: 13px; }
.act-hist-changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 12.5px; }
.act-hist-changes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; overflow-wrap: anywhere; }
.act-hist-field { font-weight: 700; }
.act-hist-from { color: var(--muted); text-decoration: line-through; }
.act-hist-arrow { color: var(--muted); }
[dir="rtl"] .act-hist-arrow { display: inline-block; transform: scaleX(-1); }
.act-hist-more { margin-top: 8px; min-height: 44px; }

/* ---- team screen */
.act-team-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.act-team-cards[hidden] { display: none; }
.act-team-card { display: grid; gap: 10px; padding: 12px 14px; text-align: start; font: inherit; color: var(--ink); cursor: pointer; min-width: 0; }
.act-team-card:hover, .act-team-card:focus-visible { border-color: var(--accent); outline: 0; }
.act-team-card.on { border-color: var(--accent); background: var(--accent-soft); }
.act-team-card.has-late { box-shadow: inset 3px 0 0 var(--danger); }
[dir="rtl"] .act-team-card.has-late { box-shadow: inset -3px 0 0 var(--danger); }
.act-team-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.act-team-name { overflow-wrap: anywhere; }
.act-av.lg { width: 36px; height: 36px; font-size: 13px; flex: none; }
.act-team-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.act-team-stat { display: grid; justify-items: start; gap: 0; font-size: 11.5px; color: var(--muted); }
.act-team-stat b { font-size: 17px; color: var(--ink); }
.act-team-stat.bad b { color: var(--danger-ink); }
.act-team-who[hidden] { display: none; }
.act-team-who .chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; }

@media (max-width: 720px) {
  .act-team-cards { grid-template-columns: 1fr; }
  .act-rem .act-pick { min-height: 44px; }
  .act-rem-num, .act-rep-num, .act-rec-q, .act-rep-until, .act-rep-row .chip-select, .act-rem-add .chip-select { min-height: 44px; }
  .act-rep-on { min-height: 44px; }
  .act-prog-row input[type=range] { min-height: 44px; }
  .act-todo { flex-wrap: wrap; }
  .act-todo > .act-main { flex: 1 1 60%; }
  .act-bar > .chip-select { flex: 1 1 140px; }
}
