/* Shared application surfaces for the application route family. The base tokens
   and header/footer primitives remain in styles.css. */
.workspace-main { min-height: calc(100vh - 72px); padding: clamp(34px, 5vw, 62px) 0 clamp(48px, 7vw, 88px); background: linear-gradient(180deg, var(--hero), var(--page) 38%); }
.workspace-main--guest { display: grid; align-items: center; min-height: calc(100vh - 72px); }
.app-shell { width: min(1320px, calc(100% - 48px)); margin: 0 auto; }
.workspace-mobile-nav { display: none; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-heading h1 { max-width: 860px; margin: 0; color: #20222e; font-size: clamp(34px, 4.2vw, 52px); letter-spacing: -.055em; line-height: 1.02; }
.page-heading > div > p:not(.eyebrow) { max-width: 700px; margin: 13px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.app-card { min-width: 0; padding: clamp(20px, 2.7vw, 32px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 8px 28px rgba(35, 34, 47, .04); }
.app-card h2, .app-card h3 { margin: 0; color: #292b36; letter-spacing: -.034em; }
.app-card h2 { font-size: 22px; }
.app-card h3 { font-size: 16px; }
.app-card > p { color: #626571; line-height: 1.55; }
.back-link { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; margin-bottom: 24px; color: #626775; font-size: 14px; font-weight: 700; }
.back-link:hover, .back-link:focus-visible { color: var(--brand); }
.ui-icon { display: inline-block; width: 20px; height: 20px; flex: 0 0 auto; object-fit: contain; vertical-align: middle; }
.route-budget { display: grid; flex: 0 0 auto; gap: 4px; min-width: 166px; padding: 14px 17px; border-radius: 12px; color: #737581; background: #fff; box-shadow: var(--shadow); }
.route-budget span { font-size: 12px; font-weight: 700; }
.route-budget strong { color: #262832; font-size: 27px; letter-spacing: -.04em; }
.field { display: grid; min-width: 0; gap: 8px; color: #555864; font-size: 13px; font-weight: 700; }
.field > input, .field > select, .field > textarea { width: 100%; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid #d9dbe4; border-radius: 9px; outline: 0; color: var(--ink); background: #fff; font: inherit; font-weight: 500; }
.field > textarea { min-height: 120px; padding: 12px; resize: vertical; line-height: 1.45; }
.field > input:focus, .field > select:focus, .field > textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,2,205,.11); }
.field small { margin-top: -2px; color: #a54e36; font-weight: 500; }
.field b { color: #bd402a; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid--route { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field--wide { grid-column: 1 / -1; }
.status-pill { display: inline-flex; min-height: 28px; align-items: center; gap: 5px; width: fit-content; padding: 0 9px; border-radius: 999px; color: #5d6270; background: #f1f1f6; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status-pill .ui-icon { width: 15px; height: 15px; }
.status-pill.is-good { color: #237653; background: #e8f8ef; }
.neutral-avatar { display: grid; width: 42px; height: 42px; flex: 0 0 auto; border: 1px solid #dedeec; border-radius: 50%; place-items: center; color: #4d45b7; background: #f3f2ff; font-size: 12px; font-weight: 700; }
.inline-info, .payment-boundary { display: flex; align-items: flex-start; gap: 10px; padding: 13px 14px; border: 1px solid #e0dcff; border-radius: 10px; color: #5f6171; background: #f8f7ff; font-size: 13px; line-height: 1.45; }
.inline-info .ui-icon, .payment-boundary .ui-icon { color: var(--brand); }
.payment-boundary { margin-top: 22px; }
.payment-boundary div { display: grid; gap: 3px; }
.payment-boundary strong { color: #30323d; }
.payment-boundary span { color: #737682; }

/* Registration */
.auth-stage { display: grid; grid-template-columns: minmax(0, .95fr) minmax(390px, .75fr); gap: clamp(36px, 7vw, 110px); align-items: center; padding: 36px 0; }
.auth-stage__copy h1 { max-width: 610px; margin: 0; color: #20222f; font-size: clamp(39px, 5vw, 66px); letter-spacing: -.062em; line-height: .98; }
.auth-stage__copy > p:not(.eyebrow) { max-width: 500px; margin: 20px 0 0; color: #626571; font-size: 17px; line-height: 1.6; }
.auth-stage__facts { display: grid; gap: 12px; margin-top: 32px; color: #4d5261; font-size: 14px; }
.auth-stage__facts span { display: flex; align-items: center; gap: 9px; }
.auth-stage__facts .ui-icon { color: var(--brand); }
.registration-card { position: relative; padding: 30px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 22px 60px rgba(41,34,94,.14); }
.registration-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.registration-card__top h2 { margin: 0; font-size: 27px; letter-spacing: -.05em; }
.registration-card__top .modal__close { position: static; flex: 0 0 44px; text-decoration: none; }
.registration-submit { width: 100%; margin-top: 19px; }

/* Request and response */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(350px, .78fr); gap: 24px; align-items: start; }
.shipment-detail__title { display: flex; align-items: center; gap: 17px; }
.shipment-detail__title p { margin: 0 0 4px; color: var(--muted); font-size: 13px; }
.cargo-symbol { display: grid; width: 78px; height: 78px; border-radius: 14px; place-items: center; color: var(--brand); background: var(--brand-wash); }
.cargo-symbol .ui-icon { width: 38px; height: 38px; }
.fact-row { display: grid; grid-template-columns: .7fr .7fr 1.5fr; gap: 10px; margin: 28px 0; padding: 19px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fact { display: flex; align-items: flex-start; gap: 10px; min-width: 0; color: #6f7280; }
.fact > .ui-icon { color: var(--brand); }
.fact div { display: grid; gap: 4px; min-width: 0; }
.fact span { font-size: 12px; }
.fact strong { overflow-wrap: anywhere; color: #2d303a; font-size: 14px; line-height: 1.35; }
.route-points { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.route-points > div { display: flex; align-items: flex-start; gap: 11px; }
.route-points .ui-icon { color: var(--brand); }
.route-points p { display: grid; gap: 4px; margin: 0; }
.route-points strong { font-size: 14px; }
.route-points span { color: #737683; font-size: 13px; }
.detail-block { margin-top: 27px; }
.detail-block p { margin: 9px 0 0; color: #626570; font-size: 14px; line-height: 1.5; }
.attachment-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 13px; }
.attachment-row > a { display: inline-flex; min-height: 76px; align-items: center; gap: 8px; padding: 11px; border: 1px solid #dedfe8; border-radius: 9px; color: #3f4350; font-size: 13px; font-weight: 700; }
.attachment-row > a:hover { border-color: var(--brand); color: var(--brand); }
.attachment-row small { color: #898c97; font-weight: 500; }
.attachment-thumb { width: 94px; min-height: 76px; border: 1px solid #dedfe8; border-radius: 9px; background: linear-gradient(135deg, #ece9f6, #fafafd); }
.attachment-thumb--pipes { background: repeating-linear-gradient(135deg, #4c5362 0 9px, #a7adba 9px 16px, #313847 16px 21px); }
.attachment-thumb--waybill { background: repeating-linear-gradient(0deg, #f7f4ec 0 8px, #ccc7b9 8px 9px, #f7f4ec 9px 16px); }
.response-form { position: sticky; top: 98px; display: grid; gap: 16px; }
.response-form .eyebrow { margin-bottom: -8px; }
.response-form h2 { margin-bottom: 4px; }
.response-form .button { width: 100%; }
.response-form .form-hint { margin: -8px 0 0; }

/* Request creation and AI draft */
.create-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; padding: 0; margin: 0 0 25px; list-style: none; }
.create-steps li { position: relative; display: flex; align-items: center; gap: 8px; min-height: 42px; color: #797c87; font-size: 13px; font-weight: 700; }
.create-steps li:not(:last-child)::after { position: absolute; top: 21px; right: 9px; left: 88px; height: 1px; border-top: 1px dashed #babcc8; content: ""; }
.create-steps span, .step-number { display: grid; width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid #cfd1db; border-radius: 50%; place-items: center; background: #fff; }
.create-steps li.is-active, .create-steps li.is-complete { color: var(--brand); }
.create-steps li.is-active span, .create-steps li.is-complete span, .step-number { border-color: var(--brand); color: #fff; background: var(--brand); }
.create-steps li.is-complete span { font-size: 0; }
.create-steps li.is-complete span::after { content: "✓"; font-size: 15px; }
.create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.create-form { display: grid; gap: 24px; }
.create-form h2 { margin-bottom: 20px; }
.create-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
.create-actions .button--primary { margin-left: auto; }
.upload-field { display: flex; min-height: 84px; align-items: center; justify-content: center; gap: 9px; padding: 12px; border: 1px dashed var(--brand); border-radius: 10px; color: var(--brand); background: #faf9ff; font-size: 13px; text-align: center; }
.upload-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.preview-card { display: grid; gap: 8px; padding: 22px; border-radius: 12px; background: var(--hero); }
.preview-card p { margin: 0; color: #626570; line-height: 1.5; }
.preview-card h3 { font-size: 22px; }
.create-aside { position: sticky; top: 98px; display: grid; gap: 12px; }
.illustration-card { padding: 28px 23px; border: 1px solid #dfe4ff; border-radius: 15px; color: #4b4e5c; background: #fff; }
.illustration-card > .ui-icon { width: 64px; height: 64px; margin-bottom: 24px; color: var(--accent-strong); }
.illustration-card h2 { margin: 0; color: #2e3141; font-size: 21px; }
.illustration-card p { color: #646775; font-size: 14px; line-height: 1.58; }
.ai-shortcut { display: flex; min-height: 52px; align-items: center; gap: 9px; padding: 10px 14px; border: 1px solid #dfdbff; border-radius: 10px; color: var(--brand); background: #faf9ff; font-size: 13px; font-weight: 700; }
.ai-shortcut:hover { border-color: var(--brand); }
.ai-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 24px; }
.ai-input, .ai-result { display: grid; align-content: start; gap: 18px; }
.ai-input h2, .ai-result h2 { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.ai-input .field textarea { min-height: 205px; font-size: 16px; }
.ai-input .field small { align-self: end; color: #777a86; }
.example-list { display: grid; gap: 7px; }
.example-list button { display: flex; min-height: 44px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e1e2ea; border-radius: 8px; color: #5c6070; background: #fff; font-size: 13px; text-align: left; }
.example-list button:hover { border-color: var(--brand); color: var(--brand); }
.draft-list { margin: 0; overflow: hidden; border: 1px solid #e0e1e9; border-radius: 10px; }
.draft-list div { display: grid; grid-template-columns: minmax(160px, .7fr) minmax(170px, 1fr); gap: 12px; padding: 13px 15px; border-bottom: 1px solid #e6e6ee; }
.draft-list div:last-child { border: 0; }
.draft-list dt, .draft-list dd { display: flex; align-items: center; gap: 8px; margin: 0; }
.draft-list dt { color: #363946; font-size: 13px; font-weight: 700; }
.draft-list dd { justify-content: space-between; color: #5d6170; font-size: 13px; }
.draft-list .ui-icon { width: 17px; height: 17px; }
.needs-manual { padding: 4px 7px; border: 1px solid #ffd88c; border-radius: 6px; color: #a76400; background: #fff8e8; font-size: 11px; font-weight: 700; }
.ai-result > .button { justify-self: end; }

/* My requests and response comparison */
.usage-counter { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1px solid #dfdff0; border-radius: 10px; color: #5e6170; background: #fff; font-size: 13px; white-space: nowrap; }
.usage-counter span { min-width: 0; }
.usage-counter strong { color: #353844; }
.usage-counter .ui-icon { color: var(--brand); }
.responses-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.request-list { padding: 12px; }
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button { min-width: 0; min-height: 42px; flex: 1; padding: 0 5px; border: 0; color: #6c6f7c; background: transparent; font-size: 11px; font-weight: 700; white-space: nowrap; }
.tabs button.is-active { color: var(--brand); border-bottom: 2px solid var(--brand); }
.request-list__item { display: grid; width: 100%; gap: 7px; padding: 17px 11px; border: 0; border-bottom: 1px solid var(--line); color: #424550; background: transparent; text-align: left; }
.request-list__item:last-child { border-bottom: 0; }
.request-list__item.is-active { margin: 7px 0; border-radius: 8px; background: var(--brand-wash); box-shadow: inset 3px 0 var(--brand); }
.request-list__item strong { color: #2b2e39; font-size: 14px; }
.request-list__item span, .request-list__item small { color: #6e7180; font-size: 12px; line-height: 1.4; }
.response-compare { padding: 0; overflow: hidden; }
.response-compare > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 24px 27px; border-bottom: 1px solid var(--line); }
.response-compare > header .eyebrow { margin-bottom: 5px; }
.response-compare > header h2 { font-size: 25px; }
.response-compare > header p:not(.eyebrow) { margin: 7px 0 0; color: #717482; font-size: 13px; }
.response-compare > h3 { padding: 22px 27px 10px; }
.response-table { display: grid; gap: 9px; padding: 0 16px 16px; }
.response-row { display: grid; grid-template-columns: minmax(170px, .95fr) minmax(130px, .68fr) minmax(190px, 1.1fr) minmax(172px, .82fr); grid-template-areas: "person offer readiness actions" "person transport transport actions"; gap: 13px 16px; align-items: start; padding: 18px; border: 1px solid #e4e4ee; border-radius: 12px; }
.response-row > div { display: grid; gap: 7px; min-width: 0; }
.response-row > div > span { color: #777a87; font-size: 11px; }
.response-row > div > strong { color: #30333e; font-size: 17px; }
.response-row > div > p { margin: 0; color: #555966; font-size: 12px; line-height: 1.45; }
.response-row > div > small { color: #737783; font-size: 11px; line-height: 1.45; }
.response-row > div:last-child .button { min-height: 40px; padding: 0 11px; font-size: 12px; }
.response-person { display: flex !important; gap: 9px; }
.response-person { grid-area: person; }
.response-offer { grid-area: offer; }
.response-readiness { grid-area: readiness; }
.response-transport { grid-area: transport; }
.response-actions { grid-area: actions; }
.response-person p { display: grid; gap: 5px; }
.response-person p > span { display: flex; align-items: center; gap: 4px; color: #5e6270; font-size: 11px; }
.response-person .ui-icon { width: 14px; height: 14px; color: var(--brand); }

/* Message and deal */
.workspace-main--messages { padding: 0; background: #fff; }
.messages-shell { display: grid; min-height: calc(100vh - 72px); grid-template-columns: minmax(320px, .72fr) minmax(0, 1.8fr); background: #fff; }
.chat-list { display: grid; align-content: start; border-right: 1px solid var(--line); background: #fbfbfd; }
.chat-list > div:first-child { padding: 27px 24px 13px; }
.chat-list h1 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
.chat-search { display: flex; min-height: 44px; align-items: center; gap: 8px; margin-top: 18px; padding: 0 10px; border: 1px solid #dedfe8; border-radius: 8px; color: #747783; background: #fff; }
.chat-search input { width: 100%; border: 0; outline: 0; color: #424550; background: transparent; }
.chat-tabs { display: flex; gap: 8px; padding: 0 24px 13px; }
.chat-tabs button { min-height: 34px; padding: 0 11px; border: 0; border-radius: 7px; color: #666976; background: transparent; font-size: 12px; font-weight: 700; }
.chat-tabs button.is-active { color: #fff; background: var(--brand); }
.chat-preview { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; width: 100%; padding: 16px 24px; border: 0; border-top: 1px solid #e9e9ef; color: #353844; background: transparent; text-align: left; }
.chat-preview.is-active { background: var(--brand-wash); }
.chat-preview > span:nth-child(2) { display: grid; gap: 5px; min-width: 0; }
.chat-preview strong { font-size: 13px; }
.chat-preview small { overflow: hidden; color: #737683; font-size: 12px; line-height: 1.38; text-overflow: ellipsis; white-space: nowrap; }
.chat-preview b { display: grid; width: 23px; height: 23px; border-radius: 50%; place-items: center; color: #fff; background: var(--brand); font-size: 11px; }
.chat-panel { display: grid; grid-template-rows: auto auto minmax(220px, 1fr) auto auto auto; min-width: 0; min-height: calc(100vh - 72px); padding-bottom: 18px; }
.chat-panel__header { display: flex; min-height: 74px; align-items: center; gap: 15px; padding: 0 27px; border-bottom: 1px solid var(--line); }
.chat-panel__header h1 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.chat-panel__header > a { display: inline-flex; color: #626571; }
.chat-panel__header .icon-action { margin-left: auto; }
.chat-context { display: grid; grid-template-columns: 1.2fr .75fr; gap: 18px; margin: 22px 27px 0; padding: 17px; border: 1px solid #dfdfea; border-radius: 12px; }
.chat-context > div { display: grid; align-content: start; gap: 8px; }
.chat-context p { display: flex; align-items: center; gap: 8px; margin: 0; color: #555966; font-size: 13px; }
.chat-context p:last-child { margin-top: 4px; }
.messages { display: grid; align-content: end; gap: 13px; width: min(100%, 840px); margin: 0 auto; padding: 24px 27px; }
.message { display: flex; width: fit-content; min-width: 0; max-width: 74%; align-items: end; gap: 9px; }
.message > span { display: grid; width: 30px; height: 30px; min-width: 30px; flex: 0 0 30px; border-radius: 50%; place-items: center; color: #4d45b7; background: #f1f0ff; font-size: 10px; font-weight: 700; }
.message p { display: grid; min-width: 0; flex: 1 1 auto; gap: 6px; margin: 0; padding: 10px 13px; border-radius: 12px 12px 12px 3px; overflow-wrap: anywhere; color: #454956; background: #f1f0f8; font-size: 13px; line-height: 1.45; }
.message small { color: #878a96; font-size: 10px; text-align: right; }
.message--me { justify-self: end; }
.message--me p { border: 1px solid #e2e1ef; border-radius: 12px 12px 3px 12px; background: #fff; }
.chat-actions { display: flex; flex-wrap: wrap; gap: 9px; padding: 0 27px 12px; }
.chat-actions .button { min-height: 39px; padding: 0 12px; font-size: 12px; }
.ai-summary { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 0 27px 13px; padding: 17px; border: 1px solid #9f92ff; border-radius: 12px; background: #fbfaff; }
.ai-summary .eyebrow { margin-bottom: 5px; }
.ai-summary h2 { margin: 0; font-size: 16px; }
.ai-summary p:not(.eyebrow) { max-width: 590px; margin: 8px 0 0; color: #626675; font-size: 12px; line-height: 1.5; }
.ai-summary > div:last-child { display: grid; gap: 5px; min-width: 126px; }
.ai-summary .button { min-height: 36px; padding: 0 9px; font-size: 12px; }
.chat-compose { display: flex; gap: 9px; width: min(100%, 900px); margin: 0 auto; padding: 0 27px; }
.chat-compose input { min-width: 0; flex: 1; min-height: 46px; padding: 0 12px; border: 1px solid #dcdee8; border-radius: 9px; outline: 0; }
.chat-compose input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,2,205,.11); }
.agreement-banner { display: flex; align-items: center; gap: 15px; margin-bottom: 24px; padding: 17px 21px; border: 1px solid #b9e7cb; border-radius: 13px; background: #f4fcf7; }
.agreement-banner__mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; border: 2px solid #28a463; border-radius: 50%; place-items: center; background: #28a463; }
.agreement-banner__mark::after { color: #fff; content: "✓"; font-size: 18px; font-weight: 700; line-height: 1; }
.agreement-banner div { display: grid; gap: 4px; }
.agreement-banner strong { color: #2c3832; font-size: 17px; }
.agreement-banner span { color: #6f7a73; font-size: 13px; }
.deal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .85fr); gap: 24px; }
.deal-facts { margin: 20px 0 0; }
.deal-facts div { display: grid; grid-template-columns: minmax(175px, .8fr) minmax(0, 1fr); gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.deal-facts div:last-child { border-bottom: 0; }
.deal-facts dt, .deal-facts dd { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; }
.deal-facts dt { color: #525663; font-weight: 700; }
.deal-facts dd { color: #646775; }
.deal-facts dd a { color: var(--brand); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.deal-parties { display: grid; align-content: start; gap: 20px; }
.deal-parties > div { display: flex; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.deal-parties > div:last-child { padding-bottom: 0; border-bottom: 0; }
.deal-party-icon { display: grid; width: 44px; height: 44px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: var(--brand-wash); }
.deal-party-icon .ui-icon { width: 26px; height: 26px; object-fit: contain; object-position: center 68%; }
.deal-parties p { display: grid; gap: 5px; margin: 0; }
.deal-parties p > span:first-child { color: #737683; font-size: 12px; }
.deal-parties p strong { color: #30333e; }
.deal-parties small { color: #818490; font-size: 11px; }
.deal-timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; padding: 20px; margin: 24px 0 0; border: 1px solid var(--line); border-radius: 13px; background: #fff; list-style: none; }
.deal-timeline li { position: relative; display: grid; gap: 6px; min-width: 0; padding-left: 42px; color: #5f6270; }
.deal-timeline li:not(:last-child)::after { position: absolute; top: 16px; right: -7px; width: calc(100% - 62px); border-top: 1px dashed #b8bac5; content: ""; }
.deal-timeline span { position: absolute; top: 0; left: 0; display: grid; width: 31px; height: 31px; border: 1px solid #cacbd5; border-radius: 50%; place-items: center; background: #fff; font-size: 13px; font-weight: 700; }
.deal-timeline li.is-done span { border-color: #27a562; color: #fff; background: #28a463; font-size: 15px; }
.deal-timeline strong { color: #3b3e4a; font-size: 13px; line-height: 1.4; }
.deal-timeline small { color: #858894; font-size: 11px; line-height: 1.4; }

/* Profile and balance */
.profile-content { display: grid; gap: 17px; }
.profile-hero { display: grid; grid-template-columns: 112px minmax(180px, .65fr) minmax(0, 1.6fr); gap: 24px; align-items: center; }
.profile-mark { display: grid; width: 112px; height: 112px; border-radius: 50%; place-items: center; color: var(--brand); background: linear-gradient(135deg, #f0edff, #e7e5fc); font-size: 37px; font-weight: 700; letter-spacing: -.06em; }
.profile-hero > div:nth-child(2) { display: grid; gap: 7px; align-content: center; }
.profile-hero > div:nth-child(2) p { margin: 0; color: #626571; font-size: 14px; }
.profile-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.profile-metrics .fact { display: grid; gap: 8px; }
.profile-metrics .fact > .ui-icon { width: 25px; height: 25px; }
.profile-columns { display: grid; grid-template-columns: 1.15fr .85fr; gap: 17px; }
.profile-columns .app-card > p { margin: 9px 0 16px; font-size: 13px; }
.contact-verify { display: grid; gap: 11px; }
.contact-verify .fact { padding: 13px; border: 1px solid #e2e3eb; border-radius: 9px; }
.contact-verify .fact strong { color: #238552; }
.plain-list { display: grid; gap: 11px; padding: 0; margin: 18px 0 0; color: #5f6370; list-style: none; font-size: 13px; }
.plain-list li { display: flex; align-items: center; gap: 9px; }
.plain-list .ui-icon { color: var(--brand); }
.review { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review p { display: grid; gap: 6px; margin: 0; color: #626570; font-size: 13px; line-height: 1.4; }
.review strong { color: #3f424d; }
.saved-search { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 43px; border-bottom: 1px solid var(--line); color: #5e6270; font-size: 13px; }
.saved-search button { width: 35px; height: 21px; padding: 0; border: 0; border-radius: 20px; color: #fff; background: var(--brand); font-size: 0; }
.saved-search button::after { display: block; width: 15px; height: 15px; margin: 0 3px 0 auto; border-radius: 50%; background: #fff; content: ""; }
.profile-columns .button { width: 100%; margin-top: 14px; }
.balance-top { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 24px; }
.balance-card { display: grid; grid-template-columns: .8fr 1.1fr; gap: 25px; }
.balance-card > div { min-width: 0; }
.balance-card > div > p:first-child { margin: 0; color: #666976; font-size: 14px; }
.balance-number { display: block; margin: 16px 0 22px; color: #252731; font-size: 59px; letter-spacing: -.07em; line-height: .9; }
.balance-number span { font-size: 21px; letter-spacing: -.03em; }
.balance-note { display: flex; align-items: center; gap: 7px; margin: 20px 0 0 !important; color: #676b78 !important; font-size: 12px !important; }
.balance-note .ui-icon { color: var(--brand); }
.operation-list { padding-left: 25px; border-left: 1px solid var(--line); }
.operation-list h3 { margin-bottom: 14px; }
.operation-list p { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); color: #515560; font-size: 13px; }
.operation-list small { grid-column: 1; color: #858894; }
.operation-list .is-positive { color: #228051; }
.pro-card { position: relative; overflow: hidden; background: linear-gradient(135deg, #fff, #f2f0ff); }
.pro-card::after { position: absolute; right: -22px; bottom: -32px; width: 185px; height: 185px; border: 2px solid #c8c1ff; border-radius: 50%; content: ""; }
.pro-card > * { position: relative; z-index: 1; }
.pro-badge { display: inline-flex; padding: 5px 9px; border-radius: 6px; color: #fff; background: var(--brand); font-size: 12px; font-weight: 700; }
.pro-card h2 { margin-top: 20px; font-size: 36px; }
.pro-card h2 small { font-size: 20px; }
.pro-card p { display: flex; align-items: center; gap: 9px; max-width: 230px; font-size: 14px; }
.pro-card .ui-icon { color: var(--brand); }
.subheading { margin: 33px 0 16px; color: #2d303a; font-size: 23px; letter-spacing: -.035em; }
.credit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.credit-card { display: grid; grid-template-columns: 64px minmax(0,1fr); align-items: center; gap: 9px 16px; }
.credit-card > .ui-icon { display: grid; width: 64px; height: 64px; padding: 17px; border: 1px solid #bde8f3; border-radius: 50%; color: var(--accent-strong); background: var(--accent-wash); }
.credit-card h3 { font-size: 26px; }
.credit-card h3 span { color: #4c505c; font-size: 15px; font-weight: 500; }
.credit-card p { grid-column: 2; grid-row: 2; margin: -9px 0 0; color: #606470; font-size: 19px; }
.credit-card .button { grid-column: 1 / -1; width: 100%; }

@media (max-width: 1120px) {
  .app-shell { width: min(100% - 40px, 980px); }
  .response-row { grid-template-columns: minmax(165px, 1fr) minmax(130px, .7fr) minmax(190px, 1.1fr); grid-template-areas: "person offer actions" "readiness transport actions"; }
  .profile-hero { grid-template-columns: 95px minmax(160px,.65fr) minmax(0,1.35fr); }
  .profile-mark { width: 95px; height: 95px; font-size: 32px; }
  .profile-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 820px) {
  .app-shell { width: min(100% - 32px, 680px); }
  .workspace-main { padding-top: 34px; }
  .page-heading { display: grid; gap: 18px; }
  .page-heading h1 { font-size: clamp(34px, 7.5vw, 47px); }
  .route-budget { width: fit-content; }
  .auth-stage { grid-template-columns: 1fr; gap: 32px; padding: 25px 0; }
  .auth-stage__copy { max-width: 640px; }
  .detail-layout, .create-layout, .ai-layout, .responses-layout, .deal-grid, .balance-top { grid-template-columns: 1fr; }
  .response-form, .create-aside { position: static; }
  .create-aside { grid-template-columns: 1fr 1fr; align-items: stretch; }
  .responses-layout > .request-list { display: none; }
  .response-row { grid-template-columns: minmax(145px, .8fr) minmax(0, 1.2fr); grid-template-areas: "person offer" "readiness readiness" "transport transport" "actions actions"; }
  .profile-hero { grid-template-columns: 95px 1fr; }
  .profile-metrics { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0,1fr)); }
  .messages-shell { grid-template-columns: 1fr; }
  .chat-list { display: none; }
  .messages-shell { min-height: calc(100vh - 64px); }
  .chat-panel__header { min-height: 64px; }
  .deal-timeline { grid-template-columns: repeat(2, 1fr); }
  .deal-timeline li:nth-child(2)::after { display: none; }
  .credit-grid { grid-template-columns: 1fr; }
  .credit-card { grid-template-columns: 64px minmax(0,1fr); }
}
@media (max-width: 560px) {
  .app-shell { width: calc(100% - 28px); }
  .workspace-main { padding-top: 25px; padding-bottom: 43px; }
  .workspace-main--guest { padding-top: 20px; }
  .page-heading { margin-bottom: 20px; }
  .page-heading > div > p:not(.eyebrow) { font-size: 14px; }
  .page-heading .button { width: 100%; }
  .app-card { padding: 18px; border-radius: 13px; }
  .auth-stage__copy h1 { font-size: 39px; }
  .registration-card { padding: 22px 18px; }
  .form-grid, .form-grid--route, .fact-row, .route-points, .profile-columns, .balance-card { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .fact-row { gap: 14px; }
  .route-points { gap: 13px; }
  .attachment-row { display: grid; grid-template-columns: 1fr 1fr; }
  .attachment-row > a { grid-column: 1 / -1; }
  .attachment-thumb { width: auto; }
  .create-steps { grid-template-columns: repeat(2, 1fr); gap: 7px 13px; }
  .create-steps li:not(:last-child)::after { display: none; }
  .create-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .create-actions .text-action { grid-column: 1 / -1; grid-row: 2; }
  .create-actions .button--primary { margin-left: 0; }
  .create-aside { grid-template-columns: 1fr; }
  .draft-list div { grid-template-columns: 1fr; gap: 5px; }
  .draft-list dd { justify-content: flex-start; }
  .ai-result > .button { width: 100%; justify-self: stretch; }
  .usage-counter { display: grid; grid-template-columns: 24px minmax(0,1fr); max-width: 100%; gap: 3px 12px; padding: 16px; white-space: normal; }
  .usage-counter .ui-icon { grid-row: 1 / 3; align-self: center; }
  .usage-counter strong { grid-column: 2; }
  .response-compare > header { display: grid; padding: 18px; }
  .response-compare > header .button { width: 100%; }
  .response-compare > h3 { padding: 18px 18px 8px; }
  .response-table { padding: 0 10px 10px; }
  .response-row { grid-template-columns: 1fr; grid-template-areas: "person" "offer" "readiness" "transport" "actions"; gap: 14px; padding: 15px; }
  .response-actions .button { width: 100%; }
  .chat-panel { grid-template-rows: auto auto minmax(260px, 1fr) auto auto auto; }
  .chat-panel { width: 100%; min-width: 0; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
  .chat-panel__header, .chat-compose { padding-right: 14px; padding-left: 14px; }
  .chat-context, .messages, .chat-actions { margin-right: 14px; margin-left: 14px; padding-right: 0; padding-left: 0; }
  .messages { width: calc(100% - 28px); min-width: 0; max-width: calc(100% - 28px); }
  .chat-context { grid-template-columns: 1fr; padding: 13px; }
  .messages { gap: 10px; }
  .message { width: 90%; max-width: none; }
  .chat-actions { display: grid; }
  .chat-actions .button { width: 100%; }
  .ai-summary { display: grid; margin-right: 14px; margin-left: 14px; padding: 14px; }
  .ai-summary > div:last-child { grid-template-columns: 1fr 1fr; }
  .agreement-banner { align-items: flex-start; padding: 14px; }
  .agreement-banner strong { font-size: 15px; }
  .deal-facts div { grid-template-columns: 1fr; gap: 5px; }
  .deal-timeline { grid-template-columns: 1fr; gap: 20px; }
  .deal-timeline li::after { display: none; }
  .profile-hero { grid-template-columns: 1fr; }
  .profile-metrics { grid-template-columns: 1fr 1fr; }
  .balance-number { font-size: 51px; }
  .operation-list { padding-top: 17px; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
}

/* Chat: the composer belongs to the working surface, not to the document flow. */
body.is-chat-page { overflow: hidden; }
.workspace-main--messages { height: calc(100dvh - 72px); min-height: 0; padding: 0; overflow: hidden; }
.workspace-main--messages .messages-shell { height: 100%; min-height: 0; }
.workspace-main--messages .chat-panel { grid-template-rows: auto auto minmax(0, 1fr) auto auto; min-height: 0; padding-bottom: 0; }
.workspace-main--messages .messages { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; scrollbar-gutter: stable; }
.chat-compose { position: relative; align-items: flex-end; min-height: 68px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--line); background: #fff; }
.chat-compose textarea { display: block; min-width: 0; max-height: 112px; flex: 1; min-height: 46px; padding: 12px; border: 1px solid #dcdee8; border-radius: 10px; outline: 0; resize: none; color: var(--ink); background: #fff; font: inherit; line-height: 1.35; }
.chat-compose textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,2,205,.11); }
.chat-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.chat-compose__tool { display: grid; width: 42px; height: 46px; flex: 0 0 42px; padding: 0; border: 1px solid #dcdee8; border-radius: 10px; place-items: center; color: #5b5e6d; background: #fff; }
.chat-compose__tool:hover, .chat-compose__tool:focus-visible { border-color: rgba(37,2,205,.42); color: var(--brand); background: var(--brand-wash); }
.chat-compose__tool svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }
.chat-compose__send { min-height: 46px; }
.chat-attachment-menu { position: absolute; bottom: 63px; left: 27px; z-index: 3; display: grid; min-width: 178px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow); background: #fff; }
.chat-attachment-menu button { min-height: 38px; padding: 0 10px; border: 0; border-radius: 7px; color: #4e5260; background: transparent; font: inherit; font-size: 13px; font-weight: 700; text-align: left; }
.chat-attachment-menu button:hover, .chat-attachment-menu button:focus-visible { color: var(--brand); background: var(--brand-wash); }
.action-symbol { display: inline-grid; width: 18px; height: 18px; flex: 0 0 auto; border-radius: 50%; place-items: center; font-size: 14px; font-weight: 700; line-height: 1; }
.action-symbol--check { color: #fff; background: #28a463; }
.action-symbol--edit { color: #5a46d5; background: transparent; font-size: 16px; }
.chat-summary-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.chat-summary-action--edit { min-height: 36px; border-color: #c9c5ff; color: #5a46d5; background: #faf9ff; font-size: 12px; font-weight: 700; }
.chat-summary-action--edit:hover, .chat-summary-action--edit:focus-visible { border-color: #5a46d5; color: #4330ba; background: #f2f0ff; }
.chat-agree-action { display: inline-flex; align-items: center; gap: 7px; }

/* Timeline marks occupy their own row, so connectors never run through labels. */
.deal-timeline { gap: 0; }
.deal-timeline li { gap: 6px; padding: 42px 18px 0 0; }
.deal-timeline li:not(:last-child)::after { top: 15px; right: 1px; left: 31px; z-index: 0; width: auto; }
.deal-timeline span { z-index: 1; }
.deal-timeline strong, .deal-timeline small { position: relative; z-index: 1; }
.deal-timeline li.is-done span { color: #fff !important; font-size: 0; }
.deal-timeline li.is-done span::after { color: #fff; content: "✓"; font-size: 16px; font-weight: 700; line-height: 1; }

@media (max-width: 820px) {
  .workspace-menu-button { display: inline-flex; }
  .workspace-main--messages { height: calc(100dvh - 109px); }
  .workspace-main--messages .messages-shell { min-height: 0; }
  .workspace-main--messages .chat-panel { grid-template-rows: 64px auto minmax(0,1fr) auto auto; }
}

@media (max-width: 560px) {
  .workspace-main--messages .chat-context { display: flex; align-items: center; min-height: 54px; margin-top: 8px; padding: 8px 12px; }
  .workspace-main--messages .chat-context > div:first-child p:not(:first-child), .workspace-main--messages .chat-context > div:last-child p { display: none; }
  .workspace-main--messages .chat-context > div:last-child { margin-left: auto; }
  .workspace-main--messages .chat-context .status-pill { min-height: 25px; padding: 0 7px; font-size: 10px; }
  .workspace-main--messages .messages { margin: 0 14px; padding: 14px 0; width: calc(100% - 28px); max-width: calc(100% - 28px); }
  .workspace-main--messages .chat-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; min-height: 51px; margin: 0 14px; padding: 5px 0 6px; }
  .workspace-main--messages .chat-actions .button { width: 100%; min-width: 0; min-height: 38px; padding: 0 7px; font-size: 11px; white-space: nowrap; }
  .workspace-main--messages .ai-summary { display: grid; gap: 8px; margin: 0 14px 6px; padding: 10px 12px; }
  .workspace-main--messages .ai-summary .eyebrow { margin-bottom: 3px; font-size: 9px; }
  .workspace-main--messages .ai-summary h2 { font-size: 14px; }
  .workspace-main--messages .ai-summary p:not(.eyebrow) { display: none; }
  .workspace-main--messages .ai-summary > div:last-child { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; min-width: 0; }
  .workspace-main--messages .ai-summary .button, .workspace-main--messages .chat-summary-action--edit { min-height: 34px; padding: 0 7px; font-size: 11px; }
  .chat-compose { gap: 6px; min-height: 64px; padding: 8px 14px max(8px, env(safe-area-inset-bottom)); }
  .chat-compose__tool { width: 44px; height: 44px; flex-basis: 44px; border-radius: 9px; }
  .chat-compose textarea { min-height: 44px; padding: 11px 9px; }
  .chat-compose__send { min-height: 44px; padding: 0 10px; font-size: 11px; }
  .chat-attachment-menu { bottom: 58px; left: 14px; }
  .deal-timeline li { min-height: 31px; padding: 0 12px 0 42px; }
}

@media (max-width: 560px) {
  .workspace-main--messages .chat-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .workspace-main--messages .chat-actions .chat-agree-action { grid-column: 1 / -1; min-height: 42px; white-space: normal; }
}

/* ТЗ completeness pass: shared controls and the previously missing product surfaces. */
.heading-actions, .row-actions, .trust-row, .metric-row, .settings-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.heading-actions { justify-content: flex-end; }
.service-label { margin-right: auto; color: #31333e; font-size: 15px; }
.workspace-mobile-menu { position: fixed; inset: 72px 0 auto; z-index: 20; display: grid; gap: 4px; padding: 12px 24px 18px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: 0 18px 35px rgba(34,31,56,.12); }
.workspace-mobile-menu[hidden] { display: none; }
.workspace-mobile-menu a { min-height: 42px; padding: 11px 12px; border-radius: 9px; color: #505360; font-size: 14px; font-weight: 700; }
.workspace-mobile-menu a.is-active { color: var(--brand); background: var(--brand-wash); }
.topbar__create {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 18px;
  border-color: #d9dce3;
  color: var(--ink);
  background: #fff;
  box-shadow: none;
  white-space: nowrap;
}
.topbar__create:hover:not(:disabled) {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(17, 178, 253, .24);
  transform: none;
}
.topbar__create:active { color: #fff; border-color: var(--brand); background: var(--brand); }
.topbar__create:focus-visible { outline: 3px solid rgba(8, 167, 215, .32); outline-offset: 3px; }
.notification-dot { display: grid; position: absolute; top: -5px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border: 2px solid #fff; border-radius: 99px; place-items: center; color: #fff; background: #ef4b55; font-size: 9px; font-weight: 700; }
.topbar .icon-action { position: relative; }
.topbar .icon-action .ui-icon { width: 19px; height: 19px; }
.auth-progress { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin: 0 0 20px; padding: 0; list-style: none; }
.auth-progress li { padding: 8px; border-radius: 8px; color: #8a8c96; background: #f3f3f7; font-size: 11px; font-weight: 700; text-align: center; }
.auth-progress li.is-active { color: var(--brand); background: var(--brand-wash); }
.auth-secondary { margin: 18px 0 0; color: #747784; font-size: 13px; text-align: center; }
.auth-secondary a, .email-status a, .email-status button { color: var(--brand); }
.registration-card form > section { display: grid; gap: 14px; }
.registration-card form > section[hidden] { display: none; }
.email-status { margin: 0; color: #797c87; font-size: 12px; line-height: 1.45; }
.code-inputs { display: grid; grid-template-columns: repeat(6,1fr); gap: 8px; }
.code-inputs input { width: 100%; min-width: 0; height: 48px; border: 1px solid #d9dbe4; border-radius: 9px; color: #282a34; font: 750 18px/1 inherit; text-align: center; }
.consent-check { display: flex; align-items: flex-start; gap: 9px; color: #60636f; font-size: 12px; line-height: 1.5; }
.consent-check input { margin-top: 3px; accent-color: var(--brand); }
.consent-check a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.create-steps { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 0 0 19px; padding: 0; list-style: none; }
.create-steps li { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; color: #747784; background: #fff; font-size: 12px; font-weight: 700; }
.create-steps li span { display: grid; width: 25px; height: 25px; border-radius: 50%; place-items: center; background: #eeeeF4; font-size: 11px; }
.create-steps li.is-active { border-color: #c9c2ff; color: var(--brand); background: var(--brand-wash); }
.create-steps li.is-active span { color: #fff; background: var(--brand); }
.create-form > section > h2 { margin-bottom: 19px; }
.create-form > section[hidden], .success-panel[hidden] { display: none; }
.upload-field { display: flex; position: relative; min-height: 74px; align-items: center; justify-content: center; gap: 8px; padding: 15px; overflow: hidden; border: 1px dashed #bbb8d0; border-radius: 10px; color: #5e5a7a; background: #faf9ff; font-weight: 700; text-align: center; }
.upload-field input { position: absolute; inset: 0; cursor: pointer; opacity: 0; }
.preview-card { margin-bottom: 17px; padding: 19px; border: 1px solid #dfddea; border-radius: 12px; background: #fafafd; }
.preview-card h3 { margin: 4px 0 9px; font-size: 24px; }
.preview-card p:not(.eyebrow) { margin: 4px 0; color: #656874; }
.success-panel { min-height: 310px; align-content: center; justify-items: center; gap: 12px; padding: 28px; text-align: center; }
.success-mark { display: grid; width: 58px; height: 58px; border-radius: 50%; place-items: center; color: #fff; background: #28a463; font-size: 26px; font-weight: 700; }
.success-panel p { max-width: 470px; margin: 0; color: #676a76; line-height: 1.55; }
.tabbed-surface { display: grid; gap: 22px; }
.tabs--five { grid-template-columns: repeat(5,minmax(0,1fr)); }
.tabs--four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.status-list, .management-list { display: grid; gap: 12px; }
.request-status-card, .management-list > article, .chat-directory article { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.request-status-card:last-child, .management-list > article:last-child, .chat-directory article:last-child { border-bottom: 0; }
.request-status-card h3, .management-list h3, .chat-directory h3 { margin: 6px 0; font-size: 17px; }
.request-status-card p, .management-list p, .chat-directory p { margin: 0; color: #747783; font-size: 13px; }
.request-card-top { display: flex; align-items: center; gap: 8px; }
.inline-form, .dispute-form { display: grid; gap: 14px; padding: 20px; border: 1px solid #dedce9; border-radius: 12px; background: #fafafd; }
.inline-form[hidden], .dispute-form[hidden] { display: none; }
.inline-form h3, .dispute-form h3 { margin: 0; }
.result-message { display: grid; gap: 5px; padding: 14px; border: 1px solid #bde5ce; border-radius: 10px; color: #296948; background: #effbf4; }
.result-message.is-error { border-color: #f0c6bd; color: #903d2f; background: #fff3f0; }
.response-row--compact { grid-template-columns: minmax(180px,1fr) auto auto auto; }
.response-row--compact .row-actions { justify-content: flex-end; }
.request-status-card > .row-actions {
  display: grid;
  width: min(100%, 380px);
  flex: 0 0 380px;
  grid-template-columns: repeat(2, minmax(0, 184px));
  justify-content: end;
  gap: 12px;
}
.request-status-card > .row-actions > .button,
.request-status-card > .row-actions > .text-action {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  white-space: normal;
}
.request-status-card > .row-actions > .request-action--wide {
  grid-column: 1 / -1;
  white-space: nowrap;
}
.request-status-card > .row-actions > .text-action {
  border: 1px solid #d8d9e3;
  color: var(--ink);
  background: #fff;
}
.request-status-card > .row-actions > .text-action:hover,
.request-status-card > .row-actions > .text-action:focus-visible { border-color: #bfc1cd; color: var(--ink); background: #f5f5f8; }
.chat-directory { display: grid; padding: 24px; }
.chat-directory .chat-search { margin: 0; }
.chat-directory .chat-tabs { min-height: 58px; align-items: center; padding: 8px 0 10px; }
.chat-directory .chat-preview { min-height: 76px; align-items: center; padding: 14px 16px; border-top: 1px solid #e9e9ef; border-radius: 12px; }
.chat-directory .chat-preview:hover { background: #f6f6f8; }
.chat-directory .chat-preview.is-active { border-top-color: transparent; background: var(--accent-wash); }
.chat-directory .chat-preview b { color: var(--accent-ink); background: var(--accent); }
.chat-directory a { color: inherit; }
.chat-directory__meta { display: grid; justify-items: end; gap: 5px; color: #7b7e89; font-size: 12px; }
.message-actions { display: flex; gap: 10px; margin-top: 7px; opacity: .72; }
.message-actions button { padding: 0; border: 0; color: #777a86; background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.message-actions button:hover { color: var(--brand); }
.message--them { margin-right: auto; }
.system-message { align-self: center; max-width: 520px; padding: 9px 12px; border-radius: 8px; color: #6a6d79; background: #f2f2f6; font-size: 12px; text-align: center; }
.result-confirmation { display: grid; gap: 12px; padding: 18px; border: 1px solid #d8d5ec; border-radius: 12px; background: #faf9ff; }
.result-confirmation h2, .result-confirmation p { margin: 0; }
.warning-text { color: #a14b32 !important; }
.freeze-note { margin-top: 14px; }
.quick-grid, .document-grid, .admin-metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
.quick-link { display: flex; min-height: 132px; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; color: #383b46; text-align: left; }
.quick-link:hover, .quick-link:focus-visible { border-color: #beb7ff; color: var(--brand); transform: translateY(-1px); }
.quick-link span { color: #7a7d88; font-size: 12px; line-height: 1.4; }
.quick-link strong { max-width: 100%; overflow-wrap: anywhere; }
.quick-link .ui-icon { width: 25px; height: 25px; }
.profile-billing { margin-top: 22px; }
.switch, .check-row { display: flex; align-items: center; gap: 10px; color: #555865; font-size: 13px; font-weight: 700; }
.switch input, .check-row input { accent-color: var(--brand); }
.review-form { display: grid; max-width: 760px; gap: 15px; margin-top: 22px; }
.notification-list { display: grid; padding-top: 8px; padding-bottom: 8px; }
.notification-list article { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 14px; align-items: start; padding: 19px 10px; border-bottom: 1px solid var(--line); }
.notification-list article.is-unread { background: linear-gradient(90deg,var(--brand-wash),transparent 68%); }
.notification-list strong, .notification-list p { display: block; margin: 0 0 5px; }
.notification-list p, .notification-list time { color: #777a86; font-size: 12px; }
.notification-list a { color: var(--brand); font-size: 12px; font-weight: 700; }
.support-layout, .admin-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(340px,.8fr); gap: 20px; align-items: start; }
.support-layout form > .button { margin-top: 17px; }
.settings-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 18px; align-items: start; }
.settings-grid > section { display: grid; gap: 14px; }
.settings-actions { grid-column: 1 / -1; }
.legal-layout { max-width: 950px; }
.legal-article { padding: clamp(25px,4vw,54px); }
.legal-article h2 { margin-top: 28px; }
.legal-article h2:first-child { margin-top: 0; }
.legal-article p { font-size: 15px; line-height: 1.75; }
.admin-metrics { margin-bottom: 18px; }
.admin-metrics a { display: grid; gap: 4px; min-height: 128px; align-content: center; }
.admin-metrics strong { color: var(--brand); font-size: 38px; }
.admin-metrics span { color: #696c78; }
.metric-row span { display: grid; flex: 1; min-width: 110px; padding: 16px; border-radius: 10px; background: #f5f4fb; color: #777a86; font-size: 12px; }
.metric-row strong { color: #292b35; font-size: 28px; }
.admin-table { margin-top: 18px; }
.table-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: center; min-height: 52px; border-bottom: 1px solid var(--line); font-size: 13px; }
.table-head { color: #888b95; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.admin-sections { margin-top: 18px; }

@media (max-width: 980px) {
  .quick-grid, .document-grid, .admin-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid > section:last-of-type { grid-column: 1 / -1; }
  .response-row--compact { grid-template-columns: 1fr auto; }
  .response-row--compact .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

@media (max-width: 820px) {
  .main-nav { display: none; }
  .topbar__actions .topbar__create { display: inline-flex !important; }
  .heading-actions { justify-content: flex-start; }
  .page-heading { display: grid; }
  .page-heading h1 { font-size: clamp(31px,8vw,46px); }
  .create-steps { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .create-steps li { justify-content: center; padding: 8px 5px; font-size: 0; }
  .create-steps li span { font-size: 11px; }
  .tabs--five, .tabs--four { display: flex; overflow-x: auto; scrollbar-width: none; }
  .tabs--five button, .tabs--four button { min-width: max-content; }
  .support-layout, .admin-grid, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > section:last-of-type { grid-column: auto; }
  .settings-actions { grid-column: auto; }
}

@media (max-width: 640px) {
  .topbar__actions > .header-popover { display: none; }
  .topbar__inner { gap: 10px; }
  .topbar__actions { gap: 6px; }
  .topbar__create { min-height: 40px; padding-inline: 12px; font-size: 12px; }
}

@media (max-width: 360px) {
  .topbar__inner { gap: 8px; }
  .brand__logo { width: 104px; }
  .topbar__actions { gap: 4px; }
  .topbar__create { padding-inline: 10px; font-size: 11px; }
}

@media (max-width: 560px) {
  .app-shell { width: min(100% - 28px,1320px); }
  .heading-actions, .row-actions, .settings-actions { align-items: stretch; }
  .heading-actions .button, .row-actions .button, .settings-actions .button { width: 100%; }
  .usage-counter { width: 100%; }
  .auth-stage { padding: 18px 0 0; }
  .registration-card { padding: 20px 17px; }
  .auth-stage__copy { display: none; }
  .code-inputs { gap: 5px; }
  .code-inputs input { height: 43px; }
  .form-grid, .form-grid--route { grid-template-columns: 1fr; }
  .request-status-card, .management-list > article { align-items: flex-start; flex-direction: column; }
  .request-status-card > .row-actions { width: 100%; flex-basis: auto; grid-template-columns: 1fr; }
  .chat-directory { padding: 14px; }
  .chat-directory .chat-preview { padding: 12px; }
  .response-row--compact { grid-template-columns: 1fr; }
  .quick-grid, .document-grid, .admin-metrics { grid-template-columns: 1fr 1fr; gap: 9px; }
  .quick-link { min-height: 116px; padding: 16px; }
  .notification-list article { grid-template-columns: auto minmax(0,1fr); }
  .notification-list time { grid-column: 2; }
  .table-row { grid-template-columns: 1fr; gap: 5px; padding: 12px 0; }
  .table-head { display: none; }
  .service-label { display: none; }
}

/* Conversation refinement: familiar bubbles, restrained metadata and a single
   mobile disclosure for secondary deal and AI actions. */
.workspace-main--messages { background: #f7f8fb; }
.chat-list { border-right-color: #e4e5eb; background: #f7f8fb; }
.chat-search { border-radius: 13px; background: #fff; }
.chat-tabs button { border-radius: 11px; }
.chat-tabs button.is-active { color: var(--ink); background: #e8e9ef; }
.chat-preview.is-active { background: #ecebff; }
.chat-panel { background: #fff; }
.chat-panel__header h1 { color: var(--ink); font-weight: 700; letter-spacing: -.025em; }
.chat-context {
  border-color: #e3e4eb;
  border-radius: 16px;
  background: #fbfbfd;
}
.status-pill.is-good { color: #17634d; background: #e6f6ee; }
.message { max-width: 70%; }
.message p {
  position: relative;
  gap: 8px;
  padding: 13px 48px 11px 15px;
  border-radius: 18px 18px 18px 6px;
  color: #31323a;
  background: #f1f2f5;
  font-size: 13px;
  line-height: 1.52;
}
.message--me p {
  border: 0;
  border-radius: 18px 18px 6px 18px;
  background: #eaf4ff;
}
.message-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: #686b76;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.message small.message-meta { color: #686b76; }
.message-menu { position: absolute; top: 5px; right: 6px; }
.message-menu__toggle {
  display: grid;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  place-items: center;
  color: #8b8d97;
  background: transparent;
  cursor: pointer;
}
.message-menu__toggle:hover, .message-menu__toggle:focus-visible, .message-menu__toggle[aria-expanded="true"] { color: var(--ink); background: rgba(255,255,255,.72); }
.message-menu__toggle svg { width: 18px; height: 18px; fill: currentColor; }
.message-menu__panel {
  position: absolute;
  top: 47px;
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 174px;
  padding: 6px;
  border: 1px solid #dedfe6;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(30, 31, 43, .14);
}
.message-menu__panel button {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  color: #4e505a;
  background: transparent;
  font: inherit;
  font-size: 12px;
  text-align: left;
}
.message-menu__panel button:hover, .message-menu__panel button:focus-visible { color: var(--ink); background: #f2f3f6; }
.message:nth-last-child(2) .message-menu__panel { top: auto; bottom: 47px; }
.system-message { border-radius: 13px; color: #666974; background: #f2f3f6; line-height: 1.45; }
.chat-panel__header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.chat-panel__header .chat-panel__header-actions .icon-action { margin-left: 0; }
.chat-actions-menu { position: relative; }
.chat-tools-toggle {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid #dadbe3;
  border-radius: 12px;
  color: var(--ink);
  background: #f4f4f7;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.chat-tools-toggle:hover, .chat-tools-toggle:focus-visible, .chat-tools-toggle[aria-expanded="true"] { border-color: #c5c7d1; background: #ececf1; }
.chat-tools-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.chat-tools-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 15;
  display: none;
  width: min(320px, calc(100vw - 28px));
  max-height: min(70dvh, 520px);
  padding: 8px;
  overflow-y: auto;
  border: 1px solid #dedfe6;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(30, 31, 43, .16);
}
.chat-tools-panel.is-open { display: grid; }
.chat-tools-panel__label { margin: 0; padding: 7px 9px 5px; color: #858791; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.chat-tools-panel__label--divided { margin-top: 6px; padding-top: 12px; border-top: 1px solid #ececf1; }
.chat-actions { display: grid; gap: 3px; padding: 0; }
.workspace-main--messages .chat-tools-panel .chat-actions { min-height: 0; grid-template-columns: 1fr; gap: 3px; margin: 0; padding: 0; }
.chat-tool-item {
  display: grid;
  min-height: 54px;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 11px;
  color: #4e505a;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.chat-tool-item:hover, .chat-tool-item:focus-visible { color: var(--ink); background: #f2f3f6; }
.chat-tool-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.chat-tool-item > .ui-icon { width: 24px; height: 24px; }
.chat-tool-item > span:last-child { display: grid; gap: 2px; min-width: 0; }
.chat-tool-item strong { font-size: 12px; line-height: 1.3; }
.chat-tool-item small { color: #83858f; font-size: 10px; line-height: 1.35; }
.chat-tool-item--primary { color: var(--accent-ink); background: var(--accent-wash); }
.chat-tool-item--primary:hover, .chat-tool-item--primary:focus-visible { color: var(--accent-ink); background: #ffefae; }
.ai-summary {
  position: relative;
  align-items: center;
  padding-right: 68px;
  border-color: #c8dcf2;
  border-radius: 16px;
  background: #f3f9ff;
}
.ai-summary .eyebrow { color: #456c9f; letter-spacing: .06em; }
.ai-summary__close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  place-items: center;
  color: #5f6671;
  background: rgba(255,255,255,.72);
}
.ai-summary__close:hover, .ai-summary__close:focus-visible { color: var(--ink); background: #fff; }
.ai-summary__close:focus-visible { outline: 3px solid rgba(159, 118, 0, .34); outline-offset: 2px; }
.ai-summary__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.chat-compose { width: 100%; max-width: none; margin: 0; padding: 12px 27px; background: rgba(255,255,255,.98); box-shadow: 0 -10px 28px rgba(27, 31, 42, .05); }
.chat-compose textarea, .chat-compose__tool { border-radius: 14px; }
.chat-compose__send { border-radius: 14px; }

@media (max-width: 560px) {
  .workspace-main--messages .chat-panel { grid-template-rows: 64px auto minmax(0,1fr) auto auto; }
  .workspace-main--messages .chat-context { border-radius: 15px; }
  .workspace-main--messages .messages { gap: 12px; padding-top: 16px; padding-bottom: 12px; }
  .workspace-main--messages .message { width: auto; max-width: 88%; }
  .workspace-main--messages .message p { padding: 12px 43px 10px 14px; border-radius: 17px 17px 17px 5px; }
  .workspace-main--messages .message--me p { border-radius: 17px 17px 5px 17px; }
  .message-menu { top: 4px; right: 4px; }
  .message-menu__toggle { width: 44px; min-height: 44px; }
  .message-menu__panel { top: 46px; }
  .message:nth-last-child(2) .message-menu__panel { top: auto; bottom: 46px; }
  .chat-tools-toggle { width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
  .chat-tools-toggle > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .chat-tools-toggle svg { width: 20px; height: 20px; }
  .chat-tools-panel { right: -1px; max-height: min(68dvh, 480px); }
  .workspace-main--messages .ai-summary { padding-right: 58px; }
  .workspace-main--messages .chat-compose { padding: 9px 14px max(9px, env(safe-area-inset-bottom)); }
}

/* 2026-09-09 — carry the selected route-search visual language through every
   authenticated, guest, support and legal surface. */
.workspace-main {
  min-height: calc(100vh - 80px);
  padding: clamp(38px,5vw,68px) 0 clamp(54px,7vw,92px);
  background: var(--page);
}
.workspace-main--guest { min-height: calc(100vh - 80px); background: #fff; }
.app-shell { width: min(1140px, calc(100% - 48px)); }
.workspace-main .eyebrow { display: none; }
.page-heading { margin-bottom: 30px; }
.page-heading h1,
.auth-stage__copy h1 { color: var(--ink); letter-spacing: -.04em; }
.page-heading h1 { font-size: clamp(38px,4.5vw,56px); line-height: 1; }
.page-heading > div > p:not(.eyebrow),
.auth-stage__copy > p:not(.eyebrow) { color: var(--muted); }

.app-card,
.registration-card {
  border-color: var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: none;
}
.registration-card { box-shadow: 0 22px 60px rgba(27,31,42,.1); }
.app-card h2, .app-card h3, .registration-card h2 { color: var(--ink); }
.route-budget { border: 1px solid var(--line); border-radius: 12px; background: #f4f5f8; box-shadow: none; }

.field > input,
.field > select,
.field > textarea,
.chat-search,
.chat-compose textarea,
.chat-compose__tool {
  border-color: transparent;
  border-radius: 12px;
  background: #f1f2f6;
}
.field > input:focus,
.field > select:focus,
.field > textarea:focus,
.chat-compose textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(8,167,215,.14);
}
.field b { color: #d62f3d; }
.inline-info, .payment-boundary { border-color: #bde8f3; color: #3f5961; background: var(--accent-wash); }
.inline-info .ui-icon, .payment-boundary .ui-icon { color: var(--accent-strong); }
.back-link:hover, .back-link:focus-visible,
.attachment-row > a:hover,
.notification-list a,
.deal-facts dd a { color: var(--accent-strong); }
.attachment-row > a:hover { border-color: var(--accent); }

.auth-progress li,
.create-steps li { border-radius: 11px; background: #f1f2f6; }
.auth-progress li.is-active,
.create-steps li.is-active { color: #056c89; border-color: #b8e7f3; background: var(--accent-wash); }
.create-steps li.is-complete { color: #056c89; }
.create-steps li.is-active span,
.create-steps li.is-complete span,
.step-number { color: #fff; border-color: var(--accent); background: var(--accent); }
.upload-field { border-color: #8fd8ea; color: #056f8e; background: #f1fbfe; }
.ai-shortcut { border-color: #b8e7f3; color: #056f8e; background: var(--accent-wash); }
.ai-shortcut:hover { border-color: var(--accent); }
.preview-card { background: #f2f3f7; }

.tabs button.is-active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.request-list__item.is-active { color: var(--ink); background: var(--accent-wash); box-shadow: inset 3px 0 var(--accent); }
.chat-tabs button.is-active { color: #075f77; background: var(--accent-wash); }
.chat-preview.is-active,
.chat-directory .chat-preview.is-active { background: var(--accent-wash); }
.chat-preview b,
.chat-directory .chat-preview b { color: #fff; background: var(--accent); }
.saved-search button { background: var(--accent); }
.switch input, .check-row input, .consent-check input { accent-color: var(--accent); }

.quick-link:hover, .quick-link:focus-visible { color: var(--accent-strong); border-color: #9fdfee; transform: translateY(-1px); }
.admin-metrics strong { color: var(--accent-strong); }
.notification-list article.is-unread { background: linear-gradient(90deg,var(--accent-wash),transparent 68%); }
.profile-mark { color: #075f77; background: var(--accent-wash); }
.pro-card { background: linear-gradient(135deg,#fff,#eefafe); }
.pro-card::after { border-color: #a8e3f1; }
.pro-badge { background: var(--accent); }
.pro-card .ui-icon { color: var(--accent-strong); }

.workspace-main--messages { height: calc(100dvh - 80px); min-height: 0; background: #f6f7f9; }
.messages-shell,
.chat-panel { min-height: calc(100vh - 80px); }
.chat-list { border-right-color: var(--line); background: #f6f7f9; }
.chat-panel { background: #fff; }
.chat-context { border-color: var(--line); border-radius: 14px; background: #f7f8fa; }
.message--me p { background: #e7f8fd; }
.chat-compose__tool:hover, .chat-compose__tool:focus-visible { color: var(--accent-strong); border-color: #9fdfee; background: var(--accent-wash); }
.chat-tool-item--primary { color: #075f77; background: var(--accent-wash); }
.chat-tool-item--primary:hover, .chat-tool-item--primary:focus-visible { color: #054e62; background: #d5f3fa; }
.chat-tools-toggle:hover, .chat-tools-toggle:focus-visible, .chat-tools-toggle[aria-expanded="true"] { border-color: #afdfea; background: var(--accent-wash); }
.ai-summary { border-color: #bde8f3; background: #f0fbfe; }
.ai-summary .eyebrow { display: block; color: #276779; }
.ai-summary__close:focus-visible { outline-color: rgba(8,167,215,.32); }
.result-confirmation { border-color: #bde8f3; background: #f2fbfe; }

.service-label { color: var(--ink); }
.legal-article { max-width: 76ch; }
.legal-article p { color: #4f525c; }

@media (max-width: 820px) {
  .workspace-main { min-height: calc(100vh - 72px); }
  .workspace-main--guest { min-height: calc(100vh - 72px); }
  .workspace-main--messages { height: calc(100dvh - 72px); }
  .messages-shell, .chat-panel { min-height: calc(100vh - 72px); }
  .app-shell { width: min(100% - 40px,1140px); }
}

@media (max-width: 560px) {
  .workspace-main { padding-top: 30px; padding-bottom: 54px; }
  .workspace-main--messages { padding: 0; }
  .app-shell { width: min(100% - 28px,1140px); }
  .page-heading h1 { font-size: clamp(34px,10vw,44px); }
  .app-card { padding: 18px; border-radius: 13px; }
  .registration-card { border-radius: 16px; }
  .quick-link { min-height: 110px; }
}

/* Owner feedback: denser pages and a true list-detail messages workspace. */
.workspace-main:not(.workspace-main--messages) { min-height: 0; padding: 30px 0 52px; }
.workspace-main--guest { min-height: calc(100vh - 80px); }
.page-heading { margin-bottom: 22px; }
.page-heading h1 { font-size: clamp(36px, 4vw, 48px); }
.page-heading > div > p:not(.eyebrow) { margin-top: 10px; font-size: 15px; }
.app-card { padding: clamp(18px, 2vw, 24px); }
.profile-content { gap: 13px; }
.profile-columns { gap: 13px; }
.quick-grid, .document-grid, .admin-metrics { gap: 10px; }
.quick-link { min-height: 106px; padding: 17px; font: inherit; cursor: pointer; }
.quick-link .header-icon { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.messages-shell { grid-template-columns: minmax(310px, 360px) minmax(0, 1fr); background: #fff; }
.workspace-main--messages { padding: 0; }
.chat-list { min-height: 0; overflow: hidden; background: #f8f9fb; }
.chat-list__heading { padding: 22px 20px 11px; }
.chat-list h1 { font-size: 24px; }
.chat-search { margin-top: 14px; }
.chat-tabs { padding: 0 20px 10px; }
.chat-tabs button { min-height: 40px; cursor: pointer; }
.chat-previews { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.chat-preview { min-height: 76px; align-items: center; padding: 12px 18px; font: inherit; cursor: pointer; }
.chat-preview:hover, .chat-preview:focus-visible { background: #f0f2f5; }
.chat-preview.is-active { background: var(--accent-wash); }
.chat-preview[hidden] { display: none; }
.chat-preview__meta { display: grid; align-self: stretch; justify-items: end; gap: 5px; color: #888b95; font-size: 10px; }
.chat-preview__meta b { align-self: end; }
.chat-preview__meta time { white-space: nowrap; }
.chat-panel { background: #fff; }
.chat-panel.is-empty { display: grid; grid-template-rows: 1fr; place-items: center; }
.chat-empty { display: grid; max-width: 390px; justify-items: center; padding: 34px; color: #6e727e; text-align: center; }
.chat-empty svg { width: 62px; height: 62px; margin-bottom: 16px; fill: none; stroke: var(--accent); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.chat-empty h2 { margin: 0; color: var(--ink); font-size: 24px; letter-spacing: -.025em; }
.chat-empty p { margin: 9px 0 0; line-height: 1.5; }
.chat-back { display: none; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 12px; place-items: center; color: #5e626d; background: #f2f3f6; cursor: pointer; }
.chat-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.chat-back:hover, .chat-back:focus-visible { color: var(--accent-strong); background: var(--accent-wash); }
.chat-panel__title { display: grid; gap: 3px; min-width: 0; }
.chat-panel__title h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-panel__title p { margin: 0; color: #7a7e89; font-size: 11px; }
.chat-readonly { margin: 0 27px 18px; padding: 14px 16px; border-radius: 12px; color: #636773; background: #f1f2f5; font-size: 12px; text-align: center; }

@media (max-width: 820px) {
  .workspace-main:not(.workspace-main--messages) { padding: 24px 0 40px; }
  .page-heading { gap: 14px; margin-bottom: 18px; }
  .page-heading h1 { font-size: clamp(33px, 8vw, 42px); }
  .messages-shell { grid-template-columns: 1fr; }
  .messages-shell .chat-list { display: grid; }
  .messages-shell .chat-panel { display: none; }
  .messages-shell.is-chat-open .chat-list { display: none; }
  .messages-shell.is-chat-open .chat-panel { display: grid; }
  .workspace-main--messages { height: calc(100dvh - 72px); }
  .chat-back { display: grid; }
}

@media (max-width: 560px) {
  .workspace-main:not(.workspace-main--messages) { padding: 20px 0 34px; }
  .app-card { padding: 16px; }
  .quick-link { min-height: 96px; padding: 14px; }
  .chat-list__heading { padding: 18px 14px 9px; }
  .chat-tabs { padding: 0 14px 8px; }
  .chat-preview { min-height: 72px; padding: 11px 14px; }
  .chat-panel__header { gap: 9px; }
  .chat-panel__header-actions { gap: 5px; }
  .chat-panel__title h1 { font-size: 17px; }
  .chat-empty { padding: 24px; }
  .chat-empty h2 { font-size: 22px; }
  .chat-readonly { margin: 0 14px 12px; }
}

/* 2026-09-11 — responsive working surfaces: keep real content and controls
   inside their columns, with task context readable at compact widths. */
.form-grid { align-items: end; }
.form-grid > .field > span { overflow-wrap: anywhere; }
.field > input, .field > select, .field > textarea { max-width: 100%; }
.page-heading > div, .request-status-card > div, .management-list > article > div { min-width: 0; }
.page-heading h1, .auth-stage__copy h1 { overflow-wrap: break-word; }
.request-card-top { flex-wrap: wrap; gap: 6px 10px; }
.request-card-top > span:not(.status-pill) { color: #747783; font-size: 12px; line-height: 1.45; }
.request-status-card h3, .management-list h3 { overflow-wrap: anywhere; }
.status-pill { max-width: 100%; }
.ai-layout { align-items: start; }
.draft-list dt, .draft-list dd { min-width: 0; overflow-wrap: anywhere; }
.profile-columns > .profile-billing { margin-top: 0; }
.profile-columns .row-actions .button { margin-top: 0; }
.registration-card .auth-progress li::after { content: none; }
.registration-card > .field + .field { margin-top: 14px; }
.admin-grid .ai-summary { display: block; margin: 16px 0; padding: 14px; }
.admin-grid .ai-summary > div:last-child { display: block; min-width: 0; }
.admin-grid .ai-summary .eyebrow { margin-bottom: 7px; }
.admin-grid .ai-summary p { overflow-wrap: anywhere; }
.chat-panel__title { flex: 1 1 auto; }
.chat-panel__header-actions, .chat-back { flex: 0 0 auto; }
.chat-compose textarea::placeholder { white-space: nowrap; }
.chat-list { grid-template-rows: auto auto minmax(0, 1fr); }

@media (max-width: 1120px) and (min-width: 561px) {
  .form-grid--route { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .create-layout { grid-template-columns: minmax(0, 1fr); }
  .create-aside { position: static; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .create-aside .ai-shortcut { min-height: 64px; }
  .auth-stage { grid-template-columns: minmax(0, 1fr); gap: 28px; max-width: 680px; }
  .auth-stage__copy h1 { font-size: clamp(36px, 5.5vw, 48px); }
}

@media (max-width: 820px) {
  .request-status-card, .management-list > article { align-items: flex-start; flex-direction: column; gap: 14px; }
  .request-status-card > .row-actions { width: 100%; flex-basis: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .request-status-card > .button, .management-list > article > .row-actions { width: 100%; }
  .management-list > article > .row-actions .button { flex: 1 1 auto; }
  .field > input, .field > select, .field > textarea, .chat-search input, .chat-compose textarea { font-size: 16px; }
  .tabs button { min-height: 44px; }
  .chat-search input { min-width: 0; }
  .create-steps li { flex-direction: column; justify-content: center; gap: 5px; min-height: 64px; font-size: 11px; }
  .create-steps li::after { content: none; }
}

@media (max-width: 560px) {
  .form-grid--route, .create-aside { grid-template-columns: minmax(0, 1fr); }
  .create-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .create-actions .button { min-width: 0; padding-inline: 10px; }
  .request-status-card > .row-actions { grid-template-columns: minmax(0, 1fr); }
  .request-status-card > .row-actions > .request-action--wide { white-space: normal; }
  .request-status-card .status-pill { white-space: normal; padding-block: 5px; line-height: 1.4; }
  .request-card-top { align-items: flex-start; }
  .request-card-top > span:not(.status-pill) { flex-basis: 100%; }
  .management-list > article > .row-actions { align-items: center; }
  .management-list > article > .row-actions .button { width: auto; }
  .workspace-main--messages .chat-context { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-height: 0; }
  .workspace-main--messages .chat-context > div:last-child { margin-left: 0; }
  .workspace-main--messages .chat-context .status-pill { width: fit-content; white-space: normal; }
  .workspace-main--messages .chat-context p { min-width: 0; }
  .workspace-main--messages .chat-context strong { overflow-wrap: anywhere; }
  .workspace-main--messages .chat-compose { flex-wrap: wrap; }
  .workspace-main--messages .chat-compose textarea { min-height: 46px; }
  .auth-progress li { min-width: 0; }
}

@media (max-width: 360px) {
  .chat-panel__title h1 { font-size: 15px; }
  .workspace-main--messages .chat-compose textarea { flex-basis: calc(100% - 56px); }
  .workspace-main--messages .chat-compose__send { width: 100%; }
}
