:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d8dee6;
  --panel: #ffffff;
  --panel-strong: #f8fafc;
  --field: #f7f8fa;
  --green: #0f766e;
  --mint: #0f766e;
  --text: #1f2933;
  --gold: #f59e0b;
  --amber: #f59e0b;
  --red: #dc2626;
  --success: #16a34a;
  --blue: #477569;
  --shadow: 0 18px 48px rgba(31, 41, 51, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #94a3b8;
  --line: #334155;
  --panel: #111827;
  --panel-strong: #1f2937;
  --field: #0f172a;
  --green: #14b8a6;
  --mint: #14b8a6;
  --text: #f8fafc;
  --gold: #f59e0b;
  --amber: #f59e0b;
  --red: #f87171;
  --success: #22c55e;
  --blue: #38bdf8;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), transparent 360px),
    #f7f8fa;
}

.app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--ink);
  background: var(--field);
}

.loading-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.loading-brand img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.loading-brand div {
  display: grid;
  gap: 2px;
}

.loading-brand strong {
  font-size: 1.18rem;
}

.loading-brand span,
.app-loading-screen p {
  color: var(--muted);
  font-size: 0.8rem;
}

.app-loading-screen p {
  margin: 0;
}

.loading-line {
  width: 210px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.14);
}

.loading-line span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  animation: loading-line-slide 1s ease-in-out infinite alternate;
}

@keyframes loading-line-slide {
  from { transform: translateX(0); }
  to { transform: translateX(138%); }
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.09), transparent 360px),
    #0f172a;
}

button,
input,
select {
  font: inherit;
}

.app-nav {
  position: relative;
  z-index: 8;
  width: min(1360px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 16px 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compact-brand img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.brand-home-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.brand-home-button:hover .brand-name,
.brand-home-button:focus-visible .brand-name {
  color: var(--mint);
}

.nav-actions {
  display: flex;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  backdrop-filter: blur(18px);
}

.nav-button,
.secondary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.secondary-button.is-enabled {
  border-color: rgba(22, 163, 74, 0.42);
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.14), rgba(15, 118, 110, 0.12));
  color: var(--success);
}

.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.nav-button {
  min-height: 40px;
  padding: 0 14px;
}

.nav-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #0b625b);
}

.app-view {
  display: none;
}

.app-view.active {
  display: grid;
}

.app-view:not(.active) {
  display: none !important;
}

.app-shell {
  width: min(1360px, calc(100vw - 32px));
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.product-dashboard {
  grid-template-columns: 1fr;
  min-height: calc(100vh - 74px);
  padding: 32px 0;
}

.product-dashboard .product-sidebar,
.product-dashboard .workspace-header,
.product-dashboard .dashboard-stats,
.product-dashboard .dashboard-overview {
  display: none;
}

.product-sidebar {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 20px;
  padding: 20px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: var(--shadow);
}

.sidebar-brand {
  gap: 9px;
}

.sidebar-brand img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.sidebar-brand .brand-name {
  font-size: 0.95rem;
}

.sidebar-brand .brand-line {
  display: none;
}

.sidebar-menu {
  display: grid;
  align-content: start;
  gap: 6px;
}

.sidebar-item {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  text-align: left;
}

.sidebar-item.active {
  background: linear-gradient(135deg, #0f766e, #0b625b);
  color: #ffffff;
}

.sidebar-icon {
  width: 18px;
  color: currentColor;
  font-size: 0.95rem;
  line-height: 1;
}

.sidebar-help {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px;
  border-radius: 7px;
  background: #f8fafc;
  color: #475569;
}

.sidebar-help > span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-weight: 900;
}

.sidebar-help strong,
.sidebar-help p {
  margin: 0;
  font-size: 0.72rem;
}

.dashboard-workspace {
  min-width: 0;
  display: block;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.workspace-header {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: center;
}

.search-field {
  position: relative;
}

.search-field span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-field input {
  min-height: 42px;
  padding-left: 42px;
  background:
    linear-gradient(90deg, transparent 0 32px, transparent 32px),
    #ffffff;
}

.search-field::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #94a3b8;
  border-radius: 999px;
  transform: translateY(-58%);
}

.search-field::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 26px;
  width: 7px;
  height: 2px;
  background: #94a3b8;
  rotate: 45deg;
}

.workspace-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.notification-button {
  position: relative;
  min-width: 42px;
  padding-inline: 10px;
}

.notification-count {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--panel);
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 900;
}

.notification-panel {
  position: fixed;
  top: 74px;
  right: max(12px, calc((100vw - 1180px) / 2));
  z-index: 30;
  width: min(440px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 92px));
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.3rem;
  cursor: pointer;
}

.avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--green);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 900;
}

.workspace-user strong,
.workspace-user small {
  display: block;
  line-height: 1.2;
}

