/* GFC Builds: styles owned by builder "screens" (see CONTRACT.md).
   Sign in, Home, Jobs, Money, Punch, Admin, New job, job picker.
   Tokens only: every color, size and duration comes from app.css :root.
   Rules scoped with .scr apply only inside these screens (the view gets
   the class), so they never change the job page or the runner. */

/* Skeletons appear only after 150 ms, so fast loads never flash. */
.scr .skel-wrap, .sheet .skel-wrap { animation: scr-skel-in var(--dur) var(--ease) 150ms both; }
@keyframes scr-skel-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------------
   Shared bits on these screens
   --------------------------------------------------------------------- */

.scr .hello-pill { font-family: var(--font); text-align: left; }
.scr a.hello-line { min-height: 48px; margin-top: 6px; text-decoration: none; }
.scr a.hello-line > .ic:last-child { width: 20px; height: 20px; color: var(--on-navy-2); }
/* Home: the cards that wait on you sit right under the header that counts them. */
.scr .home-wait { margin-top: 20px; }
.scr .texts-all { display: flex; justify-content: center; margin: -2px 0 6px; }
.scr .texts-all .link { gap: 6px; }
.scr .hello-pill .desk-only { font-weight: 750; }
.scr .hello-line.is-wait .ic { color: var(--amber); }
.scr .hsec-btn { margin-left: auto; }
.scr .hsec .count + .hsec-btn { margin-left: auto; }
.scr .jrows .jrow:last-child { margin-bottom: 0; }
.scr .collapse-btn .count { font-size: 13.5px; letter-spacing: 0; }
.scr .collapse-btn .ic { margin-left: auto; }
.scr .collapse-body { margin-top: 12px; }
.scr .ledger-more { display: flex; justify-content: center; }

/* ---------------------------------------------------------------------
   Sign in
   --------------------------------------------------------------------- */

.scr .signin .si-hero h1 { overflow-wrap: anywhere; }
.scr .si-in { display: block; }
.scr .si-field.err:focus { box-shadow: 0 0 0 4px var(--red-ring); }
.scr .si-sheet .btn-xl .ic { width: 24px; height: 24px; }

/* ---------------------------------------------------------------------
   Home
   --------------------------------------------------------------------- */

.scr .quick .key { padding: 12px 8px; line-height: 1.15; }
.scr .guest-done { margin-top: 2px; }
.scr .ledger + .my-cos { margin-top: 12px; }

/* ---------------------------------------------------------------------
   Money
   --------------------------------------------------------------------- */

.scr .money-top { padding-top: 18px; }
.scr .mtot .m > b { overflow-wrap: normal; white-space: nowrap; }
.scr .money-filter { margin-top: 14px; }
.scr .money-filter .seg { max-width: 520px; }
.scr .mtot .m > span { overflow-wrap: anywhere; }
.scr .mtot .m-amber > span, .scr .mtot .m-amber > small { color: var(--amber-ink); }
.scr .tlink {
  display: inline-flex; align-items: center; min-height: 48px; margin-block: -14px; padding: 0;
  border: 0; background: none; color: var(--ink); text-align: left; text-decoration: none;
  font: 800 15px/1.3 var(--font); overflow-wrap: anywhere;
}
.scr .tlink-blue { color: var(--blue); }
.scr .ltable td { overflow-wrap: anywhere; }
.scr .ltable td:nth-child(3), .scr .ltable td:nth-child(4) { white-space: nowrap; }
.scr .ltable .badge .ic { width: 13px; height: 13px; }
.scr .money-history { margin-top: 10px; }
/* Two totals: what waits (made of draws, invoices, change orders, quotes) and what was paid */
.scr .mtot.m2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* GFC decides on Home: the waiting tile is the way there. */
.scr a.m-link { display: block; color: var(--ink); text-decoration: none; }
.scr .m-link .m-go { display: flex; align-items: center; gap: 4px; min-height: 28px; margin-top: 8px; font: 850 14.5px/1.2 var(--font); color: var(--amber-ink); }
.scr .m-link .m-go .ic { width: 18px; height: 18px; }
.scr .money-filter.money-top + .mtot { margin-top: 14px; }

