/* Register workspace proportions and card treatment follow the desktop cash register. */
body {
  background: #f1f6f3;
}
body > .top {
  min-height: 54px;
  padding: 8px 12px;
  border-bottom: 1px solid #d2ded9;
  background: #f9fbfa;
  color: #233530;
}
body > .top .brand b { font-size: 1.15rem; letter-spacing: .04em; }
body > .top .brand b span { color: #257256; }
body > .top .brand small { color: #496358; }
body > .top #account-link { color: #195b48; }

#workspace {
  max-width: none;
  gap: 8px;
  padding: 8px;
  align-items: start;
}
#workspace .panel { border-radius: 8px; box-shadow: none; background: #fafcfb; }
#workspace .section-title {
  background: #e3ece8;
  color: #243d31;
  min-height: 37px;
  padding: 6px 9px;
}
#workspace .section-title small { display: none; }
#workspace .section-title :is(h1,h2) { font-size: .93rem; margin: 0; }
#workspace .section-title p { color: #496358; }
#workspace button { border-radius: 7px; }
#workspace #keypad .digit { border-radius: 50%; }
#workspace .tabs, #workspace .package-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
}
#workspace .tabs button, #workspace .package-actions button {
  flex: 1 1 auto;
  font-size: .76rem;
  padding: 6px;
}
#workspace #packages {
  display: grid;
  grid-auto-rows: max-content;
  gap: 6px;
  padding: 0 6px 6px;
  max-height: calc(100vh - 145px);
  overflow: auto;
}
#workspace #packages .place {
  align-content: center;
  background: #fff;
  color: #243d31;
  border: 1px solid #d2ded9;
  text-shadow: none;
}
#workspace #packages .selected, #workspace .place.selected {
  outline-color: #2d72af;
  background-color: #e7f1fd;
}
#workspace .place.table {
  min-height: 103px;
  padding: 67px 3px 5px;
  background-size: auto 61px;
  border-color: #d2ded9;
  background-color: #fafcfb;
  font-size: .78rem;
}
#workspace .place.table.occupied { background-color: #fff6ec; }
#workspace #categories {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 5px;
  padding: 6px;
  max-height: 90px;
  overflow: auto;
  align-content: start;
}
#workspace #categories button {
  height: 78px;
  min-height: 0;
  grid-template-rows: 43px 23px;
  gap: 1px;
  padding: 4px;
  color: #243d31;
  background: #fff;
  border: 1px solid #dbe3db;
}
#workspace #categories button.active {
  border-color: #257256;
  box-shadow: inset 0 0 0 1px #257256;
  background: #f6faf7;
}
#workspace #categories img {
  max-width: 100%;
  width: 44px;
  height: 43px;
  object-fit: contain;
}
#workspace #categories .catalog-title { font-size: .76rem; line-height: 1.14; }
#workspace .catalog-body { display: block; padding: 0 6px; }
#workspace #products {
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 5px;
  max-height: clamp(150px, 31vh, 420px);
}
#workspace .product-card .product {
  height: 122px;
  grid-template-rows: 64px 30px 16px;
  padding: 4px;
  border: 1px solid #dbe3db;
  color: #243d31;
}
#workspace .product-photo { height: 64px; }
#workspace .catalog .option-label { margin: 6px; font-size: .74rem; }
#workspace .bill { display: flex; flex-direction: column; }
#workspace .bill .actions {
  order: 0;
  gap: 4px;
  grid-template-columns: repeat(auto-fit,minmax(76px,1fr));
  padding: 6px;
}
#workspace .bill .actions button { min-height: 36px; font-size: .74rem; }
#workspace .bill-body {
  order: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}
#workspace .order-scroll { min-height: 132px; max-height: 34vh; }
#workspace th, #workspace td { padding: .42rem .36rem; }
#workspace .total {
  order: 3;
  padding: 6px 9px;
  background: #edf4ef;
}
#workspace #note-text { order: 2; }
#workspace #bill-quantity { width: 58px; padding: 5px; }
#workspace #bill-quantity:empty { display: none; }
#workspace #qty-panel .digit { width: 29px; height: 29px; }
#workspace #keypad { gap: 3px; }
#workspace #mobile-tables { display: none; }

