/* Tavern Trail — one cacheable stylesheet for the public site, the business app and the guest app.
   Brand colors arrive as --brand-dark / --brand-accent (+ readable --on-dark / --on-accent) on <html>. */
:root {
  --brand-dark: #1d1915; --brand-accent: #c9852c; --on-dark: #fff; --on-accent: #111;
  --paper: #f7f4ee; --sheet: #fffdf9; --ink: #1f1b17; --muted: #6b6259; --rule: #e6dfd3; --tint: #f0ebe2;
  --ok: #2f6b3a; --ok-bg: #e3efe3; --warn: #8a5a00; --warn-bg: #f6ead2; --bad: #9b2c2c; --bad-bg: #f7e1df;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --radius: 10px; --sidebar: 210px; --topbar: 56px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--body); }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .4em; text-wrap: balance; }
p { margin: 0 0 1em; }
.ic { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--brand-accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 1.5px solid transparent; font: 600 15px var(--body); text-decoration: none; cursor: pointer;
  background: var(--brand-accent); color: var(--on-accent); transition: transform .08s ease, filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.quiet { background: var(--tint); color: var(--ink); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google svg { width: 18px; height: 18px; }

label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field { margin-bottom: 16px; min-width: 0; }
.field .help { font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1.5px solid var(--rule); border-radius: 8px;
  background: #fff; color: var(--ink); font: 16px var(--body); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-accent) 25%, transparent); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.field .err { color: var(--bad); font-size: 13px; margin-top: 4px; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 15px; cursor: pointer; min-height: 44px; margin: 0; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: #cfc6b8; position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 52px; height: 44px; padding: 2px; border: 1.5px solid var(--rule); border-radius: 8px; background: #fff; flex: none; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.chip { display: inline-block; font: 600 12px var(--body); padding: 2px 9px; border-radius: 99px; background: var(--tint); color: var(--muted); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.notice { border-left: 4px solid var(--brand-accent); background: var(--sheet); padding: 12px 16px; border-radius: 0 8px 8px 0; margin: 0 0 18px; }
.notice.bad { border-color: var(--bad); background: var(--bad-bg); }

.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; min-width: 0; }
.card h2 { font-size: 22px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tbl-wrap { position: relative; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--sheet); }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--tint); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .ic { width: 36px; height: 36px; color: var(--brand-accent); margin-bottom: 8px; }

.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 90; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.bad { background: var(--bad); }

/* ---------- Public site ---------- */
.pub-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.pub-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-size: 21px; }
.pub-nav { display: flex; gap: 6px; align-items: center; }
.pub-nav a.link { text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; }
.pub-nav a.link:hover { background: var(--tint); }
@media (max-width: 640px) { .pub-nav a.link.hide-sm { display: none; } .brand span { font-size: 19px; } }

.hero { background: var(--brand-dark); color: var(--on-dark); position: relative; overflow: hidden; }
.hero .wrap { padding-top: 72px; padding-bottom: 88px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); max-width: 13ch; letter-spacing: -.01em; }
.hero p.lede { font-size: clamp(17px, 2vw, 20px); max-width: 56ch; opacity: .88; }
.hero .ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .btn.ghost { color: var(--on-dark); }
.eyebrow { font: 600 12.5px var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--brand-accent); margin-bottom: 14px; display: block; }
.trail-art { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.trail-art path { fill: none; stroke: var(--brand-accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: .1 14; }
.trail-art .stop { fill: var(--brand-accent); }
.trail-art .stop-label { fill: var(--on-dark); opacity: .55; font: 600 12px var(--body); letter-spacing: .14em; text-transform: uppercase; }
@media (max-width: 760px) { .trail-art { opacity: .35; } }

.section { padding: 72px 0; }
.section h2 { font-size: clamp(30px, 4vw, 44px); }
.section .intro { max-width: 60ch; color: var(--muted); font-size: 18px; margin-bottom: 32px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.feature { background: var(--sheet); padding: 24px; min-width: 0; }
@media (max-width: 900px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .features { grid-template-columns: minmax(0, 1fr); } }
.feature .ic { width: 28px; height: 28px; color: var(--brand-accent); margin-bottom: 12px; }
.feature h3 { font-size: 21px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 15.5px; }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; gap: 28px; } }
.phone-mock { background: var(--brand-dark); border-radius: 34px; padding: 14px; max-width: 320px; margin: 0 auto; box-shadow: 0 30px 60px -30px rgba(29,25,21,.6); }
.phone-mock .screen { background: var(--paper); border-radius: 24px; padding: 16px; min-height: 420px; }
.mock-post { background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 12px; margin-bottom: 10px; font-size: 14px; }
.mock-post b { display: block; font-size: 13px; }
.mock-post .tag { font-size: 11px; color: var(--brand-accent); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.steps { counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font: 400 30px var(--display); color: var(--brand-accent); margin-bottom: 6px; }
.band { background: var(--brand-accent); color: var(--on-accent); }
.band .wrap { padding-top: 56px; padding-bottom: 56px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.band h2 { margin: 0; font-size: clamp(28px, 4vw, 40px); }
.band .btn { background: var(--brand-dark); color: var(--on-dark); }
.pub-footer { border-top: 1px solid var(--rule); padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 14px; color: var(--muted); }
.pub-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; }
.pub-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

.auth-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 16px; padding: 32px 28px; text-align: center; }
.auth-card h1 { font-size: 32px; }
.auth-card .btn { width: 100%; margin-top: 8px; }
.auth-card .switch-side { margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth-card.dark { background: var(--brand-dark); color: var(--on-dark); border-color: transparent; }
.auth-card.dark .switch-side { color: inherit; opacity: .75; }

.legal { max-width: 760px; padding-top: 48px; padding-bottom: 64px; }
.legal h1 { font-size: clamp(34px, 5vw, 48px); }
.legal h2 { font-size: 24px; margin-top: 36px; }
.legal li { margin-bottom: 6px; }

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.place { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.place h3 { font-size: 21px; margin: 0; }
.place h3 a { text-decoration: none; }
.place .row { display: flex; gap: 8px; align-items: center; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; font-size: 15px; }
.hours .today { font-weight: 700; }

/* ---------- Business app shell (LawnRoute layout) ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(to right, var(--brand-dark) var(--sidebar), transparent var(--sidebar)); }
.sidebar { background: var(--brand-dark); color: var(--on-dark); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow-y: auto; z-index: 40; }
.sidebar .brand { padding: 16px 16px 12px; font-size: 19px; color: inherit; }
.sidebar nav { flex: 1; padding: 4px 8px 12px; }
.nav-label { font: 700 11px var(--body); letter-spacing: .14em; text-transform: uppercase; opacity: .5; padding: 14px 10px 6px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; text-decoration: none; font-size: 14.5px; font-weight: 500; opacity: .86; min-height: 40px; }
.nav-link:hover { background: rgba(255,255,255,.08); opacity: 1; }
.nav-link[aria-current="page"] { background: var(--brand-accent); color: var(--on-accent); opacity: 1; }
.nav-link .soon { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .06em; opacity: .55; text-transform: uppercase; }
.nav-link[aria-current="page"] .soon { opacity: .75; }
.user-badge { border-top: 1px solid rgba(255,255,255,.12); padding: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 700; flex: none; overflow: hidden; font-size: 14px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-badge .who { min-width: 0; flex: 1; font-size: 13px; line-height: 1.3; }
.user-badge .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-badge .who span { opacity: .65; text-transform: capitalize; }
.user-badge button { background: none; border: 0; color: inherit; cursor: pointer; padding: 8px; border-radius: 8px; opacity: .8; min-width: 40px; min-height: 40px; }
.user-badge button:hover { background: rgba(255,255,255,.1); opacity: 1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--rule); background: var(--sheet); position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 22px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .burger { display: none; }
.biz-switch { display: flex; align-items: center; gap: 8px; }
.biz-switch select { min-height: 38px; width: auto; max-width: 220px; font-size: 14px; padding: 6px 10px; }
.content { padding: 24px; max-width: 1100px; width: 100%; }
.bottom-nav { display: none; }
.backdrop { display: none; }
.icon-btn { background: none; border: 0; color: inherit; width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--tint); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; min-width: 0; }
.stat .n { font: 400 32px var(--display); line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.roadmap li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; flex-wrap: wrap; }
.roadmap li b { flex: 1; min-width: 160px; font-weight: 600; }
.save-bar { position: sticky; bottom: 0; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(6px); padding: 12px 0; display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--rule); margin-top: 8px; flex-wrap: wrap; }
.save-bar .status { color: var(--muted); font-size: 14px; flex: 1; min-width: 160px; }
.contrast { font-size: 13px; margin-top: 6px; }
.preview-strip { display: flex; border-radius: 10px; overflow: hidden; border: 1px solid var(--rule); margin-top: 8px; }
.preview-strip div { flex: 1; padding: 12px; font-weight: 600; font-size: 14px; }
.hours-row { display: grid; grid-template-columns: 110px auto 1fr 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--rule); }
.hours-row:last-child { border-bottom: 0; }
.hours-row .switch { min-height: 36px; font-size: 14px; }
@media (max-width: 560px) { .hours-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } .hours-row .day { grid-column: 1 / -1; font-weight: 600; } .hours-row input[type=time] { padding: 9px 6px; } }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; margin-bottom: 14px; }
.filters .field { margin: 0; }
.diff { font-family: var(--mono); font-size: 12.5px; display: grid; gap: 2px; min-width: 220px; overflow-wrap: anywhere; }
.diff .k { color: var(--muted); }
.diff del { background: var(--bad-bg); color: var(--bad); text-decoration: none; padding: 0 3px; border-radius: 3px; }
.diff ins { background: var(--ok-bg); color: var(--ok); text-decoration: none; padding: 0 3px; border-radius: 3px; }
.pager { display: flex; gap: 10px; justify-content: space-between; align-items: center; margin-top: 12px; flex-wrap: wrap; }

@media (max-width: 768px) {
  :root { --topbar: 52px; }
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; max-width: 84vw; transform: translateX(-102%); transition: transform .22s ease; padding-top: env(safe-area-inset-top); box-shadow: 0 0 40px rgba(0,0,0,.35); }
  body.menu-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 35; }
  body.menu-open .backdrop { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 8px 0 4px; padding-top: env(safe-area-inset-top); min-height: calc(var(--topbar) + env(safe-area-inset-top)); }
  .topbar .burger { display: inline-grid; }
  .topbar h1 { font-size: 19px; }
  .biz-switch select { max-width: 140px; }
  .content { padding: 16px 16px calc(88px + env(safe-area-inset-bottom)); }
  .bottom-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--sheet); border-top: 1px solid var(--rule); padding-bottom: env(safe-area-inset-bottom); transition: transform .2s; }
  body.menu-open .bottom-nav, body.dialog-open .bottom-nav { transform: translateY(110%); }
  .bottom-nav a, .bottom-nav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; font: 600 11px var(--body); text-decoration: none; color: var(--muted); background: none; border: 0; min-height: 56px; cursor: pointer; }
  .bottom-nav [aria-current="page"] { color: var(--ink); }
  .bottom-nav [aria-current="page"] .ic { color: var(--brand-accent); }
  .save-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Guest app ---------- */
.guest-top { background: var(--brand-dark); color: var(--on-dark); padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 20; }
.guest-top .wrap { display: flex; align-items: center; justify-content: space-between; min-height: 56px; gap: 10px; }
.guest-top .brand { font-size: 19px; color: inherit; }
.guest-main { max-width: 680px; margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); }
.guest-main h1 { font-size: 30px; }
.guest-tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--sheet); border-top: 1px solid var(--rule); display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); z-index: 20; }
.guest-tabs .inner { display: flex; width: 100%; max-width: 560px; }
.guest-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; font: 600 11.5px var(--body); text-decoration: none; color: var(--muted); min-height: 58px; }
.guest-tabs a[aria-current="page"] { color: var(--ink); }
.guest-tabs a[aria-current="page"] .ic { color: var(--brand-accent); }
.feed-item { background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px; padding: 16px; margin-bottom: 12px; }
.feed-item .meta { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; font-size: 14px; }
.feed-item .meta b { font-size: 15px; }
.feed-item .meta .when { color: var(--muted); margin-left: auto; font-size: 13px; white-space: nowrap; }
.follow-row { display: flex; align-items: center; gap: 12px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.follow-row .name { flex: 1; min-width: 0; }
.follow-row .name a { font-weight: 600; text-decoration: none; }
.follow-row .name span { display: block; color: var(--muted); font-size: 13px; }
.follow-row .icon-btn[aria-pressed="true"] { color: var(--brand-accent); }
.mono-badge { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-dark); color: var(--brand-accent); display: grid; place-items: center; font: 400 18px var(--display); flex: none; }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-row input { flex: 1; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
