:root{
  --ink:#16181D; --paper:#F5F6F8; --surface:#FFFFFF;
  --line:#E3E6EB; --line-strong:#C9CED6; --muted:#6E7480;
  --blue:#2563EB; --blue-dark:#1D4ED8; --blue-soft:#EAF1FE;
  --green:#2E9E5B; --orange:#E08A1E; --orange-soft:#FDF1DE; --red:#D64545; --red-soft:#F8DEDE;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{background:var(--paper);color:var(--ink);
  font-family:"Assistant","Heebo",-apple-system,"Segoe UI",Arial,sans-serif;
  font-weight:300;font-size:15px;-webkit-font-smoothing:antialiased;padding:24px 16px 80px}
.wrap{max-width:1120px;margin:0 auto}

.header{text-align:center;margin:0 0 16px}
h1{font-weight:700;font-size:26px;letter-spacing:-.01em;margin:0 0 4px}
.subtitle{font-weight:400;font-size:15px;color:var(--muted);margin:0}
h2{font-weight:700;font-size:18px;margin:0}

/* nav */
.nav{display:flex;justify-content:center;gap:6px;margin:0 0 20px}
.nav a{text-decoration:none;color:var(--muted);font-size:14px;font-weight:600;
  padding:7px 16px;border-radius:9px;border:1px solid transparent}
.nav a:hover{background:var(--surface);border-color:var(--line);color:var(--blue)}
.nav a.on{background:var(--blue);color:#fff}

.tools{display:flex;align-items:center;gap:8px;flex-wrap:nowrap;margin-bottom:18px}
.field{background:var(--surface);border:1px solid var(--line);border-radius:9px;height:38px;
  padding:0 10px;font:inherit;color:var(--ink);min-width:0;font-size:14px}
.field:focus-visible{outline:2px solid var(--blue);outline-offset:1px}
#search{flex:1 1 auto}
#filter{flex:0 1 150px}
.spacer{flex:1}
.btn-add{flex:0 0 38px;height:38px;width:38px;border-radius:9px;border:none;cursor:pointer;
  background:var(--blue);color:#fff;font-size:22px;line-height:1;display:grid;place-items:center}
.btn-add:hover{transform:translateY(-1px)}
.btn-help{flex:0 0 38px;height:38px;width:38px;border-radius:9px;border:1px solid var(--line);
  cursor:pointer;background:var(--surface);color:var(--muted);font:inherit;font-size:17px;
  font-weight:600;display:grid;place-items:center}
.btn-help:hover{border-color:var(--blue);color:var(--blue)}
#cloud.linked{border-color:var(--green);color:var(--green)}

.save-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:-10px 0 14px;min-height:16px}
.save-state{font-size:11.5px;color:var(--green);opacity:0;transition:opacity .2s ease}
.save-state.on{opacity:1}
.reset-btn{border:none;background:transparent;color:var(--line-strong);font:inherit;font-size:11.5px;cursor:pointer;padding:2px 4px}
.reset-btn:hover{color:var(--red);text-decoration:underline}

.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;overflow:auto}
.card.rows5{max-height:310px}
table{border-collapse:separate;border-spacing:0;width:100%;min-width:900px}
th,td{padding:0;text-align:right}
thead th{position:sticky;top:0;z-index:2;font-weight:600;font-size:12px;color:var(--muted);
  letter-spacing:.03em;padding:13px 9px;border-bottom:1px solid var(--line-strong);
  white-space:nowrap;background:var(--surface)}
