/* Son in Town — restrained initial visual system. Change the tokens to rebrand. */
:root {
  --bg: #f7f3ec;          /* warm paper */
  --surface: #fffdf9;
  --ink: #23303b;         /* deep slate */
  --muted: #6b7178;
  --line: #e4ddd0;
  --accent: #2f5a4c;      /* evergreen: steady, trustworthy */
  --accent-ink: #ffffff;
  --accent-soft: #e6eee9;
  --warm: #a8672e;        /* porch-light amber */
  --warm-soft: #f6eadc;
  --now: #a33b2b;  --now-soft: #f7e3df;
  --soon: #a8672e; --soon-soft: #f6eadc;
  --mon: #4a6680;  --mon-soft: #e3eaf1;
  --ok: #2f5a4c;   --ok-soft: #e6eee9;
  --radius: 12px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
a { color: var(--accent); }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 640px; }

/* top bar */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.brand { font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.nav a:hover, .nav a.on { background: var(--accent-soft); color: var(--accent); }

/* cards & grids */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.grid { display: grid; gap: 16px; }
@media (min-width: 820px) { .grid.two { grid-template-columns: 1fr 1fr; } .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.side { grid-template-columns: 2fr 1fr; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-family: var(--serif); font-size: 1.5rem; }
.stat span { color: var(--muted); font-size: .85rem; }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.list .main { flex: 1 1 200px; min-width: 0; }
.empty { color: var(--muted); font-style: italic; padding: 8px 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.table-scroll { overflow-x: auto; }

/* pills */
.pill { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.pill.now, .pill.asap, .pill.overdue { background: var(--now-soft); color: var(--now); }
.pill.soon { background: var(--soon-soft); color: var(--soon); }
.pill.mon { background: var(--mon-soft); color: var(--mon); }
.pill.grey { background: #eee9e0; color: var(--muted); }

/* forms */
label { display: block; font-weight: 500; margin: 12px 0 4px; }
label .muted { font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time],
input[type=number], input[type=url], select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); min-height: 46px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.row3 { display: grid; gap: 10px; grid-template-columns: 2fr 1fr 1fr; }
@media (max-width: 520px) { .row3 { grid-template-columns: 1fr 1fr; } .row3 > :first-child { grid-column: 1 / -1; } }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label { margin: 0; font-weight: 400; }
.choices input { position: absolute; opacity: 0; pointer-events: none; }
.choices span { display: inline-block; padding: 10px 16px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; }
.choices input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.choices input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 20px; height: 20px; }
.hp { position: absolute; left: -9999px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 16px; min-height: 44px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-ink); text-decoration: none; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.warm { background: var(--warm); border-color: var(--warm); }
.btn.quiet { background: #fff; color: var(--ink); border-color: var(--line); font-weight: 500; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn.big { width: 100%; min-height: 58px; font-size: 1.1rem; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

.flash { background: var(--warm-soft); border: 1px solid #ecd6bd; padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; }
.warn { background: var(--now-soft); color: var(--now); padding: 8px 14px; font-size: .9rem; text-align: center; }
.disclaimer { font-size: .8rem; color: var(--muted); line-height: 1.45; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 28px; }

/* message composer */
.composer textarea { min-height: 120px; }
.composer .btn-row .btn { flex: 1 1 auto; }

/* public pages */
.public-head { text-align: center; padding: 36px 16px 8px; }
.public-head .brand { font-size: 2rem; display: block; }
.public-head .promise { font-family: var(--serif); font-size: 1.15rem; margin: 6px 0 2px; }

/* ---------- visit (mobile first) ---------- */
.visit-bar { position: sticky; top: 0; z-index: 20; background: var(--accent); color: #fff; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.visit-bar a { color: #fff; }
.visit-bar .who { font-weight: 600; line-height: 1.2; }
.visit-bar .who small { display: block; font-weight: 400; opacity: .85; }
.progress { font-size: .85rem; opacity: .9; white-space: nowrap; }
.section-title { position: sticky; top: 54px; z-index: 5; background: var(--bg); margin: 0; padding: 14px 0 6px; font-size: 1.05rem; display: flex; justify-content: space-between; }
.item { scroll-margin-top: 104px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.item-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 58px; background: none; border: 0; font: inherit; font-size: 1.02rem; color: var(--ink); text-align: left; cursor: pointer; }
.item-head .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: .8rem; color: #fff; }
.item-head .label { flex: 1; }
.item-head .tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.item.ok .dot { background: var(--ok); border-color: var(--ok); }
.item.issue .dot { background: var(--soon); border-color: var(--soon); }
.item.issue.p-now .dot { background: var(--now); border-color: var(--now); }
.item.issue.p-mon .dot { background: var(--mon); border-color: var(--mon); }
.item.handled .dot { background: var(--ok); border-color: var(--ok); }
.item-body { padding: 0 14px 14px; display: none; }
.item.open .item-body { display: block; }
.item.open { border-color: var(--accent); box-shadow: 0 2px 10px rgba(35,48,59,.08); }
.seg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seg button, .flags button, .chips button { font: inherit; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; cursor: pointer; }
.seg button { min-height: 52px; font-size: .85rem; font-weight: 600; padding: 4px; line-height: 1.15; }
.seg button[data-v="OK"].on { background: var(--ok); color: #fff; border-color: var(--ok); }
.seg button[data-v="Do Now"].on { background: var(--now); color: #fff; border-color: var(--now); }
.seg button[data-v="Soon"].on { background: var(--soon); color: #fff; border-color: var(--soon); }
.seg button[data-v="Monitor"].on, .seg button[data-v="Optional"].on { background: var(--mon); color: #fff; border-color: var(--mon); }
.flags { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.flags button { min-height: 52px; font-weight: 600; font-size: .9rem; }
.flags button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.flags button[data-f="professional_needed"].on { background: var(--warm); border-color: var(--warm); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 4px; -webkit-overflow-scrolling: touch; }
.chips button { white-space: nowrap; padding: 8px 12px; font-size: .88rem; border-radius: 99px; flex: none; }
.item textarea { min-height: 52px; margin-top: 6px; }
.item-foot { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.photo-btn { position: relative; overflow: hidden; }
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.saved { font-size: .8rem; color: var(--muted); margin-left: auto; }
.done-bar { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 20px 0 16px; }

/* report */
.report { background: var(--surface); max-width: 760px; margin: 24px auto; padding: 36px 32px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
@media (max-width: 600px) { .report { margin: 0; padding: 24px 18px; border-radius: 0; } }
.report header { border-bottom: 2px solid var(--accent); padding-bottom: 14px; margin-bottom: 18px; }
.report header .brand { font-size: 1.6rem; color: var(--accent); }
.report header h1 { font-size: 1.3rem; font-weight: 500; margin: 2px 0 12px; }
.report dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; font-size: .95rem; }
.report dt { color: var(--muted); }
.report dd { margin: 0; }
.report h2 { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.report h3 { display: flex; align-items: center; gap: 8px; }
.report ul { padding-left: 1.2rem; margin: .3rem 0 .8rem; }
.report li { margin-bottom: 6px; }
.report .note { color: var(--muted); }
.report .pro { background: var(--warm-soft); border-left: 4px solid var(--warm); padding: 12px 16px; border-radius: 6px; margin: 18px 0; }
.report .photos { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.report .photos img { width: 150px; height: 150px; object-fit: cover; border-radius: 6px; }
.owner-bar { max-width: 760px; margin: 16px auto 0; display: flex; gap: 8px; flex-wrap: wrap; padding: 0 16px; }
@media print {
  .owner-bar, .no-print { display: none !important; }
  body { background: #fff; }
  .report { box-shadow: none; margin: 0; max-width: none; padding: 0; }
  .report .photos img { width: 120px; height: 120px; }
}
