:root {
  --bg: #f3f0ea;
  --surface: #fffdf9;
  --ink: #18212a;
  --muted: #77808a;
  --accent: #ea4729;
  --line: rgba(24, 33, 42, .13);
  --dark: #18212a;
  --shadow: 0 20px 60px rgba(24, 33, 42, .08);
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-family: Manrope, system-ui, sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted, .form-note { color: var(--muted); }
.eyebrow { margin: 0 0 12px; color: var(--accent); font: 11px "DM Mono", monospace; letter-spacing: .14em; text-transform: uppercase; }
.login-view { width: min(100% - 32px, 580px); min-height: 100vh; margin: auto; padding: 10vh 0; }
.login-mark, .brand-mark { display: grid; place-items: center; color: #fff; background: var(--accent); font-weight: 800; }
.login-mark { width: 52px; height: 52px; margin-bottom: 28px; border-radius: 16px; font-size: 22px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(36px, 7vw, 68px); line-height: .98; letter-spacing: -.07em; }
h1 em { color: var(--accent); font-style: normal; }
h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -.06em; }
h3 { margin-bottom: 0; font-size: 18px; letter-spacing: -.04em; }
.login-view > .muted { max-width: 450px; line-height: 1.6; }
.panel { background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login-panel { display: grid; gap: 16px; max-width: 430px; margin-top: 30px; padding: 22px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 11px; outline: none; }
input, select { height: 44px; padding: 0 12px; }
textarea { min-height: 88px; padding: 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(234, 71, 41, .12); }
.primary-button, .ghost-button, .send-button { border-radius: 11px; border: 0; font-weight: 800; }
.primary-button { min-height: 44px; padding: 0 16px; color: #fff; background: var(--accent); }
.primary-button:hover { filter: brightness(.95); transform: translateY(-1px); }
.ghost-button { min-height: 38px; padding: 0 13px; color: var(--ink); background: transparent; border: 1px solid var(--line); }
.form-error { margin: 0; color: #b5221a; font-size: 12px; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 72px; padding: 0 max(20px, calc((100vw - 1440px) / 2)); border-bottom: 1px solid var(--line); background: rgba(255,253,249,.7); backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; }
.dot { color: var(--accent); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.role-badge { padding: 7px 10px; color: #20854b; background: rgba(38,174,99,.12); border-radius: 999px; font: 10px "DM Mono", monospace; text-transform: uppercase; }
.telegram-alert { display: flex; align-items: flex-start; gap: 12px; width: min(100% - 40px, 1440px); margin: 14px auto 0; padding: 14px 16px; border: 1px solid rgba(234,71,41,.3); border-radius: 15px; background: rgba(234,71,41,.1); box-shadow: 0 8px 24px rgba(24,33,42,.05); }
.telegram-alert.disabled { color: #785d1a; background: rgba(230,187,103,.16); border-color: rgba(180,136,38,.3); }
.telegram-alert.limited { color: #785d1a; background: rgba(230,187,103,.16); border-color: rgba(180,136,38,.3); }
.telegram-alert.blocked { color: #8f2f1d; background: rgba(181,34,26,.14); border-color: rgba(181,34,26,.3); }
.telegram-alert.unavailable { color: #8f2f1d; background: rgba(181,34,26,.1); border-color: rgba(181,34,26,.25); }
.telegram-alert-mark { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; color: #fff; background: var(--accent); border-radius: 9px; font-weight: 800; }
.telegram-alert.disabled .telegram-alert-mark, .telegram-alert.limited .telegram-alert-mark { color: #785d1a; background: #f3d78f; }
.telegram-alert-copy { min-width: 0; }
.telegram-alert-copy strong { display: block; font-size: 13px; }
.telegram-alert-copy p { margin: 4px 0 0; line-height: 1.45; font-size: 12px; }
.telegram-alert-copy small { display: block; margin-top: 6px; opacity: .75; font: 10px "DM Mono", monospace; }
.telegram-restart-button { margin-top: 10px; padding: 8px 11px; color: #5c4510; background: rgba(255,255,255,.68); border: 1px solid rgba(120,93,26,.28); border-radius: 9px; font: 700 11px "DM Mono", monospace; cursor: pointer; }
.telegram-restart-button:hover { background: #fff; }
.telegram-restart-button:disabled { cursor: wait; opacity: .6; }
.layout { width: min(100% - 40px, 1440px); min-height: calc(100vh - 72px); margin: auto; }
.sidebar { display: flex; align-items: center; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.sidebar nav { display: flex; flex: 1 1 auto; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-cluster { display: flex; flex: 0 0 auto; gap: 5px; }
.nav-cluster + .nav-cluster { margin-left: 7px; padding-left: 12px; border-left: 1px solid var(--line); }
.nav-button { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 11px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 11px; text-align: left; font-size: 11px; font-weight: 800; white-space: nowrap; transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.nav-icon { display: grid; place-items: center; width: 21px; height: 21px; color: var(--muted); background: rgba(24,33,42,.06); border-radius: 7px; font: 12px "DM Mono", monospace; line-height: 1; transition: color .18s ease, background .18s ease; }
.nav-button:hover, .nav-button.active { color: var(--ink); background: var(--surface); border-color: var(--line); }
.nav-button:hover .nav-icon { color: var(--accent); background: rgba(234,71,41,.1); }
.nav-button.active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 7px 18px rgba(234,71,41,.2); }
.nav-button.active .nav-icon { color: var(--accent); background: #fff; }
.nav-button-priority:not(.active) { color: var(--ink); background: rgba(234,71,41,.055); border-color: rgba(234,71,41,.16); }
.nav-button-priority:not(.active) .nav-icon { color: var(--accent); background: rgba(234,71,41,.12); }
.sidebar-note { display: flex; flex: 0 1 270px; align-items: center; gap: 8px; min-width: 190px; max-width: 270px; padding: 8px 10px; color: var(--muted); background: rgba(234,71,41,.08); border-radius: 12px; font-size: 9px; line-height: 1.35; }
.sidebar-note strong { flex: 0 0 auto; color: var(--accent); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-note span { min-width: 0; }
.settings-subpage { margin-top: 0; }
.settings-tabs { display: flex; flex-wrap: nowrap; gap: 5px; padding: 5px; background: rgba(255,253,249,.78); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 25px rgba(24,33,42,.045); overflow-x: auto; scrollbar-width: thin; }
.settings-tabs .section-tab { display: inline-flex; flex: 1 1 0; align-items: center; justify-content: center; gap: 8px; min-width: 118px; border-color: transparent; }
.settings-tab-icon { display: grid; place-items: center; width: 20px; height: 20px; color: var(--muted); background: rgba(24,33,42,.06); border-radius: 6px; font: 11px "DM Mono", monospace; line-height: 1; }
.settings-tabs .section-tab:hover .settings-tab-icon { color: var(--accent); background: rgba(234,71,41,.12); }
.settings-tabs .section-tab.active .settings-tab-icon { color: var(--dark); background: #fff; }
.settings-tab-panel { animation: settings-panel-in .2s ease-out; }
@keyframes settings-panel-in { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }
.main-content { min-width: 0; padding: 32px 0 80px; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 25px; }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.metric span { display: block; color: var(--muted); font: 10px "DM Mono", monospace; text-transform: uppercase; }
.metric strong { display: block; margin-top: 13px; font-size: 28px; letter-spacing: -.06em; }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.chart-panel { min-height: 250px; padding: 20px; }
.chart-heading { display: flex; justify-content: space-between; gap: 15px; }
.chart-heading h3 { margin: 0; }
.chart-heading .muted { margin: 6px 0 0; font-size: 11px; }
.chart-mark { display: grid; place-items: center; flex: 0 0 38px; width: 38px; height: 38px; color: #fff; background: var(--dark); border-radius: 12px; font-size: 18px; }
.bar-chart { display: grid; gap: 13px; margin-top: 22px; }
.bar-row { display: grid; gap: 6px; }
.bar-label { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.bar-label strong { color: var(--ink); font: 12px "DM Mono", monospace; }
.bar-track { height: 8px; overflow: hidden; background: var(--bg); border-radius: 999px; }
.bar-track i { display: block; height: 100%; min-width: 6px; background: var(--accent); border-radius: inherit; }
.chart-empty { min-height: 120px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.quick-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 18px; padding: 22px; }
.quick-panel .muted { max-width: 580px; margin: 9px 0 0; line-height: 1.5; font-size: 13px; }
.editor-card { margin-bottom: 18px; padding: 22px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.guide-card { min-height: 260px; padding: 22px; }
.guide-card h3 { margin: 0 0 18px; }
.guide-copy { color: var(--ink); line-height: 1.75; font-size: 13px; }
.guide-grid-detailed { align-items: stretch; }
.guide-grid-detailed .guide-card { min-height: 0; }
.guide-list { display: grid; gap: 9px; margin: 0; padding-left: 20px; color: var(--ink); line-height: 1.55; font-size: 12px; }
.guide-list li::marker { color: var(--accent); font: 11px "DM Mono", monospace; }
.section-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.section-intro .muted { max-width: 650px; margin: 8px 0 0; line-height: 1.5; font-size: 12px; }
.form-mark { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; color: #fff; background: var(--accent); border-radius: 13px; font-size: 20px; font-weight: 800; }
.split-panel { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: 580px; overflow: hidden; }
.conversation-list { padding: 14px; border-right: 1px solid var(--line); }
.conversation { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px; color: var(--ink); background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: left; }
.conversation:hover, .conversation.selected { background: var(--bg); border-color: var(--line); }
.conversation-avatar { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; color: #fff; background: var(--dark); border-radius: 10px; font-size: 12px; font-weight: 800; }
.conversation-copy { display: grid; min-width: 0; gap: 3px; }
.conversation-copy strong, .conversation-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-copy strong { font-size: 12px; }
.conversation-copy small { color: var(--muted); font-size: 10px; }
.conversation-meta { display: flex; align-items: center; gap: 5px; margin-left: auto; color: var(--muted); font-size: 9px; white-space: nowrap; }
.unanswered-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: #fff; background: var(--accent); border-radius: 999px; font: 10px "DM Mono", monospace; }
.delivery-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: #8f2f1d; background: rgba(181,34,26,.14); border-radius: 999px; font: 10px "DM Mono", monospace; }
.thread { display: flex; flex-direction: column; min-width: 0; padding: 18px; }
.thread-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.thread-head-actions { display: flex; align-items: flex-start; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.thread-title { margin: 0; color: var(--muted); font: 11px "DM Mono", monospace; text-transform: uppercase; }
.category-controls { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.category-controls select { width: auto; height: 32px; font-size: 11px; }
.category-controls small { width: 100%; color: var(--accent); text-align: right; }
.chat-toolbar { display: flex; gap: 10px; margin: -8px 0 14px; }
.chat-toolbar input { flex: 1; }
.chat-toolbar select { width: 220px; }
.chat-switcher { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 16px; }
.chat-switcher .section-tab small { margin-left: 5px; opacity: .7; font-size: 9px; font-weight: 500; }
.team-chat-view { display: grid; gap: 14px; }
.team-chat-intro { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 18px 20px; }
.team-chat-intro-actions { display: flex; align-items: center; gap: 12px; }
.team-chat-intro h3 { margin: 0; }
.team-chat-intro .muted { max-width: 680px; margin: 7px 0 0; line-height: 1.55; font-size: 12px; }
.team-thread { display: flex; flex-direction: column; min-height: 520px; padding: 18px; }
.team-sender { display: block; margin-bottom: 5px; color: var(--accent); font: 10px "DM Mono", monospace; letter-spacing: .04em; }
.own .team-sender { color: #ffad9e; }
.section-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.section-tab { min-height: 36px; padding: 0 13px; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; font-weight: 800; }
.section-tab:hover, .section-tab.active { color: #fff; background: var(--dark); border-color: var(--dark); }
.orders-tab-panel, .settings-tab-panel { min-width: 0; }
.team-tab-panel { min-width: 0; }
.catalog-tabs { margin-top: -8px; }
.messages { display: flex; flex: 1; flex-direction: column; gap: 9px; min-height: 230px; max-height: 430px; padding: 20px 0; overflow-y: auto; }
.message-row { display: flex; }
.message-row.own { justify-content: flex-end; }
.bubble { max-width: min(78%, 580px); padding: 10px 13px 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 15px 15px 15px 4px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; font-size: 13px; }
.own .bubble { color: #fff; background: var(--dark); border-color: var(--dark); border-radius: 15px 15px 4px 15px; }
.message-media-link { display: block; margin: -2px -4px 8px; }
.message-media { display: block; width: min(100%, 320px); max-height: 260px; object-fit: cover; border-radius: 10px; }
.message-video { background: #000; object-fit: contain; }
.attachment-caption { display: block; margin-top: 7px; opacity: .8; font-size: 11px; }
.bubble time { display: block; margin-top: 4px; opacity: .55; font: 10px "DM Mono", monospace; text-align: right; }
.delivery-status, .delivery-error { display: block; margin-top: 5px; font: 10px "DM Mono", monospace; }
.delivery-status.sent { color: #75d69b; }
.delivery-status.pending { color: #e6bb67; }
.delivery-status.failed { color: #ff9b8f; }
.delivery-error { color: #ffb2a8; white-space: normal; }
.empty-state { display: grid; place-items: center; min-height: 130px; color: var(--muted); font-size: 12px; text-align: center; }
.composer { display: flex; align-items: flex-end; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.composer-main { display: flex; align-items: flex-end; flex: 1; min-width: 0; gap: 8px; }
.composer textarea { flex: 1; min-width: 0; width: auto; min-height: 48px; max-height: 130px; }
.composer-tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 48px; padding: 0; }
.attachment-button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; color: var(--accent); background: rgba(234,71,41,.1); border: 1px solid rgba(234,71,41,.18); border-radius: 12px; cursor: pointer; font-size: 22px; font-weight: 700; line-height: 1; }
.attachment-button input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.attachment-name { max-width: min(180px, 18vw); overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.send-button { flex: 0 0 48px; width: 48px; height: 48px; color: #fff; background: var(--accent); font-size: 22px; }
.order-create, .catalog-editor, .settings-panel { margin-bottom: 18px; padding: 22px; }
.product-image-field { gap: 8px; }
.field-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.image-picker { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(150px, 220px); gap: 12px; align-items: stretch; }
.image-picker-button { display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 140px; padding: 20px; color: var(--accent); background: rgba(234,71,41,.06); border: 1px dashed rgba(234,71,41,.42); border-radius: 14px; cursor: pointer; text-align: center; }
.image-picker-button:hover { background: rgba(234,71,41,.11); }
.image-picker-button span:not(.image-picker-icon) { font-size: 13px; font-weight: 800; }
.image-picker-button small { margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 500; }
.image-picker-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 9px; color: #fff; background: var(--accent); border-radius: 12px; font-size: 25px; line-height: 1; }
#product-image { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 18px; }
.form-grid .wide, .form-grid .primary-button, .form-grid .button-row { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; grid-column: 1 / -1; gap: 10px; }
.check-label { display: flex; align-items: center; gap: 9px; align-self: center; color: var(--ink); }
.check-label input { width: 17px; height: 17px; accent-color: var(--accent); }
.button-row { display: flex; gap: 10px; }
.table-panel { margin-top: 18px; padding: 20px; }
.table-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.table-heading h3 { margin: 0; }
.table-heading .muted { margin: 5px 0 0; font-size: 11px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { color: var(--muted); font: 10px "DM Mono", monospace; text-align: left; text-transform: uppercase; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { color: var(--ink); }
.table-subtext { display: block; max-width: 260px; margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; font-size: 10px; white-space: nowrap; }
.table-product-image, .table-product-placeholder { display: grid; place-items: center; width: 44px; height: 44px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.table-product-image { object-fit: cover; }
.product-image-field small { color: var(--muted); font-size: 10px; font-weight: 500; }
.product-image-preview { width: min(100%, 220px); height: 140px; margin-top: 2px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; }
.action-cell { display: flex; flex-wrap: wrap; gap: 6px; }
.danger-action { color: #b5221a; border-color: rgba(181,34,26,.25); }
.empty-cell { padding: 24px 10px; color: var(--muted); text-align: center; }
.status-pill { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: rgba(24,33,42,.08); font: 10px "DM Mono", monospace; }
.status-pill.good { color: #20854b; background: rgba(38,174,99,.12); }
.table-action { padding: 5px 8px; color: var(--accent); background: transparent; border: 1px solid rgba(234,71,41,.25); border-radius: 8px; font-size: 11px; }
.guide-visuals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.guide-visual { overflow: hidden; }
.guide-visual img { display: block; width: 100%; height: auto; border-bottom: 1px solid var(--line); }
.guide-visual figcaption { display: grid; gap: 4px; padding: 14px 16px 16px; font-size: 12px; }
.guide-visual figcaption span { color: var(--muted); line-height: 1.45; font-size: 11px; }
.provider-status { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.provider { padding: 8px 10px; border-radius: 9px; background: rgba(24,33,42,.07); font: 11px "DM Mono", monospace; }
.provider.ok { color: #20854b; background: rgba(38,174,99,.12); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 4; max-width: 360px; padding: 12px 15px; color: #fff; background: var(--dark); border-radius: 11px; box-shadow: var(--shadow); font-size: 13px; }
.composer-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
@media (max-width: 1050px) { .metric-grid { grid-template-columns: repeat(3, 1fr); } .sidebar { flex-wrap: wrap; gap: 10px; } .sidebar nav { flex-basis: 100%; order: 1; } .sidebar-note { flex-basis: auto; margin-left: auto; } }
@media (max-width: 760px) {
  .layout { display: block; width: min(100% - 24px, 680px); }
  .sidebar { display: block; padding: 12px 0 10px; border-right: 0; }
  .sidebar nav { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
  .nav-cluster { display: contents; }
  .nav-cluster + .nav-cluster { margin-left: 0; padding-left: 0; border-left: 0; }
  .nav-button { flex: 0 0 auto; min-height: 40px; padding: 0 12px; font-size: 12px; }
  .sidebar-note { max-width: none; margin-top: 8px; }
  .main-content { padding: 12px 0 50px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .split-panel { grid-template-columns: 1fr; }
  .conversation-list { max-height: 240px; overflow-y: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .quick-panel { align-items: flex-start; flex-direction: column; }
  .chat-toolbar { flex-direction: column; }
  .chat-toolbar select { width: 100%; }
  .chat-switcher { margin-top: 0; }
  .team-chat-intro { padding: 15px; }
  .team-thread { min-height: 460px; padding: 14px; }
  .thread { padding: 14px; }
  .thread-head { flex-direction: column; }
  .category-controls { justify-content: flex-start; width: 100%; }
  .category-controls small { text-align: left; }
  .composer { gap: 7px; }
  .composer-main { gap: 6px; }
  .composer .send-button { flex-basis: 44px; width: 44px; height: 44px; }
  .attachment-name { display: none; }
  .message-media { max-height: 220px; }
  .dashboard-grid, .guide-visuals { grid-template-columns: 1fr; }
  .settings-tabs .section-tab { flex: 0 0 auto; min-width: 122px; }
  .image-picker { grid-template-columns: 1fr; }
  .image-picker-button { min-height: 110px; }
}
@media (max-width: 500px) {
  .topbar { position: sticky; top: 0; z-index: 3; padding: 0 12px; }
  .role-badge { display: none; }
  .telegram-alert { width: min(100% - 16px, 680px); margin-top: 8px; padding: 12px; }
  .layout { width: min(100% - 16px, 680px); }
  .sidebar { padding: 13px 0 8px; }
  .main-content { padding-top: 8px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide, .form-grid .primary-button, .form-grid .button-row { grid-column: auto; }
  .page-heading { align-items: stretch; flex-direction: column; gap: 12px; margin-bottom: 16px; }
  .page-heading h2 { font-size: 30px; }
  .panel, .table-panel, .order-create, .catalog-editor, .settings-panel { border-radius: 15px; }
  .table-panel { padding: 14px; }
}
@media (max-width: 760px) { .guide-grid { grid-template-columns: 1fr; } }