:root {
  --navy: #0B2A4A;
  --ink: #17233A;
  --muted: #5C6B82;
  --line: #E3E8F0;
  --bg: #F4F7FB;
  --card: #FFFFFF;
  --brand: #1A6FE8;
  --brand2: #12AFCB;
  --accent: var(--brand);
  --accent-dark: #0F4FB8;
  --radius: 16px;
  --shadow: 0 6px 24px rgba(11, 42, 74, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--navy); margin: 0 0 8px; line-height: 1.2; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- guest (tag) pages ---------- */
.tag-page { min-height: 100vh; display: flex; flex-direction: column; }
.tag-hero { background: linear-gradient(160deg, var(--accent), var(--accent-dark)); color: #fff; padding: 28px 20px 56px; }
.tag-hero .wrap { max-width: 560px; margin: 0 auto; }
.tag-hero .icon { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,0.18); display: grid; place-items: center; margin-bottom: 14px; }
.tag-hero .icon svg { width: 30px; height: 30px; }
.tag-hero h1 { color: #fff; font-size: 30px; letter-spacing: -0.01em; }
.tag-hero .sub { opacity: 0.92; font-size: 16px; margin: 0; }
.tag-hero .prop { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; margin-bottom: 6px; }
.tag-body { max-width: 560px; width: 100%; margin: -36px auto 0; padding: 0 16px 40px; flex: 1; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.kv { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv .k { color: var(--muted); font-size: 13px; }
.kv .v { font-weight: 600; font-size: 17px; text-align: right; word-break: break-all; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 12px 18px; border-radius: 12px; background: var(--accent); color: #fff; text-decoration: none !important; transition: filter .15s; }
.btn:hover { filter: brightness(1.06); }
.btn.block { width: 100%; font-size: 17px; padding: 15px; }
.btn.ghost { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn.copy { padding: 6px 10px; font-size: 12px; background: var(--bg); color: var(--navy); border: 1px solid var(--line); }
.btn.copy.done { background: #E6F6EA; border-color: #2E9E44; color: #1F7A32; }
.btn.danger { background: #E5242B; }
.btn.neutral { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.wifi-qr { display: block; width: 180px; height: 180px; margin: 6px auto 4px; border-radius: 10px; }
.guide { white-space: pre-wrap; }
.acc { border-top: 1px solid var(--line); }
.acc:first-of-type { border-top: 0; }
.acc summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; }
.acc[open] summary::after { content: "–"; }
.acc .body { padding: 0 0 14px; color: var(--ink); white-space: pre-wrap; }
.pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: #fff; background: var(--accent); }
.check { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.check:first-of-type { border-top: 0; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.check span { font-size: 16px; }
.progress { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 8px 0 4px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=search], input[type=password], input[type=number], input[type=email], input[type=tel], select, textarea {
  width: 100%; font: inherit; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { min-height: 96px; resize: vertical; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; }
.choice span { display: block; padding: 13px 12px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 600; font-size: 14px; text-align: center; background: #fff; }
.choice input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, #fff); color: var(--accent-dark); }
.tag-foot { text-align: center; padding: 18px; color: var(--muted); font-size: 12px; }
.tag-foot b { color: var(--navy); }
.thanks { text-align: center; padding: 20px 0; }
.thanks .big { width: 72px; height: 72px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 14%, #fff); color: var(--accent); display: grid; place-items: center; margin: 0 auto 14px; font-size: 34px; }

/* connect */
.connect-actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 6px; }

/* find */
.search-card { padding: 12px; }
.search-card input[type=search] { font-size: 17px; padding: 13px 14px; border-radius: 12px; -webkit-appearance: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; color: var(--navy); cursor: pointer; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.find-item { padding: 4px 18px; }
.find-item .acc summary { padding: 14px 0; }
.find-title { font-size: 16px; }
.room { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--accent-dark); background: color-mix(in srgb, var(--accent) 12%, #fff); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.find-photo { width: 100%; border-radius: 10px; margin-bottom: 10px; max-height: 260px; object-fit: cover; }

/* ready: tick / flag */
.ck { display: flex; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); }
.ck:first-of-type { border-top: 0; }
.ck .check { flex: 1; border-top: 0; }
.ck .flag { position: relative; flex: none; margin-left: 8px; }
.ck .flag input { position: absolute; opacity: 0; inset: 0; }
.ck .flag span { display: grid; place-items: center; width: 40px; height: 36px; border-radius: 10px; border: 1.5px solid var(--line); color: #A3AEBF; font-size: 18px; background: #fff; }
.ck .flag input:checked + span { border-color: #F28C1A; background: #FFF6E5; color: #F28C1A; }
.ck .note { flex-basis: 100%; margin: 0 0 10px; }
.ck.flagged .check span { color: #8A4B00; }

/* ready / inspection */
.status-row { display: flex; align-items: center; gap: 12px; }
.status-dot { width: 14px; height: 14px; border-radius: 50%; background: #C7CFDA; flex: none; }
.status-ready .status-dot { background: #2E9E44; }
.status-stale .status-dot { background: #F2C21A; }
.status-issues .status-dot { background: #E5242B; }
.insp { padding: 10px 0; border-top: 1px solid var(--line); }
.insp:first-of-type { border-top: 0; }
.insp-label { font-size: 15px; margin-bottom: 8px; }
.kind { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-left: 6px; vertical-align: middle; }
.kind-clean { background: #E6F6EA; color: #1F7A32; }
.kind-function { background: #E8F0FE; color: #0F4FB8; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 9px; border: 1.5px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 14px; background: #fff; }
.seg input:checked + span { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, #fff); color: var(--accent-dark); }
.seg label:last-child input:checked + span { border-color: #F28C1A; background: #FFF6E5; color: #8A4B00; }
.insp-note { margin-top: 8px; }
.insp.flagged .insp-label { color: #8A4B00; }

/* ---------- home ---------- */
.home-hero { background: linear-gradient(135deg, #0B2A4A, #1A6FE8 70%, #12AFCB); color: #fff; padding: 60px 20px; text-align: center; }
.home-hero h1 { color: #fff; font-size: 40px; }
.home-hero p { font-size: 18px; opacity: .92; max-width: 560px; margin: 0 auto 20px; }
.logo { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: .02em; color: inherit; text-decoration: none !important; }
.logo svg { height: 34px; width: auto; }
.logo .sub { display: block; font-size: 9px; letter-spacing: .22em; font-weight: 600; opacity: .8; }
.func-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; max-width: 980px; margin: -30px auto 40px; padding: 0 16px; }
.func-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border-top: 5px solid var(--accent); }
.func-card .icon { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin-bottom: 10px; }
.func-card .icon svg { width: 22px; height: 22px; }
.func-card h3 { font-size: 18px; }

/* ---------- admin ---------- */
.admin { max-width: 1100px; margin: 0 auto; padding: 0 16px 60px; }
.admin-nav { background: var(--navy); color: #fff; padding: 12px 16px; }
.admin-nav .wrap { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.admin-nav a { color: #fff; opacity: .85; font-weight: 600; }
.admin-nav a.active, .admin-nav a:hover { opacity: 1; text-decoration: none; }
.admin-nav .spacer { flex: 1; }
.admin-nav form { margin: 0; }
.admin-nav .btn { background: rgba(255,255,255,.12); }
.page-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin: 26px 0 16px; }
.page-head h1 { font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .n { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat .l { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: middle; }
.fbadge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 6px; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; background: var(--accent); }
.fbadge svg { width: 14px; height: 14px; }
.fbadge.none { background: #C7CFDA; color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row .field { flex: 1; min-width: 140px; margin-bottom: 0; }
.inline-form { display: inline; }
.flash { background: #E6F6EA; border: 1px solid #2E9E44; color: #1F7A32; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.notice { background: #FFF6E5; border: 1px solid #F28C1A; color: #8A4B00; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.error { background: #FDE8E9; border: 1px solid #E5242B; color: #8B1519; padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: inline-block; }
.qr-box svg { width: 220px; height: 220px; display: block; }
.status-open { color: #C86E0A; font-weight: 700; }
.status-resolved { color: #1F7A32; font-weight: 700; }
.photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.tablewrap { overflow-x: auto; }
.tablewrap input[type=text] { padding: 7px 9px; font-size: 14px; min-width: 140px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--navy); font-weight: 600; font-size: 13px; }
.tabs a.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.login { max-width: 380px; margin: 80px auto; }
.src-ready { background: #2E9E44; }
.src-report { background: #F28C1A; }
.ready-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: #EEF1F5; color: var(--navy); }
.ready-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #C7CFDA; }
.ready-badge.ready::before { background: #2E9E44; }
.ready-badge.stale::before { background: #F2C21A; }
.ready-badge.issues::before { background: #E5242B; }
.ptabs { display: flex; gap: 8px; margin: 18px 0 14px; flex-wrap: wrap; }
.ptab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; background: #fff; border: 2px solid var(--line); color: var(--navy); font-weight: 700; text-decoration: none !important; }
.ptab svg { width: 18px; height: 18px; color: var(--accent); }
.ptab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ptab.active svg { color: #fff; }
.pane[hidden] { display: none; }
.h1-input { font-size: 24px; font-weight: 800; color: var(--navy); border: 1.5px solid transparent; padding: 4px 8px; margin-left: -8px; width: auto; min-width: 280px; background: transparent; }
.h1-input:hover, .h1-input:focus { border-color: var(--line); background: #fff; }
.addr-input { border: 1.5px solid transparent; padding: 2px 8px; margin-left: -8px; width: auto; min-width: 320px; background: transparent; color: var(--muted); font-size: 14px; }
.addr-input:hover, .addr-input:focus { border-color: var(--line); background: #fff; }
.popover { position: absolute; z-index: 5; width: 360px; right: 0; text-align: left; }
.walk { max-width: 560px; margin: 0 auto; padding: 16px; }
.walk .card { padding: 16px; }
.find-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
