:root {
  --bg0: #0b2a20;
  --bg1: #134e3a;
  --bg2: #1a6b4f;
  --card: #f7f3eb;
  --ink: #14201b;
  --muted: #5a6b63;
  --accent: #c45c26;
  --accent-ink: #fff8f2;
  --line: rgba(20, 32, 27, 0.12);
  --ok: #1f7a4d;
  --shadow: 0 12px 40px rgba(8, 28, 20, 0.28);
  --radius: 18px;
  --font: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(120% 80% at 10% -10%, #2a8f6a 0%, transparent 55%),
    radial-gradient(90% 70% at 100% 0%, #c45c26 0%, transparent 45%),
    linear-gradient(165deg, var(--bg0), var(--bg1) 45%, #0d3326 100%);
}

.ri-app {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
}
.ri-app.is-portal {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.ri-app.is-portal .ri-top {
  margin-bottom: 8px;
}
.ri-app.is-portal .ri-brand {
  /* Home already greets with brand — keep a light top bar for logout */
  opacity: 0.92;
}
.ri-app.is-portal .ri-main {
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
}

.ri-top {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 18px;
  color: #f3efe6;
}
.ri-top:has(.ri-back[hidden]) {
  grid-template-columns: 1fr auto;
}
.ri-top:has(.ri-back[hidden]) .ri-back {
  display: none;
}

.ri-back {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.08);
  color: #fff;
  border-radius: 14px;
  font-size: 22px;
  cursor: pointer;
}
.ri-back[hidden] { visibility: hidden; }

.ri-brand { min-width: 0; }
.ri-brand-zh {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ri-brand-en {
  display: block;
  font-size: 0.78rem;
  opacity: 0.72;
  margin-top: 2px;
}

.ri-logout {
  appearance: none;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.1);
  color: #f3efe6;
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  cursor: pointer;
  font: inherit;
  line-height: 1.15;
  justify-self: end;
  white-space: nowrap;
}
.ri-logout[hidden] { display: none !important; }
.ri-logout span {
  font-size: 0.78rem;
  font-weight: 700;
}
.ri-logout small {
  font-size: 0.62rem;
  opacity: 0.8;
}
.ri-logout:active {
  background: rgba(255,255,255,.18);
}

.ri-progress {
  grid-column: 1 / -1;
  margin-top: 4px;
}
.ri-progress span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.85;
  margin-bottom: 6px;
}
.ri-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}
.ri-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f0d7a8, #e8a36a);
  border-radius: inherit;
  transition: width .25s ease;
}

.ri-main {
  background: var(--card);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
  padding: 22px 18px 24px;
  flex: 1;
  animation: riIn .28s ease;
}

@keyframes riIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.ri-q-zh {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
}
.ri-q-en {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.4;
}

.ri-options {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.ri-opt {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 2px solid var(--line);
  background: #fffdf8;
  border-radius: var(--radius);
  padding: 16px 16px;
  cursor: pointer;
  transition: border-color .15s, transform .12s, background .15s;
  min-height: 64px;
}
.ri-opt:hover { border-color: rgba(196, 92, 38, 0.45); }
.ri-opt:active { transform: scale(0.99); }
.ri-opt.is-selected {
  border-color: var(--accent);
  background: #fff4ea;
  box-shadow: inset 0 0 0 1px rgba(196, 92, 38, 0.25);
}
.ri-opt-zh {
  display: block;
  font-size: 1.08rem;
  font-weight: 650;
}
.ri-opt-en {
  display: block;
  margin-top: 3px;
  font-size: 0.82rem;
  color: var(--muted);
}

.ri-field { margin-top: 18px; }
.ri-label {
  display: block;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.ri-label small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 2px;
}
.ri-input, .ri-textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px;
  font: inherit;
  font-size: 1.05rem;
  background: #fff;
  color: var(--ink);
}
.ri-textarea { min-height: 96px; resize: vertical; }
.ri-textarea-lg { min-height: 180px; line-height: 1.45; }

