/* my-todo.css — 30 Sep 2026 — the My To-Do page (src/MyTodoPage.jsx) as a Trello-style board.
   Tokens only (the six label colours are fixed signal colours, like the status dots: a label is the
   same colour in every skin). Separation ladder: the page (.view-page) -> column (--sep-panel-fill)
   -> card (--sep-row-fill), each a step lighter. Columns are a fixed 300 px and scroll sideways
   INSIDE the board (never the page); each column's cards scroll inside the column. Nothing moves when
   something toggles: the save line reserves its place, the due status line is always rendered, the
   label rows are always there, the composer replaces the "Add a card" row. */

.mytodo-page, .mt-modal {
  --mt-lbl-green: #16A34A;
  --mt-lbl-yellow: #FFB020;
  --mt-lbl-orange: #E8742A;
  --mt-lbl-red: #DC2626;
  --mt-lbl-purple: #8B5CF6;
  --mt-lbl-blue: #2563EB;
  --mt-lbl-ink: #FFFFFF;
  --mt-lbl-ink-dark: #1A1A1A;
  --mt-col-w: 300px;
}

.view-page.mytodo-page { overflow: hidden; gap: 12px; }
.mt-message { font-size: var(--fs-14); color: var(--ink-muted); font-style: italic; padding: 40px 12px; text-align: center; }

/* ---- board switcher (the page's usual .vp-tab row) ---- */
.mt-boards { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
.mt-boards .mt-add-board { margin-left: 0; }
.mt-board-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-board-input, .mt-col-name-input {
  height: 30px; box-sizing: border-box; padding: 0 10px;
  font: inherit; font-size: var(--fs-14); color: var(--ink);
  border-radius: var(--r-xs); border: 1px solid var(--card-border);
  background: var(--sep-row-fill);
}
.mt-board-input { width: 220px; }
.mt-board-input:focus, .mt-col-name-input:focus { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }
.mt-board-input::placeholder, .mt-col-name-input::placeholder { color: var(--sep-panel-ink-muted); }
.mt-save { font-size: var(--fs-12); color: var(--danger); max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* buttons reuse .pill-button; a <button> needs the page font and the neighbours' caps */
.mt-btn.pill-button { font-family: inherit; font-size: var(--fs-12); font-weight: var(--fw-bold); letter-spacing: var(--track-04); text-transform: uppercase; cursor: pointer; flex: 0 0 auto; }
.mt-btn.pill-button:disabled { background: var(--disabled-fill); color: var(--disabled-ink); cursor: default; }
.mt-btn.pill-button.mt-btn-danger { color: var(--danger); }
.mt-icon-btn {
  width: 28px; height: 28px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: var(--r-xs); background: transparent; color: var(--sep-panel-ink-muted);
  transition: color var(--dur-1) ease, background var(--dur-1) ease;
}
.mt-icon-btn:hover { color: var(--ink); background: var(--sep-row-fill-hover); }
.mt-icon-btn:focus-visible { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }

/* ---- the board: columns side by side, scrolling sideways inside the page ---- */
.mt-board {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: flex-start; gap: 12px;
  overflow-x: auto; overflow-y: hidden;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--tan-deep) 45%, transparent) transparent;
}
.mt-col {
  flex: 0 0 var(--mt-col-w); width: var(--mt-col-w); max-height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column;
  background: var(--sep-panel-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  color: var(--ink);
}
.mt-col.is-dragging { display: none; }
.mt-col-ph, .mt-card-ph {
  box-sizing: border-box; flex: 0 0 auto;
  border: 2px dashed color-mix(in srgb, var(--check-on-fill) 70%, transparent);
  background: color-mix(in srgb, var(--check-on-fill) 12%, transparent);
}
.mt-col-ph { width: var(--mt-col-w); flex-basis: var(--mt-col-w); border-radius: var(--r-card); max-height: 100%; }
.mt-card-ph { border-radius: var(--r-sm); }

.mt-col-head {
  display: flex; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box;
  padding: 8px 8px 4px 10px; cursor: grab;
}
.mt-col-head:active { cursor: grabbing; }
.mt-col-name {
  flex: 1 1 auto; min-width: 0; height: 30px; padding: 0 4px; text-align: left; cursor: pointer;
  font: inherit; font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--ink);
  background: transparent; border: 0; border-radius: var(--r-xs);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mt-col-name:hover { background: var(--sep-row-fill-hover); }
.mt-col-head .mt-col-name-input { flex: 1 1 auto; min-width: 0; font-weight: var(--fw-bold); }
.mt-col-count {
  min-width: 22px; height: 20px; padding: 0 6px; box-sizing: border-box; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: var(--fw-bold);
  background: var(--sep-row-fill); color: var(--sep-panel-ink-muted);
}

.mt-col-cards {
  flex: 1 1 auto; min-height: 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  padding: 4px 8px 6px;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--tan-deep) 40%, transparent) transparent;
}