.workspace-user small {
  color: var(--muted);
  font-size: 0.72rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-stats article,
.mini-panel,
.overview-main {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-stats article {
  min-height: 108px;
  display: grid;
  align-content: space-between;
  gap: 8px;
  padding: 15px;
}

.dashboard-stats span,
.preview-value span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.dashboard-stats strong {
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.dashboard-stats small,
.preview-property span,
.preview-value small,
.task-list small {
  color: var(--success);
  font-size: 0.76rem;
  font-weight: 750;
}

.status-alert {
  color: var(--red) !important;
}

.status-warning {
  color: var(--gold) !important;
}

.dashboard-overview {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 12px;
}

.overview-main,
.mini-panel {
  padding: 16px;
}

.overview-side {
  display: grid;
  gap: 12px;
}

.split-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.property-preview-list {
  display: grid;
  gap: 10px;
}

.preview-property {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.property-thumb {
  width: 86px;
  height: 70px;
  border-radius: 7px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.1), rgba(245, 158, 11, 0.16)),
    #d8dee6;
  overflow: hidden;
}

.row-houses {
  background:
    linear-gradient(135deg, transparent 0 34%, rgba(15, 118, 110, 0.72) 35% 45%, transparent 46%),
    repeating-linear-gradient(90deg, #b76e3a 0 16px, #d9a066 16px 32px);
}

.flats {
  background:
    repeating-linear-gradient(90deg, rgba(31, 41, 51, 0.16) 0 10px, transparent 10px 20px),
    linear-gradient(145deg, #9fb7c6, #e7eef2);
}

.townhouses {
  background:
    repeating-linear-gradient(90deg, #eef2f7 0 18px, #d8dee6 18px 36px),
    linear-gradient(145deg, #ffffff, #ccd6df);
}

.preview-property h3,
.preview-property p {
  margin: 0;
}

.preview-property h3 {
  font-size: 0.95rem;
}

.preview-property p {
  color: #475569;
  font-size: 0.8rem;
}

.preview-value {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-width: 96px;
}

.task-list {
  gap: 0;
}

.task-list li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-left: 0;
  border-bottom: 1px solid var(--line);
}

.task-list li:last-child {
  border-bottom: 0;
}

.task-list li > span {
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border: 1px solid #94a3b8;
  border-radius: 3px;
}

.task-list strong,
.task-list small,
.task-list time {
  display: block;
}

.task-list strong {
  font-size: 0.82rem;
}

.task-list time {
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 850;
}

.compact-documents div {
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.compact-documents div:last-child {
  border-bottom: 0;
}

.deal-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
  gap: 12px;
}

.site-intro {
  display: grid;
  gap: 10px;
  max-width: 860px;
  margin: 0 0 18px;
}

.site-intro h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4.2rem);
  line-height: 0.98;
}

.site-intro p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.55;
}

.calculator-panel,
.results-panel,
.calculator-partners,
.premium-hero,
.login-panel,
.dashboard-shell,
.panel-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.calculator-panel {
  padding: 24px;
}

.results-panel {
  padding: 20px;
}

.calculator-partners {
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  padding: 20px 24px 22px;
}

.calculator-partners[hidden] {
  display: none;
}

.sponsor-slot {
  display: grid;
  justify-items: center;
}

.sponsor-slot[hidden],
.partners-heading[hidden] {
  display: none;
}

.partners-heading {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.marketing-card {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.marketing-card.sponsor-card {
  max-width: 760px;
  grid-template-columns: 1fr;
  padding: 14px;
}

.marketing-card-media {
  display: grid;
  place-items: center;
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.marketing-card-media img {
  display: block;
  max-width: 100%;
  max-height: 126px;
  object-fit: contain;
}

.sponsor-card .marketing-card-media {
  height: 90px;
  min-height: 0;
}

.sponsor-card .marketing-card-media img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}

.marketing-card-body {
  display: grid;
  gap: 8px;
}

.marketing-card-body h3 {
  margin: 0;
  font-size: 1.05rem;
}

.marketing-card-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.marketing-badge {
  width: fit-content;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.08);
  color: var(--teal);
  padding: 3px 8px;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.marketing-card-action {
  justify-self: start;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 300px));
  justify-content: center;
  gap: 14px;
}

.premium-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
  gap: 18px;
}

.admin-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
  gap: 18px;
}

.premium-hero {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 18px;
  align-items: stretch;
}

.hero-copy {
  max-width: 680px;
  color: #49616b;
  font-size: 1rem;
  line-height: 1.5;
}

.contact-panel {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 24px;
  display: grid;
  gap: 18px;
}

.contact-email-link {
  width: fit-content;
  text-decoration: none;
}

.price-card {
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(216, 184, 106, 0.28);
  border-radius: 8px;
  background: rgba(216, 184, 106, 0.08);
}

.price-card span,
.price-card p {
  color: var(--muted);
  font-weight: 750;
}

.price-card strong {
  font-size: 3rem;
  line-height: 1;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plan-card,
.comparison-panel,
.purchase-panel {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.featured-plan {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 18px 52px rgba(15, 118, 110, 0.12);
}

.plan-badge {
  width: fit-content;
  padding: 6px 9px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.12);
  color: #9a5b00;
  font-size: 0.75rem;
  font-weight: 900;
}

.plan-price {
  display: block;
  margin: 10px 0;
  color: var(--ink);
  font-size: 3rem;
  line-height: 1;
}

.plan-price::after {
  content: "/mo";
  margin-left: 4px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 750;
}

.plan-features {
  gap: 8px;
}

.plan-features li {
  border-left: 0;
  padding-left: 24px;
  color: #405861;
  position: relative;
}

.plan-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.38rem;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, transparent 48%, #ffffff 49% 58%, transparent 59%),
    var(--green);
}

.plan-cta {
  align-self: end;
}

.comparison-panel,
.purchase-panel {
  margin-top: 14px;
}

.comparison-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.comparison-table div {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(2, minmax(150px, 0.9fr));
  border-bottom: 1px solid var(--line);
}

.comparison-table div:first-child {
  background: #f8fafc;
}

.comparison-table div:last-child {
  border-bottom: 0;
}

.comparison-table span,
.comparison-table strong {
  padding: 12px;
  border-right: 1px solid var(--line);
  font-size: 0.88rem;
}

.comparison-table strong:last-child {
  border-right: 0;
}

.comparison-table span {
  color: var(--muted);
  font-weight: 850;
}

.purchase-panel {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.06), rgba(245, 158, 11, 0.08)),
    var(--panel);
}

:root[data-theme="dark"] .nav-actions,
:root[data-theme="dark"] .nav-button,
:root[data-theme="dark"] .secondary-button,
:root[data-theme="dark"] .email-login,
:root[data-theme="dark"] .promo-form,
:root[data-theme="dark"] .account-profile-form,
:root[data-theme="dark"] .account-password-form,
:root[data-theme="dark"] .account-notification-panel,
:root[data-theme="dark"] .account-privacy-panel,
:root[data-theme="dark"] .account-import-panel,
:root[data-theme="dark"] .dashboard-workspace,
:root[data-theme="dark"] .dashboard-stats article,
:root[data-theme="dark"] .overview-main,
:root[data-theme="dark"] .mini-panel,
:root[data-theme="dark"] .preview-property,
:root[data-theme="dark"] .portfolio-metrics article,
:root[data-theme="dark"] .property-card,
:root[data-theme="dark"] .admin-metrics article,
:root[data-theme="dark"] .subscription-grid div,
:root[data-theme="dark"] .quarter-summary div,
:root[data-theme="dark"] .transaction-row,
:root[data-theme="dark"] .tenant-chip,
:root[data-theme="dark"] .landlord-report-intro div,
:root[data-theme="dark"] .landlord-report-metrics div,
:root[data-theme="dark"] .admin-row,
:root[data-theme="dark"] .document-list div,
:root[data-theme="dark"] .detail-row,
:root[data-theme="dark"] .metrics-grid article,
:root[data-theme="dark"] .insights,
:root[data-theme="dark"] .tax-modal,
:root[data-theme="dark"] .tax-summary article,
:root[data-theme="dark"] .tax-breakdown,
:root[data-theme="dark"] .tax-note,
:root[data-theme="dark"] .close-button,
:root[data-theme="dark"] .comparison-table div:first-child {
  background: var(--panel);
}

:root[data-theme="dark"] .dashboard-shell > .portfolio-tabs {
  background:
    linear-gradient(180deg, rgba(20, 184, 166, 0.08), rgba(17, 24, 39, 0)),
    var(--panel);
}

