/* North Trust Security: one stylesheet of named patterns.
   Light and dark follow the device setting. System fonts only.

   Patterns: site-head, brand, version, page, narrow, page-title, section-title,
   lead, muted, stack, field, btn, btn-primary, confirm, status-line, robot-slot,
   tabs, count, grid, grid-scroll, empty, received, invisible,
   question, choice, check-items, verdict, check-jobs,
   role-label, filters, owner-photo-box, crop, crop-stage. */

:root {
  --bg: #ffffff;
  --fg: #101010;
  --muted: #3d3d3d;
  --soft: #f2f2f0;
  --line: #101010;
  --rule: #c9c9c4;
  --accent: #b45309;
  --btn-bg: #101010;
  --btn-fg: #ffffff;
  --err: #9f1239;
  --ok: #166534;
  --focus: #b45309;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0f11;
    --fg: #f3f3f1;
    --muted: #c2c2bd;
    --soft: #1a1c1f;
    --line: #f3f3f1;
    --rule: #3a3d42;
    --accent: #f59e0b;
    --btn-bg: #f3f3f1;
    --btn-fg: #0e0f11;
    --err: #fda4af;
    --ok: #86efac;
    --focus: #f59e0b;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: var(--fg);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- head ---------- */
.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
  padding: 8px 16px;
  border-bottom: 3px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.version {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}

.site-head .who {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* ---------- page ---------- */
.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.page.narrow {
  max-width: 560px;
}

.page-title {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.section-title {
  margin: 32px 0 8px;
  padding-top: 12px;
  border-top: 3px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  font-size: 1.1875rem;
}

.muted {
  color: var(--muted);
}

.empty {
  margin: 8px 0;
  padding: 16px;
  background: var(--soft);
  color: var(--muted);
}

.invisible {
  visibility: hidden;
}

/* ---------- forms ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 400;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border-color: var(--btn-bg);
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Confirm in place: both labels share one cell, so the button never changes size. */
.confirm {
  display: inline-grid;
}

.confirm > span {
  grid-area: 1 / 1;
}

.confirm .armed,
.confirm.is-armed > span:first-child {
  visibility: hidden;
}

.confirm.is-armed .armed {
  visibility: visible;
}

.confirm.is-armed {
  background: var(--err);
  border-color: var(--err);
  color: var(--bg);
}

/* Errors and confirmations appear in a line that already holds its space. */
.status-line {
  min-height: 3.1em;
  margin: 0;
  font-weight: 700;
}

/* Sign in again sits inside the line as a link, so the line keeps its height. */
.status-line a {
  display: inline;
  min-height: 0;
  color: inherit;
  text-decoration: underline;
}

[hidden] {
  display: none !important;
}

.field input[type="range"] {
  padding: 0;
  border: 0;
}

.status-line.err {
  color: var(--err);
}

.status-line.ok {
  color: var(--ok);
}

/* The robot check's space is held from the start. */
.robot-slot {
  min-height: 65px;
}

/* ---------- admin tabs ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--rule);
}

.tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px;
  border-bottom: 4px solid transparent;
  font-weight: 800;
  text-decoration: none;
}

.tabs a[aria-current="page"] {
  border-bottom-color: var(--accent);
}

.count {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 6px;
  background: var(--err);
  color: var(--bg);
  font-size: 0.8125rem;
  text-align: center;
}

.count[data-count="0"],
.count[data-count=""] {
  visibility: hidden;
}

/* The admin header: the Google address with Owner or Admin. */
.role-label {
  font-weight: 800;
  color: var(--fg);
}

/* ---------- admin: audit log and owner profile ---------- */
.filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 16px;
  margin: 0 0 8px;
}

/* The owner photo keeps one fixed 96 by 96 box, in Admin as on the public pages. */
.owner-photo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  margin: 0 0 16px;
  overflow: hidden;
  background: var(--soft);
}

.owner-photo-box img,
.owner-photo-box canvas {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.crop {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin: 16px 0 0;
}

.crop-stage {
  width: 100%;
  max-width: 320px;
  height: auto;
  aspect-ratio: 1 / 1;
  background: var(--soft);
  cursor: move;
  touch-action: none;
}

/* ---------- tables ---------- */
.grid-scroll {
  width: 100%;
}

table.grid {
  width: 100%;
  border-collapse: collapse;
}

table.grid th {
  padding: 8px;
  border-bottom: 2px solid var(--line);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

table.grid td {
  padding: 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
  overflow-wrap: anywhere;
}

table.grid td .btn {
  margin: 0 8px 8px 0;
}

/* On a phone each row becomes a block of labelled lines. */
@media (max-width: 700px) {
  table.grid thead {
    display: none;
  }

  table.grid tr {
    display: block;
    padding: 8px 0;
    border-bottom: 2px solid var(--line);
  }

  table.grid td {
    display: grid;
    grid-template-columns: 7.5em 1fr;
    gap: 8px;
    padding: 4px 0;
    border: 0;
  }

  table.grid td::before {
    content: attr(data-label);
    font-size: 0.8125rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }
}

/* What a probe or a warning received. */
.received summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  font-weight: 700;
  cursor: pointer;
}

.received pre {
  margin: 4px 0 8px;
  padding: 12px;
  background: var(--soft);
  color: var(--fg);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- storefront ---------- */
.head-link,
.link-action,
.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
}

.site-head .head-link {
  margin-left: auto;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero {
  padding-bottom: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.owner {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin: 24px 0 0;
  padding: 16px;
  background: var(--soft);
}

.owner img {
  flex: none;
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.owner p {
  margin: 0 0 8px;
}

.owner-name {
  font-weight: 900;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
}

.strip {
  margin: 24px 0 0;
  border-left: 6px solid var(--accent);
  background: var(--soft);
}

.strip a {
  display: block;
  min-height: 44px;
  padding: 12px 16px;
  text-decoration: none;
}

.strip-label {
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.strip time {
  font-weight: 700;
}

.items,
.menu {
  display: grid;
  gap: 16px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.items li,
.job {
  padding: 16px;
  border: 2px solid var(--line);
}

.item-title {
  margin: 0 0 8px;
  font-size: 1.125rem;
  font-weight: 900;
}

.items p,
.job p {
  margin: 0 0 8px;
}

.job-price {
  font-size: 1.5rem;
  font-weight: 900;
}

.job-saving {
  font-weight: 700;
}

.job-cap {
  color: var(--muted);
}

@media (min-width: 900px) {
  .menu {
    grid-template-columns: 1fr 1fr;
  }
}

.promise {
  font-weight: 700;
}

.prose {
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 8px;
}

.site-foot {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  border-top: 3px solid var(--line);
}

.foot-name {
  margin: 0 0 8px;
  font-weight: 800;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

/* ---------- jobs ---------- */
.quote {
  margin: 0;
  padding: 12px 16px;
  min-height: 4.8em;
  background: var(--soft);
}

.quote-label {
  display: block;
  font-size: 1.5rem;
  font-weight: 900;
}

.quote-detail {
  color: var(--muted);
}

.field textarea {
  resize: vertical;
}

.field input[readonly] {
  background: var(--soft);
}

.portal-job .stages {
  margin: 0 0 12px;
  padding-left: 1.25em;
}

.doc-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.doc-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule);
}

.doc-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.facts {
  display: grid;
  grid-template-columns: minmax(7em, max-content) 1fr;
  gap: 4px 16px;
  margin: 8px 0 16px;
}

.facts dt {
  font-weight: 800;
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.alert {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 6px solid var(--err);
  background: var(--soft);
}

.alert p {
  margin: 0 0 8px;
  color: var(--err);
  font-weight: 700;
}

.upload input[type="file"] {
  min-height: 44px;
}

/* ---------- free check ---------- */
.question {
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.question legend {
  padding: 0;
  font-weight: 700;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* The whole label is the tap target. */
.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  cursor: pointer;
}

.choice input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}

.choice:has(input:checked) {
  background: var(--soft);
  font-weight: 800;
}

.check-items,
.check-jobs {
  display: grid;
  gap: 12px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}

.check-items li {
  padding: 12px 16px;
  border: 2px solid var(--line);
}

.check-items p {
  margin: 0 0 6px;
}

.check-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.check-label {
  font-weight: 900;
}

.verdict {
  padding: 2px 8px;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 2px solid currentColor;
}

.verdict-in_place {
  color: var(--ok);
}

.verdict-gap {
  color: var(--err);
}

.verdict-not_confirmed,
.verdict-could_not_check,
.verdict-not_sure {
  color: var(--muted);
}

.check-jobs li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
}

.check-job-name {
  flex: 1 1 14em;
  font-weight: 800;
}

.check-job-rate {
  font-weight: 900;
}
