:root {
  color-scheme: light;
  --ink: #1e2c23;
  --green: #204631;
  --deep: #173927;
  --soft: #e8efe7;
  --paper: #faf9f4;
  --line: #dbe0d6;
  --muted: #546359;
  --amber: #81511c;
  --radius: 14px;
  font-family: Tahoma, Arial, sans-serif;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  border: 0;
  border-radius: 11px;
  padding: 8px 12px;
  min-height: 44px;
}
button:disabled {
  cursor: default;
  opacity: 0.55;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid #6b8a42;
  outline-offset: 2px;
}
input:not([type="checkbox"]),
select {
  width: 100%;
  min-height: 46px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  padding: 9px 11px;
  font-size: 16px;
}
input[type="tel"] {
  letter-spacing: 1px;
}
label {
  font-weight: bold;
  display: block;
  margin-bottom: 5px;
}
label small,
small,
.muted {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: normal;
}
.wrap {
  width: min(100% - 28px, 640px);
  margin-inline: auto;
}
.top {
  background: var(--green);
  color: #fff;
  padding: 10px 0;
}
.heading,
.brand,
.status,
.label-row,
.actions,
.checkout-inner,
dialog header,
.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.brand b {
  display: block;
  font-size: 1.12rem;
}
.brand small {
  display: block;
  color: #e1ebdb;
}
.light {
  background: #f3f5ed;
  color: var(--deep);
  font-weight: bold;
}
#pending-badge {
  background: #e9d9ad;
  padding: 1px 6px;
  border-radius: 20px;
}
.status {
  font-size: 0.81rem;
  color: var(--muted);
  min-height: 44px;
}
.link {
  background: transparent;
  color: var(--deep);
  text-decoration: underline;
  padding-inline: 4px;
}
.notice {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--soft);
  margin: 0 0 10px;
  overflow-wrap: anywhere;
}
.notice.error {
  background: #f8ebd3;
  color: #694111;
}
.customer {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: var(--radius);
  padding: 6px 12px 12px;
}
.customer label {
  margin: 0;
}
#name-row {
  margin-top: 9px;
}
.section-title {
  margin: 12px 0 7px;
}
h1,
h2,
h3 {
  font-size: 1.08rem;
  margin: 0;
}
.primary {
  background: var(--green);
  color: #fff;
  font-weight: bold;
}
.secondary,
.close {
  background: var(--soft);
  color: var(--deep);
  font-weight: bold;
}
.chips {
  display: flex;
  gap: 6px;
  overflow: auto;
  margin: 9px 0;
  scrollbar-width: thin;
}
.chips button {
  white-space: nowrap;
  min-height: 40px;
  background: #eeefe8;
  color: var(--ink);
}
.chips button[aria-pressed="true"] {
  background: var(--green);
  color: #fff;
}
.products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-bottom: calc(101px + env(safe-area-inset-bottom));
}
.products > p {
  grid-column: 1/-1;
}
.product {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.product.selected {
  border-color: #78926e;
  background: #f2f7ef;
}
.tile {
  flex: 1;
  background: transparent;
  text-align: start;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: space-between;
  min-height: 94px;
  padding: 9px;
  color: var(--ink);
  border-radius: 0;
}
.tile-name {
  font-weight: bold;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}
.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  color: var(--green);
  font-size: 0.81rem;
  width: 100%;
}
.add-mark {
  flex: none;
  background: var(--soft);
  border-radius: 8px;
  min-width: 27px;
  text-align: center;
  padding: 3px;
  font-size: 1rem;
  font-weight: bold;
}
.adjust {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 0 4px;
}
.adjust button {
  width: 44px;
  min-height: 42px;
  background: transparent;
  color: var(--deep);
  font-size: 1.2rem;
  font-weight: bold;
}
.checkout {
  position: fixed;
  inset: auto 0 0;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 9px 0 calc(9px + env(safe-area-inset-bottom));
  z-index: 2;
}
.checkout-inner {
  gap: 15px;
}
.checkout .primary {
  flex: 1;
  min-height: 52px;
  font-size: 1rem;
}
.total {
  background: transparent;
  text-align: start;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  padding: 3px 0;
  min-width: 108px;
}
.total strong {
  font-size: 1.14rem;
}
dialog {
  width: min(100% - 24px, 580px);
  max-height: 90vh;
  max-height: 90dvh;
  overflow: auto;
  padding: 15px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #16291e99;
}
dialog header {
  margin-bottom: 12px;
}
dialog form label:not(:first-child) {
  margin-top: 9px;
}
dialog form > .primary,
dialog select {
  margin-top: 8px;
}
dialog .actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}
#barcode-form .actions {
  flex-wrap: nowrap;
}
#barcode-form input {
  min-width: 0;
}
.lines {
  display: grid;
  gap: 7px;
}
.line,
details.invoice {
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
  border-radius: 10px;
}
.line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.line .adjust {
  border: 0;
}
details.invoice summary {
  cursor: pointer;
  min-height: 44px;
  padding: 7px 0;
}
.details-body {
  padding: 7px 0;
  overflow-wrap: anywhere;
}
.details-body p {
  margin: 4px 0;
}
.settings-catalog {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 10px;
}
#product-form {
  margin-top: 9px;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.check input {
  width: 19px;
  height: 19px;
}
video {
  display: block;
  width: 100%;
  max-height: 48vh;
  background: #222;
  object-fit: contain;
  margin-top: 10px;
  border-radius: 10px;
}
@media (min-width: 560px) {
  .products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 350px) {
  .wrap {
    width: calc(100% - 18px);
  }
  .tile-meta {
    font-size: 0.73rem;
  }
  .tile {
    padding: 7px;
  }
}
