:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6673;
  --brand: #1f6feb;
  --brand-dark: #1a58bd;
  --border: #e2e6ea;
  --ok: #1a7f4b;
  --warn: #9a6700;
  --err: #b42318;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

.dashboard-overview { min-width: 0; }
.dashboard-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.dashboard-header h1 { margin: 0.3rem 0 0.6rem; overflow-wrap: anywhere; }
.dashboard-header .form-actions { margin: 0; flex-wrap: wrap; }
.dashboard-eyebrow { color: var(--brand-dark); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; }
.dashboard-plan { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.dashboard-plan p { margin: 0.5rem 0; }
.dashboard-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 1rem; }
.dashboard-metric.card { border-top: 3px solid var(--brand); min-width: 0; }
.dashboard-metric h2, .dashboard-metric h3 { font-size: 0.9rem; color: var(--muted); margin: 0; }
.dashboard-metric .stat { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0.65rem 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.dashboard-metric a { font-size: 0.85rem; }
.dashboard-definitions { margin: 1rem 0 1.5rem; }
.dashboard-sections { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.25rem; }
.dashboard-sections-single { grid-template-columns: minmax(0, 1fr); }
.dashboard-overview .panel { min-width: 0; margin-bottom: 1.25rem; }
.dashboard-overview .panel h2 { margin-top: 0; font-size: 1.1rem; }
.dashboard-table-scroll { max-width: 100%; overflow-x: auto; }
.dashboard-table-scroll:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.dashboard-table { min-width: 450px; table-layout: fixed; }
.dashboard-table th:first-child { width: 48%; }
.dashboard-table td { vertical-align: top; overflow-wrap: anywhere; }
.dashboard-list { list-style: none; padding: 0; margin: 0; }
.dashboard-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.dashboard-list li:last-child { border-bottom: 0; }
.dashboard-list li > div, .dashboard-list li > a { min-width: 0; overflow-wrap: anywhere; }
.dashboard-list p { margin: 0.3rem 0 0; font-size: 0.85rem; }
.dashboard-subscription-details { display: flex; flex-wrap: wrap; gap: 0.65rem 1.5rem; margin: 0.75rem 0 0; font-size: 0.85rem; }
.dashboard-subscription-details dt { color: var(--muted); }
.dashboard-subscription-details dd { margin: 0.2rem 0 0; }
.dashboard-organization-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0.75rem; }
.payment-report-filters { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 0.75rem; }
.payment-report-filters label { flex: 1 1 130px; }
.payment-report-source { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1rem; }
.payment-report-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 0.75rem; }
.payment-report-totals h4 { margin: 0 0 0.5rem; }
.payment-report-totals p { margin-bottom: 0; }
.payment-report-table { min-width: 850px; }
.payment-report-table td, .payment-report-table th { vertical-align: top; overflow-wrap: anywhere; }
.dashboard-payment-value { display: grid; gap: 0.5rem; text-align: right; }
.dashboard-empty { padding: 1.5rem; border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); background: var(--bg); }
@media (max-width: 800px) { .dashboard-sections { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .dashboard-header .form-actions { width: 100%; } .dashboard-header .btn { flex: 1 1 100%; text-align: center; } .dashboard-list li { flex-wrap: wrap; } }

.owner-plan-comparison {
  min-width: 0;
}

.owner-plan-comparison h2 { margin-top: 0; }
.owner-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.owner-plan-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--bg), var(--surface) 55%);
  overflow-wrap: anywhere;
}

.owner-plan-card-current { border-color: var(--brand); }
.owner-plan-card h3 { margin: 0.6rem 0 1rem; font-size: 1.2rem; }
.owner-plan-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  background: var(--brand);
  color: var(--surface);
  font-size: 0.8rem;
  font-weight: 600;
}

.owner-plan-prices { display: grid; gap: 0.75rem; margin: 0 0 1.25rem; }
.owner-plan-prices dt { color: var(--muted); font-size: 0.9rem; }
.owner-plan-prices dd {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.owner-plan-limits { margin: 0; }
.owner-plan-limits > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--border);
}
.owner-plan-limits dt { flex: 1 1 60%; }
.owner-plan-limits dd { margin: 0; font-weight: 600; }

.owner-subscription-controls { min-width: 0; overflow-wrap: anywhere; }
.owner-subscription-controls .inline-form > *,
.owner-subscription-controls select { min-width: 0; max-width: 100%; }
.owner-subscription-controls #plan_id { flex: 1 1 100%; width: 100%; }
.owner-subscription-controls .btn { white-space: normal; }

.owner-upgrade-history { min-width: 0; }
.owner-upgrade-history h2 { margin-top: 0; }
.owner-upgrade-list { list-style: none; padding: 0; margin: 0; }
.owner-upgrade-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-wrap: anywhere;
}
.owner-upgrade-card dl { margin: 0; }
.owner-upgrade-card dl > div + div { margin-top: 0.75rem; }
.owner-upgrade-card dt { color: var(--muted); font-size: 0.9rem; }
.owner-upgrade-card dd { margin: 0.2rem 0 0; }
.owner-upgrade-card .badge { margin-left: 0; }

