:root {
  /* Enicor brand (from enicor.co.uk): teal #7FC2C6, navy #445466, Barlow type */
  --bg: #f4f6f7; --card: #fff; --ink: #1d2630; --navy: #445466; --muted: #66717d; --line: #dde3e7;
  --brand: #7fc2c6; --brand-ink: #fff; --brand-dark: #445466; --teal-dark: #4f9ea3;
  --ok: #17803d; --ok-bg: #e3f4e8; --warn: #a65b00; --warn-bg: #fff1d6;
  --bad: #c0221b; --bad-bg: #fde6e4; --grey-bg: #eceff1;
  --radius: 6px; --tap: 52px;
  font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.4; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
[hidden] { display: none !important; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  background: var(--brand); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; min-height: 58px; }
.topbar .title { display: flex; flex-direction: column; min-width: 0; }
.topbar .site { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #e3f1fc; font-weight: 700; }
.topbar .page { font-size: 19px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.back { background: none; border: 0; color: #fff; font-size: 38px; line-height: 1; padding: 0 10px 4px 0; cursor: pointer; }

main { max-width: 760px; margin: 0 auto; padding: 14px; }
.loading, .empty { color: var(--muted); text-align: center; padding: 40px 10px; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 0 10px; font-size: 12px;
  text-decoration: none; color: var(--muted); font-weight: 600; position: relative; }
.tabbar a .ico { font-size: 22px; line-height: 1; }
.tabbar a.active { color: var(--brand-dark); }
.tabbar a.active .ico { color: var(--brand); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--bad); color: #fff; font-size: 11px;
  border-radius: 10px; padding: 1px 6px; font-style: normal; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card h2, .card h3 { margin: 0 0 8px; }
h2 { font-size: 20px; } h3 { font-size: 17px; }
.muted { color: var(--muted); } .small { font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.summary div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; text-align: center; }
.summary b { display: block; font-size: 26px; line-height: 1.1; }
.summary span { font-size: 13px; color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--line); border-left-width: 6px;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; text-decoration: none; min-height: 64px; }
.item .main { flex: 1; min-width: 0; }
.item .name { font-weight: 700; font-size: 18px; }
.item .sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .chev { color: var(--muted); font-size: 26px; }
.item.s-ok { border-left-color: var(--ok); }
.item.s-defects { border-left-color: #e09a00; }
.item.s-do-not-use { border-left-color: var(--bad); }
.item.s-unchecked { border-left-color: #a9bccd; }

.pill { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn, .pill.major { background: var(--warn-bg); color: var(--warn); }
.pill.bad, .pill.unsafe { background: var(--bad-bg); color: var(--bad); }
.pill.grey, .pill.closed, .pill.minor { background: var(--grey-bg); color: var(--muted); }

.banner { border-radius: var(--radius); padding: 14px; font-weight: 700; margin-bottom: 12px; font-size: 18px; }
.banner.ok { background: var(--ok-bg); color: var(--ok); }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner.grey { background: var(--grey-bg); color: var(--muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px;
  border-radius: 10px; border: 2px solid var(--brand); background: #fff; color: var(--brand-dark); font: inherit; font-weight: 700;
  text-decoration: none; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.dark { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.block { display: flex; width: 100%; }
.btn.small { min-height: 40px; padding: 0 12px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: default; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }

label.field { display: block; margin-bottom: 14px; font-weight: 600; }
label.field > span { display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; font: inherit; padding: 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); min-height: var(--tap); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); }
textarea { min-height: 96px; resize: vertical; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { min-height: 48px; border-radius: 9px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button.on.pass, .seg button.on.yes { background: var(--ok); border-color: var(--ok); color: #fff; }
.seg button.on.fail, .seg button.on.no { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg button.on.na, .seg button.on.minor { background: #6b6e73; border-color: #6b6e73; color: #fff; }
.seg button.on.major { background: #d98a00; border-color: #d98a00; color: #fff; }
.seg button.on.unsafe { background: var(--bad); border-color: var(--bad); color: #fff; }
.seg.two { grid-template-columns: 1fr 1fr; }

.checkitem { border-bottom: 1px solid var(--line); padding: 12px 0; }
.checkitem:last-child { border-bottom: 0; }
.checkitem .q { font-weight: 600; margin-bottom: 8px; display: flex; gap: 8px; }
.checkitem .q .n { color: var(--muted); min-width: 1.6em; }
.checkitem textarea { margin-top: 8px; min-height: 70px; border-color: var(--bad); }
.checkitem.missing .q { color: var(--bad); }

.result-list { list-style: none; padding: 0; margin: 0; }
.result-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.result-list li:last-child { border-bottom: 0; }
.result-list .st { width: 54px; flex: none; font-weight: 700; font-size: 14px; }
.st.pass { color: var(--ok); } .st.fail { color: var(--bad); } .st.na { color: var(--muted); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0; }
.photos .ph { position: relative; aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: var(--grey-bg); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.photos .rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.7); color: #fff; font-size: 16px; cursor: pointer; }
.addphoto { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); border: 2px dashed #9cc7ec;
  border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--ink); background: #fff; }
.addphoto input { display: none; }

.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .who { font-weight: 700; } .comment .when { color: var(--muted); font-size: 13px; }
.comment p, .pre { white-space: pre-wrap; margin: 6px 0 0; overflow-wrap: anywhere; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; min-height: 44px; border-radius: 99px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

.login { max-width: 420px; margin: 9vh auto 0; text-align: center; }
.login .logo { width: 84px; height: 84px; margin-bottom: 12px; }
.login h1 { margin: 0 0 4px; font-size: 26px; }
.login form { text-align: left; margin-top: 22px; }
.err { color: var(--bad); font-weight: 600; margin: 8px 0; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); top: calc(70px + env(safe-area-inset-top)); z-index: 20;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; max-width: 90vw; box-shadow: 0 6px 24px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 30; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; }
.sticky-submit { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 15px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
@media (min-width: 640px) { .summary b { font-size: 30px; } }
label.row input[type=checkbox] { width: 26px; height: 26px; flex: none; margin: 0; accent-color: var(--brand); }
label.row { align-items: flex-start; font-weight: 600; cursor: pointer; }
.banner + a.btn.block { margin-bottom: 12px; }
.addphoto { margin-bottom: 14px; }
.actions .btn { padding: 0 10px; white-space: nowrap; }

.sheettitle { font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--brand-dark); margin-bottom: 6px; }
.sheethead { padding: 12px 10px; }
.weeknav { display: flex; align-items: center; gap: 10px; margin: 4px 0 10px; }
.weeknav .wk { flex: 1; text-align: center; display: flex; flex-direction: column; }
.weeknav .btn { width: 48px; font-size: 24px; padding: 0; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.weeksheet { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.25; }
.weeksheet th, .weeksheet td { border: 1px solid var(--line); padding: 6px 4px; }
.weeksheet thead th { background: #e3f1fc; color: var(--ink); font-weight: 700; }
.weeksheet tbody th { text-align: left; font-weight: 500; min-width: 150px; }
.weeksheet .c { width: 34px; min-width: 34px; text-align: center; font-weight: 700; }
.weeksheet thead .c span, .weeksheet thead .c small { display: block; }
.weeksheet thead .c small { font-weight: 500; color: var(--muted); }
.weeksheet thead .c a { color: var(--brand-dark); text-decoration: none; display: block; }
.weeksheet thead .c.today { background: var(--brand); }
.weeksheet thead .c.today, .weeksheet thead .c.today small, .weeksheet thead .c.today a { color: #fff; }
.weeksheet td.pass { color: var(--ok); }
.weeksheet td.fail { color: #fff; background: var(--bad); }
.weeksheet td.na { color: var(--muted); font-size: 10px; font-weight: 600; }
.weeksheet tr.foot th { font-weight: 700; background: var(--grey-bg); }
.weeksheet tr.foot td { font-size: 11px; background: var(--grey-bg); overflow-wrap: anywhere; }
.legend { margin-top: 8px; }
.result-list a.pre { color: var(--ink); text-decoration: none; display: block; margin: 0; }
/* fit all seven days on a phone */
.sheethead { padding: 12px 8px; }
.weeksheet { table-layout: fixed; font-size: 12px; }
.weeksheet tbody th { min-width: 0; padding: 5px 4px; overflow-wrap: anywhere; }
.weeksheet .c { width: 31px; min-width: 0; padding: 5px 1px; }
.weeksheet tr.foot td { font-size: 10px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.weeksheet thead th:first-child { text-align: left; padding-left: 4px; }
@media (min-width: 600px) { .weeksheet { font-size: 14px; } .weeksheet .c { width: 52px; } .weeksheet tr.foot td { font-size: 12px; } }
.tabs button { font-size: 15px; padding: 0 6px; white-space: nowrap; }

.sect { margin: 16px 2px 8px; font-size: 15px; color: var(--muted); }
.spacer-sm { height: 12px; }
.hint { display: block; font-weight: 400; margin-top: 6px; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.hirecard { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--brand); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 12px; text-decoration: none; font-weight: 600; }
.hirecard span:nth-child(2) { flex: 1; min-width: 0; }
.hirecard .chev { color: var(--muted); font-size: 24px; }
.item .pill + .pill { margin-left: 6px; }
.grid2 > * { min-width: 0; }
input[type=date] { min-width: 0; max-width: 100%; display: block; }

/* ---------- Enicor website style ---------- */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/fonts/barlow-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("/fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }
h1, h2, h3, .topbar .page, .summary b, .item .name, .banner, .sheettitle, .login h1 { font-family: "Barlow Semi Condensed", "Barlow", sans-serif; }
h2, h3, .item .name { color: var(--navy); font-weight: 600; }
.topbar { background: #fff; color: var(--navy); border-bottom: 4px solid var(--brand); box-shadow: 0 1px 6px rgba(0,0,0,.06); min-height: 64px; }
.topbar .brandlogo { height: 30px; width: auto; flex: none; display: block; }
.topbar .title { border-left: 2px solid var(--line); padding-left: 10px; }
.topbar .site { color: var(--teal-dark); }
.topbar .page { color: var(--navy); font-weight: 600; font-size: 21px; }
.back { color: var(--navy); }
.tabbar { border-top: 1px solid var(--line); }
.tabbar a { text-transform: uppercase; letter-spacing: .03em; font-size: 11px; color: #3b4652; }
.tabbar a.active { color: var(--navy); box-shadow: inset 0 3px 0 var(--brand); }
.tabbar a.active .ico { color: var(--brand); }
.btn { border-radius: 4px; border-color: var(--navy); color: var(--navy); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; letter-spacing: .01em; }
.btn.dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.danger { border-color: var(--bad); }
input[type=text], input[type=password], input[type=search], input[type=date], select, textarea { border-radius: 4px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(127,194,198,.3); }
.seg button, .tabs button, .addphoto { border-radius: 4px; }
.tabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.addphoto { border-color: var(--brand); color: var(--navy); }
.hirecard { border-color: var(--brand); }
.weeksheet thead th { background: #e8f4f5; color: var(--navy); }
.weeksheet thead .c.today { background: var(--brand); }
.sheettitle { color: var(--teal-dark); text-transform: uppercase; letter-spacing: .04em; }
.login { margin-top: 7vh; }
.login .logo { width: 250px; max-width: 80%; height: auto; margin-bottom: 18px; }
.login h1 { color: var(--navy); font-weight: 600; font-size: 30px; border-left: 3px solid var(--brand); display: inline-block; padding-left: 12px; }
.demo-note, .demo-strip { background: #e8f4f5; color: var(--navy); }
.toast { background: var(--navy); }
a { color: var(--navy); }
