/* Reasontra — Planner and Quick notes (assets/planner.js). Everything here starts with .pl-, .qn- or .tp-, so the
   rest of the app is not touched. Phones first; the tablet rail and the desktop sidebar widen the layout. */

/* ---------- header: the day switcher looks and sits like the month switcher of the other pages (.month-pick) ---------- */
.pl-period .lbl.pl-period-lbl { display: flex; align-items: center; justify-content: center; height: 34px; min-width: 12em; margin: 0; border: 0; border-radius: 999px; background: none; color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; overflow: hidden; text-overflow: ellipsis; }
.pl-period .lbl.pl-period-lbl:hover { background: var(--surface-2); }
.pl-period .lbl.pl-period-lbl:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
@media (max-width: 767px) { .pl-period .lbl.pl-period-lbl { min-width: 0; } }

/* ---------- period tabs (Day · Week · Month · Year · Custom) ---------- */
.pl-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.pl-tabs:has(.pl-tab-r) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pl-tab { display: grid; gap: 1px; align-content: start; text-align: left; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); color: var(--text); min-width: 0; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s; }
.pl-tab:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.pl-tab:active { transform: scale(.985); }
.pl-tab[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-sm); background: var(--brand-50); }
.pl-tab-n { display: flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.pl-tab-n svg { width: 13px; height: 13px; }
.pl-tab[aria-selected="true"] .pl-tab-n { color: var(--brand-600); }
.pl-tab-l { font-weight: 650; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.pl-tab-i { font-size: .76rem; font-weight: 600; color: var(--brand-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-tab-c { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-tab .pl-bar { margin-top: 7px; }
@media (max-width: 999px) {
  /* one row that scrolls sideways when five do not fit (no squashed words) */
  .pl-tabs, .pl-tabs:has(.pl-tab-r) { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 14px; gap: 8px; margin: 0 -14px 14px; padding: 2px 14px 6px; scrollbar-width: none; }
  .pl-tabs::-webkit-scrollbar { display: none; }
  .pl-tab { flex: 0 0 152px; scroll-snap-align: start; padding: 10px 12px; }
  .pl-tab-r { flex-basis: 176px; }
}
@media (min-width: 768px) and (max-width: 999px) { .pl-tabs, .pl-tabs:has(.pl-tab-r) { margin: 0 -24px 16px; padding: 2px 24px 6px; scroll-padding-inline: 24px; } }

.pl-tabs.qn-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 220px)); overflow: visible; margin: 0 0 16px; padding: 0; gap: 10px; }
@media (max-width: 599px) { .pl-tabs.qn-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; } .pl-tabs.qn-tabs .pl-tab { padding: 10px 12px; } }

.pl-bar { display: block; height: 5px; border-radius: 99px; background: color-mix(in srgb, var(--muted) 16%, transparent); overflow: hidden; }
.pl-bar i { display: block; height: 100%; border-radius: inherit; background: var(--ok); transition: width .4s ease; }

/* the planner has three tabs (Day, Week, Month): they always fit in one row */
.pl-tabs.pl-tabs3, .pl-tabs.pl-tabs3:has(.pl-tab) { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 0 0 16px; padding: 0; gap: 10px; }
.pl-tabs3 .pl-tab { flex: none; }
@media (max-width: 600px) {
  .pl-tabs.pl-tabs3 { gap: 6px; }
  .pl-tabs3 .pl-tab { padding: 10px; }
  .pl-tabs3 .pl-tab-l { font-size: .88rem; }
  .pl-tabs3 .pl-tab-i, .pl-tabs3 .pl-tab-c { font-size: .72rem; white-space: normal; line-height: 1.3; }
}

/* ---------- layout ---------- */
.pl-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1100px) { .pl-grid { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); } }
@media (min-width: 700px) and (max-width: 1099px) {
  .pl-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .pl-side > .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.pl-side { align-content: start; }
.pl-side.prog-off { grid-template-columns: minmax(0, 1fr); }
.pl-side > .card, .pl-maincol > .card { margin: 0; }

/* ---------- the tasks card ---------- */
.pl-main-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 16px 18px 14px; }
.pl-main-head h2 { font-size: 1.05rem; margin: 0; font-weight: 700; }
.pl-count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.pl-empty-add { margin-top: 14px; }
.pl-empty-add svg { width: 16px; height: 16px; }