.ri-auth-head { margin-bottom: 18px; text-align: left; }
.ri-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 8px 0 18px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(20, 32, 27, 0.06);
}
.ri-auth-tab {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 12px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.ri-auth-tab small {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 500;
}
.ri-auth-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.ri-code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: stretch;
}
.ri-code-btn {
  white-space: nowrap;
  min-width: 132px;
  padding-left: 12px;
  padding-right: 12px;
  font-size: 0.86rem !important;
}
.ri-error-box {
  margin-top: 14px;
  padding: 12px;
  border-radius: 12px;
  background: #fff1f0;
  border: 1px solid #f3c1bc;
}
.ri-error-en {
  margin: 4px 0 0;
  color: #9a3412;
  font-size: 0.86rem;
}
.ri-error-box .ri-btn { margin-top: 12px; width: 100%; }
.ri-profile-meta {
  margin: 14px 0 6px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.ri-muted { color: var(--muted); font-size: 0.92rem; }
.ri-input:focus, .ri-textarea:focus {
  outline: none;
  border-color: rgba(196, 92, 38, 0.65);
}

.ri-section {
  margin-top: 28px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ri-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.ri-section-title small {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--muted);
}
.ri-required-note, .ri-optional-note {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.ri-opt-range { margin-top: 12px; }
.ri-range-box {
  margin-top: 14px;
  padding: 14px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: #fffdf8;
}
.ri-range-labels {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  margin-bottom: 12px;
}
.ri-range-sep { color: var(--muted); font-weight: 400; }
.ri-range-row {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  font-size: 0.9rem;
}
.ri-range-row input[type="range"] { width: 100%; }
.ri-helper {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f7fb;
  border: 1px solid #d7e0ea;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #334155;
}
.ri-helper p { margin: 0; }
.ri-helper-en { margin-top: 8px !important; color: #64748b; }

.ri-occupants-field { max-width: 160px; }
.ri-input-number {
  font-size: 1.45rem;
  font-weight: 700;
  text-align: center;
  padding: 14px 12px;
}
.ri-options-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ri-school-section .ri-helper { margin-bottom: 16px; }
.ri-school-group { margin-top: 14px; }
.ri-school-group-toggle {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  padding: 12px 14px;
  cursor: pointer;
  color: inherit;
}
.ri-school-group.is-open .ri-school-group-toggle {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
}
.ri-school-group-chevron {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--muted);
}
.ri-school-group-title-text strong {
  display: block;
  font-size: 1rem;
}
.ri-school-group-title-text small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}
.ri-school-list {
  display: grid;
  gap: 8px;
  padding: 10px 10px 12px;
  border: 2px solid var(--line);
  border-top: 0;
  border-radius: 0 0 14px 14px;
  background: #fff;
}
.ri-school-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.ri-school-row.is-selected {
  border-color: rgba(196, 92, 38, 0.55);
  background: #fff8f2;
}
.ri-school-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}
.ri-school-check input { width: auto; margin-top: 4px; }
.ri-school-check strong { display: block; font-size: 0.98rem; }
.ri-school-check small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.ri-school-priority {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}
.ri-school-priority select {
  width: auto;
  min-width: 64px;
  margin-top: 0;
  padding: 8px 10px;
}
.ri-school-selected-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.ri-school-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e8f5ef;
  color: #14532d;
  font-size: 0.82rem;
  font-weight: 650;
}
.ri-linkish {
  appearance: none;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.9rem;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.ri-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.ri-chip {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.ri-chip.is-selected {
  border-color: var(--accent);
  background: #fff4ea;
  font-weight: 650;
}

.ri-actions {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.ri-actions-col {
  justify-items: stretch;
}
.ri-actions-col .ri-linkish {
  justify-self: center;
  margin-top: 4px;
}
.ri-ok-box {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(31, 122, 77, 0.1);
  border: 1px solid rgba(31, 122, 77, 0.25);
}
.ri-ok {
  margin: 0;
  color: #14532d;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.4;
}
.ri-btn {
  appearance: none;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.ri-btn-primary {
  background: linear-gradient(135deg, #c45c26, #a84618);
  color: var(--accent-ink);
  box-shadow: 0 8px 20px rgba(164, 70, 24, 0.28);
}
.ri-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.ri-btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

.ri-error {
  margin-top: 12px;
  color: #b42318;
  font-size: 0.9rem;
}

.ri-summary {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}
.ri-sum-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.ri-sum-k {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: none;
}
.ri-sum-v {
  margin-top: 4px;
  font-size: 1.02rem;
  font-weight: 650;
}

.ri-save {
  text-align: center;
  color: rgba(243, 239, 230, 0.75);
  font-size: 0.78rem;
  margin: 14px 0 0;
}

.ri-done {
  text-align: center;
  padding: 12px 4px 0;
}
.ri-done h2 {
  margin: 0;
  font-size: 1.4rem;
}
.ri-done p {
  color: var(--muted);
  margin: 8px 0 0;
}

/* —— My Home / portal —— */
.ri-home-hero {
  color: #f3efe6;
  margin: 4px 4px 18px;
}
.ri-home-brand-zh {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ri-home-brand-en {
  margin: 2px 0 0;
  font-size: 0.82rem;
  opacity: 0.72;
}
.ri-home-hello-row {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ri-home-hello-text {
  min-width: 0;
  flex: 1;
}
.ri-home-hello {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.25;
}
.ri-home-hello-en {
  margin: 4px 0 0;
  font-size: 0.92rem;
  opacity: 0.78;
}
.ri-home-logout {
  appearance: none;
  flex-shrink: 0;
  border: none;
  background: #f7f3eb;
  color: #14201b;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 750;
  cursor: pointer;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ri-home-logout:active {
  background: #fff;
  transform: scale(0.98);
}
html.ri-lang-en .ri-home-logout {
  font-size: 0;
}
html.ri-lang-en .ri-home-logout::after {
  content: "Log Out";
  font-size: 0.88rem;
  font-weight: 750;
}

.ri-svc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ri-svc {
  appearance: none;
  border: 1px solid rgba(15, 61, 46, 0.1);
  background: rgba(15, 61, 46, 0.04);
  border-radius: 14px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
  text-align: left;
  transition: background 0.15s ease, transform 0.15s ease;
}
.ri-svc:active {
  transform: scale(0.98);
}
.ri-svc-icon {
  font-size: 1.35rem;
  line-height: 1;
  margin-bottom: 2px;
}
.ri-svc-zh {
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.2;
}
.ri-svc-en {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
}
.ri-svc.is-soon {
  opacity: 0.78;
}

.ri-portal-page-head {
  color: #f3efe6;
  margin: 4px 4px 16px;
}
.ri-portal-page-head h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
}
.ri-portal-page-head p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  opacity: 0.75;
}

.ri-mod {
  background: var(--card);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  margin-bottom: 14px;
}
.ri-mod-head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
}
.ri-mod-head p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.ri-mod-body { margin-top: 12px; }
.ri-mod-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.ri-mod-row:first-child { border-top: 0; padding-top: 0; }
.ri-mod-k span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}
.ri-mod-k small {
  display: block;
  font-size: 0.72rem;
  color: #8a978f;
}
.ri-mod-v {
  font-size: 0.98rem;
  font-weight: 700;
  text-align: right;
  max-width: 58%;
  line-height: 1.35;
}
.ri-mod-copy {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--ink);
}
.ri-mod-copy-en {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.4;
}
.ri-mod-stat {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 750;
}
.ri-mod-btn {
  width: 100%;
  margin-top: 14px;
}
.ri-mod-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ri-mod-danger { padding-top: 12px; padding-bottom: 12px; }

.ri-match-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ri-mod-matches .ri-match-list {
  margin-top: 4px;
}
.ri-match-card {
  background: rgba(15, 61, 46, 0.04);
  border: 1px solid rgba(15, 61, 46, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--ink);
}
.ri-portal-page .ri-match-card {
  background: rgba(247, 244, 236, 0.96);
  border-color: transparent;
}
.ri-match-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ri-match-card-top h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.3;
}
.ri-match-price {
  flex-shrink: 0;
  text-align: right;
  color: #8a4b1f;
}
.ri-match-price .ri-match-zh,
.ri-match-price .ri-match-line {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 750;
  color: inherit;
}
.ri-match-price .ri-match-en {
  margin: 2px 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: inherit;
  opacity: 0.85;
}
.ri-match-meta {
  margin: 8px 0 0;
}
.ri-match-zh {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--ink);
  font-weight: 650;
}
.ri-match-en {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
.ri-match-line {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  color: var(--muted);
}
.ri-match-meta .ri-match-zh + .ri-match-zh,
.ri-match-meta .ri-match-en + .ri-match-zh,
.ri-match-meta .ri-match-line + .ri-match-zh {
  margin-top: 6px;
}
.ri-match-addr {
  margin: 8px 0 0;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--muted);
}
.ri-match-status {
  margin: 8px 0 0;
}
.ri-match-status .ri-match-zh,
.ri-match-status .ri-match-line {
  color: #2f6b4f;
  font-weight: 650;
}
.ri-match-status .ri-match-en {
  color: #2f6b4f;
  opacity: 0.8;
}

/* Property parent → nested unit rooms */
.ri-match-list--props {
  gap: 16px;
}
.ri-prop-card {
  background: rgba(247, 244, 236, 0.98);
  border: 1px solid rgba(15, 61, 46, 0.12);
  border-radius: 18px;
  padding: 14px 14px 12px;
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(15, 61, 46, 0.06);
}
.ri-prop-head {
  margin-bottom: 8px;
}
.ri-prop-titles {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
}
.ri-prop-titles h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 780;
  letter-spacing: -0.01em;
  line-height: 1.25;
  min-width: 0;
}
.ri-prop-dwell {
  margin: 0;
  text-align: right;
  flex: 0 1 auto;
}
.ri-prop-dwell .ri-match-zh,
.ri-prop-dwell .ri-match-line {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--muted);
}
.ri-prop-dwell .ri-match-en {
  margin: 0;
  font-size: 0.76rem;
}
.ri-prop-count {
  margin-top: 6px;
}
.ri-prop-count .ri-match-zh,
.ri-prop-count .ri-match-line {
  font-size: 0.88rem;
  font-weight: 700;
  color: #2f6b4f;
}
.ri-prop-count .ri-match-en {
  font-size: 0.74rem;
  color: #2f6b4f;
  opacity: 0.85;
}
.ri-prop-photos {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 10px 0 4px;
  padding-bottom: 2px;
  scrollbar-width: thin;
}
.ri-prop-photo {
  flex: 0 0 auto;
  width: 112px;
  height: 84px;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(15, 61, 46, 0.08);
}
.ri-prop-facts {
  display: none; /* legacy text facts removed — use .ri-prop-facilities */
}
.ri-prop-facilities {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 12px;
  width: 100%;
  margin: 10px 0 4px;
}
.ri-prop-facilities.has-baths {
  align-items: stretch;
}
.ri-fac-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.ri-fac-baths {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}
.ri-fac-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 61, 46, 0.08);
  border: 1px solid rgba(15, 61, 46, 0.16);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}