tbody td{border-bottom:1px solid var(--line);padding:8px 7px;vertical-align:middle}
tbody tr:last-child td{border-bottom:none}
tbody tr:hover{background:#FBFCFD}

.cell-input,.cell-select{width:100%;border:1px solid transparent;background:transparent;
  border-radius:7px;height:34px;padding:0 8px;font:inherit;color:inherit;appearance:none;cursor:pointer}
.cell-input:hover,.cell-select:hover{border-color:var(--line)}
.cell-input:focus,.cell-select:focus{outline:none;border-color:var(--blue);background:#fff}
th.name-h,td.name-c{min-width:190px;max-width:26ch}
th.imp-h,td.imp-c{width:1px;white-space:nowrap}
.num{width:52px;text-align:center;font-variant-numeric:tabular-nums;font-weight:600}

.name-btn{border:none;background:transparent;width:100%;height:34px;
  text-align:right;padding:0 4px;font:inherit;font-weight:700;cursor:pointer;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.name-btn:hover{text-decoration:underline;text-underline-offset:3px}
.name-btn .ph{color:var(--line-strong);font-weight:400}

th.status-h,td.status{width:1px;white-space:nowrap}
.status{position:relative}
.status select{width:auto;min-width:0;padding-inline-start:21px;padding-inline-end:10px;font-weight:600;font-size:13.5px}
.dot{position:absolute;inset-inline-start:10px;top:50%;transform:translateY(-50%);width:7px;height:7px;border-radius:50%;pointer-events:none}

td.notes-c{text-align:center;padding:8px 6px;width:40px}
th.notes-h{text-align:center;padding-inline:6px;width:40px}
.note-btn{border:1px solid transparent;background:transparent;cursor:pointer;font-size:15px;
  line-height:1;padding:5px 3px;border-radius:7px;position:relative;opacity:.45}
.note-btn:hover{border-color:var(--line);background:var(--paper);opacity:1}
.note-btn.has{opacity:1}
.note-count{position:absolute;top:0;inset-inline-end:0;background:var(--blue);color:#fff;font-size:9px;
  font-weight:600;min-width:14px;height:14px;border-radius:7px;display:grid;place-items:center;padding:0 3px}

th.m{width:44px;text-align:center;padding:13px 0;font-variant-numeric:tabular-nums;font-weight:600;font-size:11.5px;color:var(--muted)}
th.m .badge{display:block;border-radius:6px;padding:3px 0;margin:0 2px}
th.m.now .badge{background:var(--blue);color:#fff}
th.nav-c{width:26px;padding:13px 0;text-align:center}
td.nav-c{width:26px}
.navbtn{border:1px solid var(--line);background:var(--surface);color:var(--muted);cursor:pointer;
  width:22px;height:24px;border-radius:6px;display:grid;place-items:center;padding:0;margin:0 auto}
.navbtn:hover{border-color:var(--blue);color:var(--blue)}
td.m{padding:8px 3px;width:44px}
.chip{display:grid;place-items:center;width:100%;height:34px;border:none;cursor:pointer;background:transparent;padding:0;
  font-family:Arial,Helvetica,sans-serif;font-size:19px;font-weight:700;line-height:1;color:var(--line-strong)}
.chip:hover{color:var(--muted)}
/* an empty month shows the × text only — no circle, ever */
.chip[data-c=""]::before{content:none!important;display:none!important}
.chip[data-c="g"]::before,.chip[data-c="o"]::before,.chip[data-c="r"]::before{
  content:"";display:block;border-radius:50%;background:#DFE3E8;width:14px;height:14px;
  transition:width .15s ease,height .15s ease,background .15s ease}
.chip[data-c="g"]::before{background:var(--green);width:16px;height:16px}
.chip[data-c="o"]::before{background:var(--orange);width:18px;height:18px}
.chip[data-c="r"]::before{background:var(--red);width:20px;height:20px}
td.m.now .chip[data-c]:not([data-c=""])::before{box-shadow:0 0 0 1.5px var(--blue)}
td.m.now .chip[data-c=""]{color:var(--blue)}

.del{border:none;background:transparent;color:var(--line-strong);cursor:pointer;font-size:16px;padding:6px 8px;border-radius:6px;line-height:1}
.del:hover{color:var(--red);background:var(--red-soft)}
.reorder{display:flex;flex-direction:column;gap:3px;width:26px}
.arrow{border:1px solid var(--line);background:var(--surface);color:var(--muted);cursor:pointer;
  height:17px;border-radius:5px;display:grid;place-items:center;padding:0}
.arrow:hover{border-color:var(--blue);color:var(--blue);background:var(--paper)}
.arrow:disabled{opacity:.3;cursor:default}
.tri{width:0;height:0}
.tri.up{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:5px solid currentColor}
.tri.down{border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid currentColor}

.empty{padding:48px 20px;text-align:center;color:var(--muted)}
.legend{display:flex;gap:18px;flex-wrap:wrap;align-items:center;justify-content:center;margin-top:14px;font-size:13px;color:var(--muted)}
.legend b{display:inline-block;border-radius:50%;margin-inline-end:6px;vertical-align:middle}

table.links-t{min-width:430px}
.links-t td{padding:8px 7px}
.link-in{width:100%;border:1px solid transparent;background:transparent;border-radius:7px;height:34px;padding:0 8px;font:inherit;color:inherit}
.link-in:hover{border-color:var(--line)}
.link-in:focus{outline:none;border-color:var(--blue);background:#fff}
.link-in.title{font-weight:600}
.link-in.url{direction:ltr;text-align:left;font-size:13px;color:var(--muted)}
td.copy-c{width:44px;padding:8px 4px}
.copy{width:100%;border:1px solid var(--line);background:var(--paper);border-radius:8px;padding:6px 0;font:inherit;font-size:14px;line-height:1.3;cursor:pointer}
.copy:hover{border-color:var(--blue)}
.copy.done{background:var(--green);border-color:var(--green);color:#fff}

.pad{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px}
.note-new{display:flex;flex-direction:column;gap:8px;margin-bottom:16px}
.note-new textarea{width:100%;min-height:64px;resize:vertical;border:1px solid var(--line);
  border-radius:10px;padding:9px 11px;font:inherit;color:var(--ink);background:var(--paper)}
.note-new textarea:focus{outline:none;border-color:var(--blue);background:#fff}
.btn{border:none;border-radius:8px;padding:8px 14px;font:inherit;font-weight:600;font-size:13.5px;
  cursor:pointer;background:var(--blue);color:#fff;align-self:flex-start}
.btn:disabled{opacity:.35;cursor:default}
.btn.ghost{background:transparent;color:var(--muted);border:1px solid var(--line)}
.btn.ghost:hover{color:var(--blue);border-color:var(--blue)}
.btn.danger{background:transparent;color:var(--red);border:1px solid var(--line)}
.btn.danger:hover{border-color:var(--red);background:var(--red-soft)}
.note{border:1px solid var(--line);border-radius:11px;padding:10px 12px;margin-bottom:9px;background:var(--paper)}
.note-ts{font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums;margin-bottom:5px}
.note-text{white-space:pre-wrap;font-size:14.5px;line-height:1.5}
.note textarea{width:100%;min-height:60px;resize:vertical;border:1px solid var(--blue);border-radius:8px;padding:8px 10px;font:inherit;background:#fff;margin-bottom:8px}
.note textarea:focus{outline:none}
.note-actions{display:flex;gap:6px;margin-top:8px}
.note-actions .btn{padding:5px 11px;font-size:12.5px}
.no-notes{color:var(--muted);font-size:13.5px;text-align:center;padding:10px 0}

.overlay{position:fixed;inset:0;background:rgba(22,24,29,.42);display:flex;align-items:center;justify-content:center;padding:20px;z-index:50}
.overlay[hidden]{display:none}
.modal{background:var(--surface);border-radius:16px;width:100%;max-width:460px;max-height:85vh;
  overflow:auto;padding:20px 20px 22px;box-shadow:0 20px 50px rgba(0,0,0,.18)}
.modal-head{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.modal-name{flex:1;border:1px solid transparent;background:transparent;font:inherit;font-weight:700;
  font-size:19px;color:var(--ink);border-radius:8px;height:38px;padding:0 8px}
.modal-name:hover{border-color:var(--line)}
.modal-name:focus{outline:none;border-color:var(--blue)}
.modal-close{border:none;background:transparent;color:var(--muted);cursor:pointer;font-size:18px;padding:6px;border-radius:7px;flex:none}
.modal-close:hover{background:var(--paper);color:var(--blue)}
.modal-label{display:block;font-size:12px;color:var(--muted);font-weight:600;margin-bottom:8px}
.modal-fields{display:flex;flex-direction:column;gap:12px;margin:0 0 16px}
.mf{flex:1}
.mf .modal-label{margin-bottom:5px}
.mf-in{width:100%;border:1px solid var(--line);background:var(--paper);border-radius:9px;height:36px;
  padding:0 10px;font:inherit;font-weight:600;font-size:13.5px;color:var(--ink);cursor:pointer;appearance:none}
.mf-in:focus{outline:none;border-color:var(--blue);background:#fff}
.modal-footer{display:flex;gap:8px;margin-top:18px;padding-top:14px;border-top:1px solid var(--line)}
.modal-footer .btn{align-self:auto}

.mm-wrap{display:flex;align-items:stretch;gap:6px;margin-bottom:8px}
.mm-nav{flex:none;width:22px;height:auto}
.mm-strip{flex:1;display:flex;gap:3px}
.mm-cell{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px}
.mm-num{font-size:10.5px;white-space:nowrap;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.mm-cell.now .mm-num{background:var(--blue);color:#fff;border-radius:5px;padding:1px 6px}
.mm-chip{display:grid;place-items:center;width:100%;height:34px;border:none;cursor:pointer;background:transparent;padding:0;
  font-family:Arial,Helvetica,sans-serif;font-size:19px;font-weight:700;line-height:1;color:var(--line-strong)}
.mm-chip[data-c=""]::before{content:none!important;display:none!important}
.mm-chip[data-c="g"]::before,.mm-chip[data-c="o"]::before,.mm-chip[data-c="r"]::before{
  content:"";display:block;border-radius:50%;background:#DFE3E8;width:14px;height:14px;transition:width .15s ease,height .15s ease,background .15s ease}
.mm-chip[data-c="g"]::before{background:var(--green);width:16px;height:16px}
.mm-chip[data-c="o"]::before{background:var(--orange);width:18px;height:18px}
.mm-chip[data-c="r"]::before{background:var(--red);width:20px;height:20px}
.mm-cell.now .mm-chip[data-c]:not([data-c=""])::before{box-shadow:0 0 0 1.5px var(--blue)}
.mm-cell.now .mm-chip[data-c=""]{color:var(--blue)}
.mm-legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--muted);margin-bottom:18px}
.mm-legend b{display:inline-block;border-radius:50%;margin-inline-end:5px;vertical-align:middle}

.help-legend{display:flex;flex-direction:column;align-items:flex-start;gap:7px;font-size:13.5px;color:var(--ink);margin-bottom:18px}
.help-legend b{display:inline-block;border-radius:50%;margin-inline-end:9px;vertical-align:middle}
.help-list{margin:0 0 18px;padding-inline-start:18px;font-size:13.5px;line-height:1.65;color:var(--ink)}
.cloud-help{font-size:13px;color:var(--muted);line-height:1.55;margin:0 8px 16px}
.cloud-msg{font-size:12.5px;margin-top:12px;padding:0 8px;color:var(--muted)}
.cloud-msg.ok{color:var(--green)}
.cloud-msg.err{color:var(--red)}

@media (max-width:640px){
  body{padding:16px 10px 60px;font-size:14px}
  h1{font-size:21px} h2{font-size:16px} .subtitle{font-size:13.5px}
  .nav a{padding:6px 12px;font-size:13px}
  .field{height:36px;font-size:13px} #filter{flex:0 1 108px}
  .btn-add,.btn-help{flex:0 0 36px;width:36px;height:36px;font-size:20px}
  .card{border-radius:12px;-webkit-overflow-scrolling:touch}
  table{min-width:700px} table.links-t{min-width:340px}
  thead th{font-size:11px;padding:10px 5px}
  tbody td{padding:6px 5px}
  th.name-h,td.name-c{min-width:150px;max-width:18ch}
  .name-btn{font-size:13.5px;padding:0 6px}
  .num{width:42px}
  th.m,td.m{width:38px} th.m{font-size:10.5px}
  .chip{height:32px}
  .modal{max-width:100%;max-height:88vh;padding:16px;border-radius:14px}
  .card.rows5{max-height:265px}
  .pad{padding:13px}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}

.header{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:12px}
.logo{width:52px;height:52px;object-fit:contain;display:block}
.header-text{text-align:right}
.badge.mjump{border:none;background:transparent;font:inherit;color:inherit;cursor:pointer;width:100%}
.badge.mjump:hover{background:var(--line);border-radius:6px}
th.m.now .badge.mjump{background:var(--blue);color:#fff}
th.m.now .badge.mjump:hover{background:var(--blue-dark)}
@media (max-width:640px){ .logo{width:38px;height:38px} .header{gap:9px} }

/* importance: colour by level, and collapsible column */
.num.imp7{color:var(--red);font-weight:700}
.num.imp6{color:var(--orange);font-weight:700}
.imp-h{cursor:pointer;user-select:none}
.imp-h:hover{color:var(--blue)}
.imp-h .cue{font-size:9px;color:var(--line-strong);margin-inline-start:4px}
th.imp-h.collapsed,td.imp-c.collapsed{width:22px;min-width:22px;max-width:22px;padding-inline:0;text-align:center}
th.imp-h.collapsed{color:var(--line-strong);font-size:10px}

/* ---- projects table goes edge-to-edge and full height on phones ---- */
@media (max-width:640px){
  .card.rows7{
    max-height:none;
    /* break out of the page padding so the table uses the whole screen width */
    margin-inline:-10px;
    width:calc(100% + 20px);
    border-inline:none;
    border-radius:0;
  }
  .card.rows7 table{min-width:0}
  .card.rows7 th.name-h,.card.rows7 td.name-c{min-width:92px;max-width:92px}
  .card.rows7 .name-btn{font-size:12.5px;padding:0 3px}
  .card.rows7 th.m,.card.rows7 td.m{width:30px}
  .card.rows7 th.m{font-size:9px}
  /* the year is what makes the month labels wide — drop it on phones */
  .card.rows7 th.m .badge .yr{display:none}
  .card.rows7 td.m{padding-inline:1px}
  .card.rows7 th.m .badge{padding:2px 0;margin:0}
  .card.rows7 .chip{height:30px}
  .card.rows7 thead th{padding:9px 3px;font-size:10.5px}
  .card.rows7 tbody td{padding:5px 3px}
  .card.rows7 .status select{font-size:11.5px;padding-inline-start:17px;padding-inline-end:4px}
  .card.rows7 .dot{inset-inline-start:5px;width:6px;height:6px}
  .card.rows7 .num{width:36px}
  .card.rows7 .reorder{width:20px}
  .card.rows7 td.notes-c,.card.rows7 th.notes-h{width:28px;padding-inline:2px}
  .card.rows7 th.nav-c,.card.rows7 td.nav-c{width:20px}
  .card.rows7 .navbtn{width:17px;height:21px}
  .card.rows7 .del{padding:5px 3px;font-size:14px}
}

/* ================= tasks page ================= */
table.tasks-t{min-width:620px}
.tasks-t td{padding:7px 6px}
.t-row{cursor:pointer}
.t-row.drag-over td{border-top:2px solid var(--blue)}
.t-row.dragging{opacity:.4}
.t-row[data-flag="g"]{background:#EDF8F1}
.t-row[data-flag="o"]{background:#FDF4E6}
.t-row[data-flag="r"]{background:#FCEDED}
.t-row[data-flag="g"]:hover{background:#E4F3EA}
.t-row[data-flag="o"]:hover{background:#FAECD8}
.t-row[data-flag="r"]:hover{background:#F8E2E2}

td.grip-c{width:26px;padding-inline:2px}
.grip{cursor:grab;color:var(--line-strong);font-size:14px;line-height:1;text-align:center;user-select:none;padding:4px 0}
.grip:active{cursor:grabbing}
.grip:hover{color:var(--muted)}

.t-in{width:100%;border:1px solid transparent;background:transparent;border-radius:7px;height:34px;
  padding:0 8px;font:inherit;font-weight:600;color:inherit}
.t-in:hover{border-color:var(--line)}
.t-in:focus{outline:none;border-color:var(--blue);background:#fff}
.t-sel{width:100%;border:1px solid transparent;background:transparent;border-radius:7px;height:34px;
  padding:0 6px;font:inherit;font-size:13px;color:var(--muted);appearance:none;cursor:pointer}
.t-sel:hover{border-color:var(--line)}
.t-sel:focus{outline:none;border-color:var(--blue);background:#fff}
th.t-name,td.t-name{min-width:200px}
th.t-proj,td.t-proj{width:150px}
th.t-stat,td.t-stat{width:112px}
th.t-pri,td.t-pri{width:96px}
.t-sel.pri-high{color:var(--red);font-weight:700}
.t-sel.pri-mid{color:var(--orange);font-weight:600}
.t-sel.pri-low{color:var(--muted)}
.done-line{text-decoration:line-through;color:var(--muted)}
.done-count{background:var(--blue);color:#fff;border-radius:9px;font-size:11px;font-weight:700;padding:1px 7px;margin-inline-start:6px}
.btn-done{height:38px;border:1px solid var(--line);background:var(--surface);color:var(--muted);
  border-radius:9px;padding:0 14px;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.btn-done:hover{border-color:var(--blue);color:var(--blue)}
.done-row{display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:11px;
  padding:9px 12px;margin-bottom:8px;background:var(--paper)}
.done-row .txt{flex:1;min-width:0}
.done-row .nm{font-weight:600;font-size:14px;text-decoration:line-through;color:var(--muted)}
.done-row .meta{font-size:11.5px;color:var(--line-strong);margin-top:2px}
.hint-line{font-size:12.5px;color:var(--muted);text-align:center;margin-top:12px}

@media (max-width:640px){
  table.tasks-t{min-width:0}
  th.t-name,td.t-name{min-width:120px}
  th.t-proj,td.t-proj{width:96px}
  th.t-stat,td.t-stat{width:88px}
  th.t-pri,td.t-pri{width:74px}
  .t-in{font-size:13px;padding:0 4px}
  .t-sel{font-size:11.5px;padding:0 3px}
  .tasks-t td{padding:6px 3px}
}

/* ---- starred tasks ---- */
td.star-c,th.star-h{width:30px;padding-inline:2px;text-align:center}
.star{border:none;background:transparent;cursor:pointer;font-size:15px;line-height:1;
  padding:4px 2px;border-radius:6px;color:var(--line-strong);opacity:.5;transition:opacity .15s ease}
.star:hover{opacity:1;background:var(--paper)}
.star.on{opacity:1;color:#E8A317}
.fav-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 10px}
.fav-title{display:flex;align-items:center;gap:7px;font-weight:700;font-size:16px}
.fav-title .cnt{background:#E8A317;color:#fff;border-radius:9px;font-size:11px;font-weight:700;padding:1px 7px}
.fav-toggle{border:1px solid var(--line);background:var(--surface);color:var(--muted);border-radius:8px;
  padding:5px 12px;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.fav-toggle:hover{border-color:var(--blue);color:var(--blue)}
.fav-section{margin-bottom:26px}
.fav-section .card{border-color:#F0DCB0;background:#FFFDF8}
.fav-section .t-row[data-flag=""]{background:transparent}
@media (max-width:640px){ .fav-title{font-size:14.5px} td.star-c,th.star-h{width:26px} }

/* the projects table must never scroll inside itself — the page scrolls instead */
.card.rows7{max-height:none !important;overflow-y:visible}
.card.rows7 thead th{position:static}

/* ---- task priority colours ---- */
.t-sel.pri-high{color:var(--red);font-weight:700}
.t-sel.pri-mid{color:var(--orange);font-weight:600}
.t-sel.pri-low{color:var(--green);font-weight:600}
.t-sel.pri-none{color:var(--line-strong);font-weight:400}

/* ---- task status colours ---- */
.t-sel.st-todo{color:var(--ink);font-weight:600}
.t-sel.st-doing{color:var(--green);font-weight:700}
.t-sel.st-wait{color:var(--orange);font-weight:600}
.t-sel.st-drop{color:var(--red);font-weight:600}
.t-sel.st-done{color:var(--line-strong);font-weight:400}

/* ---- default month state is an ✕, not an empty circle ---- */

.legend b.x-mark,.mm-legend b.x-mark,.help-legend b.x-mark{
  background:transparent!important;color:var(--line-strong);
  border-radius:0;width:auto!important;height:auto!important;
  font-family:Arial,Helvetica,sans-serif;font-size:17px;font-weight:700;line-height:1;
}

/* ---- row serial number ---- */
th.idx-h,td.idx-c{width:26px;text-align:center;padding-inline:2px}
.idx{font-size:11.5px;color:var(--line-strong);font-variant-numeric:tabular-nums;font-weight:600}

/* ---- sortable headers ---- */
th.sortable{cursor:pointer;user-select:none}
th.sortable:hover{color:var(--blue)}
th.sortable .dir{font-size:9px;margin-inline-start:3px;color:var(--line-strong)}
th.sortable.on{color:var(--blue)}
th.sortable.on .dir{color:var(--blue)}
.sort-note{font-size:12px;color:var(--muted);text-align:center;margin-top:10px}
.sort-note button{border:1px solid var(--line);background:var(--surface);color:var(--muted);
  border-radius:7px;padding:3px 10px;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;margin-inline-start:6px}
.sort-note button:hover{border-color:var(--blue);color:var(--blue)}
@media (max-width:640px){ .card.rows7 th.idx-h,.card.rows7 td.idx-c{width:20px} .idx{font-size:10px} }

/* tasks page: notes column sits tight next to the grip */
.tasks-t td.notes-c,.tasks-t th.notes-h{width:34px;padding-inline:3px}
@media (max-width:640px){ .tasks-t td.notes-c,.tasks-t th.notes-h{width:28px;padding-inline:1px} }

/* ---- projects: drag handle replaces the arrows ---- */
tr.dragging{opacity:.4}
tr.drag-over td{border-top:2px solid var(--blue)}
tbody tr[draggable="true"] .grip{cursor:grab}

/* ---- tasks: name opens a card, plus the time field ---- */
.t-name-btn{border:none;background:transparent;width:100%;height:34px;
  text-align:right;padding:0 4px;font:inherit;font-weight:700;cursor:pointer;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.t-name-btn:hover{text-decoration:underline;text-underline-offset:3px}
.t-name-btn:focus{outline:none;text-decoration:underline}
.t-name-btn .ph{color:var(--line-strong);font-weight:400}
th.t-time,td.t-time{width:56px;text-align:center}
.t-num{width:100%;border:1px solid transparent;background:transparent;border-radius:7px;height:34px;
  padding:0 4px;font:inherit;font-size:13px;font-weight:600;text-align:center;color:var(--ink);
  font-variant-numeric:tabular-nums}
.t-num:hover{border-color:var(--line)}
.t-num:focus{outline:none;border-color:var(--blue);background:#fff}
.t-num::placeholder{color:var(--line-strong);font-weight:400}
#tnTime{text-align:center;font-variant-numeric:tabular-nums}
.mf-in.pri-high{color:var(--red)} .mf-in.pri-mid{color:var(--orange)}
.mf-in.pri-low{color:var(--green)} .mf-in.pri-none{color:var(--line-strong)}
.mf-in.st-doing{color:var(--green)} .mf-in.st-wait{color:var(--orange)}
.mf-in.st-drop{color:var(--red)} .mf-in.st-done{color:var(--line-strong)}
@media (max-width:640px){ th.t-time,td.t-time{width:44px} .t-num{font-size:12px} }

/* ================= mobile pass: pages added after the first one ================= */
@media (max-width:640px){
  /* tasks table gets the same edge-to-edge treatment as projects */
  .tasks-t{min-width:0}
  .card.task-card{
    margin-inline:-10px;
    width:calc(100% + 20px);
    border-inline:none;
    border-radius:0;
  }
  .tasks-t th.t-name,.tasks-t td.t-name{min-width:100px}
  .tasks-t th.t-proj,.tasks-t td.t-proj{width:76px}
  .tasks-t th.t-pri,.tasks-t td.t-pri{width:62px}
  .tasks-t th.t-stat,.tasks-t td.t-stat{width:70px}
  .tasks-t th.t-time,.tasks-t td.t-time{width:38px}
  .tasks-t td.grip-c{width:20px;padding-inline:0}
  .tasks-t td.star-c,.tasks-t th.star-h{width:24px;padding-inline:0}
  .tasks-t .t-name-btn{font-size:13px}
  .tasks-t .t-sel{font-size:11px;padding:0 2px}
  .tasks-t .t-num{font-size:12px;padding:0 1px}
  .tasks-t .del{padding:5px 2px;font-size:14px}
  .grip{font-size:16px;padding:8px 0}      /* bigger touch target for dragging */

  /* toolbars wrap instead of squeezing off-screen */
  .tools{flex-wrap:wrap;gap:6px}
  .tools .field{flex:1 1 120px}
  .btn-done{height:36px;padding:0 10px;font-size:12.5px}
  .spacer{display:none}

  /* links table */
  .links-t th.copy-c,.links-t td.copy-c{width:38px}
  .links-t .link-in{font-size:12.5px;padding:0 5px}

  /* notes and cards */
  .note-new textarea{min-height:78px}
  .modal-fields{gap:8px}
  .sort-note{font-size:11.5px}
  .fav-head{margin-bottom:8px}
}

/* ---- history page ---- */
.snap{display:flex;align-items:center;gap:12px;background:var(--surface);border:1px solid var(--line);
  border-radius:12px;padding:12px 14px;margin-bottom:9px}
.snap.latest{border-color:var(--line-strong)}
.snap-main{flex:1;min-width:0}
.snap-when{font-size:13.5px;font-weight:600;color:var(--ink)}
.snap-ago{font-weight:400;color:var(--muted);font-size:12px;margin-inline-start:6px}
.snap-tag{background:var(--blue);color:#fff;border-radius:8px;font-size:10.5px;font-weight:700;padding:1px 7px;margin-inline-start:7px}
.snap-label{font-size:12.5px;color:var(--muted);margin-top:3px}
.snap-actions{display:flex;gap:6px;flex:none}
.snap-actions .btn{align-self:auto;padding:6px 12px;font-size:12.5px}
@media (max-width:640px){
  .snap{flex-direction:column;align-items:stretch;gap:9px}
  .snap-actions .btn{flex:1}
  .snap-when{font-size:13px}
}


/* ---- importance divider rows (2 lines -> 3 zones) ---- */
.line-row{cursor:grab}
.line-row td.line-cell{padding:0;background:transparent}
.line-inner{display:flex;align-items:center;padding:5px 12px}
.line-grip{font-size:14px;cursor:grab;user-select:none;opacity:.85}
.line-blue  .line-inner{background:var(--blue-soft);  border-top:2px solid var(--blue);  border-bottom:2px solid var(--blue)}
.line-orange .line-inner{background:var(--orange-soft);border-top:2px solid var(--orange);border-bottom:2px solid var(--orange)}
.line-blue  .line-grip{color:var(--blue)}
.line-orange .line-grip{color:var(--orange)}
.t-row.tier1{opacity:.86}
.t-row.tier2{opacity:.7}
