:root {
  --pine: #1f4d3a; --pine-2: #2d6a4f; --pine-soft: #e3efe8; --sand: #f6f1e7; --sand-2: #ece3d0; --clay: #b5622e; --ink: #1d2420; --muted: #5d6b63;
  --line: #d9d3c4; --card: #fffdf8; --ok: #2f8f5b; --warn: #c98a12; --bad: #b3412f; --sel: #1565c0;
  --radius: 10px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(31,77,58,.07);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--sand);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; background: var(--sand); }
a { color: var(--pine-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
button, .btn { font: inherit; border: 1px solid var(--pine); background: var(--pine); color: #fff; padding: .55em 1em; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: .4em; min-height: 40px; }
button:hover, .btn:hover { background: var(--pine-2); }
button.secondary, .btn.secondary { background: #fff; color: var(--pine); }
button.secondary:hover { background: var(--pine-soft); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button.small { padding: .3em .7em; min-height: 32px; font-size: .9rem; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; padding: .5em .6em; border: 1px solid var(--line); border-radius: 8px; background: #fff; width: 100%; min-height: 40px; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
input[type=checkbox] { width: auto; min-height: 0; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: .8em; }
label > input, label > select, label > textarea { margin-top: .25em; color: var(--ink); }
label.check { display: flex; gap: .5em; align-items: center; color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1em 1.2em; box-shadow: var(--shadow); margin-bottom: 1em; }
.row { display: flex; gap: 1em; flex-wrap: wrap; } .row > * { flex: 1 1 180px; }
.muted { color: var(--muted); } .small { font-size: .88rem; }
.pill { display: inline-block; padding: .1em .55em; border-radius: 99px; font-size: .78rem; background: var(--sand-2); color: var(--ink); white-space: nowrap; }
.pill.confirmed { background: #dcefe3; color: #1d6b40; } .pill.checked_in { background: #d6e6fb; color: #134a8e; } .pill.checked_out { background: #eee; color: #555; }
.pill.cancelled, .pill.no_show { background: #f6dfda; color: #8f2f20; } .pill.pending_payment, .pill.hold { background: #fbefd2; color: #8a5d00; }
table { border-collapse: collapse; width: 100%; } th, td { text-align: left; padding: .5em .6em; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stat { font-size: 1.7rem; font-weight: 700; color: var(--pine); } .stat-label { font-size: .85rem; color: var(--muted); }
.empty { color: var(--muted); padding: 1em 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: .7em 1.1em; border-radius: 8px; transition: transform .25s; z-index: 1000; max-width: calc(100% - 32px); }
#toast.show { transform: translateX(-50%) translateY(0); } #toast.bad { background: var(--bad); }

/* App shell */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--pine); color: #fff; padding: 1em .8em; position: sticky; top: 0; height: 100vh; overflow: auto; }
.brand { display: flex; align-items: center; gap: .5em; font-weight: 800; font-size: 1.2rem; margin: .2em .4em 1.2em; color: #fff; text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.side nav a { display: block; color: #e6f0ea; text-decoration: none; padding: .55em .7em; border-radius: 8px; margin-bottom: 2px; }
.side nav a.active, .side nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.side .park-name { font-size: .85rem; opacity: .85; margin: 0 .4em 1em; }
.side .foot { margin-top: 1.5em; font-size: .85rem; opacity: .85; padding: 0 .4em; }
.side .foot a { color: #fff; }
main.content { padding: 1.4em 1.8em 4em; max-width: 1280px; width: 100%; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; margin-bottom: 1em; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-105%); transition: transform .2s; height: 100%; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  main.content { padding: 1em 16px 4em; }
}

/* Auth */
.auth-wrap { max-width: 420px; margin: 8vh auto; padding: 0 16px; }
.auth-wrap .brand { color: var(--pine); justify-content: center; font-size: 1.6rem; }

/* Calendar grid */
.grid-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 72vh; }
.cal { display: grid; position: relative; min-width: max-content; }
.cal .h, .cal .sname, .cal .cell { border-right: 1px solid #eee; border-bottom: 1px solid #eee; height: 38px; }
.cal .h { position: sticky; top: 0; background: var(--sand); z-index: 3; font-size: .78rem; text-align: center; padding-top: 4px; line-height: 1.1; }
.cal .h.we { background: var(--sand-2); } .cal .h.today { background: var(--pine-soft); font-weight: 700; }
.cal .sname { position: sticky; left: 0; background: #fff; z-index: 2; font-weight: 600; padding: 0 .6em; display: flex; align-items: center; gap: .4em; font-size: .9rem; white-space: nowrap; }
.cal .corner { position: sticky; left: 0; top: 0; z-index: 4; background: var(--sand); }
.cal .cell { cursor: pointer; } .cal .cell:hover { background: var(--pine-soft); } .cal .cell.drop { background: #d6e6fb; }
.cal .bar { position: absolute; height: 30px; margin-top: 4px; border-radius: 6px; padding: 0 .5em; font-size: .8rem; color: #fff; background: var(--pine-2); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; cursor: grab; z-index: 1; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.cal .bar.checked_in { background: #1d5fa8; } .cal .bar.pending_payment, .cal .bar.hold { background: var(--warn); } .cal .bar.checked_out { background: #8a8f8c; }
.cal .bar.flagged { outline: 2px solid var(--bad); }

/* Drawer / modal */
.overlay { position: fixed; inset: 0; background: rgba(20,30,25,.35); z-index: 90; display: flex; justify-content: flex-end; }
.drawer { background: var(--card); width: min(520px, 100%); height: 100%; overflow: auto; padding: 1.3em 1.4em 3em; box-shadow: -4px 0 20px rgba(0,0,0,.15); }
.drawer .close { float: right; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: .35em .8em; margin: .8em 0; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.btns { display: flex; gap: .5em; flex-wrap: wrap; margin: .8em 0; }

/* Site map (shared) */
.sitemap { position: relative; width: 100%; max-width: 900px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #dfe7dc; }
.sitemap-inner { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.sitemap img, .sitemap .schematic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.sitemap .schematic { background: linear-gradient(#cfdcc9 1px, transparent 1px) 0 0 / 40px 40px, linear-gradient(90deg, #cfdcc9 1px, transparent 1px) 0 0 / 40px 40px, #e4ecdf; }
.sitemap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sitemap .site polygon { fill: rgba(255,255,255,.35); stroke: #fff; stroke-width: 3; vector-effect: non-scaling-stroke; cursor: pointer; }
.sitemap .site text { font-size: 22px; font-weight: 700; fill: #10241b; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 4px; pointer-events: none; }
.sitemap .site.open polygon { fill: rgba(47,143,91,.55); stroke: #e9fff1; }
.sitemap .site.open:hover polygon, .sitemap .site:focus polygon { fill: rgba(47,143,91,.8); }
.sitemap .site.nofit polygon { fill: rgba(201,138,18,.45); stroke: #fff3d6; }
.sitemap .site.taken polygon { fill: rgba(60,60,60,.45); stroke: rgba(255,255,255,.5); cursor: not-allowed; }
.sitemap g.site.selected polygon, .sitemap g.site.selected:hover polygon, .sitemap g.site.selected:focus polygon { fill: rgba(21,101,192,.8); stroke: #fff; stroke-width: 4; }
.sitemap .site:focus { outline: none; }
.legend { display: flex; gap: 1em; flex-wrap: wrap; font-size: .85rem; margin: .5em 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35em; vertical-align: -1px; }

/* Map editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1em; align-items: start; }
@media (max-width: 1000px) { .editor { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: .4em; flex-wrap: wrap; margin-bottom: .6em; }
.toolbar button.on { background: var(--clay); border-color: var(--clay); color: #fff; }
.ed-stage { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: #dfe7dc; touch-action: none; }
.ed-stage img, .ed-stage .schematic { position: absolute; inset: 0; width: 100%; height: 100%; user-select: none; pointer-events: none; }
.ed-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-stage > svg polygon { fill: rgba(255,255,255,.3); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: move; }
.ed-stage > svg polygon.sel { fill: rgba(21,101,192,.5); stroke: #ffeb3b; stroke-width: 3; }
.ed-stage > svg polygon.ghost { fill: rgba(181,98,46,.35); stroke: #ffd0b0; stroke-dasharray: 6 4; pointer-events: none; }
.ed-stage > svg text { font-size: 18px; font-weight: 700; fill: #10241b; paint-order: stroke; stroke: rgba(255,255,255,.9); stroke-width: 4px; pointer-events: none; }
.ed-stage > svg line.guide { stroke: #ffeb3b; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 8 6; }
.ed-stage > svg .handle { fill: #ffeb3b; stroke: #333; stroke-width: 1; vector-effect: non-scaling-stroke; cursor: nwse-resize; }

/* Guest booking page */
.pub-head { background: var(--pine); color: #fff; }
.pub-head .inner, .pub-main { max-width: 1100px; margin: 0 auto; padding: 1em 16px; }
.pub-head .inner { display: flex; justify-content: space-between; align-items: center; gap: 1em; flex-wrap: wrap; }
.pub-head h1 { margin: 0; font-size: 1.5rem; }
.hero { height: 240px; background: center / cover no-repeat var(--pine-2); border-radius: var(--radius); margin: 1em 0; }
.searchbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: .7em; align-items: end; }
.searchbar label { margin: 0; }
@media (max-width: 760px) { .searchbar { grid-template-columns: 1fr 1fr; } .searchbar button { grid-column: 1 / -1; } }
.book-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1.2em; align-items: start; }
@media (max-width: 900px) { .book-grid { grid-template-columns: 1fr; } }
.site-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5em; margin-top: 1em; }
.site-card { border: 1px solid var(--line); border-radius: 8px; padding: .5em .7em; background: #fff; cursor: pointer; text-align: left; color: var(--ink); display: block; min-height: 0; }
.site-card:hover { background: var(--pine-soft); } .site-card[disabled] { opacity: .5; cursor: not-allowed; background: #f3f3f3; }
.site-card.sel { outline: 2px solid var(--sel); }
.price-lines { width: 100%; margin: .5em 0; } .price-lines td { border: 0; padding: .2em 0; } .price-lines td:last-child { text-align: right; }
.price-lines tr.total td { border-top: 1px solid var(--line); font-weight: 700; padding-top: .5em; }
.amen { display: flex; flex-wrap: wrap; gap: .4em; margin: .5em 0; }

/* Landing */
.land-hero { background: var(--pine); color: #fff; padding: 3em 16px 4em; }
.land-hero .inner, .land-sec .inner { max-width: 1080px; margin: 0 auto; }
.land-hero nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3em; gap: 1em; flex-wrap: wrap; }
.land-hero nav a { color: #fff; }
.land-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 760px; margin-bottom: .4em; }
.land-hero p.lead { font-size: 1.2rem; max-width: 640px; opacity: .92; }
.land-hero .btn { background: var(--clay); border-color: var(--clay); font-size: 1.05rem; padding: .7em 1.3em; }
.land-hero .btn.secondary { background: transparent; color: #fff; border-color: #fff; }
.land-sec { padding: 3em 16px; } .land-sec.alt { background: #fff; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2em; } @media (max-width: 800px) { .cols3 { grid-template-columns: 1fr; } }
.price-box { border: 2px solid var(--pine); border-radius: 14px; padding: 1.4em; background: var(--card); }
.price-box .big { font-size: 2.4rem; font-weight: 800; color: var(--pine); }
footer.site { padding: 2em 16px; text-align: center; color: var(--muted); font-size: .9rem; }

.ed-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2em; color: var(--pine); background: rgba(228,236,223,.9); font-weight: 600; flex-direction: column; gap: .6em; }
.ed-stage.picking, .ed-stage.picking svg, .ed-stage.picking polygon { cursor: crosshair; }

/* Illustrated park maps */
.parkmap { display: block; width: 100%; height: auto; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.parkmap .amen-label, .parkmap .road-label { font-size: 13px; font-weight: 700; letter-spacing: .04em; }
.parkmap .area-label, .parkmap .bldg-label { font-size: 16px; font-weight: 800; }
.parkmap .free-label { font-weight: 800; }
.parkmap g.site { cursor: pointer; } .parkmap g.site.taken { cursor: not-allowed; }
.parkmap g.site:focus { outline: none; } .parkmap g.site:focus polygon, .parkmap g.site.open:hover polygon { stroke: #0d47a1; stroke-width: 5; }
.example-map { max-width: 1000px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); margin-top: 1em; }
.example-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1em; } @media (max-width: 700px) { .example-grid { grid-template-columns: 1fr; } }
.example-grid figure { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; } .example-grid figcaption { padding: .5em .8em; font-weight: 600; }
.mapbox { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); max-width: 900px; }
.ed-bg { position: absolute; inset: 0; pointer-events: none; } .ed-bg svg { width: 100%; height: 100%; display: block; }
.ed-stage polyline.guide { fill: none; stroke: #ffeb3b; stroke-width: 3; vector-effect: non-scaling-stroke; stroke-dasharray: 8 6; }
.ed-stage polyline.fsel { fill: none; stroke: #ffeb3b; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 6 4; pointer-events: none; }
.ed-stage .fsel-ring { fill: none; stroke: #ffeb3b; stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
.ed-stage > svg polygon { stroke: #fff; }
input[type=radio] { width: auto; min-height: 0; }
button[hidden], .btn[hidden] { display: none; }

/* Grid child must be allowed to shrink, or wide tables push the owner app past the phone width. */
.content { min-width: 0; }
