:root {
  --navy: #0d2742;
  --navy-2: #173c60;
  --gold: #b68b3a;
  --gold-soft: #f4ead8;
  --ink: #17212b;
  --muted: #637282;
  --line: #d9e1e8;
  --paper: #ffffff;
  --wash: #f4f7f9;
  --success: #1b6f4a;
  --danger: #a73232;
  --shadow: 0 14px 35px rgba(13, 39, 66, 0.10);
  --radius: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--wash); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(182,139,58,.10), transparent 28rem),
    linear-gradient(180deg, #eef3f6 0, #f8fafb 45%, #eef3f6 100%);
}
button, input, select, textarea { font: inherit; }
button, label.choice-tile, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }
.view { display: none; }
.view.active { display: block; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.brand-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: calc(70px + var(--safe-top));
  padding: calc(12px + var(--safe-top)) clamp(18px, 4vw, 42px) 12px;
  color: #fff;
  background: rgba(13,39,66,.96);
  box-shadow: 0 4px 18px rgba(0,0,0,.10);
  backdrop-filter: blur(15px);
}
.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 11px;
  color: #fff;
  font-weight: 800;
  letter-spacing: .07em;
  font-size: .86rem;
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 1.05rem; letter-spacing: .02em; }
.brand-copy span { margin-top: 4px; color: rgba(255,255,255,.68); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.brand-bar .ghost-button { margin-left: auto; color: #fff; border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.06); }

main { width: 100%; flex: 1; }
#guestView { width: min(1040px, 100%); margin: 0 auto; padding: 0 clamp(14px, 3.5vw, 34px) 40px; }
.property-hero { text-align: center; padding: clamp(34px, 7vw, 70px) 8px 28px; }
.property-kicker, .eyebrow { color: var(--gold); font-size: .76rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.property-hero h1 { margin: 8px 0 2px; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.05rem, 6vw, 4.2rem); line-height: 1.04; font-weight: 500; }
.property-city { margin: 4px 0 12px; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.28rem); }
.property-specs { color: var(--navy-2); font-weight: 650; line-height: 1.5; }
.event-pill { display: inline-flex; align-items: center; justify-content: center; margin-top: 16px; padding: 9px 16px; border-radius: 999px; color: var(--navy); background: var(--gold-soft); border: 1px solid #e7d6b6; font-weight: 700; }

.card {
  background: var(--paper);
  border: 1px solid rgba(13,39,66,.08);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4.5vw, 42px);
}
.welcome-card { max-width: 760px; margin: 0 auto; text-align: center; }
.welcome-card h2, .step-heading h2, .admin-panel h2 { margin: 5px 0 10px; color: var(--navy); font-size: clamp(1.55rem, 4vw, 2.35rem); line-height: 1.15; }
.welcome-card > p { color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.privacy-promise { display: flex; align-items: flex-start; gap: 12px; margin: 24px auto; max-width: 620px; padding: 15px 18px; border-radius: 14px; text-align: left; background: #edf7f2; color: #174f38; }
.privacy-promise span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--success); font-weight: 800; flex: 0 0 25px; }
.privacy-promise p { margin: 1px 0 0; line-height: 1.45; }

.primary-button, .secondary-button, .ghost-button, .danger-button, .file-button {
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 11px 19px;
  font-weight: 750;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.primary-button { color: #fff; background: var(--navy); box-shadow: 0 8px 18px rgba(13,39,66,.18); }
.primary-button:hover, .primary-button:focus-visible { background: var(--navy-2); }
.primary-button.large { min-width: min(320px, 100%); min-height: 56px; font-size: 1.08rem; }
.secondary-button { color: var(--navy); background: #fff; border-color: #b9c7d3; }
.ghost-button { color: var(--navy); background: transparent; border-color: #b9c7d3; }
.ghost-button.compact { min-height: 38px; padding: 7px 12px; border-radius: 10px; font-size: .84rem; }
.danger-button { color: #fff; background: var(--danger); }
button:active { transform: translateY(1px); }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid rgba(54,126,193,.28); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; box-shadow: none; }
.microcopy { color: var(--muted); font-size: .83rem; line-height: 1.45; }

.wizard { max-width: 960px; margin: 0 auto; }
.progress-wrap { position: sticky; top: calc(69px + var(--safe-top)); z-index: 12; margin: 0 4px 14px; padding: 10px 14px 13px; border-radius: 0 0 13px 13px; background: rgba(244,247,249,.94); backdrop-filter: blur(10px); }
.progress-label { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 8px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.progress-label span:last-child { color: var(--navy); }
.progress-track { height: 7px; overflow: hidden; border-radius: 99px; background: #dbe4eb; }
.progress-bar { height: 100%; width: 20%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), #d9b76f); transition: width .25s ease; }
.form-step { min-height: 430px; }
.step-heading { margin-bottom: 28px; }
.step-heading p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }

.field-grid { display: grid; gap: 16px; }
.field-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 7px; text-align: left; }
.field > span { color: var(--navy); font-size: .9rem; font-weight: 750; }
.field b { color: var(--danger); }
input, select, textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid #bac8d3;
  border-radius: 11px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
}
textarea { min-height: 92px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #98a6b3; }
input.invalid, select.invalid, textarea.invalid { border-color: var(--danger); background: #fff8f8; }
fieldset { margin: 28px 0 0; padding: 0; border: 0; }
legend { width: 100%; margin-bottom: 12px; color: var(--navy); font-weight: 800; }
legend small { color: var(--muted); font-weight: 600; }
.choice-grid { display: grid; gap: 11px; }
.choice-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice-grid.four-col { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice-tile { position: relative; min-height: 58px; display: flex; align-items: center; justify-content: center; padding: 11px 13px; border: 1px solid #c6d1da; border-radius: 12px; background: #fff; color: #294157; text-align: center; user-select: none; cursor: pointer; transition: all .13s ease; }
.choice-tile:hover { border-color: #8ea5b8; background: #f8fafb; }
.choice-tile input { position: absolute; opacity: 0; pointer-events: none; }
.choice-tile:has(input:checked) { color: #fff; background: var(--navy-2); border-color: var(--navy-2); box-shadow: 0 7px 16px rgba(13,39,66,.14); }
.choice-tile span { display: block; font-weight: 700; line-height: 1.25; }
.choice-tile.tall { min-height: 83px; justify-content: flex-start; text-align: left; }
.choice-tile.tall span { width: 100%; }
.choice-tile small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; line-height: 1.3; }
.choice-tile:has(input:checked) small { color: rgba(255,255,255,.78); }
.compact-choices .choice-tile { min-height: 52px; font-size: .91rem; }
.inline-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 15px; color: #344b5f; }
.inline-check input { width: 22px; min-height: 22px; margin: 0; flex: 0 0 22px; }
.conditional-panel, .conditional-section { margin-top: 24px; padding: 19px; border: 1px solid #d6e0e7; border-radius: 15px; background: #f8fafb; }
.conditional-section h3 { margin: 0 0 6px; color: var(--navy); font-size: 1.25rem; }
.conditional-section + .conditional-section { margin-top: 22px; }
.notice { padding: 15px 17px; border-left: 4px solid var(--gold); border-radius: 9px; color: #415264; background: #fbf6ed; line-height: 1.45; }
.top-gap { margin-top: 16px; }
.optional-details { margin-top: 26px; padding: 16px 18px; border: 1px solid #d2dde5; border-radius: 13px; background: #fafcfd; }
.optional-details summary { color: var(--navy); font-weight: 800; cursor: pointer; }
.consent-box { margin-top: 25px; padding: 15px 17px; border-radius: 12px; color: #4b5966; background: #f1f5f7; font-size: .88rem; line-height: 1.5; }
.consent-box p { margin: 0; }
.wizard-actions { position: sticky; bottom: 0; z-index: 14; display: flex; justify-content: space-between; gap: 14px; margin-top: 15px; padding: 15px max(4px, env(safe-area-inset-right)) calc(15px + var(--safe-bottom)) max(4px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(244,247,249,0), rgba(244,247,249,.92) 28%, rgba(244,247,249,.98)); }
.wizard-actions .primary-button, .wizard-actions .secondary-button { min-width: 132px; }
.form-error { margin: 8px 0; padding: 12px 15px; border-radius: 10px; color: #7f2525; background: #fdecec; font-weight: 650; }
.thank-you { max-width: 720px; margin: 0 auto; text-align: center; }
.success-icon { width: 74px; height: 74px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; color: #fff; background: var(--success); font-size: 2rem; font-weight: 900; }
.thank-you h2 { color: var(--navy); font-size: 2rem; }
.thank-you-followup { min-height: 28px; color: var(--muted); line-height: 1.5; }

.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 18px; padding: 20px clamp(18px, 4vw, 42px) calc(20px + var(--safe-bottom)); color: #677887; font-size: .8rem; }

/* Dialog */
dialog { width: min(430px, calc(100% - 28px)); border: 0; padding: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(0,0,0,.30); }
dialog::backdrop { background: rgba(9,25,41,.72); backdrop-filter: blur(4px); }
.dialog-card { padding: 28px; }
.dialog-card h2 { margin: 0 0 6px; color: var(--navy); }
.dialog-card > p { color: var(--muted); }
.button-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 18px; }
.button-stack { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.file-button { display: grid; place-items: center; position: relative; color: var(--navy); background: #fff; border-color: #b9c7d3; cursor: pointer; }
.file-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Admin */
#adminView { width: min(1280px, 100%); margin: 0 auto; padding: 32px clamp(14px, 3.5vw, 40px) 54px; }
.admin-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.admin-top h1 { margin: 5px 0 0; color: var(--navy); font-size: clamp(2rem, 4vw, 3.1rem); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.admin-controls { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(260px, 1fr) auto; gap: 14px; align-items: end; margin-bottom: 18px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid #d9e1e8; }
.admin-tabs { display: flex; overflow-x: auto; gap: 5px; margin: 0 0 18px; padding: 5px; border-radius: 13px; background: #dfe7ed; }
.admin-tab { flex: 1 0 auto; min-height: 44px; border: 0; border-radius: 9px; padding: 9px 14px; color: #3f5364; background: transparent; font-weight: 750; }
.admin-tab.active { color: #fff; background: var(--navy); }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric-card { padding: 18px 16px; border-radius: 15px; background: #fff; border: 1px solid #dce4ea; box-shadow: 0 8px 21px rgba(13,39,66,.06); }
.metric-card strong { display: block; color: var(--navy); font-size: 1.9rem; line-height: 1; }
.metric-card span { display: block; margin-top: 7px; color: var(--muted); font-size: .78rem; font-weight: 700; line-height: 1.25; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-grid .card { padding: 24px; }
.dashboard-grid h2, #tab-overview > .card h2 { font-size: 1.25rem; margin: 0 0 18px; }
.bar-list { display: flex; flex-direction: column; gap: 12px; }
.bar-row { display: grid; grid-template-columns: minmax(130px, 1.35fr) 2fr auto; gap: 10px; align-items: center; font-size: .83rem; }
.bar-track { height: 9px; border-radius: 99px; background: #e4ebf0; overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--navy-2); }
.bar-value { min-width: 25px; text-align: right; color: var(--muted); font-weight: 800; }
.empty-state { padding: 20px; border: 1px dashed #bdcbd5; border-radius: 12px; color: var(--muted); text-align: center; }
.followup-list { display: grid; gap: 10px; }
.followup-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 13px 14px; border: 1px solid #dbe3e9; border-radius: 11px; }
.followup-item b { color: var(--navy); }
.followup-item small { display: block; margin-top: 4px; color: var(--muted); }
.status-badge { align-self: start; padding: 5px 8px; border-radius: 99px; font-size: .7rem; font-weight: 800; color: #fff; background: var(--success); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 15px; }
.panel-heading h2 { margin-bottom: 3px; }
.panel-heading p { margin: 0; color: var(--muted); }
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid #d8e1e7; background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 13px 12px; border-bottom: 1px solid #e4eaee; text-align: left; vertical-align: top; font-size: .85rem; }
th { position: sticky; top: 0; color: #4d6070; background: #f1f5f7; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
tbody tr:hover { background: #fafcfd; }
.table-action { min-height: 34px; padding: 5px 9px; border: 1px solid #b9c7d3; border-radius: 8px; color: var(--navy); background: #fff; font-weight: 750; }
.detail-card { margin-top: 16px; box-shadow: none; }
.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.detail-block { padding: 14px; border-radius: 11px; background: #f4f7f9; }
.detail-block h3 { margin: 0 0 8px; color: var(--navy); font-size: .9rem; }
.detail-block p { margin: 4px 0; color: #435667; font-size: .84rem; line-height: 1.4; overflow-wrap: anywhere; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.setup-grid .card { box-shadow: 0 9px 22px rgba(13,39,66,.06); }
.setup-grid .card h2 { font-size: 1.4rem; margin-top: 0; }
.danger-zone { border-color: #efcaca; }

/* Seller report */
.seller-report { background: #fff; border: 1px solid #d8e1e7; border-radius: 16px; padding: clamp(26px, 5vw, 55px); box-shadow: var(--shadow); }
.report-header { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 2px solid var(--navy); }
.report-header h1 { margin: 6px 0; color: var(--navy); font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 2.3rem; }
.report-header p { margin: 4px 0; color: var(--muted); }
.report-brand { text-align: right; color: var(--navy); font-weight: 800; }
.report-summary { margin: 26px 0; padding: 18px 20px; border-left: 5px solid var(--gold); background: #fbf7ef; line-height: 1.65; }
.report-metrics { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin: 24px 0; }
.report-metric { padding: 15px; border-radius: 12px; background: #f1f5f7; }
.report-metric strong { display: block; color: var(--navy); font-size: 1.7rem; }
.report-metric span { color: var(--muted); font-size: .78rem; font-weight: 750; }
.report-section { margin-top: 30px; break-inside: avoid; }
.report-section h2 { padding-bottom: 7px; border-bottom: 1px solid #cfd9e1; color: var(--navy); font-size: 1.25rem; }
.report-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.report-list { margin: 0; padding-left: 20px; color: #3d4f5f; line-height: 1.6; }
.report-table { min-width: 0; }
.report-table th { position: static; }
.anonymous-comments { display: grid; gap: 9px; }
.anonymous-comment { padding: 12px 14px; border-radius: 10px; background: #f5f8fa; color: #415363; font-style: italic; }
.report-disclaimer { margin-top: 32px; padding-top: 15px; border-top: 1px solid #d6e0e7; color: #71808c; font-size: .72rem; line-height: 1.45; }

@media (max-width: 900px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .choice-grid.four-col { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 720px) {
  .field-grid.two-col, .field-grid.three-col, .choice-grid.three-col, .choice-grid.two-col, .dashboard-grid, .setup-grid, .report-columns { grid-template-columns: 1fr; }
  .intent-grid { grid-template-columns: 1fr !important; }
  .admin-top, .panel-heading, .report-header { flex-direction: column; align-items: stretch; }
  .admin-controls { grid-template-columns: 1fr; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .report-brand { text-align: left; }
  .bar-row { grid-template-columns: minmax(95px,1.3fr) 1.6fr auto; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 430px) {
  #guestView { padding-left: 10px; padding-right: 10px; }
  .card { border-radius: 16px; padding: 20px 16px; }
  .choice-grid.four-col { grid-template-columns: 1fr 1fr; }
  .wizard-actions .primary-button, .wizard-actions .secondary-button { min-width: 0; flex: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .report-metrics { grid-template-columns: 1fr 1fr; }
}

@media print {
  @page { size: Letter; margin: .55in; }
  body { background: #fff; }
  .no-print, #guestView, .admin-top, .admin-controls, .admin-tabs, #tab-overview, #tab-visitors, #tab-setup, #tab-data, .panel-heading { display: none !important; }
  #adminView, #tab-report, .admin-panel.active { display: block !important; width: auto; margin: 0; padding: 0; }
  .seller-report { border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .report-header h1 { font-size: 23pt; }
  .report-section { break-inside: avoid; }
  .report-disclaimer { font-size: 7.5pt; }
}