/* ---- a card ---- */
.mt-card {
  flex: 0 0 auto; box-sizing: border-box; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px;
  padding: 9px 11px 10px;
  background: var(--sep-row-fill);
  border: 1px solid color-mix(in srgb, var(--card-border) 60%, transparent);
  border-radius: var(--r-sm);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--shadow-ink) 14%, transparent);
  transition: background var(--dur-1) ease, border-color var(--dur-1) ease;
}
.mt-card:hover { background: var(--sep-row-fill-hover); border-color: var(--card-border); }
.mt-card:focus-visible { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 1px; }
.mt-card.is-dragging { display: none; }
.mt-card-labels { display: flex; flex-wrap: wrap; gap: 4px; }
.mt-lbl-bar { width: 40px; height: 8px; border-radius: var(--r-pill); }
.mt-card-title { font-size: var(--fs-14); line-height: 1.4; color: var(--ink); word-break: break-word; white-space: pre-wrap; }
.mt-card-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mt-badge, .mt-due {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; box-sizing: border-box;
  font-size: var(--fs-12); font-weight: var(--fw-semi); color: var(--sep-panel-ink-muted);
}
.mt-due { padding: 0 7px; border-radius: var(--r-xs); background: color-mix(in srgb, var(--sep-panel-ink-muted) 12%, transparent); }
.mt-due.is-overdue { background: var(--status-bad); color: var(--mt-lbl-ink); }
.mt-due.is-done { background: var(--status-ok); color: var(--mt-lbl-ink); }
.mt-badge.is-complete { padding: 0 7px; border-radius: var(--r-xs); background: var(--status-ok); color: var(--mt-lbl-ink); }

/* ---- column footer: "Add a card" and the composer that replaces it ---- */
.mt-col-foot { padding: 4px 8px 8px; }
.mt-add-card {
  width: 100%; height: 36px; box-sizing: border-box; padding: 0 8px;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; font-size: var(--fs-13); font-weight: var(--fw-semi); color: var(--sep-panel-ink-muted);
  background: transparent; border: 0; border-radius: var(--r-sm);
}
.mt-add-card:hover { background: var(--sep-row-fill-hover); color: var(--ink); }
.mt-composer { display: flex; flex-direction: column; gap: 8px; }
.mt-composer-input {
  width: 100%; box-sizing: border-box; min-height: 60px; resize: none; padding: 8px 10px;
  font: inherit; font-size: var(--fs-14); line-height: 1.4; color: var(--ink);
  background: var(--sep-row-fill); border: 1px solid var(--card-border); border-radius: var(--r-sm);
}
.mt-composer-input:focus { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }
.mt-composer-input::placeholder { color: var(--sep-panel-ink-muted); }
.mt-composer-row { display: flex; align-items: center; gap: 6px; }

/* the "Add a column" slot at the end of the board */
.mt-col.mt-col-new { background: color-mix(in srgb, var(--sep-panel-fill) 60%, transparent); border-style: dashed; padding: 6px; }
.mt-col-new .mt-col-name-input { width: 100%; }
.mt-add-col { height: 38px; }

