/* 2026-09-29 — mobile reliability pass v159 */
/* Let the complete mobile drawer scroll, including Settings, Help and Log out. */
@media(max-width:860px){
  body.shell-app #appShell>.sidebar{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important;
    overscroll-behavior-y:contain!important;
    max-height:100dvh!important;
    padding-bottom:max(34px,calc(env(safe-area-inset-bottom) + 22px))!important;
  }
  body.shell-app #appShell>.sidebar .nav-list{
    flex:0 0 auto!important;
    overflow:visible!important;
    min-height:max-content!important;
  }
  body.shell-app #appShell>.sidebar .sidebar-session-actions{
    flex:0 0 auto!important;
    position:static!important;
    padding-bottom:max(10px,env(safe-area-inset-bottom))!important;
  }
}

/* Make public URLs unmistakably tappable, not plain text. */
.link-box a{
  display:block!important;
  width:100%!important;
  padding:10px 12px!important;
  border:1px solid var(--line)!important;
  border-radius:11px!important;
  background:#F8F6F1!important;
  color:#145E9A!important;
  text-decoration:underline!important;
  text-decoration-thickness:1.5px!important;
  text-underline-offset:3px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
  pointer-events:auto!important;
}

/* Calendar must remain visible on phones even with zero jobs. */
@media(max-width:720px){
  [data-page="calendar"].active .calendar-panel{
    display:block!important;
    min-width:0!important;
  }
  [data-page="calendar"].active #calendarWeekRow.two-week-calendar{
    display:grid!important;
    grid-template-columns:repeat(7,minmax(64px,1fr))!important;
    gap:7px!important;
    min-height:190px!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    padding:2px 0 8px!important;
  }
  [data-page="calendar"].active #calendarWeekRow>[data-calendar-day]{
    display:flex!important;
    min-height:82px!important;
    visibility:visible!important;
    opacity:1!important;
  }
}

/* iOS: the modal X and Cancel controls always stay above form content. */
.modal{isolation:isolate!important}
.modal-close{
  z-index:20!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
}
.entity-form [data-modal-cancel]{
  pointer-events:auto!important;
  touch-action:manipulation!important;
}

/* Settings edit controls should remain tappable after iOS restores a PWA view. */
[data-edit-app-preferences],
[data-edit-payment-preferences],
#saveCustomerEmailLanguageBtn{
  pointer-events:auto!important;
  touch-action:manipulation!important;
}


/* 2026-09-29 — universal public request details */
.public-form-section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin:6px 0 0;
  padding:14px 2px 4px;
  border-top:1px solid rgba(25,25,25,.08);
}
.public-form-section-head>span{
  font-size:13px;
  font-weight:900;
  letter-spacing:-.01em;
}
.public-form-section-head>small{
  max-width:420px;
  color:var(--muted);
  font-size:9px;
  line-height:1.45;
  text-align:right;
}
.public-timezone-notice{
  margin-top:-3px;
  padding:9px 11px;
  border-radius:12px;
  background:#F2F6F8;
  color:#51616B;
  font-size:9px;
  font-weight:800;
  line-height:1.35;
}
.public-size-input{
  display:grid;
  grid-template-columns:minmax(0,1fr) 94px;
  gap:7px;
}
.public-size-input>input,
.public-size-input>select{
  width:100%;
}
.public-property-details{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  padding:12px;
  border-radius:16px;
  background:#FAF8F3;
  border:1px solid rgba(25,25,25,.07);
}
.public-property-details[hidden]{display:none!important}
.public-property-details label{margin:0}
.public-property-details input,
.public-property-details select{background:#fff}
.app-shell[data-palette-mode="night"] .public-property-details,
.app-shell[data-palette-mode="night"] .public-timezone-notice{
  background:rgba(255,255,255,.06)!important;
  color:rgba(255,255,255,.78)!important;
  border-color:rgba(255,255,255,.1)!important;
}

@media(max-width:680px){
  .public-form-section-head{
    display:grid;
    gap:4px;
    align-items:start;
    padding-top:12px;
  }
  .public-form-section-head>small{
    text-align:left;
    max-width:none;
  }
  .public-property-details{
    grid-template-columns:1fr 1fr;
    gap:8px;
    padding:10px;
  }
  .public-size-input{
    grid-template-columns:minmax(0,1fr) 82px;
  }
}
@media(max-width:430px){
  .public-property-details{grid-template-columns:1fr}
}


/* 2026-09-29 — stable invoice actions v160 */
@media(max-width:680px){
  [data-page="invoices"] .invoice-actions-stable{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:7px!important;
    width:100%!important;
    margin-top:7px!important;
    padding-top:8px!important;
    border-top:1px solid var(--line)!important;
  }
  [data-page="invoices"] .invoice-actions-stable .safe-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:7px!important;
    width:100%!important;
  }
  [data-page="invoices"] .invoice-actions-stable .safe-actions button{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    min-height:42px!important;
    padding:9px 8px!important;
    border-radius:12px!important;
    font-size:11px!important;
    line-height:1.15!important;
    white-space:normal!important;
    touch-action:manipulation!important;
    pointer-events:auto!important;
  }
  [data-page="invoices"] .invoice-actions-stable .record-delete-btn{
    display:block!important;
    width:100%!important;
    min-height:40px!important;
    padding:8px 10px!important;
    border-radius:12px!important;
    font-size:10px!important;
    touch-action:manipulation!important;
    pointer-events:auto!important;
  }
  [data-page="invoices"] .invoice-actions-stable .mobile-more-actions{
    display:none!important;
  }
}


