/* Redoo Home web client. Built on Orchestr Bauhaus (flat colour fields, thick rules, strong type). */
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bh-paper); color: var(--bh-ink); font: var(--bh-type-body); -webkit-font-smoothing: antialiased; }
ul, ol { list-style: none; margin: 0; padding: 0; }
a { color: var(--bh-blue-ink); }
img { max-width: 100%; }
button { font-family: var(--bh-font); }
h1, h2, h3 { margin: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: var(--bh-rule-bar) solid var(--bh-yellow); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--bh-yellow); color: var(--bh-on-yellow); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }

.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon--s { width: 16px; height: 16px; }
.icon--l { width: 28px; height: 28px; }

/* Test-mode strip */
.testbar { background: var(--bh-yellow); color: var(--bh-on-yellow); font: 600 13px/1.4 var(--bh-font); padding: 6px 16px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.testbar code { font: 700 13px/1.4 ui-monospace, Menlo, monospace; }

/* Top bar */
.topbar { background: var(--bh-surface); border-bottom: var(--bh-rule-bar) solid var(--bh-rule); position: sticky; top: 0; z-index: 40; }
.topbar__in { max-width: 1240px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bh-ink); font: 700 20px/1 var(--bh-font); letter-spacing: -.2px; flex: none; }
.brand img { width: 36px; height: 36px; display: block; }
.nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; justify-content: flex-end; scrollbar-width: none; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 44px; color: var(--bh-ink); text-decoration: none; font: 600 14px/1 var(--bh-font); letter-spacing: .6px; text-transform: uppercase; white-space: nowrap; border-bottom: var(--bh-rule-bar) solid transparent; }
.nav a[aria-current="page"] { border-bottom-color: var(--bh-red); }
.nav a:hover { background: var(--bh-surface-sunk); }
.nav .badge { background: var(--bh-red); color: var(--bh-on-red); font: 700 11px/1 var(--bh-font); padding: 3px 5px; }
@media (max-width: 720px) { .nav a span.lbl { display: none; } .brand span { display: none; } .nav a { padding: 0 8px; } }

main { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; }
main:focus { outline: none; }
.footer { border-top: var(--bh-rule-rule) solid var(--bh-rule); padding: 20px 16px 40px; max-width: 1240px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 8px 20px; font: var(--bh-type-caption); color: var(--bh-ink3); }
.footer a { color: var(--bh-ink2); }

.stack { display: grid; gap: 16px; }
.stack--s { gap: 8px; } .stack--l { gap: 32px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; } .row--between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--bh-ink3); }
.err { color: var(--bh-red-ink); font-weight: 600; }
.ok { color: var(--bh-blue-ink); font-weight: 600; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-wrap; }

.btn-sm { min-height: 36px !important; padding: 6px 10px !important; font-size: 13px !important; }
.iconbtn { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; background: var(--bh-surface); color: var(--bh-ink); border: var(--bh-rule-rule) solid var(--bh-rule); cursor: pointer; padding: 0; }
.iconbtn:hover { background: var(--bh-surface-sunk); }
.iconbtn[aria-pressed="true"] { background: var(--bh-blue); color: var(--bh-on-blue); }
.iconbtn:disabled { opacity: .4; cursor: not-allowed; }

label.field { display: grid; gap: 4px; font: var(--bh-type-label); letter-spacing: var(--bh-track-label); text-transform: uppercase; color: var(--bh-ink2); }
label.field .hint { font: var(--bh-type-caption); text-transform: none; letter-spacing: 0; color: var(--bh-ink3); }
textarea.bh-input { padding: 10px 12px; min-height: 96px; resize: vertical; }
select.bh-input { appearance: auto; }
.check { display: flex; gap: 8px; align-items: center; min-height: 36px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--bh-blue); }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px 16px; }
.formgrid .wide { grid-column: 1 / -1; }
fieldset { border: var(--bh-rule-rule) solid var(--bh-rule); padding: 16px; margin: 0; display: grid; gap: 12px; }
legend { font: var(--bh-type-label); letter-spacing: var(--bh-track-label); text-transform: uppercase; padding: 0 6px; }

