:root {
  --bs-primary:#062c79
}
body {
  background:#f6f8fc;
  color:#15243b
}
.card {
  border-top:4px solid #efbd19
}
.btn-primary {
  background:#062c79;
  border-color:#062c79
}
button,input {
  min-height:44px
}
#conversation {
  min-height:140px;
  max-height:55vh;
  overflow:auto
}
#conversation p {
  white-space:pre-wrap;
  overflow-wrap:anywhere
}
dt {
  font-weight:600
}
dd {
  font-variant-numeric:tabular-nums
}
textarea {
  scroll-margin-bottom:5rem
}
.brand-wordmark {
  display:block;
  width:min(100%,20rem);
  height:auto
}
header>a:first-child {
  max-width:100%
}
a:focus-visible {
  outline:3px solid #062c79;
  outline-offset:4px
}
.brand-lockup {
  display:flex;
  align-items:center;
  gap:clamp(.5rem,2.5vw,1.75rem);
  width:min(100%,42rem)
}
.brand-lockup .brand-home {
  min-width:0;
  flex:0 1 390px
}
.brand-lockup .brand-wordmark {
  width:100%
}
.brand-plus {
  flex:none;
  font-size:clamp(1.25rem,3vw,2rem);
  color:#062c79
}
.workshop-home {
  display:block;
  min-width:0;
  flex:0 1 220px
}
.workshop-wordmark {
  display:block;
  width:100%;
  height:auto
}
/* Workspace/phone interactions follow Travis's prototype page and PR43/PR50.
   Release identity, server-derived data and authenticated controls are retained. */