/* ---------------------------------------------------------------------
   Punch
   --------------------------------------------------------------------- */

.scr .punch-cols { padding-top: 18px; }
.scr .punch-top { padding-top: 18px; }
.scr .pgroup-h > div { min-width: 0; }

/* ---------------------------------------------------------------------
   Admin
   --------------------------------------------------------------------- */

.scr .adm-sync-card > b { margin-bottom: 4px; }
.scr .sync-dl { display: grid; margin: 8px 0 0; }
.scr .sync-dl > div {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px;
  padding: 10px 0; border-top: var(--bw-hair) solid var(--hair);
}
.scr .sync-dl dt { font: 650 14.5px/1.3 var(--font); color: var(--ink-2); }
.scr .sync-dl dd { margin: 0 0 0 auto; font: 800 14.5px/1.3 var(--font); color: var(--ink); text-align: right; font-variant-numeric: tabular-nums; }
.scr .sync-dl dt { min-width: 0; overflow-wrap: anywhere; }
.scr .sync-dl dt small { display: block; margin-top: 2px; font: 600 13.5px/1.3 var(--font); color: var(--ink-2); }
.scr .sync-open { margin-top: 12px; }
.scr .sync-more { margin-top: 10px; }
.scr .sync-more .ic { width: 18px; height: 18px; }
.scr .sync-note { margin-top: 10px; padding-top: 10px; border-top: var(--bw-hair) solid var(--hair); font: 600 14px/1.4 var(--font); color: var(--ink-2); }