/* Search */
.searchbar { display: grid; grid-template-columns: 2fr 1fr 1fr 110px auto; gap: 0; border: var(--bh-rule-bar) solid var(--bh-rule); background: var(--bh-surface); }
.searchbar > * { border-right: var(--bh-rule-rule) solid var(--bh-rule); }
.searchbar > :last-child { border-right: 0; }
.searchbar label.field { padding: 8px 12px 6px; }
.searchbar .bh-input { border: 0; padding: 0; min-height: 32px; background: transparent; }
.searchbar .bh-btn { border: 0; height: 100%; }
@media (max-width: 860px) { .searchbar { grid-template-columns: 1fr 1fr; } .searchbar > * { border-bottom: var(--bh-rule-rule) solid var(--bh-rule); } .searchbar > :first-child, .searchbar > :last-child { grid-column: 1 / -1; } }
.ac { position: relative; }
.ac__list { position: absolute; z-index: 1100; left: -14px; right: -14px; top: calc(100% + 8px); background: var(--bh-surface); border: var(--bh-rule-rule) solid var(--bh-rule); max-height: 320px; overflow: auto; }
.ac__list li { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--bh-rule-soft); font: var(--bh-type-body); text-transform: none; letter-spacing: 0; color: var(--bh-ink); display: flex; gap: 8px; align-items: center; }
.ac__list li[aria-selected="true"], .ac__list li:hover { background: var(--bh-blue); color: var(--bh-on-blue); }
.filters { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: end; }
.filters .bh-input { min-height: 40px; }
details.more > summary { cursor: pointer; list-style: none; font: var(--bh-type-label); letter-spacing: var(--bh-track-label); text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; min-height: 40px; }
details.more > summary::-webkit-details-marker { display: none; }

.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.results.nomap { grid-template-columns: 1fr; }
@media (max-width: 960px) { .results { grid-template-columns: 1fr; } .results .mapcol { order: -1; } }
.mapcol { position: sticky; top: 84px; height: calc(100vh - 120px); min-height: 320px; border: var(--bh-rule-rule) solid var(--bh-rule); }
@media (max-width: 960px) { .mapcol { position: static; height: 320px; } }
.map { width: 100%; height: 100%; background: var(--bh-surface-sunk); }
.pricepin { background: var(--bh-surface); color: var(--bh-ink); border: var(--bh-rule-rule) solid var(--bh-rule); font: 700 13px/1 var(--bh-font); padding: 5px 7px; white-space: nowrap; box-shadow: 2px 2px 0 var(--bh-rule); width: auto !important; height: auto !important; }
.pricepin.is-hi { background: var(--bh-red); color: var(--bh-on-red); }
.leaflet-container { font-family: var(--bh-font); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { display: grid; gap: 6px; text-decoration: none; color: var(--bh-ink); background: var(--bh-surface); border: var(--bh-rule-rule) solid var(--bh-rule); }
.card:hover .card__img img { opacity: .9; }
.card__img { aspect-ratio: 4 / 3; background: var(--bh-surface-sunk); position: relative; overflow: hidden; border-bottom: var(--bh-rule-rule) solid var(--bh-rule); }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__tags { position: absolute; left: 8px; top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.card__body { padding: 8px 12px 12px; display: grid; gap: 4px; }
.card__title { font: var(--bh-type-body-bold); }
.card__price { font: 700 16px/1.3 var(--bh-font); }
.tag-blue { background: var(--bh-blue); color: var(--bh-on-blue); }
.tag-ink { background: var(--bh-ink); color: var(--bh-paper); }

/* Listing */
.lgrid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .lgrid { grid-template-columns: 1fr; } }
.bookbox { position: sticky; top: 84px; }
@media (max-width: 960px) { .bookbox { position: static; } }
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 160px; gap: 6px; }
.gallery > button { padding: 0; border: 0; background: var(--bh-surface-sunk); cursor: pointer; position: relative; overflow: hidden; }
.gallery > button:first-child { grid-row: span 2; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .bh-tag { position: absolute; left: 6px; bottom: 6px; }
@media (max-width: 600px) { .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 120px; } .gallery > button:first-child { grid-column: 1 / -1; grid-row: span 2; } }
.amen { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px 16px; }
.amen li { display: flex; gap: 8px; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; }
.kv dt { color: var(--bh-ink3); } .kv dd { margin: 0; }
.breakdown { display: grid; gap: 6px; }
.breakdown > div { display: flex; justify-content: space-between; gap: 8px; }
.breakdown .total { border-top: var(--bh-rule-rule) solid var(--bh-rule); padding-top: 8px; font-weight: 700; }

