/* "Tick what you sell" — the opening grid (nesayo-opening-grid.js, 2026-10-14).
   Phone first: each row stacks, its boxes open when it is ticked, every
   control is 44 px tall. From 601 px it is a table. The Save bar sticks to
   the bottom ABOVE any fixed bottom bar (--nesayo-bottom-bar) and keeps the
   help bubble's corner free, so nothing the pharmacist needs is under a bar. */
.og { --og-brand: var(--brand, #1A6B4C); --og-line: var(--border, #E2E8F0); --og-muted: var(--text-2, #64748B);
  text-align: left; font-size: 15px; color: var(--text, #0F172A); }
.og [hidden] { display: none !important; }
.og-head { margin-bottom: 8px; }
.og-label { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  color: var(--og-brand); background: #E8F5EE; border-radius: 999px; padding: 3px 10px; }
.og-help { font-size: 14px; color: var(--og-muted); line-height: 1.45; margin: 8px 0 10px; }
.og-search-label { display: block; font-size: 13px; font-weight: 700; color: var(--og-muted); margin: 0 0 4px; }
.og-search { width: 100%; min-height: 44px; padding: 10px 12px; font-size: 16px; border: 1.5px solid var(--og-line);
  border-radius: 10px; box-sizing: border-box; }
.og-results { display: grid; gap: 6px; margin-top: 6px; }
.og-hit { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 44px; padding: 8px 12px;
  border: 1.5px solid var(--og-line); border-radius: 10px; background: #fff; text-align: left; cursor: pointer; font-size: 15px; }
.og-nohit { font-size: 14px; color: var(--og-muted); margin: 4px 0; }
/* Their own name, when our list does not hold it: a door, not a search answer. */
.og-hit.og-typed { border-style: dashed; border-color: var(--og-brand); background: #F6FBF8; }
.og-hit.og-typed .og-name { color: var(--og-brand); font-weight: 700; }
.og-cat { font-size: 13px; font-weight: 800; color: var(--og-muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .3px; }
.og-loading { font-size: 14px; color: var(--og-muted); }

.og-row { border: 1.5px solid var(--og-line); border-radius: 12px; padding: 4px 10px; margin-bottom: 8px; background: #fff; }
.og-row.on { border-color: var(--og-brand); background: #F6FBF8; }
.og-row.on.needs { border-color: #D97706; }
.og-row.saved { border-color: #BBF7D0; background: #F0FDF4; }
.og-tick { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.og-tickbox { width: 22px; height: 22px; flex: none; accent-color: var(--og-brand); margin: 0; }
.og-words { display: flex; flex-direction: column; min-width: 0; }
.og-name { font-weight: 700; font-size: 15px; overflow-wrap: anywhere; }
.og-pack { font-size: 12.5px; color: var(--og-muted); }
.og-fields { display: none; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 0 8px; }
.og-row.on .og-fields { display: grid; }
.og-f { display: flex; flex-direction: column; min-width: 0; margin: 0; }
.og-f-label { font-size: 12px; font-weight: 700; color: var(--og-muted); margin-bottom: 3px; text-transform: none; letter-spacing: 0; }
.og-in { width: 100%; min-height: 44px; padding: 10px; font-size: 16px; border: 1.5px solid var(--og-line);
  border-radius: 10px; box-sizing: border-box; background: #fff; }
.og-in:disabled { background: #F1F5F9; color: var(--og-muted); }
.og-echo { font-size: 12px; min-height: 15px; margin-top: 2px; }
.og-need { font-size: 13px; color: #B45309; font-weight: 600; line-height: 1.4; }
.og-need:empty { display: none; }
.og-need.ok { color: #166534; }
.og-row:not(.on) .og-need:not(.ok) { display: none; }
.og-row.saved .og-need { display: block; padding: 0 0 6px; }

.og-foot { position: -webkit-sticky; position: sticky; bottom: var(--nesayo-bottom-bar, 0px); z-index: 170;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px -4px 0; padding: 10px 64px 10px 4px;
  background: var(--card, #fff); box-shadow: 0 -6px 12px -8px rgba(0,0,0,.18); }
.og-count { flex: 1 1 140px; font-size: 14px; font-weight: 700; color: var(--og-muted); }
.og-save { flex: 1 1 160px; min-height: 48px; padding: 12px 16px; border: none; border-radius: 10px; background: var(--og-brand);
  color: #fff; font-size: 16px; font-weight: 800; cursor: pointer; }
.og-save:disabled { background: #94A3B8; cursor: default; }
/* After an answer that never came: the one way to edit a shut row. */
.og-change { flex: 0 1 auto; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--og-line); border-radius: 10px;
  background: var(--card, #fff); color: var(--og-brand); font-size: 15px; font-weight: 700; cursor: pointer; }
.og-change[hidden] { display: none; }
.og-row.locked .og-fields { opacity: .7; }
.og-result { margin: 0 0 12px; scroll-margin-top: 12px; padding: 14px; border: 1px solid #BBF7D0; border-radius: 12px; background: #F0FDF4; }
.og-result-line { display: block; color: #166534; font-size: 17px; }
.og-result-left { font-size: 14px; color: #92400E; margin: 6px 0 0; }
.og-bill { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 10px; border-radius: 10px;
  background: var(--og-brand); color: #fff !important; font-weight: 800; font-size: 16px; text-decoration: none; }

/* The unit beside the count, the MRP chip, the already-on-the-shelf question. */
.og-qty-wrap { display: flex; gap: 6px; }
.og-qty-wrap .og-in { flex: 1 1 60px; min-width: 0; }
.og-unit { flex: 0 1 auto; min-height: 44px; padding: 8px 6px; font-size: 15px; border: 1.5px solid var(--og-line);
  border-radius: 10px; background: #fff; }
.og-unit-word { align-self: center; font-size: 14px; color: var(--og-muted); white-space: nowrap; }
.og-chip { margin-top: 6px; min-height: 44px; padding: 6px 10px; border: 1.5px dashed var(--og-brand); border-radius: 10px;
  background: #fff; color: var(--og-brand); font-size: 13.5px; font-weight: 700; cursor: pointer; text-align: left; }
.og-shelf { margin: 2px 0 6px; padding: 8px 10px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FCD34D; }
.og-shelf-line { font-size: 13.5px; font-weight: 700; color: #92400E; }
.og-choices { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.og-choice { flex: 1 1 140px; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--og-line); border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }
.og-choice[aria-pressed="true"] { border-color: var(--og-brand); background: #E8F5EE; color: var(--og-brand); }
.og-hit-shelf { font-size: 12.5px; color: #92400E; font-weight: 600; }
.og-need.err { color: #B91C1C; }
.og-row.skipped { opacity: .7; }
.og-row.skipped .og-fields { display: none; }
.og-more, .og-add-more { display: block; width: 100%; min-height: 44px; margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid var(--og-line); background: #fff; color: var(--og-brand); font-size: 15px; font-weight: 700; cursor: pointer; }
.og-suggestions:empty { display: none; }
.og-suggestions { margin-top: 6px; }

/* The Stock page's door: a full-screen sheet. */
.og-sheet-bg { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,.5); display: none;
  align-items: flex-end; justify-content: center; }
.og-sheet { background: #fff; width: 100%; max-width: 980px; height: 94dvh; max-height: 94vh; border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; box-sizing: border-box; }
.og-sheet-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0; }
.og-sheet-title { font-size: 16px; margin: 0; }
.og-close { min-width: 44px; min-height: 44px; border: none; background: #F1F5F9; border-radius: 10px; font-size: 18px; cursor: pointer; }
.og-sheet-body { flex: 1; overflow-y: auto; padding: 12px 16px 0; }
.og-sheet-body .og-foot { bottom: 0; padding-right: 4px; }

@media (min-width: 601px) {
  /* A table: the medicine on the left, its four boxes in a row, each box
     keeping its own label (the rows are of mixed kinds, so no shared header). */
  .og-row { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(0, 2fr); align-items: start; column-gap: 12px; }
  .og-shelf { grid-column: 1 / -1; }
  .og-fields, .og-row.on .og-fields { display: grid; padding: 6px 0;
    grid-template-columns: minmax(150px, 1.3fr) minmax(110px, 1fr) minmax(110px, 1fr) minmax(110px, 1fr); }
  /* One line per label, so the four boxes sit on one line whatever the
     width (a wrapped "Batch no. (if printed)" pushed its box 16 px down). */
  .og-f-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .og-row:not(.on) .og-fields { opacity: .55; }
  .og-row.skipped .og-fields { display: none; }
  .og-need { grid-column: 1 / -1; padding-bottom: 6px; }
  .og-foot { padding-right: 4px; }
}
