@import url("./platform-theme.css?v=20260917a");

html:root {
  color-scheme: light;
  --navy: var(--brand-dark) !important;
  --blue: var(--brand-primary) !important;
  --sand: var(--bg-app) !important;
  --ink: var(--text-main) !important;
  --muted: var(--text-muted) !important;
  --line: var(--border-color) !important;
  --white: var(--bg-surface) !important;
}

html { min-height: 100%; background: var(--bg-app); }
body { min-width: 320px; min-height: 100%; margin: 0; background: var(--bg-app); color: var(--text-main); font-family: "Noto Sans Thai", "DM Sans", sans-serif; }
button, input, select, textarea { font: inherit; }
button, [role="button"] { touch-action: manipulation; }
a { color: var(--brand-dark); }

.app-header { color: var(--text-main); font-family: "Noto Sans Thai", "DM Sans", sans-serif; }
.api-state { color: var(--text-muted); }
.api-error { color: #a4414c; }

[data-app-shell],
[data-app-shell] * { box-sizing: border-box; }

[data-app-shell] {
  margin: 0;
  color: var(--text-main);
  background: var(--bg-app);
  font-family: "Noto Sans Thai", sans-serif;
}

[data-app-shell] .container { width: min(100% - 32px, 1240px); margin-inline: auto; }
[data-app-shell] button,
[data-app-shell] input { font: inherit; }
[data-app-shell] button { cursor: pointer; }
[data-app-shell] [hidden] { display: none !important; }
:is([data-app-shell], .formal-document, .landing-body) .compact-page-title { max-width: 100%; margin: 0; overflow: hidden; color: var(--text-main); font-size: 24px !important; line-height: 1.25 !important; letter-spacing: 0 !important; text-overflow: ellipsis; white-space: nowrap; }
:is([data-app-shell], .formal-document, .landing-body) .compact-page-title br { display: none; }
:is([data-app-shell], .formal-document, .landing-body) .compact-page-details { max-width: 760px; margin: 6px 0 0; color: var(--text-muted); font-size: 12px; line-height: 1.55; }
:is([data-app-shell], .formal-document, .landing-body) .compact-page-details summary { width: fit-content; color: var(--brand-dark); font-weight: 700; cursor: pointer; }
:is([data-app-shell], .formal-document, .landing-body) .compact-page-details p { margin: 8px 0 0; }

.app-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); width: min(100%, 1440px); min-height: calc(100dvh - 69px); margin: 0 auto; }
.app-shell--collapsed { grid-template-columns: 64px minmax(0, 1fr); }
.app-shell > main { min-width: 0; }
.app-shell .container { width: min(100% - 32px, 1160px); }
.app-sidebar { position: sticky; top: 69px; align-self: start; min-height: calc(100dvh - 69px); padding: 20px 12px; border-right: 1px solid var(--border-color); background: var(--bg-surface); }
.app-sidebar-toggle { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; margin-bottom: 12px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-main); font-size: 12px; font-weight: 700; text-align: left; }
.app-sidebar-toggle:hover { background: var(--brand-tint); color: var(--brand-primary); }
.app-sidebar-toggle svg { width: 17px; height: 17px; flex: 0 0 17px; stroke-width: 1.8; }
.app-sidebar nav { display: grid; gap: 4px; }
.app-sidebar a { display: flex; align-items: center; gap: 11px; min-height: 40px; padding: 0 11px; border-radius: 6px; color: var(--text-main); font-size: 13px; font-weight: 700; text-decoration: none; }
.app-sidebar a:hover,
.app-sidebar a[aria-current="page"] { color: var(--brand-primary); background: var(--brand-tint); }
.app-sidebar svg { width: 17px; height: 17px; stroke-width: 1.8; }
.app-shell--collapsed .app-sidebar { padding-inline: 10px; }
.app-shell--collapsed .app-sidebar-toggle { justify-content: center; padding: 0; }
.app-shell--collapsed .app-sidebar-toggle span,
.app-shell--collapsed .app-sidebar a span { display: none; }
.app-shell--collapsed .app-sidebar a { justify-content: center; gap: 0; padding: 0; }

@media (max-width: 860px) {
  [data-app-shell] .container { width: min(100% - 24px, 720px); }
  .app-shell { display: block; min-height: 0; }
  .app-shell--collapsed { display: block; }
  .app-sidebar { display: none; }
  .app-shell .container { width: min(100% - 24px, 720px); }
}

/* Shared operational surface language for every route outside the Home workspace. */
body[data-app-shell]:not(.home-scope) {
  background: var(--bg-app) !important;
}

body[data-app-shell]:not(.home-scope) :where(
  .listing-main,
  .listing-detail-main,
  .map-section,
  .ranking-main,
  .agent-main,
  .member-agent-main,
  .account-main,
  .guide-intro,
  .guide-main,
  .support-main,
  .messages-main,
  .province-hero,
  .province-listings,
  .portal-main,
  .dashboard,
  .admin-main
) {
  background: var(--bg-app) !important;
  background-image: none !important;
}

body[data-app-shell]:not(.home-scope) :where(
  .search-panel,
  .directory-filters,
  .ranking-filter-fields,
  .ranking-list,
  .property-card,
  .listing-card,
  .agent-profile,
  .agent-listing-card,
  .agent-ranking-card,
  .member-agent-card,
  .account-card,
  .account-login,
  .login-card,
  .portal-profile,
  .portal-account-overview,
  .marketing-studio,
  .owner-offer-studio,
  .listing-upgrades,
  .empty-state,
  .listing-row,
  .guide-help-panel,
  .guide-detail-section,
  .support-login,
  .support-ticket-area,
  .support-zone,
  .support-form-launcher,
  .ticket-row,
  .contact-menu-item,
  .conversation-list,
  .conversation-panel,
  .admin-workspace,
  .admin-summary article,
  .admin-table-wrap,
  .listing-payment-control,
  .api-state
) {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-surface) !important;
  box-shadow: var(--shadow-card) !important;
  color: var(--text-main) !important;
  transform: none !important;
}

body[data-app-shell]:not(.home-scope) :where(
  .property-card,
  .agent-ranking-card,
  .ticket-row,
  .portal-profile,
  .marketing-studio,
  .listing-upgrades,
  .conversation-list,
  .conversation-panel
)::before {
  content: none !important;
}

body[data-app-shell]:not(.home-scope) :where(
  .primary,
  .primary-button,
  .search-button,
  .ranking-search-button,
  .agent-listing-card button,
  .agent-contact,
  .community-send > button,
  button[type="submit"]:not(.secondary-button):not(.close-button)
) {
  border: 1px solid var(--brand-primary) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--brand-primary) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body[data-app-shell]:not(.home-scope) :where(
  .secondary,
  .secondary-button,
  .outline-button,
  .ranking-location-button,
  .agent-report,
  .agent-share,
  .mobile-filter-toggle,
  .admin-refresh
) {
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-surface) !important;
  color: var(--brand-dark) !important;
  box-shadow: none !important;
}

body[data-app-shell]:not(.home-scope) :where(input, select, textarea) {
  border-color: var(--border-color) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-surface) !important;
  color: var(--text-main) !important;
}

body[data-app-shell]:not(.home-scope) :where(button, input, select, textarea):focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}