/* Shared layout safeguards for Business, Client and Employee apps. */
:where(main, .page, .pane, .card, .stat, .sheet, .notice, .grid, .grid4, .two, .three, .list, .actions) {
  min-width: 0;
}
:where(.card, .stat, .sheet, .notice, dialog) { max-width: 100%; }
:where(.card, .stat, .sheet, .notice, dialog) :where(h1, h2, h3, p, .title, .muted, .sub, .note, label) {
  overflow-wrap: anywhere;
}
.row { flex-wrap: wrap; row-gap: 8px; }
.row > * { min-width: 0; max-width: 100%; }
.row > div:first-child { flex: 1 1 12rem; }
.row > .badge, .badge {
  flex-shrink: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.sectionhead { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
.sectionhead > *, .sheethead > *, .schedule-calendar-head > * { min-width: 0; }
.sectionhead h3 { flex: 1 1 12rem; }
.sectionhead > .actions { flex-wrap: wrap; }
.sheethead { align-items: flex-start; }
.sheethead h2 { flex: 1; overflow-wrap: anywhere; line-height: 1.25; }
.close { flex: 0 0 36px; height: 36px; padding: 0; line-height: 1; }
.card > .actions { margin-top: 12px; }
.actions { align-items: center; }
.btn, .account-tool, .contract-notice-link {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
  text-align: center;
}
.actions > .btn { flex: 0 1 auto; }
.tabs > button, nav > button { flex-shrink: 0; white-space: nowrap; }
input, select, textarea { box-sizing: border-box; min-width: 0; max-width: 100%; }
input:is([type="date"], [type="time"], [type="datetime-local"]) {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  -webkit-appearance: none;
  appearance: none;
}
input:is([type="date"], [type="time"], [type="datetime-local"])::-webkit-datetime-edit {
  min-inline-size: 0;
  max-inline-size: 100%;
}
:where(.grid, .grid4, .two, .three, .quote-item-grid, .quote-add-actions) > * { min-width: 0; }
body[data-app="employee"] .grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.schedule-calendar { width: 100%; }
.schedule-calendar-head strong { text-align: center; overflow-wrap: anywhere; line-height: 1.3; }
.schedule-calendar-head > button { flex-shrink: 0; }
.schedule-calendar-footer > b { overflow-wrap: anywhere; }
#todaySchedule { display: grid; gap: 12px; }
#modalBody > .card + .card { margin-top: 12px; }
#modalBody .card > .row { align-items: flex-start; }
:where(.card, .sheet, dialog) :where(img, video, audio, canvas) { max-width: 100%; }
:where(.client-file-meta, .quote-media-caption, .file-card, .client-file-link, .customer-file-card) { overflow-wrap: anywhere; }
:where(.file-card, .client-file-link) > span { min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; }
.proposal table, .ai-result table { table-layout: fixed; }
.proposal :where(th, td), .ai-result :where(th, td) { overflow-wrap: anywhere; }
@media (max-width: 650px) {
  .sheet { margin-top: 8px; }
  .sheethead h2 { font-size: 20px; }
  .modal { padding: 10px; }
  .sectionhead > .actions { width: 100%; }
  input, select, textarea { font-size: 16px; }
  .card > .row > div:first-child { flex-basis: 11rem; }
  .stat strong, .bigmoney, .big, .client-big { font-size: clamp(20px, 6vw, 29px); overflow-wrap: anywhere; }
  .proposal .total { font-size: clamp(22px, 7vw, 31px); overflow-wrap: anywhere; }
}
.line { min-width: 0; }
.line > * { min-width: 0; overflow-wrap: anywhere; }
.card { overflow-wrap: anywhere; }
.row:has(> .badge) { align-items: flex-start; }
@media (max-width: 650px) {
  .customer-card > .row > div:first-child { flex: 0 1 auto; }
}
@media (max-width: 550px) {
  body[data-app="employee"] .row > div:first-child { flex: 0 1 auto; }
}
@media (max-width: 650px) {
  body[data-app="client"] .profile-header-row > .portal-identity { flex: 1 0 100%; }
  .portal-identity > div { min-width: 0; }
  body[data-app="client"] .card > .row:has(> .badge) > div:first-child { flex: 1 0 100%; }
}

/* Owner-only W-9 preparation. */
.tax-check{display:flex;align-items:flex-start;gap:10px;line-height:1.45}
.tax-check input{width:auto;flex:none;margin:3px 0 0}
.tax-signature{display:block;width:100%;height:125px;border:1px dashed #aab2b7;border-radius:10px;background:#fff;touch-action:none;margin:10px 0}
.account-tools{flex-wrap:wrap}
.footerbar button{min-width:0}
#w9_share[hidden]{display:none}