:root[data-theme="dark"] .dashboard-shell > .portfolio-tabs .section-tab.active {
  border-color: rgba(20, 184, 166, 0.38);
  background: rgba(20, 184, 166, 0.14);
  color: #5eead4;
}

:root[data-theme="dark"] .field-hint,
:root[data-theme="dark"] .hero-copy,
:root[data-theme="dark"] .preview-property p,
:root[data-theme="dark"] .plan-features li,
:root[data-theme="dark"] .tax-note,
:root[data-theme="dark"] li,
:root[data-theme="dark"] .legal-page,
:root[data-theme="dark"] .legal-page p,
:root[data-theme="dark"] .legal-page li,
:root[data-theme="dark"] .help-grid p,
:root[data-theme="dark"] .help-grid ol,
:root[data-theme="dark"] .help-grid li {
  color: var(--muted);
}

:root[data-theme="dark"] .help-grid details {
  background: var(--panel-strong);
}

:root[data-theme="dark"] .help-grid summary,
:root[data-theme="dark"] .legal-page h1,
:root[data-theme="dark"] .legal-page h2 {
  color: var(--ink);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .section-tabs,
:root[data-theme="dark"] .section-tab,
:root[data-theme="dark"] .auth-tab,
:root[data-theme="dark"] .sidebar-help {
  background: var(--field);
}

:root[data-theme="dark"] .purchase-panel,
:root[data-theme="dark"] .score-block {
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(245, 158, 11, 0.08)),
    var(--panel);
}

.login-panel {
  padding: 20px;
  display: grid;
  gap: 14px;
}

.email-login,
.promo-form,
.account-profile-form,
.account-password-form,
.account-notification-panel,
.account-privacy-panel,
.account-import-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.account-privacy-panel,
.account-notification-panel,
.account-import-panel {
  margin-top: 12px;
}

.compact-heading {
  margin-top: 12px;
}

.account-privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.account-import-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid.two-column {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-import-form .secondary-button,
.account-import-form .field-hint {
  grid-column: 1 / -1;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-tab {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.auth-tab.active {
  border-color: rgba(15, 118, 110, 0.55);
  background: rgba(15, 118, 110, 0.1);
  color: var(--mint);
}

.dashboard-shell {
  padding: 20px;
  display: grid;
  grid-template-columns: 212px minmax(0, 1fr);
  gap: 16px;
}

.dashboard-shell[hidden] {
  display: none;
}

.dashboard-head,
.dashboard-actions {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-welcome {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: 8px;
  color: #ffffff;
  background: #0f766e;
  box-shadow: 0 14px 30px rgba(15, 118, 110, 0.16);
}

.dashboard-welcome::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -28px;
  width: 150px;
  height: 72px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-right: 0;
  border-bottom: 0;
  transform: skewX(-18deg);
}

.dashboard-welcome .eyebrow,
.dashboard-welcome h2 {
  position: relative;
  z-index: 1;
  color: #ffffff;
}

.dashboard-welcome .eyebrow {
  opacity: 0.76;
}

.dashboard-welcome .tax-button {
  position: relative;
  z-index: 1;
  border-color: rgba(255, 255, 255, 0.35);
  background: #ffffff;
  color: #0f766e;
  box-shadow: none;
}

.dashboard-shell > .dashboard-head,
.dashboard-shell > .portfolio-metrics,
.dashboard-shell > .dashboard-grid,
.property-detail-shell > .property-detail-panel {
  grid-column: 2;
}

.dashboard-actions {
  flex-wrap: wrap;
}

.section-tabs {
  position: sticky;
  top: 74px;
  z-index: 6;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.dashboard-shell > .section-tabs,
.property-detail-shell > .section-tabs {
  grid-column: 1;
  grid-row: 1 / span 3;
  display: grid;
  align-content: start;
  overflow-x: visible;
}

.dashboard-shell > .portfolio-tabs {
  top: 88px;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.06), rgba(255, 255, 255, 0)),
    var(--panel);
  box-shadow: 0 14px 32px rgba(31, 41, 51, 0.06);
}

.section-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  white-space: nowrap;
  text-align: left;
}

.tab-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--mint);
  font-size: 0.95rem;
  line-height: 1;
}

[data-dashboard-tab="overview"] .tab-icon {
  color: #14b8a6;
}

[data-dashboard-tab="properties"] .tab-icon {
  color: #16a34a;
}

[data-dashboard-tab="transactions"] .tab-icon {
  color: #f59e0b;
}

[data-dashboard-tab="account"] .tab-icon {
  color: #38bdf8;
}

[data-dashboard-tab="subscription"] .tab-icon {
  color: #a855f7;
}

[data-dashboard-tab="help"] .tab-icon {
  color: #64748b;
}

.dashboard-shell > .section-tabs .section-tab,
.property-detail-shell > .section-tabs .section-tab {
  flex: initial;
}

.dashboard-shell > .portfolio-tabs .section-tab {
  min-height: 46px;
  justify-content: flex-start;
  padding: 0 12px 0 14px;
  border-color: transparent;
  background: transparent;
  font-size: 0.92rem;
  font-weight: 850;
}

.section-tab.active {
  border-color: rgba(15, 118, 110, 0.55);
  background: rgba(15, 118, 110, 0.1);
  color: var(--mint);
}

.dashboard-shell > .portfolio-tabs .section-tab.active {
  border-color: rgba(15, 118, 110, 0.22);
  background: rgba(15, 118, 110, 0.12);
  color: #0b625b;
}

.dashboard-shell > .portfolio-tabs .section-tab.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 9px;
  bottom: 9px;
  width: 4px;
  border-radius: 999px;
  background: var(--mint);
}

.mobile-portfolio-dock {
  display: none;
}

.dashboard-panel[hidden],
.admin-panel[hidden],
.property-detail-panel[hidden] {
  display: none;
}

.secondary-button,
.small-button {
  min-height: 44px;
  padding: 0 14px;
}

.portfolio-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.property-record-metrics {
  margin-bottom: 12px;
}

.property-document-form {
  margin: 12px 0;
}

.portfolio-metrics article,
.property-card,
.admin-metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.portfolio-metrics article,
.admin-metrics article {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
}

.portfolio-metrics article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--green);
}

.portfolio-metrics article:nth-child(2)::before {
  background: var(--blue);
}

.portfolio-metrics article:nth-child(3)::before {
  background: var(--amber);
}

.portfolio-metrics article:nth-child(4)::before {
  background: var(--success);
}

.portfolio-metrics span,
.property-meta span,
.document-list span,
.subscription-grid span,
.admin-metrics span,
.admin-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.portfolio-metrics strong,
.admin-metrics strong {
  font-size: 1.45rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 12px;
}

.panel-card {
  padding: 16px;
}

.property-list-panel {
  grid-row: span 2;
}