/* 2026-09-29 — mobile settings + topbar cleanup v162 */
/* Put App Preferences first in Settings without changing the data flow. */
[data-page="settings"] .settings-app-preferences-card{
  order:-10;
}

/* Public link actions: remove the blank white mobile row and make Copy unmistakable. */
@media(max-width:520px){
  [data-page="booking"] .link-box{
    grid-template-columns:1fr!important;
    gap:8px!important;
  }
  [data-page="booking"] .link-box>a{
    grid-column:1!important;
    width:100%!important;
  }
  [data-page="booking"] .link-box button[data-open-public]{
    display:none!important;
  }
  [data-page="booking"] .link-box button[data-copy-target]{
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    grid-column:1!important;
    width:100%!important;
    min-height:46px!important;
    padding:10px 14px!important;
    background:var(--ink)!important;
    color:#fff!important;
    border-color:var(--ink)!important;
    border-radius:12px!important;
    font-size:12px!important;
    font-weight:900!important;
  }
}

/* Give the current page name priority on phones. */
@media(max-width:560px){
  body.shell-app .global-search-shell,
  body.shell-app #appRefreshBtn{
    display:none!important;
  }

  body.shell-app .topbar{
    gap:6px!important;
    align-items:center!important;
  }

  body.shell-app .topbar-title{
    flex:1 1 auto!important;
    min-width:0!important;
  }

  body.shell-app .topbar-title h1{
    margin:0!important;
    font-size:18px!important;
    line-height:1.08!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    max-height:2.2em!important;
  }

  body.shell-app .top-actions{
    flex:0 0 auto!important;
    gap:5px!important;
  }

  body.shell-app #quickAddBtn{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border-radius:50%!important;
    font-size:0!important;
    display:grid!important;
    place-items:center!important;
  }
  body.shell-app #quickAddBtn::before{
    content:"+";
    font-size:22px;
    line-height:1;
    font-weight:900;
  }

  body.shell-app #languageBtn,
  body.shell-app #notificationBellBtn{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
  }
}

@media(max-width:390px){
  body.shell-app .notification-shell{
    display:none!important;
  }
  body.shell-app .topbar-title h1{
    font-size:17px!important;
  }
}


/* 2026-09-29 — mobile header + booking link clarity v165 */
[data-page="settings"] .settings-app-preferences-card{order:-20!important}

