*, *:before, *:after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
body {
  font-family: sans-serif;
  margin: 0;
  padding: 8px;
  background: #f0f0f0;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
/* Caps the app to the CK71's own reported width (480x605) so it doesn't
   stretch into oversized buttons on a wider phone/desktop test browser. */
#mainPage {
  max-width: 480px;
  margin: 0 auto;
}
.box {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}
h1 {
  font-size: 22px;
  font-weight: bold;
  margin: 0 0 12px 0;
}
label {
  display: block;
  margin-top: 12px;
  margin-bottom: 4px;
  font-weight: bold;
  font-size: 16px;
}

/* Big, bold, tap-friendly controls for the CK71's 480x605 touchscreen.
   Scoped under the #app id (rather than plain element selectors) so these
   reliably win over jQuery Mobile's own class-based widget styling
   regardless of how many classes it stacks on the enhanced elements. */
#app input[type=text] {
  display: block;
  width: 100%;
  padding: 14px 12px;
  font-size: 20px;
  border: 2px solid #999;
  border-radius: 6px;
}
#app .scan-wrap input[type=text] {
  padding-right: 46px;
}
/* Also covers the confirm popups' buttons (Remove/Cancel, Clear/Cancel,
   Submit/Cancel) - they used to be small, inline, side-by-side (data-inline)
   with no sizing override at all, which combined with jQM's touch/drag
   disambiguation made them easy to mis-tap on the CK71 (shippingApp-m5l). */
#app button:not(.scan-icon-btn),
#confirmRemovePopup button,
#confirmClearPopup button,
#confirmSubmitPopup button {
  display: block;
  width: 100%;
  margin: 10px 0 0 0;
  padding: 16px 12px;
  font-size: 20px;
  font-weight: bold;
  border-radius: 8px;
}

/* Submit/Clear share this color with their popup-confirmation counterparts
   (same action, just gated behind a confirm tap) so the two never look
   mismatched. */
#app .btn-submit,
#confirmSubmitPopup .btn-submit {
  background: green;
  border-color: green;
  color: #fff;
}
#app .btn-clear,
#confirmClearPopup .btn-clear {
  background: #b00;
  border-color: #b00;
  color: #fff;
}

/* Targets the actual clickable element jQuery Mobile builds for the
   collapsible heading (an <a class="ui-btn ui-collapsible-heading-toggle">
   nested inside #tagsHeading), matching the same big/bold sizing as the
   rest of the app's buttons/inputs rather than trusting jQM's stock size.
   Deliberately does NOT set padding-left: jQM's own .ui-btn-icon-left rule
   sets padding-left: 2.5em to reserve room for the expand/collapse icon
   (an absolutely-positioned ::after at left:.5625em) - overriding it with a
   flat px value here previously squeezed the icon and the tag count text
   on top of each other (shippingApp-m8s). Leaving padding-left alone lets
   it scale with our own font-size instead (2.5em now resolves against our
   20px, not jQM's smaller default, so there's still plenty of room). */
#tagsHeading .ui-collapsible-heading-toggle {
  font-size: 20px;
  font-weight: bold;
  padding-top: 16px;
  padding-bottom: 16px;
  padding-right: 12px;
}

#tagList li {
  cursor: pointer;
  font-size: 18px;
  padding: 16px 16px 16px 20px;
}
.scan-wrap {
  position: relative;
}
/* Fixed, small, explicitly centered box - it used to stretch its height to
   match the input (top:3px;bottom:3px), which grew substantially taller
   once the input got the bold 20px/14px-padding treatment, and had no
   overflow:hidden to guarantee the glyph itself couldn't render bigger than
   its box (shippingApp-1t8). Phone-only (never the CK71), so flexbox
   centering and transform here are safe. */
.scan-icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  overflow: hidden;
  display: -webkit-flex;
  display: flex;
  -webkit-align-items: center;
  align-items: center;
  -webkit-justify-content: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
}
.scan-icon-btn svg {
  display: block;
  width: 24px;
  height: 24px;
}
.scan-icon-btn svg rect {
  fill: #333;
}
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
}
.modal-inner {
  padding: 10px;
  text-align: center;
}
#scanVideo {
  width: 100%;
  max-width: 500px;
  background: #000;
}
#app.online {
  border-left: 5px solid #39ff14;
}
#app.offline {
  border-left: 5px solid red;
}

/* Fixed corner satellite icon - separate from the #app border above, this
   one stays put over everything (including the diagnostics table further
   down the page) rather than scrolling out of view. Above .modal's z-index
   so it's still visible during the (phone-only) camera overlay too.
   "right" is just a fallback for before app.js's positionNetStatusIcon()
   overwrites it with the real offset from #mainPage's rendered edge. */
#netStatusIcon {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 1100;
  width: 36px;
  height: 36px;
  padding: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
#netStatusIcon svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Direct fill on the shapes rather than the CSS currentColor keyword -
   fewer moving parts to trust on an unverifiable ~2012-era WebKit target. */
#netStatusIcon.online rect,
#netStatusIcon.online circle {
  fill: #39ff14;
}
#netStatusIcon.offline rect,
#netStatusIcon.offline circle {
  fill: #b00;
}
#status {
  font-weight: bold;
  font-size: 16px;
}

/* Two-column layout (BOL Demo pane | Diagnostics pane) for wide-enough
   screens - #columns/#col-demo/#col-diagnostics have no rules outside this
   media query, so on the CK71 (480px) or any phone they're just plain
   block-level divs, identical to the single stacked column that existed
   before this wrapping was introduced (shippingApp-adb). Gated on a min-width
   comfortably past two ~480px-scale columns side by side, well beyond
   anything the CK71/phones will ever report, so this can safely use flexbox
   without an ancient-WebKit compatibility concern. */
@media (min-width: 900px) {
  #mainPage {
    max-width: 1000px;
  }
  #columns {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    gap: 16px;
  }
  #col-demo,
  #col-diagnostics {
    -webkit-flex: 1 1 0;
    flex: 1 1 0;
    min-width: 0;
  }
}