[hidden] {
  display:none!important
}
button:focus-visible,summary:focus-visible,[tabindex]:focus-visible {
  outline:3px solid #062c79;
  outline-offset:3px
}
summary {
  cursor:pointer
}
p {
  overflow-wrap:anywhere
}
.brand-lockup {
  width:min(100%,30rem)
}
header .brand-wordmark {
  max-height:64px
}
header .workshop-wordmark {
  max-height:64px;
  object-fit:contain
}
.demo-notice {
  padding:.5rem .75rem;
  border-left:4px solid #efbd19;
  background:#fff8e1;
  border-radius:.35rem;
  margin-bottom:.5rem;
  font-size:.85rem
}
.data-notice {
  font-size:.8rem;
  margin-bottom:.75rem
}
.data-notice p {
  max-width:70rem
}
.workspace-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem
}
.workspace-toolbar h2 {
  margin:.1rem 0
}
.eyebrow {
  font-size:.7rem;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#4b586d;
  font-weight:700;
  margin:0
}
#retention {
  font-size:.75rem;
  margin:0;
  color:#4b586d
}
.workspace-actions {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:.5rem
}
.workspace-actions select {
  max-width:18rem;
  font-size:.85rem
}
.bid-menu {
  position:relative;
  font-size:.85rem
}
.bid-menu summary {
  padding:.75rem
}
.bid-menu>div {
  position:absolute;
  right:0;
  z-index:5;
  background:white;
  padding:.75rem;
  box-shadow:0 4px 20px #15243b22;
  display:grid;
  gap:.5rem;
  min-width:11rem
}
.workspace-grid {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:1.25rem;
  align-items:start
}
.workspace-card {
  background:white;
  border:1px solid #d2d8e3;
  border-top:4px solid #efbd19;
  border-radius:.65rem;
  padding:1rem
}
.chat-panel {
  border-top-color:#062c79;
  padding:0;
  overflow:hidden
}
.chat-heading,.estimate-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:.75rem
}
.chat-heading {
  padding:.85rem 1rem;
  border-bottom:1px solid #e1e6ef
}
.chat-heading h2,.chat-heading p,.estimate-heading h2 {
  margin:0
}
.chat-heading p,.estimate-heading span {
  color:#546176
}
.chat-compose {
  padding:.75rem 1rem;
  border-top:1px solid #e1e6ef
}
.compose-row {
  display:flex;
  align-items:stretch;
  gap:.5rem
}
.compose-row textarea {
  min-width:0;
  resize:vertical;
  font-size:.9rem
}
.compose-row button {
  flex:none
}
#typing-help {
  font-size:.75rem;
  color:#546176;
  margin:.35rem 0
}
.input-options {
  font-size:.8rem
}
.input-options[open] {
  max-height:30vh;
  overflow:auto;
  padding-bottom:.5rem
}
.input-options button,.input-options input {
  margin:.4rem 0
}
.request-status {
  padding:0 1rem .65rem;
  font-size:.8rem
}
.request-status p {
  margin:.25rem 0
}
.request-status:has(p:empty) {
  padding-bottom:0
}
#conversation {
  display:flex;
  flex-direction:column;
  gap:.65rem;
  min-height:220px;
  max-height:52vh;
  overflow:auto;
  padding:1rem;
  background:#f6f8fc;
  scroll-padding:1rem
}
#conversation:empty:before {
  content:'Tell Sōl what you know about the job. Your saved figures stay beside the conversation.';
  font-size:.9rem;
  color:#546176;
  max-width:24rem
}
.user-message {
  align-self:flex-end;
  background:#062c79;
  color:white;
  border-radius:.75rem .75rem .15rem .75rem;
  padding:.6rem .8rem;
  max-width:90%;
  margin:0
}
.assistant-message {
  align-self:flex-start;
  max-width:100%;
  width:100%;
  background:#edf2fb;
  border-left:3px solid #efbd19;
  border-radius:.2rem .6rem .6rem .2rem;
  padding:.65rem .75rem;
  font-size:.9rem
}
.assistant-message p {
  margin:0 0 .4rem
}
.fact-card {
  border:1px solid #c9d3e6;
  border-left:3px solid #062c79;
  border-radius:.4rem;
  background:#fff;
  padding:.65rem .75rem
}
.fact-card h3 {
  font-size:.8rem;
  color:#40516d
}
.number-rows {
  margin:0
}
.number-rows>div {
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:1rem;
  padding:.25rem 0;
  border-top:1px solid #e6eaf1
}
.number-rows dt {
  font-weight:400;
  min-width:0;
  overflow-wrap:anywhere
}
.number-rows dd {
  text-align:right;
  font-weight:600;
  margin:0;
  flex-shrink:0;
  max-width:60%;
  overflow-wrap:anywhere
}
.decision-row {
  flex-wrap:wrap
}
.decision-row button {
  flex:1;
  min-width:6rem;
  font-size:.9rem
}
.assistant-message details {
  margin-top:.4rem
}
.estimate-figures {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:.65rem 1rem;
  margin:1rem 0
}
.estimate-figures dt {
  font-size:.75rem;
  color:#546176
}
.estimate-figures dd {
  font-size:1.05rem;
  margin:0;
  font-weight:600
}
.bid-health {
  display:flex;
  gap:.6rem;
  align-items:center;
  padding:.65rem .8rem;
  border-radius:.45rem;
  margin-top:.75rem;
  background:#edf2fb
}
.bid-health>span {
  font-size:1.3rem
}
.bid-health p {
  margin:0;
  font-size:.8rem
}
.bid-health[data-tone=OK] {
  background:#e6f4ed;
  color:#145c38
}
.bid-health[data-tone=THIN] {
  background:#fff3d6;
  color:#7a4200
}
.bid-health[data-tone=LOSS] {
  background:#fce8e8;
  color:#8e1b12
}
.suggestions {
  display:flex;
  flex-wrap:wrap;
  gap:.4rem;
  margin:.75rem 0
}
.suggestions button {
  font-size:.8rem;
  padding:.35rem .55rem
}
#bid-controls {
  border-top:1px solid #e1e6ef;
  padding-top:.75rem
}
#bid-controls legend {
  float:none;
  width:auto;
  font-size:.85rem;
  margin-bottom:.25rem
}
#bid-controls p {
  font-size:.75rem;
  margin-bottom:.4rem
}
#bid-controls label {
  font-size:.8rem;
  margin-bottom:0
}
#bid-controls input[type=range] {
  min-height:24px;
  height:24px
}
#bid-controls input[type=number] {
  display:block;
  max-width:12rem;
  min-height:36px;
  font-size:.85rem
}
.estimate-detail {
  border-top:1px solid #e1e6ef;
  padding-top:.7rem;
  font-size:.85rem
}
.filed-notes {
  list-style:none;
  padding:0;
  margin:0
}
.filed-notes li {
  border-top:1px solid #e1e6ef;
  padding:.6rem 0
}
.filed-notes p {
  margin:.25rem 0
}
.customer-copies {
  margin-top:1rem;
  font-size:.85rem
}
.customer-copies button {
  font-size:.85rem
}
.mobile-only,.mobile-summary {
  display:none
}
#chat-sheet {
  border:0;
  padding:0
}
#estimate-heading {
  scroll-margin-top:1rem
}
#workspace-status:empty {
  display:none
}
dialog::backdrop {
  background:#15243b88
}
#delete-dialog,#refresh-dialog {
  max-width:min(90vw,28rem);
  border:1px solid #c9d3e6;
  border-radius:.6rem;
  padding:1.25rem
}
@media(min-width:992px) {
  #chat-home {
    position:sticky;
    top:1rem
  }
  .estimate-card {
    scroll-margin-top:1rem
  }
}
@media(max-width:991.98px) {
  body:has(#workspace:not([hidden])) {
    padding-bottom:8rem
  }
  .workspace-grid {
    grid-template-columns:1fr
  }
  .workspace-toolbar {
    align-items:flex-start;
    flex-direction:column;
    gap:.5rem
  }
  .workspace-actions {
    width:100%;
    gap:.4rem
  }
  .workspace-actions select {
    flex:1;
    max-width:none;
    min-width:8rem;
    width:8rem
  }
  .workspace-actions button {
    font-size:.8rem
  }
  .bid-menu summary {
    padding:.5rem
  }
  #chat-home {
    display:none
  }
  .mobile-only {
    display:flex
  }
  .mobile-summary {
    display:flex;
    position:fixed;
    bottom:0;
    left:0;
    right:0;
    z-index:10;
    flex-direction:column;
    gap:.4rem;
    padding:.5rem .75rem max(.6rem,env(safe-area-inset-bottom));
    border-top:3px solid #efbd19;
    background:#fff;
    box-shadow:0 -3px 16px #15243b18
  }
  .summary-estimate {
    display:flex;
    justify-content:space-between;
    gap:.5rem;
    text-align:left;
    align-items:center;
    background:none;
    border:0;
    color:#062c79;
    font-size:.8rem
  }
  .summary-estimate span:last-child {
    font-weight:600;
    flex:none
  }
  .sheet-totals {
    justify-content:space-between;
    gap:.5rem;
    padding:.45rem .75rem;
    background:#edf2fb;
    font-size:.75rem
  }
  .sheet-totals strong {
    font-variant-numeric:tabular-nums
  }
  #chat-sheet[open] {
    position:fixed;
    inset:auto 0 0;
    margin:0;
    width:100%;
    max-width:none;
    height:calc(100dvh - 1rem);
    max-height:calc(100dvh - 1rem);
    border-radius:1rem 1rem 0 0;
    background:white;
    overflow:hidden
  }
  #chat-sheet .chat-panel {
    display:flex;
    flex-direction:column;
    height:100%;
    border:0;
    border-radius:0;
    /* The sheet owns its spacing; inherited workspace-card padding steals keyboard room. */
    padding:0;
    padding-bottom:env(safe-area-inset-bottom)
  }
  #chat-sheet #conversation {
    flex:1;
    min-height:0;
    max-height:none;
    padding:.75rem
  }
  #chat-sheet .chat-heading {
    flex:none;
    padding:.65rem .75rem
  }
  #chat-sheet .chat-compose {
    flex:none;
    padding:.5rem .75rem
  }
  #chat-sheet .request-status {
    flex:none;
    max-height:20vh;
    overflow:auto
  }
  #sheet-close {
    font-size:.8rem
  }
  .chat-sheet-open {
    overflow:hidden
  }
  .chat-sheet-open .mobile-summary {
    display:none
  }
  .brand-lockup {
    width:min(100%,25rem)
  }
  header {
    gap:.5rem!important
  }
  header .btn {
    font-size:.75rem;
    min-height:36px;
    padding:.4rem .6rem
  }
  .estimate-figures {
    gap:.6rem
  }
  .workspace-card {
    padding:.85rem
  }
  .number-rows {
    font-size:.85rem
  }
}
@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior:auto!important
  }
}