.ri-fac-baths .ri-fac-badge {
  justify-content: flex-end;
}
.ri-fac-badge.is-full {
  color: #0e7490;
  border-color: rgba(6, 182, 212, 0.55);
  background: rgba(207, 250, 254, 0.75);
}
.ri-fac-badge.is-half {
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.55);
  background: rgba(254, 243, 199, 0.85);
}
.ri-unit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
}
.ri-unit-card {
  background: #fff;
  border: 1px solid rgba(15, 61, 46, 0.08);
  border-radius: 12px;
  padding: 10px 12px;
}
.ri-unit-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ri-unit-card-top h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 750;
  line-height: 1.3;
}
.ri-unit-card-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}
.ri-unit-fav {
  appearance: none;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(15, 61, 46, 0.14);
  border-radius: 999px;
  background: rgba(15, 61, 46, 0.04);
  color: #7a8b82;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ri-unit-fav:hover {
  border-color: rgba(196, 92, 38, 0.45);
  color: var(--accent);
}
.ri-unit-fav.is-on {
  border-color: rgba(196, 92, 38, 0.55);
  background: rgba(196, 92, 38, 0.12);
  color: #c45c26;
}
.ri-unit-card.is-saved {
  border-color: rgba(196, 92, 38, 0.22);
}
.ri-unit-notes {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--muted);
}
.ri-unit-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ri-unit-detail-btn,
.ri-unit-viewing-btn {
  appearance: none;
  margin: 0;
  border: 1px solid rgba(15, 61, 46, 0.16);
  background: rgba(15, 61, 46, 0.04);
  color: #1f4d3a;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.ri-unit-viewing-btn {
  border-color: rgba(196, 92, 38, 0.4);
  background: rgba(196, 92, 38, 0.12);
  color: #8a4b1f;
}
.ri-viewing-status {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.8rem;
  line-height: 1.3;
}
.ri-viewing-status strong {
  font-size: 0.84rem;
}
.ri-viewing-status.is-pending {
  background: rgba(196, 92, 38, 0.12);
  color: #8a4b1f;
  border: 1px solid rgba(196, 92, 38, 0.28);
}
.ri-viewing-status.is-confirmed {
  background: rgba(15, 61, 46, 0.1);
  color: #1f4d3a;
  border: 1px solid rgba(15, 61, 46, 0.22);
}
.ri-viewing-cancel-btn,
.ri-msg-cancel-btn {
  margin-top: 8px;
  align-self: flex-start;
  border-color: rgba(180, 60, 60, 0.35) !important;
  color: #9b2c2c !important;
  background: rgba(180, 60, 60, 0.08) !important;
  font-size: 0.8rem;
  font-weight: 750;
  padding: 6px 12px;
}
.ri-viewing-cancel-btn:disabled,
.ri-msg-cancel-btn:disabled {
  opacity: 0.55;
}
.ri-unit-card.is-open .ri-unit-detail-btn {
  border-color: rgba(196, 92, 38, 0.45);
  background: rgba(196, 92, 38, 0.1);
  color: #8a4b1f;
}
.ri-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 28, 22, 0.48);
  backdrop-filter: blur(2px);
}
.ri-modal {
  width: min(100%, 440px);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: #f7f3ea;
  border-radius: 20px 20px 16px 16px;
  padding: 16px 16px 20px;
  box-shadow: 0 18px 48px rgba(10, 28, 22, 0.28);
}
.ri-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ri-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f3d2e;
}
.ri-modal-x {
  appearance: none;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #5a6b63;
  cursor: pointer;
  padding: 0 4px;
}
.ri-modal-sub {
  margin: 6px 0 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: #1f4d3a;
}
.ri-modal-hint,
.ri-modal-ok {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--muted, #5a6b63);
}
.ri-modal-ok {
  color: #1f4d3a;
  font-weight: 650;
}
.ri-view-dates,
.ri-view-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.ri-view-date,
.ri-view-time {
  appearance: none;
  border: 1px solid rgba(15, 61, 46, 0.16);
  background: #fff;
  color: #1f4d3a;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.ri-view-date.is-focus {
  border-color: #0f3d2e;
  box-shadow: inset 0 0 0 1px #0f3d2e;
}
.ri-view-date.is-on,
.ri-view-time.is-on {
  border-color: rgba(196, 92, 38, 0.55);
  background: rgba(196, 92, 38, 0.14);
  color: #8a4b1f;
}
.ri-view-time:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.ri-view-picked {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ri-view-picked li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 61, 46, 0.06);
  font-size: 0.82rem;
  color: #1f4d3a;
}
.ri-view-picked button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #8a4b1f;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
}
.ri-modal-submit {
  width: 100%;
  margin-top: 14px;
}
@media (min-width: 640px) {
  .ri-modal-backdrop {
    align-items: center;
  }
  .ri-modal {
    border-radius: 18px;
  }
}
.ri-unit-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(15, 61, 46, 0.12);
}
.ri-unit-detail .ri-prop-photos {
  margin-top: 0;
}
.ri-btn-bi {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.2;
}
.ri-btn-bi span {
  font-weight: 700;
}
.ri-btn-bi small {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.8;
}