/* ---------- time fields (in the task dialog) ---------- */
.pl-tbtn-w { display: flex; align-items: stretch; min-width: 0; position: relative; }
.pl-tbtn { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .9rem; white-space: nowrap; min-width: 0; transition: border-color .15s, background .15s; }
.pl-tbtn:hover:not([disabled]) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); }
.pl-tbtn svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.pl-tbtn > span { overflow: hidden; text-overflow: ellipsis; }
.pl-tbtn[disabled] { opacity: .6; cursor: not-allowed; background: var(--surface-2); font-weight: 500; font-size: .84rem; }
.pl-tbtn.set { color: var(--brand-600); border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-50); padding-right: 38px; font-size: .95rem; }
.pl-tbtn.set svg { color: var(--brand); }
.pl-tclear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--brand-600); display: grid; place-items: center; padding: 0; }
.pl-tclear:hover { background: var(--brand-100); }
.pl-tclear svg { width: 14px; height: 14px; }
.pl-time-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 14px; font-size: .84rem; font-weight: 600; color: var(--brand-600); }
.pl-time-note svg { width: 15px; height: 15px; }
.pl-inline-h { display: inline !important; margin: 0 0 0 4px !important; font-weight: 500; font-size: .8rem; color: var(--muted); }
.field > span .pl-inline-h { font-size: .78rem; }
.pl-addbtn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- steps editor (add form and dialog) ---------- */
.pl-steps-ed { display: grid; gap: 6px; }
.pl-steps-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pl-steps-list:empty { display: none; }
.pl-steps-list li { display: flex; align-items: center; gap: 8px; padding: 2px 2px 2px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.pl-steps-list .pl-step-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; opacity: .7; }
.pl-steps-list .pl-step-done { width: 17px; height: 17px; accent-color: var(--ok); flex: none; margin: 0; }
.pl-steps-list .pl-step-t { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; font-size: .9rem; color: var(--text); }
.pl-steps-list .pl-step-t:focus { outline: none; }
/* inside a form field the app's own input look must not apply to the step's text and tick */
.field .pl-steps-list input.pl-step-t, .field .pl-steps-list input.pl-step-t:focus { border: 0; box-shadow: none; background: none; padding: 8px 0; min-height: 0; width: auto; border-radius: 0; }
.field .pl-steps-list input.pl-step-done { width: 17px; height: 17px; min-height: 0; padding: 0; border: 0; box-shadow: none; flex: none; }
.pl-steps-list li:focus-within { border-color: var(--brand); }
.pl-steps-list .pl-step-x { width: 32px; height: 32px; }
.pl-steps-list .pl-step-x svg { width: 15px; height: 15px; }
.pl-step-add { display: flex; gap: 6px; }
.pl-step-add .input { flex: 1; min-width: 0; min-height: 40px; }
.pl-step-add .btn { min-height: 40px; padding: 0 12px; }
.pl-step-add .btn svg { width: 16px; height: 16px; }

/* ---------- task list ---------- */
.pl-body { border-top: 1px solid var(--line-2); }
.pl-sec { display: flex; align-items: center; gap: 8px; padding: 12px 18px 6px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pl-sec svg { width: 14px; height: 14px; }
.pl-sec b { margin-left: auto; font-size: .74rem; background: var(--surface-2); border-radius: 99px; padding: 1px 8px; color: var(--text-2); }
.pl-sec + .pl-list { border-top: 0; }
.pl-list + .pl-sec { border-top: 1px solid var(--line-2); margin-top: 2px; }
.pl-task { display: grid; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line-2); position: relative; transition: background .15s; }
.pl-tmain { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
/* the time line: "6:00 PM – 7:00 PM · 1 hr" on the left, live state, steps "0/1 steps" on the right */
.pl-thead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; padding: 4px 6px 4px 10px; margin: 0 -6px 0 0; border-radius: 9px; background: var(--brand-50); color: var(--brand-600); }
.pl-thead-t { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 0; }
.pl-thead-t svg { width: 15px; height: 15px; flex: none; }
.pl-thead-t b { font-weight: 700; }
.pl-thead-t i { font-style: normal; font-weight: 600; opacity: .8; }
.pl-thead-r { margin-left: auto; display: inline-flex; }
.pl-scount { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 700; color: var(--text-2); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-scount svg { width: 13px; height: 13px; flex: none; }
.pl-scount.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.pl-meta .pl-scount { font-size: .74rem; padding: 1px 8px; }
.pl-task.done .pl-thead, .pl-task.st-late .pl-thead { background: var(--surface-2); color: var(--text-2); }
.pl-task.st-now .pl-thead { background: color-mix(in srgb, var(--brand) 14%, var(--surface)); }
.pl-list > .pl-task:last-child { border-bottom: 0; }
.pl-task:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.pl-task::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: transparent; }
.pl-task.p2::before { background: var(--warn); }
.pl-task.st-now { background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.pl-task.st-now::before { background: var(--brand); }


.pl-check { flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--muted) 70%, transparent); background: var(--surface); display: grid; place-items: center; color: transparent; padding: 0; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.pl-check svg { width: 14px; height: 14px; stroke-width: 3; }
.pl-check:hover { border-color: var(--ok); color: color-mix(in srgb, var(--ok) 55%, transparent); }
.pl-task.p2 .pl-check { border-color: color-mix(in srgb, var(--warn) 65%, transparent); }
.pl-task.done .pl-check, .pl-check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pl-task.ticking .pl-check, .pl-drow.ticking .pl-check { transform: scale(1.15); }
.pl-check.sm { width: 20px; height: 20px; }
.pl-check.sm svg { width: 12px; height: 12px; }