.admin-subscription-tabs, .section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-subscription-tabs a, .section-tabs a {
  min-width: 0;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.admin-subscription-tabs a:hover, .section-tabs a:hover {
  background: var(--bg);
  color: var(--brand-dark);
}

.admin-subscription-tabs a[aria-current='page'], .section-tabs a[aria-current='page'] {
  background: var(--brand);
  color: var(--surface);
}

.admin-subscription-tabs a:focus-visible, .section-tabs a:focus-visible {
  outline: 2px solid var(--brand-dark);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .admin-subscription-tabs a, .section-tabs a {
    flex: 1 1 100%;
  }
}

.admin-subscription-organizations {
  min-width: 0;
}

.admin-plans {
  min-width: 0;
}

.admin-plan-card {
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-plan-card--new {
  margin-top: 1.25rem;
  border-color: #b7cff7;
  border-left: 4px solid var(--brand);
  background: #f5f9ff;
}

.admin-existing-plans {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.admin-plan-card h3,
.admin-existing-plans > h3,
.admin-plan-card-header h4 {
  margin: 0;
  overflow-wrap: anywhere;
}

.admin-plan-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.admin-plan-status {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #eef0f3;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.admin-plan-status--active {
  background: #e4f3ea;
  color: #17613c;
}

.admin-plan-fields {
  min-width: 0;
  margin: 1.25rem 0 0;
  padding: 0;
  border: 0;
}

.admin-plan-fields legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 0.85rem;
  margin-top: 0.6rem;
}

.admin-plan-grid label {
  min-width: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-plan-grid input,
.admin-plan-grid select {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}

.admin-plan-grid input[readonly] {
  background: #eef2f7;
}

.admin-plan-grid .admin-plan-features {
  grid-column: 1 / -1;
}

.admin-plan-form .btn {
  white-space: normal;
}

.admin-subscription-organizations-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.admin-subscription-organizations-scroll:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.admin-subscription-organizations-table {
  min-width: 1020px;
  table-layout: fixed;
}

.admin-subscription-organizations-table th,
.admin-subscription-organizations-table td {
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: normal;
}

.admin-subscription-organizations-table th:nth-child(1) { width: 220px; }
.admin-subscription-organizations-table th:nth-child(2) { width: 180px; }
.admin-subscription-organizations-table th:nth-child(3) { width: 120px; }
.admin-subscription-organizations-table th:nth-child(4),
.admin-subscription-organizations-table th:nth-child(5) { width: 130px; }
.admin-subscription-organizations-table th:nth-child(6) { width: 150px; }
.admin-subscription-organizations-table th:nth-child(7) { width: 100px; }

.admin-subscription-actions-page {
  max-width: 860px;
  margin-inline: auto;
  overflow-wrap: anywhere;
}

.admin-subscription-actions-page .admin-subscription-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 1rem;
}

.admin-subscription-actions-page dd {
  margin: 0;
}

.admin-subscription-actions-page dt {
  font-weight: 600;
}

.admin-subscription-actions-page .admin-subscription-organization-actions,
.admin-subscription-actions-page .admin-subscription-organization-update {
  display: grid;
  gap: 0.75rem;
}

.admin-subscription-actions-page .admin-subscription-organization-update label,
.admin-subscription-actions-page select,
.admin-subscription-actions-page .btn {
  min-width: 0;
  max-width: 100%;
}

.admin-subscription-actions-page .admin-subscription-organization-update select {
  width: 100%;
}

.admin-subscription-actions-page .btn {
  white-space: normal;
  overflow-wrap: anywhere;
}

.contract-inventory-editor {
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.contract-inventory-scroll {
  overflow-x: auto;
}

.contract-inventory-table {
  width: 100%;
  min-width: 720px;
  table-layout: fixed;
}

.contract-inventory-table th:nth-child(1) { width: 48px; }
.contract-inventory-table th:nth-child(2) { width: 26%; }
.contract-inventory-table th:nth-child(3) { width: 100px; }
.contract-inventory-table th:nth-child(5) { width: 150px; }
.contract-inventory-table td { vertical-align: top; }
.contract-inventory-table input,
.contract-inventory-table textarea { width: 100%; min-width: 0; }
.contract-inventory-table td:first-child,
.contract-inventory-table input[type="number"] { text-align: center; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

.container {
  width: min(1100px, 100% - 2rem);
  margin-inline: auto;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--brand);
  text-decoration: none;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--ink);
}

.lang-switch {
  display: inline-flex;
  gap: 0.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
  font-size: 0.85rem;
}

.lang-switch a.active {
  color: var(--brand);
  font-weight: 600;
}

main.container {
  padding: 2rem 0 3rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--brand);
  font-weight: 600;
}

.btn:hover {
  background: var(--brand-dark);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.9rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}

.hero .lead {
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 1.5rem;
}

.hero .btn + .btn {
  margin-left: 0.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.card h2 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.flash {
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--muted);
  background: var(--surface);
}

.flash-success {
  border-color: var(--ok);
}

.flash-warning {
  border-color: var(--warn);
}

.flash-error {
  border-color: var(--err);
}

.error-page {
  text-align: center;
  padding: 3rem 0;
}

.error-code {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--brand);
  margin: 0;
}