.property-search {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.subscription-card {
  grid-column: 1 / -1;
}

.transaction-form-card,
.transaction-list-card {
  grid-column: 1 / -1;
}

.subscription-grid,
.admin-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.subscription-grid div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.subscription-grid strong {
  font-size: 1.08rem;
}

.stripe-button {
  width: 100%;
  margin-top: 12px;
}

.dashboard-promo-form {
  margin-top: 12px;
}

.transaction-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.transaction-form .wide-field,
.transaction-form .tax-button {
  grid-column: span 2;
}

.detail-filter-form {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 12px;
}

.detail-filter-form .checkbox-field {
  align-self: end;
  min-height: 48px;
}

#propertyReportFilters {
  grid-template-columns: repeat(2, minmax(150px, 1fr)) minmax(220px, 1.3fr) repeat(4, minmax(108px, 0.7fr));
  align-items: end;
}

#propertyReportFilters .checkbox-field {
  white-space: nowrap;
}

.quarter-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.quarter-summary div,
.transaction-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.quarter-summary div {
  display: grid;
  gap: 6px;
}

.quarter-summary span,
.transaction-row span,
.transaction-row small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 750;
}

.quarter-summary strong {
  font-size: 1.1rem;
}

.transaction-list {
  display: grid;
  gap: 8px;
}

.transaction-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
}

.transaction-row strong,
.transaction-row small {
  display: block;
  margin-top: 4px;
}

.transaction-amount {
  font-size: 1.05rem;
  font-weight: 850;
  white-space: nowrap;
}

.transaction-amount.income {
  color: var(--green);
}

.transaction-amount.expense {
  color: var(--red);
}

.landlord-report {
  display: grid;
  gap: 12px;
}

.landlord-report-intro,
.landlord-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.landlord-report-intro {
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 2fr);
}

.landlord-report-intro div,
.landlord-report-metrics div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.landlord-report-intro span,
.landlord-report-metrics span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.landlord-report-intro strong,
.landlord-report-metrics strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
}

.stripe-readiness {
  grid-column: 1 / -1;
}

[data-admin-panel="partners"],
[data-admin-panel="sponsors"],
[data-admin-panel="email-templates"],
[data-admin-panel="send-email"],
[data-admin-panel="pricing"] {
  grid-column: 1 / -1;
}

.admin-table {
  display: grid;
  gap: 8px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.admin-form .tax-button,
.admin-form .field-hint {
  grid-column: 1 / -1;
}

.admin-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

.admin-row div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.admin-row .wide-admin-cell {
  grid-column: 1 / -1;
}

.admin-user-row {
  grid-template-columns: minmax(180px, 1.4fr) minmax(180px, 1.2fr) minmax(120px, 0.8fr) minmax(90px, 0.6fr) auto;
  align-items: center;
}

.danger-inline-button {
  border-color: rgba(220, 38, 38, 0.45);
  color: var(--danger);
  justify-self: end;
}

.email-log-row.status-sent {
  border-left: 4px solid var(--teal);
}

.email-log-row.status-failed {
  border-left: 4px solid var(--danger);
}

.compact-heading {
  margin-top: 18px;
}

.marketing-admin-form textarea {
  min-height: 78px;
  resize: vertical;
}

.email-template-form textarea,
#adminSendEmailBody {
  min-height: 220px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.5;
  resize: vertical;
}

.email-template-editor {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.email-template-editor .wide-field {
  grid-column: 1 / -1;
}

.email-template-preview {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 12px;
}

.email-template-preview > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.email-template-preview > div {
  min-height: 90px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  color: var(--text);
  line-height: 1.5;
}

.help-panel {
  grid-column: 1 / -1;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.help-grid details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 14px;
}

.help-grid summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
}

.help-grid ol {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.help-grid li {
  padding-left: 0;
  border-left: 0;
  color: inherit;
}

.help-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.admin-form-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.checkbox-group {
  display: grid;
  gap: 8px;
  align-content: start;
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.checkbox-group legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  line-height: 1.25;
}

.checkbox-group input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
  accent-color: var(--green);
}

.marketing-admin-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.8fr) minmax(0, 0.8fr) minmax(0, 0.8fr) auto auto;
}

.admin-row strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.muted-row {
  color: var(--muted);
  grid-template-columns: 1fr;
}

.promo-table .admin-row {
  grid-template-columns: 1.15fr 0.75fr 0.8fr 0.9fr auto;
  align-items: end;
}

.promo-delete-button {
  min-height: 38px;
}

.property-list {
  display: grid;
  gap: 10px;
}

.export-bottom {
  width: 100%;
  margin-top: 12px;
}

