:root,body,body[data-theme=blue],body[data-theme=sage],body[data-theme=sand]{color-scheme:light;--page:#f3f1ed;--surface:#fdfcf9;--stripe:#f7f5f1;--ink:#343932;--dim:#70746b;--muted:#70746b;--line:#e5e2db;--accent:#655944;--tint:#eae5da;--selected:#eae5da;--studio-good:#397055;--studio-warn:#8b6429;--studio-red:#ab4358;--soft-shadow:none;--deep-shadow:0 3px 12px #00000008}
body[data-theme=dark]{color-scheme:dark;--page:#1b1e21;--surface:#24282c;--stripe:#262a2e;--ink:#eeeae3;--dim:#a9ada9;--muted:#a9ada9;--line:#353a3d;--accent:#d1c0a5;--tint:#38352f;--selected:#38352f;--studio-good:#9bc5ab;--studio-warn:#d9bf8d;--studio-red:#ef9dad;--soft-shadow:none;--deep-shadow:0 3px 12px #00000020}
html{background:var(--page)}body{font-family:"Segoe UI",Arial,sans-serif}.panel,.table-wrap,.task-card{background:var(--surface);border:1px solid var(--line);border-radius:9px;box-shadow:none}button{border-radius:7px;box-shadow:none;transition:background .12s,color .12s}button:hover{box-shadow:none;background:var(--tint)}button.primary:hover{background:var(--accent);filter:brightness(1.06)}button.primary{color:var(--surface)}body[data-theme=dark] button.primary{color:var(--page)}input,select,textarea{border-color:var(--line);border-radius:7px;background:var(--surface)}input:focus,select:focus,textarea:focus{outline-color:var(--accent)}h2{font-size:22px;letter-spacing:-.4px}h3{font-size:14px}.notice,.notice.blue,body[data-theme=dark] .notice,body[data-theme=dark] .notice.blue{background:var(--tint);color:var(--ink);border-color:var(--line)}
body.workspace-ready header{min-height:72px;padding:12px 22px;gap:18px;grid-template-columns:260px minmax(170px,1fr) minmax(340px,auto);background:var(--surface)}body.workspace-ready .brand img{width:37px;height:37px;border-radius:7px;padding:3px}body.workspace-ready .brand h1{font-size:16px;letter-spacing:.3px}body.workspace-ready .brand p{font-size:9px;letter-spacing:1px;margin-top:3px}.header-search{background:var(--page);border:0;border-radius:7px}.header-search input{font-size:13px;padding:9px}.header-search span{font-size:20px}.workspace-ready #identity{font-size:12px}.workspace-ready #identity>span:not(.avatar){display:none}.workspace-ready #identity .avatar{width:29px;height:29px;min-width:29px}.workspace-ready #header-actions{width:auto;order:2;gap:7px}.workspace-ready .header-tools{order:1}.workspace-ready #header-actions button{font-size:11px;padding:6px 8px;border:0;background:transparent}.workspace-ready #auto-save-status{font-size:11px;color:var(--dim)}#theme-toggle{border:0;background:var(--tint);color:var(--ink);padding:7px 10px;font-size:12px}#notification-bell{border:0;background:transparent}#notification-bell>span{display:none}.notification-count{font-size:10px}.workspace-ready .header-right{gap:8px;flex-wrap:wrap}
@media(min-width:1101px){body.workspace-ready header{grid-template-columns:260px minmax(170px,1fr) minmax(340px,auto)}}
@media(min-width:761px){.workspace-ready main{padding:26px 25px 32px 218px!important}.workspace-ready .tabs,.workspace-ready .tabs:hover,.workspace-ready .tabs:has(button:focus-visible){width:190px!important;padding:22px 12px;background:var(--page);box-shadow:none;border-right:1px solid var(--line)}.workspace-ready .tabs button{min-height:43px;padding:9px 10px;border:0;border-radius:7px;font-size:12px;font-weight:500;gap:8px;color:var(--dim)}.workspace-ready .tabs .nav-label{opacity:1!important;max-width:none!important;margin-left:0!important;flex:1!important}.workspace-ready .tabs .nav-icon{background:transparent!important;box-shadow:none!important;border-radius:0;height:22px;flex-basis:20px;color:inherit}.workspace-ready .tabs .nav-icon svg{width:18px;height:18px}.workspace-ready .tabs button.active{background:var(--selected);color:var(--ink);box-shadow:none;border:0}.workspace-ready .tabs button:hover{background:var(--tint);border:0}.workspace-ready .tabs .nav-counter,.workspace-ready .tabs:hover .nav-counter{position:static;font-size:10px;background:var(--tint);color:var(--ink);margin-left:3px}.workspace-ready .tabs #message-badge,.workspace-ready .tabs:hover #message-badge{position:static;opacity:1;margin-left:3px}.studio-sidebar-footer{margin-top:auto;padding:25px 9px 5px;border-top:1px solid var(--line);font-size:12px;color:var(--ink)}.studio-sidebar-footer .avatar{width:29px;height:29px;min-width:29px}.studio-sidebar-footer .person{gap:9px}.studio-sidebar-footer small{display:block;font-size:11px;margin-top:3px;color:var(--dim)}}
.workspace-ready .filters{gap:9px;margin-bottom:5px}.workspace-ready .filters button,.workspace-ready .filters select{font-size:12px;padding:8px 11px}.workspace-ready .filters .check{font-size:12px}.table-wrap>table{border-collapse:separate;border-spacing:0}.table-wrap th{background:var(--stripe);color:var(--dim);font-size:11px;font-weight:500;padding:12px 15px;border-bottom:1px solid var(--line)}.project-row,.project-row.alternate{background:var(--surface)!important;border:0!important}.workspace-ready .project-row>td{padding:15px;border:0!important;border-bottom:1px solid var(--line)!important;font-size:12px;vertical-align:middle}.project-row:hover>td{background:var(--stripe)}.project-row.open>td{background:var(--selected)!important;border-top:0!important}.project-row.open>td:first-child,.project-row.open>td:last-child{border-left:0!important;border-right:0!important}.project-row .project-name{font-size:13px;line-height:1.5}.project-name small{font-size:11px;margin-top:4px}.drag-handle{font-size:19px;padding:0 6px;color:var(--dim)}.details>td{background:var(--stripe)!important;border:0!important;border-bottom:1px solid var(--line)!important}.details+.project-row>td{border-top:0!important}.detail-inner{padding:22px!important}.project-actions{min-width:140px;gap:3px}.project-actions .project-icon{width:30px;height:30px;flex-basis:30px;color:var(--dim)}.project-actions .project-icon:hover{color:var(--accent);background:var(--tint)}.project-actions .project-icon svg{width:16px;height:16px}.site-latest-note{font-size:12px;color:var(--accent)}
.project-row .badge,.hub-section-card .badge{background:transparent!important;padding:3px 0;font-size:11px;font-weight:400}.project-row .badge::before{content:"";display:inline-block;width:5px;height:5px;background:currentColor;border-radius:50%;margin:0 6px 1px 0}.badge.doing,body:not([data-theme=dark]) .badge.doing{color:var(--studio-warn)}.badge.done,body:not([data-theme=dark]) .badge.done{color:var(--studio-good)}.badge.waiting,body[data-theme=dark] .badge.waiting,body:not([data-theme=dark]) .badge.waiting{color:var(--dim)}.badge.urgent,body:not([data-theme=dark]) .badge.urgent{color:var(--studio-red)}
.section-card{background:var(--surface);border:1px solid var(--line);border-radius:8px;box-shadow:none;padding:15px}.section-card:hover{transform:none;background:var(--tint);box-shadow:none;border-color:var(--line)}.section-card.section-selected,.inline-section{background:var(--selected)!important;border:1px solid var(--line)!important;box-shadow:none}.section-card strong{font-size:13px}.section-card small{font-size:11px;line-height:1.6}.section-card.section-selected:after{display:none}.project-work-actions,.folderbar{gap:8px}.project-work-actions button,.folderbar button{font-size:12px;padding:8px 11px}.external-panel,.permit-panel,.new-document,.architecture-path,.fee-panel{background:var(--surface);border:1px solid var(--line);border-radius:9px}.fee-row{border:1px solid var(--line);border-left-width:2px}.activity-entry p{font-size:13px}.activity-entry small{font-size:11px}.document-entry,.image-widget{background:var(--surface);border-color:var(--line)}
.project-hub>.row{flex-wrap:wrap;gap:12px}.project-hub>.row h2{flex:1}.project-hub>.row button{font-size:12px;padding:8px 11px}.project-hub>.muted{font-size:12px}.subtabs button{font-size:12px;padding:8px 11px}.subtabs button.active{background:var(--tint);color:var(--ink);border-color:var(--line)}.hub-status{background:var(--surface);color:var(--ink);border:1px solid var(--line);padding:20px;border-radius:9px}.hub-status h3{font-size:20px;color:var(--ink)}.hub-eyebrow{font-size:11px;letter-spacing:.5px;color:var(--dim);opacity:1}.hub-status p{font-size:13px;color:var(--dim)}.hub-status small{color:var(--dim);opacity:1}.hub-urgent{background:transparent;border:0;color:var(--studio-red)}.hub-progress{border-left:1px solid var(--line);padding-left:20px}.hub-progress>strong{font-size:25px}.hub-progress strong span{font-size:16px}.hub-progress progress,.hub-progress progress::-webkit-progress-bar{background:var(--tint)}.hub-progress progress::-webkit-progress-value,.hub-progress progress::-moz-progress-bar{background:var(--studio-good)}.hub-section-card{border:1px solid var(--line);border-radius:8px;box-shadow:none}.hub-done,.hub-active{border-bottom:1px solid var(--line)}.hub-done .hub-section-dot{background:var(--studio-good)}.hub-active .hub-section-dot{background:var(--studio-warn)}.hub-box{border-radius:9px;padding:20px}.hub-overview{gap:18px}.hub-overview-columns{gap:18px}.hub-section-card small{font-size:11px}
.site-heading h2{font-size:22px}.site-heading p{font-size:12px}.site-toolbar label,.site-toolbar button{font-size:12px}.site-current{border-left:3px solid var(--studio-good);border-radius:9px;background:var(--surface);padding:20px}.site-current strong{font-size:17px}.site-current p{font-size:13px}.site-status{background:transparent;color:var(--dim);padding:3px 0;font-size:11px}.site-done{background:transparent;color:var(--studio-good)}.site-urgent{background:transparent;color:var(--studio-red)}.site-table,.site-box,.site-journal{border-radius:9px}.site-table td{font-size:13px}.site-stages button{background:var(--surface);border-color:var(--line)}
dialog:not(#image-viewer){border:1px solid var(--line);border-radius:12px;box-shadow:0 16px 50px #00000025;padding:24px}dialog::backdrop{background:#00000038}.form-grid{gap:16px}.field{font-size:12px;color:var(--dim)}.field input,.field select,.field textarea{font-size:13px;padding:10px 11px;background:var(--page)}.form-actions{gap:8px}.form-actions button{font-size:12px}.form-actions .muted{font-size:11px}.form-error{color:var(--studio-red)}
.chat,.contacts{border:1px solid var(--line);background:var(--surface);border-radius:9px;box-shadow:none}.chat .chat-head{background:var(--surface);border-bottom:1px solid var(--line)}.chat-head h3{font-size:14px}.chat .chat-log{background:var(--page)}.chat-log .bubble{background:var(--surface);color:var(--ink);box-shadow:0 1px 1px #00000008;border-radius:9px;padding:10px 13px}.chat-log .bubble.mine{background:var(--selected)}.bubble .text{font-size:13px;line-height:1.6}.chat .composer{background:var(--surface);border-top:1px solid var(--line)}.composer textarea{background:var(--page);border:1px solid var(--line)}.contacts button{border:0;border-radius:7px;background:transparent}.contacts button.selected{background:var(--selected);color:var(--ink)}.contact-preview{font-size:11px}.today-list,.task-cards .task-card{background:var(--surface);border-color:var(--line);border-radius:9px;box-shadow:none}.today-item:nth-child(even){background:var(--surface)}.today-copy strong{font-size:14px}.today-copy p{font-size:13px}.today-copy small{font-size:11px}
#toast{background:var(--surface);color:var(--ink);border:1px solid var(--line);box-shadow:0 4px 18px #00000014}#boot-cover{background:var(--page);color:var(--ink)}.boot-spinner{border-color:var(--line);border-top-color:var(--accent)}
@media(min-width:761px) and (max-width:1100px){body.workspace-ready header{grid-template-columns:240px minmax(0,1fr)}.workspace-ready .header-right{justify-content:flex-end}.header-search{grid-column:1/-1;grid-row:2}.workspace-ready .brand h1{font-size:15px}}
@media(max-width:760px){body.workspace-ready header{padding:12px;display:flex;flex-wrap:wrap;gap:12px}.workspace-ready .brand h1{font-size:15px}.workspace-ready .header-right{min-width:0;flex-basis:100%;display:flex;flex-wrap:wrap}.workspace-ready #header-actions{flex-wrap:wrap}.workspace-ready main{padding:16px!important}.workspace-ready .tabs{background:var(--page);padding:8px;gap:4px;box-shadow:none}.workspace-ready .tabs button{border:0;border-radius:7px;min-height:40px;font-size:12px;box-shadow:none}.workspace-ready .tabs button.active{background:var(--selected);color:var(--ink);box-shadow:none;border:0}.workspace-ready .tabs .nav-icon{background:none;box-shadow:none}.studio-sidebar-footer{display:none}.hub-progress{border-left:0;padding-left:0}.project-hub>.row h2{flex-basis:100%}.studio-sidebar-footer{display:none}}
@media print{html,body{background:white!important;color:black!important}.studio-sidebar-footer{display:none!important}.hub-status,.hub-box{background:white!important;color:black!important;border-color:#ddd!important}.hub-status h3,.hub-status p,.hub-status small{color:black!important}}

body .section-card .badge{background:transparent!important;padding:3px 0;font-size:11px}

.workspace-ready .studio-icon-button{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:6px!important;color:var(--dim)}.studio-icon-button:hover{background:var(--tint)!important;color:var(--ink)}.studio-profile-button{padding:0;border:0;background:transparent;border-radius:50%;display:inline-flex;align-items:center;justify-content:center}.studio-profile-button:hover{background:transparent}.workspace-ready .header-right{align-items:center;gap:10px}.workspace-ready #header-actions{align-items:center}.workspace-ready #auto-save-status[hidden]{display:none}.workspace-ready #auto-save-status[data-save-state=error],.workspace-ready #auto-save-status[data-save-state=conflict]{color:var(--studio-red);max-width:280px;white-space:normal;font-size:12px}.studio-more-filters{position:relative;align-self:center;font-size:12px}.studio-more-filters>summary{list-style:none;padding:8px 11px;border:1px solid var(--line);border-radius:7px;background:var(--surface);cursor:pointer}.studio-more-filters>summary::-webkit-details-marker{display:none}.studio-more-filters[open]>summary{background:var(--tint)}.studio-filter-options{position:absolute;right:0;top:calc(100% + 6px);z-index:55;width:240px;display:grid;gap:13px;padding:17px;background:var(--surface);border:1px solid var(--line);border-radius:9px;box-shadow:0 8px 24px #00000014}.studio-filter-options>label:not(.check){display:block;font-size:11px;color:var(--dim)}.studio-filter-options select{display:block;width:100%;margin-top:5px}.studio-filter-options .check{margin:0}.project-hub>.row .badge{background:transparent;color:var(--dim);font-size:12px;padding:0}.workspace-ready .filters [data-home-study]{background:transparent;border:1px solid var(--line)}.hub-section-card .hub-section-dot{background:var(--dim)}.hub-done .hub-section-dot{background:var(--studio-good)}.hub-active .hub-section-dot{background:var(--studio-warn)}.site-table button,.site-journal button{font-size:12px}.fee-panel,.external-panel{box-shadow:none}@media(max-width:760px){.studio-filter-options{right:auto;left:0;max-width:calc(100vw - 48px)}.workspace-ready #auto-save-status[data-save-state=error],.workspace-ready #auto-save-status[data-save-state=conflict]{max-width:240px}}

.studio-list-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:0 0 22px}.studio-list-heading h2{margin:0;font-size:22px;font-weight:500}.studio-list-heading p{margin:5px 0 0;font-size:12px;color:var(--dim)}.studio-list-actions{display:flex;gap:9px;align-items:center}.studio-list-actions>button{font-size:12px}.studio-category-tabs{display:flex;flex-wrap:wrap;gap:7px;align-items:center}.studio-category-tabs button{font-size:12px;padding:7px 10px;background:transparent;border:0;color:var(--dim)}.studio-category-tabs button[aria-pressed=true]{background:var(--surface);color:var(--ink)}.studio-category-tabs button:hover{background:var(--tint)}#category-filter[hidden]{display:none!important}.workspace-ready .filters [data-home-study]{border:0;color:var(--dim);padding:7px 10px}.workspace-ready .filters{align-items:center;margin-bottom:12px}.studio-more-filters{margin-left:auto}.studio-more-filters>summary{border:0;color:var(--dim);background:transparent}.workspace-ready header .brand p{letter-spacing:0;font-size:10px;text-transform:none}.workspace-ready header .brand h1{font-weight:500}.project-row .project-name{font-weight:500}.studio-sidebar-footer small:empty{display:none}@media(max-width:760px){.studio-list-heading{gap:12px;flex-wrap:wrap}.studio-list-heading h2{font-size:20px}}

#theme-toggle,.studio-list-actions .primary{display:inline-flex;align-items:center;gap:7px}.header-search>span{display:flex;align-items:center}.studio-list-actions .primary svg{width:15px;height:15px}
@media(max-width:760px){.workspace-ready .table-wrap:has(.project-row){overflow:visible}.workspace-ready .table-wrap:has(.project-row)>table{min-width:0;width:100%;display:block}.workspace-ready .table-wrap:has(.project-row) thead{display:none}.workspace-ready .table-wrap:has(.project-row) tbody{display:block}.workspace-ready .project-row{display:grid;grid-template-columns:minmax(0,1fr) auto;padding:15px;gap:9px;border-bottom:1px solid var(--line)!important}.workspace-ready .project-row>td{padding:0!important;border:0!important;min-width:0}.workspace-ready .project-row>td:first-child{display:none}.workspace-ready .project-row>td:nth-child(2){grid-column:1;grid-row:1}.workspace-ready .project-row>td:nth-child(3){grid-column:2;grid-row:1}.workspace-ready .project-row>td:nth-child(4){grid-column:1/-1;grid-row:2}.workspace-ready .project-row>td:last-child{grid-column:1/-1;grid-row:3}.workspace-ready .project-actions{justify-content:flex-start;min-width:0}.workspace-ready .details{display:block}.workspace-ready .details>td{display:block;width:auto}.workspace-ready .detail-inner{padding:15px!important}.workspace-ready .header-search{width:100%}.workspace-ready .studio-list-heading{align-items:center}.workspace-ready .studio-list-heading p{font-size:12px}}
@media(min-width:761px){.workspace-ready .table-wrap:has(.project-row)>table{min-width:0;width:100%;table-layout:fixed}.workspace-ready .table-wrap:has(.project-row) th:first-child{width:70px}.workspace-ready .table-wrap:has(.project-row) th:nth-child(3){width:155px}.workspace-ready .table-wrap:has(.project-row) th:last-child{width:155px}.workspace-ready .project-row>td{overflow-wrap:anywhere}.workspace-ready .project-row .project-name{min-width:0}}

.assistant-chat{max-width:1000px;margin:auto;display:flex;flex-direction:column;height:calc(100vh - var(--header-height,80px) - 90px);min-height:420px}.assistant-heading{display:flex;justify-content:space-between;gap:12px;align-items:center;padding-bottom:15px}.assistant-heading h2{margin:0}.assistant-heading p{font-size:12px;margin:6px 0}.assistant-heading button{font-size:12px}.assistant-conversation{flex:1;min-height:0;overflow:auto;padding:15px 4px;scrollbar-width:thin}.assistant-turn{display:flex;flex-direction:column;gap:12px;margin-bottom:22px}.assistant-user{align-self:flex-end;background:var(--selected);padding:12px 16px;border-radius:12px;max-width:75%;white-space:pre-wrap;overflow-wrap:anywhere}.assistant-reply{align-self:flex-start;max-width:90%;width:760px;font-size:13px;line-height:1.6}.assistant-reply>p{white-space:pre-wrap;margin:0 0 12px}.assistant-card{border:1px solid var(--line);border-radius:8px;padding:12px;display:flex;align-items:center;gap:12px;margin:8px 0;background:var(--surface)}.assistant-card>div:first-child{flex:1;min-width:0}.assistant-card small{display:block;color:var(--dim);white-space:pre-wrap;overflow-wrap:anywhere}.assistant-card button,.assistant-suggestions button{font-size:12px;font-weight:400;padding:7px 10px}.assistant-suggestions{display:flex;gap:7px;flex-wrap:wrap;margin:12px 0}.assistant-welcome{padding:35px 10px;color:var(--dim)}.assistant-welcome h3{font-size:20px;color:var(--ink)}.assistant-welcome small{line-height:1.8}.assistant-task-form{background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:16px}.assistant-task-form .form-grid{margin-bottom:15px}.assistant-task-form h3{margin-top:0}#assistant-find{display:flex;gap:10px;align-items:flex-end;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:10px}#assistant-find textarea{flex:1;min-height:44px;max-height:120px;resize:none;border:0;background:transparent}#assistant-find button{height:42px}@media(max-width:760px){.assistant-chat{height:70vh;min-height:420px}.assistant-heading{flex-wrap:wrap}.assistant-reply{max-width:100%;width:100%}.assistant-card{flex-wrap:wrap}.assistant-user{max-width:90%}.assistant-task-form .form-grid{grid-template-columns:1fr}}
main:has(>.notice) .assistant-chat{height:calc(100vh - var(--header-height,80px) - 160px)}@media(max-width:760px){main:has(>.notice) .assistant-chat{height:65vh}}
/* Web: show one readable pane at a time on a phone. */
@media(max-width:760px){
 body.chat-open .message-layout{display:flex;flex-direction:column;gap:0;min-width:0;grid-template-rows:none}
 body.chat-open .message-layout .contacts{display:block;flex:1;min-width:0;width:100%;overflow-x:hidden;overflow-y:auto;padding:12px}
 body.chat-open .contacts [data-act="contact"]{display:block;width:100%;min-width:0;max-width:100%;text-align:left}
 body.chat-open .chat-list-head{width:100%;min-width:0}
 body.chat-open .contacts .person{min-width:0;max-width:100%}
 body.chat-open .contact-preview{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 body.chat-open .message-layout .chat{display:none;flex:1;width:100%;min-width:0;min-height:0}
 body.chat-open.web-chat-selected .message-layout .contacts{display:none}
 body.chat-open.web-chat-selected .message-layout .chat{display:flex;flex-direction:column}
 body.chat-open .chat-head{flex-wrap:wrap;gap:6px;padding:10px}
 body.chat-open .chat-head h3{min-width:0;flex:1;font-size:14px}
 body.chat-open .chat-log{overflow-x:hidden}
 body.chat-open .composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
 .web-chat-back{display:block;min-width:44px;min-height:44px;padding:6px}
}
@media(min-width:761px){.web-chat-back{display:none}}
@media(max-width:760px){body.chat-open .contacts .chat-filters button{min-width:0;flex:1;width:auto}body.chat-open .contacts .chat-filters{width:100%;min-width:0}}
/* Phone conversation: reserve the screen for messages. */
@media(max-width:760px){
 body.chat-open.workspace-ready header{min-height:54px;padding:7px 12px;display:flex;align-items:center;justify-content:space-between;gap:8px}
 body.chat-open.workspace-ready header .header-search,body.chat-open.workspace-ready header .brand p,body.chat-open #web-notifications,body.chat-open #web-push-test,body.chat-open #header-actions{display:none!important}
 body.chat-open.workspace-ready header .brand{min-width:0;gap:7px}
 body.chat-open.workspace-ready header .brand img{width:28px;height:28px}
 body.chat-open.workspace-ready header .brand h1{font-size:12px;white-space:nowrap}
 body.chat-open.workspace-ready header .header-right{display:flex;flex-wrap:nowrap;gap:5px;min-width:0}
 body.chat-open #theme-toggle{padding:5px;font-size:11px;min-height:32px}
 body.chat-open #notification-bell{min-width:32px;min-height:32px;padding:5px}
 body.chat-open.workspace-ready main{padding:8px!important}
 body.chat-open .tabs{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;overflow-y:hidden;gap:3px;padding:4px 0;margin:0 0 8px;max-width:100%;min-height:44px}
 body.chat-open .tabs button{flex:0 0 auto;min-height:36px;padding:6px 8px;gap:4px;font-size:11px;white-space:nowrap}
 body.chat-open .tabs .nav-label{white-space:nowrap}
 body.chat-open .tabs .nav-icon{width:18px;height:18px;flex-basis:18px}
 body.chat-open .tabs .nav-icon svg{width:16px;height:16px}
 body.chat-open .chat .chat-head{position:relative;flex-wrap:nowrap;min-height:60px;padding:8px;gap:6px}
 body.chat-open .web-chat-back{font-size:0;min-width:32px;width:32px;min-height:36px;padding:4px;flex-shrink:0}
 body.chat-open .web-chat-back::before{content:'←';font-size:20px}
 body.chat-open .chat-head h3{font-size:13px;line-height:1.3;min-width:0;margin:0;overflow:hidden;flex:1}
 body.chat-open .chat-head h3 .avatar{width:26px;height:26px;min-width:26px;flex-shrink:0}
 body.chat-open .chat-head .person-presence{font-size:10px;max-width:105px;line-height:1.3;flex-shrink:1}
 body.chat-open .chat-head [data-clear-chat]{font-size:10px;max-width:46px;padding:3px;min-width:0;line-height:1.2;flex-shrink:0}
 body.chat-open .chat .chat-log{padding:10px}
 body.chat-open .chat .composer textarea{font-size:16px}
}
/* iPhone: full conversation surface and no focus zoom on the composer. */
@media(max-width:760px){
 body.chat-open.web-chat-selected.workspace-ready header,
 body.chat-open.web-chat-selected .tabs,
 body.chat-open.web-chat-selected #main>.toolbar,
 body.chat-open.web-chat-selected #update-notice{display:none!important}
 body.chat-open.web-chat-selected.workspace-ready main{padding:0!important;margin:0!important}
 body.chat-open.web-chat-selected .message-layout{margin:0;gap:0}
 body.chat-open.web-chat-selected .message-layout .chat{border-radius:0;border:0}
 body.chat-open.web-chat-selected .chat-head{padding-top:max(8px,env(safe-area-inset-top));min-height:52px}
 body.chat-open .chat .composer textarea,
 body.chat-open #message-form textarea,
 body.chat-open #message-form input{font-size:16px!important;line-height:22px}
 body.chat-open .chat .composer{padding-bottom:max(10px,env(safe-area-inset-bottom))}
}
@media(max-width:760px){
 body.chat-open.web-chat-selected{position:fixed;inset:0;overflow:hidden;width:100%;height:100%;overscroll-behavior:none}
 body.chat-open.web-chat-selected #main,body.chat-open.web-chat-selected #view{min-height:0;overflow:hidden}
 body.chat-open.web-chat-selected .message-layout{min-height:0!important;max-height:100dvh}
 body.chat-open.web-chat-selected .chat-log{overscroll-behavior:contain;overflow-anchor:none;-webkit-overflow-scrolling:touch}
}
/* Shared phone rhythm across all workspace screens. */
@media(max-width:760px){
 body.workspace-ready header{padding:8px 12px;min-height:60px;gap:8px;grid-template-columns:1fr auto}
 body.workspace-ready header .brand img{width:30px;height:30px}
 body.workspace-ready header .brand h1{font-size:13px;white-space:nowrap}
 body.workspace-ready header .brand p{display:none}
 body.workspace-ready .header-right{gap:5px;justify-content:flex-end}
 body.workspace-ready #theme-toggle,body.workspace-ready #web-notifications,body.workspace-ready #web-push-test{font-size:11px;padding:6px 8px;min-height:36px}
 body.workspace-ready #web-push-test{display:none!important}
 body.workspace-ready .header-search{grid-column:1/-1;width:100%;min-width:0}
 body.workspace-ready .header-search input{padding:8px;font-size:16px}
 body.workspace-ready main{padding:12px 10px!important}
 body.workspace-ready .tabs{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));flex-wrap:nowrap!important;gap:3px;margin:0 0 14px;padding:5px 0;max-width:100%}
 body.workspace-ready .tabs button{min-width:0;min-height:48px;padding:5px 2px;font-size:10px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px}
 body.workspace-ready .tabs .nav-label{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:0!important;opacity:1!important}
 body.workspace-ready .tabs .nav-icon{width:20px;height:20px;flex-basis:20px;background:transparent}
 body.workspace-ready .tabs .nav-icon svg{width:20px;height:20px}
 body.workspace-ready input:not([type=checkbox]):not([type=radio]),body.workspace-ready textarea,body.workspace-ready select{font-size:16px!important;max-width:100%;min-width:0}
 body.workspace-ready .form-grid,body.workspace-ready .settings-grid,body.workspace-ready .detail-lower{grid-template-columns:minmax(0,1fr)}
 body.workspace-ready .panel,body.workspace-ready .detail-inner{padding:14px!important}
 body.workspace-ready dialog{max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);overflow-y:auto;padding:16px}
 body.workspace-ready .form-actions{flex-wrap:wrap;gap:8px}
 body.workspace-ready .toolbar,.workspace-ready .row{min-width:0}
 body.chat-open.web-chat-selected{inset:auto!important;left:0!important;right:0!important;top:var(--phone-visible-top,0px)!important;height:var(--phone-visible-height,100dvh)!important}
 body.chat-open.web-chat-selected #main,body.chat-open.web-chat-selected #view{height:100%;max-height:100%;padding:0!important}
 body.chat-open.web-chat-selected .message-layout{height:100%!important;max-height:none!important;width:100%;overflow:hidden}
 body.chat-open.web-chat-selected .chat{height:100%;min-height:0;flex:1}
 body.chat-open.web-chat-selected .chat-log{min-height:0;flex:1}
 body.chat-open.web-chat-selected .chat-head,body.chat-open.web-chat-selected .composer{flex-shrink:0}
 body.chat-open.web-chat-selected .tabs{display:none!important}
}
@media(max-width:760px){
 body.chat-open.web-chat-selected #message-form{position:fixed!important;top:var(--phone-composer-top,auto);bottom:auto;left:0;right:0;width:100%;z-index:50;margin:0;border-radius:0;box-sizing:border-box;padding:8px 10px;min-height:60px;background:var(--surface)}
 body.chat-open.web-chat-selected .chat-log{padding-bottom:calc(var(--phone-composer-height,64px) + 12px)!important}
 body.chat-open.web-chat-selected #message-form textarea{display:block!important;visibility:visible!important;opacity:1!important;color:var(--ink)!important;-webkit-text-fill-color:var(--ink);font-size:16px!important;min-height:44px;max-height:110px}
 body.chat-open.web-chat-selected #message-form .send-message{display:grid!important;min-width:44px;min-height:44px}
}
@media(max-width:760px){
 body.chat-open.web-chat-selected .chat .chat-log{flex:none!important;height:calc(var(--phone-visible-height,100dvh) - var(--phone-chat-head-height,60px) - var(--phone-composer-height,64px))!important;min-height:0!important;max-height:none!important;padding-bottom:12px!important;overflow-y:auto}
}
