:root {
  color-scheme: dark;
  --crimson: #b40020;
  --crimson-deep: #7f001a;
  --crimson-bright: #ef2446;
  --white: #fff;
  --ink: #21171a;
  --muted-white: rgb(255 255 255 / .72);
  --glass: rgb(255 255 255 / .13);
  --glass-strong: rgb(255 255 255 / .19);
  --glass-line: rgb(255 255 255 / .23);
  --glass-shadow: 0 1rem 2.5rem rgb(42 0 11 / .12), inset 0 1px 0 rgb(255 255 255 / .17);
  --focus: #ffcb61;
  --space-1: .5rem;
  --space-2: .75rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2rem;
  --radius-small: .85rem;
  --radius-medium: 1.4rem;
  --radius-large: 1.7rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--crimson-deep); scroll-behavior: smooth; }
body { min-height: 100svh; margin: 0; color: var(--white); background: radial-gradient(circle at 78% 55%, var(--crimson-bright) 0, var(--crimson) 38%, var(--crimson-deep) 100%); }
.chat-background-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% center; }
body.has-chat-video::before { content: ""; position: fixed; z-index: 1; inset: 0; background: linear-gradient(90deg, rgb(56 0 13 / .76), rgb(84 0 19 / .42) 55%, rgb(70 0 15 / .15)); pointer-events: none; }
body.has-chat-video .stage-mark { display: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.skip { position: absolute; z-index: 100; top: -6rem; left: 1rem; padding: var(--space-2) var(--space-3); border-radius: var(--radius-small); color: var(--ink); background: var(--white); }
.skip:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.site-shell { position: relative; z-index: 2; display: flex; flex-direction: column; min-height: 100svh; }
.site-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) clamp(1.25rem, 3vw, 3rem); }
.brand { display: inline-flex; flex: none; align-items: center; }
.brand img { display: block; width: clamp(10rem, 16vw, 14rem); height: auto; }
.utility-nav { display: flex; align-items: center; gap: var(--space-4); }
.utility-nav a, .site-footer a { font-size: .86rem; text-underline-offset: .25em; }
.utility-nav a:last-child { padding: .65rem .95rem; border: 1px solid var(--glass-line); border-radius: 99rem; background: var(--glass); text-decoration: none; }
.utility-nav a:hover, .site-footer a:hover { text-decoration-thickness: .13em; }
.stage { position: relative; flex: 1; display: flex; align-items: center; min-height: 0; padding: 1rem clamp(1.25rem, 4vw, 4rem) var(--space-5); isolation: isolate; }
.stage-mark { position: absolute; z-index: -1; top: 50%; right: 7vw; width: min(48vw, 44rem); height: auto; opacity: .14; filter: blur(1px); transform: translateY(-50%) rotate(-11deg); pointer-events: none; }
.conversation-column { width: min(100%, 38rem); margin-left: clamp(0rem, 2vw, 3rem); }
.chat-panel { color: var(--white); }
.chat-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); padding: 0 .5rem; }
.chat-heading strong { font-size: 1.1rem; font-weight: 650; }
.chat-heading p { margin: .12rem 0 0; color: var(--muted-white); font-size: .78rem; }
.chat-disclosure { max-width: 36rem; margin: var(--space-1) .5rem 0; color: var(--muted-white); font-size: .75rem; line-height: 1.45; }
.chat-disclosure a { text-underline-offset: .2em; }
#thread { height: min(26rem, 35svh); min-height: 15rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2rem .25rem var(--space-2); mask-image: linear-gradient(to bottom, transparent, #000 2.5rem); }
.msg { display: flex; margin: 0 0 var(--space-3); }
.msg.ai { justify-content: flex-end; }
.msg.user { justify-content: flex-start; }
.bubble, #askForm, #brief-panel, .manual-fallback[open] { border: 1px solid var(--glass-line); border-radius: var(--radius-large); background: var(--glass); box-shadow: var(--glass-shadow); backdrop-filter: blur(22px) saturate(.8); -webkit-backdrop-filter: blur(22px) saturate(.8); }
.bubble { width: 86%; padding: 1.1rem 1.3rem; overflow-wrap: anywhere; line-height: 1.55; }
.bubble::before { display: block; margin-bottom: .55rem; color: var(--muted-white); font-size: .78rem; line-height: 1; }
.ai .bubble::before { content: "Ⓢ  Sanifu"; }
.user .bubble::before { content: "Ⓨ  You"; }
.user .bubble { background: rgb(255 255 255 / .1); }
.bubble a { text-underline-offset: .2em; }
.chat-panel.unavailable #thread { height: auto; min-height: 0; overflow: visible; padding-top: 2rem; mask-image: none; }
.offline-answer { border-top: 1px solid var(--glass-line); margin-top: 1rem; padding-top: 1rem; }
.offline-bubble { width: 86%; margin-left: auto; padding: 1.1rem 1.3rem; border: 1px solid var(--glass-line); border-radius: var(--radius-large); background: var(--glass); box-shadow: var(--glass-shadow); backdrop-filter: blur(22px); line-height: 1.5; }
.offline-bubble::before { content: "Ⓢ  Sanifu"; display: block; margin-bottom: .55rem; color: var(--muted-white); font-size: .78rem; }
.offline-bubble p { margin: 0; }
.offline-bubble p + p { margin-top: .7rem; }
.offline-options { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-3); }
.offline-options a { display: inline-flex; padding: .5rem .85rem; border: 1px solid var(--glass-line); border-radius: 99rem; background: var(--glass); font-size: .78rem; text-decoration: none; }
.offline-options a:hover { background: var(--glass-strong); }
.chat-suggestions { display: flex; flex-wrap: nowrap; align-items: center; gap: var(--space-1); width: 100%; margin: 0 0 var(--space-3); overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: thin; }
.chat-suggestions p { flex: none; margin: 0; color: var(--muted-white); font-size: .76rem; }
.chat-suggestions button, .chat-actions button, .chat-controls button, .booking-card button, .retry { min-height: 2.3rem; border: 1px solid var(--glass-line); border-radius: 99rem; padding: .5rem .8rem; color: var(--white); background: var(--glass); font-size: .78rem; text-align: left; }
.chat-suggestions button { flex: 0 0 auto; max-width: 15rem; }
.chat-suggestions button:hover, .chat-actions button:hover, .chat-controls button:hover, .booking-card button:hover, .retry:hover { background: var(--glass-strong); }
button:disabled { opacity: .5; cursor: not-allowed; }
#askForm { display: flex; align-items: flex-end; gap: var(--space-2); padding: .7rem .8rem .7rem 1.2rem; }
#q { display: block; flex: 1; width: 100%; min-width: 0; min-height: 2.8rem; max-height: 10rem; padding: .6rem 0; resize: vertical; border: 0; outline: 0; color: var(--white); background: transparent; font-size: 1rem; line-height: 1.4; }
#q::placeholder { color: var(--muted-white); }
#q:focus-visible { outline: 0; }
#askForm:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
#askForm button[type=submit] { flex: none; display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; color: var(--crimson-deep); background: var(--white); font-size: 1.5rem; line-height: 1; }
#askForm button[type=submit]:hover { background: #ffe8ec; }
#chat-status, #brief-status, #manual-status { min-height: 1em; margin: .55rem .5rem; color: var(--muted-white); font-size: .75rem; line-height: 1.4; }
.history-menu { margin: var(--space-1) .5rem; color: var(--muted-white); font-size: .78rem; }
.history-menu summary { display: inline-block; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.chat-controls { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: var(--space-2) 0; }
.chat-controls select { flex: 1; min-width: 9rem; max-width: 19rem; min-height: 2.3rem; padding: 0 .5rem; border: 1px solid var(--glass-line); border-radius: var(--radius-small); color: var(--white); background: var(--crimson-deep); font-size: .8rem; }
.chat-actions { display: flex; flex-wrap: wrap; gap: var(--space-1); margin: var(--space-1) .5rem; }
#brief-panel { margin-top: var(--space-3); padding: var(--space-4); }
#brief-panel h2 { margin: 0 0 var(--space-2); font-size: 1.2rem; }
#brief-panel p { font-size: .85rem; line-height: 1.45; }
#brief-text { width: 100%; margin: var(--space-2) 0; padding: var(--space-2); border: 1px solid var(--glass-line); border-radius: var(--radius-small); color: var(--white); background: rgb(0 0 0 / .12); font-size: 1rem; line-height: 1.5; }
.chat-footnote { margin: var(--space-2) .5rem 0; color: var(--muted-white); font-size: .72rem; line-height: 1.4; }
.booking-card h3 { margin: 0 0 var(--space-2); font-size: 1rem; }
.booking-card label { display: block; margin: var(--space-2) 0; }
.booking-card input, .booking-card select { display: block; width: 100%; max-width: 23rem; min-height: 2.5rem; margin-top: .3rem; padding: .45rem; border: 1px solid var(--glass-line); border-radius: var(--radius-small); color: var(--white); background: var(--crimson-deep); font-size: 1rem; }
.booking-times button { margin: .2rem; }
.manual-fallback { margin: var(--space-3) 0 0; color: var(--muted-white); font-size: .8rem; }
.manual-fallback summary { display: inline-block; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.manual-fallback[open] { padding: var(--space-4); }
.manual-fallback p { line-height: 1.5; }
.manual-fallback label { display: block; margin: var(--space-3) 0; }
.manual-fallback textarea { display: block; width: 100%; min-height: 4rem; margin-top: .4rem; padding: .75rem; border: 1px solid var(--glass-line); border-radius: var(--radius-small); color: var(--white); background: rgb(0 0 0 / .12); font-size: 1rem; }
.manual-fallback button { min-height: 2.6rem; padding: .55rem .9rem; border: 1px solid var(--glass-line); border-radius: 99rem; color: var(--white); background: var(--glass); }
.site-footer { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) clamp(1.25rem, 3vw, 3rem); color: var(--muted-white); font-size: .8rem; }
.site-footer span { margin-right: auto; }
.legal { min-height: 100svh; padding: clamp(2rem, 6vw, 5rem) max(1.5rem, calc((100vw - 47rem)/2)); color: var(--ink); background: var(--white); line-height: 1.6; }
.legal h1 { font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1; }
.legal h2 { margin-top: var(--space-5); font-size: 1.4rem; }
.legal a { color: var(--crimson-deep); }
.legal .back { display: inline-block; margin-bottom: var(--space-5); }
@media (max-width: 48rem) {
  .site-header { padding: var(--space-3); }
  .brand img { width: 10rem; }
  .utility-nav { gap: var(--space-2); }
  .utility-nav a { font-size: .76rem; }
  .utility-nav a:last-child { padding: .55rem .7rem; }
  .stage { display: block; padding: .25rem var(--space-3) var(--space-4); }
  .stage-mark { right: -18vw; top: 30%; width: 80vw; opacity: .08; }
  .conversation-column { width: 100%; margin: 0; }
  #thread { height: 30svh; min-height: 12rem; padding-top: 1.4rem; }
  .bubble, .offline-bubble { width: 91%; padding: 1rem 1.1rem; }
  .chat-suggestions button { flex-basis: 12rem; }
  .site-footer { flex-wrap: wrap; padding: var(--space-4) var(--space-3); }
  .site-footer span { flex-basis: 100%; }
}
@media (max-width: 27rem) {
  .brand img { width: 8.5rem; }
  .utility-nav a:first-child { display: none; }
  .bubble, .offline-bubble { width: 94%; }
}
@supports not (backdrop-filter: blur(1px)) { :root { --glass: rgb(92 0 22 / .87); --glass-strong: rgb(92 0 22 / .94); } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