.ri-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(7, 28, 22, 0.94);
  border-top: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.ri-tabbar[hidden] { display: none !important; }
.ri-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(243, 239, 230, 0.62);
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font: inherit;
  min-width: 0;
}
.ri-tab.is-active { color: #f0d7a8; }
.ri-tab-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.15rem;
}
.ri-tab-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.ri-tab-badge {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #c45c26;
  color: #fff7ed;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px rgba(7, 28, 22, 0.94);
  pointer-events: none;
}
.ri-tab-badge[hidden] {
  display: none !important;
}
.ri-tab-zh {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.1;
}
.ri-tab-en {
  font-size: 0.62rem;
  opacity: 0.8;
  line-height: 1.1;
}

/* —— Language: default Chinese; Profile can switch to English —— */
.ri-lang-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.ri-lang-btn {
  appearance: none;
  border: 1px solid rgba(15, 61, 46, 0.16);
  background: rgba(15, 61, 46, 0.04);
  border-radius: 12px;
  padding: 12px 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.ri-lang-btn.is-active {
  border-color: rgba(196, 92, 38, 0.55);
  background: rgba(196, 92, 38, 0.12);
  color: #8a4b1f;
}

html.ri-lang-zh .ri-q-en,
html.ri-lang-zh .ri-home-brand-en,
html.ri-lang-zh .ri-home-hello-en,
html.ri-lang-zh .ri-mod-head > p,
html.ri-lang-zh .ri-portal-page-head > p,
html.ri-lang-zh .ri-tab-en,
html.ri-lang-zh .ri-brand-en,
html.ri-lang-zh .ri-logout small,
html.ri-lang-zh .ri-match-en,
html.ri-lang-zh .ri-mod-copy-en,
html.ri-lang-zh .ri-label small,
html.ri-lang-zh .ri-mod-k small,
html.ri-lang-zh .ri-btn-bi small,
html.ri-lang-zh .ri-auth-tab small,
html.ri-lang-zh .ri-svc-en,
html.ri-lang-zh .ri-opt-en,
html.ri-lang-zh .ri-error-en {
  display: none !important;
}

html.ri-lang-en .ri-q-zh,
html.ri-lang-en .ri-home-brand-zh,
html.ri-lang-en .ri-home-hello,
html.ri-lang-en .ri-mod-head > h2,
html.ri-lang-en .ri-portal-page-head > h1,
html.ri-lang-en .ri-tab-zh,
html.ri-lang-en .ri-brand-zh,
html.ri-lang-en .ri-match-zh,
html.ri-lang-en .ri-mod-copy:not(.ri-mod-copy-en),
html.ri-lang-en .ri-mod-k span,
html.ri-lang-en .ri-svc-zh,
html.ri-lang-en .ri-opt-zh {
  display: none !important;
}
html.ri-lang-en .ri-label {
  font-size: 0;
  line-height: 0;
}

/* Promote English lines to primary look when lang=en */
html.ri-lang-en .ri-home-hello-en {
  display: block !important;
  margin: 18px 0 0;
  font-size: 1.55rem;
  font-weight: 750;
  line-height: 1.25;
  opacity: 1;
  color: #f3efe6;
}
html.ri-lang-en .ri-home-brand-en {
  display: block !important;
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  opacity: 1;
  color: #f3efe6;
}
html.ri-lang-en .ri-mod-head > p {
  display: block !important;
  margin: 0;
  font-size: 1.12rem;
  font-weight: 750;
  color: var(--ink);
}
html.ri-lang-en .ri-portal-page-head > p {
  display: block !important;
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  opacity: 1;
  color: #f3efe6;
}
html.ri-lang-en .ri-q-en {
  display: block !important;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 750;
  color: var(--ink);
}
html.ri-lang-en .ri-label small {
  display: block !important;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 6px;
}
html.ri-lang-en .ri-mod-k small {
  display: block !important;
  font-size: 0.78rem;
  color: var(--muted);
}
html.ri-lang-en .ri-tab-en {
  display: block !important;
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 1;
}
html.ri-lang-en .ri-brand-en {
  display: block !important;
  font-size: 1.35rem;
  font-weight: 700;
  opacity: 1;
}
html.ri-lang-en .ri-svc-en {
  display: block !important;
  font-size: 0.92rem;
  font-weight: 750;
  color: var(--ink);
}
html.ri-lang-en .ri-opt-en {
  display: block !important;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
}
html.ri-lang-en .ri-match-en {
  display: block !important;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--ink);
}
html.ri-lang-en .ri-mod-copy-en {
  display: block !important;
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink);
}
html.ri-lang-en .ri-auth-tab small {
  display: inline !important;
  font-size: inherit;
  font-weight: inherit;
  opacity: 1;
}
/* Hide Chinese text nodes in auth tabs (keep small English) */
html.ri-lang-en .ri-auth-tab {
  font-size: 0;
}
html.ri-lang-en .ri-auth-tab small {
  font-size: 0.95rem;
}
.ri-msg-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.ri-msg-card {
  padding: 14px 14px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15, 61, 46, 0.12);
  background: #fff;
}
.ri-msg-card.is-confirmed {
  border-color: rgba(15, 61, 46, 0.28);
  background: linear-gradient(180deg, rgba(15, 61, 46, 0.08), #fff 42%);
}
.ri-msg-card.is-pending {
  border-color: rgba(196, 92, 38, 0.28);
  background: linear-gradient(180deg, rgba(196, 92, 38, 0.1), #fff 42%);
}
.ri-msg-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.ri-msg-card.is-confirmed .ri-msg-badge {
  background: rgba(15, 61, 46, 0.12);
  color: #1f4d3a;
}
.ri-msg-card.is-pending .ri-msg-badge {
  background: rgba(196, 92, 38, 0.14);
  color: #8a4b1f;
}
.ri-msg-title {
  margin: 10px 0 0;
  font-size: 1rem;
  font-weight: 800;
  color: #0f3d2e;
}
.ri-msg-when {
  margin: 6px 0 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1f4d3a;
}
.ri-msg-card.is-pending .ri-msg-when {
  color: #8a4b1f;
  font-size: 0.82rem;
  font-weight: 650;
}
.ri-msg-sub {
  margin: 6px 0 0;
  font-size: 0.8rem;
  color: var(--muted, #5a6b63);
}
.ri-msg-card.is-cancelled {
  border-color: #d7d0c6;
  opacity: 0.92;
}
.ri-msg-card.is-cancelled .ri-msg-badge {
  background: #efeae3;
  color: #6b635a;
}
.ri-msg-address {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f6f3ee;
}
.ri-msg-address-label {
  font-size: 12px;
  font-weight: 700;
  color: #5c534a;
  margin-bottom: 4px;
}
.ri-msg-address-line {
  font-size: 14px;
  line-height: 1.35;
  color: #1f1a16;
}
.ri-msg-maps-btn {
  margin-top: 8px;
  display: inline-flex;
}
.ri-msg-chat {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e7e1d8;
}
.ri-msg-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ri-msg-chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c4552a;
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}
.ri-msg-chat-thread {
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}
.ri-msg-chat-bubble {
  max-width: 88%;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f1ece5;
}
.ri-msg-chat-bubble.is-mine {
  align-self: flex-end;
  background: #e7f0ea;
}
.ri-msg-chat-bubble.is-theirs {
  align-self: flex-start;
}
.ri-msg-chat-meta {
  font-size: 11px;
  color: #7a7167;
  margin-bottom: 3px;
}
.ri-msg-chat-text {
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.ri-msg-chat-compose {
  display: grid;
  gap: 8px;
}
.ri-msg-chat-input {
  width: 100%;
  border: 1px solid #d8d0c5;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
  resize: vertical;
  min-height: 56px;
}
.ri-msg-chat-error {
  margin: 0 0 6px;
}
.ri-msg-cancel-btn {
  width: auto;
}

.ri-push-status {
  margin: 8px 0 0;
  font-size: 0.82rem;
  font-weight: 750;
}
.ri-push-status.is-on { color: var(--ok, #1f7a4d); }
.ri-push-status.is-off { color: #8a4b1f; }
.ri-home-notify-done .ri-mod-body {
  padding-top: 14px;
  padding-bottom: 14px;
}
.ri-home-notify-done .ri-push-status {
  margin: 0;
}
.btnEnablePush[disabled],
.btnEnablePush[aria-busy="true"] {
  opacity: 0.75;
  cursor: wait;
}
#modPushNotify .ri-mod-copy,
.ri-push-entry .ri-mod-copy { margin: 0; }
.ri-push-entry,
.ri-home-notify {
  margin-bottom: 12px;
}
.ri-home > .ri-push-entry,
.ri-home > .ri-home-notify {
  margin-top: 4px;
}
.ri-home-notify-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding: 0 14px 14px;
}
.ri-home-notify-actions .ri-btn {
  width: 100%;
}
.ri-push-entry .ri-home-notify-actions {
  padding: 0;
}

.ri-push-prompt-backdrop {
  z-index: 90;
}
.ri-push-prompt .ri-modal-head {
  margin-bottom: 4px;
}
.ri-push-prompt-lead {
  margin: 10px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #1f4d3a;
  font-weight: 650;
}
.ri-push-prompt-list,
.ri-push-prompt-steps {
  margin: 12px 0 0;
  padding: 0 0 0 1.2em;
  color: #1f4d3a;
  font-size: 0.9rem;
  line-height: 1.55;
}
.ri-push-prompt-list li,
.ri-push-prompt-steps li {
  margin: 4px 0;
}
.ri-push-prompt-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.ri-push-prompt-actions .ri-btn {
  flex: 1;
}
