/* HazWreck field induction — mobile-first, high-contrast, big touch targets.
   Brand: orange #fd7014, charcoal #393e46. Built for a tradie's phone in
   bright sun on a demo site, so: large type, thick tap targets, no clutter. */

:root {
  --orange: #fd7014;
  --charcoal: #393e46;
  --ink: #222831;
  --paper: #f6f7f9;
  --line: #d7dbe0;
  --red: #c62828;
  --red-bg: #fdecea;
  --amber: #b26a00;
  --amber-bg: #fff6e5;
  --green: #1b7f4b;
  --green-bg: #e7f6ee;
  --radius: 12px;
}

* { box-sizing: border-box; }

/* The [hidden] attribute must always win — component display rules below
   (.view, .swms, etc.) would otherwise override the UA `display:none` and
   render every view at once. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.topbar {
  background: var(--charcoal);
  color: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: calc(12px + env(safe-area-inset-top, 0));
}
.wordmark { font-weight: 800; letter-spacing: 0.5px; font-size: 20px; }
.wordmark .mark { color: var(--orange); }
.tag { font-size: 11px; letter-spacing: 2px; color: #aeb4bd; }

main { max-width: 640px; margin: 0 auto; padding: 16px; }
.view { display: block; }

h1 { font-size: 22px; margin: 6px 0 2px; }
h2 { font-size: 16px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--charcoal); }
.muted { color: #5b626b; }
.small { font-size: 13px; }
.hint { font-size: 14px; color: #6b727b; margin: 0 0 8px; }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 14px 0;
}

.banner { border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.banner p { margin: 6px 0 0; }
.banner-red { background: var(--red-bg); border: 2px solid var(--red); color: #7f1d1d; }
.banner-amber { background: var(--amber-bg); border: 1px solid var(--amber); color: #7a4a00; }
.banner-green { background: var(--green-bg); border: 1px solid var(--green); color: #14532d; }

#hazard-points { margin: 0; padding-left: 20px; }
#hazard-points li { margin: 6px 0; }

.swms {
  display: block;
  background: var(--charcoal);
  color: #fff;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  margin: 14px 0;
}

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input[type="text"], input:not([type]), textarea {
  width: 100%;
  font-size: 17px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
textarea { resize: vertical; }

.attest, .confirm { font-weight: 500; display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; }
.attest input, .confirm input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; }

.sig-wrap { position: relative; }
#sig {
  width: 100%;
  height: 200px;
  background: #fff;
  border: 2px dashed var(--line);
  border-radius: 10px;
  touch-action: none;
}
.link { background: none; border: none; color: var(--orange); font-weight: 600; padding: 6px 0; cursor: pointer; }

.btn {
  width: 100%;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: var(--orange);
  border: none;
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
  cursor: pointer;
}
.btn:disabled { background: #c9ccd1; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--charcoal); border: 2px solid var(--charcoal); }

.status { margin: 10px 0 0; font-weight: 600; min-height: 1.2em; }
.status.err { color: var(--red); }
.status.ok { color: var(--green); }

.pill {
  background: var(--amber-bg);
  border: 1px solid var(--amber);
  color: #7a4a00;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  text-align: center;
  margin-bottom: 12px;
}

.foot { max-width: 640px; margin: 8px auto 24px; padding: 0 16px; color: #8a909a; font-size: 12px; text-align: center; }
