:root {
  --navy: #0b2b4c;
  --navy-dark: #071c33;
  --yellow: #f4b400;
  --yellow-dark: #c98f00;
  --ink: #1a1f24;
  --paper: #ffffff;
  --bg: #f4f6f8;
  --line: #dde3e9;
  --muted: #5b6670;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1e6b3c;
  --ok-bg: #e9f6ee;
  --radius: 14px;
  --header-h: 56px;
  --tab-h: 60px;
  --max-w: 760px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  padding-top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ---------- Header ---------- */

.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--navy);
  color: white;
  padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--header-h);
  padding: 0 8px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  color: white;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
}

.brand span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  overflow: hidden;
}

.brand strong {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand small {
  font-size: 11px;
  color: var(--yellow);
  letter-spacing: .03em;
}

.icon-btn {
  background: transparent;
  border: none;
  color: white;
  font-size: 20px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:active { background: rgba(255,255,255,.12); }

.search-row {
  display: flex;
  gap: 8px;
  padding: 0 8px 10px;
  max-width: var(--max-w);
  margin: 0 auto;
}

.search-row input[type="search"] {
  flex: 1;
  min-width: 0;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: white;
}

.search-row select {
  border: none;
  border-radius: 10px;
  padding: 0 8px;
  font-size: 13px;
  background: white;
  color: var(--ink);
  max-width: 40%;
}

/* ---------- Main ---------- */

.app-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 14px 24px;
}

.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 20px 4px 10px;
}

.section-title:first-child { margin-top: 4px; }

/* Category tiles on home */

.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.cat-tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(11,43,76,.05);
}

.cat-tile:active { background: #eef2f6; }

.cat-tile .cat-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow-dark);
  letter-spacing: .05em;
}

.cat-tile .cat-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

.cat-tile .cat-count {
  font-size: 12px;
  color: var(--muted);
}

/* Situation list cards */

.sit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sit-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(11,43,76,.04);
}

.sit-card:active { background: #eef2f6; }

.sit-card .sit-id {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--navy);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sit-card .sit-body {
  flex: 1;
  min-width: 0;
}

.sit-card .sit-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
}

.sit-card .sit-snippet {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sit-card .chev {
  color: var(--muted);
  flex-shrink: 0;
}

/* Detail view */

.detail-header {
  margin-bottom: 4px;
}

.detail-header .breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.detail-header h1 {
  font-size: 21px;
  line-height: 1.3;
  margin: 0 0 10px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}

.card h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 10px;
  color: var(--muted);
}

.card p { margin: 0; line-height: 1.55; font-size: 15px; }

.card.what-this-is { border-left: 4px solid var(--navy); }

.card.do { border-left: 4px solid var(--ok); }
.card.do h2 { color: var(--ok); }

.card.dont { border-left: 4px solid var(--danger); }
.card.dont h2 { color: var(--danger); }

.card.legal { border-left: 4px solid var(--yellow-dark); background: #fffaf0; }
.card.legal h2 { color: var(--yellow-dark); }

.card.cba { border-left: 4px solid #6b4fbb; background: #f7f5fc; }
.card.cba h2 { color: #6b4fbb; }
.card.cba p { margin-bottom: 10px; }

.quick-ref {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-ref-item {
  background: white;
  border: 1px solid #e3ddf3;
  border-radius: 10px;
  padding: 10px 12px;
}

.quick-ref-clause {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6b4fbb;
  margin-bottom: 6px;
}

.quick-ref-item blockquote {
  margin: 0 0 6px;
  padding-left: 10px;
  border-left: 3px solid #e3ddf3;
  font-size: 13.5px;
  line-height: 1.5;
  font-style: italic;
  color: var(--ink);
}

.quick-ref-source {
  font-size: 11.5px;
  color: var(--muted);
}

ol.steps, ul.donts {
  margin: 0;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

ol.steps li, ul.donts li {
  line-height: 1.5;
  font-size: 15px;
}

ul.donts { list-style: none; padding-left: 0; }
ul.donts li {
  padding-left: 26px;
  position: relative;
}
ul.donts li::before {
  content: "✕";
  position: absolute;
  left: 0;
  top: 1px;
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.doc-note {
  font-size: 14px;
  line-height: 1.5;
}

.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: white;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  margin: 6px 6px 0 0;
}

.related-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
}

.related-item .sit-id {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--line);
}

/* Agreement page */

.branch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.branch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
}

.branch-card.active {
  border-color: #6b4fbb;
  background: #f7f5fc;
}

.branch-card .radio-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex-shrink: 0;
  position: relative;
}

.branch-card.active .radio-dot {
  border-color: #6b4fbb;
}

.branch-card.active .radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #6b4fbb;
}

