/* Software workspace: stable project rail, conversation, explicit tool dialogs. */
#billing-content h3{font-size:16px;font-weight:600;margin:24px 0 12px}
#billing-content p{line-height:1.55}
.billing-balance{font-size:28px;font-weight:600;margin:4px 0 16px;font-variant-numeric:tabular-nums}
.billing-totals{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;margin:16px 0;font-size:14px}
.billing-totals dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}
.billing-details{border-top:1px solid var(--line);padding:12px 0}
.billing-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-size:16px}
.billing-details summary::before{content:'+';width:24px;flex-shrink:0}
.billing-details[open] summary::before{content:'−'}
.billing-history,.billing-lots{list-style:none;padding:0;margin:12px 0}
.billing-history li{display:flex;flex-direction:column;gap:4px;padding:12px 0;border-top:1px solid var(--line);font-size:14px}
.billing-history time{color:var(--muted);font-size:13px}
.billing-lots li{margin:12px 0;font-size:14px}
.billing-plan-row{display:grid;grid-template-columns:1fr auto;gap:8px;padding:16px 0;border-bottom:1px solid var(--line);font-size:16px}
.billing-plan-row p{grid-column:1/-1;margin:0;font-size:14px}
body[data-page="workspace"]{--ink:#20252c;--muted:#616975;--line:#e5e7eb;--action-gradient:#355acb;background:#fff;height:100dvh;overflow:hidden}
.chat-shell{display:grid;grid-template-columns:256px minmax(0,1fr);height:100dvh}
.project-sidebar{display:flex;flex-direction:column;min-height:0;gap:24px;padding:24px 16px 16px;background:#f7f8fa;border-right:1px solid var(--line)}
.sidebar-brand{display:flex;align-items:center;justify-content:space-between;padding:0 8px}.sidebar-brand .brand{font-size:21px;gap:8px}
.new-project{width:100%;justify-content:flex-start;background:#fff!important;gap:12px!important}.sidebar-heading{font-size:13px;font-weight:500;color:var(--muted);margin:0 12px -12px;display:flex;justify-content:space-between}
.chat-project-list{overflow:auto;min-height:0;flex:1;scrollbar-gutter:stable}.chat-project-list>p{font-size:14px;padding:0 12px;color:var(--muted)}
.chat-project{display:block;width:100%;border:0;border-radius:8px;text-align:left;background:transparent;padding:12px;margin-bottom:4px;color:var(--ink);transition:background .15s}
.chat-project:hover{background:#eceef2}.chat-project[aria-current="page"]{background:#e8ecf4}.chat-project strong{display:block;font-size:14px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-project small{display:block;color:var(--muted);font-size:13px;margin-top:4px}
.sidebar-account{border-top:1px solid var(--line);padding:16px 8px 0;display:grid;grid-template-columns:1fr auto;align-items:center;font-size:14px}.sidebar-account .text-button{padding:0}.sidebar-account p{grid-column:1/-1;font-size:13px;color:var(--muted);margin:8px 0 0}
.chat-main{min-width:0;min-height:0;display:flex;flex-direction:column;background:#fff}.chat-header{display:flex;align-items:center;gap:16px;padding:16px 32px;border-bottom:1px solid var(--line);min-height:88px;flex-shrink:0}.chat-heading{min-width:0;flex:1}.chat-heading h1{font-size:17px;font-weight:600;letter-spacing:-.3px;line-height:1.4;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chat-heading p{font-size:13px;line-height:1.5;color:var(--muted);margin:4px 0 0}
.chat-tools{display:flex;gap:8px;align-items:center}.tool-button,.icon-button{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);height:40px;font-size:13px;padding:0 12px;gap:8px;white-space:nowrap;transition:background .15s,transform .15s}.icon-button{width:40px;padding:0;font-size:23px}.tool-button:hover:not(:disabled):not([aria-disabled="true"]),.icon-button:hover:not(:disabled){background:#f2f4f8;transform:translateY(-1px)}.tool-button:active,.icon-button:active{transform:translateY(1px)}.tool-button[aria-disabled="true"],.tool-button:disabled,.icon-button:disabled{opacity:.45;cursor:default}
.chat-content{position:relative;flex:1;min-height:0}.chat-scroll{height:100%;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-anchor:none}.chat-thread{max-width:800px;padding:32px 32px 48px;margin:auto}.chat-welcome{height:100%;min-height:220px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;text-align:center}.chat-welcome h2{font-size:28px;letter-spacing:-.8px;font-weight:550;line-height:1.3;margin:24px 0 12px}.chat-welcome p{font-size:16px;color:var(--muted);line-height:1.7;margin:0}.chat-loading{padding:48px;text-align:center;color:var(--muted)}
.chat-entry{margin-bottom:36px;min-width:0;overflow-wrap:anywhere}.chat-entry:last-child{margin-bottom:0}.message-label{font-size:13px;font-weight:600;margin:0 0 8px;color:var(--muted)}.message-user{background:#f2f4f8;padding:16px 20px;border-radius:16px 16px 4px 16px;margin:0 0 24px 48px;white-space:pre-wrap;font-size:16px;line-height:1.7}.message-answer{white-space:pre-wrap;font-size:16px;line-height:1.75;margin:0 0 12px}.message-meta{font-size:13px;color:var(--muted);margin-top:12px;display:block}.chat-proposal{border-left:2px solid #c6d1ee;padding:0 0 0 20px;margin:20px 0}.chat-proposal summary{font-weight:550;font-size:14px;cursor:pointer}.chat-proposal p{white-space:pre-wrap;margin:12px 0;font-size:15px;line-height:1.7}.chat-proposal .button{margin-top:8px;height:auto;min-height:44px;white-space:normal;text-align:left;font-size:14px}
.job-result{padding:16px 20px;border:1px solid var(--line);border-radius:12px;margin-top:16px;background:#fbfcfd}.job-result[data-status="failed"]{border-color:#e6cccd;background:#fffafa}.job-result h3{font-size:14px;font-weight:550;line-height:1.6;margin:0}.job-result p{font-size:14px;line-height:1.7;margin:8px 0 0;white-space:pre-wrap}.job-result p:empty{display:none}.job-result .text-button{font-size:13px;padding:8px 0 0}.job-log{margin-top:8px;font-size:13px;color:var(--muted)}.job-log summary{cursor:pointer;width:fit-content}.job-log ol{padding-left:20px;margin:12px 0 0}.job-log li{padding:4px 0;white-space:pre-wrap}.job-log time{display:block;font-size:12px}.job-log .form-error{font-size:13px}.initial-action{margin:16px 0}.initial-action p{font-size:14px;color:var(--muted);line-height:1.7;margin:12px 0}.initial-action .button{white-space:normal;height:auto;min-height:44px}
.new-messages{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);border:1px solid var(--line);border-radius:24px;padding:8px 16px;background:#fff;box-shadow:0 4px 20px #20252c12;font-size:13px;color:var(--ink);white-space:nowrap}.older-messages{display:block;margin:0 auto 24px;font-size:14px}
.chat-compose-area{flex-shrink:0;width:min(800px,100%);margin:0 auto;padding:0 32px max(16px,env(safe-area-inset-bottom))}.chat-compose-area>.form-error{margin:0 0 12px;max-height:100px;overflow:auto;font-size:14px}.chat-composer{border:1px solid #d9dee7;border-radius:16px;padding:12px 16px;background:#fff;box-shadow:0 4px 20px #20252c05}.chat-composer:focus-within{border-color:#98abdc;box-shadow:0 0 0 3px #355acb0a}.chat-composer textarea{border:0;border-radius:0;resize:none;outline:0;padding:4px 0;width:100%;height:64px;max-height:160px;min-height:52px;line-height:1.65;background:transparent;box-shadow:none;font-size:16px}.chat-composer input{border:0;border-bottom:1px solid var(--line);border-radius:0;height:40px;padding:0 0 8px;margin:0 0 8px;font-size:14px;background:transparent;box-shadow:none}.chat-compose-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:4px}.chat-compose-actions>span{font-size:13px;color:var(--muted)}.send-button{width:36px;height:36px;border:0;border-radius:10px;background:#355acb;color:#fff;font-size:24px;flex-shrink:0;transition:transform .15s,background .15s}.send-button:hover:not(:disabled){background:#2748aa;transform:translateY(-1px)}.send-button:active{transform:translateY(1px)}.send-button:disabled{background:#e7eaf0;color:#697487;opacity:1;cursor:default}.composer-status{min-height:36px;line-height:1.5;margin:8px 0 0;font-size:12px;color:var(--muted);text-align:center}
.workspace-dialog{color:var(--ink);width:min(480px,calc(100% - 32px));max-height:calc(100dvh - 32px);border:1px solid var(--line);border-radius:16px;padding:24px;overflow:auto}.workspace-dialog::backdrop,.projects-dialog::backdrop{background:#20252c55}.panel-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:24px}.panel-header h2{font-size:22px;font-weight:550;letter-spacing:-.5px;margin:0}.panel-copy{color:var(--muted);font-size:15px;line-height:1.7}.workspace-dialog form .button{margin-top:16px}.workspace-dialog p{overflow-wrap:anywhere}.settings-section{border-top:1px solid var(--line);padding-top:20px;margin-top:24px}.settings-section h3{font-size:15px;margin:0 0 12px;font-weight:600}.settings-section p{font-size:14px;line-height:1.7;margin:8px 0}.settings-section ol{padding-left:20px;font-size:14px}.settings-section li{padding:8px 0}.settings-section li small{display:block;color:var(--muted)}.project-description summary{font-size:15px;cursor:pointer}.project-description p{white-space:pre-wrap;font-size:14px;line-height:1.7}
.mobile-only{display:none}.projects-dialog{padding:0;margin:0;height:100dvh;max-height:100dvh;width:min(320px,86vw);max-width:86vw;border:0;background:#f7f8fa}.projects-dialog .project-sidebar{height:100%;border:0}.chat-shell .button.primary,.workspace-dialog .button.primary{background:#355acb!important;box-shadow:none!important}.chat-shell .button.primary:hover,.workspace-dialog .button.primary:hover{background:#2748aa!important}
@media(max-width:1023px){.chat-shell{grid-template-columns:224px minmax(0,1fr)}.chat-header{padding:16px 24px;gap:12px}.chat-thread{padding:24px 24px 40px}.chat-compose-area{padding-inline:24px}.chat-tools{gap:4px}.tool-button{padding-inline:10px}.chat-heading h1{font-size:16px}}
@media(max-width:767px){.chat-shell{grid-template-columns:minmax(0,1fr)}.mobile-only{display:inline-flex}.chat-header{padding:12px 16px;gap:12px;min-height:108px;flex-wrap:wrap}.chat-heading{flex-basis:calc(100% - 52px)}.chat-tools{width:100%;justify-content:flex-end;gap:8px}.chat-tools #open-preview{margin-right:auto}.chat-header>.icon-button{align-self:flex-start}.chat-thread{padding:24px 16px 32px}.chat-compose-area{padding:0 16px max(12px,env(safe-area-inset-bottom))}.message-user{margin-left:24px;padding:12px 16px}.chat-welcome h2{font-size:25px}.chat-welcome p{font-size:15px}.chat-composer{padding:12px}.chat-compose-actions>span{font-size:12px}.composer-status{font-size:12px;min-height:54px}.workspace-dialog{padding:20px}.chat-entry{margin-bottom:28px}.job-result{padding:12px 16px}}
@media(max-height:600px){.chat-welcome{min-height:140px;padding:16px}.chat-welcome img{display:none}.chat-welcome h2{margin:0 0 8px;font-size:22px}.chat-welcome p{font-size:14px}.composer-status{margin-top:4px}.chat-composer textarea{height:52px}.chat-header{padding-block:8px}}

/* The composer supplies the focus ring; the name field keeps a quiet underline. */
.chat-composer input:focus{outline:0;border-bottom-color:var(--composer-focus,#355acb)}
@media(forced-colors:active){.chat-composer input:focus{outline:2px solid Highlight;outline-offset:2px}}

/* Stable chat status; reduced-motion users keep a static three-dot indicator. */
.typing-indicator{display:flex;align-items:center;gap:5px;min-height:28px;padding:8px 0 12px;color:var(--muted)}
.typing-dot{width:6px;height:6px;border-radius:50%;background:currentColor;animation:chat-typing 1.2s ease-in-out infinite}
.typing-dot:nth-of-type(3){animation-delay:.15s}.typing-dot:nth-of-type(4){animation-delay:.3s}
@keyframes chat-typing{0%,60%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-3px);opacity:1}}
@media(prefers-reduced-motion:reduce){.typing-dot{animation:none;opacity:.7}}

/* Environment controls share the workspace's existing dialog and button system. */
.configuration-dialog{width:min(640px,calc(100% - 32px))}.configuration-row{min-width:0;margin:16px 0;padding:16px;border:1px solid var(--line);border-radius:12px;display:grid;grid-template-columns:1fr 1fr;gap:12px}.configuration-row legend{font-size:13px;color:var(--muted);padding:0 4px}.configuration-row label{min-width:0;font-size:13px}.configuration-row input:not([type=checkbox]){width:100%;margin:6px 0 0;min-width:0}.configuration-row .config-secret-label{display:flex;align-items:center;gap:8px;margin:0}.config-secret-label input{width:16px;height:16px;margin:0}.configuration-row>.text-button{justify-self:end}.settings-section select,#configuration-environment{width:100%;margin:8px 0 16px;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:8px;background:var(--theme-surface,#fff);color:var(--ink)}
@media(max-width:767px){.chat-tools{flex-wrap:wrap}.configuration-row{grid-template-columns:1fr;padding:12px}.configuration-row>.text-button{justify-self:start}.configuration-dialog .dialog-actions{flex-wrap:wrap}.configuration-dialog .dialog-actions .button{flex:1;white-space:nowrap}}

/* Markdown stays inside the existing conversation width, including long code. */
.chat-markdown{white-space:normal;overflow-wrap:anywhere;min-width:0}
.chat-markdown p{margin:0 0 .8em;white-space:normal;font-size:inherit;line-height:inherit}
.chat-markdown>:last-child{margin-bottom:0}
.chat-markdown strong{font-weight:700}
.chat-markdown :is(h3,h4,h5,h6){font-size:1.05em;line-height:1.5;font-weight:700;margin:1.2em 0 .5em;letter-spacing:normal}
.chat-markdown>:first-child{margin-top:0}
.chat-markdown :is(ul,ol){margin:.6em 0 1em;padding-left:1.5em}
.chat-markdown li{margin:.35em 0;padding-left:.15em}
.chat-markdown li :is(ul,ol){margin:.3em 0}
.chat-markdown li p{margin:.3em 0}
.chat-markdown code{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.9em;background:#80808026;border-radius:4px;padding:.12em .3em;white-space:break-spaces;overflow-wrap:anywhere}
.chat-markdown pre{max-width:100%;overflow-x:auto;padding:14px 16px;border:1px solid var(--line);border-radius:8px;background:#16161566;line-height:1.55;margin:.8em 0;white-space:pre}
.chat-markdown pre code{display:block;white-space:pre;overflow-wrap:normal;background:none;padding:0;border-radius:0;color:inherit}
.chat-markdown a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.chat-markdown a:hover{text-decoration-thickness:2px}
.chat-markdown blockquote{margin:.8em 0;padding-left:16px;border-left:3px solid currentColor}
.chat-markdown hr{border:0;border-top:1px solid var(--line);margin:1em 0}
.chat-markdown input[type=checkbox]{width:auto;display:inline;margin:0;vertical-align:middle}
.markdown-table{max-width:100%;overflow-x:auto;margin:.8em 0}
.markdown-table table{border-collapse:collapse;font-size:.95em;width:100%}
.markdown-table :is(th,td){border:1px solid var(--line);padding:8px 12px;text-align:left;min-width:100px}
.markdown-table .align-center{text-align:center}.markdown-table .align-right{text-align:right}
.chat-proposal>.chat-markdown{margin:12px 0;font-size:15px;line-height:1.7}
.message-delivery{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px 16px;align-items:center;max-width:92%;margin:-12px 0 24px auto;font-size:13px;color:inherit;text-align:right}
.message-delivery .text-button{font-size:13px;padding:4px 0}

.project-menu{width:min(360px,calc(100% - 32px))}.project-menu>button{display:flex;width:100%;margin-top:12px;justify-content:flex-start}.project-menu .panel-header h2{font-size:20px}

.material-actions{display:flex;gap:16px;align-items:center;margin:4px 0 8px}.material-actions button{font-size:13px;min-height:36px}.attached-photos{display:flex;gap:8px;overflow-x:auto;max-width:100%;margin-bottom:8px}.photo-chip{display:flex;align-items:center;gap:4px;flex:none}.photo-chip img{object-fit:cover;border-radius:8px}.photo-chip button{min-width:32px;min-height:44px}.reference-field{display:block;font-size:12px;margin:8px 0}.reference-field input{display:block;width:100%;font-size:14px;min-height:44px;margin:4px 0}.message-materials{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin:0 0 18px}.message-materials img{object-fit:cover;border-radius:8px}.message-materials a{align-self:center}#material-status{font-size:12px;margin:4px 0 8px}

.address-input{display:flex;align-items:center;gap:8px;min-width:0}.address-input input{flex:1;min-width:80px}.address-input span{font-size:13px;white-space:nowrap}#address-status{min-height:24px}#address-alternative{text-align:left;overflow-wrap:anywhere}#address-preview{overflow-wrap:anywhere;font-size:13px}@media(max-width:400px){.address-input{flex-wrap:wrap}.address-input input{flex-basis:100%}.address-input span{margin-left:auto}}

.reference-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.reference-heading label{font-size:12px}.reference-heading button{flex:none;min-width:44px;min-height:44px;font-size:22px}

#address-save:disabled{cursor:default;transform:none}#address-save[aria-busy="true"]{cursor:wait}
.billing-close{display:none}
@media(max-width:700px){.billing-close{display:inline-flex;flex:none;min-width:44px;min-height:44px;align-items:center;justify-content:center}}

#expenses-title:focus{outline:none}

.billing-plans-dialog{width:min(1000px,calc(100% - 32px));padding:32px}
.billing-plans-header{align-items:flex-start;margin-bottom:24px}
.billing-plans-header h2{font-size:28px;letter-spacing:-.6px}
.billing-plans-header .form-note{margin:8px 0 0}
.billing-plans-header .icon-button{display:inline-flex;align-items:center;justify-content:center;flex:none;width:44px;height:44px;font-size:26px}
#billing-plans-title:focus{outline:none}
.billing-checkout fieldset{border:0;padding:0;margin:0;min-width:0}
.billing-checkout legend{padding:0;margin-bottom:8px;font-size:18px;font-weight:600}
.billing-plan-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.billing-checkout .billing-plan-card{position:relative;display:flex;flex-direction:column;margin:0;padding:24px 20px;border:1px solid var(--line);border-radius:16px;font-size:15px;font-weight:400;line-height:1.6;min-width:0;transition:border-color .15s,transform .15s}
.billing-checkout label.billing-plan-card{cursor:pointer}
.billing-checkout label.billing-plan-card:hover{transform:translateY(-2px)}
.billing-checkout .billing-plan-card.is-selected{border-color:#7298ff;box-shadow:inset 0 0 0 1px #7298ff}
.billing-plan-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:32px}
.billing-plan-heading h3{font-size:22px;font-weight:600;margin:0}
.billing-current{font-size:11px;white-space:nowrap;color:var(--muted)}
.billing-checkout .billing-plan-price{display:flex;flex-direction:column;align-items:flex-start;gap:0;margin:16px 0 12px}
.billing-plan-price strong{font-size:36px;line-height:1.25;letter-spacing:-1px;font-weight:600;font-variant-numeric:tabular-nums}
.billing-plan-price span,.billing-plan-purpose{color:var(--muted);font-size:14px}
.billing-checkout .billing-plan-purpose{margin:0 0 20px}
.billing-plan-features{list-style:none;margin:0 0 24px;padding:20px 0 0;border-top:1px solid var(--line);flex:1}
.billing-plan-features li{position:relative;padding-left:22px;margin:0 0 12px;font-size:14px}
.billing-plan-features li::before{content:'✓';position:absolute;left:0;color:#218657}
html[data-theme="dark"] .billing-plan-features li::before{color:#65d59a}
.billing-plan-action{display:flex;justify-content:center;align-items:center;min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:8px;text-align:center;font-size:14px;font-weight:600}
label .billing-plan-action{background:#4369d4;color:#fff;border-color:#4369d4;transition:background .15s}
label:hover .billing-plan-action{background:#3d60c3;border-color:#3d60c3}
article .billing-plan-action{border-color:transparent;color:var(--muted);font-weight:400}
.billing-checkout .billing-offer-radio{position:absolute;opacity:0;width:1px;height:1px;padding:0;margin:0;pointer-events:none}
.billing-plan-card:has(input:focus-visible),.billing-topup-card:has(input:focus-visible){outline:2px solid #7298ff;outline-offset:4px}
.billing-checkout #billing-topups{margin-top:28px}
#billing-topups>.form-note{margin:0 0 12px}
.billing-topup-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.billing-checkout .billing-topup-card{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid var(--line);border-radius:10px;padding:16px;margin:0;cursor:pointer;font-size:14px;font-weight:400}
.billing-topup-card.is-selected{border-color:#7298ff;box-shadow:inset 0 0 0 1px #7298ff}
.billing-topup-card:hover{transform:translateY(-2px)}
.billing-checkout-details{border-top:1px solid var(--line);margin-top:28px;padding-top:4px}
.billing-checkout-details input{display:block;max-width:440px}
.billing-checkout .button{height:auto;min-height:44px;white-space:normal;text-align:center;max-width:100%}
#billing-payment-check{display:block;min-height:44px;margin-top:8px}
#billing-payment-status{overflow-wrap:anywhere}
@media(max-width:700px){.billing-plans-dialog{padding:20px}.billing-plans-header h2{font-size:24px}.billing-plan-grid{grid-template-columns:1fr}.billing-checkout .billing-plan-card{padding:20px}.billing-plan-features{margin-bottom:12px}.billing-plan-heading h3{font-size:22px}.billing-checkout .billing-plan-price{flex-direction:row;align-items:baseline;gap:12px;margin:12px 0}.billing-plan-price strong{font-size:32px}.billing-topup-grid{grid-template-columns:1fr}.billing-checkout .button{width:100%}}
@media(prefers-reduced-motion:reduce){.billing-plan-card,.billing-topup-card{transition:none!important;transform:none!important}}
.billing-plans-header{position:sticky;top:0;z-index:2;background:inherit;padding-bottom:16px}

.billing-checkout .billing-upgrade-note{font-size:14px;font-weight:600;margin:0 0 12px}
