/* 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; } }