.property-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.property-card:hover,
.property-card:focus-visible {
  border-color: rgba(15, 118, 110, 0.48);
  box-shadow: 0 12px 26px rgba(15, 118, 110, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.property-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.property-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.property-address {
  display: block;
  margin: 4px 0 2px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 700;
}

.property-card-status {
  display: flex;
  justify-content: end;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  width: fit-content;
  align-self: start;
  padding: 6px 9px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 999px;
  color: var(--green);
  background: rgba(15, 118, 110, 0.08);
  font-size: 0.74rem;
  font-weight: 850;
}

.pill.status-active {
  border-color: rgba(22, 163, 74, 0.24);
  color: var(--success);
  background: rgba(22, 163, 74, 0.08);
}

.pill.status-empty,
.pill.status-warning {
  border-color: rgba(245, 158, 11, 0.28);
  color: #9a5b00;
  background: rgba(245, 158, 11, 0.1);
}

.pill.status-managed {
  border-color: rgba(71, 117, 105, 0.3);
  color: var(--blue);
  background: rgba(71, 117, 105, 0.1);
}

.property-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.property-meta div {
  display: grid;
  gap: 4px;
}

.property-expiry {
  display: none;
}

.property-performance {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.property-performance strong {
  margin-left: 3px;
  color: var(--ink);
}

.property-performance .positive-value {
  color: var(--success);
}

.property-performance .negative-value {
  color: var(--red);
}

.property-performance .open-record {
  margin-left: auto;
  color: var(--green);
}

.reminder-list li {
  border-left-color: var(--gold);
}

.reminder-list .reminder-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 82px;
  gap: 10px;
  align-items: start;
  padding: 10px 0 10px 12px;
}

.reminder-type {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.reminder-item strong,
.reminder-item small,
.reminder-item time {
  display: block;
}

.reminder-item strong {
  color: var(--ink);
  font-size: 0.86rem;
}

.reminder-item small {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.reminder-item time {
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: right;
}

.reminder-overdue {
  border-left-color: var(--red) !important;
}

.reminder-due,
.reminder-one-week {
  border-left-color: var(--gold) !important;
}

.reminder-one-month,
.reminder-three-months,
.reminder-rent {
  border-left-color: var(--green) !important;
}

.document-list {
  display: grid;
  gap: 8px;
}

.document-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
}

.document-action-bar:empty {
  display: none;
}

.document-action-bar span,
.document-action-bar small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.document-action-bar strong {
  display: block;
  margin-top: 3px;
  font-size: 1rem;
}

.document-list > div {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(130px, 1fr) minmax(110px, 0.8fr) minmax(260px, auto);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
}

#invoiceList > div {
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  max-width: 100%;
}

.document-row-head {
  background: transparent !important;
  border: 0 !important;
  padding: 0 4px !important;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.document-list-heading {
  margin: 18px 0 8px;
}

.document-row {
  scroll-margin: 96px;
}

.document-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.document-row strong small {
  font-weight: 750;
}

.checkbox-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.tenancy-card p {
  color: #405861;
  line-height: 1.5;
}

.external-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  width: fit-content;
  padding: 0 12px;
  border: 1px solid var(--green);
  border-radius: 8px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 850;
}

.inline-link {
  color: var(--gold);
  text-decoration: none;
  font-weight: 850;
}

.site-footer {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 0 0 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 800;
}

.legal-page {
  width: min(880px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
  color: #405861;
}

.legal-page h1 {
  margin: 16px 0;
  max-width: none;
}

.legal-page h2 {
  margin-top: 28px;
  color: var(--ink);
  font-size: 1.18rem;
}

.legal-page p,
.legal-page li {
  color: #405861;
  line-height: 1.65;
}

.legal-page ul {
  list-style: disc;
  padding-left: 22px;
}

.legal-page li {
  padding-left: 4px;
  border-left: 0;
}

.legal-page a {
  color: var(--gold);
}

.legal-muted {
  color: var(--muted) !important;
}

@media (prefers-color-scheme: dark) {
  body:has(.legal-page) {
    color: #f8fafc;
    background:
      linear-gradient(180deg, rgba(20, 184, 166, 0.12), transparent 360px),
      #0f172a;
  }

  .legal-page {
    color: #94a3b8;
  }

  .legal-page h1,
  .legal-page h2 {
    color: #f8fafc;
  }

  .legal-page p,
  .legal-page li {
    color: #94a3b8;
  }
}

.property-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.property-form .tax-button,
.compact-form .tax-button {
  grid-column: 1 / -1;
}

.form-note {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.08);
}

.form-note span {
  color: var(--mint);
  font-size: 0.8rem;
  font-weight: 850;
}

.form-note p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.operator-note {
  grid-column: 1 / -1;
}

.tenant-note {
  align-content: start;
}

.tenant-note .secondary-button {
  margin-top: 8px;
}

.tenant-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.tenant-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfa;
}

.tenant-chip div {
  display: grid;
  gap: 2px;
}

.tenant-chip span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.detail-operator-field[hidden] {
  display: none;
}

.property-detail-shell {
  min-height: calc(100vh - 120px);
  grid-template-columns: minmax(184px, 212px) minmax(0, 1fr);
  column-gap: 28px;
}

.property-detail-shell > .dashboard-head,
.property-detail-shell > .property-detail-panel {
  min-width: 0;
}

.property-detail-shell > .section-tabs {
  align-self: start;
  max-width: 212px;
  width: 100%;
  min-width: 0;
  z-index: 3;
}

.property-detail-shell > .section-tabs .section-tab {
  width: 100%;
  min-width: 0;
}

.property-detail-summary,
.detail-list {
  display: grid;
  gap: 8px;
}

.property-detail-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.property-detail-summary div,
.detail-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfa;
  padding: 10px;
}