.branch-card .branch-body { flex: 1; min-width: 0; }
.branch-card .branch-name { font-weight: 700; font-size: 14.5px; }
.branch-card .branch-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.badge.on-file { background: var(--ok-bg); color: var(--ok); }
.badge.no-file { background: #f0f0f2; color: var(--muted); }
.badge.non-union { background: #eef1f4; color: var(--muted); }

.add-branch-btn {
  display: block;
  text-align: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  background: transparent;
  width: 100%;
  cursor: pointer;
  margin-bottom: 18px;
}

.add-branch-form {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.add-branch-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.upload-area {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 10px;
}

.upload-area input[type="file"] { display: none; }

.file-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.file-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.btn-outline {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  background: white;
  color: var(--ink);
  cursor: pointer;
}

.btn-outline.danger { color: var(--danger); border-color: #f2c6c2; }

/* Templates page */

.template-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.template-card .t-icon,
.file-card .t-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.template-card .t-body,
.file-card .t-body { flex: 1; min-width: 0; }
.template-card .t-name,
.file-card .t-name { font-weight: 700; font-size: 15px; }
.template-card .t-desc,
.file-card .t-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

.dl-btn {
  background: var(--yellow);
  color: var(--navy-dark);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  white-space: nowrap;
}

.dl-btn:active { background: var(--yellow-dark); }

/* Search */

.search-hint {
  color: var(--muted);
  font-size: 14px;
  text-align: center;
  padding: 40px 20px;
}

.result-count {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 4px 12px;
}

mark {
  background: rgba(244,180,0,.45);
  border-radius: 3px;
  padding: 0 1px;
}

/* Placeholder / empty states */

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.province-note {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* ---------- Tab bar ---------- */

.tab-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  height: var(--tab-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.tab-link.active { color: var(--navy); }
.tab-link .tab-icon { font-size: 19px; }

/* ---------- Responsive ---------- */

@media (min-width: 620px) {
  .cat-grid { grid-template-columns: 1fr 1fr; }
  .app-main { padding: 20px 20px 32px; }
}

@media (min-width: 900px) {
  :root { --max-w: 920px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   Tradecraft additions - i18n, tools, forms, features
   ============================================================ */

.lang-toggle {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  height: 30px;
  min-width: 38px;
  padding: 0 8px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
}
.lang-toggle:active { background: rgba(255,255,255,.28); }

.lead { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.disclaimer { color: var(--muted); font-size: 12px; text-align: center; padding: 10px 6px 0; }

/* Emergency quick actions on home */
.emergency-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.emergency-tile {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius); padding: 14px;
  color: #fff; box-shadow: 0 2px 6px rgba(11,43,76,.15);
}
.emergency-tile.inspector { background: linear-gradient(135deg, #0b2b4c, #123a63); }
.emergency-tile.timers { background: linear-gradient(135deg, #b3261e, #d33a30); }
.emergency-tile .et-icon { font-size: 26px; flex-shrink: 0; }
.emergency-tile .et-title { font-weight: 800; font-size: 14px; display: block; line-height: 1.2; }
.emergency-tile .et-sub { font-size: 11.5px; opacity: .9; display: block; margin-top: 3px; }
@media (max-width: 480px) { .emergency-grid { grid-template-columns: 1fr; } }

/* Tools hub grid */
.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }
.tool-tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 1px 2px rgba(11,43,76,.05);
}
.tool-tile:active { background: #eef2f6; }
.tool-icon { font-size: 24px; }
.tool-name { font-weight: 700; font-size: 14px; }
.tool-sub { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.records-link {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; border-radius: var(--radius);
  padding: 12px 16px; font-weight: 700; font-size: 14px; margin-bottom: 14px;
}
.records-link .chev { color: var(--yellow); }

.sit-id.big { font-size: 18px; background: var(--bg); }

/* Reg basis badge */
.reg-badge {
  display: inline-block; background: var(--navy); color: var(--yellow);
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  margin-top: 6px;
}
.reg-badge.sm { background: #eef1f4; color: var(--muted); font-size: 10.5px; margin: 2px 4px 2px 0; }

/* ---- Forms ---- */
.tc-form { margin-bottom: 8px; }
.tc-form.is-sealed { opacity: .96; }
.form-section {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.form-section h2 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--navy); margin: 0 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.form-field { margin-bottom: 12px; }
.form-field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.form-field input[type=text], .form-field input[type=number], .form-field input[type=date],
.form-field input[type=time], .form-field input[type=tel], .form-field select, .form-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; font-family: inherit; background: #fff; color: var(--ink);
}
.form-field textarea { resize: vertical; }
.req { color: var(--danger); }
.field-help { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-static {
  background: #fffaf0; border: 1px solid #f0e0b8; border-left: 4px solid var(--yellow-dark);
  border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin-bottom: 12px;
}
.radio-group, .checklist { display: flex; flex-direction: column; gap: 8px; }
.opt { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.opt input { width: 18px; height: 18px; }
.opt.single { font-weight: 500; }
.passfail { display: flex; gap: 8px; }
.passfail .pf {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px; font-size: 13px; font-weight: 600;
}
.passfail .pf input { margin: 0; }
.passfail .pf-pass { color: var(--ok); }
.passfail .pf-fail { color: var(--danger); }
.attendee-row { display: flex; gap: 8px; margin-bottom: 6px; }
.attendee-row input { flex: 1; }
.attendee-del {
  width: 40px; border: 1px solid var(--line); background: #fff; border-radius: 10px;
  color: var(--danger); font-size: 18px; cursor: pointer;
}
.add-attendee { margin-top: 4px; width: 100%; }

.form-actions { display: flex; gap: 10px; margin: 8px 0 6px; }
.form-actions > * { flex: 1; text-align: center; }
.dl-btn.block { display: block; text-align: center; padding: 12px; margin-bottom: 14px; }
.dl-btn.seal { background: var(--ok); color: #fff; }
.dl-btn.seal:active { background: #17552f; }
.sealed-banner {
  background: var(--ok-bg); color: var(--ok); border: 1px solid #bfe3ce;
  border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.seal-note, .offline-note { font-size: 12px; color: var(--muted); text-align: center; margin: 4px 0 0; }
.offline-note { color: var(--ok); }

/* ---- Bullet lists in cards ---- */
ul.bullets { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; }
ul.bullets li { font-size: 14px; line-height: 1.45; }

/* ---- Inspector / emergency cards ---- */
.detail-header.alarm h1 { color: var(--navy); }
.card.danger-card { border-left: 4px solid var(--danger); background: #fff6f5; }
.card.danger-card h2 { color: var(--danger); }
.call-row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.call-btn {
  flex: 1; text-align: center; background: var(--navy); color: #fff; border-radius: 10px;
  padding: 12px; font-weight: 700; font-size: 14px; min-width: 140px;
}
.call-btn.danger { background: var(--danger); }

/* ---- Timers ---- */
.timer-start { display: flex; flex-wrap: wrap; gap: 8px; }
.timer-type {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; font-weight: 600; cursor: pointer; flex: 1; min-width: 130px;
}
.timer-type.danger { border-color: #f2c6c2; color: var(--danger); }
.timer-head { display: flex; justify-content: space-between; align-items: baseline; }
.timer-label { font-weight: 800; font-size: 15px; }
.timer-clock { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; color: var(--danger); }
.timer-window { font-size: 13px; font-weight: 600; margin: 6px 0 2px; }
.timer-basis { font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.timer-who { font-size: 13px; }
.timer-who ul { margin-top: 6px; }
.timer-forms { margin: 10px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.timer-forms strong { width: 100%; }
.timer-forms .elaws-chip { border-color: var(--navy); color: var(--navy); }

/* Deep guidance block on forms */
.guidance-block {
  background: #f7f5fc; border: 1px solid #e3ddf3; border-left: 4px solid #6b4fbb;
  border-radius: var(--radius); padding: 4px 14px 12px; margin-bottom: 14px;
}
.guidance-block > summary {
  font-weight: 800; font-size: 14px; color: #5a3fb0; padding: 12px 0 8px; cursor: pointer;
  list-style: none;
}
.guidance-block > summary::-webkit-details-marker { display: none; }
.guidance-block > summary::before { content: "▸ "; }
.guidance-block[open] > summary::before { content: "▾ "; }
.guidance-sec { margin-top: 8px; }
.guidance-sec h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; color: #5a3fb0; margin: 8px 0 6px; }

/* Humidex response table */
.humidex-table { display: flex; flex-direction: column; gap: 6px; }
.humidex-row {
  display: flex; align-items: stretch; gap: 12px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.humidex-row .hx-range {
  flex: 0 0 64px; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: #fff; padding: 10px 4px; text-align: center;
}
.humidex-row.ok .hx-range { background: var(--ok); }
.humidex-row.warn .hx-range { background: var(--yellow-dark); }
.humidex-row.danger .hx-range { background: var(--danger); }
.humidex-row .hx-body { flex: 1; padding: 8px 10px 8px 0; display: flex; flex-direction: column; gap: 2px; }
.humidex-row .hx-body strong { font-size: 13.5px; }
.humidex-row .hx-body span { font-size: 12.5px; color: var(--muted); line-height: 1.4; }

/* ---- Toolbox topics ---- */
.topic-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.topic-card .btn-outline { margin-top: 6px; display: inline-block; }

/* ---- Gas / readings ---- */
.gas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card.flag-card { border-left: 4px solid var(--danger); background: #fdecea; }
.card.flag-card h2 { color: var(--danger); }
.device-card strong { font-size: 14px; }
.dev-row { display: flex; gap: 8px; font-size: 12.5px; margin-top: 4px; }
.dev-row span:first-child { flex: 0 0 64px; color: var(--muted); font-weight: 600; }
.reading-row { padding: 12px 14px; }
.reading-vals { font-size: 13px; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }
.reading-time { font-size: 11.5px; color: var(--muted); margin-top: 3px; }

/* ---- Weather ---- */
.wx-now { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.wx-temp { font-size: 40px; font-weight: 800; color: var(--navy); }
.wx-meta { font-size: 13px; color: var(--muted); }
.wx-guide { border-radius: 10px; padding: 12px; background: var(--bg); }
.wx-guide.legal { background: #fffaf0; border: 1px solid #f0e0b8; }
.wx-guide.do { background: var(--ok-bg); }
.wx-guide ul { margin-top: 8px; }
.wx-links { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---- Search / hazards / training ---- */
.tool-search {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; margin-bottom: 14px; background: #fff;
}
.haz-reg { margin: 4px 0 8px; }
.haz-label { display: block; font-size: 12px; text-transform: uppercase; color: var(--muted); margin: 4px 0; letter-spacing: .04em; }
.train-row .btn-outline { margin-top: 8px; }

/* Home hero */
.home-hero { width: 100%; height: auto; border-radius: var(--radius); display: block; margin-bottom: 6px; box-shadow: 0 2px 10px rgba(11,43,76,.12); }

/* Video cards */
.video-grid { display: flex; flex-direction: column; gap: 8px; }
.video-card {
  display: flex; align-items: center; gap: 12px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(11,43,76,.04);
}
.video-card:active { background: #eef2f6; }
.vid-play {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 10px;
  background: var(--danger); color: #fff; display: flex; align-items: center;
  justify-content: center; font-size: 15px;
}
.vid-body { flex: 1; min-width: 0; }
.vid-title { display: block; font-weight: 700; font-size: 14px; }
.vid-desc { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.vid-src { display: block; font-size: 11px; color: var(--yellow-dark); margin-top: 3px; font-weight: 600; }

/* e-Laws deep-link chips on situations */
.elaws-row { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.elaws-label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; width: 100%; }
.elaws-chip {
  display: inline-flex; align-items: center; gap: 2px; background: #fff;
  border: 1px solid var(--yellow-dark); color: var(--yellow-dark); border-radius: 999px;
  padding: 5px 11px; font-size: 12.5px; font-weight: 700;
}
.elaws-chip:active { background: #fffaf0; }

/* Legal disclaimers */
.app-disclaimer {
  margin: 22px 2px 4px; padding-top: 14px; border-top: 1px solid var(--line, #e2e6ea);
  font-size: 11.5px; line-height: 1.5; color: var(--muted);
}
.legal-disclaimer {
  margin: 12px 0 0; font-size: 11.5px; font-style: italic; color: var(--muted);
}