.link-box{
  grid-template-columns:minmax(0,1fr) auto!important;
  align-items:center!important;
  gap:8px!important;
}
.link-box .link-copy-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:40px!important;
  padding:9px 13px!important;
  border:1px solid var(--ink)!important;
  border-radius:11px!important;
  background:var(--ink)!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:900!important;
  white-space:nowrap!important;
}
@media(max-width:680px){
  body.shell-app .global-search-shell,
  body.shell-app #appRefreshBtn,
  body.shell-app .notification-shell{
    display:none!important;
  }
  body.shell-app .topbar{
    display:grid!important;
    grid-template-columns:auto auto minmax(0,1fr) auto auto!important;
    gap:6px!important;
    align-items:center!important;
    padding-top:10px!important;
    padding-bottom:10px!important;
    margin-bottom:16px!important;
  }
  body.shell-app .topbar-title{
    min-width:0!important;
    width:100%!important;
  }
  body.shell-app .topbar-title .eyebrow{display:none!important}
  body.shell-app .topbar-title h1{
    margin:0!important;
    font-size:17px!important;
    line-height:1.05!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    max-height:2.2em!important;
  }
  body.shell-app #quickAddBtn{
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border-radius:50%!important;
    font-size:0!important;
    display:grid!important;
    place-items:center!important;
  }
  body.shell-app #quickAddBtn::before{
    content:"+";
    font-size:22px;
    line-height:1;
    font-weight:900;
  }
  body.shell-app #languageBtn{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
  }
  [data-page="booking"] .link-box{
    grid-template-columns:1fr!important;
  }
  [data-page="booking"] .link-box>a,
  [data-page="booking"] .link-box .link-copy-btn{
    grid-column:1!important;
    width:100%!important;
  }
  [data-page="booking"] .link-box .link-copy-btn{
    min-height:46px!important;
    font-size:12px!important;
  }
}


/* 2026-09-29 — simplified mobile topbar v169 */
@media(max-width:680px){
  body.shell-app .topbar{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto auto!important;
    gap:7px!important;
    align-items:center!important;
    padding:10px 0!important;
    margin-bottom:16px!important;
  }

  /* On a nested screen, Back replaces the hamburger. Never show both. */
  body.shell-app .topbar:has(#backBtn:not([hidden])) #menuToggle{
    display:none!important;
  }

  body.shell-app #menuToggle,
  body.shell-app #backBtn{
    grid-column:1!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    margin:0!important;
  }

  body.shell-app .topbar-title{
    grid-column:2!important;
    min-width:0!important;
    width:100%!important;
  }
  body.shell-app .topbar-title .eyebrow{display:none!important}
  body.shell-app .topbar-title h1{
    margin:0!important;
    font-size:19px!important;
    line-height:1.08!important;
    letter-spacing:-.035em!important;
    white-space:normal!important;
    overflow:visible!important;
    text-overflow:clip!important;
    display:-webkit-box!important;
    -webkit-box-orient:vertical!important;
    -webkit-line-clamp:2!important;
    max-height:2.2em!important;
  }

  body.shell-app .top-actions{
    display:contents!important;
  }

  /* Search and refresh are intentionally removed from the phone header.
     Refresh is automatic; search remains a desktop/tablet utility. */
  body.shell-app .global-search-shell,
  body.shell-app #appRefreshBtn,
  body.shell-app #languageBtn{
    display:none!important;
  }

  /* Keep only the two urgent actions: inquiries + add. */
  body.shell-app .notification-shell{
    display:block!important;
    grid-column:3!important;
    position:relative!important;
  }
  body.shell-app #notificationBellBtn{
    display:grid!important;
    place-items:center!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
  }
  body.shell-app #quickAddBtn{
    grid-column:4!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
    padding:0!important;
    border-radius:50%!important;
    font-size:0!important;
    display:grid!important;
    place-items:center!important;
  }
  body.shell-app #quickAddBtn::before{
    content:"+";
    font-size:22px;
    line-height:1;
    font-weight:900;
  }

  body.shell-app .notification-popover{
    position:fixed!important;
    top:74px!important;
    right:12px!important;
    left:12px!important;
    width:auto!important;
    max-width:none!important;
  }

  body.shell-app .sidebar-language-btn{
    display:grid!important;
    grid-template-columns:auto 1fr auto!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;
    text-align:left!important;
  }
  body.shell-app .sidebar-language-btn strong{
    font-size:10px!important;
    letter-spacing:.08em!important;
  }
}