.pl-tb { flex: 1; min-width: 0; display: grid; gap: 5px; }
.pl-tt { font-weight: 600; overflow-wrap: anywhere; line-height: 1.4; cursor: pointer; border-radius: 4px; justify-self: start; }
.pl-tt:hover { color: var(--brand-600); }
.pl-task.done .pl-tt { color: var(--muted); text-decoration: line-through; }
.pl-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.pl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pl-chip svg { width: 12px; height: 12px; flex: none; }
.pl-chip.hi { background: var(--warn-bg); color: var(--warn); }
.pl-task.done .pl-chip.lo { background: transparent; border: 1px dashed var(--line); }
.pl-chip.ok { background: var(--ok-bg); color: var(--ok); }
.pl-chip.from { background: var(--debt-bg); color: var(--debt); }
.pl-live { font-size: .74rem; padding: 2px 9px; }
.pl-live.lv-now { background: var(--brand); color: #fff; }
.pl-live.lv-next { background: var(--lent-bg); color: var(--lent); }
.pl-live.lv-late { background: var(--warn-bg); color: var(--warn); }
.pl-tnote { margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--line); font-size: .86rem; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.pl-steps { list-style: none; margin: 0; padding: 0 0 0 10px; display: grid; gap: 2px; }
.pl-steps li { display: flex; align-items: flex-start; gap: 8px; font-size: .88rem; line-height: 1.4; padding: 3px 0; }
.pl-steps li span { overflow-wrap: anywhere; min-width: 0; }
.pl-steps li.done span { color: var(--muted); text-decoration: line-through; }
.pl-step-c { flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 5px; border: 1.5px solid color-mix(in srgb, var(--muted) 70%, transparent); background: var(--surface); padding: 0; display: grid; place-items: center; color: transparent; }
.pl-step-c svg { width: 12px; height: 12px; stroke-width: 3; }
.pl-step-c:hover { border-color: var(--ok); }
.pl-step-c[aria-checked="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.pl-edit { margin: -6px -8px -6px 0; opacity: .7; flex: none; }
.pl-task:hover .pl-edit, .pl-edit:focus-visible { opacity: 1; }
@media (hover: none) { .pl-edit { opacity: 1; } }
.pl-move { flex: none; min-height: 32px; padding: 4px 10px; font-size: .8rem; }
.pl-move svg { width: 15px; height: 15px; }

@media (max-width: 600px) {
  .pl-task { padding: 12px 14px; }
  .pl-tmain { gap: 10px; }
  .pl-sec { padding: 12px 14px 6px; }
  .pl-main-head { padding: 14px 14px 10px; }
}
@media (max-width: 420px) {
  .pl-move span { display: none; }
  .pl-move { width: 36px; padding: 0; }
}

.pl-empty { padding: 30px 16px; }
.pl-empty p { margin: 0; }
.pl-empty .pl-empty-h { margin-top: 6px; font-size: .85rem; }
.pl-empty-s { margin: 0; padding: 4px 0 2px; color: var(--muted); font-size: .85rem; }
.pl-carry .card-head { flex-wrap: wrap; }
.pl-carry .card-head .btn svg, .pl-donecard .card-head .btn svg { width: 16px; height: 16px; }
.pl-carry .card-head + .pl-list { border-top: 1px solid var(--line-2); }

/* ---------- progress ---------- */
.pl-prog .card-body { position: relative; }
.pl-prog-x { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; color: var(--muted); }
.pl-prog-x svg { width: 17px; height: 17px; }
.pl-prog-how { margin: 10px 0 0; font-size: .78rem; color: var(--muted); text-align: center; }
.pl-prog-how:empty { display: none; }
.pl-prog-top { display: flex; align-items: center; gap: 16px; padding-right: 26px; }
.pl-prog-show { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 10px 16px; border: 1px dashed var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: .88rem; text-align: left; }
.pl-prog-show:hover { border-color: var(--brand); color: var(--brand-600); }
.pl-prog-show svg { width: 18px; height: 18px; color: var(--brand); flex: none; }
.pl-prog-show span { flex: 1; min-width: 0; }
.pl-prog-show b { font-size: .85rem; color: var(--ok); background: var(--ok-bg); border-radius: 99px; padding: 2px 9px; }
.pl-ring-w { position: relative; width: 104px; height: 104px; flex: none; }
.pl-ring { display: block; width: 100%; height: 100%; }
.pl-ring circle { fill: none; stroke-width: 11; }
.pl-ring .bg { stroke: var(--surface-2); }
.pl-ring .fg { stroke: var(--ok); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.pl-ring-v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.pl-ring-v b { font-size: 1.45rem; font-weight: 750; letter-spacing: -.02em; }
.pl-ring-v span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.pl-prog-t { min-width: 0; }
.pl-prog-t b { font-size: 1.02rem; overflow-wrap: anywhere; }
.pl-prog-t p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.pl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.pl-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px 6px; text-align: center; min-width: 0; }
.pl-stats b { display: block; font-size: 1.2rem; font-weight: 700; }
.pl-stats span { display: block; font-size: .72rem; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-stats .hi { background: var(--warn-bg); }
.pl-stats .hi b { color: var(--warn); }
@media (max-width: 380px) { .pl-ring-w { width: 88px; height: 88px; } .pl-ring-v b { font-size: 1.25rem; } }

/* ---------- completed ---------- */
.pl-donecard .card-head { padding-bottom: 12px; }
.pl-drow { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line-2); }
.pl-drow:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.pl-drow { align-items: flex-start; }
.pl-drow .pl-check { margin-top: 1px; }
.pl-dbody { flex: 1; min-width: 0; display: grid; gap: 5px; }
.pl-dt { min-width: 0; display: grid; cursor: pointer; }
.pl-dline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: .8rem; line-height: 1.4; color: var(--text-2); }
.pl-dline svg { width: 14px; height: 14px; flex: none; }
.pl-dplan, .pl-ddone { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-dplan svg { color: var(--muted); }
.pl-ddone svg { stroke-width: 3; }
.pl-ddone b { font-weight: 700; }
.pl-ddone em { font-style: normal; font-weight: 600; }
.pl-ddone.ok, .pl-ddone.ok svg, .pl-ddone.ok b { color: var(--ok); }
.pl-ddone.late svg, .pl-ddone.late b, .pl-ddone.late em { color: var(--warn); }
.pl-dsteps { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pl-dsteps li { display: flex; align-items: flex-start; gap: 7px; font-size: .82rem; line-height: 1.35; color: var(--text-2); }
.pl-dsteps li svg { width: 14px; height: 14px; flex: none; color: var(--ok); stroke-width: 3; margin-top: 1px; }
.pl-dsteps li i { width: 12px; height: 12px; flex: none; margin: 2px 1px 0; border: 1.5px solid var(--line); border-radius: 4px; }
.pl-dsteps li.no span { color: var(--muted); }
.pl-dsteps li span { overflow-wrap: anywhere; min-width: 0; }
.pl-dt span { font-size: .9rem; color: var(--muted); text-decoration: line-through; overflow-wrap: anywhere; }
.pl-dt small { font-size: .74rem; color: var(--muted); }
.pl-drow:not(.done) .pl-dt span { text-decoration: none; color: var(--text); }
.pl-showall { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 10px; border: 0; border-top: 1px solid var(--line-2); background: none; color: var(--brand-600); font-weight: 600; font-size: .85rem; border-radius: 0 0 var(--r) var(--r); }
.pl-showall:hover { background: var(--brand-50); }
.pl-showall svg { width: 15px; height: 15px; }
.pl-done-empty { display: flex; align-items: center; gap: 8px; padding: 14px 18px 16px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: .85rem; }
.pl-done-empty svg { width: 16px; height: 16px; color: var(--ok); }

/* ---------- year at a glance ---------- */
.pl-months { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pl-month { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); text-align: left; color: var(--text); min-width: 0; }
.pl-month:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.pl-month.now { border-color: var(--brand); background: var(--brand-50); }
.pl-month-n { font-weight: 650; font-size: .85rem; }
.pl-month-c { font-size: .75rem; color: var(--muted); }
@media (max-width: 420px) { .pl-months { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- dialogs ---------- */
.pl-sheet .seg { flex-wrap: nowrap; }
.pl-sheet .seg button { padding: 0 6px; }
@media (max-width: 400px) { .pl-sheet .pl-seg button { font-size: .78rem; } }
.pl-sheet-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; }
.pl-sheet-row.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.pl-sheet-row:has(> [data-time-f][hidden]) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 480px) { .pl-sheet-row:not(.two) { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.pl-sheet .date-field, .pl-sheet .date-btn { width: 100%; }
.pl-sheet .pl-tbtn { width: 100%; height: 42px; justify-content: flex-start; border-radius: var(--r-sm); }
.pl-sheet-p { margin: -4px 0 12px; color: var(--muted); font-size: .88rem; }
.pl-presets { margin: 0 0 14px; }
.pl-presets .chip { min-height: 32px; font-size: .82rem; }
.pl-range-sum { margin: -4px 0 14px; font-size: .85rem; font-weight: 600; color: var(--brand-600); }
.pl-range-sum.bad { color: var(--warn); }
.qn-sheet-meta { margin: -4px 0 12px; font-size: .8rem; color: var(--muted); }

/* ---------- time in the task dialog: a "from – to" row, each side opens a list of times ---------- */
.pl-tadd { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--brand-600); font-weight: 600; font-size: .9rem; }
.pl-tadd:hover { border-color: var(--brand); background: var(--brand-50); }
.pl-tadd svg, .pl-time-off svg { width: 16px; height: 16px; flex: none; }
.pl-time-off { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--muted); font-size: .88rem; }
.pl-tarea { display: grid; gap: 8px; }
.pl-trange { display: flex; align-items: center; gap: 8px; }
.pl-tsel { position: relative; flex: 1 1 0; min-width: 0; cursor: pointer; }
.pl-sheet .pl-tsel .input { width: 100%; height: 46px; min-height: 46px; padding: 0 30px 0 12px; font-weight: 650; font-size: .98rem; font-variant-numeric: tabular-nums; cursor: pointer; caret-color: var(--brand); }
.pl-sheet .pl-tsel:first-child .input { padding-left: 36px; }
.pl-tsel-i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--brand); pointer-events: none; }
.pl-tsel-c { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--muted); pointer-events: none; }
.pl-tdash { flex: none; font-size: .85rem; font-weight: 600; color: var(--muted); }
.pl-tx { flex: none; width: 38px; height: 38px; color: var(--muted); }
.pl-tx:hover { color: var(--debt); }
.pl-tx svg { width: 16px; height: 16px; }
.pl-tsum { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; border-radius: 10px; font-size: .85rem; font-weight: 600; line-height: 1.4; }
.pl-tsum svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.pl-tsum.ok { background: var(--brand-50); color: var(--brand-600); }
.pl-tsum.bad { background: var(--warn-bg); color: var(--warn); }
/* the list of times (opens under the box, above the dialog) */
.pl-tlist { position: fixed; z-index: 150; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(16, 24, 40, .35), var(--shadow); padding: 4px; animation: fade .1s ease-out; scrollbar-width: thin; }
.pl-topt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; width: 100%; min-height: 38px; padding: 8px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: .92rem; font-weight: 600; font-variant-numeric: tabular-nums; text-align: left; }
.pl-topt small { font-size: .76rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.pl-topt:hover:not([disabled]), .pl-topt.hi { background: var(--surface-2); }
.pl-topt.sel { background: var(--brand-50); color: var(--brand-600); }
.pl-topt.sel small { color: var(--brand-600); }
.pl-topt[disabled] { color: var(--muted); opacity: .55; cursor: not-allowed; text-decoration: line-through; }
.pl-topt[disabled] small { text-decoration: none; }
.pl-topt.pl-tact { position: sticky; top: -4px; z-index: 1; justify-content: flex-start; align-items: center; gap: 8px; margin: -4px -4px 4px; width: calc(100% + 8px); padding: 10px 14px; border-radius: 12px 12px 0 0; border-bottom: 1px solid var(--line-2); background: var(--surface); color: var(--brand-600); font-size: .88rem; }
.pl-topt.pl-tact svg { width: 16px; height: 16px; flex: none; }
.pl-topt.pl-tact span { white-space: nowrap; }
.pl-topt.pl-tact small { margin-left: auto; }
.pl-topt.pl-tact:hover, .pl-topt.pl-tact.hi { background: var(--brand-50); }
.pl-tsum.ok.past { background: var(--surface-2); color: var(--text-2); }
.pl-tlist-none { padding: 12px; font-size: .85rem; color: var(--muted); }
@media (max-width: 420px) {
  .pl-trange { flex-wrap: wrap; }
  .pl-tsel { flex: 1 1 calc(50% - 30px); }
  .pl-tdash { display: none; }
  .pl-sheet .pl-tsel:first-child .input { padding-left: 34px; }
}
@media (max-width: 380px) {
  /* small phones: the clock icon makes room, so "12:45 PM" always shows in full */
  .pl-tsel-i { display: none; }
  .pl-sheet .pl-tsel .input, .pl-sheet .pl-tsel:first-child .input { padding: 0 24px 0 10px; font-size: .92rem; }
  .pl-tsel-c { right: 7px; }
  .pl-trange { gap: 6px; }
}

/* ---------- Day / Upcoming ---------- */
.pl-views { display: inline-flex; margin: 0 0 16px; padding: 3px; }
.pl-views button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 18px; font-weight: 650; }
.pl-views svg { width: 16px; height: 16px; }
@media (max-width: 600px) { .pl-views { display: flex; } .pl-views button { flex: 1; justify-content: center; } }
.pl-upbody { border-top: 1px solid var(--line-2); }
.pl-ugroup { scroll-margin-top: 80px; }
.pl-ugroup + .pl-ugroup { border-top: 6px solid var(--surface-2); }
.pl-ugroup-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 14px 18px 8px; }
.pl-ugroup-h h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.pl-ugroup-h span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.pl-ugroup-h > b { flex: none; font-size: .76rem; font-weight: 700; color: var(--brand-600); background: var(--brand-50); border-radius: 99px; padding: 3px 10px; }
.pl-uday-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 18px; border: 0; border-top: 1px solid var(--line-2); background: color-mix(in srgb, var(--surface-2) 55%, transparent); color: var(--text); text-align: left; font-size: .86rem; }
.pl-uday-h b { font-weight: 700; }
.pl-uday-h span { color: var(--muted); font-weight: 600; }
.pl-uday-h svg { width: 15px; height: 15px; margin-left: auto; color: var(--muted); }
.pl-uday-h:hover { background: var(--brand-50); }
.pl-uday-h:hover b { color: var(--brand-600); }
.pl-uday .pl-list { border-top: 1px solid var(--line-2); }
.pl-undated .pl-list { border-top: 1px solid var(--line-2); }
.pl-sumrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 11px 18px; border: 0; border-top: 1px solid var(--line-2); background: none; text-align: left; color: var(--text); }
.pl-sumrow:hover { background: var(--surface-2); }
.pl-sumrow span { min-width: 0; display: grid; }
.pl-sumrow b { font-size: .9rem; }
.pl-sumrow small { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-sumrow i { font-style: normal; font-weight: 700; font-size: .85rem; min-width: 28px; text-align: center; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); }
@media (max-width: 600px) { .pl-ugroup-h, .pl-uday-h { padding-left: 14px; padding-right: 14px; } }

