:root {
  color-scheme: light;
  font-family: Arial, Helvetica, sans-serif;
  --dark: #424749;
  --ink: #1f2a2e;
  --muted: #758187;
  --line: #d7dde0;
  --soft: #f3f6f7;
  --accent: #dce95a;
  --blue: #2384c6;
  --danger: #c73535;
  --ok: #22a447;
}

* {
  box-sizing: border-box;
}

html {
  background: #eef2f3;
  height: 100%;
  overscroll-behavior: none;
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

body {
  background: #eef2f3;
  color: var(--ink);
  height: 100%;
  margin: 0;
  min-height: 100dvh;
  overscroll-behavior: none;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.app-header {
  align-items: center;
  background: var(--dark);
  border-bottom: 4px solid #f4f6f7;
  color: #ffffff;
  display: flex;
  gap: 16px;
  min-height: calc(56px + env(safe-area-inset-top));
  justify-content: space-between;
  padding: env(safe-area-inset-top) calc(20px + env(safe-area-inset-right)) 0 calc(20px + env(safe-area-inset-left));
}

.app-header strong {
  font-size: 20px;
  font-weight: 400;
}

.header-status {
  align-items: center;
  display: flex;
  gap: 12px;
}

.mobile-locale-switcher {
  display: inline-flex;
  gap: 2px;
}

.mobile-locale-switcher button {
  background: transparent;
  border: 1px solid rgb(255 255 255 / 35%);
  color: #ffffff;
  font-size: 11px;
  min-height: 30px;
  min-width: 32px;
  padding: 2px 5px;
}

.mobile-locale-switcher button.active {
  background: #ffffff;
  color: var(--dark);
}

.api-dot {
  background: #989fa3;
  border-radius: 999px;
  display: inline-block;
  height: 18px;
  width: 18px;
}

.api-dot.online {
  background: #20bb43;
}

.api-dot.offline {
  background: #d74747;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.icon-button svg {
  fill: none;
  height: 28px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 28px;
}

.screen {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px calc(18px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
}

.loading-card {
  background: #ffffff;
  border: 1px solid var(--line);
  padding: 20px;
}

.login-screen {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  padding-right: clamp(28px, 8vw, 96px);
}

.pin-panel {
  display: grid;
  gap: 20px;
  justify-items: center;
  max-width: 360px;
  width: min(360px, 100%);
}

.pin-text,
.pin-dots {
  color: #0f2028;
  font-size: 15px;
  line-height: 1.35;
  min-height: 42px;
  text-align: center;
  width: 100%;
}

.pin-auth-space {
  align-items: center;
  display: grid;
  min-height: 170px;
  width: 100%;
}

.pin-auth-loading {
  align-items: center;
  color: #0f2028;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.pin-auth-loading[hidden] {
  display: none;
}

.pin-auth-spinner {
  animation: pin-auth-logo-spin 2.8s linear infinite;
  display: block;
  height: 132px;
  object-fit: contain;
  width: 132px;
}

.pin-auth-loading strong {
  font-size: 17px;
  font-weight: 500;
}

@keyframes pin-auth-logo-spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.pin-dots {
  font-size: 30px;
  letter-spacing: 8px;
}

.pin-grid {
  display: grid;
  gap: 22px 34px;
  grid-template-columns: repeat(3, 64px);
  justify-content: center;
}

.pin-grid button {
  align-items: center;
  background: transparent;
  border: 0;
  color: #10212a;
  display: flex;
  font-size: 38px;
  font-weight: 300;
  height: 64px;
  justify-content: center;
  padding: 0;
  width: 64px;
}

.pin-grid[aria-busy="true"] button:not([data-pin-key="backspace"]) {
  opacity: 0.35;
}

.pin-grid-spacer {
  height: 64px;
  width: 64px;
}

.pin-grid .pin-grid-card-button svg {
  height: 34px;
  width: 34px;
}

.pin-grid svg {
  fill: none;
  height: 46px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
  width: 46px;
}

.login-error {
  color: var(--danger);
  margin: 0;
  min-height: 20px;
  text-align: center;
}

.portal-screen {
  display: grid;
  gap: 16px;
}

.summary-card,
.portal-section,
.portal-grid article {
  background: #ffffff;
  border: 1px solid var(--line);
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 18px;
}

.summary-card span,
.summary-card small {
  color: var(--muted);
}

.summary-card strong {
  font-size: 28px;
  font-weight: 400;
}

.portal-section header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.portal-section h2,
.portal-grid h3,
.task-dialog h2,
.stock-product-dialog h2,
.unknown-product-card h3 {
  font-size: 18px;
  margin: 0;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--blue);
  padding: 8px;
}

.task-list {
  display: grid;
}

.task-card {
  align-items: center;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  display: grid;
  gap: 4px;
  grid-template-columns: 1fr auto;
  min-height: 76px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.task-card strong {
  font-size: 16px;
}

.task-card small {
  color: var(--muted);
}

.task-card .status-pill {
  background: var(--soft);
  border-radius: 999px;
  color: var(--muted);
  padding: 5px 10px;
}

.task-card.available .status-pill {
  background: #e2f4e7;
  color: #187034;
}

.empty-state {
  color: var(--muted);
  padding: 18px 14px;
}

.portal-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-grid article {
  padding: 16px;
}

.portal-grid p {
  color: var(--muted);
  margin: 10px 0 0;
}

.stock-product-section {
  margin-top: 16px;
}

.stock-product-header {
  cursor: pointer;
  position: relative;
}

.stock-product-section header small {
  color: var(--muted);
}

.stock-product-card {
  padding: 14px;
}

.stock-barcode-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.stock-barcode-row .button {
  min-height: 40px;
  padding: 7px 10px;
  white-space: nowrap;
}

.stock-packaging-select-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
}

.stock-packaging-select-row strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-packaging-select-row select {
  margin-top: 0;
  min-width: 0;
}

.inventory-product-search-row {
  align-items: stretch;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) 46px;
}

.inventory-product-search-row input {
  min-width: 0;
}

.barcode-scan-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 0;
  display: inline-grid;
  justify-items: center;
  min-height: 42px;
  padding: 0;
  touch-action: manipulation;
}

