:root {
  --brand-green: #3ECF4D;
  --brand-green-rgb: 62, 207, 77;
  --brand-green-hover: #2CB63C;
  --tech-blue: #1E90FF;
  --background-primary: #FFFFFF;
  --background-secondary: #F2F2F2;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-heading: #333333;
  --border-color: #E0E0E0;
  --card-background: #FFFFFF;
  --card-border: #E5E7EB;
  --input-border: #D1D5DB;
  --warning-color: #F59E0B;
  --error-color: #EF4444;
  --hover-overlay: rgba(0, 0, 0, 0.05);
  --transition-fast: 0.15s ease;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--background-secondary); color: var(--text-primary); font-family: Inter, "Segoe UI", Helvetica, Arial, sans-serif; }
h1, h2, h3, h4 { font-family: Montserrat, Inter, sans-serif; color: var(--text-heading); letter-spacing: -0.04em; margin: 0; }
a { color: var(--tech-blue); text-decoration: none; }
button, input, select, textarea { font: inherit; }
.pillar-container { min-height: 100vh; display: flex; flex-direction: column; background: var(--background-primary); }
.pillar-header { background: var(--card-background); border-bottom: 1px solid var(--border-color); }
.header-content { max-width: 1400px; margin: 0 auto; padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.header-identity { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.header-content h1 { font-size: 1.5rem; font-weight: 700; white-space: nowrap; }
.user-info, .property-selector-container { display: flex; align-items: center; gap: 0.75rem; }
.user-email { color: var(--text-secondary); font-size: 0.8rem; }
.sign-out-link { color: var(--text-tertiary); font-weight: 600; font-size: 0.8rem; }
.property-selector { min-width: 280px; padding: 0.6rem 0.85rem; border: 1px solid var(--border-color); border-radius: 0.5rem; background: white; }
.tab-navigation { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem 1rem; display: flex; gap: 0.5rem; overflow-x: auto; border-bottom: 1px solid var(--border-color); }
.tab-button { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1.25rem; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--text-secondary); font-weight: 600; cursor: pointer; white-space: nowrap; }
.tab-button.active { color: var(--brand-green); border-bottom-color: var(--brand-green); }
.tab-button:hover { background: var(--hover-overlay); border-radius: 0.5rem 0.5rem 0 0; }
.pillar-content { flex: 1; max-width: 1400px; width: 100%; margin: 0 auto; padding: 1.25rem; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.card-pillar { background: var(--card-background); border: 1px solid var(--card-border); border-radius: 0.75rem; padding: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.stat { font-size: 1.6rem; font-weight: 700; margin-top: 0.35rem; }
.btn-pillar { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.5rem; padding: 0.5rem 1rem; font-size: 0.875rem; font-weight: 600; border: none; cursor: pointer; }
.btn-pillar-primary { background: var(--brand-green); color: white; }
.btn-pillar-primary:hover { background: var(--brand-green-hover); }
.btn-pillar-secondary { background: white; color: #334155; border: 1px solid var(--card-border); }
.btn-pillar-danger { background: #dc2626; color: white; }
.btn-pillar:disabled { opacity: 0.6; cursor: not-allowed; }
.input-pillar, .table-wrap select, textarea.input-pillar { width: 100%; border: 1px solid var(--input-border); border-radius: 0.5rem; padding: 0.5rem 0.75rem; background: white; color: var(--text-primary); }
.input-pillar:focus { outline: none; border-color: var(--brand-green); box-shadow: 0 0 0 3px rgba(var(--brand-green-rgb), 0.2); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border-color); vertical-align: top; }
th { color: var(--text-secondary); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal-panel, .modal-panel-wide { background: white; border-radius: 1rem; padding: 1.5rem; width: min(32rem, 100%); max-height: 90vh; overflow: auto; }
.modal-panel-wide { width: min(42rem, 100%); }
.form-grid { display: grid; gap: 0.75rem; }
label span { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--text-secondary); }
.row-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.empty-state-full { text-align: center; padding: 4rem 1rem; color: var(--text-secondary); }
.subtabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }
.status-badge { display: inline-flex; border-radius: 999px; padding: 0.15rem 0.55rem; font-size: 0.75rem; font-weight: 700; background: #ecfdf3; color: #166534; }
.muted { color: var(--text-secondary); }
.error { color: var(--error-color); }
.auth-card { max-width: 32rem; margin: 4rem auto; }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.account-card { display: block; padding: 1.25rem; border-radius: 0.75rem; border: 1px solid var(--card-border); background: white; color: inherit; }
.account-card:hover { border-color: var(--brand-green); }
.thread { display: flex; flex-direction: column; gap: 0.5rem; max-height: 28rem; overflow: auto; }
.bubble { border: 1px solid var(--card-border); border-radius: 0.75rem; padding: 0.7rem 0.9rem; background: white; }
.filters { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters > * { width: auto; min-width: 10rem; }
@media (max-width: 768px) {
  .header-content { flex-direction: column; align-items: stretch; padding: 0.6rem 1rem 0.35rem; }
  .header-identity { justify-content: space-between; }
  .property-selector, .property-selector-container { width: 100%; min-width: 0; }
  .tab-navigation { padding: 0 0.85rem 0.45rem; gap: 0.2rem; }
  .tab-button { padding: 0.42rem 0.72rem; font-size: 0.82rem; }
  .tab-mobile-priority-1 { order: 1; } .tab-mobile-priority-2 { order: 2; } .tab-mobile-priority-3 { order: 3; }
  .tab-mobile-priority-4 { order: 4; } .tab-mobile-priority-5 { order: 5; } .tab-mobile-priority-6 { order: 6; }
  .tab-mobile-priority-7 { order: 7; } .tab-mobile-priority-8 { order: 8; }
  .pillar-content { padding: 0.55rem 0.65rem 0.85rem; }
}
.header-content { flex-wrap: wrap; align-items: center; }
.header-identity { flex: 1 1 16rem; min-width: 0; }
.header-identity h1, .sign-out-link { flex: 0 0 auto; white-space: nowrap; }
.user-email { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.property-controls { margin-left: auto; flex: 1 1 18rem; display: flex; justify-content: flex-end; min-width: 16rem; }
.property-selector-container, .property-selector { width: min(100%, 28rem); max-width: 28rem; position: static; }
.pillar-header { overflow: visible; }
.tab-navigation { overflow-x: auto; flex-wrap: nowrap; }
.tab-button { flex: 0 0 auto; }
.tab-icon { font-size: 1.05rem; }
.dashboard { display: flex; flex-direction: column; gap: 1rem; }
.stats-grid { display: grid; gap: 0.75rem; }
.stats-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card { background: #fff; border: 1px solid #E0E0E0; border-radius: 10px; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.mini-stat { padding: 1rem 1.15rem; }
.stat-label, .mini-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: #999; font-weight: 600; margin: 0; }
.stat-value { font-size: 1.5rem; font-weight: 700; color: #333; }
.mini-value { font-size: 1.25rem; font-weight: 700; margin: 0.15rem 0 0; color: #333; }
.mini-sub, .stat-sub { font-size: 0.75rem; color: #666; }
.negative, .stat-value.negative, .mini-value.negative, .stat-sub.negative { color: #EF4444; }
.positive, .stat-value.positive, .mini-value.positive { color: #3ECF4D; }
.stat-row { display: flex; justify-content: space-between; align-items: center; }
.count-badge { padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 700; color: #fff; }
.count-badge.warning { background: #F59E0B; }
.section-heading { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #666; margin: 0.25rem 0; }
.dashboard .property-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }
.dashboard .property-card { background: #fff; border: 1px solid #E0E0E0; border-radius: 10px; padding: 0.85rem 1rem; cursor: pointer; }
.dashboard .property-card:hover { border-color: #3ECF4D; }
.property-card-header, .person-card-top, .expense-card-row, .task-card-row { display: flex; justify-content: space-between; gap: 0.75rem; }
.property-name { font-size: 0.95rem; margin: 0; }
.property-address, .contact-context, .contacts-subtitle { font-size: 0.75rem; color: #666; margin: 0.15rem 0 0; }
.dashboard .occupancy-badge, .properties-page .occupancy-badge { border-radius: 999px; font-weight: 700; }
.dashboard .occupancy-badge { padding: 0.2rem 0.6rem; font-size: 0.7rem; }
.occupancy-badge.occupied { background: rgba(62,207,77,.12); color: #3ECF4D; }
.occupancy-badge.vacant { background: rgba(245,158,11,.12); color: #d97706; }
.property-card-footer { display: flex; gap: 0.75rem; margin-top: 0.6rem; font-size: 0.8rem; color: #666; }
.properties-page { display: flex; flex-direction: column; gap: 1rem; }
.page-header, .page-head, .settings-header, .contacts-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.page-header h2, .page-head h2 { font-size: 1.125rem; }
.btn-add-property, .btn-save { background: #3ECF4D; color: #fff; border: none; border-radius: 8px; padding: 0.55rem 1rem; font-weight: 700; cursor: pointer; }
.btn-add-property:hover, .btn-save:hover { background: #2CB63C; }
.properties-page .property-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.properties-page .property-card { background: #fff; border: 1px solid #E0E0E0; border-radius: 12px; overflow: hidden; }
.properties-page .card-top { display: flex; justify-content: space-between; gap: 1rem; padding: 0.85rem 1.15rem; cursor: pointer; align-items: center; }
.properties-page .card-title-row { display: flex; align-items: center; gap: 0.6rem; }
.properties-page .card-address { color: #999; font-size: 0.8rem; }
.properties-page .occupancy-badge { font-size: 0.65rem; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.15rem 0.5rem; }
.properties-page .card-stats { display: flex; align-items: center; gap: 1.5rem; }
.properties-page .stat { display: flex; flex-direction: column; align-items: flex-end; font-size: 0.85rem; font-weight: 400; margin: 0; }
.properties-page .stat strong { font-size: 0.85rem; }
.card-details { border-top: 1px solid #E0E0E0; padding: 1rem 1.15rem; background: #F2F2F2; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.detail-heading { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #999; }
.detail-row { display: flex; justify-content: space-between; font-size: 0.82rem; }
.text-negative { color: #EF4444; }
.card-actions, .task-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.btn-action { padding: 0.4rem 0.85rem; font-size: 0.78rem; font-weight: 600; border-radius: 0.4rem; border: 1px solid #E0E0E0; background: #fff; cursor: pointer; }
.btn-action.view { background: #3ECF4D; color: #fff; border-color: #3ECF4D; }
.btn-action.delete { margin-left: auto; color: #EF4444; background: transparent; }
.stack, .task-list, .expense-list, .message-list { display: flex; flex-direction: column; gap: 0.65rem; }
.people-grid, .contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.contacts-stats { display: flex; gap: 0.75rem; }
.contacts-toolbar, .filters { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filters > *, .contacts-toolbar > * { min-width: 10rem; flex: 1; }
.task-card { cursor: pointer; padding: 1rem 1.15rem; }
.task-title-row { display: flex; align-items: center; gap: 0.5rem; }
.task-title-row h4 { font-size: 0.9rem; margin: 0; }
.task-title-row h4.done { text-decoration: line-through; }
.priority-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.task-meta, .title-row, .message-contact-main, .expense-card-line { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.task-meta { margin-top: 0.45rem; font-size: 0.75rem; }
.status-badge.pill-open { background: #dbeafe; color: #1d4ed8; }
.status-badge.pill-progress { background: #fef3c7; color: #b45309; }
.status-badge.pill-done { background: #dcfce7; color: #166534; }
.status-badge.pill-cancel, .status-badge.pill-slate { background: #f1f5f9; color: #475569; }
.due-overdue { color: #EF4444; font-weight: 700; }
.due-date { color: #999; }
.hero-section, .primary-card, .settings-group, .expense-card, .message-contact-row { background: #fff; border: 1px solid #E0E0E0; border-radius: 12px; }
.hero-section, .primary-card, .expense-card, .message-contact-row, .settings-group { padding: 0.85rem 1rem; }
.primary-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.card-header { display: flex; justify-content: space-between; align-items: center; }
.header-action { background: none; border: none; color: #3ECF4D; font-weight: 700; cursor: pointer; }
.comms-subtabs { display: flex; border-bottom: 1px solid #E0E0E0; }
.comms-subtab { background: none; border: none; border-bottom: 2px solid transparent; padding: 0.6rem 1.25rem; font-weight: 700; color: #666; cursor: pointer; }
.comms-subtab--active { color: #3ECF4D; border-bottom-color: #3ECF4D; }
.message-contact-row { width: 100%; text-align: left; cursor: pointer; }
.expense-amount { color: #EF4444; font-weight: 700; }
.expense-chip { display: inline-flex; border-radius: 999px; background: #F2F2F2; font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.5rem; }
.expense-delete-btn { border: none; background: transparent; color: #EF4444; font-weight: 700; cursor: pointer; }
.table-card { padding: 0; overflow: hidden; }
th.num, td.num { text-align: right; }
.bar-row { display: grid; grid-template-columns: 7rem 1fr auto; gap: 0.6rem; align-items: center; margin-top: 0.45rem; }
.bar-track { height: 0.45rem; background: #F2F2F2; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: #EF4444; }
.settings-page { display: flex; flex-direction: column; gap: 1rem; }
.group-title { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: #999; }
.section-title { margin: 0.8rem 0 0.55rem; }
.form-grid.two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.account-page { max-width: 64rem; margin: 0 auto; padding: 2.5rem 1.5rem; }
.btn-admin { background: #0f172a; color: #fff; border-radius: 8px; padding: 0.5rem 1rem; font-weight: 700; }
.account-card:hover { border-color: #3ECF4D; }
.empty-pad { text-align: center; padding: 2.5rem 1rem; }
.empty-text { color: #999; }
.text-xs { font-size: 0.75rem; padding: 0.25rem 0.5rem; }
@media (max-width: 900px) {
  .stats-grid.cols-4, .stats-grid.cols-5, .primary-grid, .detail-grid, .form-grid.two-col { grid-template-columns: 1fr 1fr; }
  .property-controls, .property-selector-container, .property-selector { width: 100%; max-width: none; }
}
@media (max-width: 640px) {
  .stats-grid.cols-4, .stats-grid.cols-5, .stats-grid.cols-2, .primary-grid, .detail-grid, .form-grid.two-col, .people-grid, .contacts-grid { grid-template-columns: 1fr; }
  .properties-page .card-top, .header-identity { flex-direction: column; align-items: flex-start; }
}
.comms-topbar { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.comms-phone-pill { display: inline-flex; align-items: center; gap: 0.45rem; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 999px; padding: 0.25rem 0.7rem; font-size: 0.8rem; font-weight: 600; color: #334155; }
.comms-workspace { display: grid; grid-template-columns: 20rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.comms-sidebar { background: #fff; border: 1px solid var(--card-border); border-radius: 0.75rem; overflow: hidden; display: flex; flex-direction: column; max-height: 42rem; }
.comms-sidebar-head { padding: 0.75rem; border-bottom: 1px solid var(--border-color); display: flex; flex-direction: column; gap: 0.5rem; background: #fafafa; }
.comms-contact-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; }
.comms-contact-item { width: 100%; text-align: left; border: none; border-bottom: 1px solid #f1f5f9; background: #fff; padding: 0.75rem 0.85rem; cursor: pointer; display: flex; flex-direction: column; gap: 0.25rem; transition: background var(--transition-fast); }
.comms-contact-item:hover { background: #f8fafc; }
.comms-contact-item.active { background: rgba(62, 207, 77, 0.09); border-left: 3px solid var(--brand-green); }
.comms-contact-top { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.comms-contact-name { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.4rem; }
.comms-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-green); display: inline-block; flex-shrink: 0; }
.comms-contact-sub { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.74rem; color: var(--text-secondary); }
.comms-contact-preview { font-size: 0.8rem; color: #475569; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comms-main { background: #fff; border: 1px solid var(--card-border); border-radius: 0.75rem; display: flex; flex-direction: column; min-height: 34rem; max-height: 42rem; overflow: hidden; }
.comms-thread-header { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; background: #fafafa; }
.comms-scheduled-bar { padding: 0.55rem 1rem; background: #fffbeb; border-bottom: 1px solid #fde68a; font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.35rem; }
.comms-scheduled-item { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.comms-bubbles { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 0.65rem; background: #f8fafc; }
.comms-date-divider { align-self: center; background: #e2e8f0; color: #475569; font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 0.15rem 0.65rem; margin: 0.35rem 0; }
.msg-bubble { max-width: min(78%, 34rem); border-radius: 0.85rem; padding: 0.65rem 0.85rem; font-size: 0.9rem; line-height: 1.42; box-shadow: 0 1px 2px rgba(0,0,0,0.04); word-wrap: break-word; }
.msg-bubble.sent { align-self: flex-end; background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; border-bottom-right-radius: 0.25rem; }
.msg-bubble.received { align-self: flex-start; background: #ffffff; color: var(--text-primary); border: 1px solid var(--card-border); border-bottom-left-radius: 0.25rem; }
.msg-body { white-space: pre-wrap; }
.msg-orig-box { margin-top: 0.4rem; padding-top: 0.35rem; border-top: 1px dashed rgba(0,0,0,0.15); font-size: 0.8rem; color: #475569; white-space: pre-wrap; }
.msg-meta { margin-top: 0.3rem; display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; font-size: 0.7rem; color: #64748b; flex-wrap: wrap; }
.msg-link-btn { background: none; border: none; padding: 0; color: #0284c7; font-size: 0.7rem; font-weight: 600; cursor: pointer; text-decoration: underline; }
.comms-composer { padding: 0.75rem 1rem; border-top: 1px solid var(--border-color); background: #fff; display: flex; flex-direction: column; gap: 0.5rem; }
.comms-composer-row { display: flex; gap: 0.5rem; align-items: flex-end; }
.comms-composer-row textarea { flex: 1; resize: vertical; min-height: 2.6rem; max-height: 8rem; }
.call-card, .voicemail-card { background: #fff; border: 1px solid var(--card-border); border-radius: 0.75rem; padding: 0.9rem 1.1rem; display: flex; flex-direction: column; gap: 0.55rem; }
.voicemail-card.unread { border-left: 4px solid var(--brand-green); background: #fafffb; }
.call-card-top, .voicemail-card-top { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.call-transcript-box { margin-top: 0.4rem; padding: 0.75rem; border-radius: 0.6rem; background: #f8fafc; border: 1px solid #e2e8f0; display: flex; flex-direction: column; gap: 0.45rem; }
.transcript-entry { padding: 0.45rem 0.65rem; border-radius: 0.5rem; font-size: 0.84rem; background: #fff; border: 1px solid #e2e8f0; }
.transcript-entry.landlord { border-left: 3px solid var(--brand-green); }
.transcript-entry.caller { border-left: 3px solid var(--tech-blue); }
.voicemail-transcript { font-size: 0.88rem; color: #334155; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.55rem; padding: 0.65rem 0.8rem; white-space: pre-wrap; }
.voicemail-audio { width: 100%; max-width: 28rem; height: 2.25rem; margin-top: 0.25rem; }
.webhook-row { display: flex; gap: 0.5rem; align-items: center; }
.webhook-row input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; background: #f8fafc; }
.forwarding-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 0.5rem; align-items: center; margin-bottom: 0.45rem; }
.checkbox-inline { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.86rem; font-weight: 600; color: var(--text-primary); cursor: pointer; }
@media (max-width: 900px) {
  .comms-workspace { grid-template-columns: 1fr; }
  .comms-sidebar { max-height: 18rem; }
  .forwarding-row { grid-template-columns: 1fr; }
}

/* Phone rules follow the 900px communications query so they override the 18rem sidebar cap. */
.mobile-back { display: none; }

@media (max-width: 760px) {
  html {
    max-width: 100%;
    overflow-x: clip;
  }
  body {
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: clip;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .pillar-container {
    min-height: 100dvh;
    max-width: 100%;
    overflow-x: clip;
  }
  .pillar-header,
  .pillar-content,
  .header-content,
  .tab-navigation,
  .card-pillar,
  .table-card,
  .table-wrap,
  .dashboard,
  .properties-page,
  .settings-page,
  .settings-group,
  section {
    min-width: 0;
    max-width: 100%;
  }
  input,
  select,
  textarea,
  .input-pillar,
  .property-selector,
  .table-wrap select,
  textarea.input-pillar,
  .webhook-row input {
    font-size: 16px;
  }
  .pillar-header {
    padding-top: env(safe-area-inset-top);
  }
  .header-content {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem 0.15rem;
  }
  .header-identity {
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.25rem 0.65rem;
    width: 100%;
    min-width: 0;
  }
  .header-content h1,
  .header-identity h1 {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.12rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sign-out-link {
    margin-left: auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .user-email {
    flex: 1 1 100%;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .property-controls,
  .property-selector-container,
  .property-selector {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin-left: 0;
    flex: none;
  }
  .property-controls { justify-content: stretch; }
  .property-selector-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
  }
  .property-selector { min-height: 44px; }
  .tab-navigation {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.15rem;
    padding: 0 0.5rem 0.15rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .tab-navigation::-webkit-scrollbar { display: none; height: 0; }
  .tab-button {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
  }
  .pillar-content { padding: 0.65rem 0.7rem calc(0.85rem + env(safe-area-inset-bottom)); }
  .page-head,
  .page-header,
  .settings-header,
  .contacts-header,
  .properties-page .card-top,
  .properties-page .card-stats {
    flex-direction: column;
    align-items: stretch;
  }
  .stats-grid.cols-2,
  .stats-grid.cols-4,
  .stats-grid.cols-5,
  .primary-grid,
  .detail-grid,
  .form-grid.two-col,
  .people-grid,
  .contacts-grid,
  .account-grid,
  .dashboard .property-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .filters,
  .contacts-toolbar,
  .contacts-stats,
  .row-actions,
  .webhook-row {
    flex-wrap: wrap;
  }
  .filters > *,
  .contacts-toolbar > * {
    min-width: 0;
    flex: 1 1 100%;
    width: 100%;
  }
  .bar-row { grid-template-columns: minmax(0, 5.5rem) minmax(0, 1fr) auto; }
  .table-wrap {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    width: max-content;
    min-width: 100%;
  }
  img, svg, video, canvas, iframe, pre, audio { max-width: 100%; }
  pre { overflow-x: auto; }
  .account-page { padding: 1rem 0.75rem; }
  .auth-card { margin: 1.5rem auto; }
  .modal-overlay {
    align-items: flex-end;
    justify-content: stretch;
    padding: 0;
  }
  .modal-panel,
  .modal-panel-wide {
    width: 100%;
    max-width: 100%;
    border-radius: 1rem 1rem 0 0;
    max-height: 92dvh;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
  }
  .pillar-container:has([data-hedy-feature="messages"]) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }
  .pillar-container:has([data-hedy-feature="messages"]) .pillar-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }
  .pillar-container:has([data-hedy-feature="messages"]) .pillar-content > section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .pillar-container:has([data-hedy-feature="messages"]) .page-head,
  .comms-topbar {
    flex: 0 0 auto;
    margin-bottom: 0.4rem;
  }
  .comms-workspace {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    gap: 0;
    overflow: hidden;
  }
  .comms-workspace:not(.show-thread) .comms-main { display: none; }
  .comms-workspace.show-thread .comms-sidebar { display: none; }
  .comms-workspace .comms-sidebar,
  .comms-workspace.show-thread .comms-main {
    display: flex;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: auto;
    max-height: none;
  }
  .comms-workspace .comms-main {
    min-height: 0;
    max-height: none;
  }
  .comms-contact-list,
  .comms-bubbles {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .comms-thread-header .mobile-back {
    display: inline-flex;
    align-items: center;
    flex: 1 0 100%;
    min-height: 44px;
    padding: 0.2rem 0;
    border: none;
    background: none;
    color: var(--tech-blue);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
  }
  .comms-thread-header { align-items: flex-start; padding: 0.45rem 0.75rem; }
  .comms-thread-header .row-actions { width: 100%; }
  .comms-thread-header .row-actions .btn-pillar,
  .comms-composer .btn-pillar { min-height: 44px; }
  .comms-composer {
    flex: 0 0 auto;
    position: sticky;
    bottom: 0;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  }
  .comms-composer-row textarea {
    min-width: 0;
    font-size: 16px;
  }
  .comms-main .empty-state-full { padding: 1.5rem 0.75rem; }
}

@media (min-width: 480px) and (max-width: 760px) {
  .stats-grid.cols-2,
  .stats-grid.cols-4,
  .stats-grid.cols-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
