.stocktake-view { min-width: 0; color: var(--ink); }
.stocktake-view button { width: auto; min-height: 40px; margin: 0; font-size: 14px; line-height: 1.3; padding: 9px 13px; border-radius: 6px; white-space: normal; overflow-wrap: anywhere; }
.stocktake-view input, .stocktake-view select, .stocktake-view textarea { min-width: 0; max-width: 100%; font-size: 16px; }
.stocktake-view h2 { font-size: 24px; margin: 0; overflow-wrap: anywhere; }
.stocktake-view h3 { font-size: 19px; }
.stocktake-view small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.stocktake-view a { color: var(--ink); overflow-wrap: anywhere; }
.st-toolbar, .st-actions, .st-heading, .st-pagination, .st-picker-toolbar, .st-picker-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.st-toolbar { justify-content: space-between; margin-bottom: 20px; }
.st-tabs { display: inline-flex; max-width: 100%; border-bottom: 1px solid var(--line); }
.st-tabs button { background: transparent; color: var(--muted); border: 0; border-radius: 0; border-bottom: 3px solid transparent; }
.st-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--brand); background: var(--surface-2); }
:root[data-theme="dark"] .stocktake-view .st-tabs button[role="tab"]:not(.secondary) { color: var(--ink); background: transparent; }
:root[data-theme="dark"] .stocktake-view .st-tabs button[role="tab"][aria-selected="true"]:not(.secondary) { color: var(--ink); background: var(--surface-2); }
.st-campaigns, .st-lines { display: grid; gap: 10px; }
.st-campaign, .st-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 6px; padding: 16px; background: var(--surface); }
.st-campaign { grid-template-columns: minmax(0, 1fr) auto auto auto auto; }
.st-line-identity { min-width: 0; overflow-wrap: anywhere; }
.st-line-identity strong { font-size: 17px; }
.st-line-identity small { margin: 4px 0; }
.st-state { display: inline-block; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; font-size: 12px; font-weight: 650; color: var(--ink); background: var(--surface-2); overflow-wrap: anywhere; }
.st-state-counted, .st-state-closed, .st-state-finalized { border-color: var(--success); }
.st-state-review { border-color: var(--warn); }
.st-state-cancelled, .st-state-excluded { color: var(--muted); }
.st-heading { margin: 12px 0 4px; }
.st-sites { margin: 6px 0 14px; overflow-wrap: anywhere; }
.st-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 14px 0; }
.st-progress progress { width: min(260px, 100%); height: 8px; accent-color: var(--brand); }
.st-campaign-actions { margin-bottom: 20px; }
.st-management-actions { display: flex; align-items: stretch; flex-wrap: wrap; gap: 10px; }
.st-summary { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 20px 0; border-block: 1px solid var(--line); }
.st-summary > div { padding: 12px; min-width: 0; }
.st-summary dt, .st-line-counts dt { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.st-summary dd { margin: 6px 0 0; font-size: 23px; font-weight: 700; }
.st-line-counts { display: flex; gap: 16px; margin: 0; }
.st-stock-breakdown { margin: 0; }
.st-stock-breakdown > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.st-stock-breakdown dt { min-width: 0; overflow-wrap: anywhere; }
.st-stock-breakdown dd { margin: 0; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.st-line-counts dd { margin: 4px 0 0; font-weight: 650; text-align: right; }
.st-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.st-filters label { flex: 1; min-width: 150px; }
.st-pagination { justify-content: flex-end; margin-top: 16px; font-size: 13px; }
.st-pagination button { min-height: 36px; }
.st-error { color: var(--danger); overflow-wrap: anywhere; }
.st-uncertain { border-left: 3px solid var(--warn); padding: 10px 14px; margin-bottom: 16px; background: var(--surface-2); }
.st-uncertain .st-actions { margin-top: 8px; }
.st-policy { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; }
.st-policy summary { cursor: pointer; }
.st-policy form { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding-top: 14px; }
.st-checkbox { display: flex; align-items: center; gap: 10px; }
.stocktake-view input[type="checkbox"], .stocktake-view input[type="radio"] { width: 18px; height: 18px; flex: 0 0 18px; margin: 0; accent-color: var(--brand); }
.st-dialog { box-sizing: border-box; width: min(680px, calc(100% - 24px)); max-width: 680px; max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 8px; padding: 20px; background: var(--surface); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.st-dialog::backdrop { background: rgb(0 0 0 / 65%); }
.st-dialog > header { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 20px; }
.st-dialog h2 { font-size: 21px; min-width: 0; }
.stocktake-view .st-close { flex: 0 0 40px; width: 40px; height: 40px; padding: 0; font-size: 26px; }
.st-form { display: grid; gap: 16px; }
.st-form fieldset { margin: 0; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 6px; }
.st-form legend { padding: 0 6px; font-size: 14px; }
.st-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 230px; overflow-y: auto; }
.st-options label { display: flex; align-items: start; gap: 8px; font-size: 14px; min-width: 0; overflow-wrap: anywhere; }
.st-picker-toolbar { align-items: end; margin-bottom: 14px; }
.st-picker-toolbar select { flex: 1; width: 120px; }
.st-picker-search { flex: 2; min-width: 120px; }
.st-picker-footer { justify-content: space-between; margin-top: 14px; font-size: 13px; }
.st-picker-footer .st-pagination { margin: 0; }
.st-form-actions { display: flex; flex-wrap: wrap; gap: 10px; position: sticky; bottom: -20px; background: var(--surface); padding: 12px 0; border-top: 1px solid var(--line); }
.st-attempt-clock { color: var(--muted); font-size: 13px; }
.st-observation { display: flex; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.st-observation > span { min-width: 0; }
.st-observation p { margin: 8px 0 0; }
.st-review-status { color: var(--muted); font-size: 14px; }
.st-report-table { max-width: 100%; overflow-x: auto; }
.st-report-table table { width: 100%; border-collapse: collapse; }
.st-report-table th, .st-report-table td { padding: 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14px; }
.st-report-table th { white-space: normal; }
.st-report-table details { font-size: 12px; font-weight: 400; margin-top: 8px; }
.st-camera { width: 100%; aspect-ratio: 4 / 3; background: #0a1010; border-radius: 6px; overflow: hidden; margin-bottom: 14px; }
.st-camera video { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 1100px) {
  .st-campaign { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 14px; }
  .st-campaign small { grid-column: 1 / -1; }
  .st-line { grid-template-columns: minmax(0, 1fr) auto; }
  .st-line > .st-actions { grid-column: 1 / -1; }
  .st-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .st-toolbar { align-items: stretch; margin-bottom: 14px; gap: 12px; }
  .st-toolbar > .st-actions { justify-content: flex-end; width: 100%; }
  .st-tabs { width: 100%; }
  .st-tabs button { flex: 1; }
  .st-heading h2 { font-size: 21px; flex-basis: 100%; }
  .st-line { padding: 12px; gap: 12px; }
  .st-line-counts { gap: 10px; }
  .st-line-counts dt { font-size: 11px; }
  .st-line-identity strong { font-size: 16px; }
  .st-summary > div { padding: 10px 6px; }
  .st-summary dd { font-size: 21px; }
  .st-dialog { padding: 16px; }
  .st-form-actions { bottom: -16px; }
  .st-options { grid-template-columns: 1fr; }
  .st-report-table table, .st-report-table tbody, .st-report-table tr { display: block; }
  .st-report-table thead { display: none; }
  .st-report-table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .st-report-table th { display: block; border: 0; padding: 6px 0 10px; }
  .st-report-table td { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; border: 0; padding: 5px 0; overflow-wrap: anywhere; }
  .st-report-table td::before { content: attr(data-label); color: var(--muted); }
  .st-report-table td small { grid-column: 2; }
}