/* ---- the card modal ---- */
.modal-backdrop.mt-modal-backdrop { z-index: var(--z-modal); align-items: start; overflow-y: auto; padding: 6vh 24px 24px; }
.mt-modal {
  width: min(760px, calc(100vw - 32px)); box-sizing: border-box;
  display: flex; flex-direction: column; gap: 16px;
  padding: 22px 24px 20px;
  border-radius: var(--r-card);
  color: var(--ink);
  box-shadow: 0 18px 50px color-mix(in srgb, var(--shade) 40%, transparent);
}
.mt-modal-head { display: flex; align-items: flex-start; gap: 10px; }
.mt-modal-title {
  flex: 1 1 auto; min-width: 0; box-sizing: border-box; resize: none; field-sizing: content; min-height: 40px;
  padding: 6px 8px; font: inherit; font-size: var(--fs-20); font-weight: var(--fw-bold); line-height: 1.35; color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-xs);
}
.mt-modal-title:hover { border-color: var(--card-border); }
.mt-modal-title:focus { outline: none; border-color: var(--card-border); background: var(--sep-row-fill); }
.mt-modal-close { width: 34px; height: 34px; }
.mt-modal-where { display: flex; align-items: center; gap: 8px; margin-top: -8px; padding-left: 8px; font-size: var(--fs-13); color: var(--sep-panel-ink-muted); }
.mt-select, .mt-date {
  height: 32px; box-sizing: border-box; padding: 0 10px;
  font: inherit; font-size: var(--fs-13); color: var(--ink);
  background: var(--sep-row-fill); border: 1px solid var(--card-border); border-radius: var(--r-xs);
}
.mt-select:focus, .mt-date:focus { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }
.mt-date { color-scheme: light dark; }

.mt-modal-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; align-items: stretch; }
.mt-sec {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px;
  background: var(--sep-panel-fill);
  border: 1px solid var(--card-border);
  border-radius: var(--r-md);
}
.mt-sec-title { font-size: var(--fs-11); font-weight: var(--fw-bold); letter-spacing: var(--track-10, 0.1em); text-transform: uppercase; color: var(--sep-panel-ink-muted); }

/* labels: the board's six colours, always listed (a tick = on this card), names optional */
.mt-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.mt-label-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mt-lbl-swatch {
  width: 40px; height: 26px; flex: 0 0 auto; padding: 0; cursor: pointer;
  display: grid; place-items: center; border: 0; border-radius: var(--r-xs);
  color: transparent;
}
.mt-label-row.is-on .mt-lbl-swatch { color: var(--mt-lbl-ink); box-shadow: 0 0 0 2px var(--sep-panel-fill), 0 0 0 4px color-mix(in srgb, var(--ink) 55%, transparent); }
.mt-label-row.is-on .mt-lbl-swatch.mt-lbl--yellow { color: var(--mt-lbl-ink-dark); }
.mt-lbl-swatch:focus-visible { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 2px; }
.mt-label-name {
  flex: 1 1 auto; min-width: 0; height: 26px; box-sizing: border-box; padding: 0 6px;
  font: inherit; font-size: var(--fs-12); color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-xs);
}
.mt-label-name:hover { border-color: var(--card-border); }
.mt-label-name:focus { outline: none; border-color: var(--card-border); background: var(--sep-row-fill); }
.mt-label-name::placeholder { color: var(--sep-panel-ink-muted); }
.mt-lbl--green  { background: var(--mt-lbl-green); }
.mt-lbl--yellow { background: var(--mt-lbl-yellow); }
.mt-lbl--orange { background: var(--mt-lbl-orange); }
.mt-lbl--red    { background: var(--mt-lbl-red); }
.mt-lbl--purple { background: var(--mt-lbl-purple); }
.mt-lbl--blue   { background: var(--mt-lbl-blue); }

/* due date */
.mt-due-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mt-due-done { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-13); color: var(--ink); cursor: pointer; }
.mt-due-done input { width: 16px; height: 16px; accent-color: var(--status-ok); cursor: pointer; }
.mt-due-done.is-off { color: var(--sep-panel-ink-muted); cursor: default; }
.mt-due-status { height: 24px; line-height: 24px; font-size: var(--fs-13); font-weight: var(--fw-semi); color: var(--sep-panel-ink-muted); }
.mt-due-status.is-overdue { color: var(--status-bad); }
.mt-due-status.is-done { color: var(--status-ok); }

/* description: plain text, exactly as written */
.mt-desc {
  width: 100%; box-sizing: border-box; min-height: 120px; max-height: 50vh; resize: vertical; field-sizing: content;
  padding: 10px 12px; font: inherit; font-size: var(--fs-14); line-height: 1.5; color: var(--ink);
  background: var(--sep-row-fill); border: 1px solid var(--card-border); border-radius: var(--r-sm);
  white-space: pre-wrap;
}
.mt-desc:focus { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }
.mt-desc::placeholder { color: var(--sep-panel-ink-muted); }