.chat-heading > div { min-width: 0; flex: 1; }
#chat-job { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phone chat and estimate screens, built to docs/design/phone-chat (approved Nov 8, 2026).
   Below 992px only: these elements stay hidden on a laptop. */
.photo-ready,.send-phone,.photo-note {
  display:none
}
@media(max-width:991.98px) {
  /* The photo field's privacy note isn't shown on phones, so the data notice carries it. */
  .photo-note {
    display:block
  }
  /* "You:" and "Sōl:" stay for screen readers only, as in the approved mockup. */
  #chat-sheet .speaker {
    position:absolute;
    width:1px;
    height:1px;
    margin:-1px;
    padding:0;
    overflow:hidden;
    clip:rect(0,0,0,0);
    white-space:nowrap;
    border:0
  }
  /* Chat: one full-height screen. Only the conversation scrolls. */
  #chat-sheet[open] {
    inset:0 0 auto;
    top:var(--sheet-top,0px);
    height:var(--sheet-height,100dvh);
    max-height:none;
    border-radius:0
  }
  /* iOS 26's ^ v ✓ bar is see-through and sits below Safari's layout viewport, where neither
     the backdrop nor the sheet is painted; Safari shows the scrolled page there instead. While
     the chat is open, hide the page (layout and scroll stay put) and leave plain white. */
  body.chat-sheet-open {
    background:#fff
  }
  body.chat-sheet-open>:not(#chat-sheet) {
    visibility:hidden
  }
  #chat-sheet::backdrop {
    background:#fff
  }
  #chat-sheet .chat-heading {
    padding:8px 12px
  }
  #chat-sheet #chat-heading {
    font-size:17px;
    font-weight:700
  }
  #chat-sheet #chat-job {
    font-size:12px;
    margin-top:1px
  }
  #chat-sheet #sheet-close {
    align-items:center;
    min-height:44px;
    padding:0 12px;
    border-radius:8px;
    font-size:14px;
    font-weight:600
  }
  #chat-sheet .sheet-totals {
    padding:7px 12px;
    font-size:13px;
    border-bottom:1px solid #e1e6ef
  }
  body:has(#bid-health[data-tone=OK]) #chat-sheet .sheet-totals [data-bid-value=margin] {
    color:#145c38
  }
  body:has(#bid-health[data-tone=THIN]) #chat-sheet .sheet-totals [data-bid-value=margin] {
    color:#7a4200
  }
  body:has(#bid-health[data-tone=LOSS]) #chat-sheet .sheet-totals [data-bid-value=margin] {
    color:#8e1b12
  }
  /* The newest message sits just above the message bar. */
  #chat-sheet #conversation {
    gap:10px;
    padding:12px
  }
  #chat-sheet #conversation>:first-child,#chat-sheet #conversation:empty:before {
    margin-top:auto
  }
  #chat-sheet .user-message {
    max-width:82%;
    border-radius:14px 14px 4px 14px;
    padding:9px 12px;
    font-size:15px;
    line-height:21px
  }
  #chat-sheet .assistant-message {
    background:#fff;
    border:1px solid #c9d3e6;
    border-radius:14px 14px 14px 4px;
    padding:10px 12px;
    margin-bottom:0!important;
    font-size:14px;
    line-height:20px
  }
  #chat-sheet .fact-card {
    border:0;
    padding:0
  }
  #chat-sheet .fact-card h3 {
    font-size:12px;
    font-weight:700;
    margin-bottom:6px
  }
  #chat-sheet .decision-row button {
    min-height:44px;
    border-radius:8px;
    font-size:14px;
    font-weight:600
  }
  #chat-sheet .assistant-message summary {
    min-height:24px;
    font-size:13px;
    color:#546176
  }
  #chat-sheet .request-status {
    order:1
  }
  /* One bottom row: camera, message, mic, Send. The tip and "Photo ready" sit above it. */
  #chat-sheet .chat-compose {
    order:2;
    display:flex;
    flex-direction:column;
    padding:0;
    border-top:0
  }
  #chat-sheet .compose-row {
    align-items:flex-end;
    gap:7px;
    padding:8px 10px;
    border-top:1px solid #e1e6ef;
    background:#fff
  }
  #chat-sheet #message {
    height:44px;
    min-height:44px;
    padding:10px 12px;
    border-radius:22px;
    border-color:#c9d3e6;
    background:#f6f8fc;
    font-size:16px;
    line-height:22px;
    resize:none
  }
  #chat-sheet #message::placeholder {
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis
  }
  .compose-icon {
    flex:none;
    align-items:center;
    justify-content:center;
    width:44px;
    height:44px;
    padding:0;
    border:1px solid #c9d3e6;
    border-radius:22px;
    background:#fff;
    color:#062c79
  }
  .compose-mic {
    border-color:#efbd19;
    background:#efbd19
  }
  .compose-icon:disabled { opacity:.5; cursor:not-allowed; }
  #chat-sheet #send {
    height:44px;
    padding:0 13px;
    border-radius:22px;
    font-size:15px;
    font-weight:700
  }
  .send-wide,#typing-help {
    display:none
  }
  .send-phone {
    display:inline
  }
  #chat-sheet .input-options {
    order:-2;
    max-height:none;
    overflow:visible;
    padding:0;
    font-size:13px
  }
  #chat-sheet .input-options>:not(#dictation-help) {
    display:none!important
  }
  #chat-sheet #dictation-help {
    margin:0;
    padding:8px 12px;
    background:#fff8e1;
    border-top:1px solid #efbd19;
    font-size:13px;
    line-height:18px
  }
  /* #64's sample notes (Travis, Nov 10): one row of chips above the bar that swipes sideways,
     hidden while the keyboard is open so the message bar stays on screen. */
  #chat-sheet #sample-notes {
    flex:none;
    padding:6px 12px 0
  }
  #chat-sheet[data-keyboard] #sample-notes {
    display:none
  }
  #chat-sheet #sample-notes h3 {
    margin:0 0 4px;
    font-size:13px;
    font-weight:600;
    color:#5b6576
  }
  #chat-sheet #sample-notes p {
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    overflow:hidden!important;
    clip:rect(0,0,0,0)!important;
    white-space:nowrap!important
  }
  #chat-sheet #samples {
    flex-wrap:nowrap!important;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scrollbar-width:none;
    padding-bottom:2px
  }
  #chat-sheet #samples button {
    flex:none;
    max-width:75%;
    min-height:44px;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
    border-radius:22px;
    font-size:14px
  }
  #chat-sheet .photo-ready:not([hidden]) {
    order:-1;
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 12px;
    background:#fff8e1;
    border-top:1px solid #efbd19;
    font-size:13px;
    line-height:18px
  }
  .photo-ready-icon {
    flex:none;
    display:flex;
    align-items:center;
    justify-content:center;
    width:48px;
    height:48px;
    border:1px solid #c9d3e6;
    border-radius:8px;
    background:#dde3ee;
    color:#40516d
  }
  .photo-ready>span:nth-child(2) {
    flex:1;
    min-width:0
  }
  #photo-ready-remove {
    flex:none;
    padding:0 10px;
    border:0;
    background:none;
    color:#062c79;
    font-size:14px;
    font-weight:600;
    text-decoration:underline
  }
  /* Estimate: one normally scrolling page with 44px controls and 16px fields. */
  .workspace-actions select,#bid-controls input[type=number],.customer-copies #document-kind,#manual-panel select,#manual-panel input:not([type=checkbox]):not([type=radio]) {
    min-height:44px;
    font-size:16px
  }
  .workspace-actions button,.bid-menu summary,.estimate-detail summary,.data-notice summary,#manual-panel>summary,header .btn {
    min-height:44px
  }
  header .btn {
    display:inline-flex;
    align-items:center
  }
  .bid-menu summary,.estimate-detail summary,.data-notice summary,#manual-panel>summary {
    display:flex;
    align-items:center
  }
  .bid-menu>div {
    position:static;
    box-shadow:none;
    padding:.5rem 0
  }
  .workspace-card {
    border-radius:10px;
    padding:14px
  }
  #estimate-heading {
    font-size:20px;
    font-weight:700
  }
  .estimate-figures dd {
    font-size:18px;
    font-weight:700
  }
  .suggestions button {
    min-height:44px;
    padding:0 12px;
    border-radius:8px;
    font-size:14px
  }
  #bid-controls label {
    font-size:14px
  }
  #bid-controls input[type=range] {
    height:44px;
    min-height:44px
  }
  #talk {
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:48px;
    border-radius:10px;
    font-size:16px;
    font-weight:700
  }
  .summary-estimate {
    font-size:13px
  }
}

/* Home Screen installation is a browser action, never an access grant. */
.phone-install { margin: 0 0 1rem; font-size: .875rem; }
.phone-install summary { min-height: 44px; display: list-item; align-content: center; cursor: pointer; font-weight: 600; }
.phone-install p { margin: .5rem 0; }
@media (display-mode: standalone) { .phone-install { display: none; } }

/* PDF consent/page range stays usable in the existing phone composer. */
@media(max-width:991.98px){
 #chat-sheet .input-options>#pdf-options:not([hidden]){display:block!important;padding:8px 12px;max-height:32dvh;overflow:auto;background:#f6f8fc;border-top:1px solid #c9d3e6}
 #pdf-options label{min-width:0;flex:1}
 #pdf-options p{margin-bottom:6px}
}
