/* core.css - shared look for MWM PWA prototypes. Large touch targets for gloved site use. */
:root {
  --green: #1E4632; --deep: #163526; --gold: #C9A54C; --cream: #F6F1E4; --paper: #FFFDF8;
  --ink: #1d231f; --muted: #5d665f; --line: #d9d2bf; --danger: #A3302A; --warn: #B7791F; --ok: #2F6B45; --info: #2B5C8A;
  --r: 14px; --tap: 56px;
  --serif: Georgia, 'Noto Serif', 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 17px/1.45 var(--sans); padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--serif); color: var(--deep); line-height: 1.2; }
h1 { font-size: 1.5rem; margin: .2rem 0 .8rem; } h2 { font-size: 1.2rem; margin: 1.4rem 0 .6rem; } h3 { font-size: 1.1rem; margin: .4rem 0 .6rem; }
.muted { color: var(--muted); font-size: .92rem; }
.small { font-size: .85rem; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; background: var(--green); color: #fff; display: flex; align-items: center; gap: 6px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px; border-bottom: 3px solid var(--gold); min-height: 64px; }
.bar .title { flex: 1; min-width: 0; }
.bar .title b { display: block; font-family: var(--serif); font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .title span { display: block; font-size: .78rem; color: #e8dcb8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { min-width: var(--tap); min-height: var(--tap); border: 0; background: transparent; color: #fff; font-size: 1.5rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.iconbtn:active { background: rgba(255,255,255,.15); }
.brandlogo { height: 40px; max-width: 90px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }

main { max-width: 760px; margin: 0 auto; padding: 14px 16px; }

/* cards & lists */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 12px; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; min-height: 72px; text-decoration: none; color: inherit; }
.item:active { background: #f0ead8; }
.item .grow { flex: 1; min-width: 0; }
.item .t { font-weight: 650; display: block; overflow: hidden; text-overflow: ellipsis; }
.item .s { color: var(--muted); font-size: .88rem; display: block; }
.thumb { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; background: #e9e3d2; flex: none; }
.chev { color: var(--muted); font-size: 1.4rem; }
.empty { text-align: center; padding: 30px 14px; color: var(--muted); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 10px 18px; border-radius: 12px; border: 2px solid var(--green); background: #fff; color: var(--green); font: 600 1rem var(--sans); text-decoration: none; cursor: pointer; width: 100%; }
.btn.primary { background: var(--green); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--deep); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn:active { transform: translateY(1px); filter: brightness(.95); }
.btn[disabled] { opacity: .5; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }
.fab { position: fixed; right: 16px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 15; min-height: 64px; padding: 0 24px; border-radius: 32px; background: var(--gold); color: var(--deep); border: 0; font: 700 1.05rem var(--sans); box-shadow: 0 6px 18px rgba(0,0,0,.25); }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.tabs a { flex: none; min-height: 48px; padding: 0 16px; border-radius: 24px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; text-decoration: none; color: var(--deep); font-weight: 600; }
.tabs a.on { background: var(--green); color: #fff; border-color: var(--green); }

/* forms */
label.f { display: block; margin: 0 0 14px; }
label.f > span { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; color: var(--deep); }
label.f > em { display: block; font-style: normal; font-size: .82rem; color: var(--muted); margin-top: 4px; }
input, select, textarea { width: 100%; min-height: var(--tap); padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: 1rem var(--sans); color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,165,76,.25); }
input[type=checkbox] { width: 28px; min-height: 28px; height: 28px; accent-color: var(--green); flex: none; }
.check { display: flex; gap: 12px; align-items: center; min-height: var(--tap); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.seg button { flex: 1 1 auto; min-height: 52px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: 600 .95rem var(--sans); color: var(--deep); }
.seg button.on { border-color: var(--green); background: var(--green); color: #fff; }
fieldset { border: 0; padding: 0; margin: 0; }

/* repeatable rows */
.rows .rowcard { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 10px 0; margin-bottom: 10px; background: #fffef9; position: relative; }
.rows .rowcard .del { position: absolute; top: 4px; right: 4px; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--danger); font-size: 1.3rem; }

/* photos */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #e9e3d2; }
.photobtns { display: flex; gap: 10px; margin-bottom: 14px; }
.photobtns label { flex: 1; }
.photobtns input { display: none; }
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; flex-direction: column; }
.viewer img { flex: 1; min-height: 0; object-fit: contain; width: 100%; }
.viewer .vbar { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: #111; }

/* badges & pills */
.pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700; background: #e7e2d3; color: var(--deep); white-space: nowrap; }
.pill.open { background: #f7dcd8; color: var(--danger); } .pill.progress { background: #f8e9c9; color: #7a4f0b; }
.pill.closed { background: #dbe8f3; color: var(--info); } .pill.verified { background: #d9ecdf; color: var(--ok); }
.pill.pA { background: var(--danger); color: #fff; } .pill.pB { background: var(--warn); color: #fff; } .pill.pC { background: #8b8b8b; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-size: 1.5rem; font-family: var(--serif); color: var(--green); } .stat span { font-size: .75rem; color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table.t { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.t th, table.t td { padding: 8px 10px; border-bottom: 1px solid #eee5cf; text-align: left; white-space: nowrap; }
table.t th { background: var(--green); color: #fff; font-weight: 600; }
table.t td.n, table.t th.n { text-align: right; }
table.t tr.tot td { font-weight: 700; background: var(--cream); }

/* notices */
.notice { border-left: 5px solid var(--gold); background: #fbf3dc; padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; font-size: .95rem; }
.notice.strong { border-color: var(--danger); background: #fbe9e6; }
.saved { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(92px + env(safe-area-inset-bottom)); background: var(--deep); color: #fff; padding: 6px 14px; border-radius: 20px; font-size: .85rem; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; }
.saved.show { opacity: .92; }
#toast { position: fixed; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 70; background: var(--deep); color: #fff; padding: 14px 16px; border-radius: 12px; text-align: center; opacity: 0; transform: translateY(20px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; }
.menu a, .menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 0 12px; border: 0; border-bottom: 1px solid var(--line); background: none; font: 1rem var(--sans); color: var(--ink); text-decoration: none; text-align: left; }

/* step progress */
.progress { height: 10px; background: #e6dfcb; border-radius: 6px; overflow: hidden; margin: 6px 0; }
.progress i { display: block; height: 100%; background: var(--gold); }
.prose p, .prose li { max-width: 62ch; }
@media (min-width: 700px) { body { font-size: 17px; } .photos { grid-template-columns: repeat(4, 1fr); } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* v0.2: section tiles, day strip, chips, signatures, QR, permit states */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.tile, .qa { position: relative; min-height: 108px; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 14px 12px 12px; display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; text-decoration: none; color: var(--ink); border-left: 6px solid var(--gold); }
.tile:active, .qa:active { background: #f0ead8; }
.tile i { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: .8rem; color: var(--muted); }
.tile b, .qa b { font-family: var(--serif); font-size: 1.22rem; color: var(--deep); line-height: 1.15; }
.tile span, .qa span { font-size: .84rem; color: var(--muted); }
.alert { color: var(--danger); }
.daynav { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.navbtn { min-width: var(--tap); min-height: var(--tap); display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 2px solid var(--green); background: #fff; color: var(--green); font-size: 1.8rem; text-decoration: none; }
.navbtn.off { border-color: var(--line); color: var(--line); }
.dpick { flex: 1; min-width: 0; text-align: center; }
.dpick b { display: block; font-size: .9rem; color: var(--deep); margin-bottom: 4px; }
.dpick input { min-height: 48px; padding: 8px 10px; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 14px; }
.chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1px solid var(--line); background: #fff; font: 600 .9rem var(--sans); color: var(--deep); }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.subtabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0 0 14px; }
.subtabs a { min-height: 52px; display: flex; align-items: center; justify-content: center; text-align: center; border-radius: 12px; border: 2px solid var(--line); background: #fff; text-decoration: none; color: var(--deep); font-weight: 650; font-size: .92rem; line-height: 1.1; padding: 4px; }
.subtabs a.on { background: var(--green); border-color: var(--green); color: #fff; }
.sigbox { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px; margin: 0 0 14px; }
.sighead { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
canvas.sig { width: 100%; height: 170px; background: #fff; border: 2px dashed var(--green); border-radius: 12px; touch-action: none; display: block; margin-bottom: 6px; }
.sigimg { display: block; width: 100%; max-width: 360px; aspect-ratio: 3 / 1; object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 6px; }
.sigbox .row { margin-top: 8px; }
.sigbox .btn.gold { margin-top: 10px; }
.qrbox { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; text-align: center; margin: 0 0 14px; }
.qrbox svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 0 auto 10px; }
.qrtext { white-space: pre-wrap; text-align: left; font: .85rem/1.4 ui-monospace, Menlo, Consolas, monospace; background: var(--cream); border-radius: 10px; padding: 10px; margin: 0 0 12px; }
.qrfull { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 14px; }
.qrfull svg { width: min(92vw, 70vh); height: auto; }
.qrfull b { font: 700 1.4rem var(--sans); }
.pill.draft, .pill.cancelled { background: #e7e2d3; color: #555; }
.pill.issued, .pill.accepted { background: #d9ecdf; color: var(--ok); }
.pill.extended, .pill.items, .pill.ending { background: #f8e9c9; color: #7a4f0b; }
.pill.expired, .pill.rejected, .pill.action { background: var(--danger); color: #fff; }
.pill.ok { background: #d9ecdf; color: var(--ok); } .pill.na { background: #e7e2d3; color: #555; }
.banner { border-radius: 12px; padding: 12px 14px; margin: 0 0 14px; font-weight: 650; background: #eef2ef; border-left: 6px solid var(--green); }
.banner.expired { background: #fbe9e6; border-color: var(--danger); color: var(--danger); }
.banner.ending { background: #fbf3dc; border-color: var(--warn); }
.banner.closed, .banner.cancelled, .banner.draft { background: #f1eee5; border-color: #8b8b8b; }
.chk { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 10px 0; margin: 0 0 10px; position: relative; }
.chk.bad { border-color: var(--danger); background: #fdf3f1; }
.chk .chkt { width: calc(100% - 46px); min-height: 44px; padding: 6px 8px; border: 1px dashed transparent; border-radius: 8px; font-weight: 650; font-size: .98rem; background: transparent; margin-bottom: 8px; }
.chk .chkt:focus { border-color: var(--gold); background: #fff; }
.chk .seg { margin-bottom: 10px; }
.chk .seg button { min-height: 50px; }
.chk .del { position: absolute; top: 4px; right: 4px; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--danger); font-size: 1.2rem; }
.scanv { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; margin-bottom: 10px; object-fit: cover; }
.hit { background: #fbf3dc; border-radius: 4px; padding: 0 2px; }
.sectitle { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }


/* v1.1: trade photos on labour lines, trade tags on photos, trade breakdown */
.photos .ph { position: relative; display: block; min-width: 0; }
.photos .ph b { position: absolute; left: 4px; right: 4px; bottom: 4px; background: rgba(22,53,38,.86); color: #fff; font-size: .7rem; font-weight: 600; padding: 2px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photos .ph i { display: block; font-style: normal; font-size: .74rem; line-height: 1.25; color: var(--muted); margin-top: 3px; overflow-wrap: anywhere; }
.photos.small { grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 8px; }
.rowphotos { margin-top: 2px; }
.rowphotos .photobtns { margin-bottom: 10px; }
.seg a { flex: 1 1 auto; min-height: 52px; padding: 6px 12px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: 600 .95rem var(--sans); color: var(--deep); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.seg a.on { border-color: var(--green); background: var(--green); color: #fff; }
.tradecard h2 { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.tradecard h2 .pill { font-family: var(--sans); font-size: .85rem; }
.tradecard ul { margin: 0 0 10px; padding-left: 20px; }
.tradecard li { margin-bottom: 4px; }
.tradecard h3 { font-size: 1rem; margin: 10px 0 6px; }
.viewer select { min-height: 48px; }
.viewer .vf { display: block; }
.viewer .vf span { display: block; color: #c9c9c9; font-size: .8rem; margin-bottom: 2px; }
.viewer .vf input, .viewer .vf select { min-height: 46px; padding: 8px 12px; }

/* v1.1 onboarding: first-run intro, Getting started checklist, grouped project hub, empty-screen hints */
body.noscroll { overflow: hidden; }
.grp { font: 700 .78rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }
.tiles.today { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tiles.today .tile, .tiles.today .qa { min-height: 112px; padding: 12px 10px 10px; border-left-color: var(--green); }
.tiles.today b { font-size: 1.15rem; }
.tic { position: absolute; top: 10px; left: 10px; color: var(--green); line-height: 0; }
.tiles.more .tile { min-height: 84px; }
.hint { color: var(--muted); font-size: .95rem; background: var(--paper); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; }
.gs { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 0 0 16px; }
.gs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gs-head h2 { margin: 0; } .gs-head span { color: var(--muted); font-size: .9rem; font-weight: 600; }
.gs ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.gs-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; font: 600 1rem var(--sans); text-align: left; cursor: pointer; }
.gs-row:active { background: #f0ead8; }
.gs-n { flex: none; width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--cream); border: 2px solid var(--line); color: var(--deep); font-weight: 700; }
.gs-t { flex: 1; min-width: 0; } .gs-t em { font-style: normal; font-weight: 500; font-size: .82rem; color: var(--muted); margin-left: 4px; }
.gs-row.done { background: #f7f4ea; color: var(--muted); } .gs-row.done .gs-n { background: var(--ok); border-color: var(--ok); color: #fff; }
.gs-row.next { border-color: var(--gold); background: #fbf3dc; box-shadow: 0 0 0 3px rgba(201,165,76,.25); }
.gs-row.next .gs-n { background: var(--gold); border-color: var(--gold); color: var(--deep); }
.gs-go { flex: none; background: var(--green); color: #fff; border-radius: 20px; padding: 6px 14px; font-size: .9rem; }
.intro { position: fixed; inset: 0; z-index: 80; background: var(--green); color: #fff; display: flex; flex-direction: column; padding: calc(8px + env(safe-area-inset-top)) 0 calc(18px + env(safe-area-inset-bottom)); }
.intro-top { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 0 20px; font: 700 1.05rem var(--serif); color: var(--gold); }
.intro-skip { min-height: var(--tap); min-width: 88px; border: 0; background: transparent; color: #fff; font: 600 1.05rem var(--sans); border-radius: 12px; cursor: pointer; }
.intro-skip:active { background: rgba(255,255,255,.15); }
.intro-cards { flex: 1; min-height: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.intro-cards::-webkit-scrollbar { display: none; }
.intro-card { flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 32px; }
.intro-ic { width: 128px; height: 128px; border-radius: 50%; background: rgba(255,255,255,.07); border: 2px solid var(--gold); color: var(--gold); display: flex; align-items: center; justify-content: center; margin-bottom: 28px; }
.intro-step { margin: 0 0 8px; font-size: .85rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #e8dcb8; }
.intro-card h2 { color: #fff; font-size: 1.6rem; margin: 0; max-width: 16ch; }
.intro-dots { display: flex; justify-content: center; gap: 8px; margin: 10px 0 18px; }
.intro-dots i { width: 10px; height: 10px; border-radius: 5px; background: rgba(255,255,255,.3); transition: width .2s, background .2s; }
.intro-dots i.on { background: var(--gold); width: 26px; }
.intro-foot { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px; }
.intro-foot .btn.primary { background: var(--gold); border-color: var(--gold); color: var(--deep); min-height: 60px; font-size: 1.1rem; }
.tile span b, .qa span b { font: 700 .84rem var(--sans); color: var(--danger); }

/* v1.2 (8 Nov 2026): one-page photo-first diary. Plain headings and thin lines instead of boxes; 2 button styles
   (green filled = the one main action, green outline = everything else); text links only for Remove / Delete. */
body { font-size: 18px; }
label.f > span, .fl { display: block; font-weight: 600; font-size: 1rem; margin-bottom: 5px; color: var(--deep); }
.fab { background: var(--green); color: #fff; }
.btn.gold { background: #fff; border-color: var(--green); color: var(--green); }
.iconbtn.lab { font: 600 1rem var(--sans); padding: 0 10px; min-width: 0; white-space: nowrap; }
.btn.big { min-height: 64px; font-size: 1.15rem; margin-top: 22px; }
.center { text-align: center; }
.linkbtn { min-height: 48px; padding: 0 6px; border: 0; background: none; color: var(--danger); font: 600 .95rem var(--sans); text-decoration: underline; cursor: pointer; }
.menu .warn { color: var(--danger); font-weight: 600; }
.diary .dsec { border-top: 1px solid var(--line); padding: 16px 0 4px; }
.diary .dsec.main { border-top: 0; padding-top: 4px; }
.diary .dsec h2 { margin: 0 0 10px; font-size: 1.3rem; }
.dsh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dsh h2 { margin-bottom: 6px !important; }
textarea.note { min-height: 60px; height: 60px; resize: none; overflow: hidden; font-size: 1.05rem; line-height: 1.45; margin-bottom: 10px; }
.strip .photos.small { grid-template-columns: repeat(3, 1fr); }
.strip .photobtns .btn { min-height: 52px; }
.entries { display: grid; gap: 18px; margin-bottom: 14px; }
.entry { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.entry img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 12px; background: #e9e3d2; margin-bottom: 10px; }
.entry .f { margin-bottom: 12px; }
.stepper { display: flex; gap: 8px; align-items: stretch; }
.stepper button { flex: none; width: 64px; min-height: 56px; border-radius: 12px; border: 2px solid var(--green); background: #fff; color: var(--green); font: 700 1.6rem var(--sans); cursor: pointer; }
.stepper input { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 700; }
.erow { display: flex; justify-content: space-between; align-items: center; }
details.more { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
details.more summary { min-height: 56px; display: flex; align-items: center; font-weight: 600; color: var(--green); cursor: pointer; }
details.more[open] summary { margin-bottom: 8px; }
.daynav .dpick b { font-size: 1.05rem; }
.psec { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.psec h2 { margin-top: 4px; }
.chk .chkt { min-height: 48px; width: calc(100% - 52px); }
.chk .del, .rows .rowcard .del { min-width: 48px; min-height: 48px; }
/* v1.3 one-page diary: a box per trade, then every section in one scroll */
.start1 { padding-top: 10px; }
.wline { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.wline span { font-weight: 600; color: var(--deep); flex: none; }
.gangs { display: grid; gap: 12px; margin-bottom: 12px; }
.gang, .pitem { background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 10px; }
.gtop { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.gno { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 700; }
.gtop input { flex: 1; font-weight: 600; }
.gdel { flex: none; width: 48px; min-height: 48px; border: 0; background: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; }
.grow2 { display: flex; gap: 8px; margin-bottom: 8px; }
.gloc { display: block; width: 100%; margin-bottom: 8px; font-size: 1.05rem; }
.gang textarea.gtask, .pitem textarea.gtask { display: block; width: 100%; min-height: 52px; height: 52px; margin-bottom: 8px; }
.gcount { display: flex; gap: 4px; }
.gcount button { width: 48px; min-height: var(--tap); border-radius: 12px; border: 2px solid var(--green); background: #fff; color: var(--green); font: 700 1.4rem var(--sans); cursor: pointer; }
.gcount input { width: 58px; text-align: center; font-weight: 700; font-size: 1.1rem; padding: 12px 4px; }
.gang .rowphotos .photobtns, .pitem .rowphotos .photobtns { margin-bottom: 0; }
.gang .rowphotos .btn, .pitem .rowphotos .btn, .diary .dsec .rowphotos .btn { min-height: 48px; }
.gang .photos.small, .pitem .photos.small, .diary .dsec .photos.small { margin-bottom: 8px; }
.diary .dsec { padding: 14px 0 10px; }
.diary .dsec h2 { font-size: 1.15rem; margin-bottom: 8px; }
.diary textarea.note { margin-bottom: 8px; }
.diary .dsec .rowphotos .photobtns { display: flex; gap: 8px; }
.diary .dsec .rowphotos .btn { width: auto; padding: 8px 16px; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
@media (min-width: 761px) { .gangs { grid-template-columns: 1fr 1fr; } }
.diary .dsec .photobtns label, .gang .photobtns label, .pitem .photobtns label { flex: none; }
.gang .photobtns label, .pitem .photobtns label { min-width: 120px; }
/* v1.3 start page: all diaries by month, photo on the left (Site Audit Pro style), "+ New diary" button bottom right */
.logpage { padding-bottom: 90px; }
.mon { font: 600 1rem var(--sans); color: var(--muted); margin: 8px 0 10px; }
.log { display: grid; gap: 6px; margin-bottom: 14px; background: #fff; border-radius: 18px; padding: 6px; }
.logday { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); min-height: 88px; }
.logday + .logday { border-top: 1px solid #eee8d8; }
.logday .lpic { flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--green); display: flex; }
.logday .lpic img { width: 100%; height: 100%; object-fit: cover; }
.logday .ld { width: 100%; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.logday .ld b { font-size: 1.6rem; } .logday .ld i { font-style: normal; font-size: .85rem; color: var(--gold); margin-top: 4px; }
.logday .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.logday .t { font-size: 1.1rem; font-weight: 600; } .logday .t em { font-style: normal; font-size: .8rem; background: var(--gold); color: var(--deep); border-radius: 999px; padding: 2px 8px; margin-left: 4px; vertical-align: middle; }
.logday .s { color: var(--muted); font-size: .92rem; }
.fab.newday { font-size: 1.1rem; }
.logday .s svg { vertical-align: -3px; }
.lsum-line { margin: 0 0 8px; }

/* Drawings, pins and mark-up */
.mkblock { margin: 10px 0; }
.mkblock .mkprev { display: block; width: 100%; max-height: 260px; object-fit: contain; background: #fff; border: 1px solid var(--line, #ccc); border-radius: 10px; margin: 6px 0; }
.mkblock .row2 { display: flex; gap: 8px; } .mkblock .row2 .btn { flex: 1; }
.dwglist { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.dwglist.big { grid-template-columns: 1fr; }
.dwg { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line, #ccc); border-radius: 10px; background: var(--card, #fff); color: inherit; font: inherit; text-align: left; }
.dwg img { width: 100%; height: 120px; object-fit: contain; background: #fff; border-radius: 6px; }
.dwglist.big .dwg img { height: 200px; }
.dwg input { width: 100%; }
.pagepick { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.mk { position: fixed; inset: 0; z-index: 200; background: #222; display: flex; flex-direction: column; color: #fff; }
.mk-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: #111; }
.mk-top b { flex: 1; text-align: center; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mk-top .btn { min-height: 40px; padding: 6px 14px; width: auto; }
.mk-top .btn.ghost { color: #fff; border-color: #666; }
.mk-stage { flex: 1; position: relative; overflow: hidden; touch-action: none; }
.mk-layer { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.mk-layer img, .mk-layer canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; pointer-events: none; }
.mk-hint { margin: 0; padding: 6px 10px; font-size: 13px; background: #111; color: #ddd; text-align: center; }
.mk-tools { display: flex; overflow-x: auto; gap: 4px; padding: 6px; padding-bottom: max(6px, env(safe-area-inset-bottom)); background: #111; }
.mk-tools button { flex: 0 0 auto; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border: 0; border-radius: 8px; background: #2a2a2a; color: #fff; font: inherit; font-size: 11px; }
.mk-tools button span { font-size: 20px; line-height: 1; }
.mk-tools button.on { background: #f5b301; color: #111; }
.mk-tools .sw { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; }

/* Labour list collapse (1.6.2) */
#sec-labour.lcol .gangs, #sec-labour.lcol .gloose, #sec-labour.lcol [data-act=gang-copy] { display: none; }
.gmini { display: none; }
#sec-labour.lcol .gmini { display: block; border: 1px solid var(--line, #ccc); border-radius: 12px; background: var(--card, #fff); margin-bottom: 10px; cursor: pointer; overflow: hidden; }
.gmini .gm { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 8px 12px; border-bottom: 1px solid var(--line, #e5e5e5); }
.gmini .gm b { font-weight: 600; } .gmini .gm span { font-weight: 700; text-align: right; } .gmini .gm i { grid-column: 1 / -1; font-style: normal; color: var(--muted, #666); font-size: 13px; }
.gmini .gm i:empty { display: none; }
.gmini .gm-open { padding: 8px 12px; text-align: center; color: var(--accent, #1f5135); font-weight: 600; font-size: 14px; }
.btn.lab-tog { margin-bottom: 10px; }

/* Executive summary (1.7.0) */
.exec-day{display:flex;align-items:center;gap:12px;cursor:pointer}.exec-day input{width:22px;height:22px;flex:0 0 auto}
.exec-quick{display:flex;gap:8px;margin:8px 0}.exec-quick .btn{flex:1}
.ex-wrap{overflow-x:auto}.ex-tab{width:100%;border-collapse:collapse;font-size:14px}
.ex-tab th,.ex-tab td{padding:6px 6px;border-bottom:1px solid var(--line,#ddd);text-align:left;vertical-align:middle}
.ex-tab .num{text-align:right;width:44px;font-weight:600}.ex-tab .ex-dh th{background:var(--accent,#1f5135);color:#fff;font-weight:600}
.ex-tab .ex-tot td{font-weight:700}.ex-tab tfoot td{border-top:2px solid var(--accent,#1f5135)}
.ex-note{width:100%;min-width:140px;padding:6px 8px;font:inherit;border:1px solid var(--line,#ccc);border-radius:8px;background:var(--card,#fff);color:inherit}
.ex-note{resize:vertical;min-height:44px;line-height:1.35}

/* 1.7.1 collapsed labour list grouped by level */
.gmini .gm-lev + .gm-lev { border-top: 2px solid var(--line, #ccc); }
.gmini .gm-lh { display: flex; justify-content: space-between; padding: 7px 12px; background: var(--chip, rgba(201,165,76,.16)); font-size: 14px; }
.gmini .gm-lh span { font-weight: 700; }

/* Week folders (1.7.4) */
.wkf { background: #fff; border-radius: 18px; margin-bottom: 8px; }
.wkf > summary { list-style: none; display: flex; align-items: center; gap: 14px; padding: 16px; min-height: 88px; cursor: pointer; color: var(--ink); }
.wkf > summary::-webkit-details-marker { display: none; }
.wkf > summary .lpic { flex: none; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--green); display: flex; }
.wkf > summary .ld { width: 100%; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.wkf > summary .ld b { font-size: 1.6rem; } .wkf > summary .ld i { font-style: normal; font-size: .85rem; color: var(--gold); margin-top: 4px; }
.wkf > summary .grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.wkf > summary .t { font-size: 1.1rem; font-weight: 600; } .wkf > summary .s { color: var(--muted); font-size: .92rem; }
.wkf .chev { flex: none; width: 12px; height: 12px; border-right: 2.5px solid var(--muted); border-bottom: 2.5px solid var(--muted); transform: rotate(45deg); margin-right: 6px; transition: transform .2s; }
.wkf[open] .chev { transform: rotate(-135deg); }
.wkf > .log { margin: 0 6px 6px; padding-top: 0; }
.wkf[open] > summary { border-bottom: 1px solid #eee8d8; }

/* Task suggestions (1.7.5) */
.tsug { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; }
.tsug[hidden] { display: none; }
.tsug .tsb { font: inherit; font-size: .95rem; min-height: 44px; padding: 8px 12px; border-radius: 14px; border: 1.5px solid var(--gold, #C9A54C); background: rgba(201,165,76,.12); color: inherit; text-align: left; cursor: pointer; max-width: 100%; }
