/* Shared controls use the selected theme; no customer document/print styling. */
:root { --ui-radius:12px; --ui-space:12px; --ui-text:var(--cream); --ui-muted:var(--home-muted); --ui-line:var(--home-border); }
.screen .field-label, .screen .crm-panel-title { color:var(--ui-text); }
.screen input::placeholder, .screen textarea::placeholder { opacity:1; }
.screen input:focus::placeholder, .screen textarea:focus::placeholder { color:#666; }
.ui-view-tabs { display:flex; gap:4px; padding:4px; border:1px solid var(--ui-line); border-radius:var(--ui-radius); background:var(--field-bg); }
.ui-view-tabs button { flex:1; min-width:0; min-height:44px; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--ui-muted); font:600 14px/1.2 'DM Sans',sans-serif; cursor:pointer; }
.ui-view-tabs button[aria-selected="true"] { background:var(--home-panel); color:var(--ui-text); box-shadow:inset 0 0 0 1px var(--ui-line); }
.ui-view-tabs button:focus-visible, .ui-section-jumps a:focus-visible { outline:2px solid var(--wheat); outline-offset:2px; }
.ui-status { color:var(--ui-muted); font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.ui-status[data-state="error"] { color:var(--ui-text); border-left:3px solid var(--rust); padding-left:10px; }
.ui-section-jumps { display:flex; flex-wrap:wrap; gap:4px; padding:8px 0; }
.ui-section-jumps a { display:flex; align-items:center; min-height:44px; padding:8px 12px; color:var(--cream); font:600 13px 'DM Sans',sans-serif; text-decoration:none; border:1px solid var(--home-border); border-radius:8px; }
.ui-section-jumps a:hover { background:var(--home-panel); }
@media (max-width:767px) {
  .screen input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .screen textarea, .screen select { font-size:16px!important; }
}
@media (min-width:1280px) {
  body { max-width:1680px; }
  .screen.active:not(#screenHome) { width:min(100%,1560px); }
  #screenHome { width:100%; max-width:1560px; }
  #appBottomNav.app-bottom-nav { max-width:1680px; }
}
@media (prefers-reduced-motion:reduce) {
  .ui-view-tabs *, .ui-section-jumps * { scroll-behavior:auto; transition:none; }
}

/* The legacy search field uses an important transparent background. Match its
   specificity so the shared white editing surface stays readable on iPhone. */
#screenCRMFull .crm-search-box:focus-within { background:#fff!important; }
#screenCRMFull .crm-search-box input:focus { background:#fff!important; color:#241a15!important; -webkit-text-fill-color:#241a15!important; }
#screenInventory #inv_search { width:100%; min-height:48px; box-sizing:border-box; padding:12px 14px; border:1px solid var(--home-border); border-radius:10px; background:var(--field-bg); color:var(--cream); font:16px 'DM Sans',sans-serif; }
#screenInventory #inv_search::placeholder { color:var(--home-muted); }
.ui-filter-disclosure > summary::after { content:'＋'; margin-left:auto; }
.ui-filter-disclosure[open] > summary::after { content:'−'; }
.ui-filter-disclosure { border:1px solid var(--home-border); border-radius:10px; padding:0 12px; background:var(--home-panel); }
.ui-filter-disclosure > summary { min-height:44px; display:flex; align-items:center; gap:6px; cursor:pointer; color:var(--cream); font-weight:600; }
.ui-filter-disclosure[open] { padding-bottom:12px; }
#screenInventory #inv_statusViews { overflow-x:auto; }
#screenInventory #inv_statusViews { display:flex; flex-wrap:wrap; }
#screenInventory #inv_statusViews button { flex:1 0 auto; min-height:44px; }
@media (min-width:900px) {
  #screenInventory .inv-toolbar { display:grid; grid-template-columns:minmax(280px,1.2fr) minmax(420px,1.8fr); align-items:start; }
  #screenInventory #inv_search { grid-column:1; }
  #screenInventory #inv_statusViews { grid-column:2; }
  #screenInventory .ui-filter-disclosure { grid-column:1; }
  #screenInventory .inv-pricing-refresh { grid-column:2; align-self:stretch; }
  #screenInventory .inv-section > .inv-list-stack { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; }
}
.calc-budget-action { display:block; min-height:44px; margin:8px 0; padding:10px 14px; border:1px solid var(--home-border); border-radius:9px; background:var(--home-panel); color:var(--cream); font:600 14px 'DM Sans',sans-serif; cursor:pointer; }
#screenCalc #revCalcTabSlot { display:none; }
#screenCalc [data-needs-price]:disabled { opacity:.45; cursor:default; }
.home-recent-more { position:relative; flex:0 0 auto; }
.home-recent-more summary { display:flex; align-items:center; list-style:none; cursor:pointer; min-height:44px; }
.home-recent-more summary::-webkit-details-marker { display:none; }
.home-recent-more > div { position:absolute; right:0; top:100%; z-index:30; min-width:170px; padding:6px; background:var(--home-panel); border:1px solid var(--home-border); border-radius:10px; box-shadow:0 8px 20px #0005; }
.home-recent-more button { display:block; width:100%; min-height:44px; border:0; padding:10px 12px; background:transparent; color:var(--cream); text-align:left; font:600 14px 'DM Sans',sans-serif; }
#screenHome .cc-hero-card { overflow:visible; }
#screenHome:has(.cc-home-pair:not(.gss-home-section-hidden)) .home-crm-trio > button:first-child { display:none; }
#screenHome:has(.cc-home-pair:not(.gss-home-section-hidden)) .home-crm-trio { grid-template-columns:repeat(2,minmax(0,1fr)); }
.screen input:is([type="text"],[type="search"],[type="email"],[type="tel"],[type="url"],[type="number"]):not(:focus), .screen textarea:not(:focus) { background:var(--field-bg)!important; color:var(--cream)!important; -webkit-text-fill-color:var(--cream); }
.screen input:not(:focus)::placeholder, .screen textarea:not(:focus)::placeholder { color:var(--home-muted)!important; -webkit-text-fill-color:var(--home-muted); opacity:1; }
.app-bottom-nav__btn { gap:5px; }
.app-bottom-nav__btn .ui-nav-label { font:600 12px/1.2 'DM Sans',sans-serif; letter-spacing:0; order:2; }
.app-bottom-nav__btn--back.has-text-label .ui-nav-label { display:none; }
#ssStepDots .ss-dot { width:auto; height:auto; flex:1; min-height:44px; border-radius:9px; padding:8px; font:600 14px/1.25 'DM Sans',sans-serif; }
#ssStepDots { padding-left:16px!important; padding-right:16px!important; }

/* Keep document sending explicit and reachable on touch screens. */
#screenDocs .docs-share-btn { min-width:44px; min-height:44px; width:auto; padding:8px; flex-shrink:0; color:var(--cream); font:600 14px/1.2 'DM Sans',sans-serif; }
#screenDocs .docs-row-info { min-width:0; }
#screenDocs .docs-row-name { overflow-wrap:anywhere; white-space:normal; }

@media(max-width:600px){
  #screenInventory #inv_statusViews { flex-wrap:nowrap; scrollbar-width:none; }
  #screenInventory #inv_statusViews::-webkit-scrollbar { display:none; }
  #screenInventory #inv_statusViews button { flex:0 0 auto; min-width:88px; }
  #screenInventory .inv-card-price-line { flex-wrap:wrap; font-size:12px; row-gap:0; }
  #screenInventory .inv-card-price-line strong { max-width:100%; margin-left:auto; }
  #screenInventory .inv-card-rto-line strong { white-space:normal; margin-left:0; }
  #screenInventory .inv-card-rto-tax { display:block; white-space:normal; }
  #screenInventory .inv-card-down-line { white-space:normal; }
}
#screenInventory :is(.inv-card-act-btn,.inv-card-menu-trigger,.inv-card-status-trigger,.inv-copy-serial-btn) { min-height:44px; }
.screen input:is([type="date"],[type="month"],[type="time"],[type="datetime-local"]), .screen select { min-height:44px; min-width:0; max-width:100%; }
#screenLotPagesHub #lotHubList { margin-bottom:18px; }
/* Keep timestamps readable inside the solid outgoing-message bubble. */
#screenCRMDetail .hl-message.outbound .hl-message-meta { color:rgba(255,255,255,.85); }
html[data-theme="light"] #screenCRMDetail .crm-compact-btn.danger { color:#8b3024; }

#screenHome .cc-home-pair { grid-template-columns:repeat(2,minmax(0,1fr)); }
#screenHome .cc-dash-card, #screenHome .cc-dash-card-hit, #screenHome .cc-hero-copy { min-width:0; }
#screenHome .cc-dash-card-head { flex-wrap:wrap; }
#screenHome .cc-dash-name { overflow-wrap:anywhere; }
#screenHome .cc-hero-when { line-height:1.4; }

#ssStepDots .ss-dot { color:var(--cream); background:var(--home-panel); border-color:var(--home-border); }
#ssStepDots .ss-dot.active { color:#fff; background:var(--accent-deep); border-color:var(--accent-deep); }
.screen .style-picker-trigger { background:var(--field-bg)!important; color:var(--cream); border-color:var(--home-border); }
.screen .page-sub, #screenSalesSheet .page-sub { color:var(--home-muted); }

#screenCaptureLinks #cap_recentSearch { width:100%; min-height:48px; box-sizing:border-box; padding:12px 14px; border:1px solid var(--home-border); border-radius:10px; font:16px 'DM Sans',sans-serif; }
#cbStart .cb-title { display:none; }
#cbStart .config-note { color:var(--home-muted)!important; }

/* Keep budget search beside the building selector on phone and desktop. */
#screenCalc .calc-building-row { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:10px; margin-bottom:14px; }
#screenCalc .calc-building-row .field-group { min-width:0; margin:0; }
#screenCalc .calc-building-row .style-picker-trigger { min-width:0; min-height:48px; }
#screenCalc .calc-building-row .spt-text { min-width:0; }
#screenCalc .calc-building-row .calc-budget-action { margin:0; min-height:48px; max-width:112px; padding:8px 10px; line-height:1.25; }
@media (min-width:600px) { #screenCalc .calc-building-row .calc-budget-action { max-width:none; } }
.selopt-edit-pop .owp-opt-tile,
.selopt-edit-pop .selopt-edit-btn,
.selopt-edit-pop .selopt-edit-qtybtn,
.selopt-edit-pop .selopt-edit-close { min-height:44px; }
.selopt-edit-pop .selopt-edit-qtybtn,
.selopt-edit-pop .selopt-edit-close { min-width:44px; }

/* Budget search shares the calculator navigation above its page overlay. */
body.rev-nav-active #appBottomNav.app-bottom-nav { z-index:10031; max-width:480px; }