/* ---------- Quick notes: colours ---------- */
.c-default { --qn-hue: var(--muted); --qn-bg: var(--surface); --qn-line: var(--line); }
.c-yellow { --qn-hue: #E0A800; }
.c-green { --qn-hue: #1F9D57; }
.c-blue { --qn-hue: #2F7BD6; }
.c-pink { --qn-hue: #D9417E; }
.c-purple { --qn-hue: #7A4FD1; }
.c-yellow, .c-green, .c-blue, .c-pink, .c-purple {
  --qn-bg: color-mix(in srgb, var(--qn-hue) 11%, var(--surface));
  --qn-line: color-mix(in srgb, var(--qn-hue) 34%, var(--line));
}
.qn-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--qn-line); background: var(--qn-bg); padding: 0; position: relative; flex: none; }
.qn-dot.c-default { background: var(--surface); }
.qn-dot::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--qn-hue); opacity: .75; }
.qn-dot.c-default::after { background: transparent; border: 1.5px dashed var(--muted); opacity: .6; }
.qn-dot[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--qn-hue); }
.qn-colors { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- Quick notes: new note ---------- */
.qn-new { display: grid; gap: 4px; padding: 12px 16px 12px; margin: 0 0 16px; background: var(--qn-bg); border-color: var(--qn-line); transition: background .2s, border-color .2s; }
.qn-new:focus-within { box-shadow: var(--shadow); }
.qn-new-t, .qn-new-b { border: 0; background: transparent; padding: 4px 0; width: 100%; resize: none; color: var(--text); }
.qn-new-t { font-weight: 650; font-size: 1rem; }
.qn-new-b { font-size: .95rem; line-height: 1.55; min-height: 48px; }
.qn-new-t:focus, .qn-new-b:focus { outline: none; }
.qn-new-t::placeholder, .qn-new-b::placeholder { color: var(--muted); }
.qn-new-f { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--qn-line) 70%, transparent); }
.qn-new-btns { margin-left: auto; display: flex; gap: 8px; }
.qn-new-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -2px -6px 2px 0; font-size: .8rem; color: var(--muted); }
.qn-new-h > span { display: inline-flex; align-items: center; gap: 6px; }
.qn-new-h svg { width: 15px; height: 15px; color: var(--brand); }
.qn-new-h b { color: var(--text-2); }
.qn-new-x { width: 32px; height: 32px; }
.qn-new.drop { animation: qn-drop .22s ease-out; transform-origin: top center; }
@keyframes qn-drop { from { opacity: 0; transform: translateY(-10px) scaleY(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .qn-new.drop { animation: none; } .qn.dragging { transform: none; } }
.qn-pin-f { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 600; font-size: .9rem; cursor: pointer; }
.qn-pin-f input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }
.qn-pin-f svg { width: 16px; height: 16px; color: var(--brand); }
.qn-kbd { font-size: .75rem; color: var(--muted); }
.qn-pin-t { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .82rem; }
.qn-pin-t svg { width: 15px; height: 15px; }
.qn-pin-t[aria-pressed="true"] { color: var(--brand-600); border-color: var(--brand); background: var(--brand-50); }
@media (max-width: 600px) {
  .qn-new-f .qn-colors { flex: 1 1 100%; }
  .qn-new-btns { flex: 1 1 100%; }
  .qn-new-btns .btn { flex: 1; }
}

/* ---------- Quick notes: grid (row by row, so the order a note is dragged into reads left to right) ---------- */
.qn-hint { display: flex; align-items: center; gap: 6px; margin: 0 2px 10px; font-size: .8rem; color: var(--muted); }
.qn-hint svg { width: 15px; height: 15px; }
.qn-h { display: flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 6px 2px 10px; }
.qn-h svg { width: 14px; height: 14px; }
.qn-h > b { margin-left: auto; font-size: .74rem; background: var(--surface-2); border-radius: 99px; padding: 1px 8px; color: var(--text-2); letter-spacing: 0; }
.qn-day + .qn-day { margin-top: 6px; }
.qn-dayl { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; color: var(--text); font: inherit; font-size: .9rem; font-weight: 700; text-transform: none; letter-spacing: 0; }
.qn-dayl svg { color: var(--brand); width: 16px; height: 16px; }
.qn-dayl small { font-size: .78rem; font-weight: 500; color: var(--muted); }
.qn-dayl:hover { background: var(--surface-2); color: var(--brand-600); }
.qn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; align-items: start; margin: 0 0 18px; }
@media (max-width: 599px) { .qn-grid { grid-template-columns: 1fr; gap: 12px; } }
.qn-slot { border: 2px dashed color-mix(in srgb, var(--brand) 45%, var(--line)); border-radius: var(--r); background: var(--brand-50); }
.qn.dragging { box-shadow: 0 22px 44px -18px rgba(16, 24, 40, .45), var(--shadow); transform: rotate(1.2deg) scale(1.02); opacity: .97; cursor: grabbing; }
body.qn-dragging, body.qn-dragging * { user-select: none; -webkit-user-select: none; cursor: grabbing !important; }
.qn-grip { width: 30px; height: 30px; margin-left: -8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; padding: 0; cursor: grab; touch-action: none; opacity: .6; flex: none; }
.qn-grip svg { width: 17px; height: 17px; }
.qn-grip:hover, .qn-grip:focus-visible { opacity: 1; background: color-mix(in srgb, var(--qn-hue) 14%, transparent); }
@media (hover: hover) and (pointer: fine) { .qn { cursor: grab; } .qn-b { cursor: pointer; } }
@media (hover: none) { .qn-grip { opacity: .9; width: 36px; height: 36px; } }
.qn { display: grid; grid-column: span var(--span, 1); margin: 0; background: var(--qn-bg); border: 1px solid var(--qn-line); border-radius: var(--r); box-shadow: var(--shadow-sm); position: relative; transition: box-shadow .15s, transform .15s; }
.qn:hover { box-shadow: var(--shadow); }
.qn-b { padding: 14px 44px 6px 16px; cursor: pointer; border-radius: var(--r) var(--r) 0 0; min-height: 52px; }
.qn-b h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.qn-b p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; line-height: 1.55; color: var(--text-2); }
.qn-b p.clip { display: -webkit-box; -webkit-line-clamp: 10; -webkit-box-orient: vertical; overflow: hidden; }
.qn footer { display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px 16px; font-size: .75rem; color: var(--muted); min-width: 0; }
.qn footer .qn-at { margin-left: auto; white-space: nowrap; }
.qn-ed { width: 32px; height: 32px; opacity: .6; }
.qn:hover .qn-ed, .qn-ed:focus-visible { opacity: 1; }
@media (hover: none) { .qn-ed { opacity: 1; } }
.qn-pin { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); opacity: .45; padding: 0; }
.qn-pin svg { width: 17px; height: 17px; }
.qn:hover .qn-pin, .qn-pin:focus-visible { opacity: 1; }
.qn-pin:hover { background: color-mix(in srgb, var(--qn-hue) 14%, transparent); }
.qn-pin[aria-pressed="true"] { opacity: 1; color: var(--brand); }
@media (hover: none) { .qn-pin { opacity: .8; } }
.qn-sheet textarea { background: var(--qn-bg); border-color: var(--qn-line); transition: background .2s, border-color .2s; }
@media (hover: none) { .qn-kbd { display: none; } }

