:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: #142b3c;
  background: #f5f8fa;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #142b3c;
  --muted: #637685;
  --line: #dce5eb;
  --surface: #ffffff;
  --canvas: #f5f8fa;
  --cyan: #087d91;
  --cyan-dark: #056377;
  --cyan-pale: #e6f5f7;
  --green: #138654;
  --green-pale: #eaf7ef;
  --red: #c24740;
  --red-pale: #fff0ee;
  --amber: #a76312;
  --amber-pale: #fff4df;
  --shadow: 0 10px 26px rgba(22, 47, 62, 0.06);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(8, 125, 145, 0.28); outline-offset: 2px; }
[hidden] { display: none !important; }

.app-shell { min-height: 100vh; }
.topbar {
  height: 70px; display: flex; align-items: center; gap: 28px; padding: 0 34px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); white-space: nowrap; }
.brand-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--cyan); display: flex; justify-content: center; align-items: end; gap: 2px; padding: 6px 5px; }
.brand-mark span { width: 3px; border-radius: 2px 2px 0 0; background: white; }
.brand-mark span:nth-child(1) { height: 7px; opacity: .7; }
.brand-mark span:nth-child(2) { height: 14px; }
.brand-mark span:nth-child(3) { height: 10px; opacity: .85; }
.brand-name { font-size: 17px; font-weight: 600; }
.brand-name b { color: var(--cyan); font-weight: 700; }
.main-nav { display: flex; align-items: stretch; align-self: stretch; gap: 5px; margin-left: 16px; }
.nav-link { position: relative; background: transparent; border: 0; padding: 0 14px; color: #627583; font-size: 14px; cursor: pointer; }
.nav-link:hover { color: var(--cyan-dark); }
.nav-link.active { color: var(--cyan-dark); font-weight: 650; }
.nav-link.active::after { content: ""; position: absolute; left: 14px; right: 14px; height: 2px; bottom: -1px; background: var(--cyan); }
.account-area { margin-left: auto; display: flex; align-items: center; gap: 14px; min-width: 0; }
.connection-indicator { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.connection-indicator i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #c68c33; box-shadow: 0 0 0 3px #fbf2e4; }
.connection-indicator.online i { background: var(--green); box-shadow: 0 0 0 3px var(--green-pale); }
.connection-indicator.offline i { background: var(--red); box-shadow: 0 0 0 3px var(--red-pale); }
.account-button { max-width: 235px; height: 38px; border: 0; background: transparent; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 0 2px; }
.avatar-initial { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: #dff2f4; color: #086b7d; font-weight: 700; font-size: 12px; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #415968; font-size: 13px; }
.chevron { color: #758995; font-size: 15px; }

main { width: min(1380px, calc(100% - 64px)); margin: 0 auto; padding: 34px 0 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 24px; }
.eyebrow { margin: 0 0 7px; font-size: 10px; line-height: 1.4; letter-spacing: 1px; font-weight: 750; color: #68808f; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 28px; line-height: 1.2; color: var(--ink); }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.35; color: var(--ink); }
.page-description { margin: 0; font-size: 14px; color: var(--muted); }
.heading-actions { display: flex; align-items: center; gap: 12px; }
.rate-pill { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #cfe7e5; background: #f1faf8; border-radius: 6px; padding: 9px 11px; color: #2b635c; font-size: 12px; font-weight: 650; white-space: nowrap; }
.rate-dot { width: 7px; height: 7px; border-radius: 50%; background: #44a873; }
.button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border: 1px solid transparent; border-radius: 5px; font-size: 13px; font-weight: 650; white-space: nowrap; cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .14s ease; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { cursor: not-allowed; opacity: .55; }
.button-primary { color: white; background: var(--cyan); border-color: var(--cyan); }
.button-primary:hover:not(:disabled) { background: var(--cyan-dark); border-color: var(--cyan-dark); }
.button-outline { background: #fff; border-color: #cbd8df; color: #3a5667; }
.button-outline:hover:not(:disabled) { color: var(--cyan-dark); border-color: #8dbcc4; background: #f6fcfc; }
.button-quiet { color: var(--cyan-dark); background: #edf7f8; border-color: #d7ecee; }
.button-quiet:hover:not(:disabled) { background: #e0f2f4; }
.button-wide { width: 100%; }
.refresh-icon { font-size: 17px; line-height: 1; }
.notice-bar { border: 1px solid #f1d8a8; background: #fff9e9; border-radius: 5px; margin: -7px 0 22px; padding: 10px 13px; color: #755020; font-size: 13px; }

.auth-gate { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(300px, 400px); gap: 34px; align-items: center; background: #eaf5f6; border: 1px solid #d3e8ea; border-radius: 7px; padding: 27px 30px; margin-bottom: 24px; }
.auth-copy { max-width: 540px; }
.auth-copy h2 { font-size: 22px; margin-bottom: 9px; }
.auth-copy > p:last-child { margin: 0; color: #55707d; font-size: 14px; line-height: 1.6; }
.auth-form { padding: 17px; background: white; border: 1px solid #dae7eb; border-radius: 6px; box-shadow: var(--shadow); }
.auth-tabs { display: flex; border-bottom: 1px solid var(--line); margin: -1px 0 16px; }
.auth-tab { position: relative; border: 0; background: transparent; color: var(--muted); padding: 0 12px 11px; font-size: 13px; cursor: pointer; }
.auth-tab:first-child { padding-left: 0; }
.auth-tab.active { color: var(--cyan-dark); font-weight: 700; }
.auth-tab.active::after { content: ""; position: absolute; left: 0; right: 12px; bottom: -1px; height: 2px; background: var(--cyan); }
.field-label { display: block; margin: 12px 0 6px; color: #4e6573; font-size: 12px; font-weight: 650; }
input { width: 100%; height: 39px; border: 1px solid #cbd8df; border-radius: 4px; padding: 0 11px; color: var(--ink); background: #fff; font-size: 13px; }
input::placeholder { color: #96a5ae; }
.auth-form .button { margin-top: 10px; }
.form-message { min-height: 18px; margin: 8px 0 2px; font-size: 12px; color: var(--muted); line-height: 1.45; }
.form-message.error { color: var(--red); }
.form-message.success { color: var(--green); }

.overview-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: white; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 34px; box-shadow: 0 2px 8px rgba(22, 47, 62, .025); }
.metric { min-height: 98px; position: relative; display: grid; grid-template-columns: auto 1fr; align-content: center; column-gap: 8px; padding: 16px 20px; border-right: 1px solid #e6edf1; }
.metric:last-child { border-right: 0; }
.metric-label { grid-column: 1 / -1; display: block; color: #748692; font-size: 12px; margin-bottom: 7px; }
.metric strong { display: block; align-self: center; font-size: 20px; line-height: 1.2; font-weight: 700; color: var(--ink); }
.metric-sub { display: block; color: #758894; font-size: 11px; align-self: end; padding-bottom: 2px; }
.metric-dot { position: absolute; right: 21px; top: 22px; width: 8px; height: 8px; border-radius: 50%; }
.metric-dot.green { background: #28a36c; box-shadow: 0 0 0 4px var(--green-pale); }
.metric-dot.red { background: #df665c; box-shadow: 0 0 0 4px var(--red-pale); }
.metric-note strong { font-size: 18px; }

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading.compact { margin-bottom: 11px; }
.active-lease-section { margin: 0 0 34px; }
.live-state { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #b9e3ca; border-radius: 4px; padding: 6px 9px; color: #1a7650; font-size: 10px; font-weight: 750; letter-spacing: .35px; }
.live-state i { width: 7px; height: 7px; background: #20a265; border-radius: 50%; }
.active-lease-list { display: grid; gap: 10px; }
.lease-card { display: flex; align-items: center; gap: 16px; border: 1px solid #b9ddce; border-left: 3px solid #238a5d; border-radius: 5px; padding: 15px 17px; background: #f7fcf9; }
.room-glyph { width: 40px; height: 36px; position: relative; flex: none; border: 1.5px solid #90b8bf; border-bottom-width: 2px; border-radius: 3px 3px 1px 1px; background: #f5fbfc; }
.room-glyph::before { content: ""; position: absolute; top: 5px; left: 5px; right: 5px; height: 2px; background: #b2cbd0; box-shadow: 0 6px #d6e5e7; }
.room-glyph::after { content: ""; position: absolute; width: 8px; height: 15px; bottom: 0; right: 6px; border: 1.3px solid #90b8bf; border-bottom: 0; border-radius: 4px 4px 0 0; background: #e3f1f2; }
.lease-primary { flex: 1; min-width: 150px; }
.lease-name { margin: 0 0 4px; font-weight: 700; color: var(--ink); font-size: 14px; }
.lease-meta { margin: 0; color: #657985; font-size: 12px; line-height: 1.5; }
.lease-charge { text-align: right; min-width: 155px; }
.lease-charge strong { display: block; font-size: 14px; color: var(--ink); }
.lease-charge small { color: #7b8c96; font-size: 11px; }
.button-danger { background: white; border-color: #e2b7b3; color: #a43933; }
.button-danger:hover:not(:disabled) { background: #fff4f2; border-color: #d9958f; }
.cleanup-note { display: block; margin-top: 5px; color: var(--amber); font-size: 11px; }

.room-heading { margin-top: 2px; }
.room-legend { display: flex; align-items: center; gap: 16px; color: #71838f; font-size: 11px; }
.room-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.legend-dot.available { background: #249863; }
.legend-dot.unavailable { background: #d6564d; }
.room-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; min-height: 100px; }
.room-card { min-width: 0; min-height: 147px; display: flex; flex-direction: column; border: 1px solid #d1e3da; border-radius: 5px; background: #fff; overflow: hidden; }
.room-card.is-ready { border-color: #b9dcc8; }
.room-card.is-unavailable { border-color: #e6c4c0; background: #fffdfd; }
.room-card-top { display: flex; align-items: center; gap: 10px; padding: 13px 13px 10px; }
.room-card .room-glyph { width: 36px; height: 33px; }
.room-title-wrap { min-width: 0; flex: 1; }
.room-title { margin: 0 0 3px; color: #263f4e; font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-code { color: #80909a; font-size: 10px; font-variant-numeric: tabular-nums; }
.status-badge { display: inline-flex; align-items: center; justify-content: center; flex: none; min-height: 22px; border-radius: 3px; padding: 0 7px; font-size: 9px; line-height: 1.2; font-weight: 750; letter-spacing: .2px; }
.status-badge.ready { color: #14734a; background: #e5f5eb; }
.status-badge.unavailable { color: #a63f39; background: #ffebe9; }
.status-badge.maintenance { color: #8a5918; background: #fff0d6; }
.room-reason { min-height: 33px; flex: 1; padding: 0 13px 8px; color: #697c88; font-size: 11px; line-height: 1.45; }
.room-card.is-unavailable .room-reason { color: #9a5c57; }
.room-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-top: 1px solid #edf1f3; background: #fbfdfd; }
.room-card.is-unavailable .room-card-bottom { background: #fff9f8; border-color: #f4e5e3; }
.room-card-price { font-size: 10px; color: #748590; white-space: nowrap; }
.room-card .button { min-height: 30px; padding: 0 10px; font-size: 11px; }
.room-card .button-primary { background: #168052; border-color: #168052; }
.room-card .button-primary:hover:not(:disabled) { background: #106c45; border-color: #106c45; }
.unavailable-action { color: #a44b46; font-size: 10px; font-weight: 650; white-space: nowrap; }
.empty-state { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 104px; padding: 20px; border: 1px dashed #c9d7de; border-radius: 5px; background: rgba(255,255,255,.65); color: #758792; text-align: center; font-size: 13px; }
.empty-state.small { min-height: 60px; border: 0; background: transparent; padding: 14px; font-size: 12px; }
.loader { width: 16px; height: 16px; border: 2px solid #c9dfe2; border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 20px 0 0; color: #71838d; font-size: 12px; }
.pagination .button { min-height: 34px; }

.wallet-summary { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 6px; background: #fff; margin-bottom: 21px; }
.wallet-total, .wallet-rate { padding: 20px 22px; }
.wallet-total { border-right: 1px solid #e5ecef; }
.wallet-summary .metric-label { margin-bottom: 8px; }
.wallet-summary strong { display: block; font-size: 23px; color: #174b58; margin-bottom: 3px; }
.section-copy { max-width: 600px; color: #71828d; font-size: 12px; line-height: 1.55; margin: 0 0 17px; }
.wallet-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 15px; }
.form-section { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 19px 20px; }
.stack-form { max-width: 500px; }
.stack-form .button { margin-top: 5px; }
.ledger-section { margin-top: 14px; }
.ledger-list { display: grid; }
.ledger-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; align-items: center; gap: 16px; padding: 12px 1px; border-top: 1px solid #edf1f3; font-size: 12px; }
.ledger-row:first-child { border-top: 0; }
.ledger-description { color: #344d5a; font-weight: 600; }
.ledger-meta { display: block; margin-top: 3px; color: #8a9aa3; font-size: 10px; }
.ledger-amount { font-weight: 700; white-space: nowrap; }
.ledger-amount.positive { color: var(--green); }
.ledger-amount.negative { color: var(--red); }
.ledger-status { justify-self: end; color: #758792; font-size: 10px; white-space: nowrap; }
.ledger-status.pending { color: var(--amber); }
.ledger-status.approved { color: var(--green); }
.ledger-status.rejected { color: var(--red); }

.footer { min-height: 55px; display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 0 max(32px, calc((100vw - 1380px) / 2)); border-top: 1px solid var(--line); background: white; color: #8a99a2; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 18px; background: rgba(13, 32, 45, .45); }
.confirm-dialog { width: min(100%, 450px); position: relative; background: #fff; border-radius: 7px; padding: 25px; box-shadow: 0 20px 60px rgba(8, 32, 46, .2); }
.confirm-dialog h2 { margin: 0 20px 9px 0; font-size: 20px; }
.confirm-dialog > p:not(.eyebrow):not(.form-message) { color: #637682; line-height: 1.55; font-size: 13px; margin-bottom: 10px; }
.icon-close { position: absolute; right: 13px; top: 11px; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: #72838e; font-size: 22px; cursor: pointer; }
.icon-close:hover { background: #f1f5f7; color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.toast-region { position: fixed; z-index: 30; right: 20px; bottom: 18px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { border: 1px solid #cbded6; border-left: 3px solid var(--green); border-radius: 5px; padding: 12px 14px; background: white; color: #335647; box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; animation: toast-in .18s ease-out; }
.toast.error { border-color: #e8cbc8; border-left-color: var(--red); color: #8e413c; }
@keyframes toast-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1020px) {
  .topbar { padding: 0 21px; gap: 16px; }
  .main-nav { margin-left: 0; }
  main { width: calc(100% - 42px); }
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 740px) {
  .topbar { height: auto; min-height: 62px; flex-wrap: wrap; gap: 0; padding: 9px 15px 0; }
  .brand { height: 40px; }
  .account-area { height: 40px; }
  .connection-indicator { display: none; }
  .main-nav { order: 3; width: calc(100% + 30px); margin: 0 -15px; height: 42px; overflow-x: auto; border-top: 1px solid #edf1f3; }
  .nav-link { flex: none; padding: 0 15px; font-size: 12px; }
  .nav-link.active::after { left: 15px; right: 15px; }
  .account-email { max-width: 118px; }
  main { width: calc(100% - 30px); padding: 24px 0 42px; }
  .page-heading { display: block; margin-bottom: 19px; }
  h1 { font-size: 24px; }
  .heading-actions { justify-content: space-between; margin-top: 17px; }
  .rate-pill { font-size: 10px; padding: 8px; }
  .button { min-height: 36px; font-size: 12px; }
  .auth-gate { grid-template-columns: 1fr; gap: 15px; padding: 19px; }
  .auth-copy h2 { font-size: 19px; }
  .overview-strip { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 82px; padding: 12px 13px; }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid #e6edf1; }
  .metric strong { font-size: 17px; }
  .metric-note strong { font-size: 15px; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .room-card { min-height: 156px; }
  .room-card-top { gap: 7px; padding: 10px 9px 8px; }
  .room-card .room-glyph { width: 31px; height: 29px; }
  .room-title { font-size: 11px; }
  .status-badge { font-size: 8px; padding: 0 5px; }
  .room-reason { padding: 0 10px 8px; font-size: 10px; }
  .room-card-bottom { padding: 8px 9px; }
  .room-card .button { font-size: 10px; padding: 0 7px; }
  .room-card-price { font-size: 9px; }
  .room-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .room-legend { gap: 12px; }
  .lease-card { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .lease-primary { min-width: calc(100% - 56px); }
  .lease-charge { text-align: left; margin-left: 50px; min-width: 0; }
  .lease-card > .button { margin-left: auto; }
  .wallet-columns { grid-template-columns: 1fr; }
  .wallet-total, .wallet-rate { padding: 16px; }
  .wallet-summary strong { font-size: 19px; }
  .form-section { padding: 15px; }
  .ledger-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px 10px; }
  .ledger-status { grid-column: 1 / -1; justify-self: start; }
  .pagination { gap: 8px; }
  .pagination .button { padding: 0 9px; font-size: 11px; }
  .footer { padding: 0 15px; font-size: 10px; }
}
@media (max-width: 380px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-card { min-height: 138px; }
  .rate-pill { white-space: normal; max-width: 220px; line-height: 1.35; }
  .account-email { max-width: 85px; }
}

/* Shadcn-inspired dashboard shell: restrained surfaces, blue tech accent, and
   a compact workspace rail. The original selectors remain above so this is a
   presentation-only layer; API-bound markup keeps its existing behavior. */
:root {
  --sidebar-width: 248px;
  --canvas: #f8fafc;
  --surface: #ffffff;
  --surface-muted: #f1f5f9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --cyan: #0ea5e9;
  --cyan-dark: #0284c7;
  --cyan-pale: #e0f2fe;
  --green: #16a34a;
  --green-pale: #dcfce7;
  --red: #dc2626;
  --red-pale: #fee2e2;
  --amber: #d97706;
  --amber-pale: #fef3c7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .045);
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #080d17;
  --surface: #0f172a;
  --surface-muted: #111c2f;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: #223047;
  --cyan: #38bdf8;
  --cyan-dark: #7dd3fc;
  --cyan-pale: #082f49;
  --green: #4ade80;
  --green-pale: #052e1a;
  --red: #f87171;
  --red-pale: #450a0a;
  --amber: #fbbf24;
  --amber-pale: #451a03;
  --shadow: 0 1px 2px rgba(0, 0, 0, .24), 0 12px 32px rgba(0, 0, 0, .2);
}

body { background: var(--canvas); color: var(--ink); transition: background .2s ease, color .2s ease; }
.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 10; width: var(--sidebar-width);
  display: flex; flex-direction: column; padding: 20px 13px 14px;
  background: color-mix(in srgb, var(--surface) 94%, var(--cyan-pale));
  border-right: 1px solid var(--line);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; color: var(--ink); text-decoration: none; font-size: 17px; letter-spacing: -.2px; }
.sidebar-brand strong { font-weight: 700; }
.sidebar-brand b { color: var(--cyan-dark); }
.sidebar-brand .brand-mark { width: 29px; height: 29px; border-radius: 8px; background: linear-gradient(145deg, var(--cyan), #2563eb); }
.workspace-switcher { display: flex; align-items: center; gap: 9px; margin: 26px 4px 23px; padding: 9px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-muted); }
.workspace-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: #fff; background: linear-gradient(145deg, var(--cyan), #2563eb); font-size: 10px; font-weight: 800; }
.workspace-switcher span:nth-child(2) { display: grid; flex: 1; min-width: 0; gap: 1px; }
.workspace-switcher small { color: var(--muted); font-size: 10px; }
.workspace-switcher strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.workspace-chevron { color: var(--muted); font-size: 15px; }
.sidebar-label { margin: 0 11px 8px; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: grid; gap: 4px; }
.sidebar .nav-link { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 39px; padding: 0 11px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); text-align: left; font-size: 13px; font-weight: 550; }
.sidebar .nav-link:hover { color: var(--ink); background: var(--surface-muted); }
.sidebar .nav-link.active { color: var(--cyan-dark); background: var(--cyan-pale); border-color: color-mix(in srgb, var(--cyan) 22%, transparent); font-weight: 700; }
.sidebar .nav-link.active::after { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan); }
.nav-icon { display: grid; place-items: center; width: 18px; color: currentColor; font-size: 17px; line-height: 1; }
.sidebar-spacer { flex: 1; min-height: 30px; }
.sidebar-status { display: flex; align-items: center; gap: 8px; margin: 0 10px 12px; color: var(--muted); font-size: 10px; }
.sidebar-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-pale); }
.theme-toggle { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid transparent; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.theme-toggle:hover { color: var(--ink); background: var(--surface-muted); border-color: var(--line); }
.theme-icon { display: grid; place-items: center; width: 18px; font-size: 16px; }
.theme-toggle kbd { margin-left: auto; padding: 2px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 9px; font-family: inherit; }
.sidebar-footer { display: flex; justify-content: space-between; margin: 12px 10px 0; color: var(--muted); font-size: 10px; }
.sidebar-footer span { color: var(--muted); opacity: .7; }
.topbar { height: 64px; margin-left: var(--sidebar-width); padding: 0 32px; background: color-mix(in srgb, var(--surface) 93%, transparent); border-bottom-color: var(--line); backdrop-filter: blur(14px); }
.topbar > .brand { display: none; }
.topbar .main-nav { display: none; }
.sidebar-toggle { display: none; }
.account-area { gap: 12px; }
.compact-theme { display: none; width: 34px; min-height: 34px; justify-content: center; padding: 0; }
.connection-indicator { color: var(--muted); }
.account-email { color: var(--ink); }
.avatar-initial { color: #fff; background: linear-gradient(145deg, var(--cyan), #2563eb); }
/* Keep the content inside the area left by the fixed navigation rail. On
   smaller desktop widths the old calc() included the sidebar twice and made
   the page wider than the viewport. */
main { width: min(1320px, calc(100vw - var(--sidebar-width) - 64px)); margin-left: calc(var(--sidebar-width) + max(0px, (100vw - var(--sidebar-width) - 1320px) / 2)); margin-right: auto; padding: 38px 0 66px; }
.page-heading { align-items: flex-start; margin-bottom: 27px; }
.eyebrow { color: var(--muted); letter-spacing: .12em; }
h1 { color: var(--ink); font-size: 30px; letter-spacing: -.6px; }
h2 { color: var(--ink); letter-spacing: -.2px; }
.page-description { color: var(--muted); }
.heading-actions { align-items: flex-start; }
.rate-pill { border-color: color-mix(in srgb, var(--cyan) 25%, var(--line)); background: var(--cyan-pale); color: var(--cyan-dark); border-radius: 7px; }
.rate-dot { background: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 20%, transparent); }
.button { min-height: 36px; border-radius: 7px; }
.button-primary { background: #0284c7; border-color: #0284c7; }
.button-primary:hover:not(:disabled) { background: #0369a1; border-color: #0369a1; }
.button-outline { color: var(--ink); background: var(--surface); border-color: var(--line); }
.button-outline:hover:not(:disabled) { color: var(--cyan-dark); background: var(--surface-muted); border-color: color-mix(in srgb, var(--cyan) 45%, var(--line)); }
.button-quiet { color: var(--cyan-dark); background: var(--cyan-pale); border-color: transparent; }
.notice-bar { border-radius: 8px; }
.auth-gate, .overview-strip, .wallet-summary, .form-section, .room-card, .confirm-dialog { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); }
.auth-gate { background: linear-gradient(120deg, var(--cyan-pale), var(--surface)); border-radius: 8px; }
.auth-copy > p:last-child, .section-copy { color: var(--muted); }
.auth-form { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow); border-radius: 9px; }
input { color: var(--ink); background: var(--surface); border-color: var(--line); border-radius: 7px; }
input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cyan) 18%, transparent); }
.overview-strip { border-radius: 9px; box-shadow: var(--shadow); }
.metric { border-color: var(--line); }
.metric strong { color: var(--ink); }
.metric-label, .metric-sub { color: var(--muted); }
.section-heading { margin-bottom: 18px; }
.active-lease-section { padding: 20px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--green-pale) 45%, var(--surface)); box-shadow: var(--shadow); }
.room-heading { margin-top: 30px; }
.room-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.room-card { min-height: 164px; border-radius: 8px; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.room-card.is-ready:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--cyan) 56%, var(--line)); box-shadow: 0 10px 26px color-mix(in srgb, var(--cyan) 12%, transparent); }
.room-card.is-ready { border-color: color-mix(in srgb, var(--cyan) 28%, var(--line)); }
.room-card.is-unavailable { border-color: color-mix(in srgb, var(--red) 30%, var(--line)); background: color-mix(in srgb, var(--red-pale) 18%, var(--surface)); }
.room-card-top { padding: 15px 14px 11px; }
.room-title { color: var(--ink); }
.room-code { color: var(--muted); }
.room-reason { color: var(--muted); }
.room-card-bottom { border-top-color: var(--line); background: var(--surface-muted); }
.room-card.is-unavailable .room-card-bottom { background: color-mix(in srgb, var(--red-pale) 30%, var(--surface)); border-color: var(--line); }
.room-card-price { color: var(--muted); }
.empty-state { border-color: var(--line); background: color-mix(in srgb, var(--surface) 70%, transparent); color: var(--muted); }
.wallet-summary, .form-section { border-radius: 8px; }
.wallet-total { border-right-color: var(--line); }
.wallet-summary strong { color: var(--cyan-dark); }
.ledger-row { border-top-color: var(--line); }
.ledger-description { color: var(--ink); }
.ledger-meta { color: var(--muted); }
.footer { margin-left: var(--sidebar-width); padding-left: 32px; padding-right: 32px; background: var(--surface); border-top-color: var(--line); color: var(--muted); }
.confirm-dialog { color: var(--ink); }
.confirm-dialog > p:not(.eyebrow):not(.form-message) { color: var(--muted); }
.toast { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }

:root[data-theme="dark"] .room-glyph { border-color: #3b5870; background: #122238; }
:root[data-theme="dark"] .room-glyph::before { background: #3b5870; box-shadow: 0 6px #263c54; }
:root[data-theme="dark"] .room-glyph::after { border-color: #3b5870; background: #1b3550; }
:root[data-theme="dark"] .live-state { border-color: #1c633d; color: var(--green); }
:root[data-theme="dark"] .lease-card { background: color-mix(in srgb, var(--green-pale) 45%, var(--surface)); border-color: #1c633d; }

/* Legacy component rules above still carry light-only values. Keep those
   controls readable when the Shadcn-inspired dark theme is selected. */
:root[data-theme="dark"] .notice-bar {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber-pale) 72%, var(--surface));
  border-color: color-mix(in srgb, var(--amber) 36%, var(--line));
}
:root[data-theme="dark"] .notice-bar.error-notice {
  color: var(--red);
  background: color-mix(in srgb, var(--red-pale) 70%, var(--surface));
  border-color: color-mix(in srgb, var(--red) 38%, var(--line));
}
:root[data-theme="dark"] .field-label { color: var(--muted); }
:root[data-theme="dark"] .button-danger {
  color: var(--red);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
}
:root[data-theme="dark"] .button-danger:hover:not(:disabled) {
  color: var(--red);
  background: color-mix(in srgb, var(--red-pale) 55%, var(--surface));
  border-color: color-mix(in srgb, var(--red) 68%, var(--line));
}
:root[data-theme="dark"] .status-badge.ready {
  color: var(--green);
  background: color-mix(in srgb, var(--green-pale) 75%, var(--surface));
}
:root[data-theme="dark"] .status-badge.unavailable {
  color: var(--red);
  background: color-mix(in srgb, var(--red-pale) 75%, var(--surface));
}
:root[data-theme="dark"] .status-badge.maintenance {
  color: var(--amber);
  background: color-mix(in srgb, var(--amber-pale) 75%, var(--surface));
}
:root[data-theme="dark"] .room-card.is-unavailable .room-reason,
:root[data-theme="dark"] .unavailable-action { color: color-mix(in srgb, var(--red) 82%, var(--ink)); }
:root[data-theme="dark"] .toast.error {
  color: var(--red);
  background: var(--surface);
  border-color: color-mix(in srgb, var(--red) 40%, var(--line));
  border-left-color: var(--red);
}
:root[data-theme="dark"] .icon-close:hover { background: var(--surface-muted); color: var(--ink); }

@media (max-width: 1180px) {
  .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 861px) and (max-width: 1020px) {
  .page-heading { display: block; }
  .heading-actions { flex-wrap: wrap; margin-top: 16px; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wallet-columns { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --sidebar-width: 0px; }
  .sidebar { width: 270px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: 20px 0 40px rgba(15, 23, 42, .12); }
  .sidebar.is-open { transform: translateX(0); }
  .topbar { margin-left: 0; padding: 0 18px; }
  .sidebar-toggle { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 5px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: var(--surface); cursor: pointer; }
  .topbar > .brand { display: inline-flex; }
  .compact-theme { display: inline-flex; }
  main { width: calc(100% - 36px); margin: 0 auto; padding-top: 30px; }
  .footer { margin-left: 0; padding-left: 18px; padding-right: 18px; }
  .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .topbar { padding: 8px 14px; height: auto; min-height: 60px; }
  .topbar > .brand .brand-name { font-size: 15px; }
  .connection-indicator { display: none; }
  .account-email { max-width: 105px; }
  main { width: calc(100% - 28px); padding: 25px 0 45px; }
  .page-heading { display: block; }
  h1 { font-size: 25px; }
  .heading-actions { justify-content: space-between; margin-top: 17px; }
  .room-grid { grid-template-columns: 1fr; }
  .room-card { min-height: 145px; }
  .active-lease-section { padding: 14px; }
  .footer { min-height: 48px; }
}

/* Marketplace room cards.  These cards deliberately use a public, abstract
   preview when a room has no avatar URL yet.  A worker may provide
   preview_url/thumbnail_url later without changing the client contract. */
.room-grid { align-items: stretch; }
.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 292px;
  overflow: hidden;
  border: 1px solid #263a5d;
  border-radius: 10px;
  background: #0f1b30;
  box-shadow: 0 9px 24px rgba(3, 13, 31, .2);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.room-card.is-ready { border-color: #214b70; }
.room-card.is-unavailable { border-color: #3c2c49; background: #101a2d; }
.room-card.is-ready:hover { transform: translateY(-3px); border-color: #2dabe8; box-shadow: 0 16px 34px rgba(14, 165, 233, .18); }
.room-card.is-unavailable:hover { border-color: #70455a; }
.room-preview {
  position: relative;
  flex: none;
  height: 126px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 72% 24%, rgba(94, 230, 255, .38), transparent 18%),
    radial-gradient(circle at 32% 120%, rgba(111, 78, 255, .5), transparent 49%),
    linear-gradient(135deg, #122b51 0%, #183664 44%, #19234f 100%);
  background-size: cover;
  background-position: center;
}
.room-preview::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 14, 34, .07) 8%, rgba(5, 13, 29, .82) 100%);
}
.room-preview.has-image::before { background: linear-gradient(180deg, rgba(3, 13, 31, .03) 12%, rgba(3, 13, 31, .86) 100%); }
.room-preview-video {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #122b51;
}
.room-preview.preview-video-error .room-preview-video { display: none; }
.room-preview-grid {
  position: absolute;
  z-index: 2;
  inset: 0;
  opacity: .3;
  background-image: linear-gradient(rgba(134, 222, 255, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(134, 222, 255, .16) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: linear-gradient(to bottom, #000, transparent 90%);
}
.room-preview-copy { position: absolute; z-index: 3; left: 14px; bottom: 12px; display: grid; gap: 3px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.room-preview-label { color: #8ee4ff; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
.room-preview-copy strong { font-size: 18px; letter-spacing: -.2px; }
.room-preview-character { max-width: min(76%, 220px); overflow: hidden; color: rgba(255,255,255,.86); font-size: 10px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.room-favorite { position: absolute; z-index: 3; right: 12px; bottom: 10px; color: rgba(255,255,255,.84); font-size: 21px; line-height: 1; }
.room-preview > .status-badge { position: absolute; z-index: 4; top: 11px; left: 11px; min-height: 22px; padding: 0 8px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; font-size: 9px; letter-spacing: .03em; box-shadow: 0 3px 10px rgba(0,0,0,.2); }
.room-preview > .status-badge i { width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 20%, transparent); }
.room-preview > .status-badge.ready { color: #b7ffd6; background: rgba(13, 145, 79, .87); }
.room-preview > .status-badge.unavailable { color: #ffd0d8; background: rgba(170, 38, 79, .87); }
.room-preview > .status-badge.maintenance { color: #ffe6a8; background: rgba(166, 101, 9, .9); }
.room-card-body { display: grid; flex: 1; gap: 10px; min-width: 0; padding: 14px 14px 12px; }
.room-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; min-width: 0; }
.room-card-heading .room-title-wrap { min-width: 0; }
.room-title { margin: 0 0 4px; overflow: hidden; color: #f5f8ff; font-size: 14px; font-weight: 700; letter-spacing: -.1px; text-overflow: ellipsis; white-space: nowrap; }
.room-code { color: #8ea5c4; font-size: 10px; }
.room-tier { flex: none; color: #8fc9ef; font-size: 9px; font-weight: 800; letter-spacing: .05em; }
.room-specs { display: flex; flex-wrap: wrap; gap: 8px 13px; color: #a5b8d0; font-size: 10px; }
.room-specs span { display: inline-flex; align-items: center; gap: 5px; }
.room-specs i { color: #62d5ff; font-size: 11px; font-style: normal; }
.room-reason { align-self: end; min-height: 28px; margin: 0; padding: 0; color: #8398b6; font-size: 10px; line-height: 1.45; }
.room-card.is-unavailable .room-reason { color: #bd91a0; }
.room-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 58px; padding: 10px 12px; border-top: 1px solid #203451; background: #0b1629; }
.room-card-price { display: grid; gap: 1px; color: #8098b9; font-size: 9px; line-height: 1.2; white-space: nowrap; }
.room-card-price strong { color: #f8c95f; font-size: 13px; }
.room-card-price small { color: #8098b9; font-size: 9px; }
.room-card .button { min-height: 33px; padding: 0 12px; border-radius: 6px; font-size: 11px; font-weight: 700; }
.room-card .button-primary { color: #eafff4; background: linear-gradient(135deg, #08a65a, #0c824f); border-color: #12b968; box-shadow: 0 4px 12px rgba(9, 176, 95, .24); }
.room-card .button-primary:hover:not(:disabled) { background: linear-gradient(135deg, #10bb6b, #0b955b); border-color: #22d47c; }
.room-card .button-outline { color: #98a8bd; background: #17243a; border-color: #273c5d; }
.room-card .button-outline:disabled { opacity: .86; }
.room-card .button > span { margin-right: 4px; font-size: 13px; }

/* The reference dashboard is adapted to a bright marketplace canvas; users
   can still switch to the dark workspace from the existing control. */
@media (min-width: 1181px) { .room-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 861px) and (max-width: 1180px) { .room-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .room-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-card { min-height: 276px; }
  .room-preview { height: 142px; }
}

/* Light marketplace presentation (the page stays bright while the preview
   retains the high-energy live-room look from the reference dashboard). */
:root:not([data-theme="dark"]) .room-card {
  border-color: #cfe0ee;
  background: #fff;
  box-shadow: 0 10px 25px rgba(31, 93, 132, .10);
}
:root:not([data-theme="dark"]) .room-card.is-ready,
:root:not([data-theme="dark"]) .room-card-ready {
  border: 2px solid #2fa66a;
  box-shadow: 0 10px 25px rgba(47, 166, 106, .13);
}
:root:not([data-theme="dark"]) .room-card.is-occupied,
:root:not([data-theme="dark"]) .room-card-occupied {
  border: 2px solid #d45757;
  background: #fff9f9;
  box-shadow: 0 10px 25px rgba(212, 87, 87, .11);
}
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-maintenance,
:root:not([data-theme="dark"]) .room-card-maintenance {
  border: 2px solid #d3a03d;
  background: #fffdf6;
}
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-unconfigured,
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-offline,
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-stale,
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-unavailable,
:root:not([data-theme="dark"]) .room-card-unconfigured {
  border: 2px solid #c8d3da;
  background: #fbfcfd;
}
:root:not([data-theme="dark"]) .room-card-occupied .room-reason {
  color: #a44b4b;
}
:root:not([data-theme="dark"]) .room-card-occupied .room-card-bottom {
  background: #fff1f1;
  border-top-color: #f0d2d2;
}
:root:not([data-theme="dark"]) .room-preview > .status-badge.occupied {
  color: #fff0f0;
  background: #c94b4b;
}
:root:not([data-theme="dark"]) .room-preview > .status-badge.unconfigured {
  color: #536572;
  background: #e8eef2;
}
:root:not([data-theme="dark"]) .room-card.is-ready:hover {
  border-color: #37a9df;
  box-shadow: 0 16px 32px rgba(14, 165, 233, .16);
}
:root:not([data-theme="dark"]) .room-card-body { background: #fff; }
:root:not([data-theme="dark"]) .room-title { color: #112b43; }
:root:not([data-theme="dark"]) .room-code { color: #71889b; }
:root:not([data-theme="dark"]) .room-tier { color: #1877aa; }
:root:not([data-theme="dark"]) .room-specs { color: #526d80; }
:root:not([data-theme="dark"]) .room-specs i { color: #168fbe; }
:root:not([data-theme="dark"]) .room-reason { color: #718795; }
:root:not([data-theme="dark"]) .room-card.is-unavailable .room-reason { color: #718795; }
:root:not([data-theme="dark"]) .room-card-bottom {
  border-top-color: #e4edf3;
  background: #f7fbfe;
}
:root:not([data-theme="dark"]) .room-card.is-unavailable .room-card-bottom {
  background: #f7fbfe;
  border-top-color: #e4edf3;
}
:root:not([data-theme="dark"]) .room-card.is-unavailable.room-card-maintenance .room-card-bottom {
  background: #fffaf0;
  border-top-color: #f1e2bd;
}
:root:not([data-theme="dark"]) .room-card.is-occupied .room-card-bottom,
:root:not([data-theme="dark"]) .room-card-occupied .room-card-bottom {
  background: #fff1f1;
  border-top-color: #f0d2d2;
}
:root:not([data-theme="dark"]) .room-card-price { color: #6d8290; }
:root:not([data-theme="dark"]) .room-card-price strong { color: #c17b08; }
:root:not([data-theme="dark"]) .room-card-price small { color: #7f929e; }
:root:not([data-theme="dark"]) .room-card .button-outline {
  color: #6b7d8a;
  background: #f0f4f7;
  border-color: #dce6ec;
}

/* Room preview interaction: show the poster/cover first, then reveal the
   default character demo only while the pointer or keyboard focus is inside
   the room preview. The fixed 16:9 box keeps every card rectangular and stops
   media loading from changing the grid height. */
.room-preview {
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
  background-color: #122b51;
}
.room-preview-video {
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.room-preview.is-previewing .room-preview-video {
  opacity: 1;
}
.room-preview.preview-video-error .room-preview-video {
  opacity: 0;
}
.room-preview[data-preview-video=""] .room-preview-video {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .room-preview-video { transition: none; }
}

.room-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, var(--cyan-pale));
  box-shadow: var(--shadow);
}
.room-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 170px;
}
.room-search > span {
  position: absolute;
  left: 12px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
  transform: rotate(-20deg);
}
.room-search input,
.room-filter select {
  width: 100%;
  min-height: 36px;
  margin: 0;
  border-color: var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: var(--surface);
  font-size: 11px;
}
.room-search input { padding-left: 34px; }
.room-filter { flex: 0 1 164px; min-width: 136px; margin: 0; }
.room-view-toggle {
  display: inline-flex;
  flex: none;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}
.room-view-toggle button {
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.room-view-toggle button:hover,
.room-view-toggle button.is-active {
  color: var(--cyan-dark);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.room-grid.is-list { grid-template-columns: 1fr; }
.room-grid.is-list .room-card {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) auto;
  min-height: 156px;
}
.room-grid.is-list .room-preview { height: 100%; min-height: 156px; }
.room-grid.is-list .room-card-bottom {
  min-width: 170px;
  border-top: 0;
  border-left: 1px solid var(--line);
}
@media (max-width: 880px) {
  .room-toolbar { flex-wrap: wrap; }
  .room-search { flex-basis: 100%; }
  .room-filter { flex: 1 1 150px; }
  .room-view-toggle { margin-left: auto; }
  .room-grid.is-list .room-card { grid-template-columns: 170px minmax(0, 1fr); }
  .room-grid.is-list .room-card-bottom { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .room-filter { flex-basis: calc(50% - 5px); }
  .room-view-toggle { width: 100%; margin-left: 0; }
  .room-view-toggle button { flex: 1; }
  .room-grid.is-list .room-card { display: flex; }
  .room-grid.is-list .room-preview { min-height: 142px; }
  .room-grid.is-list .room-card-bottom { border-left: 0; border-top: 1px solid var(--line); }
}

/* Full-card media surface with glass metadata. The poster is the idle state;
   the muted preview video fades in below these layers only while the card is
   hovered or focused. Keeping the layers inside a fixed-height card prevents
   the marketplace grid from jumping when a video is loaded. */
.room-card {
  display: block;
  height: 320px;
  min-height: 320px;
  overflow: hidden;
  isolation: isolate;
  background: #0a1b32;
}
.room-card.is-ready { border-color: #2fa66a; }
.room-card.is-unavailable { background: #101d32; }
.room-preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
}
.room-preview::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(4, 15, 34, .12) 0%, rgba(4, 15, 34, .03) 38%, rgba(3, 13, 29, .78) 100%);
}
.room-preview::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(3, 14, 32, .08) 0%, transparent 36%, rgba(3, 13, 29, .2) 100%);
}
.room-preview-video { z-index: 0; }
.room-preview-grid { z-index: 3; pointer-events: none; opacity: .22; }
.room-preview-copy {
  z-index: 5;
  top: 55px;
  bottom: auto;
  left: 14px;
  padding: 7px 10px;
  border: 1px solid rgba(190, 229, 255, .22);
  border-radius: 8px;
  background: rgba(4, 21, 42, .48);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 18px rgba(1, 10, 26, .16);
}
.room-preview-copy strong { font-size: 17px; }
.room-preview > .status-badge { z-index: 7; }
.room-card-body {
  position: absolute;
  z-index: 6;
  right: 12px;
  bottom: 67px;
  left: 12px;
  display: grid;
  gap: 8px;
  min-width: 0;
  min-height: 92px;
  padding: 11px 13px 10px;
  border: 1px solid rgba(199, 231, 255, .24);
  border-radius: 9px;
  color: #f7fbff;
  background: rgba(4, 21, 42, .58);
  backdrop-filter: blur(7px) saturate(1.08);
  box-shadow: 0 9px 22px rgba(1, 10, 26, .2);
  pointer-events: none;
}
.room-title { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, .34); }
.room-code { color: rgba(218, 239, 255, .8); }
.room-tier { color: #9fe5ff; }
.room-specs { color: rgba(224, 241, 255, .84); }
.room-specs i { color: #8ce3ff; }
.room-reason { color: rgba(226, 241, 255, .78); }
.room-card.is-unavailable .room-reason { color: rgba(255, 219, 225, .86); }
.room-card-bottom {
  position: absolute;
  z-index: 8;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: 59px;
  padding: 10px 12px;
  border-top: 1px solid rgba(194, 227, 251, .2);
  background: rgba(4, 19, 38, .78);
  backdrop-filter: blur(8px) saturate(1.08);
}
.room-card-price { color: rgba(224, 241, 255, .76); }
.room-card-price strong { color: #ffd978; }
.room-card-price small { color: rgba(212, 233, 249, .72); }
.room-card-bottom .button { pointer-events: auto; }
.room-card.is-ready:hover { border-color: #4ac77e; }
.room-card.is-unavailable:hover { border-color: #d26a77; }

/* Keep the optional list view usable without turning its rows into absolute
   overlays. The default marketplace grid above remains the visual focus. */
.room-grid.is-list .room-card {
  display: grid;
  grid-template-columns: 215px minmax(0, 1fr) auto;
  height: auto;
  min-height: 156px;
}
.room-grid.is-list .room-preview {
  position: relative;
  inset: auto;
  grid-column: 1;
  width: auto;
  height: 100%;
  min-height: 156px;
  aspect-ratio: auto;
}
.room-grid.is-list .room-card-body {
  position: relative;
  inset: auto;
  grid-column: 2;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: rgba(4, 21, 42, .04);
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: auto;
}
.room-grid.is-list .room-card-bottom {
  position: relative;
  inset: auto;
  grid-column: 3;
  min-width: 170px;
  border-top: 0;
  border-left: 1px solid rgba(194, 227, 251, .2);
}
@media (max-width: 880px) {
  .room-grid.is-list .room-card { grid-template-columns: 170px minmax(0, 1fr); }
  .room-grid.is-list .room-card-bottom {
    grid-column: 1 / -1;
    min-width: 0;
    border-top: 1px solid rgba(194, 227, 251, .2);
    border-left: 0;
  }
}
@media (max-width: 560px) {
  .room-card { height: 304px; min-height: 304px; }
  .room-grid.is-list .room-card { display: flex; height: auto; min-height: 0; }
  .room-grid.is-list .room-preview { min-height: 142px; }
  .room-grid.is-list .room-card-body,
  .room-grid.is-list .room-card-bottom { width: 100%; }
  .room-grid.is-list .room-card-bottom { border-left: 0; }
}
