/* r8 (John, Q4): custom column types. Text, Number, Date and Checkbox cells beside the r1 Dropdown (tag) cells; the
   type picker in Project settings; the fields in the task panel. HIG: light weights, hairlines, 44px touch targets. */

/* table cells */
main.grid .task > .field-cell { font-weight: 400; color: var(--text); min-width: 0; }
main.grid .task > .field-cell .ce-text, main.grid .task > .field-cell .fdate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
main.grid .task > .field-number { justify-content: flex-end; text-align: right; }
main.grid .task > .field-number .fnum { font-variant-numeric: tabular-nums; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main.grid .thead > .h-num { justify-content: flex-end; text-align: right; padding-right: 12px; }
/* the checkbox: a quiet 18px square; checked is the primary ink (black in light, off-white in dark), never the magenta of
   a completed task, so a ticked field can't be mistaken for "done" */
.fcheck { box-sizing: border-box; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--hairline-strong, var(--line));
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.fcheck.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.fcheck svg { width: 14px; height: 14px; stroke-width: 2.2; }
main.grid .task > .field-checkbox.ce-cell[data-editable="true"] { cursor: pointer; }
main.grid .task > .field-checkbox:focus-visible .fcheck { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
/* the phone table never shows the '–' placeholder for a checkbox (an empty square already says "not checked") */
main.grid .pt-inner .task > .field-checkbox.ce-empty-cell::before { content: none; }

/* inline Number editing: numbers right-aligned while typing too */
main.grid .task > .field-number .ce-inline { text-align: right; font-variant-numeric: tabular-nums; }

/* Project settings: the type next to each column's name, and the type picker beside the new column's name */
.tagcol-title, .tagcol-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.tagcol-title > span:first-child, .tagcol-name > span:first-child { overflow-wrap: anywhere; min-width: 0; }
.col-type { font: 400 13px/18px var(--font-ui); color: var(--text-2); white-space: nowrap; flex: none; }
.tagcol-add { flex-wrap: wrap; }
.tagcol-add #new-tagcol-type { flex: 0 0 auto; width: auto; min-width: 128px; }
@media (max-width: 600px) {
  .tagcol-add { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; }
  .tagcol-add #new-tagcol { grid-column: 1 / -1; }
  .tagcol-add #new-tagcol-type { height: 44px; min-height: 44px; border-radius: 8px; font-size: 17px; min-width: 0; width: 100%; }
}

/* task panel */
.dfields .fnum-input { font-variant-numeric: tabular-nums; }
/* Kirby (r8 review): Text and Number values look like the other rows at rest (plain, right-aligned, no box; a muted
   'Add' when empty) and show their field border and focus ring only while being edited */
.dfields .input.fval { text-align: right; text-overflow: ellipsis; background: transparent; border-color: transparent; box-shadow: none; font-weight: 400; color: var(--text); }
.dfields .input.fval::placeholder { color: var(--text-3); opacity: 1; }
.dfields .input.fval:hover { border-color: transparent; background: transparent; }
.dfields .input.fval:focus, .dfields .input.fval:focus-visible { text-align: left; background: var(--surface); border-color: var(--field-focus, var(--hairline-strong)); box-shadow: inset 0 0 0 1px var(--field-focus, var(--hairline-strong)); outline: none; }
.dfields .input.fnum-input.fval:focus { text-align: right; }
.dfields .input.fval:focus::placeholder { color: transparent; }
.dfields .fcheck-input { width: 22px; height: 22px; margin: 0; accent-color: var(--primary); }
.dfields label.drow:has(.fcheck-input) { cursor: pointer; }
/* r8: at 320 px the three Dropdown actions (Edit options, Rename, Delete) don't fit on one line; they wrap instead of
   widening the sheet past the screen (the pre-r8 nowrap pushed the whole Columns tab sideways at 320) */
@media (max-width: 600px) {
  .tagcol > .tagcol-actions { flex-wrap: wrap; row-gap: 12px; align-items: center; }
  /* Kirby (r8 review): Edit options, Rename and Delete are the r7 32px secondary buttons (15px, 500, 12px sides, Delete
     in red text), with an invisible 7px above and below so the tap area is still 44px (as r7 P3-34) */
  .tagcol > .tagcol-actions .btn { position: relative; height: 32px; min-height: 32px; padding: 0 12px; border-radius: var(--radius-btn);
    font: 500 15px/1 var(--font-ui); }
  .tagcol > .tagcol-actions .btn::after { content: ''; position: absolute; left: 0; right: 0; top: -7px; bottom: -7px; }
  .tagcol > .tagcol-actions .tagcol-del { color: var(--danger); }
}
