/* GOODS IN — its own stylesheet, and that is deliberate twice over.

   styles.css is 888 lines of desktop-first with mobile patched in at five
   breakpoints. This section is the other way round: it is a phone held in one
   hand in a yard, and the desktop view is the accommodation. Writing that as
   more overrides on top of the existing sheet would have meant fighting it.

   It also keeps this feature out of a file other people are editing today.

   Variables come from styles.css where it is loaded (the hub tab) and are
   defined as fallbacks in yard.html where it is not. */

.gi-wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 60px; }

.gi-head { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.gi-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.02em; }
.gi-head-sub { color: var(--ink-3, #6b7a83); font-size: 13.5px; margin-top: 2px; }

.gi-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--ink-3, #6b7a83); margin: 22px 0 8px; font-weight: 700;
  display: flex; align-items: center; gap: 8px; }
.gi-h span { background: var(--sunk, #e8edf0); color: var(--ink-2, #46545c);
  border-radius: 999px; padding: 1px 8px; font-size: 11px; letter-spacing: 0; }
.gi-h.late { color: var(--red, #c8442f); }
.gi-h.late span { background: rgba(200, 68, 47, 0.12); color: var(--red, #c8442f); }

.gi-list { display: flex; flex-direction: column; gap: 8px; }

/* A TILE IS NOT A BUTTON THAT DOES SOMETHING IRREVERSIBLE. On 06/08 Adam
   completed six board items in seventy seconds because the tile he tapped to
   READ was itself the done button. Opening is all this does; every write is
   behind its own labelled control on the next screen. */
.gi-tile, .gi-reg {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--card, #fff); border: 1px solid var(--line, #dde4e8);
  border-radius: 14px; padding: 14px; font: inherit; color: inherit;
  cursor: pointer; min-height: 64px;
}
.gi-tile:active, .gi-reg:active { transform: scale(0.995); }
.gi-tile.is-late { border-color: rgba(200, 68, 47, 0.45);
  background: linear-gradient(0deg, rgba(200,68,47,0.04), rgba(200,68,47,0.04)), var(--card, #fff); }
.gi-tile-main { flex: 1; min-width: 0; }
.gi-desc { font-weight: 620; font-size: 15.5px; line-height: 1.3;
  overflow-wrap: anywhere; }
.gi-desc.big { font-size: 19px; line-height: 1.28; }
.gi-sub { color: var(--ink-3, #6b7a83); font-size: 13px; margin-top: 3px;
  overflow-wrap: anywhere; }
.gi-when { font-size: 13px; font-weight: 620; color: var(--ink-2, #46545c);
  white-space: nowrap; text-align: right; }
.gi-when.is-late { color: var(--red, #c8442f); }
.gi-claim { display: inline-block; margin-top: 6px; font-size: 11.5px;
  background: var(--sunk, #e8edf0); color: var(--ink-3, #6b7a83);
  border-radius: 6px; padding: 2px 7px; }

/* the register */
.gi-reg .gi-mark { width: 26px; height: 26px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.gi-reg.good .gi-mark { background: rgba(46, 172, 102, 0.14); color: #1f8a4c; }
.gi-reg.bad .gi-mark { background: rgba(200, 68, 47, 0.13); color: var(--red, #c8442f); }
.gi-reg.absent .gi-mark { background: var(--sunk, #e8edf0); color: var(--ink-3, #6b7a83); }
.gi-reg-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gi-thumbs { font-size: 12px; color: var(--ink-3, #6b7a83); white-space: nowrap; }

.gi-empty, .gi-warn { border-radius: 14px; padding: 18px; font-size: 14.5px;
  line-height: 1.45; }
.gi-empty { background: var(--sunk, #e8edf0); color: var(--ink-3, #6b7a83);
  text-align: center; }
.gi-warn { background: rgba(200, 68, 47, 0.09); color: var(--red, #c8442f);
  border: 1px solid rgba(200, 68, 47, 0.3); margin-bottom: 14px; }
.gi-lead { color: var(--ink-2, #46545c); font-size: 14.5px; line-height: 1.5;
  margin: 0 0 4px; }

/* ------------------------------------------------------------ one delivery */
.gi-back { background: none; border: 0; font: inherit; color: var(--ink-3, #6b7a83);
  padding: 8px 0; margin-bottom: 6px; cursor: pointer; font-size: 14.5px; }
.gi-card { background: var(--card, #fff); border: 1px solid var(--line, #dde4e8);
  border-radius: 14px; padding: 16px; margin-bottom: 4px; }
.gi-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px;
  font-size: 13.5px; color: var(--ink-2, #46545c); }
.gi-meta b { color: var(--ink-3, #6b7a83); font-weight: 600; margin-right: 4px; }

/* The courier's claim, stated as a claim. This wording is the feature in one
   sentence: their "delivered" and ours are different facts. */
.gi-claim-note { margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--sunk, #e8edf0); color: var(--ink-2, #46545c);
  font-size: 13px; line-height: 1.45; }

.gi-done-banner { margin: 12px 0 4px; border-radius: 12px; padding: 13px 15px;
  font-weight: 680; font-size: 15px; display: flex; flex-direction: column; gap: 3px; }
.gi-done-banner span { font-weight: 400; font-size: 12.5px; opacity: 0.8; }
.gi-done-banner.good { background: rgba(46, 172, 102, 0.13); color: #1a7742; }
.gi-done-banner.bad { background: rgba(200, 68, 47, 0.11); color: var(--red, #c8442f); }
.gi-note-shown { background: var(--sunk, #e8edf0); border-radius: 10px;
  padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-bottom: 4px;
  white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- photos
   THE BIGGEST THING ON THE SCREEN, because it is the job. Two squares side by
   side, thumb-reachable, and they read as empty slots that want filling. */
.gi-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin: 14px 0 4px; }
.gi-photo { position: relative; aspect-ratio: 3 / 4; border-radius: 14px;
  border: 2px dashed var(--line, #dde4e8); background: var(--sunk, #e8edf0);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; cursor: pointer; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.gi-photo.has { border-style: solid; border-color: var(--line, #dde4e8); }
.gi-photo.locked { cursor: default; }
.gi-photo img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.gi-photo-icon { font-size: 30px; line-height: 1; }
.gi-photo-label { font-weight: 700; font-size: 15px; }
.gi-photo-hint { font-size: 12px; color: var(--ink-3, #6b7a83); }
.gi-photo-state { position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(0, 0, 0, 0.66); color: #fff; font-size: 11.5px;
  padding: 3px 8px; border-radius: 999px; }
.gi-photo-state.up { background: rgba(0, 0, 0, 0.78); }

/* -------------------------------------------------------------- condition */
.gi-conds { display: grid; gap: 8px; }
.gi-cond { text-align: left; background: var(--card, #fff);
  border: 1.5px solid var(--line, #dde4e8); border-radius: 12px; padding: 13px 15px;
  font: inherit; color: inherit; cursor: pointer; display: flex;
  flex-direction: column; gap: 2px; min-height: 58px; }
.gi-cond b { font-size: 15px; font-weight: 650; }
.gi-cond span { font-size: 12.5px; color: var(--ink-3, #6b7a83); }
.gi-cond.on { border-color: var(--accent, #2eac66); background: rgba(46, 172, 102, 0.07); }
.gi-cond.on b { color: #1a7742; }

.gi-field { display: block; margin: 14px 0; }
.gi-field > span { display: block; font-size: 13px; font-weight: 620;
  margin-bottom: 6px; color: var(--ink-2, #46545c); }
.gi-field em { font-style: normal; font-weight: 400; color: var(--ink-3, #6b7a83); }
.gi-field input, .gi-field textarea {
  width: 100%; border: 1px solid var(--line, #dde4e8); border-radius: 11px;
  padding: 13px 14px; font: inherit; background: var(--card, #fff); color: inherit;
  /* 16px: anything smaller and iOS Safari zooms the page on focus, which on a
     one-handed form is enough to lose your place entirely. */
  font-size: 16px; resize: vertical;
}
.gi-field input:focus, .gi-field textarea:focus {
  outline: 2px solid var(--accent, #2eac66); outline-offset: -1px; border-color: transparent; }

/* ---------------------------------------------------------------- buttons */
.gi-btn { border-radius: 12px; padding: 12px 16px; font: inherit; font-weight: 620;
  font-size: 15px; cursor: pointer; border: 1px solid var(--line, #dde4e8);
  background: var(--card, #fff); color: inherit; }
.gi-btn.primary { background: var(--accent, #2eac66); border-color: var(--accent, #2eac66);
  color: #fff; }
.gi-btn.primary:disabled { background: var(--sunk, #e8edf0); color: var(--ink-3, #6b7a83);
  border-color: var(--line, #dde4e8); cursor: not-allowed; }
.gi-btn.big { width: 100%; padding: 17px; font-size: 16.5px; margin-top: 16px;
  border-radius: 14px; }
.gi-btn.ghost { background: none; }
.gi-one .gi-btn.ghost { width: 100%; margin-top: 9px; padding: 14px; }
.gi-gate { text-align: center; font-size: 13px; color: var(--ink-3, #6b7a83);
  margin-top: 9px; min-height: 18px; }

/* The route to Goods in from the sign-in page. Lives here rather than in
   styles.css so the whole feature, including the way in, stays in one file. */
.signin-yard { display: flex; align-items: center; gap: 12px; margin-top: 18px;
  padding: 13px 14px; border-radius: 12px; text-decoration: none; color: inherit;
  border: 1px solid var(--line, #dde4e8); background: var(--sunk, #e8edf0); }
.signin-yard b { display: block; font-size: 14.5px; font-weight: 650; }
.signin-yard em { display: block; font-style: normal; font-size: 12.5px;
  color: var(--ink-3, #6b7a83); margin-top: 1px; }
.signin-yard .ic { font-size: 18px; color: var(--accent, #2eac66); }
.signin-yard .chev { margin-left: auto; color: var(--ink-3, #6b7a83); font-size: 19px; }

/* ------------------------------------------------- a phone is asking
   Loud on purpose. Somebody is standing in a yard holding a phone that does
   not work yet, and the cost of this being missed is a person waiting. */
.gi-ask-banner { display: flex; align-items: center; gap: 13px; width: 100%;
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  border: 1px solid rgba(46, 172, 102, 0.45); border-radius: 14px;
  background: rgba(46, 172, 102, 0.09); padding: 14px 15px; margin-bottom: 14px; }
.gi-ask-banner b { display: block; font-size: 15px; font-weight: 650; }
.gi-ask-banner em { display: block; font-style: normal; font-size: 12.5px;
  color: var(--ink-3, #6b7a83); margin-top: 2px; }
.gi-ask-banner .chev { margin-left: auto; font-size: 20px; color: var(--ink-3, #6b7a83); }
.gi-ask-n { flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent, #2eac66); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 16px; }

.gi-asks { display: flex; flex-direction: column; gap: 8px; }
.gi-ask { display: flex; align-items: center; gap: 10px; padding: 13px 14px;
  border: 1px solid rgba(46, 172, 102, 0.4); border-radius: 12px;
  background: rgba(46, 172, 102, 0.06); flex-wrap: wrap; }
.gi-lead.small { font-size: 13px; margin-top: 8px; }

/* ------------------------------------------------------------ yard phones */
.gi-head-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.gi-devs { display: flex; flex-direction: column; gap: 8px; }
.gi-dev { display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  background: var(--card, #fff); border: 1px solid var(--line, #dde4e8);
  border-radius: 12px; }
.gi-dev.is-off { opacity: 0.6; }
.gi-dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gi-dev-state { font-size: 11.5px; border-radius: 999px; padding: 3px 9px;
  white-space: nowrap; }
.gi-dev-state.on { background: rgba(46, 172, 102, 0.14); color: #1a7742; }
.gi-dev-state.pending { background: rgba(214, 158, 46, 0.16); color: #8a6100; }
.gi-dev-state.off { background: var(--sunk, #e8edf0); color: var(--ink-3, #6b7a83); }
.gi-btn.small { padding: 7px 12px; font-size: 13px; border-radius: 9px; }

.gi-qr-card { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap;
  background: var(--card, #fff); border: 1px solid var(--line, #dde4e8);
  border-radius: 14px; padding: 16px; margin-top: 14px; }
.gi-qr-img { flex: none; line-height: 0; background: #fff; border-radius: 10px;
  padding: 8px; }
.gi-qr-img svg { display: block; }
.gi-qr-side { flex: 1; min-width: 200px; }
.gi-qr-side p { margin: 6px 0 10px; font-size: 13.5px; color: var(--ink-2, #46545c);
  line-height: 1.45; }
/* Big, spaced and selectable: this gets read aloud across a yard. */
.gi-qr-code { font-size: 26px; font-weight: 700; letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums; background: var(--sunk, #e8edf0);
  border-radius: 10px; padding: 10px 14px; text-align: center;
  user-select: all; margin-bottom: 8px; }

/* ------------------------------------------------------------------ toast */
#gi-toast { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 90;
  background: #16232a; color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 550; box-shadow: 0 8px 26px rgba(0, 0, 0, 0.26);
  max-width: 90vw; text-align: center; }
#gi-toast.bad { background: var(--red, #c8442f); }

/* ------------------------------------------------------------------ phone */
@media (max-width: 560px) {
  .gi-wrap { padding: 12px 12px calc(46px + env(safe-area-inset-bottom)); }
  .gi-head h2 { font-size: 20px; }
  .gi-head #gi-manual { width: 100%; padding: 13px; }
  .gi-photo { aspect-ratio: 1 / 1; }
  .gi-tile, .gi-reg { padding: 15px 13px; border-radius: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .gi-tile:active, .gi-reg:active { transform: none; }
}
