/* ERA Pallet Board, in ERA's colours (the palette the ERA Sales Agent uses: ERA blue and green, pale blue-grey page).
   Layout: an airport arrivals board that fills a vertical TV (a dark display in ERA's deep blues, green titles and
   pallet counts), and the same board plus forms in the staff app (light pages under an ERA-blue header with the logo).
   Rules the TV depends on avoid very new CSS (flex gap, inset, clamp), since TV browsers can be old. */

:root {
  --era-green: #72b83d;
  --era-green-dark: #4f8f26;
  --era-green-light: #b9dc9e;
  --era-blue: #176f98;
  --era-blue-mid: #105875;
  --era-blue-dark: #0b3b50;
  --era-blue-soft: #eaf4f8;
  --era-header: linear-gradient(105deg, #0b3447, #105875 72%, #176f98);
  --canvas: #edf3f5;
  --surface: #ffffff;
  --surface-soft: #f6f9fa;
  --ink: #17242c;
  --ink-soft: #52636d;
  --line: #d8e2e7;
  --line-strong: #c7d4da;
  --shadow-sm: 0 2px 8px rgba(18, 47, 61, .06);
  --shadow-md: 0 14px 36px rgba(18, 47, 61, .14);
  /* states: their own colours, separate from the brand */
  --ok: #72b83d;
  --ok-ink: #10280f;
  --bad: #d13a4a;
  --bad-text: #b42335;
  --bad-soft: #fff1f1;
  --warn: #e2b03a;
  --warn-ink: #2b2006;
  --warn-text: #8a6200;
  --late: #f08a2c;
  --font-display: "Saira Semi Condensed", "Barlow Semi Condensed", "Arial Narrow", sans-serif;
  --font-body: "Barlow Semi Condensed", "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  color-scheme: light;
}

/* The board is a dark display; inside it these names mean the board's colours. (Only the board: the shipment panel
   that opens over it on the TV keeps the light colours.) */
.fids {
  --night: #072330;
  --deep: #0b3447;
  --band-a: #0d3b51;
  --band-b: #155d7d;
  --ink: #f2f8fb;
  --mist: #9dc4d6;
  --line: rgba(157, 196, 214, .2);
  --line-strong: rgba(157, 196, 214, .4);
  --accent: #a4d878;      /* ERA green, lightened to read on the blues */
  --bad-text: #ff9aa5;
  --warn-text: #f0c75e;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(circle at 12% 0%, rgba(114, 184, 61, .08), transparent 24rem) no-repeat, var(--canvas);
  color: var(--ink);
  font: 500 17px/1.45 var(--font-body);
}
[hidden] { display: none !important; }
a { color: var(--era-blue); }
a:hover { color: var(--era-blue-dark); }
h2, h3 { text-wrap: balance; }
h3 { font: 600 18px/1.2 var(--font-display); margin: 22px 0 6px; letter-spacing: .02em; }
:focus-visible { outline: 3px solid var(--era-blue); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- ERA header and tabs */

.wrap { max-width: 1320px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.site { background: var(--era-header); border-bottom: 3px solid var(--era-green); box-shadow: 0 3px 16px rgba(8, 42, 56, .18); }
.site :focus-visible { outline-color: #fff; }
.site-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 12px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; }
.brand:hover { color: #fff; }
.brand-logo {
  width: 44px; height: 44px; padding: 3px; flex: none; object-fit: contain;
  background: #fff; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .12);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1; }
.brand-kicker { font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--era-green-light); }
.brand-name { font: 600 23px/1 var(--font-display); color: #fff; letter-spacing: .01em; margin-top: 4px; }
.account { display: flex; align-items: center; gap: 12px; font-size: 15px; color: #bcd0d9; min-width: 0; }
.account-who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site .btn { background: transparent; color: #dbe9ee; border-color: rgba(255, 255, 255, .28); }
.site .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .45); color: #fff; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] {
  appearance: none; background: none; border: 0; border-bottom: 3px solid transparent;
  color: #c8d8df; font: 600 15px/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase;
  padding: 12px 14px 11px; cursor: pointer; white-space: nowrap;
}
.tabs [role="tab"]:hover { color: #fff; }
.tabs [role="tab"][aria-selected="true"] { color: #fff; border-bottom-color: var(--era-green); }
.main { padding-top: 24px; padding-bottom: 64px; }

/* ---------------------------------------------------------------- buttons, cards, forms */

.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 9px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 700 15px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #9eb3bd; background: var(--surface-soft); color: var(--ink); }
.btn-primary { background: var(--era-blue); border-color: var(--era-blue); color: #fff; }
.btn-primary:hover { background: var(--era-blue-mid); border-color: var(--era-blue-mid); color: #fff; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: #b9303f; border-color: #b9303f; color: #fff; }
.btn-big { min-height: 54px; padding: 0 26px; font-size: 17px; }
/* Google's own light button look, so people recognise it. */
.btn-google {
  width: 100%; gap: 12px; background: #fff; border-color: #747775; color: #1f1f1f;
  font-weight: 600; letter-spacing: .01em; text-transform: none;
}
.btn-google:hover { background: #f8fafd; border-color: #5f6368; color: #1f1f1f; }
.btn-google svg { width: 22px; height: 22px; flex: none; }
.signin .dev-login { margin-top: 18px; }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-icon {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  width: 44px; height: 44px; border-radius: 9px; font: 400 28px/1 var(--font-body); cursor: pointer; flex: none;
}
.btn-icon:hover { background: var(--surface-soft); }
.link {
  appearance: none; background: none; border: 0; padding: 0; color: var(--era-blue);
  font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0;
  box-shadow: var(--shadow-sm);
}
.card.narrow { max-width: 470px; margin: 48px auto 0; border-top: 5px solid var(--era-green); }
.card h2 { font: 600 25px/1.15 var(--font-display); margin: 0 0 6px; letter-spacing: .01em; }
.lede { color: var(--ink-soft); margin: 0 0 20px; }
.hint { color: var(--ink-soft); font-size: 15px; margin: 0 0 10px; }
.optional { color: var(--ink-soft); font-weight: 500; text-transform: none; letter-spacing: 0; }
.empty { color: var(--ink-soft); margin: 6px 0; }
.split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 6px; }

.field { display: flex; flex-direction: column; gap: 7px; margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
legend.label { padding: 0; margin-bottom: 7px; }
.label { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 50px; padding: 10px 13px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 9px;
  font: 600 18px/1.2 var(--font-body);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.35; }
input::placeholder, textarea::placeholder { color: #8a9aa3; font-weight: 500; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--era-blue); box-shadow: 0 0 0 3px rgba(23, 111, 152, .2); }
input[readonly] { color: var(--ink-soft); background: var(--surface-soft); }
select { appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }

/* Yes / No and direction choices: a row of big buttons, nothing picked until someone picks. */
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg label { position: relative; flex: 1 1 0; min-width: 0; }
.seg input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg label > span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 50px; padding: 6px 12px;
  color: var(--ink-soft); font-weight: 700; font-size: 16px; letter-spacing: .08em; text-transform: uppercase;
}
.seg label + label > span { border-left: 1px solid var(--line-strong); }
.seg input:hover + span { color: var(--ink); background: var(--surface-soft); }
.seg input:checked + span { background: var(--era-blue); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--era-blue-dark); outline-offset: -3px; }
.yn-destroy input[value="yes"]:checked + span { background: var(--bad); color: #fff; }

.stepper { display: flex; }
.stepper input { text-align: center; font-size: 24px; border-radius: 0; min-width: 0; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step {
  appearance: none; flex: none; width: 56px; min-height: 50px; border: 1px solid var(--line-strong);
  background: var(--surface-soft); color: var(--ink); font: 600 26px/1 var(--font-body); cursor: pointer;
}
.step:first-child { border-radius: 9px 0 0 9px; border-right: 0; }
.step:last-child { border-radius: 0 9px 9px 0; border-left: 0; }
.step:hover { background: var(--era-blue-soft); color: var(--era-blue-dark); }

.more { margin: 0 0 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.more summary { cursor: pointer; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: 14px; color: var(--ink-soft); margin-bottom: 14px; }
.more summary:hover { color: var(--ink); }

.note { padding: 12px 14px; border-radius: 9px; margin: 0 0 16px; font-weight: 600; }
.note p { margin: 0 0 8px; }
.note-bad { background: var(--bad-soft); border: 1px solid #f0c6c6; color: #8a2727; }
.note-warn { background: #fff7df; border: 1px solid #dfc576; color: #5c4400; }
.editing { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }

.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 260px; }
.toolbar input { min-height: 44px; }
.board-hint { margin-top: 12px; }

/* ---------------------------------------------------------------- the board */

.fids {
  --fs: 19px;                          /* the TV sets this from its screen size */
  --pad: calc(var(--fs) * .7);
  --gap: calc(var(--fs) * .42);
  --grid: .84fr 1.95fr 1.6fr .56fr .56fr 2.12fr 1.45fr;
  display: flex; flex-direction: column;
  font-size: var(--fs);
  background: var(--night); color: var(--ink);
  border: 1px solid #0b3447; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md);
  font-variant-numeric: tabular-nums;
}
.fids[data-mode="tv"] { height: 100%; border: 0; border-radius: 0; box-shadow: none; }
.fids-head {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: calc(var(--fs) * .5) var(--pad); background: var(--era-header);
  border-bottom: calc(var(--fs) * .1) solid var(--era-green);
}
.fids-hq { display: flex; align-items: center; min-width: 0; }
.fids-logo {
  width: 1.75em; height: 1.75em; flex: none; padding: .1em; margin-right: .45em; object-fit: contain;
  background: #fff; border-radius: 50%; box-shadow: 0 0 0 .1em rgba(255, 255, 255, .14);
}
.fids-hq-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.fids-hq-name {
  font: 600 .86em/1.05 var(--font-display); letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fids-hq-sub { font-size: .46em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--era-green-light); margin-top: .3em; }
.fids-title, .panel-title { display: flex; align-items: center; margin: 0; color: var(--accent); font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; line-height: 1; }
.fids-title { font-size: 1.62em; padding: 0 .4em; }
.fids-title > * + *, .panel-title > * + * { margin-left: .34em; }
.tile {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.22em; height: 1.22em; border-radius: .2em; background: var(--era-green); color: #0b3447;
}
.tile svg { width: 74%; height: 74%; display: block; }
.fids-clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; min-width: 0; }
.fids-time { font: 600 1.4em/1 var(--font-display); letter-spacing: .03em; }
.fids-date { font-size: .48em; font-weight: 600; letter-spacing: .16em; color: #c8dbe4; margin-top: .35em; white-space: nowrap; }
.pager {
  font: 700 .3em/1 var(--font-body); letter-spacing: .12em; color: var(--mist);
  border: 1px solid var(--line-strong); border-radius: 99px; padding: .35em .7em; align-self: center;
}
.panel-title .pager { font-size: .38em; }

.panel { display: flex; flex-direction: column; min-height: 0; }
.fids[data-mode="tv"] .panel-in { flex: 1 1 auto; }
.panel-title {
  font-size: 1.15em; padding: calc(var(--fs) * .42) var(--pad); background: var(--era-header);
  border-top: calc(var(--fs) * .1) solid var(--era-green);
}
.cols, .row {
  display: grid; grid-template-columns: var(--grid); grid-column-gap: var(--gap); column-gap: var(--gap); align-items: center;
  padding-left: var(--pad); padding-right: var(--pad);
}
.cols {
  min-height: calc(var(--fs) * 1.3); background: var(--deep); border-bottom: 1px solid var(--line);
  color: var(--mist); font-size: .46em; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap;
}
.fids[data-mode="tv"] .carrier { display: none; }  /* too small to read across a warehouse */
.cols .num, .c-num { text-align: center; }
.rows { display: flex; flex-direction: column; min-height: 0; background: var(--band-a); }
.fids[data-mode="tv"] .rows { overflow: hidden; flex: 1 1 auto; }
.fids[data-mode="tv"] .panel-out .rows { flex: none; }

.row {
  min-height: calc(var(--fs) * 2.05); margin: 0; border: 0; width: 100%;
  background: var(--band-a); color: var(--ink); text-align: left; font: inherit; font-variant-numeric: tabular-nums;
}
.row:nth-child(even) { background: var(--band-b); }
.fids[data-mode="tv"] .row { height: var(--rh); min-height: 0; flex: none; }
button.row { cursor: pointer; }
button.row:hover { -webkit-filter: brightness(1.14); filter: brightness(1.14); }
button.row:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.row > * { min-width: 0; }
.fit { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.c-sent { font-size: .8em; font-weight: 600; letter-spacing: .03em; white-space: nowrap; }
.c-place { font-style: italic; font-weight: 700; letter-spacing: .015em; text-transform: uppercase; }
.c-place .fit { padding-right: .12em; }
.c-bol { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; }
.c-bol .bol { font-weight: 600; font-size: .9em; letter-spacing: .02em; }
.c-bol .carrier { font-size: .42em; font-weight: 600; letter-spacing: .14em; color: var(--mist); margin-top: .35em; text-transform: uppercase; }
.row:nth-child(even) .carrier { color: #cfe2ea; }
.c-plts { font-weight: 700; font-size: 1.05em; color: var(--accent); }
.c-rcvd { font-weight: 700; font-size: 1.05em; }
.c-rcvd.is-none { color: var(--mist); font-weight: 500; }
.c-rcvd.is-ok { color: var(--accent); }
.c-rcvd.is-bad { color: var(--bad-text); }
.c-flags { display: grid; grid-template-columns: 2.55em auto; justify-content: start; align-items: center; grid-column-gap: .22em; column-gap: .22em; }
.chip {
  display: inline-block; justify-self: start; padding: .32em .5em; border-radius: .3em;
  font-size: .46em; font-weight: 700; letter-spacing: .09em; line-height: 1; white-space: nowrap; text-transform: uppercase;
}
.chip-serial { background: var(--era-blue-soft); color: var(--era-blue-dark); box-shadow: inset 0 0 0 1px #b9d9e7; }
.chip-destroy { background: var(--bad); color: #fff; }
.c-status { white-space: nowrap; overflow: hidden; }
.pill {
  display: inline-block; padding: .34em .58em; border-radius: .3em;
  font-size: .6em; font-weight: 700; letter-spacing: .08em; line-height: 1; white-space: nowrap; text-transform: uppercase;
}
.tone-plain { padding-left: 0; padding-right: 0; color: var(--ink); }
.tone-due { padding-left: 0; padding-right: 0; color: var(--warn-text); }
.tone-dock { background: var(--warn); color: var(--warn-ink); animation: blink 1.6s ease-in-out infinite; }
.tone-late { background: var(--late); color: var(--warn-ink); }
.tone-ok { background: var(--ok); color: var(--ok-ink); }
.tone-bad { background: var(--bad); color: #fff; }
.tone-muted { padding-left: 0; padding-right: 0; color: var(--ink-soft); }
.fids .tone-muted { color: var(--mist); }
.row-filler { pointer-events: none; }
.rows-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: calc(var(--fs) * 4.2); padding: calc(var(--fs) * .8) var(--pad); background: var(--band-a);
}
.fids[data-mode="tv"] .rows-empty { min-height: 0; height: calc(var(--rh) * 2); flex: none; }
.rows-empty strong { font: 600 1.05em/1.1 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.rows-empty span { font-size: .52em; color: var(--mist); margin-top: .5em; max-width: 34em; }

.fids-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--fs) * .45) var(--pad); background: var(--deep); border-top: 1px solid var(--line); overflow: hidden;
}
.stats { display: flex; align-items: center; min-width: 0; overflow: hidden; }
.stat { display: flex; flex-direction: column; line-height: 1.05; white-space: nowrap; margin-right: calc(var(--fs) * 1.1); }
.stat-label { font-size: .46em; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mist); }
.stat-value { font: 600 1.02em/1.05 var(--font-display); margin-top: .12em; }
.stat-value small { font: 700 .5em var(--font-body); letter-spacing: .1em; color: var(--mist); margin-left: .3em; }
.stat.is-late .stat-value { color: var(--late); }
.stat.is-bad .stat-value { color: var(--bad-text); }
.live { display: flex; align-items: center; flex: none; font-size: .4em; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--mist); white-space: nowrap; }
.live-dot { width: 1em; height: 1em; border-radius: 50%; background: var(--mist); margin-right: .6em; }
.live.is-on .live-dot { background: var(--era-green); box-shadow: 0 0 0 .3em rgba(114, 184, 61, .22); }
.live.is-stale { color: var(--late); }
.live.is-stale .live-dot { background: var(--late); box-shadow: 0 0 0 .3em rgba(240, 138, 44, .2); }

/* At a desk the board is read up close, so its small labels get a floor. (The TV keeps plain em sizes: old browsers.) */
.fids[data-mode="desk"] { --fs: 20px; }
.fids[data-mode="desk"] .cols { font-size: max(11px, .5em); }
.fids[data-mode="desk"] .carrier { font-size: max(10.5px, .5em); letter-spacing: .1em; }
.fids[data-mode="desk"] .c-flags { grid-template-columns: 2.9em auto; }
.fids[data-mode="desk"] .chip { font-size: max(10.5px, .5em); }
.fids[data-mode="desk"] .pill { font-size: max(12px, .62em); }
.fids[data-mode="desk"] .fids-hq-sub, .fids[data-mode="desk"] .fids-date,
.fids[data-mode="desk"] .stat-label, .fids[data-mode="desk"] .live { font-size: max(10.5px, .5em); }
.fids[data-mode="desk"] .stat-value small { font-size: max(11px, .55em); }

/* Narrow screens (phones): each row becomes a two-line card; the column headings go. */
.fids.is-narrow .cols { display: none; }
.fids.is-narrow .row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "place place place status" "sent bol plts rcvd" "flags flags flags flags";
  grid-row-gap: .3em; row-gap: .3em; padding-top: .55em; padding-bottom: .6em;
}
.fids.is-narrow .c-place { grid-area: place; }
.fids.is-narrow .c-status { grid-area: status; }
.fids.is-narrow .c-sent { grid-area: sent; }
.fids.is-narrow .c-bol { grid-area: bol; }
.fids.is-narrow .c-plts { grid-area: plts; font-size: .9em; }
.fids.is-narrow .c-rcvd { grid-area: rcvd; font-size: .9em; }
.fids.is-narrow .c-flags { grid-area: flags; display: flex; flex-wrap: wrap; gap: .3em; }
.fids.is-narrow .c-flags:empty { display: none; }
.fids.is-narrow .chip-slot { display: none; }
.fids.is-narrow .c-plts::before { content: "Plts "; }
.fids.is-narrow .c-rcvd::before { content: "Rcvd "; }
.fids.is-narrow .c-plts::before, .fids.is-narrow .c-rcvd::before { font-size: .48em; letter-spacing: .14em; color: var(--mist); text-transform: uppercase; }
.fids.is-narrow .fids-hq { display: none; }
.fids.is-narrow .fids-head { grid-template-columns: 1fr auto; }
.fids.is-narrow .fids-title { padding-left: 0; }
.fids.is-narrow .stat:nth-child(n+4) { display: none; }

/* Something new or changed draws the eye, the way a real board flickers. */
.row.is-new { animation: arrive 2.6s ease-out; }
.pill.is-flip { animation: flip .7s ease-out; }
.rows.is-paging .row { animation: page-in .45s ease-out both; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
@keyframes arrive { 0%, 35% { box-shadow: inset 0 0 0 999px rgba(164, 216, 120, .32); } 100% { box-shadow: inset 0 0 0 999px rgba(164, 216, 120, 0); } }
@keyframes flip { 0% { transform: perspective(300px) rotateX(90deg); } 65% { transform: perspective(300px) rotateX(-14deg); } 100% { transform: none; } }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- the TV */

.tv-html, .tv { height: 100%; }
body.tv { overflow: hidden; background: #072330; }
.tv-stage { position: fixed; top: 0; right: 0; bottom: 0; left: 0; }
body.tv.no-cursor, body.tv.no-cursor * { cursor: none !important; }
.tv-full { position: fixed; right: 18px; bottom: 18px; z-index: 5; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.tv-sample {
  position: fixed; top: 0; left: 50%; z-index: 4; transform: translateX(-50%);
  background: var(--late); color: var(--warn-ink); font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  font-size: 14px; padding: 5px 16px; border-radius: 0 0 8px 8px; white-space: nowrap;
}
.tv-notice {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 10%;
  background: rgba(7, 35, 48, .95); color: #f2f8fb; font: 600 28px/1.3 var(--font-display);
}
/* A tap on the board of a screen nobody signed in on. */
.tv-prompt {
  position: fixed; left: 50%; bottom: 28px; z-index: 7; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px; width: 640px; max-width: calc(100% - 32px);
  padding: 16px 18px 16px 22px; border-radius: 12px; background: var(--surface); color: var(--ink);
  border-top: 5px solid var(--era-green); box-shadow: 0 18px 48px rgba(0, 0, 0, .45); font-size: 18px; font-weight: 600;
}
.tv-prompt .btn { flex: none; }

/* ---------------------------------------------------------------- shipment drawer */

.scrim { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 40; background: rgba(11, 52, 71, .45); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: 480px; max-width: 100%;
  display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: -24px 0 48px rgba(11, 52, 71, .22);
}
.has-drawer { overflow: hidden; }
.drawer-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 18px 20px;
  background: var(--surface-soft); border-bottom: 1px solid var(--line); border-top: 4px solid var(--era-green);
}
.drawer-heading { min-width: 0; }
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--era-blue); }
#d-title { margin: 0; font: italic 700 30px/1.05 var(--font-body); text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; color: var(--era-blue-dark); }
#d-title:focus { outline: none; }
.drawer-body { overflow-y: auto; padding: 18px 20px 32px; -webkit-overflow-scrolling: touch; }
.d-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.d-bol strong { display: block; font-size: 24px; letter-spacing: .03em; overflow-wrap: anywhere; }
.d-top .pill { font-size: 15px; }
.flag-line { margin: 0 0 10px; padding: 10px 12px; border-radius: 9px; font-weight: 700; background: var(--era-blue-soft); border: 1px solid #b9d9e7; color: var(--era-blue-dark); }
.flag-line.is-destroy { background: var(--bad-soft); border-color: #f0c6c6; color: #8a2727; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 18px; margin: 16px 0 0; }
.facts dt { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); padding-top: 3px; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 4px; }
.section h3 { margin-top: 14px; }
.big-count { font: 600 30px/1.1 var(--font-display); margin: 4px 0; }
.big-count.is-ok { color: var(--era-green-dark); }
.big-count.is-bad { color: var(--bad-text); }
.muted { color: var(--ink-soft); margin: 0 0 8px; }
.count-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.count-form .btn-big { margin-top: 8px; }
.confirm { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line-strong); }
.confirm p { margin: 0 0 10px; }
.confirm .field { margin-bottom: 12px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.timeline time { color: var(--ink-soft); white-space: nowrap; }
.timeline .who { color: var(--ink-soft); }

/* ---------------------------------------------------------------- your shipments, history, settings */

.mine-list { display: flex; flex-direction: column; gap: 8px; }
.mine-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; width: 100%;
  padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--era-blue); border-radius: 9px;
  background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer;
}
.mine-item:hover { border-color: #9fc9db; border-left-color: var(--era-blue); background: var(--surface-soft); }
.mine-place { font-style: italic; font-weight: 700; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--era-blue-dark); }
.mine-meta { grid-column: 1 / -1; font-size: 15px; color: var(--ink-soft); }
.mine-item .pill { font-size: 13px; }
.chips-inline { display: inline-flex; gap: 6px; vertical-align: middle; margin-left: 6px; }
.chips-inline .chip { font-size: 11px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; flex: 0 1 190px; }
.filters .grow { flex: 1 1 200px; }
.filters .is-off { opacity: .45; }
.totals { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: 4px 0 16px; }
.total { display: flex; flex-direction: column; }
.total b { font: 600 28px/1.1 var(--font-display); color: var(--era-blue-dark); }
.total span { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); }
.total.is-bad b { color: var(--bad-text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.table { width: 100%; border-collapse: collapse; font-size: 16px; font-variant-numeric: tabular-nums; background: var(--surface); }
.table th {
  text-align: left; padding: 11px 12px; background: var(--surface-soft); color: var(--ink-soft);
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  border-bottom: 1px solid var(--line);
}
.table td { padding: 10px 12px; border-top: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: var(--era-blue-soft); }
.table .num { text-align: right; }
.table .place { font-style: italic; font-weight: 700; text-transform: uppercase; color: var(--era-blue-dark); }
.table .link { font-weight: 700; color: var(--ink); text-decoration-color: var(--line-strong); }
.table .chip { font-size: 11px; margin-right: 4px; }
.table .pill { font-size: 12px; }
.table .is-ok { color: var(--era-green-dark); font-weight: 700; }
.table .is-bad { color: var(--bad-text); font-weight: 700; }
.table .dir { color: var(--ink-soft); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }

.chips-edit { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips-edit li {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 14px; border-radius: 99px;
  background: var(--era-blue-soft); border: 1px solid #b9d9e7; color: var(--era-blue-dark); font-weight: 700;
}
.chips-edit li.empty { background: none; border-style: dashed; padding-right: 14px; color: var(--ink-soft); font-weight: 500; }
.chips-edit button {
  appearance: none; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%; font: 400 22px/1 var(--font-body);
}
.chips-edit button:hover { background: #fde8ea; color: var(--bad-text); }
.add-row, .copy-row { display: flex; gap: 8px; }
.add-row input, .copy-row input { flex: 1 1 auto; min-width: 0; }
.rotate-zone { margin-top: 14px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { padding: 4px 0; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 13px 18px; border-radius: 10px;
  background: var(--era-blue-dark); color: #fff; font-weight: 700; box-shadow: 0 12px 34px rgba(11, 52, 71, .35);
  border-left: 5px solid var(--era-green);
  pointer-events: none;  /* only words: taps go through to whatever is underneath, e.g. the form on a phone */
}
.toast.is-bad { background: var(--bad); border-left-color: #8a2727; }

@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-left: 16px; padding-right: 16px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .account-who { display: none; }
  .brand-logo { width: 38px; height: 38px; }
  .brand-name { font-size: 21px; }
  .drawer { width: 100%; border-left: 0; }
  .filters .field { flex: 1 1 140px; }
  .fids[data-mode="desk"] { --fs: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .tone-dock, .row.is-new, .pill.is-flip, .rows.is-paging .row { animation: none; }
}