.barcode-scan-icon {
  background: linear-gradient(
    90deg,
    #1f252d 0 2px,
    transparent 2px 5px,
    #1f252d 5px 8px,
    transparent 8px 10px,
    #1f252d 10px 11px,
    transparent 11px 14px,
    #1f252d 14px 17px,
    transparent 17px 20px,
    #1f252d 20px 22px,
    transparent 22px 25px,
    #1f252d 25px 28px
  );
  display: block;
  height: 24px;
  position: relative;
  width: 28px;
}

.barcode-scan-icon::after {
  background: #1f252d;
  bottom: -4px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

.stock-photo-field {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 38px;
}

.stock-photo-field .button {
  min-height: 38px;
  padding: 7px 10px;
}

.stock-photo-clear {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 24px;
  height: 38px;
  justify-content: center;
  padding: 0;
  width: 38px;
}

.stock-photo-preview {
  border: 1px solid var(--line);
  display: block;
  height: 96px;
  margin-top: 8px;
  overflow: hidden;
  width: 96px;
}

.stock-photo-preview[hidden] {
  display: none;
}

.stock-photo-preview img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.stock-packaging-block {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding-top: 12px;
}

.stock-packaging-block[hidden] {
  display: none;
}

.task-dialog,
.stock-product-dialog,
.incoming-invoice-dialog,
.barcode-scanner-dialog,
.unknown-product-dialog,
.line-comment-dialog,
.line-action-dialog {
  border: 0;
  margin: auto;
  max-width: min(720px, calc(100vw - 24px));
  padding: 0;
  width: 720px;
}

.task-dialog,
.stock-product-dialog {
  height: 100dvh;
  max-height: 100dvh;
  max-width: 100vw;
  position: relative;
  width: 100vw;
}

.unknown-product-dialog,
.line-comment-dialog,
.line-action-dialog {
  max-width: min(520px, calc(100vw - 24px));
  width: 520px;
}

.task-dialog::backdrop,
.stock-product-dialog::backdrop,
.incoming-invoice-dialog::backdrop,
.barcode-scanner-dialog::backdrop,
.unknown-product-dialog::backdrop,
.line-comment-dialog::backdrop,
.line-action-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.task-dialog form,
.stock-product-dialog form,
.incoming-invoice-dialog form,
.barcode-scanner-dialog form,
.unknown-product-dialog form,
.line-comment-dialog form,
.line-action-dialog form {
  background: #ffffff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: calc(100dvh - 24px);
}

.task-dialog form,
.stock-product-dialog form {
  height: 100dvh;
  max-height: 100dvh;
  position: relative;
}

.task-dialog header,
.stock-product-dialog header,
.incoming-invoice-dialog header,
.barcode-scanner-dialog header,
.unknown-product-dialog header,
.line-comment-dialog header,
.line-action-dialog header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: calc(18px + env(safe-area-inset-top)) calc(18px + env(safe-area-inset-right)) 18px calc(18px + env(safe-area-inset-left));
}