/* 2026-09-29 audit fix v170 — keep critical mobile controls visible */
.moon-glow{
  position:absolute;
  width:150px;
  height:150px;
  right:-48px;
  top:-62px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(255,255,255,.42) 0%,rgba(226,225,255,.22) 38%,rgba(255,255,255,0) 72%);
  animation:tleMoonFloat 7s ease-in-out infinite;
}
@media(max-width:680px){
  body.shell-app .global-search-shell{display:none!important}
  body.shell-app #appRefreshBtn{display:inline-flex!important}
  body.shell-app .notification-shell{display:block!important}
}
@media(max-width:390px){
  body.shell-app #appRefreshBtn{display:inline-flex!important}
  body.shell-app .notification-shell{display:block!important}
  body.shell-app .top-actions{gap:3px!important}
  body.shell-app .top-tool-btn{
    width:32px!important;
    min-width:32px!important;
    height:32px!important;
    min-height:32px!important;
  }
}
@media(prefers-reduced-motion:reduce){
  .moon-glow{animation:none!important}
}


/* Email delivery alerts */
.notification-item.is-email-issue{
  border-left:4px solid #B45309;
  background:#FFF7ED;
}
.notification-item.is-email-issue .notification-dot{
  background:#B45309;
  box-shadow:0 0 0 4px rgba(180,83,9,.12);
}
.email-delivery-warning,
.client-email-warning{
  display:grid;
  gap:6px;
  padding:14px 16px;
  border:1px solid rgba(180,83,9,.28);
  border-left:4px solid #B45309;
  border-radius:14px;
  background:#FFF7ED;
  color:#191919;
}
.email-delivery-warning span,
.client-email-warning span{
  color:#6B5A45;
  line-height:1.45;
}
.client-email-warning{
  margin-bottom:14px;
}


/* 2026-09-29 — weather-aware mobile layout v175 */

