:root {
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    sans-serif;
  color: #183e3a;
  background: #f3f5f1;
  font-size: 16px;
}
.list-tabs,
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.list-tabs [aria-pressed="true"] {
  background: #235c4d;
  color: #fff;
}
.pagination {
  justify-content: space-between;
}
.pagination button {
  padding: 10px 12px;
  min-height: 44px;
}
#assignment-site {
  margin: 0 0 8px;
}
#assignment-name {
  font-size: 19px;
}
#search-options > summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
}
#product-overview select {
  text-overflow: ellipsis;
}
.count-list-info,
.tile-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
}
main {
  max-width: 860px;
  margin: auto;
  padding: 24px 20px 64px;
}
header,
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
header {
  padding: 0 0 24px;
}
.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.brand span {
  font-size: 12px;
  color: #4c6259;
}
h1 {
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.04em;
  margin: 12px 0 20px;
}
h2 {
  font-size: 21px;
  margin: 0 0 12px;
}
p {
  line-height: 1.6;
}
.lead {
  color: #50665e;
  max-width: 520px;
}
.notice {
  background: #e7eddb;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 26px;
  font-size: 14px;
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 10px;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 16px;
  padding: 14px;
  border: 1px solid #768f7e;
  border-radius: 9px;
  margin-top: 8px;
  background: #fff;
  color: #163d32;
}
textarea {
  min-height: 90px;
  resize: vertical;
}
button {
  font: 600 15px system-ui;
  padding: 14px 18px;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: #235c4d;
  color: #fff;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:hover {
  filter: brightness(0.94);
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #b68b28;
  outline-offset: 3px;
}
.secondary {
  color: #235c4d;
  background: #e4ece4;
}
.quiet {
  background: transparent;
  color: #36584b;
  border-color: #c2cfc3;
}
.card,
#editor {
  background: #fff;
  border: 1px solid #d6dfd5;
  border-radius: 16px;
  padding: 24px;
  margin: 16px 0;
}
.card .card {
  padding: 16px;
}
#login-form {
  max-width: 420px;
}
.eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4c6259;
}
.badge {
  font-size: 12px;
  border-radius: 20px;
  padding: 8px 12px;
  background: #e6ece6;
  white-space: nowrap;
}
.hint,
footer {
  font-size: 13px;
  color: #4c6259;
}
footer {
  margin-top: 32px;
  border-top: 1px solid #d2dcd1;
  padding-top: 18px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.result {
  background: #f0f5ec;
  border-radius: 8px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 20px;
}
.blocked {
  background: #fff2df;
  color: #694c24;
}
#message {
  position: static;
  margin: 8px 0;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
#message:empty {
  display: none;
}
#message:not(:empty) {
  padding: 8px 10px;
  background: #e4f0e7;
  color: #183e3a;
  border: 1px solid #b6c7bd;
}
#message.message-error:not(:empty) {
  background: #fff5f2;
  color: #9a2929;
  border-color: #9a2929;
}
.count-date {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  color: #4c6259;
}
.list-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  text-align: left;
  background: white;
  color: #235c4d;
  border: 1px solid #c5d3c3;
  margin: 8px 0;
}
.heading {
  margin-top: 16px;
}
#review-note {
  color: #79512f;
}
.notice p {
  margin: 8px 0 0;
}
#proposal-list {
  padding-left: 20px;
  line-height: 1.6;
}
#proposal-list li {
  margin: 8px 0;
}
#demo-next {
  margin: 8px 0 18px;
}
.field-error {
  color: #9a2929;
  font-size: 14px;
  margin: 8px 0;
}
input[aria-invalid="true"] {
  border: 2px solid #9a2929;
  background: #fff5f2;
}
#editor,
input {
  scroll-margin-top: 20px;
}
@media (max-width: 520px) {
  main {
    padding: 18px 14px 50px;
  }
  .card,
  #editor {
    padding: 18px 14px;
  }
  .heading {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .actions button {
    width: 100%;
  }
  #create {
    width: 100%;
  }
  #count-title {
    font-size: 18px;
  }
  .badge {
    white-space: normal;
  }
}
#product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 16px 0 24px;
}
.product-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 6px;
  background: #fff;
  border: 1px solid #b6c7bd;
  border-radius: 14px;
  color: #183e3a;
  padding: 14px 16px;
}
.product-tile.saved {
  background: #e4f0e7;
  border-color: #51936c;
}
.product-tile .hint {
  margin: 0;
  font-weight: 400;
}
.tile-name {
  font-size: 17px;
}
#product-detail {
  max-width: 620px;
  margin: 16px auto;
}
#product-name {
  margin-top: 14px;
}
#quantity {
  font-size: 28px;
}
#save-product {
  width: 100%;
  margin-top: 16px;
}
#export-excel {
  margin: 12px 12px 12px 0;
}
@media (max-width: 520px) {
  #product-grid {
    grid-template-columns: 1fr;
  }
  .product-tile {
    min-height: 92px;
  }
}
.inline-check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.inline-check input {
  width: 22px;
  height: 22px;
  margin: 0;
}
.period-tag {
  font-size: 12px;
  font-weight: 400;
  color: #50665e;
}
#tare-reference {
  margin: 12px 0;
  font-size: 14px;
}
#tare-reference summary {
  cursor: pointer;
  padding: 10px 0;
}