.scr .tx-card .ok-band { gap: 12px; }
.scr .tx-form { display: grid; gap: 14px; margin-top: 14px; }
.scr .tx-f { min-width: 0; }
.scr .tx-f > .lbl { margin-bottom: 8px; }
.scr .tx-f .cost, .scr .tx-f .picks { margin-top: 0; }
.tx-job {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px;
  border: var(--bw) solid var(--edge); border-radius: var(--r-md); background: var(--card); color: var(--ink); text-align: left;
}
.tx-job .tile { width: 44px; height: 44px; border-radius: 11px; }
.tx-job .tile .ic { width: 22px; height: 22px; }
.tx-job > div { flex: 1; min-width: 0; }
.tx-job b { display: block; font: 800 16.5px/1.25 var(--font); letter-spacing: -.01em; overflow-wrap: anywhere; }
.tx-job .s { display: block; margin-top: 3px; font: 600 14px/1.3 var(--font); color: var(--ink-2); overflow-wrap: anywhere; }
.tx-job > .ic { color: var(--ink-2); }
.tx-chg { flex: none; font: 850 15px/1 var(--font); color: var(--blue); }
.tx-job.is-miss { background: var(--amber-tint); border-color: var(--amber-edge); }
.scr .tx-match { background: var(--blue-tint); color: var(--ink); }
.scr .tx-match .ic { color: var(--blue); }
.scr .tx-new-row { display: flex; justify-content: center; margin-top: 10px; }
.scr .tx-new-row .link { margin-block: -4px; white-space: normal; text-align: center; }
/* The job used last, first in a job picker */
.pick-tag { display: inline-block; margin-bottom: 4px; padding: 2px 7px; border-radius: var(--r-xs); background: var(--navy-tint); color: var(--navy-3); font: 850 12.5px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.pick.pick-last { border-color: var(--navy-edge); }
.tx-job.is-miss .s { color: var(--amber-ink); }
/* A text that names more than one payment. */
.tx-two { background: var(--amber-tint); color: var(--amber-ink); }
.tx-two .ic { color: var(--amber-ink); }
.sheet .tx-two { margin: 0 0 16px; }
.sheet .tx-job { margin-top: 0; }
.scr .tx-row .row-t b { font-weight: 700; }
.scr .tx-row .btn-sm { flex: none; }

/* A person row is one button that opens their menu (New sign-in link, Switch off). */
.scr .person-btn {
  width: 100%; padding-right: 14px; border: 0; border-radius: 0; background: none;
  color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.scr .person-btn > .ic { flex: none; color: var(--ink-3); }
.scr .person .chip { height: 24px; }
.scr .onetime { margin-bottom: 12px; }
.scr .ot-keys { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scr .ot-keys .btn { flex: 1 1 140px; }

/* ---------------------------------------------------------------------
   Sheets: New job, job picker, add a person (they live in #layer)
   --------------------------------------------------------------------- */

.nj-type { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.nj-gap { margin-top: 18px; }
p.lbl.nj-gap { margin-top: 20px; }
.nj-more { margin-top: 4px; }
.nj-none { padding: 14px 4px; font: 600 15px/1.45 var(--font); color: var(--ink-2); }
.nj-warn {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; padding: 11px 13px;
  border-radius: var(--r-md); background: var(--amber-tint); border: var(--bw-hair) solid var(--amber-edge);
  font: 650 15px/1.4 var(--font); color: var(--amber-ink);
}
.nj-warn > .ic { width: 20px; height: 20px; flex: none; }
.nj-warn > span { flex: 1 1 200px; min-width: 0; }
.nj-warn b { font-weight: 850; }
.nj-warn .link { margin-block: -8px; }
.choice > div { flex: 1; min-width: 0; }
.choice > .ic:last-child { flex: none; color: var(--ink-3); }
.choice .row-ic { width: 44px; height: 44px; }
.role-cards { margin-top: 2px; }
.role-cards .choice b { font-size: 17px; }
.pick > .ic:last-child { flex: none; color: var(--ink-3); }
.pick .s.prop-owner, .pick-sel .s { color: var(--teal-2); font-weight: 750; }
.pick .s2, .pick-sel .s2 { display: block; margin-top: 2px; font: 600 13.5px/1.3 var(--font); color: var(--ink-2); overflow-wrap: anywhere; }
.pick-sel .tile { width: 44px; height: 44px; border-radius: 11px; }
.pick-sel .tile .ic { width: 22px; height: 22px; }
.pick-sel .link { margin-block: -8px; flex: none; }
.sheet .search { margin-bottom: 4px; }
.pick-search { margin-bottom: 4px; }

/* ---------------------------------------------------------------------
   Breakpoints
   --------------------------------------------------------------------- */

@media (max-width: 479px) {
  /* Phones: the waiting total (with what it is made of) and the paid total stack. */
  .scr .mtot, .scr .mtot.m2 { grid-template-columns: minmax(0, 1fr); }
  .scr .mtot .m > b { font-size: 24px; }
}

@media (min-width: 560px) {
  .scr .tx-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scr .tx-wide { grid-column: 1 / -1; }
}

@media (min-width: 768px) and (max-width: 1023px) {
  /* Tablet: job cards two across (app.css starts its grid at 1024 px). */
  .scr .jobgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .scr .jobgrid .job { margin: 0; }
}

@media (min-width: 768px) {
  /* Sign in: a centered card on the navy splash. Auto margins center it and
     still let a short window scroll to the top (no clipped hero). */
  .scr .signin { justify-content: flex-start; align-items: center; padding: calc(var(--safe-t) + 40px) 24px calc(var(--safe-b) + 40px); }
  .scr .signin .si-hero { flex: none; margin-top: auto; padding: 0 0 30px; }
  .scr .signin .si-sheet { width: 100%; max-width: 500px; margin-bottom: auto; padding: 32px 30px 30px; border-radius: 28px; box-shadow: var(--sh-dialog); }
}

@media (min-width: 1024px) {
  .scr .guest-chip { margin-top: 14px; }
  .scr .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .scr .quick .key { min-height: 96px; }
  .scr .chrome .hello-line.is-wait .ic { color: var(--amber-ink); }
  .scr .money-top, .scr .punch-top { padding-top: 22px; }
}

@media (min-width: 1280px) {
  .scr .punch-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; align-items: start; }
  .scr .adm-grid {
    display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto 1fr;
    gap: 0 32px; align-items: start;
  }
  /* Texts to log on the left; people, then status, on the right. */
  .scr .adm-texts { grid-column: 1; grid-row: 1 / span 2; }
  .scr .adm-people { grid-column: 2; grid-row: 1; }
  .scr .adm-people > .hsec:first-child { margin-top: 22px; }
  .scr .adm-sync { grid-column: 2; grid-row: 2; }
}

/* Decision cards follow the width of their column, not the window: next to the
   1024 px sidebar the column can be 600 to 860 px, too narrow for a 356 px key
   column. Medium columns get a slimmer key column, narrow ones stack. */
.scr .okq { container-type: inline-size; }
@container (min-width: 600px) and (max-width: 859px) {
  .scr .ok-wide .ok-body { grid-template-columns: minmax(0, 1fr) 300px; gap: 4px 20px; }
  .scr .ok-wide .ok-keys .two .btn { padding: 0 8px; white-space: nowrap; }
}
@container (max-width: 599px) {
  .scr .ok-wide .ok-body { display: block; padding: 14px; }
  .scr .ok-wide .ok-head .ok-amt { display: block; }
  .scr .ok-wide .ok-side > .desk-amt { display: none; }
  .scr .ok-wide .ok-side .ok-keys { margin-top: 14px; padding-top: 0; }
}

@media (min-width: 1024px) and (hover: hover) {
  .scr a.m-link:hover { filter: brightness(.98); }
  .scr .ltable tbody tr:hover td { background: var(--sunk); }
  .tx-job:hover, .scr .person-btn:hover { background: var(--sunk); }
  .tx-job.is-miss:hover { background: var(--amber-tint); filter: brightness(.98); }
}

/* Shared PIN sign-in (10/28): four dots, a phone-style keypad, then tap your name. */
.scr .si-dots { display: flex; justify-content: center; gap: 20px; margin: 26px 0 6px; }
.scr .si-dot { width: 18px; height: 18px; border-radius: 50%; border: var(--bw-strong) solid var(--navy); transition: background var(--dur) var(--ease); }
.scr .si-dot.on { background: var(--navy); }
.scr .si-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
.scr .si-pad.busy { opacity: .45; pointer-events: none; }
.scr .si-key { height: var(--h-key); border: var(--bw-hair) solid var(--hair); border-radius: var(--r-lg); background: var(--sunk); color: var(--ink); font: 800 28px/1 var(--font); font-variant-numeric: tabular-nums; cursor: pointer; display: grid; place-items: center; -webkit-tap-highlight-color: transparent; }
.scr .si-key:active { background: var(--tray); transform: scale(.97); }
.scr .si-key:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.scr .si-key.blank { visibility: hidden; }
.scr .si-key .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.scr .si-people { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.scr .si-person { display: flex; align-items: center; gap: 14px; min-height: var(--h-key); padding: 10px 16px; border: var(--bw-hair) solid var(--hair); border-radius: var(--r-lg); background: var(--sunk); color: var(--ink); text-align: left; font: 800 19px/1.2 var(--font); cursor: pointer; }
.scr .si-person:active { background: var(--tray); }
.scr .si-person:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.scr .si-person b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.scr .si-person .ic { width: 22px; height: 22px; color: var(--ink-3); }
.scr .si-av { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: var(--on-navy); font: 850 15px/1 var(--font); }
.scr .si-alt { display: block; margin: 22px auto 0; min-height: var(--h-min); }
.scr .si-sheet .si-err { margin-top: 16px; }