@media (min-width: 641px) {
  #workspace {
    grid-template-columns: minmax(170px, 1fr) minmax(410px, 1fr) minmax(170px, 1fr);
    grid-template-areas: "tables catalog packages" "tables bill packages";
    grid-template-rows: auto 1fr;
    max-width: 1920px;
  }
  #workspace .places { grid-area: tables; }
  #workspace .catalog { grid-area: catalog; }
  #workspace .bill { grid-area: bill; }
  #workspace .packages { grid-area: packages; }
  #workspace #places {
    grid-template-columns: repeat(auto-fill,minmax(95px,1fr));
    max-height: calc(100vh - 138px);
    padding: 0 6px;
    gap: 6px;
  }
  #workspace #package-tab { display: none; }
}
@media (min-width: 641px) and (max-width: 940px) {
  #workspace {
    grid-template-columns: minmax(165px, 28%) minmax(0, 1fr);
    grid-template-areas: "tables catalog" "packages bill";
  }
  #workspace #places, #workspace #packages { max-height: 46vh; }
}
@media (max-width: 640px) {
  #workspace { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  #workspace[data-mobile-view="catalog"]:has(#catalog-start-order:not(:empty)) {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  #workspace[data-mobile-view="places"][data-place-kind="package"] > .places { display: none; }
  #workspace[data-mobile-view="places"][data-place-kind="package"] > .packages { display: block; }
  #workspace[data-mobile-view="places"][data-place-kind="table"] > .packages { display: none; }
  #workspace #mobile-tables { display: inline-block; }
  #workspace #categories {
    grid-template-columns: repeat(auto-fit,minmax(70px,1fr));
    max-height: 154px;
  }
  #workspace #packages { max-height: none; }
  #workspace .catalog-body { display: flex; }
  #workspace #products { grid-template-columns: repeat(auto-fill,minmax(96px,1fr)); max-height: none; }
  #workspace .bill-body { display: block; }
  #workspace #bill-quantity { width: auto; }
  #workspace .order-scroll { max-height: none; }
  #workspace .bill .actions button { min-height: 44px; }
  #workspace #qty-panel .digit { width: 40px; height: 40px; }
}

#workspace .bill .actions button {
  --action-ink: #214f96;
  --action-edge: #d9e8ff;
  color: var(--action-ink);
  border-color: var(--action-edge);
  background: linear-gradient(#fff,#f8fafc);
  min-width: 0;
}
#workspace .bill .actions button:hover:not(:disabled) {
  background: linear-gradient(#fff,var(--action-edge));
  border-color: var(--action-ink);
}
#workspace .bill .actions #remove { --action-ink: #963137; --action-edge: #ffe0e1; }
#workspace .bill .actions #edit-options { --action-ink: #7d4d11; --action-edge: #ffebc0; }
#workspace .bill .actions :is(#start-order, #print-order) { --action-ink: #116753; --action-edge: #d3f0e3; }
#workspace .bill .actions :is(#start-order, #print-order).start-pending { --action-ink: #773f07; --action-edge: #ffda85; }
#workspace .bill .actions #note:enabled { color: #fff; background: linear-gradient(#157cea,#1152b7); border-color: #66b3f9; }

@media (min-width: 941px) {
  #workspace .bill .actions { grid-template-columns: repeat(6,minmax(0,1fr)); }
  #workspace .bill .actions button { min-height: 40px; }
  #workspace #products { grid-template-columns: repeat(auto-fill,minmax(104px,128px)); justify-content: start; }
  #workspace .product-card .product { height: 96px; grid-template-rows: 42px 25px 17px; }
  #workspace .product-card .product-photo { height: 42px; object-fit: contain; }
  #workspace .product-card.has-photo .product { height: 148px; grid-template-rows: 92px 30px 17px; }
  #workspace .product-card.has-photo .product-photo { height: 92px; }
}
@media (min-width: 941px) {
  #workspace #bill-quantity { background: #e0edfb; }
  #workspace #qty-panel label { gap: 3px; }
  #workspace #qty-panel input { min-height: 28px; }
  #workspace #qty-panel .digit { width: 23px; height: 23px; font-size: .72rem; }
  #workspace #keypad { padding: 4px 0; gap: 2px; }
  #workspace #keypad .quantity-apply { min-height: 26px; font-size: .72rem; }
}
