:is(#docRows,#safeDocRows,#pettyDocRows) .doc-row.shared-document-row {
  display: grid !important;
  grid-template-columns: minmax(106px,.7fr) minmax(72px,.65fr) minmax(105px,1.5fr) minmax(78px,.7fr) 30px !important;
  gap: 5px !important;
  align-items: center !important;
}
:is(#docRows,#safeDocRows,#pettyDocRows):has(.shared-document-row) {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
}
:is(#docRows,#safeDocRows,#pettyDocRows) .doc-row.shared-document-row {
  min-width: 420px;
}
@media print {
  :is(#docRows,#safeDocRows,#pettyDocRows):has(.shared-document-row) { overflow: visible; }
}
:is(#docRows,#safeDocRows,#pettyDocRows) .shared-document-row :is(input,button.icon-btn) {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 4px 5px !important;
  font: 650 14px/1.2 system-ui,sans-serif !important;
}
.shared-document-row input { border: 1px solid var(--theme-input); border-radius: 6px; }
.shared-document-row input[data-field="amount"] { text-align: right; appearance: textfield; }
.shared-document-row input[type="number"]::-webkit-inner-spin-button,
.shared-document-row input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }

.cc-document-date {position:relative;min-width:0}
.cc-document-date input[type="date"] {color:transparent!important}
.cc-document-date input[type="date"]::-webkit-datetime-edit {opacity:0}
.cc-document-date input[type="date"]::-webkit-calendar-picker-indicator {cursor:pointer}
.cc-document-date-label {
 position:absolute;inset-inline-start:6px;top:50%;transform:translateY(-50%);
 pointer-events:none;white-space:nowrap;color:var(--ink,#16334b);
 font:650 13px/1.2 system-ui,sans-serif;
}
.cc-document-date:focus-within input[type="date"] {outline:2px solid var(--theme-input,#69a6cc);outline-offset:1px}

@media screen {
  :is(#docRows,#safeDocRows,#pettyDocRows) .shared-document-row > button.icon-btn {
    position: relative;
    font-size: 0 !important;
    color: #bd202b !important;
  }
  .shared-document-row > button.icon-btn::before,
  .shared-document-row > button.icon-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
  }
  .shared-document-row > button.icon-btn::before {
    top: calc(50% - 3px);
    width: 9px;
    height: 11px;
    border: 1.5px solid currentColor;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(currentColor,currentColor) 35% center / 1px 6px no-repeat,
                linear-gradient(currentColor,currentColor) 65% center / 1px 6px no-repeat;
  }
  .shared-document-row > button.icon-btn::after {
    top: calc(50% - 6px);
    width: 14px;
    height: 1.5px;
    border-radius: 2px;
    background: currentColor;
  }
}

@media screen and (max-width: 600px) {
  :is(#docRows,#safeDocRows,#pettyDocRows):has(.shared-document-row) {
    box-sizing: border-box;
    width: 100%;
  }
  :is(#docRows,#safeDocRows,#pettyDocRows) .doc-row.shared-document-row {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0,26fr) minmax(0,16fr) minmax(0,29fr) minmax(0,29fr) 30px !important;
    gap: 3px !important;
    padding-block: 2px;
  }
  :is(#docRows,#safeDocRows,#pettyDocRows) .shared-document-row input[data-field] {
    padding-inline: 3px !important;
    font-size: clamp(11px,3.3vw,14px) !important;
  }
  .shared-document-row .cc-document-date-label {
    inset-inline-start: 3px;
    font-size: clamp(10px,3vw,12px);
    font-variant-numeric: tabular-nums;
  }
}

/* Front-counter documents only need visible description, amount, and remove controls. */
:is(#frontPage #docRows, #counter[data-part="front"] #docRows) .doc-row.shared-document-row {
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(85px, 34%) 30px !important;
}
:is(#frontPage #docRows, #counter[data-part="front"] #docRows) .shared-document-row > :is(.cc-document-date, input[data-field="bill"]) {
  display: none !important;
}