/* Keep the phone header to one compact row and give the page name its own space. */
@media(max-width:680px){
  body.shell-app .topbar{
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr) auto auto auto!important;
    align-items:center!important;
    gap:6px!important;
    min-height:0!important;
    padding:8px 0!important;
    margin-bottom:10px!important;
  }
  body.shell-app .topbar:has(#backBtn:not([hidden])) #menuToggle{display:none!important}
  body.shell-app #menuToggle,
  body.shell-app #backBtn{
    grid-column:1!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    margin:0!important;
  }
  body.shell-app .topbar-title{
    grid-column:2!important;
    min-width:0!important;
    width:100%!important;
    padding-left:2px!important;
  }
  body.shell-app .topbar-title h1{
    margin:0!important;
    font-size:18px!important;
    line-height:1.05!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    max-height:none!important;
    display:block!important;
  }
  body.shell-app .top-actions{display:contents!important}
  body.shell-app .notification-shell{
    display:block!important;
    grid-column:3!important;
    position:relative!important;
  }
  body.shell-app #appRefreshBtn{
    display:grid!important;
    place-items:center!important;
    grid-column:4!important;
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
    padding:0!important;
  }
  body.shell-app #quickAddBtn{
    grid-column:5!important;
    width:38px!important;
    min-width:38px!important;
    height:38px!important;
    min-height:38px!important;
  }
  body.shell-app #notificationBellBtn{
    width:36px!important;
    min-width:36px!important;
    height:36px!important;
    min-height:36px!important;
  }

  /* Today: show useful content sooner instead of spending the first screen on the hero. */
  [data-page="today"] #todayHeroCard{
    padding:14px!important;
    margin-bottom:10px!important;
    border-radius:22px!important;
  }
  [data-page="today"] #todayHeroCard .hero-card-topline{
    margin:0 0 12px!important;
    align-items:center!important;
  }
  [data-page="today"] #todayHeroCard .today-clock{
    min-width:0!important;
    padding:7px 9px!important;
    border-radius:14px!important;
  }
  [data-page="today"] #todayHeroCard .today-clock-mark{display:none!important}
  [data-page="today"] #todayHeroCard .today-clock-copy strong{font-size:13px!important}
  [data-page="today"] #todayHeroCard .today-clock-copy small{font-size:9px!important}
  [data-page="today"] #todayHeroCard .hero-sky-badge{
    width:52px!important;
    min-width:52px!important;
    height:42px!important;
    margin:0!important;
  }
  [data-page="today"] #todayHeroCard .today-greeting-first{
    gap:5px!important;
    margin:0 0 11px!important;
  }
  [data-page="today"] #todayHeroCard #todayGreeting{
    font-size:clamp(31px,9.3vw,40px)!important;
    line-height:.94!important;
    letter-spacing:-.055em!important;
    margin:0!important;
  }
  [data-page="today"] #todayHeroCard #todayMomentCopy{
    font-size:12px!important;
    line-height:1.34!important;
    margin:0!important;
  }
  [data-page="today"] #todayHeroCard #todayHeroAction{
    min-height:44px!important;
    margin:0 0 10px!important;
    padding:0 14px!important;
    border-radius:14px!important;
    font-size:12px!important;
  }
  [data-page="today"] #todayHeroCard .hero-weather-compact{
    padding:10px 11px!important;
    border-radius:15px!important;
  }
  [data-page="today"] #todayHeroCard .hero-weather-compact .weather-temp-row>strong,
  [data-page="today"] #todayHeroCard .hero-weather-compact.weather-no-icon .weather-temp-row>strong{
    font-size:31px!important;
  }
  [data-page="today"] #todayHeroCard .hero-weather-compact .weather-condition-stack>span{font-size:11px!important}
  [data-page="today"] #todayHeroCard .hero-weather-compact .weather-condition-stack>small{font-size:9px!important}
  [data-page="today"] #todayHeroCard .hero-weather-alert{
    margin-top:8px!important;
    padding:9px 11px!important;
    border-radius:13px!important;
    font-size:10px!important;
  }

  /* Invoice summaries: keep currency values inside the cards on narrow phones. */
  [data-page="invoices"] .metric-grid.compact{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    overflow:visible!important;
  }
  [data-page="invoices"] .metric-grid.compact .metric-card{
    min-width:0!important;
    width:auto!important;
    min-height:84px!important;
    padding:10px 9px!important;
  }
  [data-page="invoices"] .metric-grid.compact .metric-card span{
    font-size:9px!important;
    line-height:1.05!important;
    min-height:19px!important;
  }
  [data-page="invoices"] .metric-grid.compact .metric-card strong{
    display:block!important;
    max-width:100%!important;
    font-size:clamp(16px,4.8vw,20px)!important;
    line-height:1!important;
    letter-spacing:-.045em!important;
    white-space:nowrap!important;
    overflow:hidden!important;
    text-overflow:clip!important;
    font-variant-numeric:tabular-nums!important;
  }

  /* Old and new invoices use the same safe mobile layout. */
  [data-page="invoices"] .invoice-growth-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    gap:10px 12px!important;
    padding:14px!important;
    overflow:hidden!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-primary,
  [data-page="invoices"] .invoice-growth-row>.record-field{
    min-width:0!important;
    width:100%!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-field{
    display:grid!important;
    grid-template-columns:1fr!important;
    align-content:start!important;
    gap:4px!important;
    padding:0!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-field::before{
    position:static!important;
    display:block!important;
    margin:0 0 2px!important;
    font-size:8px!important;
    line-height:1!important;
  }
  [data-page="invoices"] .invoice-growth-primary{grid-column:1!important}
  [data-page="invoices"] .invoice-client-field{grid-column:2!important}
  [data-page="invoices"] .invoice-total-field{grid-column:1!important}
  [data-page="invoices"] .invoice-status-field{grid-column:2!important}
  [data-page="invoices"] .invoice-growth-amount{
    font-size:clamp(22px,7vw,28px)!important;
    white-space:nowrap!important;
  }
  [data-page="invoices"] .invoice-total-field>strong{
    font-size:clamp(19px,5.8vw,24px)!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  [data-page="invoices"] .invoice-client-field>strong,
  [data-page="invoices"] .invoice-status-field>b,
  [data-page="invoices"] .invoice-status-field>small{
    line-height:1.25!important;
    overflow-wrap:anywhere!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-actions{
    grid-column:1/-1!important;
    min-width:0!important;
  }

  /* Client cards: neutral rather than purple, with delete always reachable. */
  [data-page="clients"] .client-card.client-card-compact{
    background:#FFFDF9!important;
    border-color:#DADFE3!important;
    box-shadow:0 8px 24px rgba(25,25,25,.035)!important;
  }
  [data-page="clients"] .client-card .client-avatar{background:#E4EEF6!important}
  [data-page="clients"] .client-business-snapshot>span{background:#F1F5F7!important}
  [data-page="clients"] .client-card-actions{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:7px!important;
    width:100%!important;
  }
  [data-page="clients"] .client-card-actions .safe-actions{
    display:contents!important;
  }
  [data-page="clients"] .client-card-actions .safe-actions button{
    display:none!important;
  }
  [data-page="clients"] .client-card-actions .safe-actions button[data-client-info],
  [data-page="clients"] .client-card-actions .safe-actions button[data-edit="client"]{
    display:block!important;
    min-height:38px!important;
    width:100%!important;
  }
  [data-page="clients"] .client-card-actions .record-delete-btn{
    display:block!important;
    grid-column:1/-1!important;
    width:100%!important;
    min-height:38px!important;
    margin:0!important;
  }
  [data-page="clients"] .client-card-actions .mobile-more-actions{display:none!important}
}

/* Weather controls the visual mood, not a fixed yellow card. */
#todayHeroCard[data-weather="rain"],
#todayHeroCard[data-weather="drizzle"]{
  background:linear-gradient(145deg,#DCE8F2 0%,#E8E6F2 55%,#D8E7ED 100%)!important;
}
#todayHeroCard[data-weather="storm"]{
  background:linear-gradient(145deg,#CBD6E2 0%,#D8D4E4 58%,#C7D3DD 100%)!important;
}
#todayHeroCard[data-weather="cloudy"],
#todayHeroCard[data-weather="fog"]{
  background:linear-gradient(145deg,#E7EBEE 0%,#EEEAF2 100%)!important;
}
#todayHeroCard[data-weather="snow"]{
  background:linear-gradient(145deg,#EDF5F8 0%,#E8EFF5 100%)!important;
}
#todayHeroCard[data-weather="rain"] #todayHeroAction,
#todayHeroCard[data-weather="drizzle"] #todayHeroAction,
#todayHeroCard[data-weather="storm"] #todayHeroAction,
#todayHeroCard[data-weather="cloudy"] #todayHeroAction,
#todayHeroCard[data-weather="fog"] #todayHeroAction,
#todayHeroCard[data-weather="snow"] #todayHeroAction{
  background:#273541!important;
  color:#fff!important;
  border-color:#273541!important;
}

.app-shell[data-weather-mood="rain"] .pulse-money,
.app-shell[data-weather-mood="drizzle"] .pulse-money,
.app-shell[data-weather-mood="storm"] .pulse-money,
.app-shell[data-weather-mood="cloudy"] .pulse-money,
.app-shell[data-weather-mood="fog"] .pulse-money{background:#E3ECF3!important}
.app-shell[data-weather-mood="rain"] .pulse-collected,
.app-shell[data-weather-mood="drizzle"] .pulse-collected,
.app-shell[data-weather-mood="storm"] .pulse-collected,
.app-shell[data-weather-mood="cloudy"] .pulse-collected,
.app-shell[data-weather-mood="fog"] .pulse-collected{background:#E4EFEC!important}
.app-shell[data-weather-mood="rain"] .pulse-jobs,
.app-shell[data-weather-mood="drizzle"] .pulse-jobs,
.app-shell[data-weather-mood="storm"] .pulse-jobs,
.app-shell[data-weather-mood="cloudy"] .pulse-jobs,
.app-shell[data-weather-mood="fog"] .pulse-jobs{background:#DCE8F2!important}
.app-shell[data-weather-mood="rain"] .pulse-clients,
.app-shell[data-weather-mood="drizzle"] .pulse-clients,
.app-shell[data-weather-mood="storm"] .pulse-clients,
.app-shell[data-weather-mood="cloudy"] .pulse-clients,
.app-shell[data-weather-mood="fog"] .pulse-clients{background:#E9E6F0!important}
.app-shell[data-weather-mood="snow"] .pulse-card{background:#EDF4F7!important}

/* Public booking: unavailable dates/times must be impossible to miss. */
.booking-availability-alert{
  display:flex;
  align-items:flex-start;
  gap:9px;
  width:100%;
  margin:7px 0 2px;
  padding:13px 14px;
  border:1px solid #D8A59B;
  border-left:5px solid #A84A3D;
  border-radius:14px;
  background:#FFF0EC;
  color:#6F2F28;
  font-size:13px;
  font-weight:900;
  line-height:1.35;
}
.booking-availability-alert::before{
  content:"!";
  display:grid;
  place-items:center;
  flex:0 0 22px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#A84A3D;
  color:#fff;
  font-size:12px;
  line-height:1;
}




/* 2026-09-29 — invoice phone stack v208 */
@media(max-width:680px){
  [data-page="invoices"] .invoice-growth-row{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:12px!important;
    padding:16px!important;
    overflow:hidden!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-primary,
  [data-page="invoices"] .invoice-growth-row>.record-field,
  [data-page="invoices"] .invoice-growth-row>.record-actions{
    grid-column:1!important;
    min-width:0!important;
    width:100%!important;
  }
  [data-page="invoices"] .invoice-growth-primary{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    align-items:end!important;
    column-gap:10px!important;
    row-gap:3px!important;
    padding-bottom:10px!important;
    border-bottom:1px solid var(--line)!important;
  }
  [data-page="invoices"] .invoice-growth-primary .invoice-number{
    grid-column:1/-1!important;
    font-size:10px!important;
  }
  [data-page="invoices"] .invoice-growth-primary .invoice-growth-amount{
    grid-column:1!important;
    font-size:30px!important;
    line-height:1!important;
    white-space:nowrap!important;
    overflow:visible!important;
    word-break:normal!important;
  }
  [data-page="invoices"] .invoice-growth-primary>small:last-child{
    grid-column:2!important;
    align-self:end!important;
    margin-bottom:2px!important;
    white-space:nowrap!important;
    font-size:10px!important;
    color:#6F6A62!important;
  }
  [data-page="invoices"] .invoice-client-field,
  [data-page="invoices"] .invoice-total-field,
  [data-page="invoices"] .invoice-status-field{
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:5px!important;
    padding:10px 0!important;
    border-bottom:1px solid var(--line)!important;
  }
  [data-page="invoices"] .invoice-growth-row>.record-field::before{
    position:static!important;
    display:block!important;
    margin:0!important;
    font-size:9px!important;
    line-height:1!important;
    letter-spacing:.14em!important;
  }
  [data-page="invoices"] .invoice-total-field>strong{
    font-size:25px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }
  [data-page="invoices"] .invoice-status-field :is(.status,.customer-open-status,.payment-choice-note,.dispute-alert){
    max-width:100%!important;
    width:max-content!important;
    overflow-wrap:anywhere!important;
  }
  [data-page="invoices"] .invoice-next-action{
    line-height:1.25!important;
  }
  [data-page="invoices"] .invoice-actions-stable{
    display:grid!important;
    grid-template-columns:1fr!important;
    gap:8px!important;
    margin-top:2px!important;
    padding-top:4px!important;
    border-top:0!important;
  }
  [data-page="invoices"] .invoice-actions-stable .safe-actions{
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:8px!important;
    width:100%!important;
  }
  [data-page="invoices"] .invoice-actions-stable .safe-actions button,
  [data-page="invoices"] .invoice-actions-stable .record-delete-btn{
    width:100%!important;
    min-width:0!important;
    min-height:46px!important;
    padding:10px 12px!important;
    border-radius:14px!important;
    font-size:12px!important;
    line-height:1.15!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  [data-page="invoices"] .invoice-actions-stable .record-delete-btn{
    margin-top:2px!important;
  }
}


/* 2026-09-29 — surface-aware mobile contrast + invoice flow v208 */
@media(max-width:680px){
  .app-shell [data-page="clients"] .client-card.client-card-compact,
  .app-shell :is([data-page="leads"],[data-page="invoices"],[data-page="mileage"],[data-page="time"]) .mobile-record-card,
  .app-shell [data-page="quotes"] .quote-growth-card{
    color:var(--tle-text-strong)!important;
    border-color:rgba(25,25,25,.12)!important;
    opacity:1!important;
  }
  .app-shell [data-page="clients"] .client-card.client-card-compact{background:var(--tle-surface-light)!important}
  .app-shell :is([data-page="leads"],[data-page="invoices"],[data-page="mileage"],[data-page="time"]) .mobile-record-card{background:var(--tle-surface-white)!important}
  .app-shell [data-page="quotes"] .quote-growth-card{background:#FCFBF8!important}

  .app-shell [data-page="clients"] :is(.client-card-identity strong,.client-business-snapshot b,.client-avatar),
  .app-shell :is([data-page="leads"],[data-page="invoices"],[data-page="mileage"],[data-page="time"]) .mobile-record-card :is(.record-primary>strong,.record-field),
  .app-shell [data-page="invoices"] .invoice-next-action,
  .app-shell [data-page="quotes"] :is(.quote-growth-customer strong,.quote-amount,.quote-next-step b){
    color:var(--tle-text-strong)!important;
  }
  .app-shell [data-page="clients"] :is(.client-card-identity span,.client-business-snapshot small,.client-location),
  .app-shell :is([data-page="leads"],[data-page="invoices"],[data-page="mileage"],[data-page="time"]) .mobile-record-card :is(.record-primary>small,.record-note),
  .app-shell [data-page="invoices"] .invoice-growth-row>.record-field>small:not(.customer-open-status):not(.payment-choice-note):not(.dispute-alert),
  .app-shell [data-page="quotes"] :is(.quote-growth-customer small,.quote-next-step span),
  .app-shell :is([data-page="leads"],[data-page="invoices"],[data-page="mileage"],[data-page="time"]) .mobile-record-card>.record-field::before{
    color:var(--tle-text-muted)!important;
  }

  .app-shell :is([data-page="mileage"],[data-page="time"]) .table-card>.empty-table{
    margin:8px!important;border-radius:16px!important;
    background:var(--tle-surface-white)!important;color:var(--tle-text-strong)!important;
  }
  .app-shell :is([data-page="mileage"],[data-page="time"]) .table-card>.empty-table span,
  .app-shell [data-page="today"] .next-move-panel :is(.eyebrow,p){color:var(--tle-text-muted)!important}
  .app-shell [data-page="today"] .next-move-panel{color:var(--tle-text-strong)!important}
}

/* Invoice phone layout: one readable flow, no narrow vertical action tabs. */
@media(max-width:430px){
  [data-page="invoices"] .invoice-growth-row{
    grid-template-columns:1fr!important;gap:12px!important;padding:16px!important;
  }
  [data-page="invoices"] .invoice-growth-row :is(.invoice-growth-primary,.invoice-client-field,.invoice-total-field,.invoice-status-field){
    grid-column:1!important;width:100%!important;
  }
  [data-page="invoices"] .invoice-growth-primary{
    display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;
    align-items:end!important;column-gap:10px!important;
  }
  [data-page="invoices"] .invoice-growth-primary .invoice-number{grid-column:1/-1!important}
  [data-page="invoices"] .invoice-growth-primary .invoice-growth-amount{
    grid-column:1!important;font-size:clamp(26px,8vw,34px)!important;white-space:nowrap!important;
  }
  [data-page="invoices"] .invoice-growth-primary>small:last-child{
    grid-column:2!important;align-self:end!important;padding-bottom:3px!important;white-space:nowrap!important;
  }
  [data-page="invoices"] :is(.invoice-client-field,.invoice-total-field,.invoice-status-field){
    padding-top:10px!important;border-top:1px solid rgba(25,25,25,.10)!important;
  }
  [data-page="invoices"] .invoice-status-field{gap:7px!important}
  [data-page="invoices"] .invoice-actions-stable .safe-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  [data-page="invoices"] .invoice-actions-stable .safe-actions button,
  [data-page="invoices"] .invoice-actions-stable .record-delete-btn{
    min-height:46px!important;font-size:12px!important;
  }
}
