.guest-search { margin-bottom: 16px; }
.guest-active-filters, .guest-pagination, .guest-profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.guest-summary { margin: 20px 0 12px; color: var(--text-secondary); }
.guest-table-wrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
.guest-table { min-width: 1120px; }
.guest-table td { font-size: 13px; overflow-wrap: anywhere; }
.guest-table th .mud-button-root { padding: 4px; min-width: 44px; min-height: 44px; font-size: 13px; text-transform: none; }
.guest-table small, .guest-profile-card small, .guest-consent-detail small, .guest-pinned small, .guest-pinned-menu small { display: block; color: var(--text-secondary); font-size: 12px; }
.guest-table td:first-child { min-width: 150px; }
.guest-table td:first-child a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.guest-date { white-space: nowrap; }
.guest-consents { display: inline-flex; gap: 8px; margin: 4px 0; }
.guest-pagination { margin: 16px 0; justify-content: flex-end; }
.guest-pagination > span { margin-right: auto; }
.guest-phone-filters, .guest-mobile-cards { display: none; }
.guest-profile-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.guest-profile-card { overflow-wrap: anywhere; }
.guest-profile-card h2 { font-size: 20px; }
.guest-profile-section { padding-top: 20px; margin-top: 20px; border-top: 1px solid var(--border-subtle); }
.guest-profile-section p, .guest-pinned p { margin: 8px 0; }
.guest-consent-detail { margin: 12px 0; font-size: 13px; }
.guest-pinned { background: var(--warning-bg); color: var(--warning-fg); border: 1px solid var(--warning); border-radius: var(--radius-md); padding: 16px; margin: 16px 0; overflow-wrap: anywhere; }
.guest-pinned p, .guest-pinned small { color: inherit; white-space: pre-wrap; }
.guest-pinned-menu { padding: 16px; max-width: min(340px, 90vw); white-space: pre-wrap; overflow-wrap: anywhere; }
.guest-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
.guest-stat-grid dt { font-size: 13px; color: var(--text-secondary); }
.guest-stat-grid dd { margin: 0; font-size: 18px; font-weight: 600; }
.guest-stats summary, .guest-chart-data summary { min-height: 44px; cursor: pointer; display: flex; align-items: center; color: var(--text-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.guest-stats summary::after, .guest-chart-data summary::after { content: ' · Show'; }
.guest-stats[open] summary::after, .guest-chart-data[open] summary::after { content: ' · Hide'; }
.guest-timeline-filters { display: flex; flex-wrap: wrap; margin: 12px 0; }
.guest-timeline { list-style: none; padding: 0 0 0 24px; margin: 24px 0 16px 10px; border-left: 1px solid var(--border-strong); }
.guest-activity { position: relative; border: 1px solid var(--border-subtle); background: var(--surface-primary); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.guest-activity::before { content: ''; position: absolute; left: -30px; top: 26px; width: 10px; height: 10px; background: var(--surface-primary); border: 2px solid var(--border-strong); border-radius: 50%; }
.guest-activity-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guest-activity-heading h3 { font-size: 15px; font-weight: 600; margin: 0; }
.guest-activity-heading a { display: inline-flex; align-items: center; min-height: 44px; }
.guest-activity small { color: var(--text-secondary); }
.guest-activity p { margin: 12px 0; }
.guest-note-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.guest-money { border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.guest-filter-fields { display: grid; gap: 16px; }
.guest-details-editor { max-width: 800px; padding-bottom: 32px; }
.guest-details-editor > .mud-input-control { margin-bottom: 16px; }
.guest-dashboard-filters { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.guest-dashboard-filters > * { min-width: 180px; flex: 1; }
.guest-chart-data table, .guest-heat { width: 100%; border-collapse: collapse; font-size: 13px; }
.guest-chart-data th, .guest-chart-data td { text-align: left; padding: 10px 6px; border-bottom: 1px solid var(--border-subtle); }
.guest-chart-data a, .guest-heat a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
.guest-heat-scroll { overflow-x: auto; }
.guest-heat { border-collapse: separate; border-spacing: 4px; }
.guest-heat th { font-size: 12px; font-weight: 600; }
.guest-heat td { text-align: center; border-radius: 6px; height: 44px; min-width: 27px; font-variant-numeric: tabular-nums; }
.guest-heat-0 { background: var(--surface-tertiary); }
.guest-heat-1 { background: color-mix(in srgb, var(--brand-accent) 10%, var(--surface-primary)); }
.guest-heat-2 { background: color-mix(in srgb, var(--brand-accent) 20%, var(--surface-primary)); }
.guest-heat-3 { background: color-mix(in srgb, var(--brand-accent) 30%, var(--surface-primary)); }
/* The busiest level is a stronger tint, not the solid accent: white on a bright tenant accent failed contrast. */
.guest-heat-4 { background: color-mix(in srgb, var(--brand-accent) 50%, var(--surface-primary)); color: var(--text-primary); font-weight: 700; }
.guest-heat-4 a { color: inherit; }
.guest-top-list { list-style: none; padding: 0; }
.guest-top-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 16px 0; border-bottom: 1px solid var(--border-subtle); }
.guest-top-list span { grid-column: 1; font-size: 13px; color: var(--text-secondary); }
.guest-top-list strong { grid-column: 2; grid-row: 1; }
@media (max-width: 900px) {
    .guest-profile-grid { grid-template-columns: minmax(0, 1fr); }
    .guest-profile-card { width: 100%; }
}
@media (max-width: 600px) {
    .guest-desktop-filters.d-flex, .guest-table-wrap { display: none !important; }
    .guest-mobile-cards, .guest-phone-filters { display: block; }
    .guest-phone-filters { margin-top: 12px; }
    .guest-mobile-cards article { margin-top: 16px; }
    .guest-profile-actions { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1200; background: var(--surface-primary); border-top: 1px solid var(--border-subtle); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
    .guest-profile-grid { padding-bottom: 88px; }
    .guest-timeline { margin-left: 0; padding-left: 14px; }
    .guest-activity { padding: 14px; }
    .guest-activity::before { left: -20px; }
    .guest-filters-dialog { position: fixed; bottom: 0; margin: 0; width: 100%; max-height: 90dvh; border-radius: 14px 14px 0 0; padding-bottom: env(safe-area-inset-bottom); }
    .guest-dashboard-filters { display: grid; grid-template-columns: minmax(0, 1fr); }
}
.guest-merge-comparison { border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px; overflow-wrap: anywhere; }

.guest-timeline-filters .mud-chip { min-height: 44px; }

/* Timeline statuses: primary text on a tint of the tone, so they read on light, dark and dark-tenant themes alike
   (the state tokens keep their light values; see ds-chip--pending-tint). */
.guest-status { --tone: var(--text-secondary); display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600; white-space: nowrap; color: var(--text-primary);
  background: color-mix(in srgb, var(--tone) 18%, var(--surface-primary)); border: 1px solid color-mix(in srgb, var(--tone) 50%, var(--surface-primary)); }
.guest-status--success { --tone: var(--success); }
.guest-status--info { --tone: var(--info); }
.guest-status--warning { --tone: var(--warning); }
.guest-status--error { --tone: var(--danger); }