/* Pano viewer */
.pano { position: relative; background: #000; aspect-ratio: 16 / 9; overflow: hidden; border: var(--bh-rule-rule) solid var(--bh-rule); touch-action: none; user-select: none; -webkit-user-select: none; }
.pano.is-full { aspect-ratio: auto; position: fixed; inset: 0; z-index: 200; border: 0; }
@media (max-width: 600px) { .pano { aspect-ratio: 4 / 3; } }
.pano canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.pano canvas:active { cursor: grabbing; }
.pano.is-pick canvas { cursor: crosshair; }
.pano__bar { position: absolute; right: 8px; top: 8px; display: flex; gap: 6px; }
.pano__bar .iconbtn { background: rgba(17,17,17,.72); color: #fff; border-color: rgba(255,255,255,.7); }
.pano__bar .iconbtn[aria-pressed="true"] { background: var(--bh-blue); }
.pano__room { position: absolute; left: 8px; top: 8px; background: rgba(17,17,17,.72); color: #fff; font: 700 13px/1 var(--bh-font); letter-spacing: 1px; text-transform: uppercase; padding: 8px 10px; }
.pano__msg { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: var(--bh-type-body-bold); text-align: center; padding: 16px; pointer-events: none; }
.pano__hint { position: absolute; left: 8px; bottom: 8px; color: #fff; background: rgba(17,17,17,.6); font: var(--bh-type-caption); padding: 4px 8px; pointer-events: none; }
.hotspot { position: absolute; transform: translate(-50%, -50%); background: var(--bh-yellow); color: var(--bh-on-yellow); border: var(--bh-rule-rule) solid #111; font: 700 13px/1 var(--bh-font); padding: 6px 8px; display: inline-flex; gap: 4px; align-items: center; cursor: pointer; white-space: nowrap; }
.hotspot:hover { background: #fff; }
.rooms { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 4px; }
.rooms button { flex: none; width: 132px; display: grid; gap: 4px; padding: 0; background: var(--bh-surface); border: var(--bh-rule-rule) solid var(--bh-rule); cursor: pointer; text-align: left; color: var(--bh-ink); }
.rooms button[aria-current="true"] { border-color: var(--bh-red); outline: var(--bh-rule-rule) solid var(--bh-red); }
.rooms img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; background: var(--bh-surface-sunk); }
.rooms span { font: 600 13px/1.2 var(--bh-font); padding: 0 6px 6px; }

.spatial { position: relative; background: #000; overflow: hidden; touch-action: none; }
.spatial canvas, .spatial img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Calendar */
.cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.cal__m h4 { margin: 0 0 8px; font: var(--bh-type-body-bold); }
.cal__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__g .dow { font: var(--bh-type-caption); color: var(--bh-ink3); text-align: center; padding: 4px 0; }
.cal__g button { aspect-ratio: 1; min-height: 36px; border: 1px solid var(--bh-rule-soft); background: var(--bh-surface); color: var(--bh-ink); font: 600 14px/1 var(--bh-font); cursor: pointer; display: grid; place-items: center; padding: 0; gap: 0; }
.cal__g button small { font: 400 10px/1 var(--bh-font); color: var(--bh-ink3); }
.cal__g button:disabled { color: var(--bh-ink-disabled); background: var(--bh-surface-sunk); text-decoration: line-through; cursor: not-allowed; }
.cal__g button.is-sel { background: var(--bh-blue); color: var(--bh-on-blue); border-color: var(--bh-blue); }
.cal__g button.is-sel small { color: var(--bh-on-blue); }
.cal__g button.is-range { background: color-mix(in srgb, var(--bh-blue) 22%, var(--bh-surface)); }
.cal__g button.is-blocked { background: var(--bh-surface-sunk); color: var(--bh-ink3); text-decoration: line-through; }
.cal__g button.is-booked { background: var(--bh-red); color: var(--bh-on-red); }
.cal__g button.is-booked small { color: var(--bh-on-red); }
.cal__g button.is-price small { color: var(--bh-blue-ink); font-weight: 700; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font: var(--bh-type-caption); }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 18px; height: 12px; border: 1px solid var(--bh-rule); display: inline-block; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: var(--bh-rule-rule) solid var(--bh-rule); overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--bh-ink); background: none; border: 0; border-bottom: var(--bh-rule-bar) solid transparent; font: 600 14px/1 var(--bh-font); letter-spacing: .6px; text-transform: uppercase; cursor: pointer; white-space: nowrap; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { border-bottom-color: var(--bh-blue); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: var(--bh-type-label); letter-spacing: var(--bh-track-label); text-transform: uppercase; color: var(--bh-ink2); border-bottom: var(--bh-rule-rule) solid var(--bh-rule); padding: 8px 6px; }
.table td { border-bottom: 1px solid var(--bh-rule-soft); padding: 8px 6px; vertical-align: top; }
.tablewrap { overflow-x: auto; }

/* Inbox */
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); border: var(--bh-rule-rule) solid var(--bh-rule); min-height: 520px; background: var(--bh-surface); }
@media (max-width: 760px) { .inbox { grid-template-columns: 1fr; } .inbox.has-thread .threads { display: none; } .inbox:not(.has-thread) .conv { display: none; } }
.threads { border-right: var(--bh-rule-rule) solid var(--bh-rule); overflow: auto; max-height: 72vh; }
.threads a { display: grid; gap: 2px; padding: 12px; border-bottom: 1px solid var(--bh-rule-soft); color: var(--bh-ink); text-decoration: none; }
.threads a[aria-current="page"] { background: var(--bh-surface-sunk); border-left: var(--bh-rule-bar) solid var(--bh-red); }
.conv { display: grid; grid-template-rows: auto 1fr auto; max-height: 72vh; }
.conv__head { padding: 12px; border-bottom: var(--bh-rule-rule) solid var(--bh-rule); }
.msgs { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 78%; padding: 8px 12px; border: var(--bh-rule-rule) solid var(--bh-rule); background: var(--bh-paper); }
.msg.mine { align-self: flex-end; background: var(--bh-blue); color: var(--bh-on-blue); border-color: var(--bh-blue); }
.msg.sys { align-self: center; background: var(--bh-surface-sunk); border-style: dashed; font: var(--bh-type-caption); }
.msg time { display: block; font: 400 11px/1.3 var(--bh-font); opacity: .75; margin-top: 2px; }
.compose { display: flex; gap: 8px; padding: 12px; border-top: var(--bh-rule-rule) solid var(--bh-rule); }

/* Host media */
.drop { border: var(--bh-rule-bar) dashed var(--bh-rule); padding: 24px; display: grid; gap: 8px; justify-items: center; text-align: center; background: var(--bh-surface); }
.drop.is-over { background: color-mix(in srgb, var(--bh-yellow) 35%, var(--bh-surface)); }
.uq { display: grid; gap: 8px; }
.uq > li, .mlist > li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 10px; border: var(--bh-rule-rule) solid var(--bh-rule); background: var(--bh-surface); }
.uq img, .mlist img { width: 96px; height: 72px; object-fit: cover; background: var(--bh-surface-sunk); display: block; }
.mlist { display: grid; gap: 8px; }
.mlist .ctrls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.mlist .ctrls .bh-input { min-height: 36px; width: auto; flex: 1; min-width: 120px; }
@media (max-width: 480px) { .uq > li, .mlist > li { grid-template-columns: 1fr; } .uq img, .mlist img { width: 100%; height: 140px; } }

/* Dialog */
dialog { border: var(--bh-rule-bar) solid var(--bh-rule); padding: 0; max-width: min(640px, calc(100vw - 24px)); width: 100%; background: var(--bh-surface); color: var(--bh-ink); }
dialog.wide { max-width: min(1100px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(17,17,17,.6); }
.dlg__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: var(--bh-rule-rule) solid var(--bh-rule); }
.dlg__body { padding: 16px; display: grid; gap: 12px; max-height: 75vh; overflow: auto; }
.dlg__foot { padding: 12px 16px; border-top: var(--bh-rule-rule) solid var(--bh-rule); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; width: min(480px, calc(100vw - 32px)); }
.toast { background: var(--bh-ink); color: var(--bh-paper); padding: 12px 16px; border-left: var(--bh-rule-heavy) solid var(--bh-yellow); font: var(--bh-type-callout); }
.toast.is-err { border-left-color: var(--bh-red); }

.banner { border: var(--bh-rule-rule) solid var(--bh-rule); border-left: var(--bh-rule-heavy) solid var(--bh-yellow); background: var(--bh-surface); padding: 12px 16px; display: grid; gap: 4px; }
.banner--red { border-left-color: var(--bh-red); }
.banner--blue { border-left-color: var(--bh-blue); }
.loading { padding: 32px 0; color: var(--bh-ink3); }
.avatar { width: 48px; height: 48px; object-fit: cover; background: var(--bh-blue); color: var(--bh-on-blue); display: inline-grid; place-items: center; font: 700 20px/1 var(--bh-font); flex: none; }
.ratingseg { display: flex; border: var(--bh-rule-rule) solid var(--bh-rule); width: max-content; }
.ratingseg button { min-width: 44px; min-height: 40px; border: 0; border-left: var(--bh-rule-rule) solid var(--bh-rule); background: var(--bh-surface); font: 700 15px/1 var(--bh-font); cursor: pointer; color: var(--bh-ink); }
.ratingseg button:first-child { border-left: 0; }
.ratingseg button[aria-pressed="true"] { background: var(--bh-blue); color: var(--bh-on-blue); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.leaflet-bar, .leaflet-bar a, .leaflet-control-attribution { border-radius: 0 !important; }
.leaflet-bar { border: var(--bh-rule-rule) solid var(--bh-rule) !important; }
.bh-tile svg.icon, .bh-tile .icon { fill: none !important; stroke: currentColor; width: 55%; height: 55%; }
h1[tabindex="-1"]:focus, h1[tabindex="-1"]:focus-visible { outline: none; }
.results { align-items: start; }
.stack { align-content: start; }
.cards { align-items: start; }
.pano:not(.is-full) { max-height: 68vh; }
@media (min-width: 761px) { .conv__head > a.iconbtn { display: none; } }
.row > * { min-width: 0; }
.bh-display, .bh-title { overflow-wrap: anywhere; }
@media (max-width: 480px) { .bh-display { font-size: 28px; } main { padding: 16px 16px 48px; } }
.stack { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 960px) { .lgrid { grid-template-columns: minmax(0, 1fr); } }
.bh-input { min-width: 0; } .bh-card { min-width: 0; }