#demo-controls {
  margin-bottom: 16px;
  color: #4c6259;
  font-size: 14px;
}
#demo-controls summary,
#source-hints > summary {
  cursor: pointer;
  padding: 12px 0;
}
#inventory-choice label {
  margin-top: 0;
}
#inventory-choice #create {
  margin-top: 8px;
}
.count-list-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.list-row {
  align-items: center;
}
#back-counts {
  margin-bottom: 12px;
}
#review-note {
  overflow-wrap: anywhere;
}
#result-summary {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid #d6dfd5;
}
#progress {
  font-weight: 650;
}
#reviewer-actions {
  margin: 8px 0 16px;
  padding: 16px;
}
#reviewer-actions label {
  margin-top: 8px;
}
#note {
  min-height: 64px;
}
#recount-product {
  max-width: 100%;
}
#review-table-wrap {
  margin-top: 16px;
}
#review-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 14px;
}
#review-table th {
  text-align: left;
  background: #e4ece4;
  color: #183e3a;
}
#review-table th,
#review-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #d6dfd5;
  overflow-wrap: anywhere;
  vertical-align: middle;
}
#review-table th:nth-child(2) {
  width: 54px;
}
#review-table th:nth-child(3) {
  width: 92px;
}
#review-table th:nth-child(4) {
  width: 100px;
}
#review-table tbody tr:nth-child(even) {
  background: #f3f5f1;
}
.row-recount {
  padding: 8px;
  min-height: 44px;
  font-size: 13px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#product-detail #product-hint {
  margin: 12px 0;
  font-size: 15px;
}
#product-detail label {
  margin: 10px 0;
}
#product-detail #product-limits {
  margin: 8px 0;
}
#product-review-warning {
  padding: 10px 12px;
  margin: 8px 0;
  font-size: 14px;
}
#source-hints {
  margin-top: 12px;
}
#source-hints p {
  line-height: 1.5;
}
.product-open header,
.product-open > main > .notice,
.product-open #demo-controls,
.product-open #back-counts,
.product-open #editor > .heading,
.product-open #review-note,
.product-open #step-label,
.product-open #workflow-help,
.product-open footer {
  display: none;
}
.product-open #editor {
  padding: 0;
  border: 0;
  background: transparent;
  margin: 0;
}
.product-open #product-detail {
  margin: 0 auto;
}
.product-open #message:not(:empty) {
  position: static;
}
@media (max-width: 520px) {
  #product-detail {
    padding: 12px;
  }
  #product-name {
    font-size: 20px;
    margin-top: 12px;
  }
  .product-open main {
    padding: 8px 10px 24px;
  }
  #quantity {
    font-size: 26px;
    padding: 12px;
  }
  .save-bar {
    position: sticky;
    bottom: 8px;
    background: #fff;
    padding: 6px 0;
    z-index: 3;
  }
  #save-product {
    margin-top: 0;
  }
  .list-row {
    align-items: flex-start;
    padding: 12px;
  }
  #review-table th:nth-child(2) {
    width: 36px;
  }
  #review-table th:nth-child(3) {
    width: 52px;
  }
  #review-table th:nth-child(4) {
    width: 76px;
  }
  #review-table td,
  #review-table th {
    padding: 8px 4px;
  }
  #result-summary {
    flex-wrap: wrap;
  }
  #show-review-actions {
    font-size: 13px;
    padding: 8px;
  }
  #reviewer-actions {
    padding: 10px;
  }
}

