/* The staff app's look: Exclusive Eco's colours and Rubik, made for phones outdoors. */

@font-face {
  font-family: "Rubik";
  src: url("/fonts/rubik-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("/fonts/rubik-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rubik";
  src: url("/fonts/rubik-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #097a3d;
  --green-dark: #076735;
  --leaf: #70a742;
  --ink: #1f2a24;
  --charcoal: #333333;
  --muted: #56625b;
  --line: #dfe5e1;
  --edge: #b6c1ba;
  --paper: #ffffff;
  --wash: #f1f2f2;
  --red: #c12523;
  --tap: 48px;
  color-scheme: light;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--wash);
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.45;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
body.signed-out { background: var(--paper); padding-bottom: 24px; }

.bar {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--green);
  color: #fff;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
}
.bar h1 { margin: 0 auto; max-width: 36rem; font-size: 1.125rem; font-weight: 500; }
body.signed-out .bar { display: none; }

/* No signal: shown at the top of the bar, which stays on screen, so it is seen anywhere on a long page. */
.banner {
  margin: -12px -16px 10px;
  background: var(--charcoal);
  color: #fff;
  padding: 8px 16px;
  font-size: .9375rem;
  text-align: center;
}

main {
  max-width: 36rem;
  margin: 0 auto;
  padding: 16px max(16px, env(safe-area-inset-left)) 16px max(16px, env(safe-area-inset-right));
}
main:focus, h2:focus { outline: none; }

h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.2; margin: 8px 0 12px; }
h3 { font-size: 1.0625rem; font-weight: 500; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.lead, .muted { color: var(--muted); }
.hint { color: var(--muted); font-size: .9375rem; margin: 0 0 8px; }
.error { color: var(--red); font-weight: 500; }
.notice {
  background: #eef6e8;
  border-left: 4px solid var(--leaf);
  border-radius: 8px;
  padding: 12px 14px;
}

.logo { display: block; height: 72px; width: auto; margin: max(24px, env(safe-area-inset-top)) 0 16px; }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 0 0 16px;
}
.card p:last-child { margin-bottom: 0; }

/* Forms */
.field { margin: 0 0 18px; }
label { display: block; font-weight: 500; margin: 0 0 6px; }
input[type="text"], input[type="email"], input[type="tel"], select {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
}
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--red); border-width: 2px; }
input:disabled, select:disabled { background: var(--wash); color: var(--muted); }
#code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.5rem;
  letter-spacing: .35em;
  text-align: center;
}
.field-error { color: var(--red); font-size: .9375rem; margin: 6px 0 0; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  margin: 0 0 18px;
  padding: 8px 14px 4px;
}
legend { font-weight: 500; padding: 0 6px; }
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-weight: 400;
  min-height: var(--tap);
  padding: 10px 0;
  margin: 0;
}
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--green); }

:is(a, button, input, select, summary):focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }

