:root {
  --ink: #18221d;
  --muted: #6d7772;
  --line: #e5ebe7;
  --paper: #ffffff;
  --canvas: #f3f6f4;
  --green: #176b45;
  --green-deep: #0e5034;
  --green-soft: #e9f5ef;
  --navy: #17263a;
  --navy-soft: #eaf0f7;
  --amber: #b66a18;
  --amber-soft: #fff5e7;
  --red: #ad3d3d;
  --red-soft: #fff0f0;
  --shadow: 0 18px 50px rgba(26, 46, 35, 0.1);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
.staff-body { height: 100%; overflow: hidden; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

.landing-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 14%, rgba(36, 128, 86, .18), transparent 32%),
    linear-gradient(145deg, #f5faf7 0%, #eef5f1 46%, #f8f6f0 100%);
}
.landing-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; min-height: 100vh; padding: 34px 0 24px; display: flex; flex-direction: column; }
.brand-lockup, .sidebar-brand, .auth-brand { display: flex; align-items: center; gap: 11px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; background: var(--green); color: white; font-weight: 800; box-shadow: 0 8px 20px rgba(23, 107, 69, .24); }
.brand-mark.small { width: 32px; height: 32px; border-radius: 9px; font-size: 14px; }
.brand-mark.dark { background: var(--navy); box-shadow: 0 8px 20px rgba(23, 38, 58, .2); }
.hero-copy { margin: auto 0 46px; max-width: 780px; }
.eyebrow { display: inline-block; color: var(--green); font-weight: 700; letter-spacing: .12em; font-size: 13px; margin-bottom: 16px; }
.hero-copy h1 { font-size: clamp(42px, 7vw, 72px); line-height: 1.04; letter-spacing: -.055em; margin: 0; font-weight: 820; }
.hero-copy p { font-size: 18px; color: var(--muted); margin: 22px 0 0; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.entry-card { min-height: 150px; padding: 28px; border-radius: 24px; text-decoration: none; color: inherit; background: rgba(255, 255, 255, .9); border: 1px solid rgba(255,255,255,.8); box-shadow: var(--shadow); display: flex; align-items: center; gap: 20px; transition: transform .2s, box-shadow .2s; }
.entry-card:hover { transform: translateY(-4px); box-shadow: 0 24px 60px rgba(26, 46, 35, .15); }
.entry-icon { width: 62px; height: 62px; flex: 0 0 auto; border-radius: 18px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 800; font-size: 22px; }
.staff-entry .entry-icon { background: var(--navy-soft); color: var(--navy); }
.entry-content { display: flex; flex-direction: column; gap: 9px; }
.entry-content strong { font-size: 21px; }
.entry-content small { color: var(--muted); line-height: 1.6; }
.entry-arrow { margin-left: auto; font-size: 28px; color: var(--muted); }
.landing-footer { margin-top: 28px; text-align: center; font-size: 12px; color: #8b958f; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; background: radial-gradient(circle at 25% 20%, rgba(48, 147, 100, .16), transparent 34%), #f2f7f4; position: relative; }
.staff-auth { background: radial-gradient(circle at 75% 18%, rgba(56, 86, 126, .17), transparent 34%), #f2f5f8; }
.back-link { position: absolute; top: 28px; left: 30px; color: var(--muted); text-decoration: none; font-size: 14px; }
.auth-card { width: min(450px, 100%); background: white; padding: 38px; border-radius: 24px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.7); }
.auth-brand { margin-bottom: 30px; }
.auth-card h1 { font-size: 30px; letter-spacing: -.035em; margin: 0 0 10px; }
.auth-card > p { line-height: 1.65; margin: 0 0 26px; }
.form-stack, .modal-card { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; font-weight: 680; color: #3b4640; }
input, textarea, select { width: 100%; border: 1px solid #dce4df; background: #fbfcfb; border-radius: 11px; padding: 12px 13px; outline: none; color: var(--ink); transition: border-color .18s, box-shadow .18s; }
input:focus, textarea:focus, select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,69,.1); background: white; }
textarea { resize: vertical; line-height: 1.55; }
.button { border: 0; border-radius: 10px; padding: 11px 16px; font-weight: 700; background: #edf1ef; color: var(--ink); white-space: nowrap; }
.button:hover { filter: brightness(.97); }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.primary { background: var(--green); color: white; }
.button.dark { background: var(--navy); color: white; }
.button.secondary { background: white; border: 1px solid var(--line); }
.button.danger { background: var(--red-soft); color: var(--red); }
.button.wide { width: 100%; padding: 13px 18px; }
.button.mini { padding: 8px 11px; font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--muted); padding: 6px; }
.text-button:hover { color: var(--ink); }
.form-error { min-height: 20px; color: var(--red) !important; font-size: 13px; margin: -7px 0 0 !important; }
.privacy-note { background: var(--green-soft); color: var(--green-deep); padding: 11px; border-radius: 9px; font-size: 12px; text-align: center; margin-top: 22px; }

.app-body { height: 100vh; overflow: hidden; background: var(--canvas); }
.workspace { display: grid; grid-template-columns: 330px 1fr; height: 100vh; }
.sidebar { background: white; border-right: 1px solid var(--line); padding: 22px 18px 14px; display: flex; flex-direction: column; min-width: 0; }
.sidebar-brand { padding: 0 6px 20px; }
.store-chip { display: flex; gap: 11px; align-items: center; background: var(--green-soft); padding: 13px; border-radius: 14px; margin-bottom: 15px; }
.store-chip > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.store-chip strong, .store-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-chip small { color: var(--green-deep); font-size: 11px; }
.store-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; background: white; color: var(--green); font-weight: 800; }
.section-label { font-size: 11px; font-weight: 750; color: #919a95; letter-spacing: .08em; text-transform: uppercase; margin: 22px 5px 9px; }
.conversation-list { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.conversation-item { width: 100%; border: 0; background: transparent; text-align: left; padding: 13px; border-radius: 12px; color: inherit; display: grid; gap: 7px; }
.conversation-item:hover { background: #f5f8f6; }
.conversation-item.active { background: var(--green-soft); }
.staff-list .conversation-item.active { background: var(--navy-soft); }
.conversation-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.conversation-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.conversation-time { margin-left: auto; color: #99a29d; font-size: 10px; flex: 0 0 auto; }
.conversation-preview { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: flex; gap: 6px; align-items: center; }
.tiny-badge { border-radius: 5px; padding: 3px 6px; background: #f0f3f1; color: #68726c; font-size: 9px; }
.unread { margin-left: auto; min-width: 18px; height: 18px; border-radius: 9px; background: var(--red); color: white; display: grid; place-items: center; font-size: 10px; padding: 0 5px; }
.sidebar-footer { border-top: 1px solid var(--line); padding-top: 10px; text-align: center; }
.chat-main, .staff-chat-area { min-width: 0; min-height: 0; position: relative; background: #f7f9f8; overflow: hidden; }
.empty-state { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 30px; }
.empty-state h2 { color: var(--ink); margin: 18px 0 6px; font-size: 20px; }
.empty-state p { margin: 0; font-size: 13px; }
.empty-illustration { width: 88px; height: 88px; margin: auto; display: grid; place-items: center; border-radius: 26px; background: var(--green-soft); color: var(--green); font-weight: 800; }
.empty-illustration.dark { background: var(--navy-soft); color: var(--navy); }
.chat-panel { height: 100%; min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.chat-header { min-height: 78px; background: white; border-bottom: 1px solid var(--line); padding: 17px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.chat-header h2 { margin: 0; font-size: 18px; }
.chat-header p { margin: 6px 0 0; font-size: 12px; }
.chat-mode-actions { display: flex; align-items: center; gap: 8px; }
.status-badge, .role-badge { font-size: 10px; font-weight: 750; border-radius: 999px; padding: 5px 9px; background: #edf1ef; color: #626d66; }
.status-badge.waiting { background: var(--amber-soft); color: var(--amber); }
.status-badge.active { background: var(--green-soft); color: var(--green); }
.status-badge.pending_rating { background: #f0eafa; color: #6944a1; }
.messages { min-height: 0; overflow: auto; padding: 24px max(24px, 6vw); display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.new-chat-welcome { margin: auto; max-width: 520px; text-align: center; color: var(--muted); padding: 32px 18px; }
.new-chat-welcome > span { display: inline-grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; background: var(--navy); color: white; font-weight: 800; font-size: 20px; box-shadow: var(--shadow); }
.new-chat-welcome h2 { color: var(--ink); margin: 18px 0 7px; font-size: 24px; }
.new-chat-welcome p { margin: 0; font-size: 13px; line-height: 1.7; }
.message { display: flex; flex-direction: column; max-width: min(72%, 620px); gap: 5px; }
.message.staff { margin-left: auto; align-items: flex-end; }
.message.store { margin-right: auto; }
.message.ai { margin-right: auto; }
.message.ai .message-bubble { background: #f1efff; border-color: #ded8fa; }
.message.ai .message-meta { color: #745aa7; }
.message.internal { margin: 0 auto; align-items: center; max-width: 80%; }
.message.system { margin: 0 auto; max-width: 90%; color: #8a948e; font-size: 11px; text-align: center; }
.message-meta { display: flex; gap: 8px; color: #929b96; font-size: 10px; }
.message-bubble { background: white; border: 1px solid var(--line); border-radius: 5px 16px 16px 16px; padding: 11px 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; font-size: 14px; }
.message.staff .message-bubble { background: var(--green); color: white; border: 0; border-radius: 16px 5px 16px 16px; }
.staff-body .message.staff .message-bubble { background: var(--navy); }
.message.internal .message-bubble { background: #fffbe9; border-color: #eee1a8; color: #765f17; font-size: 12px; }
.attachment-card { text-decoration: none; color: inherit; background: white; border: 1px solid var(--line); border-radius: 14px; padding: 11px; display: flex; align-items: center; gap: 10px; min-width: 230px; }
.message.staff .attachment-card { background: var(--green-soft); }
.staff-body .message.staff .attachment-card { background: var(--navy-soft); }
.attachment-card img { max-width: 280px; max-height: 240px; border-radius: 10px; display: block; object-fit: contain; }
.file-icon { width: 38px; height: 38px; border-radius: 8px; display: grid; place-items: center; background: #eef2ef; font-weight: 750; color: var(--green); }
.file-info { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.file-info small { color: var(--muted); font-size: 10px; }
.composer { position: sticky; z-index: 3; bottom: 0; background: white; border-top: 1px solid var(--line); padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
.composer-row { display: flex; align-items: flex-end; gap: 10px; }
.composer textarea { min-height: 44px; max-height: 130px; resize: none; background: #f7f9f8; }
.composer > small { display: block; color: #9aa39e; font-size: 9px; margin: 6px 0 0; }
.attachment-toolbar { min-height: 34px; display: flex; align-items: center; gap: 4px; margin: 2px 0 7px; }
.attachment-tool { height: 32px; padding: 4px 8px; border: 0; background: transparent; border-radius: 8px; display: inline-flex; align-items: center; gap: 5px; color: var(--muted); cursor: pointer; }
.attachment-tool:hover, .attachment-tool:focus-visible { color: var(--green); background: var(--green-soft); outline: none; }
.attachment-tool.service-toggle { margin-left: 3px; padding-left: 10px; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; }
.attachment-tool.service-toggle.resume-ai { color: var(--green); background: var(--green-soft); border-left-color: transparent; border-radius: 8px; }
.staff-body .attachment-tool:hover, .staff-body .attachment-tool:focus-visible { color: var(--navy); background: var(--navy-soft); }
.attachment-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.attachment-tool span { font-size: 10px; font-weight: 650; }
.hidden-file-input { display: none; }
.mobile-header-spacer { width: 42px; }
.upload-preview { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 7px; }
.upload-pill { background: #eef2ef; border-radius: 7px; padding: 5px 8px; font-size: 10px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rating-card { margin: 0 24px 16px; padding: 18px; border: 1px solid #dce8e1; background: white; border-radius: 16px; box-shadow: 0 10px 30px rgba(30,50,38,.08); }
.rating-heading { display: flex; align-items: center; gap: 12px; }
.rating-heading > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-weight: 800; }
.rating-heading > div { display: flex; flex-direction: column; gap: 3px; }
.rating-heading small { color: var(--muted); }
.stars { display: flex; gap: 8px; margin: 16px 0; }
.star { background: transparent; border: 0; color: #d7ddd9; font-size: 30px; padding: 0; }
.star.selected { color: #f1aa35; }
.rating-question { font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.segmented { display: flex; gap: 8px; }
.segmented button, .tag-options button { border: 1px solid var(--line); background: white; border-radius: 8px; padding: 7px 10px; font-size: 11px; }
.segmented button.active, .tag-options button.active { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.tag-options { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.rating-card textarea { min-height: 70px; }
.rating-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 12px; }
.mobile-header { display: none; }

.staff-workspace { height: 100vh; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: 66px minmax(0, 1fr); }
.staff-topbar { background: white; border-bottom: 1px solid var(--line); padding: 0 22px; display: flex; align-items: center; gap: 36px; }
.top-nav { align-self: stretch; display: flex; gap: 7px; }
.top-nav button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 0 12px; color: var(--muted); font-size: 13px; }
.top-nav button.active { border-bottom-color: var(--navy); color: var(--navy); font-weight: 750; }
.staff-account { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.service-indicator { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--muted); }
.staff-account { margin-left: 0; }
.inline-toggle { flex-direction: row; align-items: center; gap: 7px; font-weight: 650; white-space: nowrap; }
.inline-toggle input { width: auto; }
.staff-main-view { display: grid; grid-template-columns: 340px minmax(420px, 1fr) 260px; min-height: 0; overflow: hidden; }
.queue-panel { background: white; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.queue-header { padding: 18px 16px 10px; }
.queue-header > div { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.queue-header h2 { margin: 0; font-size: 18px; }
.queue-header input { padding: 9px 11px; font-size: 12px; }
.count-badge { background: var(--navy-soft); color: var(--navy); border-radius: 9px; padding: 2px 7px; font-size: 10px; font-weight: 750; }
.status-tabs { display: flex; gap: 2px; padding: 0 12px 10px; overflow: auto; }
.status-tabs button { flex: 0 0 auto; border: 0; background: transparent; border-radius: 8px; padding: 7px 8px; color: var(--muted); font-size: 10px; }
.status-tabs button span { margin-left: 2px; opacity: .72; }
.status-tabs button.active { background: var(--navy); color: white; }
.staff-list { min-height: 0; overflow: auto; padding: 0 8px 12px; }
.detail-panel { background: white; border-left: 1px solid var(--line); padding: 10px 18px; overflow: auto; }
.detail-panel h3 { margin: 10px 5px 20px; font-size: 17px; }
.detail-panel dl { margin: 0 5px; display: grid; grid-template-columns: 70px 1fr; row-gap: 13px; font-size: 11px; }
.detail-panel dt { color: #929b96; }
.detail-panel dd { margin: 0; text-align: right; word-break: break-all; }
.inline-form { display: flex; gap: 7px; }
.inline-form select { padding: 7px; font-size: 11px; }
.header-actions { display: flex; gap: 7px; }
.staff-chat-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.staff-back-button { display: none; flex: 0 0 auto; }
.composer-tools { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.composer-tools label { flex-direction: row; align-items: center; font-size: 10px; color: var(--muted); }
.composer-tools input { width: auto; }
.content-view { overflow: auto; padding: 30px; }
.content-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.content-header h1 { margin: 0; font-size: 27px; letter-spacing: -.03em; }
.content-header p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.content-header select { width: auto; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.summary-card, .data-card { background: white; border: 1px solid var(--line); border-radius: 15px; }
.summary-card { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.summary-card small { color: var(--muted); font-size: 11px; }
.summary-card strong { font-size: 27px; letter-spacing: -.04em; }
.data-card { margin-bottom: 18px; overflow: hidden; }
.card-title { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.card-title h2 { margin: 0; font-size: 15px; }
.card-title p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.settings-layout { max-width: 1000px; display: grid; gap: 16px; }
.settings-card { padding: 0 18px 18px; position: relative; }
.settings-card .card-title { margin: 0 -18px 18px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.settings-grid.four-columns { grid-template-columns: repeat(4, 1fr); }
.settings-grid .full-width { grid-column: 1 / -1; }
.setting-switch { min-height: 46px; padding: 11px 13px; background: #f7f9f8; border: 1px solid var(--line); border-radius: 11px; }
.settings-card label small { color: var(--muted); font-weight: 400; }
.integration-card { padding-left: 68px; }
.integration-step { position: absolute; left: 18px; top: 18px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--navy); color: white; font-weight: 800; }
.config-warning { margin-top: 14px; background: var(--amber-soft); color: #7f511f; border-radius: 10px; padding: 11px 13px; font-size: 11px; line-height: 1.65; }
.integration-test { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.integration-test span { font-size: 11px; line-height: 1.5; }
.settings-actions { display: flex; align-items: center; gap: 10px; position: sticky; bottom: 0; background: rgba(243,246,244,.94); padding: 12px 0 20px; z-index: 2; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-size: 10px; background: #fafbfa; }
td .button { margin-right: 5px; }
.bar-list { padding: 18px; display: grid; gap: 14px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 12px; align-items: center; font-size: 11px; }
.bar-track { height: 8px; background: #eef2ef; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--navy); border-radius: 4px; }

.modal { border: 0; padding: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(22,35,28,.23); width: min(560px, calc(100% - 30px)); }
.modal::backdrop { background: rgba(17, 28, 22, .42); backdrop-filter: blur(3px); }
.modal-card { padding: 25px; gap: 16px; }
.modal-card.narrow { width: min(440px, 100%); }
.modal-header { display: flex; justify-content: space-between; gap: 20px; }
.modal-header h2 { margin: 0; font-size: 21px; }
.modal-header p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 9px; background: #f0f3f1; color: var(--muted); font-size: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 4px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translate(-50%, 20px); background: var(--ink); color: white; padding: 10px 15px; border-radius: 9px; font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

@media (max-width: 1050px) {
  .staff-main-view { grid-template-columns: 300px 1fr; }
  .detail-panel { display: none !important; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .landing-shell { width: min(100% - 28px, 520px); padding-top: 22px; }
  .hero-copy { margin: auto 0 30px; }
  .hero-copy h1 { font-size: 42px; }
  .entry-grid { grid-template-columns: 1fr; }
  .entry-card { min-height: 124px; padding: 20px; }
  .entry-icon { width: 50px; height: 50px; border-radius: 14px; }
  .auth-card { padding: 28px 22px; }
  .back-link { top: 18px; left: 18px; }
  .workspace { display: block; padding-top: 58px; }
  .mobile-header { display: flex; position: fixed; z-index: 20; top: 0; left: 0; right: 0; height: 58px; align-items: center; justify-content: space-between; padding: 0 12px; background: white; border-bottom: 1px solid var(--line); }
  .portal-sidebar { position: fixed; z-index: 19; top: 58px; bottom: 0; left: 0; width: min(330px, 88vw); transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow); }
  .portal-sidebar.open { transform: translateX(0); }
  .chat-main { height: calc(100vh - 58px); }
  .messages { padding: 18px 13px; }
  .message { max-width: 88%; }
  .chat-header { padding: 13px 15px; min-height: 66px; }
  .composer { padding: 9px; }
  .composer .button { padding: 11px; }
  .composer-row { gap: 7px; }
  .attachment-toolbar { margin-bottom: 5px; }
  .attachment-tool { padding: 4px 7px; }
  .rating-card { margin: 0 10px 10px; }
  .rating-actions { flex-direction: column; }
  .staff-topbar { height: auto; min-height: 66px; padding: 8px 12px; flex-wrap: wrap; gap: 8px; }
  .staff-workspace { grid-template-rows: auto 1fr; }
  .staff-topbar .sidebar-brand { display: none; }
  .top-nav { order: 2; width: 100%; height: 34px; overflow: auto; }
  .top-nav button { flex: 1; min-width: 90px; }
  .staff-main-view { grid-template-columns: 1fr; }
  .queue-panel { display: flex; height: 100%; }
  .staff-chat-area { display: none; }
  .staff-main-view.chat-open .queue-panel { display: none; }
  .staff-main-view.chat-open .staff-chat-area { display: block; height: 100%; }
  .staff-back-button { display: grid; place-items: center; }
  .staff-chat-header { flex-wrap: wrap; align-content: center; }
  .staff-chat-header .header-actions { width: 100%; overflow-x: auto; }
  .header-actions { gap: 3px; }
  .header-actions .button { padding: 7px; font-size: 10px; }
  .content-view { padding: 18px 12px; }
  .service-indicator { margin-left: 0; }
  .settings-grid, .settings-grid.four-columns { grid-template-columns: 1fr; }
  .content-header { align-items: flex-start; gap: 12px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-card { padding: 14px; }
}
