.tube-feeding-workspace {
  width: 100%;
  max-width: 1480px;
  margin-inline: auto;
  color: #203c32;
  font-size: 16px;
}
.tf-page-heading, .tf-heading-actions, .tf-detail-totals {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.tf-page-heading { min-height: 44px; margin: 4px 0 18px; }
.tf-page-heading h1 { margin: 0; font-size: 24px; font-weight: 750; }
.tf-heading-actions { justify-content: flex-end; }
.tf-more { position: relative; }
.tf-more summary { display: grid; place-items: center; width: 44px; height: 44px; list-style: none; cursor: pointer; border: 1px solid #cfdbd1; border-radius: 6px; background: #fff; font-size: 22px; }
.tf-more summary::-webkit-details-marker { display: none; }
.tf-more > button { position: absolute; top: calc(100% + 6px); right: 0; width: 220px; z-index: 5; background: #fff; }
.tf-filters {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0;
  background: #f5f8f5;
}
.tf-filters label { display: grid; gap: 6px; flex: 1 1 150px; min-width: 0; font-size: 14px; }
.tf-filters label:nth-child(2) { flex-basis: 205px; }
.tf-filters input, .tf-filters select { width: 100%; min-height: 44px; font-size: 16px; background: #fff; }
.tf-filters output { align-self: center; font-size: 14px; color: #53695e; white-space: nowrap; }
.tube-feeding-workspace .button, .tf-detail-dialog .button { min-height: 44px; }
.tf-table-scroll { min-height: min(520px, calc(100dvh - 285px)); max-height: calc(100dvh - 285px); overflow-y: auto; overflow-x: hidden; border: 1px solid #d4e0d8; border-radius: 6px; background: #fff; }
.tf-table { width: 100%; min-width: 0 !important; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.tf-table col.tf-col-actions { width: 14%; }
.tf-table col.tf-col-floor { width: 5%; }
.tf-table col.tf-col-bed { width: 7%; }
.tf-table col.tf-col-resident { width: 9%; }
.tf-table col.tf-col-marking { width: 7%; }
.tf-table col.tf-col-schedule { width: 25%; }
.tf-table col.tf-col-daily { width: 12%; }
.tf-table col.tf-col-notes { width: 13%; }
.tf-table col.tf-col-updated { width: 8%; }
.tf-table th, .tf-table td { padding: 12px 9px; text-align: left; vertical-align: top; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; border-right: 1px solid #e2e9e4; border-bottom: 1px solid #e2e9e4; }
.tf-table th { position: sticky; top: 0; z-index: 2; background: #eaf2ec; font-weight: 750; color: #244d3c; text-align: center; vertical-align: middle; word-break: keep-all; }
.tf-table td:first-child, .tf-table td:last-child { position: static !important; left: auto; right: auto; }
.tf-table tbody tr:nth-child(even) td { background: #f7faf7; }
.tf-table tbody tr:hover td { background: #eef6ef; }
.tf-table td > strong, .tf-table td > span, .tf-table td > small { display: block; }
.tf-table td > span + span { margin-top: 4px; }
.tf-table small { color: #576e60; font-size: 13px; margin-top: 5px; }
.tf-table .tf-cell-center { text-align: center; }
.tf-list-primary { font-weight: 750; line-height: 1.35; white-space: nowrap !important; overflow-wrap: normal; word-break: keep-all; }
.tf-list-primary + .tf-list-primary { margin-top: 7px !important; padding-top: 7px; border-top: 1px dashed #b8c5bc; }
.tf-list-water { white-space: nowrap !important; overflow-wrap: normal; word-break: keep-all; }
.tf-list-water + .tf-list-water { margin-top: 5px !important; }
.tf-daily { font-variant-numeric: tabular-nums; }
.tf-daily > strong, .tf-daily > span, .tf-daily > small { white-space: nowrap; }
.tf-daily > small { color: #a34f00; font-weight: 750; }
.tf-identity-marking { margin-top: 5px; color: #9d4e00; font-weight: 700; }
.tf-compact-schedule, .tf-compact-prescription { display: grid; gap: 5px; }
.tf-compact-schedule > span, .tf-compact-prescription > span { display: block; }
.tf-compact-water, .tf-compact-supplement { line-height: 1.45; }
.tf-compact-water .tf-list-water { display: inline; }
.tf-compact-prescription > span + span { padding-top: 6px; border-top: 1px dashed #bcc9c0; white-space: pre-wrap; }
.tf-compact-prescription b { padding-inline: 5px; color: #9ca9a0; }
.tf-status { display: inline-block !important; padding: 4px 7px; border-radius: 4px; font-size: 13px; font-weight: 650; }
.tf-status.is-confirmed { background: #e9f5ec; color: #23623d; }
.tf-status.is-pending { background: #fff0d4; color: #86540a; }
.tf-actions { white-space: nowrap; }
.tf-action-buttons { display: flex; align-items: flex-start; gap: 4px; width: 100%; }
.tf-action-buttons .button { width: auto; flex: 1 1 0; min-width: 0; min-height: 36px; margin: 0; padding: 5px 3px; font-size: 13px; }
.tf-notice { display: grid; gap: 5px; padding: 13px 16px; margin: 12px 0; background: #f1f5f1; border-left: 3px solid #658c6b; font-size: 15px; }
.tf-error { background: #fff3ef; color: #8a3928; border-color: #bd5d46; }
.tf-empty { padding: 32px 16px !important; text-align: center !important; color: #627166; }
.tf-detail-dialog { width: min(860px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 0; margin: auto; border: 1px solid #cddbd1; border-radius: 8px; color: #203c32; background: #fff; box-shadow: 0 18px 60px #1a302833; }
.tf-detail-dialog::backdrop { background: #14291f70; }
.tf-edit-dialog { width: min(1000px, calc(100% - 24px)); max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 0; margin: auto; border: 1px solid #cddbd1; border-radius: 8px; background: #fff; color: #203c32; }
.tf-edit-dialog::backdrop { background: #14291f70; }
.tf-edit-dialog .tube-feeding-registry-dialog { width: 100%; max-width: none; margin: 0; box-shadow: none; border: 0; }
.tf-edit-dialog .modal-header, .tf-edit-dialog .modal-actions { position: sticky; background: #f4f8f4; z-index: 2; }
.tf-edit-dialog .modal-header { top: 0; }
.tf-edit-dialog .modal-actions { bottom: 0; }
.tf-edit-dialog input, .tf-edit-dialog select, .tf-edit-dialog textarea { font-size: 16px; min-height: 44px; }
.tf-edit-dialog .button { min-height: 44px; }
.tf-edit-dialog .hidden { display: none !important; }
.tf-edit-dialog .tube-feeding-plan-editor { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; padding: 12px; border: 1px solid #d4e0d8; border-radius: 6px; background: #fff; }
.tf-edit-dialog .tube-feeding-plan-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tf-edit-dialog .tube-feeding-plan-editor-head output { font-weight: 700; }
.tf-edit-dialog .tube-feeding-profile-grid { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(150px, .8fr) minmax(220px, 1fr); align-items: end; gap: 8px 10px; padding: 8px 12px 2px; }
.tf-edit-dialog .tube-feeding-profile-grid > label { display: grid; gap: 4px; min-width: 0; font-size: 13px; }
.tf-edit-dialog .tube-feeding-profile-grid .tf-profile-status { display: flex; align-items: center; align-self: end; min-height: 44px; gap: 7px; white-space: nowrap; }
.tf-edit-dialog .tube-feeding-profile-grid .tf-profile-status input { width: 20px; min-height: 0; height: 20px; }
.tf-edit-dialog .tube-feeding-profile-grid .tf-profile-source { grid-column: 1 / span 2; }
.tf-edit-dialog .tube-feeding-profile-grid .tf-profile-notes { grid-column: 1 / -1; }
.tf-edit-dialog .tf-inline-control { display: flex; gap: 6px; min-width: 0; }
.tf-edit-dialog .tf-inline-control > select { flex: 1 1 150px; min-width: 0; }
.tf-edit-dialog .tf-inline-control > input { flex: 1 1 180px; min-width: 0; }
.tf-edit-dialog .tf-profile-notes textarea { min-height: 44px; max-height: 120px; resize: vertical; }
.tf-edit-dialog .tube-feeding-plan-supplement-row { grid-template-columns: minmax(0, 1fr) 76px 72px 44px; align-items: end; }
.tf-edit-dialog [data-tube-feeding-supplement-custom-wrap] { grid-column: 1 / -1; }
.tf-edit-dialog .tube-feeding-plan-supplement-row label { display: grid; gap: 5px; min-width: 0; font-size: 13px; }
.tf-edit-dialog .tube-feeding-plan-row { border-radius: 0; border-width: 1px 0 0; background: white; padding: 14px 0; }
.tf-edit-dialog .tube-feeding-plan-rows { gap: 16px; }
.tf-confirm-dialog { width: min(440px, calc(100% - 28px)); padding: 20px; margin: auto; border: 1px solid #cddbd1; border-radius: 8px; background: #fff; color: #203c32; }
.tf-confirm-dialog::backdrop { background: #14291f80; }
.tf-confirm-dialog p { white-space: pre-wrap; font-size: 16px; line-height: 1.6; margin: 0 0 20px; }
.tf-confirm-dialog form > div { display: flex; justify-content: flex-end; gap: 10px; }
.tf-confirm-dialog .button { min-height: 44px; }
.tf-detail-dialog .modal-header { position: sticky; top: 0; background: #f1f6f1; z-index: 2; padding: 12px 18px; }
.tf-detail-body { padding: 18px; font-size: 16px; }
.tf-detail-identity { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 18px; }
.tf-detail-identity strong { font-size: 20px; }
.tf-detail-identity span { color: #597061; }
.tf-detail-table { width: 100%; min-width: 0 !important; table-layout: fixed; border-collapse: collapse; font-size: 15px; }
.tf-detail-table th, .tf-detail-table td { padding: 12px 9px; border: 1px solid #dce5de; white-space: normal !important; overflow-wrap: anywhere; text-align: left; }
.tf-detail-table th { background: #edf4ee; }
.tf-detail-totals { justify-content: flex-start; gap: 12px 25px; padding: 16px 0; border-bottom: 1px solid #dce5de; }
.tf-detail-totals span { display: grid; gap: 5px; }
.tf-detail-totals strong { font-size: 19px; }
.tf-detail-notes p { white-space: pre-wrap; overflow-wrap: anywhere; }
.tf-detail-updated { color: #627166; font-size: 13px; }
.tube-feeding-registry-dialog .tf-form-error { margin: 8px 18px; }
.tube-feeding-registry-dialog .tf-form-error:empty { display: none; }
.tf-list-feed + .tf-list-feed { border-top: 1px solid #d9e2dc; margin-top: 9px; padding-top: 9px; }
.tf-list-feed > strong, .tf-list-feed > span { display: block; }
.tf-list-feed > span { margin-top: 4px; }
.tf-list-supplement { color: #334c3e; }
.tf-edit-dialog .tf-schedule-setup { display: flex; align-items: end; gap: 16px; padding: 12px 0; }
.tf-edit-dialog .tf-schedule-setup label { display: grid; gap: 5px; font-size: 14px; }
.tf-edit-dialog .tube-feeding-plan-defaults { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; background: #f1f7f2; padding: 12px; border: 1px solid #cddfd2; border-radius: 6px; }
.tf-edit-dialog .tube-feeding-plan-defaults > label { flex: 1 1 110px; min-width: 0; }
.tf-edit-dialog .tube-feeding-plan-defaults > label:nth-child(2) { flex-basis: 170px; }
.tf-edit-dialog .tf-select-all { display: flex !important; align-items: center; flex: 0 0 auto !important; align-self: center; white-space: nowrap; gap: 6px; }
.tf-edit-dialog .tf-select-all input { width: 24px; height: 24px; min-height: 0; }
.tf-edit-dialog .tube-feeding-plan-rows { display: block; margin-top: 12px; border: 1px solid #d4e0d8; border-radius: 6px; }
.tf-edit-dialog .tf-meal-grid { display: grid; grid-template-columns: 85px 125px minmax(150px, 1fr) 100px 100px; gap: 8px; align-items: end; padding: 8px; border-top: 1px solid #d4e0d8; background: #fff; }
.tf-edit-dialog .tf-meal-grid:first-child { border-top: 0; }
.tf-edit-dialog .tf-meal-grid:nth-child(even) { background: #f7faf8; }
.tf-edit-dialog .tf-meal-grid:has(.tf-milk-custom:not(.hidden)) { grid-template-columns: 60px 110px minmax(65px, 1fr) minmax(90px, 1fr) 75px 75px; }
.tf-edit-dialog .tf-meal-grid label { display: grid; gap: 4px; min-width: 0; position: relative; font-size: 13px; }
.tf-edit-dialog .tf-meal-grid input, .tf-edit-dialog .tf-meal-grid select { min-width: 0; width: 100%; margin: 0; padding: 7px 6px; border-radius: 5px; background: #fff; }
.tf-edit-dialog .tf-meal-grid input[type="number"] { padding-right: 26px; }
.tf-edit-dialog .tf-meal-grid input[type="time"] { padding-inline: 4px; }
.tf-edit-dialog .tf-meal-grid label small { position: absolute; bottom: 13px; right: 6px; font-size: 12px; line-height: 1; color: #53685b; }
.tf-edit-dialog .tf-meal-selector { display: flex !important; align-items: center; gap: 5px; height: 44px; white-space: nowrap; }
.tf-edit-dialog .tf-meal-selector input { width: 24px; height: 24px; min-height: 0; }
.tf-edit-dialog .tf-supplement-heading { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 8px; gap: 10px; }
.tf-edit-dialog .tf-supplement-grid { display: grid; grid-template-columns: 100px minmax(160px, 1fr) 100px 100px 44px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid #d4e0d8; }
.tf-edit-dialog .tf-supplement-grid label { display: grid; min-width: 0; gap: 4px; font-size: 13px; }
.tf-edit-dialog .tf-supplement-grid [data-tube-feeding-supplement-custom-wrap] { grid-column: 1 / -1; }
.tf-edit-dialog .tf-supplement-grid input, .tf-edit-dialog .tf-supplement-grid select { width: 100%; min-width: 0; margin: 0; }
.tf-edit-dialog #tubeFeedingPlanSupplementTotal { display: block; margin-top: 8px; font-size: 14px; }
.tf-card-dialog { width: min(520px, calc(100% - 16px)); max-width: calc(100% - 16px); max-height: calc(100dvh - 20px); margin: auto; padding: 0; border: 1px solid #cbd8cf; border-radius: 8px; color: #203c32; background: #fff; }
.tf-card-dialog::backdrop { background: #14291f80; }
.tf-card-dialog .modal-header, .tf-card-dialog .modal-actions { padding: 12px; background: #f4f7f5; }
.tf-card-dialog .button { min-height: 44px; }
.tf-card-preview { padding: 16px 6px; display: grid; justify-content: center; background: #eef1ef; }
.tf-card-dialog .tf-form-error { padding: 0 14px; color: #8a3928; }
.tf-card-dialog .tf-form-error:empty { display: none; }
.tf-card-print-frame { position: fixed; left: -10000px; top: 0; width: 90mm; height: 54mm; border: 0; }
@media (min-width: 761px) and (max-width: 1000px) {
  .tf-table { font-size: 14px; }
  .tf-table th, .tf-table td { padding: 10px 6px; }
  .tf-actions .button { font-size: 13px; }
}
@media (max-width: 760px) {
  .tf-edit-dialog .tube-feeding-plan-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tf-edit-dialog .tube-feeding-plan-fields label:first-child { grid-column: 1 / -1; }
  .tf-edit-dialog .tube-feeding-plan-supplement-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .tf-edit-dialog .tube-feeding-plan-supplement-row label:first-child { grid-column: 1 / -1; }
  .tf-page-heading { margin-top: 8px; }
  .tf-page-heading h1 { font-size: 22px; }
  .tf-filters label { flex: 1 1 calc(50% - 10px); }
  .tf-filters label:nth-child(2) { flex-basis: calc(50% - 10px); }
  .tf-table-scroll { min-height: 0; max-height: none; overflow: visible; border: 0; background: transparent; }
  .tf-table, .tf-table tbody { display: block; min-width: 0 !important; }
  .tf-table colgroup, .tf-table thead { display: none; }
  .tf-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin: 0 0 12px; border: 1px solid #d3dfd5; border-radius: 6px; background: #fff; }
  .tf-table tbody td, .tf-table tbody tr:nth-child(even) td, .tf-table tbody tr:hover td { display: block; width: auto !important; background: #fff; padding: 11px 12px; font-size: 16px; }
  .tf-table td::before { content: attr(data-label); display: block; font-size: 13px; color: #5b7364; margin-bottom: 5px; }
  .tf-table .tf-cell-identity, .tf-table .tf-cell-milk, .tf-table .tf-cell-supplements, .tf-table .tf-cell-notes, .tf-table .tf-cell-updated, .tf-table .tf-actions { grid-column: 1 / -1; }
  .tf-table .tf-cell-identity { background: #edf4ee !important; }
  .tf-table td.tf-daily { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; }
  .tf-table td.tf-daily::before { flex-basis: 100%; margin-bottom: 0; }
  .tf-table td.tf-daily > small { flex-basis: 100%; margin-top: 0; }
  .tf-actions { display: block !important; }
  .tf-actions::before { display: none !important; }
  .tf-action-buttons { display: flex; gap: 10px; }
  .tf-action-buttons .button { width: auto; flex: 1; margin: 0 !important; min-height: 44px; font-size: 16px; }
  .tf-edit-dialog .tube-feeding-profile-grid { grid-template-columns: minmax(0, 1.5fr) minmax(150px, 1fr); }
  .tf-edit-dialog .tube-feeding-profile-grid .tf-profile-resident,
  .tf-edit-dialog .tube-feeding-profile-grid .tf-profile-source,
  .tf-edit-dialog .tube-feeding-profile-grid .tf-profile-notes { grid-column: 1 / -1; }
  .tf-detail-table, .tf-detail-table tbody { display: block; }
  .tf-detail-table thead { display: none; }
  .tf-detail-table tr { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 12px; border: 1px solid #dce5de; }
  .tf-detail-table td { display: block; min-width: 0; font-size: 16px; }
  .tf-detail-table td:first-child, .tf-detail-table td:nth-child(2), .tf-detail-table td:last-child { grid-column: 1 / -1; }
  .tf-detail-table td::before { content: attr(data-label); display: block; font-size: 13px; color: #627166; margin-bottom: 4px; }
  .tf-detail-body { padding: 14px; }
}
@media (max-width: 680px) {
  .tf-edit-dialog .tf-meal-grid { grid-template-columns: 54px 98px minmax(90px, 1fr) 72px 72px; gap: 4px; padding: 6px 4px; }
  .tf-edit-dialog .tf-meal-selector { gap: 2px; font-size: 12px; }
  .tf-edit-dialog .tf-meal-selector input { width: 20px; height: 24px; }
  .tf-edit-dialog .tf-supplement-grid { grid-template-columns: 80px minmax(110px, 1fr) 72px 72px 44px; gap: 5px; }
}
@media (max-width: 500px) {
  .tf-edit-dialog { width: calc(100% - 8px); max-width: calc(100% - 8px); }
  .tf-edit-dialog .tube-feeding-registry-dialog { padding: 8px; }
  .tf-edit-dialog .tube-feeding-plan-editor { padding: 6px; }
  .tf-edit-dialog .tube-feeding-plan-editor-head { flex-wrap: wrap; }
  .tf-edit-dialog .tube-feeding-plan-editor-head output { font-size: 14px; }
  .tf-edit-dialog .tube-feeding-profile-grid { grid-template-columns: minmax(0, 1fr); padding-inline: 6px; }
  .tf-edit-dialog .tube-feeding-profile-grid > label { grid-column: 1 !important; }
  .tf-edit-dialog .tf-meal-grid { grid-template-columns: 32px 80px minmax(65px, 1fr) 58px 58px; gap: 3px; }
  .tf-edit-dialog .tf-meal-grid:has(.tf-milk-custom:not(.hidden)) { grid-template-columns: 28px 76px minmax(45px, 1fr) minmax(50px, 1fr) 50px 50px; }
  .tf-edit-dialog .tf-meal-grid input, .tf-edit-dialog .tf-meal-grid select { font-size: 16px; padding-inline: 2px; }
  .tf-edit-dialog .tf-meal-grid input[type="number"] { padding-right: 2px; appearance: textfield; }
  .tf-edit-dialog .tf-meal-grid input[type="number"]::-webkit-inner-spin-button,
  .tf-edit-dialog .tf-meal-grid input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
  .tf-edit-dialog .tf-meal-grid input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  .tf-edit-dialog .tf-meal-grid label small { font-size: 9px; right: 0; top: 2px; bottom: auto; }
  .tf-edit-dialog .tf-meal-selector { font-size: 11px; gap: 0; }
  .tf-edit-dialog .tf-meal-selector input { width: 18px; flex: 0 0 18px; }
  .tf-edit-dialog .tf-meal-word { display: none; }
  .tf-edit-dialog .tf-supplement-grid { grid-template-columns: 72px minmax(0, 1fr) 65px 60px 38px; gap: 4px; }
  .tf-edit-dialog .tf-supplement-grid label { font-size: 12px; }
  .tf-edit-dialog .tf-supplement-grid input, .tf-edit-dialog .tf-supplement-grid select { font-size: 16px; padding-inline: 2px; }
}