.error-stack {
  text-align: left;
  margin-top: 2rem;
  padding: 1rem;
  background: #11161c;
  color: #d5dae0;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.8rem;
}

.agreement-document-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  background: linear-gradient(135deg, #f1f8f5, #fff);
}

.agreement-document-header h2 { margin: 0.2rem 0 0.3rem; font-size: 1.35rem; }
.agreement-document-header p { margin: 0; color: var(--muted); }
.agreement-document-eyebrow { color: var(--brand); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.agreement-document-meta { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; justify-content: flex-end; }
.agreement-editor-section { border: 1px solid #dce7e3; border-radius: 12px; padding: 1.25rem 1.4rem; margin: 0 0 1.25rem; background: #fff; }
.agreement-editor-section legend { padding: 0 0.5rem; color: var(--brand-dark); font-weight: 700; }
.agreement-form-grid { align-items: start; }
.agreement-editor .blue-box { background: #f3f7fb; border-color: #d7e3ed; color: #34495e; }
.agreement-preview-shell { margin-top: 1.5rem; padding: 1rem; border-radius: 14px; background: #edf2f0; }
.agreement-preview-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.25rem 0.4rem 0.9rem; }
.agreement-preview-heading h3 { margin: 0.15rem 0 0; }
.agreement-preview-badge { padding: 0.3rem 0.65rem; border-radius: 999px; background: #fff4d6; color: #765000; font-size: 0.78rem; font-weight: 700; }
.agreement-preview-paper { max-width: 820px; min-height: 640px; margin: 0 auto; padding: 3.2rem 3.5rem; background: #fff; box-shadow: 0 12px 32px rgba(27, 46, 39, 0.14); }
.agreement-preview-paper .contract-content { margin: 0; color: #1e2925; font-family: Georgia, 'Times New Roman', serif; font-size: 0.94rem; line-height: 1.65; }
.agreement-signature-block { max-width: 820px; margin: 1rem auto 0; padding: 1rem 1.25rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.tenant-agreement-section { max-width: 1100px; margin: 0 auto 1.5rem; }
.tenant-agreement-signature { max-width: 820px; margin: 1.25rem auto 0; padding: 1.4rem; border: 1px solid #dce7e3; border-radius: 12px; background: #fff; box-shadow: 0 6px 22px rgba(23, 61, 49, 0.08); }
.tenant-agreement-signature h3 { margin-top: 0; color: var(--brand-dark); }
.signature-pad-field { margin-top: 1rem; }
.signature-pad-field canvas {
  display: block;
  width: 100%;
  max-width: 720px;
  height: 180px;
  margin: 0.35rem 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
.signature-pad-field canvas:focus { outline: 2px solid var(--brand); outline-offset: 2px; }

.contract-content {
  white-space: pre-wrap;
  font: inherit;
  margin: 0 0 1rem;
}

@media (max-width: 640px) {
  .agreement-document-header { display: block; padding: 1.1rem; }
  .agreement-document-meta { justify-content: flex-start; margin-top: 1rem; }
  .agreement-preview-paper { min-height: 0; padding: 1.5rem 1.2rem; }
}

@media print {
  .owner-nav, .breadcrumb, .page-head, .section-tabs, .agreement-document-header,
  .agreement-editor-section, .agreement-preview-heading, .agreement-preview-shell > .hint,
  .agreement-editor > .hint, .agreement-editor > .form-actions { display: none !important; }
  .agreement-preview-shell { padding: 0; background: transparent; }
  .agreement-preview-paper { max-width: none; min-height: 0; padding: 0; box-shadow: none; }
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  padding: 1rem 0;
  margin: 0;
}

.auth-card {
  max-width: 460px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
}

.auth-card h1 {
  margin-top: 0;
  font-size: 1.4rem;
}

.auth-card .muted,
.dashboard .muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth-card label {
  display: block;
  margin-top: 1rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-card input,
.auth-card select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.auth-card input:focus,
.auth-card select:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.auth-password-field {
  position: relative;
}

.auth-password-field input[data-password-field] {
  padding-right: 3.25rem;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.auth-password-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.auth-password-toggle:focus-within {
  outline: 2px solid var(--brand);
}

.auth-password-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-password-toggle .auth-password-toggle-slash { display: none; }
.auth-password-toggle input:checked + svg .auth-password-toggle-slash { display: block; }

.auth-card button[type='submit'] {
  margin-top: 1.5rem;
  width: 100%;
  cursor: pointer;
}

.field-error {
  display: block;
  margin-top: 0.25rem;
  color: var(--err);
  font-size: 0.82rem;
}

.hint {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.auth-links {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.auth-links a {
  color: var(--brand);
  text-decoration: none;
}

.logout-form {
  display: inline;
  margin: 0;
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}

.link-button:hover {
  color: var(--ink);
}

.dashboard h1 {
  margin-bottom: 0.25rem;
}

.plan-banner {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: #e8f0fe;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 600;
}

.plan-usage {
  margin: 0.75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand);
}

.owner-nav {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  padding: 0.75rem;
  margin-bottom: 1.5rem;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  background: #f5f9f7;
  box-shadow: 0 4px 18px rgba(23, 61, 49, 0.05);
}

.owner-nav-group { flex: 1 1 auto; min-width: 0; }
.owner-nav-secondary { padding-left: 1rem; border-left: 1px solid #dce7e3; }
.owner-nav-label { display: block; margin: 0 0.4rem 0.45rem; color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.owner-nav-tabs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.owner-nav-tabs a {
  padding: 0.55rem 0.75rem;
  border: 1px solid transparent;
  border-radius: 9px;
  color: #53635d;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.owner-nav-tabs a:hover { background: #e9f2ee; color: var(--brand-dark); }
.owner-nav-tabs a.active {
  border-color: #c8ded5;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(23, 61, 49, 0.08);
}

@media (max-width: 760px) {
  .owner-nav { display: block; }
  .owner-nav-group { min-width: 0; }
  .owner-nav-secondary { margin-top: 0.7rem; padding: 0.7rem 0 0; border-top: 1px solid #dce7e3; border-left: 0; }
  .owner-nav-tabs { flex-wrap: wrap; padding-bottom: 0.2rem; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.page-head h1,
.page-head h2 {
  margin: 0.25rem 0;
}

.head-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.head-actions form {
  margin: 0;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-bar input,
.filter-bar select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.house-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.house-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.house-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  background: #eef1f4;
  overflow: hidden;
}

.house-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-image {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 0.85rem;
}

.house-body {
  padding: 0.9rem 1rem 1.1rem;
}

.house-body h2 {
  font-size: 1.02rem;
  margin: 0.4rem 0 0.3rem;
}

.house-body h2 a {
  color: var(--ink);
  text-decoration: none;
}

.house-body p {
  margin: 0.15rem 0;
  font-size: 0.85rem;
}

.badge-draft {
  background: #f1f3f5;
  color: var(--muted);
}

.badge-published {
  background: #e6f5ec;
  color: var(--ok);
}

.badge-full {
  background: #fdf3e3;
  color: var(--warn);
}

.badge-archived {
  background: #f8e7e5;
  color: var(--err);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
}

.panel > h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.renewal-notice {
  border-color: #dfb55d;
  border-left: 5px solid #a66300;
  background: #fff9ec;
  color: #38270c;
}

.panel.renewal-notice > h2 {
  color: #38270c;
  font-size: 1.25rem;
  line-height: 1.3;
}

.renewal-period, .renewal-instruction {
  line-height: 1.55;
}

.renewal-deadline {
  display: grid;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid #d5a744;
  border-radius: 8px;
  background: #fff;
  color: #6b3800;
  overflow-wrap: anywhere;
}

.renewal-deadline-label {
  font-size: 0.9rem;
  font-weight: 700;
}

.renewal-deadline-date {
  font-size: clamp(1.2rem, 3vw, 1.4rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.renewal-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  list-style: none;
}

.renewal-list-item {
  min-width: 0;
  padding: 1rem;
  border: 1px solid #ead3a3;
  border-radius: 8px;
  background: #fff;
  overflow-wrap: anywhere;
}

.renewal-property { margin: 0; }
.renewal-list-item .renewal-period { margin: 0.5rem 0; }
.renewal-notice .btn-outline:hover { color: #fff; }
.renewal-actions { flex-wrap: wrap; }

@media (max-width: 480px) {
  .renewal-actions .btn { flex: 1 1 100%; }
}

.vacancy-page { max-width: 100%; }
.vacancy-back { display: inline-block; margin-bottom: 0.5rem; }
.vacancy-header { margin-bottom: 1.5rem; }
.vacancy-header h1 { margin: 0 0 0.4rem; overflow-wrap: anywhere; }
.vacancy-header p { margin: 0; color: var(--muted); line-height: 1.6; }
.panel.vacancy-open { border-top: 4px solid var(--brand); }
.panel.vacancy-open > h2 { font-size: 1.2rem; }
.vacancy-open-form { max-width: 42rem; }
.vacancy-term-hint { color: var(--muted); line-height: 1.6; }
.vacancy-term-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 1rem; }
.vacancy-term-fields > div { min-width: 0; }
.vacancy-houses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.vacancy-houses a { display: block; height: 100%; padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-weight: 700; overflow-wrap: anywhere; }
.vacancy-houses a:hover { border-color: var(--brand); }
.vacancy-houses a:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.vacancy-open-form select,
.vacancy-page input[type='datetime-local'] {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.vacancy-form-deadline {
  margin-top: 1rem;
  padding: 0.1rem 1rem 0.8rem;
  border: 1px solid #d5a744;
  border-radius: 8px;
  background: #fff9ec;
}
.vacancy-form-hint, .vacancy-extension-hint { margin: 0.5rem 0 0; color: #543c15; line-height: 1.5; }
.vacancy-error {
  padding: 0.75rem 1rem;
  border: 1px solid #ba4b41;
  border-radius: 8px;
  background: #fff1ef;
  color: #84251c;
}
.vacancy-periods-title { margin: 2rem 0 1rem; }
.vacancy-period-card { overflow-wrap: anywhere; }
.vacancy-period-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.vacancy-period-header > div { min-width: 0; }
.vacancy-period-header h3 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.vacancy-period-dates { margin: 0; color: var(--muted); }
.vacancy-pending-count { margin: 0.55rem 0 0; font-weight: 700; }
.vacancy-deadline { margin: 0; flex: 0 1 19rem; }
.vacancy-extension { margin-top: 1rem; }
.vacancy-extension summary { cursor: pointer; }
.vacancy-extension form { max-width: 34rem; margin-top: 0.75rem; }
.vacancy-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.75rem; margin: 1.25rem 0; }
.vacancy-metrics > div { min-width: 0; padding: 0.75rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; background: #f7f9fa; }
.vacancy-metrics > .vacancy-metric-held { border-color: #dfb55d; background: #fff9ec; }
.vacancy-metrics > .vacancy-metric-available { border-color: #82b998; background: #eef9f2; }
.vacancy-metrics dt { font-size: 0.85rem; font-weight: 700; }
.vacancy-metrics dd { margin: 0.15rem 0 0; font-size: 1.5rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.vacancy-decisions-title { margin: 1.25rem 0 0.5rem; font-size: 1rem; }
.vacancy-decisions { margin: 0; padding: 0; list-style: none; }
.vacancy-decisions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.8rem 0; border-top: 1px solid var(--border); }
.vacancy-decision-person { display: grid; min-width: 0; }
.vacancy-decision-person span { color: var(--muted); font-size: 0.9rem; }
.vacancy-decision-status { padding: 0.25rem 0.65rem; border: 1px solid var(--border); border-radius: 999px; background: #f1f3f5; font-size: 0.85rem; font-weight: 700; }
.vacancy-decision-status--pending { border-color: #d5a744; background: #fff5dd; color: #6b3800; }
.vacancy-decision-status--renewing { border-color: #82b998; background: #e8f6ed; color: #175c35; }

@media (max-width: 480px) {
  .vacancy-period-header { display: grid; }
  .vacancy-deadline { width: 100%; }
  .vacancy-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.house-form-header {
  max-width: 1100px;
  margin: 1.5rem auto 1.25rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  background: linear-gradient(135deg, #f1f8f5 0%, #fff 68%);
}

.house-form-header h1 { margin: 0; }
.house-form-header p { margin: 0.45rem 0 0; color: var(--muted); }

.house-management-form {
  max-width: 1100px;
  margin: 0 auto 2.5rem;
}

.stacked-form .house-form-section {
  position: relative;
  margin-bottom: 1.5rem;
  padding: 1.4rem 1.6rem 1.6rem;
  border: 1px solid #dce7e3;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 5px 20px rgba(23, 61, 49, 0.05);
}

.stacked-form .house-form-section legend {
  padding: 0.35rem 0.75rem;
  border: 1px solid #cfe1da;
  border-radius: 999px;
  background: #eff7f3;
  color: var(--brand-dark);
  font-size: 0.9rem;
}

.house-management-form .house-form-section > label:first-of-type {
  margin-top: 0.35rem;
}

.house-management-form input:focus,
.house-management-form select:focus,
.house-management-form textarea:focus {
  outline: 0;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(31, 122, 92, 0.12);
}

.house-management-form .radio {
  max-width: 48rem;
  padding: 0.8rem 0.9rem;
  border-color: #dce7e3;
  transition: border-color 120ms ease, background 120ms ease;
}

.house-management-form .radio:hover { border-color: #9ec4b6; background: #f8fcfa; }

.house-management-form .checkbox-row,
.house-management-form .checkbox-grid {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fafcfb;
}

.house-form-actions {
  position: sticky;
  bottom: 0.75rem;
  z-index: 5;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid #dce7e3;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 28px rgba(23, 61, 49, 0.12);
  backdrop-filter: blur(8px);
}

@media (max-width: 640px) {
  .house-form-header { margin-top: 1rem; padding: 1.15rem; }
  .stacked-form .house-form-section { padding: 1.1rem 1rem 1.25rem; }
  .house-form-actions { bottom: 0.35rem; }
  .house-form-actions .btn { flex: 1; text-align: center; }
}

.stacked-form fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.4rem;
  margin: 0 0 1.25rem;
  background: var(--surface);
}

.stacked-form legend {
  padding: 0 0.4rem;
  font-weight: 700;
  font-size: 0.92rem;
}

.stacked-form .house-basic-fields {
  min-width: 0;
}

.house-basic-fields #title {
  max-width: 38rem;
}

.house-basic-fields #category_id,
.house-basic-fields #building_type,
.house-basic-fields #building_type_custom {
  max-width: 24rem;
}

#service_type {
  max-width: 24rem;
}

#homestay-time-fields {
  width: min(100%, 32rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.house-basic-fields #description {
  max-width: 48rem;
}

.room-form #name {
  max-width: 32rem;
}

.room-form #room_type,
.room-form #gender_preference,
.room-form #status {
  max-width: 18rem;
}

.room-form #bed_count,
.room-form #size_sqft {
  max-width: 8rem;
}

.room-form #description {
  max-width: 48rem;
}

.stacked-form.room-form fieldset {
  min-width: 0;
}

.room-form input[type='file'] {
  max-width: 100%;
}

.room-price-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.room-price-scroll .price-table {
  min-width: 27rem;
  max-width: 46rem;
  table-layout: fixed;
}

.room-price-scroll .price-table input {
  max-width: 12rem;
}

.manager-form input[name='full_name'],
.manager-form input[name='email'],
.manager-form input[name='password'],
.manager-form input[name='password_confirmation'] {
  max-width: 32rem;
}

.manager-form input[name='phone'] {
  max-width: 18rem;
}

.house-rental-audience-fields {
  width: min(100%, 44rem);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stacked-form .house-target-audience,
.stacked-form .house-gender-policy {
  max-width: 100%;
}

.stacked-form .agreement-settings-group {
  min-width: 0;
  background: #f8fafc;
}

.stacked-form .agreement-settings-group legend {
  color: var(--brand-dark);
  font-size: 1rem;
}

.agreement-settings-group[data-agreement-group='owner'] #owner_name {
  max-width: 32rem;
}

.agreement-settings-group[data-agreement-group='owner'] #owner_phone,
.agreement-settings-group[data-agreement-group='owner'] #owner_ic {
  max-width: 18rem;
}

.stacked-form label,
.stacked-form .label {
  display: block;
  margin-top: 0.9rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
  font-size: 0.88rem;
}

.stacked-form input[type='text'],
.stacked-form input[type='email'],
.stacked-form input[type='password'],
.stacked-form input[type='number'],
.stacked-form input[type='date'],
.house-semester-form input[type='datetime-local'],
.stacked-form input:not([type]),
.stacked-form select,
.stacked-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.35rem 1rem;
  margin: 0.5rem 0 0.75rem;
}

.checkbox-row {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.checkbox,
.radio {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin-top: 0.35rem;
}

.checkbox input,
.radio input {
  width: auto;
  margin-top: 0.25rem;
}

.radio {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0.4rem;
  background: #fff;
}

.radio span {
  display: block;
}

.mode-fieldset .hint {
  margin-top: 0.1rem;
}

.form-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 1rem;
}

.inline-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1rem;
}

.inline-form input,
.inline-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
}

.upload-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.image-tile {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.image-tile.is-cover {
  border-color: var(--brand);
}

.image-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.image-tile figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
}

.image-tile figcaption form {
  margin: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.table th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.table td form {
  margin: 0;
}

.admin-users-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-users-scroll:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.admin-users-table {
  min-width: 1040px;
  table-layout: fixed;
}

.admin-users-table--owners {
  min-width: 1240px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 0.9rem 1rem;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.admin-users-table th {
  background: var(--bg);
}

.admin-users-table th:nth-child(1) { width: 180px; }
.admin-users-table th:nth-child(2) { width: 240px; }
.admin-users-table th:nth-child(3) { width: 140px; }
.admin-users-table th:nth-child(4) { width: 130px; }
.admin-users-table th:nth-child(5) { width: 150px; }
.admin-users-table th:nth-child(6) { width: 200px; }
.admin-users-table th:nth-child(7) { width: 200px; }

.admin-users-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-users-table tbody tr:hover {
  background: var(--bg);
}

.admin-users-table td:first-child a {
  font-weight: 600;
  text-underline-offset: 0.15em;
}

.admin-users-cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.admin-users-table .pill {
  max-width: 100%;
  margin: 0;
  white-space: normal;
}

.plain-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.92rem;
}

.breadcrumb {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.danger-zone {
  margin-top: 1rem;
  text-align: right;
}

.link-button.danger {
  color: var(--err);
}

.hero-search {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 1rem;
  max-width: 900px;
}

.hero-search input,
.hero-search select {
  flex: 1 1 180px;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.hero-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.hero-links a {
  color: var(--brand);
  text-decoration: none;
}

.section {
  margin-top: 2.5rem;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.listing-thumb {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  background: #eef1f4;
}

.listing-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listing-thumb .pill {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
}

.listing-body {
  padding: 0.8rem 0.9rem 1rem;
}

.listing-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.listing-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.listing-price {
  margin: 0.4rem 0 0.3rem;
  font-size: 1.05rem;
}

.small {
  font-size: 0.82rem;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.pill-ok {
  background: #e6f5ec;
  color: var(--ok);
}

.pill-full {
  background: #f8e7e5;
  color: var(--err);
}

.search-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 820px) {
  .search-layout {
    grid-template-columns: 1fr;
  }
}

.search-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.4rem;
  position: sticky;
  top: 1rem;
}

.search-filters h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.search-filters label,
.search-filters .label {
  display: block;
  margin-top: 0.85rem;
  margin-bottom: 0.25rem;
  font-weight: 600;
  font-size: 0.82rem;
}

.search-filters input,
.search-filters select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.search-filters .checkbox {
  font-size: 0.85rem;
  margin-top: 0.2rem;
}

.search-filters .checkbox input {
  width: auto;
}

.facility-filters {
  max-height: 190px;
  overflow-y: auto;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sort-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.sort-form select {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.pagination a {
  color: var(--brand);
  text-decoration: none;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.detail-head h1 {
  margin: 0 0 0.3rem;
}

.detail-cta {
  text-align: right;
}

.tag-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.6rem 0 0;
}

.gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0.6rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 700px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

.gallery-main {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery-main img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.gallery-thumbs img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
}

.property-gallery {
  grid-template-columns: minmax(0, 1fr);
}

.property-gallery .gallery-main img {
  height: clamp(240px, 45vw, 520px);
  aspect-ratio: auto;
  object-fit: contain;
  background: #edf0f4;
}

.property-gallery .gallery-thumbs {
  display: flex;
  overflow-x: auto;
  gap: 0.6rem;
  padding: 0.3rem;
}

.gallery-thumbnail {
  flex: 0 0 100px;
  padding: 3px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
}

.gallery-thumbnail img { display: block; }
.gallery-thumbnail[aria-pressed='true'] { border-color: var(--brand); }
.gallery-thumbnail:hover { background: #e8f0fe; }
.gallery-thumbnail:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 880px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }
}

.prose {
  white-space: pre-line;
  color: var(--muted);
  margin: 0;
}

.room-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.room-row:last-child {
  border-bottom: none;
}

.room-row h3 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}

.room-availability-info {
  flex: 1 1 240px;
  min-width: 0;
}

.room-availability-photos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.5rem;
  max-width: 400px;
  margin: 0.75rem 0;
}

.room-availability-photos a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.room-availability-photos a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.room-availability-photos img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.room-price {
  text-align: right;
  min-width: 150px;
}

.room-price strong {
  font-size: 1.2rem;
  color: var(--brand);
}

.room-price p {
  margin: 0.25rem 0;
}

.room-eligibility-notice {
  max-width: 32ch;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: #fdf3e3;
  color: var(--ink);
  text-align: left;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.room-eligibility-notice a {
  color: var(--brand-dark);
  font-weight: 600;
}

.booking-soon {
  font-style: italic;
}

.payment-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.payment-review-table td {
  vertical-align: top;
}

.payment-review-table .payment-awaiting-review > td {
  background: #fffbeb;
}

.payment-review-table .payment-awaiting-review > td:first-child {
  box-shadow: inset 4px 0 0 #b77908;
}

.payment-review-table .payment-review-status {
  background: #fef0c7;
  color: #7a4800;
  border: 1px solid #f0cc76;
  font-weight: 700;
}

.payment-review-actions {
  min-width: 200px;
  max-width: 270px;
}

.payment-proof-link {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  min-height: 36px;
  color: var(--brand-dark);
  font-weight: 600;
}

.payment-review-hint {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.payment-review-actions .payment-verify-form {
  margin: 0;
}

.btn.payment-verify-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 1rem;
  background: #167044;
  border: 1px solid #115934;
  color: #fff;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 2px 4px #14532d26;
}

.btn.payment-verify-button:hover {
  background: #105633;
  border-color: #0b4226;
}

.payment-verify-icon { font-size: 1.2rem; }

.payment-review-actions :is(button, a, summary, input):focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.payment-reject-details {
  margin-top: 0.9rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.payment-reject-details summary {
  color: var(--err);
  cursor: pointer;
  padding: 0.4rem 0;
  font-size: 0.88rem;
}

.payment-reject-form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.88rem;
}

.payment-reject-form input {
  width: 100%;
  min-width: 0;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.payment-reject-button {
  min-height: 40px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--err);
  border-radius: 6px;
  color: var(--err);
  background: var(--surface);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.payment-reject-button:hover { background: #fff1f0; }

.property-person {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.property-person-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: #e8f0fe;
  color: var(--brand-dark);
  font-weight: 700;
}

.property-person-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-person h3 { margin: 0; font-size: 0.95rem; }
.property-person p { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--muted); }
.property-rating-score { font-size: 1.6rem; margin: 0; }
.property-rating-score > span { color: var(--warn); }
.property-rating-options { border: 0; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.property-rating-options legend { font-weight: 600; margin-bottom: 0.5rem; }
.property-rating-options label { display: inline-flex; align-items: center; gap: 0.1rem; padding: 0.3rem; cursor: pointer; }
.property-rating-options input { accent-color: var(--brand); }
.property-rating-details { border: 0; padding: 0; margin: 1.25rem 0; }
.property-rating-details legend { font-weight: 600; }
.property-rating-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.property-rating-grid label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.property-rating-grid select { width: 100%; padding: 0.5rem; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface); color: var(--text); }

.property-review-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.property-rating textarea {
  display: block;
  width: 100%;
  min-height: 7rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  font: inherit;
}

.property-rating textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tenant-review { padding: 1rem 0; border-top: 1px solid var(--border); }
.tenant-review-head { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.tenant-review-head h3 { margin: 0; font-size: 1rem; }
.tenant-review-head strong { color: var(--warn); }
.tenant-review-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 0; }

.period-list {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.facility-list {
  margin: 0;
  padding-left: 1.1rem;
  columns: 2;
  font-size: 0.88rem;
}

.profile-shell {
  width: min(960px, 100%);
  margin-inline: auto;
}

.profile-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(115deg, #fff 0%, #f5f9ff 62%, #f4faf7 100%);
  border: 1px solid var(--border);
  border-top: 4px solid var(--brand);
  border-radius: var(--radius);
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  background: #e8f0fe;
  border: 1px solid #cbdcf8;
  color: var(--brand-dark);
  font-size: 1.35rem;
  font-weight: 750;
  letter-spacing: 0;
  overflow: hidden;
}

.profile-avatar img,
.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-identity-copy {
  min-width: 0;
}

.profile-eyebrow,
.profile-section-kicker {
  margin: 0 0 0.2rem;
  color: var(--brand-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.profile-identity h1 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.25;
}

.profile-identity-copy > p:not(.profile-eyebrow) {
  margin: 0.2rem 0 0.55rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 650;
}

.profile-status.is-verified {
  background: #e6f5ec;
  color: var(--ok);
}

.profile-status.is-pending {
  background: #fdf3e3;
  color: var(--warn);
}

.profile-edit {
  align-self: start;
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1.28fr);
  gap: 1.25rem;
  align-items: start;
}

.profile-grid .profile-panel {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.profile-grid .profile-panel:only-child {
  grid-column: 1 / -1;
}

.profile-section-head {
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

.profile-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.details-list {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}

.details-list-wide {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-list > div {
  min-width: 0;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.details-list-wide > div:nth-child(odd) {
  border-right: 1px solid var(--border);
}

.details-list > div:last-child,
.details-list-wide > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.details-list dt {
  margin-bottom: 0.18rem;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: uppercase;
}

.details-list dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 550;
  overflow-wrap: anywhere;
}

.details-list dd.value-ok {
  color: var(--ok);
}

.details-list dd.value-muted {
  color: var(--muted);
  font-weight: 400;
}

.profile-photo-editor {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
}

.profile-photo-editor h2 {
  margin: 0 0 0.2rem;
}

.profile-photo-editor p {
  margin: 0 0 0.75rem;
}

.profile-photo-preview {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  overflow: hidden;
  background: #e8f0fe;
  border: 1px solid #cbdcf8;
  color: var(--brand-dark);
  font-size: 1.5rem;
  font-weight: 750;
}

.profile-photo-editor .upload-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.profile-photo-editor input[type='file'] {
  max-width: 100%;
}

.stacked-form .profile-input-email,
.stacked-form .profile-input-wide {
  max-width: 32rem;
}

.stacked-form .profile-input-number,
.stacked-form .profile-input-medium {
  max-width: 18rem;
}

.stacked-form .profile-input-short {
  max-width: 8rem;
}

@media (max-width: 760px) {
  .profile-identity {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 1.15rem;
  }

  .profile-edit {
    grid-column: 1 / -1;
    width: 100%;
    text-align: center;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .details-list-wide {
    grid-template-columns: 1fr;
  }

  .details-list-wide > div:nth-child(odd) {
    border-right: 0;
  }

  .details-list-wide > div:nth-last-child(2) {
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 460px) {
  .profile-identity {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-avatar {
    margin-inline: auto;
  }

  .profile-identity h1 {
    font-size: 1.35rem;
  }

  .profile-photo-editor {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .profile-photo-preview {
    margin-inline: auto;
  }

  .profile-photo-editor .upload-form {
    justify-content: center;
  }
}