/* ---------- v2.29: the open book, capture ---------- */
.pl-done-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.pl-done-acts .btn svg { width: 16px; height: 16px; }
.pl-donecard .card-head { flex-wrap: nowrap; gap: 10px; }
.pl-donecard .card-head > div:first-child { min-width: 0; }
.pl-donecard .card-head .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-done-acts .btn { padding-inline: 10px; }
@media (max-width: 360px) { .pl-done-acts .pl-capture span, .pl-done-acts [data-pl="clear-done"] span { display: none; } }
@media (max-width: 380px) { .pl-stats span { white-space: normal; line-height: 1.2; } }

/* ---------- notes made wider (right edge) or taller (bottom edge); the corner does both ----------
   Phones and tablets (touch) get the corner only: an edge along the whole note would stop the page from scrolling
   when a finger starts there. A taller text than the box scrolls inside it with the wheel or a finger, without a
   scroll bar; a soft fade shows there is more, and at its end the page carries on scrolling. */
.qn.sized { display: flex; flex-direction: column; }
.qn.sized .qn-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.qn.sized .qn-b::-webkit-scrollbar { display: none; width: 0; height: 0; }
.qn-b.fade-b { -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent); mask-image: linear-gradient(#000 calc(100% - 36px), transparent); }
.qn-b.fade-t { -webkit-mask-image: linear-gradient(transparent, #000 28px); mask-image: linear-gradient(transparent, #000 28px); }
.qn-b.fade-t.fade-b { -webkit-mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(transparent, #000 28px, #000 calc(100% - 36px), transparent); }
.qn.sized footer { flex: none; }
.qn footer { padding-right: 16px; }
.qn-rs { position: absolute; z-index: 2; touch-action: none; }
.qn-rs-r { top: 14px; bottom: 20px; right: -6px; width: 12px; cursor: ew-resize; }
.qn-rs-b { left: 14px; right: 20px; bottom: -6px; height: 12px; cursor: ns-resize; }
.qn-rs-c { right: -3px; bottom: -3px; width: 22px; height: 22px; cursor: nwse-resize; }
/* a thin line shows where to hold */
.qn-rs-r::after, .qn-rs-b::after { content: ""; position: absolute; border-radius: 3px; background: var(--qn-hue); opacity: 0; transition: opacity .15s; }
.qn-rs-r::after { top: 30%; bottom: 30%; left: 4px; width: 4px; }
.qn-rs-b::after { left: 35%; right: 35%; top: 4px; height: 4px; }
.qn-rs-c::after { content: ""; position: absolute; right: 8px; bottom: 8px; width: 9px; height: 9px; border-right: 2px solid var(--qn-hue); border-bottom: 2px solid var(--qn-hue); border-radius: 0 0 3px 0; opacity: .35; transition: opacity .15s; }
.qn:hover .qn-rs-r::after, .qn:hover .qn-rs-b::after { opacity: .35; }
.qn-rs:hover::after, .qn.resizing .qn-rs::after { opacity: .9 !important; }
.qn:hover .qn-rs-c::after { opacity: .7; }
.qn-grid.one-col .qn-rs-r { display: none; }
.qn-grid.one-col .qn-rs-c { cursor: ns-resize; }
.qn.resizing { box-shadow: 0 0 0 2px var(--qn-hue), var(--shadow); transition: none; z-index: 3; }
body.qn-resizing, body.qn-resizing * { user-select: none; -webkit-user-select: none; }
body.qn-resizing.rs-r, body.qn-resizing.rs-r * { cursor: ew-resize !important; }
body.qn-resizing.rs-b, body.qn-resizing.rs-b * { cursor: ns-resize !important; }
body.qn-resizing.rs-c, body.qn-resizing.rs-c * { cursor: nwse-resize !important; }
@media (hover: none), (pointer: coarse) {
  .qn-rs-r, .qn-rs-b { display: none; }
  /* a corner big enough for a finger, always shown */
  .qn-rs-c { width: 34px; height: 34px; right: 0; bottom: 0; border-radius: 0 0 var(--r) 0; }
  .qn-rs-c::after { opacity: .6; right: 9px; bottom: 9px; width: 11px; height: 11px; }
  .qn footer { padding-right: 34px; }
}

/* a quick swipe that starts on a grip or a corner scrolls the page; holding it a moment picks the note up */
.qn-grip { touch-action: pan-y; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
@media (hover: none), (pointer: coarse) { .qn-rs-c { touch-action: pan-y; -webkit-touch-callout: none; } }