.detail-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.property-transaction-row {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.property-transaction-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.tenancy-rent-schedule {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.tenancy-rent-change-form {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.55fr) minmax(120px, 0.45fr) auto;
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tenancy-rent-change-form label,
.rent-change-history {
  display: grid;
  gap: 4px;
}

.rent-change-history {
  grid-column: 1 / -1;
}

.rent-change-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(80px, auto) minmax(76px, auto);
  gap: 8px;
  align-items: center;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.reminder-calendar {
  width: fit-content;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 0.74rem;
}

.tenancy-rent-schedule > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.tenancy-rent-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(130px, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.tenancy-rent-row span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.expense-bulk-actions {
  justify-content: flex-end;
  margin-bottom: 12px;
}

.operations-grid {
  display: grid;
  gap: 14px;
}

.operations-section {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.operations-section h3 {
  margin: 0;
}

.operations-form {
  margin-bottom: 8px;
}

.csv-import-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.document-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.checklist-item {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.checklist-item.complete {
  border-color: var(--teal);
  color: var(--teal);
}

.rent-calendar {
  display: grid;
  gap: 7px;
}

.calendar-toolbar,
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calendar-toolbar {
  margin-bottom: 12px;
}

.calendar-navigation {
  display: flex;
  align-items: end;
  gap: 6px;
}

.calendar-navigation .icon-button {
  min-width: 36px;
  min-height: 36px;
  font-size: 1.45rem;
}

.calendar-navigation .calendar-period-field {
  display: grid;
  gap: 4px;
  min-width: 124px;
}

.calendar-navigation .calendar-year-field {
  min-width: 86px;
}

.calendar-navigation .calendar-period-field span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.calendar-navigation select {
  min-height: 36px;
  padding: 6px 24px 6px 8px;
}

.calendar-toolbar label {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.calendar-toolbar label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
}

.calendar-panel {
  grid-column: 1 / -1;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.calendar-weekday {
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  min-height: 58px;
  display: grid;
  align-content: space-between;
  gap: 5px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.calendar-day:hover,
.calendar-day:focus-visible,
.calendar-day.selected {
  border-color: rgba(15, 118, 110, 0.62);
  outline: none;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.1);
}

.calendar-day.today strong {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: var(--green);
}

.calendar-day > span {
  display: flex;
  gap: 3px;
  align-items: center;
  flex-wrap: wrap;
}

.calendar-day small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
}

.calendar-day-empty {
  border-color: transparent;
  background: transparent;
}

.calendar-dot {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 999px;
}

.dot-rent {
  background: #dc2626;
}

.dot-mortgage {
  background: #f59e0b;
}

.dot-certificate {
  background: #9333ea;
}

.dot-tenancy {
  background: #2563eb;
}

.dot-review {
  background: #0f766e;
}

.calendar-legend {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-strong);
}

.calendar-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  font-size: 0.74rem;
  font-weight: 750;
}

.calendar-legend small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
}

.calendar-day-events {
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.calendar-day-events .section-heading {
  margin-bottom: 2px;
}

.calendar-day-events h3 {
  margin: 0;
  font-size: 1rem;
}

.calendar-subscription-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: rgba(15, 118, 110, 0.06);
}

.calendar-subscription-layout {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.calendar-subscription-layout img {
  display: block;
  width: 164px;
  height: 164px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.calendar-subscription-details {
  display: grid;
  gap: 10px;
}

.calendar-subscription-details p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.calendar-subscription-details label {
  display: grid;
  gap: 4px;
}

.calendar-subscription-details label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.calendar-subscription-details input {
  min-width: 0;
}

.calendar-event-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.calendar-event-row div {
  display: grid;
  gap: 2px;
}

.calendar-event-row div span {
  color: var(--muted);
  font-size: 0.74rem;
}

.calendar-event-status {
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--panel-strong);
  font-size: 0.7rem;
  font-weight: 850;
}

.calendar-event-status.status-paid,
.calendar-event-status.status-completed {
  color: var(--success);
  background: rgba(22, 163, 74, 0.1);
}

.calendar-event-status.status-due,
.calendar-event-status.status-overdue {
  color: var(--red);
  background: rgba(220, 38, 38, 0.1);
}

.print-statement {
  display: none;
}

.operations-row {
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.detail-actions .small-button {
  flex: 0 1 auto;
  min-height: 36px;
  max-width: 100%;
  padding: 0 10px;
}

.property-detail-summary span,
.detail-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.property-detail-summary strong,
.detail-row strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.danger-button {
  border: 1px solid rgba(216, 38, 38, 0.42);
  background: #fffafa;
  color: var(--red);
  box-shadow: none;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: rgba(216, 38, 38, 0.78);
  background: #fff1f1;
  color: #b91c1c;
}

.danger-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

:root[data-theme="dark"] .danger-button {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.18);
  color: var(--red);
}

:root[data-theme="dark"] .danger-button:hover,
:root[data-theme="dark"] .danger-button:focus-visible {
  border-color: rgba(248, 113, 113, 0.72);
  background: rgba(127, 29, 29, 0.32);
  color: #fecaca;
}

.topbar {
  display: grid;
  gap: 22px;
  align-items: start;
  margin-bottom: 28px;
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-lockup img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 34px rgba(15, 118, 110, 0.14);
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 850;
}

.brand-line {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  line-height: 1;
  max-width: 620px;
  text-wrap: balance;
}

.product-dashboard h1 {
  font-size: clamp(1.6rem, 2.5vw, 2.35rem);
  line-height: 1.05;
}

h2 {
  font-size: 1.1rem;
}

.mode-toggle {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: fit-content;
  padding: 4px;
  gap: 4px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.wide-toggle {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 680px);
}

.toggle-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 9px 12px;
  min-width: 104px;
  cursor: pointer;
}

.toggle-help {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  opacity: 0.8;
}

.toggle-help::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 20;
  width: min(280px, 72vw);
  transform: translateX(-50%);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.toggle-button:hover .toggle-help::after,
.toggle-button:focus-visible .toggle-help::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

.bulk-field,
.mixed-field,
.field-control.bulk-field,
.field-control.mixed-field {
  display: none;
}

.bulk-mode .bulk-field,
.bulk-mode .field-control.bulk-field,
.mixed-mode .mixed-field,
.mixed-mode .field-control.mixed-field {
  display: grid;
}

.toggle-button.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0f766e, #0b625b);
  box-shadow: 0 8px 24px rgba(15, 118, 110, 0.14);
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-control {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.field-hint {
  color: #6f828a;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.35;
}

.label-with-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
}

.help-dot {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(216, 184, 106, 0.46);
  border-radius: 999px;
  background: rgba(216, 184, 106, 0.1);
  color: var(--gold);
  cursor: help;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1;
}

.tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 10px);
  z-index: 4;
  width: min(340px, calc(100vw - 48px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1f2933;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
}

.label-with-help:hover .tooltip,
.label-with-help:focus-within .tooltip {
  opacity: 1;
  transform: translateY(0);
}

.mode-toggle.compact {
  width: 100%;
}

.mode-toggle.compact .toggle-button {
  min-width: 0;
  min-height: 48px;
  padding: 8px 10px;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
}

select {
  appearance: none;
  cursor: pointer;
}

input[readonly] {
  color: #9b6b00;
  background: rgba(216, 184, 106, 0.08);
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

.field-error {
  color: var(--red);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.35;
}

.form-status {
  grid-column: 1 / -1;
  margin: 0;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 54px;
}

.input-suffix span {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  color: var(--muted);
  font-weight: 800;
}

.score-block {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.1), rgba(216, 184, 106, 0.08)),
    var(--panel-strong);
  border: 1px solid var(--line);
  margin-bottom: 14px;
}

.score-block strong {
  display: block;
  font-size: 3.5rem;
  line-height: 0.9;
}

.score-block p:last-child {
  margin: 0;
  color: #49616b;
  font-weight: 800;
}

.score-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfeae8;
}

.score-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metrics-grid article {
  min-height: 96px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.metrics-grid span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.metrics-grid .metric-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
}

.metric-help {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal-dark);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  cursor: help;
}

.metric-help::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 8px);
  left: 50%;
  width: min(240px, 70vw);
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #1f2933;
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

:root[data-theme="dark"] .tooltip,
:root[data-theme="dark"] .metric-help::after {
  border-color: #d8dee6;
  background: #f8fafc;
  color: #1f2933;
}

.metric-help:hover::after,
.metric-help:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.metrics-grid strong {
  font-size: 1.35rem;
}

