.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.text-pre-line { white-space: pre-line; }
.depth-1 { padding-left: 1.5rem; }
.depth-2 { padding-left: 3rem; }
.depth-3 { padding-left: 4.5rem; }
.depth-4 { padding-left: 6rem; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.photo { position: relative; aspect-ratio: 1; border-radius: .375rem; overflow: hidden; background: var(--bs-tertiary-bg); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-delete { position: absolute; top: .25rem; right: .25rem; }
@media (hover: hover) {
  .photo-delete { opacity: 0; transition: opacity .15s; }
  .photo:hover .photo-delete, .photo:focus-within .photo-delete { opacity: 1; }
}
.company-logo { width: 200px; height: 90px; object-fit: contain; }
.tabular { font-variant-numeric: tabular-nums; }
.order-items .qty-input { width: 5rem; display: inline-block; }
.order-items .price-input { width: 6.5rem; display: inline-block; }
.order-items .pct-input { width: 4.5rem; display: inline-block; }
.scan-input { width: 9.5rem; }
.template-editor { min-height: 60vh; tab-size: 2; white-space: pre; }
.template-default { max-height: 50vh; overflow: auto; }
.qty-small { width: 4.5rem; }

.calendar { table-layout: fixed; width: 100%; }
.calendar.cal-days-14 { min-width: 54rem; }
.calendar.cal-days-28 { min-width: 92rem; }
.calendar .cal-label-col { width: 15rem; }
.calendar th, .calendar td { vertical-align: middle; }
.calendar .cal-label { position: sticky; left: 0; z-index: 1; }
.calendar .cal-month { font-weight: 600; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calendar .cal-day { text-align: center; font-size: .8125rem; line-height: 1.1; }
.calendar .cal-weekend { --bs-table-bg: var(--bs-tertiary-bg); }
.calendar .cal-today { --bs-table-bg: rgba(var(--bs-primary-rgb), .07); }
.calendar th.cal-today { --bs-table-bg: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.calendar .cal-bar-cell { padding: .125rem; }
.calendar .cal-occ { text-align: center; font-variant-numeric: tabular-nums; font-size: .8125rem; }
.cal-bar { display: block; padding: .125rem .5rem; border: 1px solid transparent; border-radius: .375rem; font-size: .8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.cal-bar-quote { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); border: 1px dashed var(--bs-warning-border-subtle); }
.cal-bar-confirmed { background: var(--bs-primary); color: #fff; }
.cal-bar-completed { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); border-color: var(--bs-border-color); }
.cal-bar:hover { filter: brightness(.95); }
.cal-cut-start { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-cut-end { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.calendar .occ-idle { color: var(--bs-tertiary-color); }
.calendar .occ-booked, .cal-swatch.occ-booked { --bs-table-bg: var(--bs-success-bg-subtle); background: var(--bs-success-bg-subtle); }
.calendar .occ-tentative, .cal-swatch.occ-tentative { --bs-table-bg: var(--bs-warning-bg-subtle); background: var(--bs-warning-bg-subtle); }
.calendar .occ-full, .cal-swatch.occ-full { --bs-table-bg: var(--bs-danger-bg-subtle); background: var(--bs-danger-bg-subtle); font-weight: 600; }
.calendar .occ-over, .cal-swatch.occ-over { --bs-table-bg: var(--bs-danger); --bs-table-color: #fff; background: var(--bs-danger); color: #fff; font-weight: 700; }
.cal-swatch { display: inline-block; width: .875rem; height: .875rem; margin-right: .3rem; vertical-align: -.125rem; border-radius: .2rem; border: 1px solid var(--bs-border-color); padding: 0; }
@media (max-width: 575.98px) { .calendar .cal-label-col { width: 9rem; } }

.camera-view { position: relative; background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
@media (max-width: 575.98px) { .modal-fullscreen-sm-down .camera-view { aspect-ratio: auto; flex: 1 1 auto; } }
.camera-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-frame { position: absolute; inset: 22% 12%; border: 3px solid rgba(255, 255, 255, .85); border-radius: .75rem; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
