/* RoastAbout. Retains the app’s existing web-font families with local fallbacks. */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Outfit:wght@500;700;800&display=swap');

:root {
  --cream: #faf7f0;
  --surface: #fffdf8;
  --ink: #302238;
  --muted: #625a65;
  --lime: #e2eea6;
  --border: #807584;
  --line: #e3ddd5;
  --error: #8c2934;
  --error-bg: #fff0ef;
  --success: #345437;
  --success-bg: #edf4e8;
  --focus: #6752a5;
  font-size: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'DM Sans', Arial, sans-serif; font-size: 1rem; line-height: 1.5; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
button, input, textarea, select { color: var(--ink); }
button { min-height: 44px; max-width: 100%; overflow-wrap: anywhere; }
body.modal-open { overflow: hidden; }
button:disabled { opacity: .62; cursor: not-allowed; }
input, textarea { min-width: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 12px 14px; line-height: 1.5; }
input:not([type=checkbox]), textarea { width: 100%; font-size: 1rem; }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: #746c77; opacity: 1; }
label, .field-label { display: block; font-weight: 700; margin: 0 0 8px; }
a { color: var(--ink); text-underline-offset: 3px; }
a, p, h1, h2, h3, strong, small { overflow-wrap: anywhere; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { max-width: 1000px; margin-inline: auto; padding-inline: 20px; }
.skip-link { position: absolute; z-index: 100; left: 20px; top: -100px; padding: 12px 16px; border: 2px solid var(--ink); background: var(--lime); border-radius: 8px; }
.skip-link:focus { top: 12px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 24px; }
.brand { max-width: 100%; overflow-wrap: anywhere; font: 800 2rem/1.1 Outfit, 'Trebuchet MS', sans-serif; letter-spacing: -.045em; }
.header-actions, .nav { display: flex; align-items: center; gap: 20px; }
.nav { gap: 16px; flex-wrap: wrap; }
.nav button { border: 0; border-radius: 0; padding: 10px 0; background: transparent; font-size: .875rem; font-weight: 500; position: relative; }
.nav button.active { font-weight: 700; }
.nav button.active::after { content: ''; position: absolute; inset: auto 0 0; height: 4px; border-radius: 2px; background: var(--lime); }
.profile-btn { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; border: 0; background: transparent; font-size: .875rem; white-space: nowrap; }
.account-icon { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.profile-btn.signed .account-icon { fill: var(--lime); }
.profile-btn.active span { text-decoration: underline; text-decoration-thickness: 3px; text-decoration-color: var(--lime); text-underline-offset: 8px; }
.screen { display: none; }
.screen.active { display: block; }
h1, h2, h3, .title { font-family: Outfit, 'Trebuchet MS', sans-serif; line-height: 1.15; letter-spacing: -.025em; }
h1 { font-size: 3.5rem; font-weight: 800; margin: 0 0 12px; }
h2, .title { font-size: 1.75rem; font-weight: 700; margin: 0 0 12px; }
h3 { font-size: 1.375rem; font-weight: 700; margin: 0 0 8px; }
.hero { padding: 24px 0 8px; }
.lead { color: var(--ink); font-size: 1.125rem; line-height: 1.5; margin: 0 0 16px; }
.over { color: var(--muted); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; margin-bottom: 8px; }
.small, .field-help { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.field-help { margin: 8px 0 0; }
.intent-choices { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; margin: 16px 0 24px; }
.intent-choice { position: relative; display: grid; grid-template-columns: 56px minmax(0,1fr); align-items: center; gap: 16px; min-height: 132px; padding: 20px 16px; text-align: left; border: 1px solid var(--border); border-radius: 12px; background: transparent; }
.intent-choice.selected { background: var(--lime); border: 2px solid var(--ink); padding: 19px 15px; }
.intent-icon { width: 56px; height: 56px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.intent-copy { overflow-wrap: anywhere; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.intent-name { font: 700 1.5rem/1.15 Outfit, 'Trebuchet MS', sans-serif; letter-spacing: -.025em; }
.intent-desc { font-size: 1rem; line-height: 1.4; }
.intent-check { display: none; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--surface); align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; line-height: 1; }
.intent-choice.selected .intent-check { display: flex; }
.intent-entry { margin-bottom: 32px; }
.intent-entry textarea { display: block; min-height: 104px; }
.discovery-go, .cta, .add button, .checkin-controls .primary { background: var(--ink); color: var(--surface); border: 1px solid var(--ink); border-radius: 8px; padding: 12px 18px; font-weight: 700; }
.discovery-go { display: flex; align-items: center; justify-content: center; gap: 16px; width: 100%; min-height: 52px; margin-top: 16px; font-size: 1.125rem; }
.discovery-go:hover, .cta:hover, .add button:hover, .checkin-controls .primary:hover { background: #493650; }
.intent-hint { text-align: center; color: var(--muted); font-size: .875rem; margin: 10px 0 0; }
.search-controls { display: grid; grid-template-columns: minmax(0,1fr) auto 180px; gap: 8px 16px; margin: 24px 0 16px; align-items: start; }
.location-field { grid-column: 1; grid-row: 1; }
.radius-field { grid-column: 3; grid-row: 1; }
.location-button { grid-column: 2; grid-row: 1; margin-top: 32px; }
.location-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.location-disclosure, .location-status { grid-column: 1 / -1; margin: 0; }
.location-status { font-weight: 500; }
.panel { margin: 24px 0 32px; padding: 0; max-width: none; }
.panel > .small { margin: 0 0 12px; }
.chat { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; max-height: 320px; overflow-y: auto; }
.chat:empty { margin: 0; }
.bubble { align-self: flex-start; padding: 12px 16px; max-width: 90%; border-radius: 12px; background: #ede8ee; overflow-wrap: anywhere; }
.bubble.user { align-self: flex-end; background: var(--lime); }
.bubble.error, .error, [data-state=error] .search-status { background: var(--error-bg); color: var(--error); border-color: var(--error); }
.success, .saved-message { color: var(--success); background: var(--success-bg); }
.entry { display: flex; align-items: stretch; gap: 12px; }
.entry textarea { flex: 1; min-height: 88px; }
.entry .cta { align-self: stretch; min-width: 100px; }
.feedback-consent { display: flex; align-items: center; gap: 12px; min-height: 44px; margin: 12px 0 0; font-weight: 400; font-size: .875rem; cursor: pointer; }
.feedback-consent input { appearance: auto; flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--ink); }
.feedback-consent:has(input:disabled) { color: var(--muted); }
.notice { background: #eee9e1; border-radius: 8px; padding: 12px 16px; margin: 16px 0; font-size: .875rem; color: var(--muted); }
.notice p { margin: 0 0 8px; }
.notice button { margin: 4px 8px 0 0; }
#matches { margin: 24px 0 40px; }
#matches > p { margin: 0 0 20px; }
.cards { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; gap: 24px; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 20px; overflow: hidden; }
.card h3 { font-size: 1.375rem; margin: 4px 0 8px; }
.card p { font-size: .875rem; line-height: 1.55; color: var(--muted); margin: 8px 0; }
.card a { overflow-wrap: anywhere; }
.card > a { display: inline-block; padding-block: 10px; font-size: .875rem; }
.card-cover { background: #ede8df; margin: -20px -20px 16px; overflow: hidden; }
.photo-frame { position: relative; width: 100%; aspect-ratio: 2.1; display: grid; place-items: center; overflow: hidden; padding: 12px; text-align: center; font-size: .875rem; color: var(--muted); }
.photo-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-credit { min-height: 3.5rem; height: 3.5rem; padding: 6px 12px; font-size: .875rem; line-height: 1.5; overflow: auto; overflow-wrap: anywhere; background: var(--surface); }
.photo-credit a { color: var(--muted); }
.pill { font-size: .75rem; color: var(--muted); font-weight: 700; letter-spacing: .03em; }
.why-label { margin: 16px 0 4px; font-size: .875rem; font-weight: 700; color: var(--ink); }
.card .why { font-size: 1rem; color: var(--ink); line-height: 1.55; }
.card .why:empty { display: none; }
.chips { display: flex; gap: 8px 16px; flex-wrap: wrap; margin: 12px 0; }
.chip { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.card .chip + .chip { border-left: 1px solid var(--line); padding-left: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.actions button, .mini, .checkin-controls button, .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; background: transparent; color: var(--ink); font-weight: 700; font-size: .875rem; line-height: 1.5; text-decoration: none; }
.actions button:hover, .mini:hover { background: #eee9e1; }
.card .actions button:first-child { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.card .actions button[aria-pressed=true] { background: var(--lime); color: var(--ink); }
.evidence { margin-top: 20px; padding-top: 8px; border-top: 1px solid var(--line); }
.evidence summary { min-height: 44px; padding-block: 10px; font-weight: 700; font-size: .875rem; }
.evidence a { display: inline-block; font-size: .875rem; padding-block: 10px; }
.evidence blockquote { border-left: 2px solid var(--line); margin: 16px 0; padding-left: 12px; font-size: .875rem; overflow-wrap: anywhere; }
.passport { padding: 24px 0 40px; }
.passport > .title { font-size: 2.25rem; }
.passport > .lead { font-size: 1rem; color: var(--muted); max-width: 580px; }
.statrow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; padding-block: 16px; border-bottom: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; gap: 10px; }
.stat strong { font: 700 1.75rem/1.1 Outfit, 'Trebuchet MS', sans-serif; }
.stat span { font-size: .875rem; color: var(--muted); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 16px; }
.tabs button.active { background: var(--lime); border: 2px solid var(--ink); padding: 9px 13px; }
.tabs button.active::before { content: '✓'; }
.roster { display: flex; flex-direction: column; gap: 12px; }
.roster > .small { margin: 0; padding: 24px 0; }
.item { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; background: var(--surface); border: 1px solid var(--line); padding: 20px; border-radius: 12px; min-width: 0; }
.item > div { min-width: 0; }
.item strong { font-family: Outfit, 'Trebuchet MS', sans-serif; font-size: 1.25rem; }
.item small { display: block; font-size: .875rem; margin-top: 4px; color: var(--muted); }
.item .actions { margin: 0; flex-shrink: 0; max-width: 55%; }
.visit-note { font-size: .875rem; line-height: 1.5; margin: 8px 0; color: var(--muted); }
.add-label { margin-top: 24px; }
.add { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 12px; }
.add input { flex: 1; min-width: 120px; }
.add button { min-height: 48px; }
.badges { display: flex; flex-wrap: wrap; gap: 16px; padding-block: 12px; }
.badge { flex: 1; min-width: 160px; font-size: .875rem; font-weight: 700; }
.badge span { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.badge.locked { color: var(--muted); }
.account-card { max-width: 560px; padding: 24px; margin: 16px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.account-heading { font-size: 2.25rem; margin: 8px 0 16px; }
.social-signin { display: grid; gap: 12px; margin: 24px 0 16px; }
.social-signin button { padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: transparent; font-weight: 700; }
.signin-divider { text-align: center; font-size: .875rem; color: var(--muted); }
#signinForm label { flex-basis: 100%; margin-bottom: 0; }
#signinForm { margin-block: 16px; }
.account-card > .mini { margin: 8px 8px 0 0; }
.checkin-overlay { display: none; position: fixed; inset: 0; z-index: 50; padding: 24px 20px; align-items: flex-start; justify-content: center; overflow-y: auto; overscroll-behavior: contain; background: #30223899; }
.checkin-overlay.open { display: flex; }
.checkin-modal { width: min(100%,560px); max-height: calc(100dvh - 48px); overflow-y: auto; overscroll-behavior: contain; border-radius: 12px; padding: 24px; background: var(--surface); }
.checkin-modal h2 { font-size: 1.75rem; }
.checkin-modal h3, .notes-label { font-family: 'DM Sans', Arial, sans-serif; font-size: 1rem; letter-spacing: 0; margin: 24px 0 12px; }
.checkin-modal .small { font-weight: 400; }
.checkin-row { display: flex; flex-wrap: wrap; gap: 8px; }
.checkin-row button { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: transparent; font-size: .875rem; }
.checkin-row button.selected { background: var(--lime); border: 2px solid var(--ink); padding: 9px 11px; font-weight: 700; }
.checkin-row button.selected::before { content: '✓ '; }
.checkin-modal textarea { min-height: 88px; }
.explain { font-size: .875rem; line-height: 1.5; color: var(--muted); margin: 8px 0; }
.checkin-controls { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
footer { display: flex; align-items: baseline; gap: 16px; border-top: 1px solid var(--line); padding-block: 24px; font-size: .875rem; color: var(--muted); }
footer strong { color: var(--ink); font-family: Outfit, 'Trebuchet MS', sans-serif; font-size: 1.25rem; }

@media (max-width: 800px) {
  header { display: flex; flex-wrap: wrap; gap: 16px; padding-top: 20px; padding-bottom: 12px; }
  .header-actions { display: contents; }
  .profile-btn { margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 4px 12px; }
  .nav button { white-space: normal; }
  .brand { font-size: 1.875rem; }
  h1 { font-size: 2.375rem; line-height: 1.12; }
  .hero { padding-top: 24px; }
  .lead { font-size: 1rem; }
  .intent-choices { grid-template-columns: 1fr; gap: 12px; margin: 16px 0 24px; }
  .intent-choice { grid-template-columns: 56px minmax(0,1fr) 22px; min-height: 104px; padding: 16px; gap: 16px; }
  .intent-choice.selected { padding: 15px; }
  .intent-check { position: static; }
  .intent-name { font-size: 1.375rem; }
  .intent-desc { font-size: 1rem; }
  .search-controls { grid-template-columns: minmax(0,1fr) 160px; gap: 16px; }
  .location-field { grid-column: 1; grid-row: 1; }
  .radius-field { grid-column: 2; grid-row: 1; }
  .location-button { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .location-disclosure, .location-status { grid-column: 1 / -1; }
  .cards { gap: 16px; }
  .item { flex-direction: column; gap: 16px; }
  .item .actions { max-width: 100%; }
  .stat { display: block; }
  .stat strong { display: block; margin-bottom: 4px; }
  footer { flex-direction: column; gap: 8px; }
}
@media (max-width: 560px) {
  h1 { font-size: 2.25rem; }
  .brand { font-size: 1.75rem; }
  .profile-btn { gap: 4px; }
  .account-icon { width: 24px; height: 24px; }
  .intent-choice { grid-template-columns: 48px minmax(0,1fr) 22px; gap: 12px; }
  .intent-icon { width: 48px; height: 48px; }
  .search-controls { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .location-field { grid-column: 1; grid-row: 1; }
  .location-button { grid-column: 1; grid-row: 2; }
  .radius-field { grid-column: 1; grid-row: 3; }
  .location-disclosure { grid-column: 1; grid-row: 4; }
  .location-status { grid-column: 1; grid-row: 5; }
  .entry { flex-direction: column; }
  .cards { grid-template-columns: minmax(0,1fr); }
  .card { padding: 16px; }
  .card-cover { margin: -16px -16px 16px; }
  .card .actions > * { flex: 1; }
  .bubble { max-width: 100%; }
  .passport > .title, .account-heading { font-size: 2rem; }
  .statrow { gap: 12px; }
  .stat strong { font-size: 1.5rem; }
  .stat span { font-size: .875rem; }
  .account-card { padding: 20px; }
  #signinForm input, #signinForm button { flex-basis: 100%; }
  .checkin-overlay { padding: 12px; }
  .checkin-modal { max-height: calc(100dvh - 24px); padding: 20px; }
  .checkin-controls { flex-wrap: wrap; }
  .checkin-controls button { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Runtime feedback uses the same calm hierarchy without hiding uncertainty. */
.app-status { margin: 8px 0 16px; padding: 12px 16px; border-left: 3px solid var(--border); background: #eee9e1; color: var(--ink); font-size: .875rem; border-radius: 0 8px 8px 0; }
.app-status:empty { display: none; }
.app-status.is-success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.branch-address { margin-top: 4px; color: var(--muted); font-size: .875rem; }
.place-facts { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0; color: var(--muted); font-size: .875rem; }
.uncertainty { padding-left: 12px; border-left: 2px solid var(--border); }
.card .actions .save-place.is-saved { background: var(--lime); color: var(--ink); border-color: var(--ink); }
.search-state, #searchIntro.search-state { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.search-state.is-error, .app-status.is-error { color: var(--error); background: var(--error-bg); border-color: var(--error); }
.search-state.is-loading { border-color: var(--border); }

.checkin-status { margin: 16px 0 0; padding: 12px; border-left: 3px solid var(--border); border-radius: 0 8px 8px 0; color: var(--ink); background: #eee9e1; font-size: .875rem; }
.checkin-status:empty { display: none; }
.checkin-status.is-error { color: var(--error); border-color: var(--error); background: var(--error-bg); }

/* Fail closed from first paint, including when scripts fail. */
body:not([data-admission="admitted"]) .nav,
body:not([data-admission="admitted"]) .screen:not(#account),
body:not([data-admission="admitted"]) #checkinOverlay,
body:not([data-admission="admitted"]) #importGuest,
body:not([data-admission="admitted"]) #importLegacy,
body:not([data-admission="admitted"]) #backToPassport {display:none!important}
body:not([data-admission="admitted"]) #account {display:block!important}