.insights {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.tax-basis {
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(216, 184, 106, 0.07);
}

.tax-basis p:last-child {
  margin: 0;
  color: #405861;
  line-height: 1.45;
}

.tax-button {
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: linear-gradient(135deg, #0f766e, #0b625b);
  color: #ffffff;
  cursor: pointer;
  font-weight: 850;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none;
}

.tax-modal {
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.property-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(820px, 100%);
  height: min(760px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  overflow: hidden;
  padding: 0;
}

.property-modal .modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  margin-bottom: 0;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.property-modal .property-form {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 18px 20px 20px;
  scrollbar-gutter: stable;
}

.property-modal .property-form::-webkit-scrollbar {
  width: 10px;
}

.property-modal .property-form::-webkit-scrollbar-thumb {
  border: 3px solid var(--panel);
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.42);
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.tax-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.close-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
}

.tax-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.tax-summary article,
.tax-breakdown,
.tax-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.tax-summary article {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 14px;
}

.tax-summary span,
.tax-breakdown span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

.tax-summary strong {
  font-size: 1.45rem;
}

.tax-breakdown {
  display: grid;
  gap: 0;
}

.tax-breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tax-breakdown div:last-child {
  border-bottom: 0;
}

.tax-note {
  margin-top: 14px;
  padding: 14px;
  color: #405861;
  line-height: 1.5;
}

.section-heading {
  margin-bottom: 12px;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

li {
  padding-left: 16px;
  border-left: 3px solid var(--green);
  color: #405861;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .app-shell,
  .premium-hero,
  .plan-grid,
  .dashboard-grid,
  .dashboard-shell,
  .admin-grid,
  .product-dashboard,
  .dashboard-overview,
  .deal-workspace {
    grid-template-columns: 1fr;
  }

  .dashboard-shell > .dashboard-head,
  .dashboard-shell > .portfolio-metrics,
  .dashboard-shell > .dashboard-grid,
  .dashboard-shell > .section-tabs,
  .property-detail-shell > .dashboard-head,
  .property-detail-shell > .section-tabs,
  .property-detail-shell > .property-detail-panel {
    grid-column: auto;
  }

  .dashboard-shell > .section-tabs,
  .property-detail-shell > .section-tabs {
    grid-row: auto;
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .dashboard-shell:not(.property-detail-shell) {
    padding-bottom: calc(102px + env(safe-area-inset-bottom, 0px));
  }

  .dashboard-shell > .portfolio-tabs {
    display: none;
  }

  .mobile-portfolio-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
    z-index: 80;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(86px, 1fr);
    align-items: center;
    gap: 6px;
    width: auto;
    max-width: calc(100vw - 20px);
    padding: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(31, 41, 51, 0.2);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .mobile-portfolio-dock .section-tab {
    display: grid;
    justify-items: center;
    gap: 4px;
    min-width: 82px;
    min-height: 58px;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.72rem;
    line-height: 1.05;
    text-align: center;
  }

  .mobile-portfolio-dock .tab-icon {
    width: 20px;
    height: 20px;
    font-size: 1.05rem;
  }

  .mobile-portfolio-dock .section-tab.active {
    border-color: rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.12);
    color: #0b625b;
  }

  :root[data-theme="dark"] .mobile-portfolio-dock {
    background: var(--panel);
  }

  :root[data-theme="dark"] .mobile-portfolio-dock .section-tab.active {
    border-color: rgba(20, 184, 166, 0.38);
    background: rgba(20, 184, 166, 0.14);
    color: #5eead4;
  }

  .mobile-portfolio-dock .section-tab.active::before {
    display: none;
  }

  .section-tabs {
    display: flex;
    overflow-x: auto;
  }

  .section-tab {
    flex: 0 0 auto;
  }

  .property-detail-shell > .detail-tabs {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }

  .property-detail-shell > .detail-tabs .section-tab {
    flex: 0 0 auto;
    min-width: 172px;
    max-width: 220px;
    justify-content: flex-start;
    overflow: hidden;
    scroll-snap-align: start;
  }

  .property-detail-shell > .detail-tabs .tab-icon {
    flex: 0 0 20px;
  }

  .product-sidebar {
    border-right: 1px solid var(--line);
    border-radius: 8px;
  }

  .dashboard-workspace {
    border-radius: 8px;
  }

  .portfolio-metrics,
  .property-meta,
  .subscription-grid,
  .transaction-form,
  .quarter-summary,
  .landlord-report-intro,
  .landlord-report-metrics,
  .admin-metrics,
  .dashboard-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .account-import-form {
    grid-template-columns: 1fr;
  }

  .form-grid.two-column {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .property-detail-shell > .detail-tabs .section-tab {
    min-width: 152px;
    max-width: 188px;
  }

  .calendar-toolbar,
  .calendar-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .calendar-toolbar label {
    min-width: 0;
  }

  .calendar-navigation {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 78px 36px;
    align-items: end;
  }

  .calendar-navigation .calendar-period-field,
  .calendar-navigation .calendar-year-field {
    min-width: 0;
  }

  .calendar-day {
    min-height: 48px;
    padding: 5px;
  }

  .calendar-event-row {
    grid-template-columns: 8px minmax(0, 1fr);
  }

  .calendar-event-row .calendar-event-status,
  .calendar-event-row .small-button {
    grid-column: 2;
    justify-self: start;
  }

  .calendar-subscription-layout {
    grid-template-columns: 1fr;
  }

  .calendar-subscription-layout img {
    justify-self: center;
  }

  .property-performance {
    align-items: start;
    display: grid;
    gap: 7px;
  }

  .property-performance .open-record {
    margin-left: 0;
  }

  .property-card-status {
    justify-content: start;
  }

  .section-tabs {
    top: 96px;
  }

  .app-nav {
    width: min(100vw - 20px, 1180px);
    align-items: stretch;
    display: grid;
  }

  .nav-actions {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    flex-wrap: wrap;
  }

  .nav-button {
    flex: 1 1 auto;
  }

  .app-shell,
  .premium-shell {
    width: min(100vw - 20px, 1180px);
    padding: 10px 0;
  }

  .calculator-panel,
  .results-panel,
  .calculator-partners {
    padding: 16px;
  }

  .topbar {
    display: grid;
  }

  .mode-toggle,
  .input-grid,
  .metrics-grid,
  .comparison-table div,
  .workspace-header,
  .dashboard-stats,
  .preview-property,
  .portfolio-metrics,
  .property-detail-summary,
  .detail-row,
  .subscription-grid,
  .transaction-form,
  .quarter-summary,
  .transaction-row,
  .landlord-report-intro,
  .landlord-report-metrics,
  .admin-metrics,
  .admin-form,
  .email-template-editor,
  .admin-row,
  .marketing-admin-row,
  .promo-table .admin-row,
  .property-meta,
  .property-form,
  .tax-summary,
  .tax-controls {
    grid-template-columns: 1fr;
  }

  .transaction-form .wide-field,
  .operator-note,
  .transaction-form .tax-button {
    grid-column: auto;
  }

  .tenancy-rent-row {
    grid-template-columns: 1fr;
  }

  .detail-actions,
  .tenancy-rent-row .detail-actions {
    justify-content: flex-start;
  }

  .detail-actions .small-button,
  .tenancy-rent-row .detail-actions .small-button {
    flex: 1 1 120px;
  }

  .rent-change-row {
    grid-template-columns: 1fr;
  }

  .rent-change-row .small-button {
    width: 100%;
  }

  .tenancy-rent-change-form {
    grid-template-columns: 1fr;
  }

  .operations-row {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    display: none;
  }

  .dashboard-workspace {
    padding: 12px;
  }

  .preview-value {
    justify-items: start;
  }

  .toggle-button {
    min-width: 0;
  }

  .dashboard-head {
    display: grid;
  }

  .marketing-card.sponsor-card,
  .partner-grid {
    grid-template-columns: 1fr;
  }
}

.print-document-appendix {
  display: none;
}

@media print {
  body.print-statement-report > *:not(#printStatement) {
    display: none !important;
  }

  body.print-statement-report #printStatement {
    display: block !important;
    color: #111111;
    background: #ffffff;
  }

  .print-statement-lines {
    margin-top: 16px;
    border-top: 1px solid #222222;
  }

  .print-statement-lines div {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 0;
    border-bottom: 1px solid #222222;
  }

  :root {
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #111111;
  }

  .app-nav,
  .admin-shell,
  .premium-hero,
  .login-panel,
  .admin-view,
  .dashboard-actions,
  .results-panel,
  .calculator-panel,
  .panel-card:not(.property-list-panel),
  .export-bottom,
  .modal-backdrop {
    display: none !important;
  }

  .premium-shell,
  .dashboard-shell,
  .dashboard-grid,
  .property-list-panel,
  .property-list {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .premium-shell::before {
    content: "PropertyPanel Portfolio Schedule";
    display: block;
    margin-bottom: 8px;
    color: #111111;
    font-size: 22px;
    font-weight: 800;
  }

  .premium-shell::after {
    content: "Prepared for lender review";
    display: block;
    margin-top: 8px;
    color: #555555;
    font-size: 11px;
  }

  .dashboard-head {
    margin-bottom: 12px;
  }

  .dashboard-head .eyebrow,
  .section-heading .eyebrow {
    color: #555555;
  }

  .portfolio-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    margin-bottom: 14px;
    border: 1px solid #222222;
  }

  .portfolio-metrics article {
    min-height: auto;
    padding: 8px;
    border: 0;
    border-right: 1px solid #222222;
    border-radius: 0;
    background: #ffffff;
  }

  .portfolio-metrics article:last-child {
    border-right: 0;
  }

  .portfolio-metrics span,
  .property-meta span {
    color: #555555;
    font-size: 10px;
  }

  .portfolio-metrics strong {
    color: #111111;
    font-size: 15px;
  }

  .property-card {
    break-inside: avoid;
    display: grid;
    grid-template-columns: 1.45fr 4.4fr 0.75fr;
    gap: 0;
    margin-bottom: 0;
    padding: 0;
    border: 1px solid #222222;
    border-bottom: 0;
    border-radius: 0;
    background: #ffffff;
    color: #111111;
  }

  .property-card:last-child {
    border-bottom: 1px solid #222222;
  }

  .property-card-head {
    display: block;
    padding: 6px;
    border-right: 1px solid #222222;
    border-bottom: 0;
  }

  .property-card h3 {
    color: #111111;
    font-size: 11px;
    line-height: 1.2;
  }

  .field-hint,
  .pill {
    color: #555555 !important;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .property-card > .field-hint {
    display: none;
  }

  .property-meta {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0;
  }

  .property-meta div {
    min-height: 44px;
    padding: 5px 6px;
    border-right: 1px solid #222222;
    border-bottom: 0;
  }

  .property-meta div:nth-child(8n) {
    border-right: 0;
  }

  .property-meta strong {
    color: #111111;
    font-size: 10px;
    line-height: 1.25;
  }

  .property-expiry {
    display: grid;
    gap: 4px;
    min-height: 44px;
    padding: 5px 6px;
    border-left: 1px solid #222222;
  }

  .property-expiry span {
    color: #555555;
    font-size: 10px;
    font-weight: 750;
  }

  .property-expiry strong {
    color: #111111;
    font-size: 10px;
    line-height: 1.25;
  }

  h2,
  h3 {
    color: #111111;
  }

  .print-document-appendix {
    break-before: page;
    page-break-before: always;
    display: block !important;
    margin: 18px 0 0;
    padding: 0;
    color: #111111;
  }

  .print-document-appendix h2 {
    margin: 0 0 10px;
    color: #111111;
    font-size: 20px;
    font-weight: 850;
  }

  .print-document-property {
    break-inside: avoid;
    margin: 0 0 12px;
    border: 1px solid #222222;
  }

  .print-document-property h3 {
    margin: 0;
    padding: 7px 8px;
    border-bottom: 1px solid #222222;
    background: #ffffff;
    color: #111111;
    font-size: 12px;
    font-weight: 850;
  }

  .print-document-list {
    display: grid;
    gap: 0;
  }

  .print-document-list div {
    display: grid;
    grid-template-columns: 1.3fr 2fr 1fr;
    gap: 8px;
    padding: 7px 8px;
    border-bottom: 1px solid #222222;
    color: #111111;
    font-size: 10px;
  }

  .print-document-list div:last-child {
    border-bottom: 0;
  }

  .print-document-list strong,
  .print-document-list span {
    color: #111111;
  }

  body.print-landlord-report .premium-shell,
  body.print-landlord-report .dashboard-shell,
  body.print-landlord-report .dashboard-grid,
  body.print-landlord-report .property-list-panel,
  body.print-landlord-report .property-list {
    display: none !important;
  }

  body.print-landlord-report #propertyDetailView,
  body.print-landlord-report .property-detail-shell,
  body.print-landlord-report [data-property-detail-panel="landlord-report"],
  body.print-landlord-report .landlord-report {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #ffffff !important;
    box-shadow: none !important;
  }

  body.print-landlord-report .property-detail-shell > .dashboard-head,
  body.print-landlord-report .detail-tabs,
  body.print-landlord-report .property-detail-panel:not([data-property-detail-panel="landlord-report"]),
  body.print-landlord-report .detail-filter-form,
  body.print-landlord-report #printLandlordReport {
    display: none !important;
  }

  body.print-landlord-report [data-property-detail-panel="landlord-report"]::before {
    content: "PropertyPanel Landlord Report";
    display: block;
    margin-bottom: 6px;
    color: #111111;
    font-size: 22px;
    font-weight: 850;
  }

  body.print-landlord-report [data-property-detail-panel="landlord-report"]::after {
    content: "Generated from saved PropertyPanel records";
    display: block;
    margin-top: 12px;
    color: #555555;
    font-size: 11px;
  }

  body.print-landlord-report .section-heading {
    margin-bottom: 10px;
  }

  body.print-landlord-report .landlord-report-intro,
  body.print-landlord-report .landlord-report-metrics {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 1px solid #222222;
  }

  body.print-landlord-report .landlord-report-intro div,
  body.print-landlord-report .landlord-report-metrics div,
  body.print-landlord-report .landlord-report-lines div {
    border: 0;
    border-right: 1px solid #222222;
    border-bottom: 1px solid #222222;
    border-radius: 0;
    background: #ffffff;
  }

  body.print-landlord-report .landlord-report-lines {
    margin-top: 12px;
    border-top: 1px solid #222222;
    border-left: 1px solid #222222;
  }
}