/* checklists: the subtasks */
.mt-cl-head { display: flex; align-items: center; gap: 8px; }
.mt-cl-name {
  flex: 1 1 auto; min-width: 0; height: 32px; box-sizing: border-box; padding: 0 8px;
  font: inherit; font-size: var(--fs-14); font-weight: var(--fw-bold); color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-xs);
}
.mt-cl-name:hover { border-color: var(--card-border); }
.mt-cl-name:focus { outline: none; border-color: var(--card-border); background: var(--sep-row-fill); }
.mt-cl-progress { display: flex; align-items: center; gap: 10px; }
.mt-cl-pct { width: 38px; flex: 0 0 auto; font-size: var(--fs-12); font-weight: var(--fw-bold); color: var(--sep-panel-ink-muted); text-align: right; }
.mt-cl-bar { flex: 1 1 auto; height: 8px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--sep-panel-ink-muted) 20%, transparent); overflow: hidden; }
.mt-cl-fill { height: 100%; border-radius: var(--r-pill); background: var(--check-on-fill); transition: width var(--dur-1) ease; }
.mt-cl-fill.is-complete { background: var(--status-ok); }
.mt-cl-items { display: flex; flex-direction: column; gap: 4px; }
.mt-cl-item {
  display: grid; grid-template-columns: 22px 1fr 28px; align-items: center; gap: 8px;
  min-height: 36px; padding: 2px 4px 2px 8px; box-sizing: border-box;
  background: var(--sep-row-fill); border-radius: var(--r-xs);
}
.mt-check {
  width: 20px; height: 20px; padding: 0; box-sizing: border-box; display: grid; place-items: center; cursor: pointer;
  border-radius: var(--r-xs); border: 1.5px solid var(--sep-panel-ink-muted); background: transparent; color: transparent;
}
.mt-cl-item.is-done .mt-check { background: var(--check-on-fill); border-color: var(--check-on-fill); color: var(--check-on-ink); }
.mt-cl-text {
  min-width: 0; height: 30px; box-sizing: border-box; padding: 0 6px;
  font: inherit; font-size: var(--fs-14); color: var(--ink);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-xs);
}
.mt-cl-text:focus { outline: none; border-color: var(--card-border); background: var(--sep-row-fill-hover); }
.mt-cl-item.is-done .mt-cl-text { text-decoration: line-through; color: var(--sep-panel-ink-muted); }
.mt-cl-x { opacity: 0; }
.mt-cl-item:hover .mt-cl-x, .mt-cl-x:focus-visible { opacity: 1; }
.mt-cl-x:hover { color: var(--danger); }
.mt-cl-add { display: flex; align-items: center; gap: 8px; }
.mt-cl-new {
  flex: 1 1 auto; min-width: 0; height: 32px; box-sizing: border-box; padding: 0 10px;
  font: inherit; font-size: var(--fs-13); color: var(--ink);
  background: var(--sep-row-fill); border: 1px solid var(--card-border); border-radius: var(--r-xs);
}
.mt-cl-new:focus { outline: var(--ring-w) solid var(--check-on-fill); outline-offset: 0; }
.mt-cl-new::placeholder { color: var(--sep-panel-ink-muted); }

.mt-modal-foot { display: flex; align-items: center; gap: 10px; padding-top: 4px; }
.mt-modal-foot-gap { flex: 1 1 auto; }
.mt-del-card.confirm-delete-btn { height: 32px; padding: 0 16px; flex: 0 0 auto; }

/* text edited in place (card title, label names, checklist name, checklist items) reads as text until
   hovered or focused, in every skin: the skins' recessed-input look is for real form boxes */
body .mt-modal :is(.mt-modal-title, .mt-label-name, .mt-cl-name, .mt-cl-text):not(:focus):not(:hover) {
  background: transparent; border-color: transparent; box-shadow: none;
}
body .mt-modal :is(.mt-modal-title, .mt-label-name, .mt-cl-name, .mt-cl-text):hover:not(:focus) {
  background: transparent; border-color: var(--card-border); box-shadow: none;
}

/* the styled confirm sits above the card modal */
.pres-confirm-backdrop.mt-confirm-backdrop { z-index: var(--z-dialog); }

@media (max-width: 720px) {
  .mt-modal-grid { grid-template-columns: 1fr; }
  .mt-labels { grid-template-columns: 1fr; }
  .mt-cl-x { opacity: 1; }
}