.task-dialog header,
.stock-product-dialog header {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.incoming-invoice-dialog {
  border: 0;
  margin: auto;
  max-width: min(620px, calc(100vw - 24px));
  padding: 0;
  width: 620px;
}

.incoming-invoice-dialog form {
  grid-template-rows: auto minmax(0, 1fr);
}

.incoming-invoice-dialog header > button {
  background: transparent;
  border: 0;
  font-size: 28px;
  height: 40px;
  width: 40px;
}

.incoming-invoice-dialog header h2 {
  margin: 0 0 4px;
}

.incoming-invoice-dialog header small {
  color: var(--muted);
}

.incoming-invoice-dialog-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.incoming-invoice-dialog-body label {
  display: grid;
  gap: 6px;
}

.incoming-invoice-dialog-body textarea {
  min-height: 92px;
  resize: vertical;
}

.incoming-invoice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.incoming-invoice-status {
  background: var(--soft);
  margin: 0;
  padding: 12px;
}

.incoming-invoice-status.is-error {
  color: var(--danger);
}

.incoming-invoice-result {
  border: 1px solid var(--line);
  padding: 12px;
}

.incoming-invoice-result dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.incoming-invoice-result dl div {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(110px, 0.45fr) 1fr;
}

.incoming-invoice-result dt {
  color: var(--muted);
}

.incoming-invoice-result dd {
  margin: 0;
}

.stock-product-dialog header {
  align-items: center;
}

.stock-product-dialog header small {
  color: var(--muted);
  grid-column: 1;
}

.task-dialog header p {
  color: var(--muted);
  margin: 4px 0 0;
}

.task-dialog-heading {
  align-items: center;
  display: grid;
  gap: 6px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.task-dialog-heading h2 {
  align-items: center;
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 8px;
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  min-width: 0;
}

.task-dialog-heading h2,
.task-show-deleted-toggle {
  min-width: 0;
}

.task-info-button {
  align-items: center;
  aspect-ratio: 1;
  background: transparent;
  border: 1px solid #9aa6ab;
  border-radius: 50%;
  block-size: 28px;
  color: #4f5a60;
  display: inline-flex;
  flex: 0 0 28px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  inline-size: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.task-show-deleted-toggle {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  gap: 8px;
  grid-column: 1 / -1;
  grid-row: 2;
  justify-self: start;
  min-height: 34px;
  white-space: nowrap;
}

.task-sync-status {
  color: var(--muted);
  font-size: 12px;
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  line-height: 1.2;
  min-width: 68px;
  text-align: right;
  white-space: normal;
}

.task-sync-status span,
.task-sync-status strong {
  display: block;
}

.task-sync-status strong {
  color: var(--text);
  font-weight: 600;
}

.task-show-deleted-toggle input {
  height: 18px;
  min-height: 18px;
  width: 18px;
}

.task-dialog header > button,
.stock-product-dialog header > button,
.barcode-scanner-dialog header > button,
.unknown-product-dialog header > button,
.line-comment-dialog header > button,
.line-action-dialog header > button {
  background: transparent;
  border: 0;
  color: #68747a;
  font-size: 34px;
  line-height: 1;
}

.task-info-card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.task-info-card div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
}

.task-info-card span {
  color: var(--muted);
  font-size: 13px;
}

.task-info-card strong {
  font-weight: 500;
}

.task-info-overlay {
  inset: 0;
  position: absolute;
  z-index: 80;
}

.task-info-overlay-backdrop {
  background: rgb(0 0 0 / 45%);
  border: 0;
  inset: 0;
  padding: 0;
  position: absolute;
}

.task-info-panel {
  background: #ffffff;
  box-shadow: 0 16px 40px rgb(0 0 0 / 24%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  left: 50%;
  max-height: min(620px, calc(100dvh - 32px));
  max-width: min(520px, calc(100vw - 24px));
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 520px;
}

.task-info-panel header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 16px 18px;
}

.task-info-panel header h2 {
  font-size: 18px;
  margin: 0;
}

.task-info-panel header button {
  background: transparent;
  border: 0;
  color: #68747a;
  font-size: 34px;
  line-height: 1;
}

.task-info-subtitle {
  background: var(--soft);
  margin: 0;
  padding: 10px 12px;
}

.task-dialog-body,
.stock-product-dialog-body {
  display: grid;
  gap: 16px;
  grid-auto-rows: max-content;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px calc(18px + env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
}

.barcode-scanner-dialog {
  max-width: min(620px, calc(100vw - 24px));
  width: 620px;
}

.barcode-scanner-dialog form {
  gap: 12px;
  grid-template-rows: auto auto auto;
  padding-bottom: 16px;
}

.barcode-scanner-view {
  background: #111;
  display: grid;
  margin: 0 16px;
  min-height: min(70vw, 420px);
  overflow: hidden;
  position: relative;
}

.barcode-scanner-view video {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.barcode-scanner-frame {
  border: 2px solid #dce86b;
  inset: 26% 10%;
  pointer-events: none;
  position: absolute;
}

.barcode-scanner-dialog p {
  margin: 0;
  padding: 0 16px;
}

.task-dialog dl {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.task-dialog dl div {
  background: var(--soft);
  padding: 12px;
}

.task-dialog dt {
  color: var(--muted);
  font-size: 12px;
}

.task-dialog dd {
  margin: 4px 0 0;
}

.unknown-product-card,
.line-comment-card,
.line-action-card {
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.unknown-quantity-unit-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 2fr 1fr;
}

.inventory-entry-card {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px;
  position: sticky;
  top: 0;
  z-index: 8;
}

.egais-receiving-dialog {
  border: 0;
  height: 100dvh;
  margin: 0;
  max-height: none;
  max-width: none;
  padding: 0;
  width: 100vw;
}

.egais-receiving-dialog > form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
}

.egais-receiving-dialog > form > header,
.egais-receiving-dialog > form > footer {
  align-items: center;
  background: #424749;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
}

.egais-receiving-dialog > form > header button {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 32px;
}

.egais-receiving-dialog-body {
  background: #eef1f2;
  overflow-y: auto;
  padding: 12px;
}

.mobile-egais-line {
  background: #fff;
  border-left: 6px solid #e0b34f;
  margin-bottom: 8px;
  padding: 12px;
}

.mobile-egais-line.ok { border-left-color: #42a85a; }
.mobile-egais-line > header { align-items: start; display: flex; gap: 12px; justify-content: space-between; }
.mobile-egais-line > small { display: block; overflow: hidden; padding: 4px 0 10px; text-overflow: ellipsis; white-space: nowrap; }
.mobile-egais-mark-row { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr) 48px; }
.mobile-egais-mark-row .button { grid-column: 1 / -1; }
.mobile-egais-confirmed-marks { display: flex; flex-wrap: wrap; gap: 5px; grid-column: 1 / -1; }
.mobile-egais-confirmed-marks > span { align-items: center; background: #dcefdc; display: inline-flex; font-size: 12px; gap: 4px; padding: 4px 6px; }
.mobile-egais-confirmed-marks button { background: transparent; border: 0; font-size: 20px; min-height: 28px; min-width: 28px; padding: 0; }
.mobile-egais-quantity-row { display: grid; gap: 8px; grid-template-columns: minmax(0, 2fr) minmax(110px, 1fr); }
.mobile-egais-mark-row input,
.mobile-egais-quantity-row input { min-height: 48px; min-width: 0; }

.inventory-entry-card h3 {
  font-size: 18px;
  margin: 0;
}

.inventory-entry-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) auto;
  align-items: end;
}

.inventory-entry-grid label,
.product-search-field {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 13px;
  min-width: 0;
}

.inventory-quantity-unit-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 2fr 1fr;
  min-width: 0;
}

.inventory-unit-label-row {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-height: 24px;
}

.inventory-unit-toggle {
  background: #d8e0e3;
  border: 1px solid #b7c4c9;
  border-radius: 999px;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  height: 28px;
  min-width: 116px;
  overflow: hidden;
  padding: 2px;
  position: relative;
  touch-action: pan-y;
}

.inventory-unit-toggle[hidden] {
  display: none;
}

.inventory-unit-toggle::before {
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
  content: "";
  height: calc(100% - 4px);
  left: 2px;
  position: absolute;
  top: 2px;
  transform: translateX(0);
  transition: transform 120ms ease;
  width: calc(50% - 2px);
  z-index: 0;
}

.inventory-unit-toggle[data-mode="packaging"]::before {
  transform: translateX(100%);
}

.inventory-unit-toggle button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: inherit;
  font-size: 11px;
  min-height: 22px;
  padding: 2px 7px;
  position: relative;
  z-index: 1;
}

.inventory-unit-toggle button.active {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.inventory-unit-field {
  display: block;
  position: relative;
}

.packaging-suggestions {
  top: calc(100% + 2px);
}

.inventory-entry-grid input,
.inventory-entry-grid select {
  border: 1px solid var(--line);
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.product-search-field {
  position: relative;
}

.product-suggestions {
  background: #ffffff;
  border: 1px solid #b9c5ca;
  box-shadow: 0 14px 34px rgb(0 0 0 / 18%);
  display: grid;
  left: 0;
  max-height: 260px;
  overflow: auto;
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 18;
}

.product-suggestions button {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #edf0f1;
  display: grid;
  gap: 3px;
  min-height: 48px;
  padding: 7px 10px;
  text-align: left;
}

.product-suggestions button.active,
.product-suggestions button:focus {
  background: #dfeaf0;
  outline: 0;
}

.product-suggestions span {
  color: var(--ink);
  font-size: 14px;
}

.product-suggestions small,
.selected-product,
.counted-lines small {
  color: var(--muted);
}

.unknown-suggestion span {
  color: var(--blue);
}

.selected-product {
  background: var(--soft);
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 10px;
}

.selected-product span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-product-image-button {
  min-height: 34px;
  padding: 6px 12px;
}

.product-image-dialog {
  border: 0;
  box-sizing: border-box;
  height: min(96vh, 900px);
  max-height: 96vh;
  max-width: 96vw;
  overflow: hidden;
  padding: 0;
  width: 96vw;
}

.product-image-dialog::backdrop {
  background: rgb(0 0 0 / 45%);
}

.product-image-dialog form {
  background: #ffffff;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  max-height: 96vh;
  overflow: hidden;
}

.product-image-dialog header {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}

.product-image-dialog header h2 {
  font-size: 18px;
  margin: 0;
}

.product-image-dialog header button {
  background: transparent;
  border: 0;
  font-size: 28px;
}

.product-image-card {
  align-items: center;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 12px;
  position: relative;
}

.product-image-slider {
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  touch-action: pan-y;
}

.product-image-slider img {
  display: block;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}

.product-image-nav {
  background: rgb(255 255 255 / 82%);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 34px;
  height: 52px;
  line-height: 1;
  padding: 0;
  touch-action: manipulation;
  width: 40px;
}

.product-image-nav[hidden] {
  visibility: hidden;
}

.product-image-counter {
  background: rgb(31 37 45 / 70%);
  bottom: 16px;
  color: #ffffff;
  font-size: 13px;
  left: 50%;
  padding: 4px 10px;
  position: absolute;
  transform: translateX(-50%);
}

.task-dialog.inventory-task-preset .inventory-entry-grid {
  grid-template-columns: minmax(150px, 220px) auto;
}

.task-dialog.inventory-task-preset .product-search-field {
  display: none;
}

.counted-lines {
  display: grid;
  gap: 4px;
  max-height: min(44vh, 420px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.counted-lines::-webkit-scrollbar {
  display: none;
}

.counted-line {
  align-items: center;
  border: 0;
  background: #f8fafb;
  color: inherit;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto 12px 30px;
  min-height: 34px;
  overflow: hidden;
  padding: 6px 8px;
  position: relative;
  text-align: left;
  touch-action: pan-y;
  user-select: none;
  width: 100%;
}

.counted-line::before {
  align-items: center;
  background: #dff3df;
  color: #1f5f1f;
  content: '\041A\043E\043C\043C\0435\043D\0442\0430\0440\0438\0439';
  display: flex;
  font-size: 12px;
  font-weight: 700;
  inset: 0 auto 0 0;
  justify-content: center;
  min-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  transition: opacity 120ms ease;
  width: var(--swipe-progress, 0);
  z-index: 2;
}

.counted-line.swiping-comment::before {
  opacity: 1;
}

.counted-line.swiping-delete::before {
  background: #ffdede;
  color: #9f1f1f;
  content: '\0423\0434\0430\043B\0438\0442\044C';
  inset: 0 0 0 auto;
  opacity: 1;
}

.counted-line > * {
  position: relative;
  z-index: 1;
}

.counted-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.counted-line-state {
  border-radius: 50%;
  display: block;
  height: 10px;
  width: 10px;
}

.counted-line-state-accepted,
.counted-line-state-synced {
  background: var(--ok);
}

.counted-line-state-pending {
  background: #d79a24;
}

.counted-line-state-deleted,
.counted-line-state-error {
  background: var(--danger);
}

.counted-line-info-button {
  align-items: center;
  background: transparent;
  border: 1px solid #9aa3a8;
  border-radius: 50%;
  color: #334047;
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  height: 26px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 26px;
}

.counted-line.deleted {
  background: #fff0f0;
  color: #8f3131;
  text-decoration: line-through;
}

.counted-line-comment-link {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.unknown-product-card p {
  color: var(--muted);
  margin: 0;
}

.unknown-product-card label {
  color: var(--muted);
  display: grid;
  gap: 5px;
  font-size: 13px;
}

.unknown-product-card input,
.unknown-product-card select,
.unknown-product-card textarea,
.line-comment-card textarea {
  border: 1px solid var(--line);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.line-comment-card textarea {
  min-height: 132px;
  resize: vertical;
}

.danger-button {
  background: var(--danger);
}

.button {
  background: var(--blue);
  border: 0;
  color: #ffffff;
  min-height: 42px;
  padding: 10px 14px;
}

.portal-toast {
  background: #2f3436;
  bottom: calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 12px 34px rgb(0 0 0 / 24%);
  color: #ffffff;
  left: 50%;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1000;
}

@media (max-width: 720px) {
  .app-header {
    padding: env(safe-area-inset-top) calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left));
  }

  .login-screen {
    justify-content: center;
    padding-right: 18px;
  }

  .task-dialog,
  .stock-product-dialog,
  .barcode-scanner-dialog,
  .unknown-product-dialog,
  .line-comment-dialog,
  .line-action-dialog {
    max-width: calc(100vw - 12px);
    width: calc(100vw - 12px);
  }

  .task-dialog {
    height: 100dvh;
    max-width: 100vw;
    width: 100vw;
  }

  .stock-product-dialog {
    height: 100dvh;
    max-width: 100vw;
    width: 100vw;
  }

  .task-dialog form,
  .stock-product-dialog form,
  .barcode-scanner-dialog form,
  .unknown-product-dialog form,
  .line-comment-dialog form,
  .line-action-dialog form {
    height: 100%;
    max-height: 100%;
  }

  .portal-grid,
  .inventory-entry-grid {
    grid-template-columns: 1fr;
  }

  .task-dialog-body,
  .stock-product-dialog-body {
    padding: 12px;
  }
}