/* Buttons */
button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}
button:disabled { opacity: .6; cursor: default; }
.primary { background: var(--green); color: #fff; }
.primary:active { background: var(--green-dark); }
.secondary { background: #fff; color: var(--green); border-color: var(--green); }
.danger { background: var(--red); color: #fff; }
.link {
  background: none;
  border: none;
  color: var(--green);
  text-decoration: underline;
  padding: 10px 0;
}
form > .primary, .wide { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 16px; }
form + .actions { margin-top: 12px; }
.actions .button, .actions button { flex: 1 1 auto; }
.row { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 8px; }

.tip {
  margin-top: 28px;
  padding: 14px 16px;
  background: var(--wash);
  border-radius: 12px;
  color: var(--charcoal);
}
.tip p:last-child { margin-bottom: 0; }
.tip button { margin-top: 4px; }

/* People */
.people {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.people li + li { border-top: 1px solid var(--line); }
.people li.muted, .people li.error { padding: 14px 16px; margin: 0; }
.person {
  display: grid;
  gap: 2px;
  min-height: 56px;
  padding: 12px 16px;
  color: inherit;
  text-decoration: none;
}
.person .name { font-weight: 500; }
.person .meta { color: var(--muted); font-size: .9375rem; }
.person.removed .name { color: var(--muted); }
.tag {
  justify-self: start;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--wash);
  color: var(--charcoal);
  font-size: .8125rem;
}

.details {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2px 16px;
  margin: 0 0 16px;
}
.details div { padding: 10px 0; }
.details div + div { border-top: 1px solid var(--line); }
.details dt { color: var(--muted); font-size: .9375rem; }
.details dd { margin: 2px 0 0; }

details.card summary { font-weight: 500; color: var(--green); cursor: pointer; min-height: 32px; }
details.card[open] summary { margin-bottom: 12px; }

.version { color: var(--muted); font-size: .8125rem; text-align: center; margin: 24px 0 0; }

/* Tabs along the bottom */
.tabs {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.tabs a {
  flex: 1;
  max-width: 12rem;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 8px 4px 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: .8125rem;
}
.tabs a[aria-current="page"] { color: var(--green); font-weight: 500; }
.tabs svg { width: 26px; height: 26px; }

/* Messages and the confirm box */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  z-index: 4;
  max-width: 34rem;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--charcoal);
  color: #fff;
  box-shadow: 0 6px 18px rgb(0 0 0 / .25);
}
body.signed-out .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast button { min-height: 40px; padding: 6px 14px; background: none; color: #fff; border-color: #fff; }

dialog {
  width: min(92vw, 26rem);
  border: none;
  border-radius: 16px;
  padding: 20px;
  color: var(--ink);
}
dialog:modal { overscroll-behavior: contain; }
dialog::backdrop { background: rgb(0 0 0 / .45); overflow: hidden; overscroll-behavior: contain; }
dialog h2 { font-size: 1.25rem; margin-top: 0; }
dialog form { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* Programme cards */
.chip {
  display: inline-block;
  margin: 4px 0 0;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 500;
  justify-self: start;
}
.status-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.status-line .chip { margin: 0; }
.chip.ok { background: #e3f1e8; color: var(--green-dark); }
.chip.wait { background: #fff4d6; color: #6b4e00; }
.chip.bad { background: #fde4e3; color: var(--red); }
.card-section h3 { font-size: 1.125rem; margin-bottom: 10px; }
.card-section h4 { font-size: 1rem; margin: 16px 0 8px; }
.card-section p.small, .small { font-size: .9375rem; color: var(--muted); }
.card-section .note, p.note {
  background: var(--wash);
  border-radius: 10px;
  padding: 10px 12px;
}
.rows { display: grid; gap: 10px; margin: 0 0 8px; }
.rowcard {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
.rowcard p { margin: 0 0 6px; }
.rowcard p:last-child { margin-bottom: 0; }
.row-title { font-weight: 500; }
.label { color: var(--muted); font-weight: 500; }
.src { font-size: .8125rem; color: var(--muted); }
.card-table { margin: 0; border: none; padding: 0; }
details.product { margin: 0 0 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
details.product summary { cursor: pointer; font-weight: 500; color: var(--green); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.product .details { border: none; padding: 0; margin: 8px 0 0; }
.review .check { align-items: flex-start; }

/* Jobs */
textarea {
  display: block;
  width: 100%;
  min-height: 88px;
  padding: 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.0625rem;
  resize: vertical;
}
textarea:disabled { background: var(--wash); color: var(--muted); }
.field input + input, .field select + input { margin-top: 8px; }
h4.day { font-size: .9375rem; color: var(--muted); font-weight: 500; margin: 14px 0 6px; }
.card .people { margin-bottom: 8px; }
.person .chip { margin-top: 6px; }
details.part > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  color: var(--ink);
  font-size: 1.0625rem;
  min-height: 40px;
  list-style-position: outside;
}
details.part > summary > span:first-child { color: var(--green); }
.part-state { color: var(--muted); font-size: .875rem; font-weight: 400; }
.part h4 { font-size: 1rem; margin: 18px 0 8px; }
.lines { list-style: none; margin: 0 0 12px; padding: 0; }
.line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.lines .line:last-child { border-bottom: none; }
div.line { border-bottom: none; }
.line .link { padding: 6px 0; min-height: 40px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.add { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 4px; }
.part .note { margin: 0 0 14px; }
.part .note p { margin: 0 0 4px; }
.error ul { margin: 4px 0 0; padding-left: 20px; }

/* identification photos */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
label.button { display: flex; align-items: center; justify-content: center; cursor: pointer; margin: 0 0 10px; }
label.button:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 2px; }
.photo { display: flex; gap: 12px; align-items: flex-start; border-top: 1px solid var(--line); padding: 12px 0 4px; }
.photo .thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; flex: none; background: var(--wash); }
.photo-text { flex: 1 1 auto; min-width: 0; }
.photo-text p { margin: 0 0 6px; }
.photo-text .meta { color: var(--muted); font-size: .875rem; }
.photo-text .status-line strong { font-weight: 500; }
.photo-text .actions { margin: 8px 0 4px; }
.seen { margin: 0 0 8px; padding-left: 18px; font-size: .9375rem; }
.seen li { margin: 0 0 4px; }

/* stage 5: calls, the team's work, flags */
.card.ask { border: 2px solid var(--green); }
.card.ask h3 { color: var(--green-dark); }
/* stage 6: the approver's word on the nightly copy to Google Drive */
.card.warn { border: 2px solid var(--red); }
.card.warn h3 { color: var(--red); }
.card code { font-size: .875rem; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chips .chip { margin: 0; }
.call { border-top: 1px solid var(--line); padding: 10px 0 2px; }
.call:first-of-type { border-top: none; }
.call p { margin: 0 0 6px; }
details.flag { margin: 6px 0 4px; }
details.flag summary { color: var(--green); cursor: pointer; padding: 6px 0; }
