/* One stylesheet, no web fonts: the app has to render the same in a basement
   with no bars as it does on the hotspot in the truck. */

:root {
  --ground: #F4F6F8;
  --surface: #FFFFFF;
  --ink: #1B2530;
  --muted: #5B6A77;
  --line: #D3DBE2;
  --accent: #0E6E8C;
  --accent-ink: #FFFFFF;
  --accent-soft: #E1EFF4;
  --signal: #C9651E;
  --signal-soft: #FBEADB;
  --good: #2E7D4F;
  --good-soft: #DFF1E6;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #131920;
    --surface: #1B232C;
    --ink: #E4EAEF;
    --muted: #93A1AD;
    --line: #2C3844;
    --accent: #1B7E9E;
    --accent-soft: #163A47;
    --signal: #F09A5C;
    --signal-soft: #45301F;
    --good: #3E9A63;
    --good-soft: #1E3A2B;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ground);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app { min-height: 100%; display: flex; flex-direction: column; }

.screen {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  max-width: 34rem;
  width: 100%;
  margin: 0 auto;
}

/* Top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: env(safe-area-inset-top);
  min-height: 34px;
}
.bar h1 { font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; color: var(--muted); font-weight: 600; }
.bar .who { font-size: 15px; color: var(--muted); }
.bar button.link { background: none; border: 0; padding: 6px 2px; color: var(--accent); font-size: 16px; cursor: pointer; }

/* Buttons */
button { font: inherit; color: inherit; }

.big {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 26px 12px;
  cursor: pointer;
}
.big:disabled { opacity: 0.55; }
.big.dim {
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--line);
  font-weight: 600;
}
.big.dim small { display: block; font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; margin-top: 4px; }
.big.talk { padding: 18px 12px; font-size: 18px; }
.big.talk.listening { background: var(--signal); }

.small {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 16px;
  padding: 14px 12px;
  cursor: pointer;
}
.small.strong { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

/* The copy button is the last thing the tech touches, so it is the biggest
   target on the screen and says plainly when it has worked. */
.copy {
  display: block;
  width: 100%;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--surface);
  color: var(--accent);
  font-size: 20px;
  font-weight: 700;
  padding: 20px 12px;
  cursor: pointer;
}
.copy.done { background: var(--good); border-color: var(--good); color: #fff; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grow { flex: 1; }

/* Fields */
label.field { display: block; }
.field .k {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 5px;
}

input, textarea {
  font: inherit;
  width: 100%;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 12px;
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { resize: vertical; line-height: 1.5; }
textarea.notes { min-height: 34vh; flex: 1; }
input.pin { font-size: 28px; letter-spacing: 0.5em; text-align: center; }

/* Equipment chips: a phone dropdown is fiddly with gloves on, so the choices
   are buttons that stay lit. */
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 14px 10px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Report */
textarea.report {
  min-height: 42vh;
  flex: 1;
  font-size: 16px;
  background: var(--surface);
}

.note {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--accent-soft);
  color: var(--ink);
}
.note.warn { background: var(--signal-soft); color: var(--signal); }
.note.good { background: var(--good-soft); color: var(--good); }
.note b { display: block; margin-bottom: 4px; }

.muted { color: var(--muted); font-size: 15px; margin: 0; }
.error { color: var(--signal); font-size: 15px; margin: 0; }

/* Recent list */
.list { display: flex; flex-direction: column; gap: 8px; list-style: none; padding: 0; margin: 0; }
.item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px 14px;
  cursor: pointer;
}
.item .when { font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.item .what { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .tag { font-size: 12px; color: var(--signal); font-weight: 600; }

/* Working */
.working { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; flex: 1; text-align: center; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
