#receipt:has(> .android-receipt-body) {
  width: 100%;
  max-width: none;
  padding: 0;
  background: transparent;
}

.android-receipt-body {
  --paper: 80mm;
  /* Android uses 544 printable dots at about 8 dots/mm inside an 80mm roll. */
  --paper-inset: 6mm;
  --rule: 1px solid #000;
  --print-row: 27px;
  --print-meta: 23px;
  --print-gap: 8px;
  --print-type: 14px;
  --print-heading: 33px;
  --urdu-font: "Jameel Noori Nastaleeq", "Noto Nastaliq Urdu", "Geeza Pro", Arial, sans-serif;
  width: min(100%, var(--paper));
  margin: 0 auto;
  padding: 3mm var(--paper-inset) 4mm;
  background: #fff;
  color: #000;
  font: 400 var(--print-type)/1.28 Roboto, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.android-receipt-body.android-receipt-58 {
  --paper: 58mm;
  /* Android uses 360 printable dots inside the 58mm roll. */
  --paper-inset: 6.5mm;
  --print-row: 20px;
  --print-meta: 17px;
  --print-gap: 6px;
  --print-type: 11px;
  --print-heading: 24px;
}

.android-receipt-body [lang="ur"] { font-family: var(--urdu-font); }
.android-receipt-mini { padding-top: 2mm; }
.android-receipt-shop { text-align: center; border-bottom: var(--rule); padding-bottom: var(--print-gap); }
.android-receipt-shop h3 {
  margin: 0 0 2px;
  font-size: var(--print-heading);
  line-height: 1.28;
  white-space: pre-line;
}
.android-receipt-shop-details { display: flex; justify-content: center; align-items: baseline; }
.android-receipt-shop-details > span { flex: 0 1 44%; padding: 2px 3px; }
.android-receipt-shop-details > span:only-child { flex-basis: auto; }
.android-receipt-address { padding: 2px 0; }

.android-receipt-identity, .android-receipt-customer {
  display: grid;
  align-items: center;
  min-height: var(--print-meta);
  padding: 2px 3px;
}
.android-receipt-identity { grid-template-columns: 1fr auto 1fr; border-bottom: var(--rule); gap: 5px; }
.android-receipt-mini .android-receipt-identity { border-top: var(--rule); }
.android-receipt-customer { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
.android-receipt-meta time { justify-self: end; white-space: nowrap; }

.android-receipt-grid {
  table-layout: fixed;
  width: 100%;
  margin: var(--print-gap) 0 0;
  border-collapse: collapse;
  color: #000;
  font-size: inherit;
  text-align: center;
}
.android-receipt-grid th, .android-receipt-grid td {
  height: var(--print-row);
  border: var(--rule);
  padding: 2px 1px;
  color: #000;
  background: #fff;
  font-weight: inherit;
  vertical-align: middle;
}
.android-receipt-grid .android-receipt-emphasized { font-weight: 700; }
.android-receipt-weights .android-column-grams { width: 23%; }
.android-receipt-weights .android-column-tola { width: 16%; }
.android-receipt-weights .android-column-subunit { width: 15%; }
.android-receipt-weights .android-column-ratti { width: 16%; }
.android-receipt-weights .android-column-description { width: 30%; }
.android-receipt-financials td { height: calc(var(--print-row) + 4px); font-size: 1.14em; }
.android-receipt-financials td:first-child { font-size: 1.33em; }
.android-receipt-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-height: var(--print-row);
  border-block: var(--rule);
  margin-top: var(--print-gap);
  padding: 2px 4px;
}

.android-record-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.55fr) minmax(0, 1.55fr) minmax(0, 2.1fr) minmax(35px, .8fr) minmax(35px, .8fr);
  align-items: center;
  width: 100%;
  padding-inline: 4px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.android-record-header {
  min-height: 48px;
  padding-block: 7px;
  background: #004d54;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  white-space: pre-line;
}
#history-list:has(> .android-record-row) { margin: 0; }
#history-list > .android-record-row {
  min-height: 47px;
  border: 0;
  background: #e8f5e9;
  color: #182323;
  font-size: clamp(11px, 3.1vw, 14px);
}
#history-list > .android-record-row:nth-child(even) { background: #e0f7fa; }
.android-record-row > time, .android-record-number { font-size: .85em; }
.android-record-number { font-weight: 650; }
#history-list .android-record-action {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  color: #00666e;
  background: transparent;
}
#history-list .android-record-delete { color: #ba1a1a; }
#history-list .android-record-action .android-record-icon { color: inherit; position: relative; }
.android-record-view .android-record-icon {
  width: 16px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 80% 15% 80% 15%;
  transform: rotate(45deg);
}
.android-record-view .android-record-icon::before {
  position: absolute;
  inset: 1px;
  width: 5px;
  height: 5px;
  margin: auto;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.android-record-delete .android-record-icon {
  width: 10px;
  height: 12px;
  margin-top: 3px;
  border-radius: 0 0 2px 2px;
  background: currentColor;
}
.android-record-delete .android-record-icon::before, .android-record-delete .android-record-icon::after {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: currentColor;
  content: "";
}
.android-record-delete .android-record-icon::before { top: -3px; width: 14px; height: 2px; }
.android-record-delete .android-record-icon::after { top: -5px; width: 5px; height: 2px; }

@media print {
  .android-receipt-body { width: var(--paper); print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .android-receipt-grid, .android-receipt-footer { break-inside: avoid; }
}
