:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182018;
  background: #f4f3ee;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f7f6f1 0, #ecebe5 100%); }
button, input, select { font: inherit; }
.shell { width: min(920px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 80px; }
.hero { max-width: 680px; margin-bottom: 28px; }
.hero h1 { margin: 6px 0 12px; font-size: clamp(2.1rem, 6vw, 4.4rem); line-height: .95; letter-spacing: -.055em; }
.hero p:last-child { max-width: 620px; font-size: 1.05rem; line-height: 1.6; color: #536052; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 750; color: #667663; }
.card, .notice { background: rgba(255,255,255,.88); border: 1px solid #d8ddd5; border-radius: 20px; box-shadow: 0 15px 45px rgba(37,48,35,.07); }
.card { padding: 24px; margin-top: 18px; }
.notice { padding: 14px 18px; }
.notice.success { border-color: #b9ceb6; background: #f4fbf2; }
.notice.error { border-color: #e0b9b5; background: #fff5f4; }
.hidden { display: none !important; }
.section-head { display: flex; gap: 16px; align-items: center; justify-content: space-between; }
h2 { margin: 3px 0 16px; font-size: 1.45rem; }
.stay-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0; }
.stay-grid div { padding: 14px; background: #f3f5f1; border-radius: 14px; }
dt { font-size: .76rem; color: #677066; margin-bottom: 4px; }
dd { margin: 0; font-weight: 700; }
.traveler { border: 0; border-top: 1px solid #dde2da; margin: 22px 0 0; padding: 22px 0 0; }
.traveler legend { font-weight: 800; font-size: 1.05rem; padding-right: 12px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.identity, .signature-block, .minor-block { margin-top: 14px; }
.span2 { grid-column: 1 / -1; }
label { display: grid; gap: 7px; font-size: .87rem; font-weight: 650; color: #475245; }
input, select { width: 100%; min-height: 44px; border: 1px solid #c9d0c6; border-radius: 10px; background: #fff; color: #182018; padding: 9px 11px; }
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(83,117,78,.25); outline-offset: 1px; border-color: #698065; }
button { border: 0; border-radius: 11px; min-height: 44px; padding: 10px 16px; cursor: pointer; font-weight: 760; }
.primary { background: #263b28; color: white; margin-top: 18px; }
.secondary { background: #e9ede6; color: #263b28; }
.legal-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-weight: 500; line-height: 1.45; }
.legal-check input { width: 18px; min-height: 18px; margin: 2px 0 0; flex: 0 0 auto; }
.privacy-note { font-size: .84rem; color: #687267; line-height: 1.55; }
@media (max-width: 720px) {
  .shell { width: min(100% - 22px, 920px); padding-top: 30px; }
  .card { padding: 18px; border-radius: 16px; }
  .stay-grid { grid-template-columns: repeat(2, 1fr); }
  .grid.two { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .secondary, .primary { width: 100%; }
}
.signature-pad { display: grid; gap: 8px; margin-top: 12px; }
.signature-label { font-size: .87rem; font-weight: 650; color: #475245; }
.signature-canvas { width: 100%; height: 150px; display: block; border: 1px dashed #aeb9ab; border-radius: 12px; background: #fff; touch-action: none; }
.signature-clear { justify-self: start; min-height: 36px; padding: 7px 12px; }

.count-hint { font-size: .84rem; color: #687267; font-weight: 650; }

.topbar { min-height: 42px; display: flex; justify-content: flex-end; margin-bottom: 12px; }
.language { display: flex; align-items: center; gap: 8px; grid-template-columns: auto auto; }
.language select { width: auto; min-width: 112px; min-height: 38px; }
.companion-list { display: grid; gap: 10px; margin-top: 16px; }
.companion-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 14px; background: #f3f5f1; border-radius: 12px; }
.companion-item > div { display: grid; gap: 3px; }
.slot-status { font-size: .8rem; color: #687267; }
.slot-status.complete { font-weight: 750; color: #385c38; }
.compact { min-height: 36px; padding: 7px 11px; font-size: .83rem; }
.private-placeholder { padding: 20px; background: #f5f6f3; border-radius: 14px; }
.private-placeholder p { color: #687267; margin-bottom: 0; }
.custom-grid { margin-top: 16px; }
textarea { width: 100%; min-height: 96px; border: 1px solid #c9d0c6; border-radius: 10px; background: #fff; color: #182018; padding: 9px 11px; font: inherit; resize: vertical; }
.legal-documents { margin-top: 18px; padding-top: 16px; border-top: 1px solid #dde2da; }
.legal-documents h3 { margin: 0 0 10px; font-size: 1rem; }
.legal-document { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: #f5f6f3; }
.legal-document summary { cursor: pointer; font-weight: 700; }
.legal-document p { color: #596458; line-height: 1.55; white-space: pre-wrap; }
.legal-document .legal-summary { font-weight: 600; color: #34423a; }
.legal-document h4 { margin: 14px 0 4px; font-size: 0.98rem; color: #34423a; }
.portal-footer { display: flex; justify-content: center; padding-top: 24px; }
.link-button { background: transparent; color: #60705e; text-decoration: underline; font-weight: 600; }
.companion-actions { display: flex !important; grid-template-columns: none; align-items: center; justify-content: flex-end; gap: 6px !important; flex-wrap: wrap; }
.text-button { background: transparent; color: #667663; text-decoration: underline; }
.text-button:hover { color: #263b28; }
@media (max-width: 720px) {
  .companion-item { align-items: flex-start; flex-direction: column; }
  .companion-actions { width: 100%; justify-content: flex-start; }
}

.document-scan { margin: 14px 0 18px; padding: 16px; border: 1px solid #c8d2c5; border-radius: 14px; background: linear-gradient(180deg, #f4f8f1 0, #f8faf6 100%); }
.document-scan-prominent { box-shadow: inset 0 0 0 1px rgba(76,101,71,.04); }
.scan-kicker { margin: 0 0 4px; text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 800; color: #667663; }
.scan-title { margin: 0 0 7px; font-size: 1.05rem; color: #263b28; }
.document-scan-help { margin: 0 0 12px; color: #596458; line-height: 1.5; }
.scan-primary { width: 100%; margin-top: 0; }
.scan-manual { margin: 10px 0 0; font-size: .82rem; color: #687267; }
.scan-autofilled { background: #f2faef; border-color: #8caf83; box-shadow: 0 0 0 2px rgba(95,135,86,.08); }
.document-scan-button { width: auto; }
.document-scan-status { margin: 8px 0 0; }
@media (max-width: 720px) {
  .document-scan-button { width: 100%; }
}

.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.scan-actions button { width: 100%; margin: 0; }
.scan-privacy { margin: 10px 0 0; font-size: .8rem; line-height: 1.4; color: #667166; }
@media (max-width: 520px) { .scan-actions { grid-template-columns: 1fr; } }

.field-help { display: block; margin-top: 5px; font-size: .78rem; line-height: 1.35; color: #727b70; }

html.camera-open, html.camera-open body { overflow: hidden; }
.guided-camera-overlay {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center;
  padding: 14px; background: rgba(8, 12, 9, .92);
}
.guided-camera-dialog {
  width: min(760px, 100%); max-height: 100%; overflow: auto; border-radius: 18px;
  background: #111713; color: #f5f7f4; box-shadow: 0 18px 60px rgba(0,0,0,.42);
}
.guided-camera-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; }
.guided-camera-close { width: 42px; min-height: 42px; padding: 0; background: transparent; color: #fff; font-size: 1.8rem; }
.guided-camera-stage { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #000; }
.guided-camera-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.guided-camera-preview { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#000; z-index:3; }
.guided-camera-shade { position: absolute; inset: 0; background: rgba(0,0,0,.18); pointer-events: none; }
.guided-camera-guide {
  position: absolute; left: 50%; top: 50%; width: min(86%, 660px); aspect-ratio: var(--document-aspect, 1.586);
  transform: translate(-50%, -50%); border: 3px solid rgba(255,255,255,.92); border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.28), inset 0 0 0 1px rgba(0,0,0,.2); pointer-events: none;
}
.guided-camera-status { margin: 14px 16px 4px; min-height: 1.5em; font-weight: 700; text-align: center; }
.guided-camera-status[data-quality="ready"] { color: #d9f3d1; }
.guided-camera-status[data-quality="holding"],
.guided-camera-status[data-quality="dark"],
.guided-camera-status[data-quality="bright"],
.guided-camera-status[data-quality="blurry"] { color: #ffe7ad; }
.guided-camera-privacy { margin: 4px 16px 0; color: #c5cdc3; font-size: .82rem; text-align: center; }
.guided-camera-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px 18px; }
.guided-camera-actions button { width: 100%; margin: 0; }
@media (max-width: 520px) {
  .guided-camera-overlay { padding: 0; place-items: stretch; }
  .guided-camera-dialog { width: 100%; min-height: 100%; border-radius: 0; display: flex; flex-direction: column; }
  .guided-camera-stage { margin-top: auto; margin-bottom: auto; aspect-ratio: 3 / 4; }
  .guided-camera-guide { width: 88%; }
  .guided-camera-actions { grid-template-columns: 1fr; }
}

/* Guest Hub progressive shell; hidden unless the server feature flag is enabled. */
.hub-heading { margin-top: 1rem; }
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.hub-panel { margin: 0; min-width: 0; }
.hub-panel h3 { margin-top: 0; }
.hub-facts { display: grid; gap: .7rem; margin: 0; }
.hub-facts div { display: grid; grid-template-columns: minmax(7rem, .8fr) 1.2fr; gap: .75rem; }
.hub-facts dt { font-weight: 600; }
.hub-facts dd { margin: 0; overflow-wrap: anywhere; }
.hub-state { font-weight: 650; }
@media (max-width: 800px) { .hub-grid { grid-template-columns: 1fr; } }

/* Guest Hub owner verification. Hidden unless owner_verification is enabled. */
.hub-identity-form { display: grid; gap: .9rem; margin-top: 1rem; }
.hub-identity-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.hub-identity-actions button { width: 100%; }
#hub-identity-code { font-size: 1.25rem; letter-spacing: .22em; text-align: center; }
@media (max-width: 520px) {
  .hub-identity-actions { grid-template-columns: 1fr; }
}

.hub-pin-panel { margin-top: 12px; padding: 14px; border: 1px solid #c8d2c5; border-radius: 14px; text-align: center; background: #f8faf6; }
.hub-pin-label { display: block; margin-bottom: 6px; color: #596458; font-size: .9rem; }
.hub-pin-value { display: block; margin: 4px 0 8px; font-size: clamp(2rem, 9vw, 3rem); line-height: 1.05; letter-spacing: .16em; font-variant-numeric: tabular-nums; }
.hub-pin-panel .privacy-note { margin: 6px 0 12px; }

/* Real-device canary polish: make document mode obvious and camera feedback legible. */
.scan-format { display: grid; gap: 6px; padding: 12px; border: 1px solid #d8dfd5; border-radius: 12px; background: #f6f8f4; font-weight: 700; }
.scan-format select { min-height: 46px; font-weight: 700; }
.guided-camera-guide[data-quality="ready"] { border-color: #9ee18f; box-shadow: 0 0 0 2px rgba(158,225,143,.22); }
.guided-camera-guide[data-quality="holding"], .guided-camera-guide[data-quality="dark"], .guided-camera-guide[data-quality="bright"], .guided-camera-guide[data-quality="blurry"] { border-color: #ffd27a; }

.checkin-steps { list-style:none; margin:4px 0 20px; padding:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.checkin-steps li { display:flex; align-items:center; gap:8px; min-width:0; padding:10px 11px; border:1px solid #d8ddd5; border-radius:12px; background:#f7f8f4; color:#445044; }
.checkin-steps li span { flex:0 0 24px; width:24px; height:24px; display:grid; place-items:center; border-radius:50%; background:#264d35; color:#fff; font-size:.76rem; font-weight:800; }
.checkin-steps li strong { font-size:.78rem; line-height:1.25; font-weight:700; }
@media (max-width:520px) { .checkin-steps { gap:5px; } .checkin-steps li { padding:8px 7px; gap:5px; } .checkin-steps li span { flex-basis:21px; width:21px; height:21px; } .checkin-steps li strong { font-size:.68rem; } }