@media (max-width: 520px) {
  .count-open:not(.product-open) main {
    padding: 10px 10px 30px;
  }
  .count-open header,
  .count-open #demo-controls {
    display: none;
  }
  .count-open > main > .notice {
    padding: 8px 10px;
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.4;
  }
  .count-open:not(.product-open) #editor {
    padding: 12px;
    margin-top: 8px;
  }
  .count-open #back-counts {
    border-color: transparent;
    padding: 4px 0;
    min-height: 44px;
    margin-bottom: 6px;
  }
  .count-open #editor > .heading {
    margin-top: 0;
    gap: 8px;
  }
  .count-open #count-title {
    margin-bottom: 0;
  }
  .count-open #count-status {
    padding: 6px 8px;
  }
  .count-open #step-label {
    display: none;
  }
  .count-open #workflow-help {
    margin: 8px 0;
    line-height: 1.4;
  }
  .count-open #progress {
    margin: 10px 0;
  }
  .count-open #product-overview > label {
    margin: 10px 0;
  }
  .count-open #product-search {
    padding: 12px;
  }
  .count-open #filter-summary {
    margin: 8px 0;
  }
  .count-open #product-grid {
    margin-top: 10px;
  }
}

#test-notice {
  padding: 0 10px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
}
#test-notice > summary,
#welcome > summary {
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
#test-notice > p:last-child {
  padding-bottom: 12px;
}
header {
  gap: 8px;
}
#demo-controls {
  position: relative;
  margin: 0;
}
#demo-controls > summary {
  min-height: 44px;
  font-size: 13px;
  white-space: nowrap;
}
.role-options {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 5;
  width: 260px;
  max-width: calc(100vw - 24px);
  padding: 12px;
  border: 1px solid #768f7e;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 4px 16px #0002;
}
.role-options .hint {
  margin-top: 0;
}
.demo-mode #role {
  display: none;
}
#welcome.help {
  margin: 4px 0 8px;
  padding: 0 10px;
  font-size: 14px;
  color: #36584b;
}
#welcome.help p {
  margin: 8px 0;
}
@media (max-width: 520px) {
  main {
    padding: 10px 12px 36px;
  }
  header {
    padding-bottom: 4px;
  }
  .brand {
    font-size: 18px;
  }
  .brand span {
    font-size: 10px;
  }
  #overview-panel > .heading {
    margin-top: 4px;
  }
  #overview-panel h1 {
    font-size: 26px;
    margin: 4px 0 10px;
  }
  #inventory-choice {
    margin: 4px 0;
    padding: 12px;
  }
  #inventory-choice label {
    margin: 0;
  }
  #inventory-choice select {
    padding: 12px;
  }
  #inventory-choice-help {
    margin: 8px 0;
    line-height: 1.4;
  }
  #inventory-choice #create {
    margin-top: 4px;
  }
  #refresh {
    min-height: 44px;
    padding: 8px 12px;
  }
  .count-open > main > #test-notice {
    padding: 0 10px;
  }
}
#category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0;
  margin: 4px 0;
}
.category-chip {
  border-radius: 24px;
  min-height: 44px;
  flex: 0 0 auto;
  max-width: 155px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 10px 12px;
}
.category-chip[aria-pressed="true"] {
  background: #235c4d;
  color: white;
}
#product-grid > #message {
  grid-column: 1 / -1;
}
