/* ITUS: same screens and control positions, updated visual system. */
:root{--bg:#f4f5f7;--card:#fff;--text:#202632;--muted:#687180;--blue:#b92824;--red:#d9362b;--line:#e4e7ec;--soft:#f2f3f5;--ok:#16704b;--warn:#8a5b0a;--bad:#b4232a;--shadow:0 4px 18px #20263206;--focus:#ba2925}
html{font-size:1rem;background:var(--bg)}
body{background:var(--bg);font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;font-size:1rem;line-height:1.5}
body::after{display:none}.brand-rail{width:3px;background:#ba2925}
.phone{width:100%;max-width:var(--app-shell-max,560px);padding-right:var(--app-shell-gutter,16px);padding-left:var(--app-shell-gutter,16px)}
.top{gap:10px;padding:10px 0 14px;margin-bottom:10px;border-bottom:1px solid var(--line);background:#f4f5f7f5;backdrop-filter:blur(16px)}
.logo{flex:0 0 62px;width:62px;height:62px;padding:0;border:1px solid #eee;border-radius:16px;box-shadow:none;background:#fff}
.logo img{width:100%;height:100%;object-fit:contain;transform:scale(1.65);transform-origin:50% 53%}
.product h1{color:var(--text);font-size:1.3125rem;letter-spacing:.07em;font-weight:800;line-height:1.1}.product h1::after{display:none}.product p{font-size:0.75rem;line-height:1.35;max-width:195px}
.user-panel{min-width:120px;max-width:170px;border-radius:14px;padding:9px;box-shadow:none;background:#fff;gap:7px}
.avatar{background:#faeae8;color:#ae2923;font-size:0.875rem;font-weight:700}.user-name{color:var(--text);font-size:0.8125rem;font-weight:700}.user-role{font-size:0.75rem;font-weight:500}
.tabs{top:87px;gap:6px;padding:4px 0 12px;margin-bottom:4px;background:#f4f5f7f5}
.tab{flex:1 0 52px;width:auto;height:58px;border:1px solid var(--line);border-radius:14px;box-shadow:none;padding:6px;color:#626b78}
.tab .nav-icon{display:block;width:28px;height:28px;object-fit:contain;pointer-events:none}.tab.active{background:#b92824;border-color:#b92824;box-shadow:0 4px 10px #b9282420;color:#fff}.tab.active .nav-icon{filter:brightness(0) invert(1)}
.card{padding:18px;border-radius:20px;border:1px solid var(--line);box-shadow:var(--shadow);margin-bottom:14px}.card::before{display:none}.card h2{font-size:1.125rem;line-height:1.35;letter-spacing:-.025em;font-weight:750}.card h3{font-size:1rem}.card p{line-height:1.5}.tiny{font-size:0.8125rem;line-height:1.45}
.row{flex-wrap:wrap}.row>*{min-width:0}.section-title{flex-wrap:wrap}
.button,.grid button,.primary,.secondary,.danger,.success,.question>button,.notice-actions button{min-height:46px;border-radius:12px;padding:12px;font-size:0.875rem;font-weight:650;line-height:1.3;transition:background .15s,box-shadow .15s,transform .15s}
.grid button{background:#f1f2f4;color:#343d4b;border:1px solid #e9ebef}.primary{background:#b92824;color:#fff;box-shadow:0 4px 9px #b928241c;border:1px solid #b92824}.primary:hover:not(:disabled){background:#a7211e}.secondary{box-shadow:none}.question>button{border:1px solid var(--line);background:#fff;color:var(--blue)}
button:active:not(:disabled){transform:translateY(1px)}button:disabled{cursor:not-allowed;opacity:.45}.grid{gap:9px}
input,textarea,select{font-size:1rem;min-height:48px;border-radius:12px;background:#fafbfc;border:1px solid #dfe3e8;padding:12px;color:var(--text);box-shadow:inset 0 1px 2px #20263203;margin-top:6px;margin-bottom:12px}
input:focus,textarea:focus,select:focus{background:var(--card);border-color:var(--focus);outline:3px solid #ba292512}label{font-size:0.875rem;font-weight:650}.error-text{font-size:0.8125rem}textarea{min-height:104px}
button:focus-visible,a:focus-visible{outline:3px solid #b9282470;outline-offset:3px}
.order{padding:15px;border-radius:16px;box-shadow:none}.order.active{border-color:#d9807b;background:#fff8f7;box-shadow:inset 3px 0 #b92824}.order b{font-weight:700}.order .tiny{margin-top:7px}
.badge{font-size:0.75rem;line-height:1.4;font-weight:650;padding:5px 9px;border-radius:8px;background:#f0f1f3;color:#596171;white-space:normal}.badge.warn{background:#fff4dc;color:#8a5b0a}.badge.ok{background:#eaf6ef}.badge.bad{background:#fcebea}
.stat{border-radius:12px;background:#f8f9fb;padding:12px;border:1px solid #eceef1}.stat b{font-size:0.9375rem;font-weight:650}.reason{border-left:3px solid #b92824;border-radius:10px;background:#f8f9fb;padding:12px;font-size:0.9375rem}.reason b{font-weight:650}
.empty{border:1px dashed #d4d9e1;border-radius:14px;background:#f8f9fb;font-size:0.875rem;padding:20px}.notice{border-radius:14px;box-shadow:none}
.question{border-radius:14px;padding:14px;background:#fff}.question-title{font-size:0.9375rem;font-weight:650}.question.done{background:#f6fbf8;border-color:#cbe3d5}.answer{font-size:0.9375rem;min-height:46px;border-radius:10px;font-weight:550}.answer.selected{background:#fff0ee;border-color:#c45850;color:#982720}.progress{height:6px;background:#edeff2;margin:12px 0 18px}.progress span{background:#b92824;transition:width .2s}
.topic{border-radius:13px}.topic.active{background:#fff7f6;border-color:#d9807b}.topic-title{font-weight:650;font-size:0.9375rem}.topic-preview{font-size:0.8125rem}.message{border-radius:14px;font-size:0.9375rem}.message.mine{background:#a62a26}.message-meta{font-size:0.75rem}.attachment{font-size:0.8125rem;overflow-wrap:anywhere}.message.mine .attachment{color:#762622}.attachment-preview{max-height:240px}
.entry{border-radius:12px}.entry-head{font-size:0.75rem}.entry-file{font-size:0.875rem;overflow-wrap:anywhere}.entry-file>div{min-width:0}
.overlay{background:#141a2670;backdrop-filter:blur(4px)}.sheet{border-radius:24px 24px 18px 18px;padding:20px;max-width:560px;box-shadow:0 24px 80px #10182030}.sheet-head{top:-20px;margin:-20px -20px 16px;padding:20px;background:#fffffffa;border-bottom:1px solid var(--line)}.sheet-head h2{font-size:1.1875rem;line-height:1.35;font-weight:700}.sheet-head p{font-size:0.8125rem}.icon-button{flex:0 0 44px;width:44px;height:44px;border-radius:12px}
.toast{border-radius:14px;background:#303947;font-size:0.875rem;font-weight:600;box-shadow:0 8px 24px #20263225}.toast.error{background:#a62623}footer{font-size:0.75rem;line-height:1.5}.connection-status{display:block;margin-bottom:6px;font-size:0.75rem;color:var(--muted)}.connection-status[data-status="ok"]{color:var(--ok)}.connection-status[data-status="error"]{color:var(--bad)}
@media(hover:hover){.tab:not(.active):hover,.grid button:not(:disabled):hover{background:#e9ebef}.order:hover{border-color:#c3c9d2}}
@media(max-width:390px){.phone{padding-left:12px;padding-right:12px}.top{gap:8px}.logo{flex-basis:52px;width:52px;height:52px}.product h1{font-size:1.1875rem}.product p{font-size:0.75rem}.user-panel{min-width:98px;max-width:110px;padding:7px}.user-name{font-size:0.75rem}.user-role{font-size:0.75rem}.tabs{top:88px}.tab{flex-basis:46px;height:61px}.card{padding:16px}.avatar{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

.tabs{top:var(--header-height,90px)}

/* Review 2.2: opaque surfaces and readable text, preserving screen structure. */
:root{--muted:#4b5563;--line:#cbd1da}
body{font-family:Arial,'Segoe UI',sans-serif;color:#17212f;line-height:1.55}
.top,.tabs{background:#f4f5f7;backdrop-filter:none;-webkit-backdrop-filter:none}
.top{flex-wrap:wrap}.product{flex:1;min-width:100px}
.user-panel{max-width:210px}.user-name{white-space:normal;overflow-wrap:anywhere;font-size:0.875rem}
.sheet,.sheet-head,.card,.question{background:#fff;backdrop-filter:none}
.overlay{background:rgba(18,24,34,.7);backdrop-filter:none;-webkit-backdrop-filter:none}
.tiny,.message-meta,.entry-head,.topic-preview{font-size:0.875rem}
.message-meta{display:block;line-height:1.5;color:#435063}
.message.mine .message-meta{color:#fff}.message.mine .attachment{color:#762622}
.card h2,.card h3{letter-spacing:normal;font-weight:700}
input,textarea,select{background:#fff;border-color:#aeb8c5}
.bot-unread{margin-left:auto;border:1px solid #b92824;border-radius:10px;background:#fff;color:#9e201c;padding:8px 12px;font-weight:700;font-size:0.875rem}
.bot-unread[hidden]{display:none}
.setting-row{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #d1d7df}
.setting-row input{width:22px;height:22px;min-height:22px;flex:0 0 22px;margin:0}
.review-banner{background:#fff3cd;color:#5c4300;padding:12px;font:16px Arial,sans-serif}

/* v2.6.1: compact fixed application header */
.top{position:fixed;top:0;left:50%;transform:translateX(-50%);width:min(520px,100%);padding:calc(8px + env(safe-area-inset-top)) 14px 10px;margin-bottom:0}
.phone{padding-top:calc(var(--header-height,78px) + 12px)}
.product p{display:none}
.tabs{top:var(--header-height,78px)}
@media(max-width:390px){.top{padding-left:11px;padding-right:11px}.phone{padding-top:calc(var(--header-height,70px) + 10px)}.tabs{top:var(--header-height,70px)}}

/* Compact unread badge belongs to the Chats navigation button. */
.tab{position:relative}
.tab .chat-unread-dot{position:absolute;top:4px;right:6px;display:flex;align-items:center;justify-content:center;min-width:19px;height:19px;padding:0 4px;border-radius:999px;background:#c52b27;color:#fff;border:2px solid #fff;font-size:0.625rem;font-weight:800;line-height:1;box-sizing:border-box;pointer-events:none}
.tab .chat-unread-dot[hidden]{display:none}
.tab.active .chat-unread-dot{background:#fff;color:#b92824;border-color:#fff}

/* Responsive shell: existing content is reflowed, never globally scaled. */
:root{--app-shell-max:560px;--app-shell-gutter:16px;--app-safe-top:var(--safe-area-inset-top,env(safe-area-inset-top,0px));--app-safe-bottom:var(--safe-area-inset-bottom,env(safe-area-inset-bottom,0px));--app-safe-left:var(--safe-area-inset-left,env(safe-area-inset-left,0px));--app-safe-right:var(--safe-area-inset-right,env(safe-area-inset-right,0px))}
.phone{padding-left:max(var(--app-shell-gutter),var(--app-safe-left));padding-right:max(var(--app-shell-gutter),var(--app-safe-right))}
.top{width:min(var(--app-shell-max),100%);flex-wrap:nowrap;gap:10px;padding:calc(8px + var(--app-safe-top)) max(var(--app-shell-gutter),var(--app-safe-right)) 8px max(var(--app-shell-gutter),var(--app-safe-left))}
.top .logo{flex:0 0 44px;width:44px;height:44px;border-radius:12px}
.top .product{flex:0 0 auto;min-width:0}.top .product h1{font-size:1.125rem;letter-spacing:.03em}
.top .user-panel{margin-left:auto;min-width:0;max-width:210px;padding:7px;flex:0 1 210px}.top .user-meta{min-width:0;flex:1}.top .user-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.75rem}.top .user-role{font-size:0.6875rem}
@media (max-width:390px){:root{--app-shell-gutter:12px}.top{gap:8px}}
@media (min-width:600px){:root{--app-shell-max:760px;--app-shell-gutter:clamp(18px,3vw,28px)}.tabs{gap:8px}.tab{min-height:56px}.row>.primary,.row>.secondary,.row>.danger,.row>.success{width:auto;min-width:180px}}
@media (min-width:1024px){:root{--app-shell-max:1100px;--app-shell-gutter:32px}.tabs{padding-bottom:14px}.tab{flex:0 1 128px}}
@media (max-width:599px){.overlay{padding:max(10px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))}.sheet{width:100%;max-width:100%;max-height:calc(100dvh - 20px)}.sheet-head{overflow-wrap:anywhere}}
@media (max-height:560px) and (orientation:landscape){.top .logo{flex-basis:36px;width:36px;height:36px}.top{padding-top:calc(4px + var(--app-safe-top));padding-bottom:4px}.phone{padding-top:calc(var(--header-height,58px) + 8px)}.tabs{top:var(--header-height,58px);padding-bottom:6px}.tab{height:46px;min-height:46px}}
