:root {
  --paper: #F7F3EA;
  --card: #FFFDF8;
  --ink: #3A2A1E;
  --ink-2: #5B4636;
  --soft: #7A6452;
  --line: rgba(91, 70, 54, .16);
  --line-2: rgba(91, 70, 54, .32);
  --gold: #B8975A;
  --green: #2F7A4B;
  --green-bg: #E3F1E6;
  --amber: #8A5E0E;
  --amber-bg: #FBF0D8;
  --red: #A23B2A;
  --red-bg: #F8E1DC;
  --wa: #1F8F55;
  --script: "Pinyon Script", cursive;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Jost", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
.script { font-family: var(--script); font-weight: 400; }
.muted { color: var(--soft); }
.small { font-size: 14px; }
.boot { min-height: 100svh; display: grid; place-items: center; color: var(--soft); }
h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; line-height: 1.15; }
.eyebrow { font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--gold); font-weight: 500; }

/* buttons */
.b { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--card); font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; }
.b:hover { border-color: var(--ink-2); }
.b--solid { background: var(--ink); color: #FFF8EC; border-color: var(--ink); }
.b--go { background: var(--green); color: #fff; border-color: var(--green); font-size: 18px; min-height: 54px; }
.b--ok { background: var(--green); color: #fff; border-color: var(--green); }
.b--wa { background: var(--wa); color: #fff; border-color: var(--wa); }
.b--danger { color: var(--red); border-color: rgba(162, 59, 42, .35); background: transparent; }
.b:disabled { opacity: .5; cursor: default; }
.wide { width: 100%; }
.icon { width: 44px; height: 44px; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.icon svg { width: 22px; height: 22px; fill: none; stroke: #F3E7D3; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* forms */
label { display: grid; gap: 6px; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.lbl { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
label input, label textarea, .search, .linkbox, .slug-row input {
  min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 16px; font-weight: 400; color: var(--ink); width: 100%;
}
label textarea { resize: vertical; line-height: 1.4; }
label.check { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 500; }
label.check input { width: 22px; height: 22px; accent-color: var(--ink); }
.slug-row { display: flex; align-items: center; gap: 4px; }
.err { color: var(--red); min-height: 1.2em; font-size: 14px; font-weight: 500; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #EDE5D6; border-radius: 12px; padding: 4px; }
.seg button { border: 0; background: transparent; min-height: 40px; border-radius: 9px; font-weight: 500; cursor: pointer; font-size: 14px; }
.seg button.is-on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 400px); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 32px 26px; display: grid; gap: 16px; text-align: center; }
.login-card .script { font-size: 44px; color: var(--ink-2); line-height: 1.1; }
.login-card h1 { font-family: var(--serif); font-weight: 600; font-size: 30px; margin-top: -10px; }

/* chrome */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: max(6px, env(safe-area-inset-top)) 8px 6px 18px; background: var(--ink); color: #F3E7D3; }
.brand { text-decoration: none; }
.brand .script { font-size: 30px; color: var(--gold); }
.me { display: flex; align-items: center; gap: 4px; font-size: 14px; opacity: .9; }
.home, .wed { max-width: 1100px; margin: 0 auto; padding: 18px 14px 60px; }
.home-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 6px 0 18px; }
.home-head h1 { font-family: var(--serif); font-weight: 600; font-size: 34px; }
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.wcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: grid; gap: 10px; text-decoration: none; }
.wcard:hover { border-color: var(--line-2); box-shadow: 0 4px 18px rgba(58, 42, 30, .07); }
.wcard h3 { font-family: var(--script); font-weight: 400; font-size: 40px; line-height: 1.05; color: var(--ink-2); }
.wcard .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.wcard .nums div { background: #F3ECE0; border-radius: 10px; padding: 8px 6px; text-align: center; }
.wcard .nums b { display: block; font-family: var(--serif); font-size: 24px; line-height: 1; }
.wcard .nums span { font-size: 11px; color: var(--soft); }
.wcard .nums .hot { background: var(--amber-bg); color: var(--amber); }
.wcard .nums .hot span { color: var(--amber); }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: #EFE8DA; color: var(--ink-2); }
.pill--open { background: var(--green-bg); color: var(--green); }
.pill--closed { background: var(--amber-bg); color: var(--amber); }
.empty-home { text-align: center; padding: 60px 20px; color: var(--soft); }

.wed-head { text-align: center; padding: 4px 0 6px; position: relative; }
.back { position: absolute; left: 0; top: 0; font-size: 14px; color: var(--soft); text-decoration: none; }
.wtitle { font-family: var(--script); font-weight: 400; font-size: clamp(44px, 9vw, 64px); line-height: 1.1; color: var(--ink-2); margin-top: 4px; }
.wurl { font-size: 14px; color: var(--soft); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 6px; text-align: center; }
.stat b { display: block; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--soft); }
.stat--hot { background: var(--amber-bg); border-color: transparent; }
.stat--hot b, .stat--hot span { color: var(--amber); }
.tabs { display: flex; gap: 4px; margin: 14px 0; background: #EDE5D6; border-radius: 12px; padding: 4px; overflow-x: auto; scrollbar-width: none; }
.tab { flex: 1 0 auto; border: 0; background: transparent; min-height: 42px; padding: 0 14px; border-radius: 9px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab.is-on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px; display: grid; gap: 14px; margin-bottom: 14px; }

/* guests */
.banner { background: var(--amber-bg); color: var(--amber); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-weight: 500; margin-bottom: 12px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; }
.search { flex: 1 1 220px; min-width: 0; }
.filters { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 6px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; font-weight: 500; }
.chip.is-on { background: var(--ink); color: #FFF8EC; border-color: var(--ink); }
.chip i { font-style: normal; opacity: .7; margin-left: 4px; }
.list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; margin-top: 6px; }
.g { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; }
.g--pending { border-color: rgba(138, 94, 14, .45); box-shadow: inset 4px 0 0 #D9A441; }
.g-top { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.g-name { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.15; }
.g-sub { color: var(--soft); font-size: 14px; margin-top: 2px; }
.g-count { flex: none; text-align: center; min-width: 58px; padding: 6px 8px; border-radius: 10px; background: #F1EADD; }
.g-count b { display: block; font-family: var(--serif); font-size: 22px; line-height: 1; }
.g-count span { font-size: 11px; color: var(--soft); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #EFE8DA; color: var(--ink-2); }
.tag--ok { background: var(--green-bg); color: var(--green); }
.tag--warn { background: var(--amber-bg); color: var(--amber); }
.tag--no { background: var(--red-bg); color: var(--red); }
.g-msg { margin-top: 8px; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-2); }
.g-note { margin-top: 6px; font-size: 14px; color: var(--ink-2); background: #F3ECE0; border-radius: 8px; padding: 6px 10px; }
.g-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 12px; }
.g-actions .b { min-height: 40px; padding: 0 12px; font-size: 14px; }
.empty { text-align: center; color: var(--soft); padding: 40px 0; }

/* door */
.door-count { text-align: center; margin: 4px 0 14px; }
.door-count b { font-family: var(--serif); font-size: 44px; font-weight: 600; }
.door-count span { color: var(--soft); }
.scan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cam { position: relative; aspect-ratio: 3 / 4; max-height: 64svh; margin: 0 auto 12px; border-radius: 18px; overflow: hidden; background: #1E1712; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.frame { position: absolute; inset: 18% 14%; }
.frame i { position: absolute; width: 34px; height: 34px; border: 4px solid #F3E7D3; }
.frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.cam-msg { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; text-align: center; color: #F3E7D3; background: linear-gradient(transparent, rgba(0, 0, 0, .65)); font-size: 15px; }
.find { display: flex; gap: 8px; align-items: end; }
.find label { flex: 1; }
.found { list-style: none; display: grid; gap: 8px; margin-top: 12px; }
.found li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.found b { font-family: var(--serif); font-size: 20px; }
.found small { display: block; color: var(--soft); }

/* people */
.members, .activity { list-style: none; display: grid; gap: 8px; }
.members li { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.members li.off { opacity: .55; }
.members b { font-weight: 600; }
.members small { display: block; color: var(--soft); font-size: 13px; }
.activity li { font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.activity li span { color: var(--soft); font-size: 12px; display: block; }
.linkbox { font-size: 14px; }

/* settings */
.settings h2 { margin-top: 6px; }
.events-edit { display: grid; gap: 8px; }
.ev-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr 1.4fr auto; gap: 6px; }
.ev-row input { min-height: 42px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; font-size: 15px; width: 100%; min-width: 0; }
.ev-row button { width: 42px; border: 1px solid var(--line-2); background: var(--card); border-radius: 10px; cursor: pointer; }
.events-edit > .b { justify-self: start; }

/* sheets */
.sheet-bg { position: fixed; inset: 0; z-index: 20; background: rgba(30, 22, 16, .55); display: grid; align-items: end; justify-items: center; }
.sheet { width: min(100%, 540px); background: var(--paper); border-radius: 22px 22px 0 0; padding: 22px 18px max(18px, env(safe-area-inset-bottom)); display: grid; gap: 12px; text-align: center; max-height: 94svh; overflow: auto; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
.sheet.form { text-align: left; }
.sheet.form h2 { text-align: center; }
.verdict { border-radius: 14px; padding: 14px; font-weight: 600; font-size: 19px; }
.verdict small { display: block; font-weight: 400; font-size: 14px; margin-top: 2px; }
.v-ok { background: var(--green-bg); color: var(--green); }
.v-warn { background: var(--amber-bg); color: var(--amber); }
.v-no { background: var(--red-bg); color: var(--red); }
.s-meta { color: var(--ink-2); font-size: 17px; }
.s-meta b { font-size: 20px; }
.s-admit { display: grid; gap: 10px; justify-items: center; padding: 6px 0; }
.s-admit .b--go { width: 100%; }
.stepper { display: flex; align-items: center; gap: 22px; }
.stepper button { width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--card); font-size: 26px; cursor: pointer; }
.stepper output { font-family: var(--serif); font-weight: 600; font-size: 40px; min-width: 1.4em; }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: #FFF8EC; padding: 12px 18px; border-radius: 12px; font-size: 15px; max-width: 90vw; text-align: center; }

@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stats .stat:nth-child(5) { display: none; }
  .stat { padding: 8px 4px; }
  .stat b { font-size: 22px; }
  .stat span { font-size: 11px; line-height: 1.2; display: block; }
  .tab { padding: 0 8px; font-size: 15px; }
  .search { flex-basis: 100%; }
  .tools .b { flex: 1; }
  .scan-grid { grid-template-columns: 1fr; }
  .ev-row { grid-template-columns: 1fr 1fr; }
  .ev-row input:nth-child(3), .ev-row input:nth-child(4) { grid-column: span 2; }
  .ev-row button { grid-column: span 2; width: auto; min-height: 38px; }
  .back { position: static; display: inline-block; margin-bottom: 6px; }
  .list { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .row2 { grid-template-columns: 1fr; }
}
