:root {
  color-scheme: light;
  --navy: #13273b;
  --deep: #0d1d2d;
  --ink: #152a3a;
  --muted: #556773;
  --quiet: #687a84;
  --teal: #08675d;
  --teal-hover: #05564e;
  --mint: #81e0cd;
  --mint-wash: #e0f4ee;
  --surface: #f3f7f8;
  --white: #fff;
  --line: #dbe5e9;
  --line-strong: #c5d3d9;
  --danger: #a83440;
  --chat-viewport-height: 100vh;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  text-rendering: optimizeLegibility;
}

@supports (height: 100dvh) {
  :root { --chat-viewport-height: 100dvh; }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { font-size: 14px; line-height: 1.5; }
button, input, textarea { font: inherit; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button, .button { cursor: pointer; }
button:disabled, .button[aria-disabled="true"] { cursor: default; }
button, h1, h2, p { margin: 0; }
a { color: var(--teal); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #078574; outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; vertical-align: middle; }

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  color: var(--navy);
  font-size: 16px;
  font-weight: 750;
  white-space: nowrap;
}

.brand img, .rail-brand img {
  display: block;
  width: 36px;
  height: 36px;
  flex: none;
}

.button, .icon-btn, .text-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  gap: 7px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .16s, color .16s, border-color .16s;
}

.button {
  min-height: 41px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 620;
}

.button .icon { width: 17px; height: 17px; }
.primary { background: var(--teal); color: var(--white); }
.primary:hover:not(:disabled) { background: var(--teal-hover); }
.primary:disabled { background: #e3eae9; color: #647675; }
.secondary { background: var(--white); color: var(--ink); border-color: var(--line); }
.secondary:hover:not(:disabled) { background: #edf6f4; border-color: #b9d8d1; color: var(--teal); }
.secondary:disabled { color: var(--quiet); background: var(--surface); }
.danger { background: var(--danger); color: var(--white); }
.danger:hover:not(:disabled) { background: #862935; }
.danger:disabled { opacity: .65; }
.icon-btn {
  width: 40px;
  height: 40px;
  color: var(--muted);
  border-radius: 8px;
  background: transparent;
  padding: 0;
}
.icon-btn:hover { color: var(--teal); background: #eaf4f1; }
.text-btn { padding: 0; color: var(--teal); background: transparent; font-weight: 650; }
.text-btn:hover { text-decoration: underline; }
.danger-text { color: var(--danger); }

input:not([type="file"]), textarea {
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--white);
  color: var(--ink);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.5;
}
input::placeholder, textarea::placeholder { color: var(--quiet); opacity: 1; }
input:not([type="file"]):focus, textarea:focus { border-color: #078574; outline-offset: 1px; }

.loading-view { display: grid; align-content: center; justify-items: center; min-height: 100dvh; gap: 14px; color: var(--muted); }
.loading-mark { width: 44px; height: 44px; background: url("/favicon.svg") center / contain no-repeat; }

/* Sign-in */
.login-view { display: grid; grid-template-columns: 44% 56%; min-height: 100vh; min-height: 100dvh; background: var(--white); }
.login-brand { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; padding: clamp(30px, 5vw, 74px); background: var(--navy); }
.login-brand .brand { position: relative; z-index: 1; color: var(--white); font-size: 22px; gap: 14px; }
.login-brand .brand img { width: 46px; height: 46px; border: 1px solid #33566b; border-radius: 12px; }
.login-art { position: absolute; inset: 10% -25% -28% -22%; isolation: isolate; pointer-events: none; }
.login-art span { position: absolute; inset: 14% 10%; border: 1px solid #458a8c; border-radius: 57% 43% 61% 39%; transform: rotate(-35deg); }
.login-art span:nth-child(2) { inset: 20% 14%; border-color: #659d9e; transform: rotate(-31deg); }
.login-art span:nth-child(3) { inset: 28% 20%; border-color: #7bb8ad; transform: rotate(-26deg); }
.login-art::before { position: absolute; inset: 14% 10%; content: ""; background: radial-gradient(ellipse at 54% 61%, #1c5358, transparent 66%); }
.login-surface { display: grid; align-items: center; justify-items: center; padding: 48px clamp(28px, 7vw, 106px); }
.login-card { width: min(100%, 380px); }
.mobile-brand { display: none; }
.login-card h1 { font-size: clamp(29px, 3.5vw, 40px); letter-spacing: -.035em; font-weight: 780; line-height: 1.16; }
.login-intro { color: var(--muted); margin-top: 13px; }
.login-form { display: grid; gap: 18px; margin-top: 31px; }
.login-form label, .dialog-form label, .stack-label { display: grid; gap: 7px; font-weight: 650; }
.login-form input { height: 47px; font-size: 16px; }
.login-form .primary { min-height: 47px; margin-top: 2px; }
.login-extra:empty { display: none; }
.login-extra { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 5px 14px; margin-top: 17px; padding: 11px 13px; border: 1px solid #d0e7e0; border-radius: 8px; background: #eff8f5; color: #385f58; font-size: 13px; }
.login-foot { margin-top: 29px; padding-top: 20px; border-top: 1px solid var(--line); }
.login-foot a { font-weight: 650; text-decoration: none; }
.login-foot a:hover { text-decoration: underline; }

/* Staff work area and shared chrome */
.workspace { display: grid; grid-template-columns: 72px minmax(0, 1fr); height: 100vh; height: var(--keyboard-height, var(--chat-viewport-height)); overflow: hidden; }
.rail { display: flex; flex-direction: column; align-items: center; min-height: 0; gap: 26px; padding: 17px 0; background: var(--navy); }
.rail-brand { border: 1px solid #365367; border-radius: 11px; }
.rail-brand img { width: 36px; height: 36px; border-radius: 10px; }
.rail-actions, .rail-account { display: grid; justify-items: center; gap: 9px; width: 100%; }
.rail-account { margin-top: auto; gap: 13px; }
.rail-btn { display: grid; place-items: center; width: 43px; height: 42px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #bed0dc; transition: background-color .16s, color .16s; }
.rail-btn:hover, .rail-btn.selected { color: #a0ecdd; background: #254456; }
.rail-btn:focus-visible, .rail-brand:focus-visible { outline-color: var(--mint); }
.rail-initial { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #345367; color: #eff7f8; font-weight: 680; }
.workspace-main { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); }
.workspace-header, .guest-header { border-bottom: 1px solid var(--line); background: var(--white); }
.workspace-header { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 27px; }
.workspace-title, .workspace-controls { min-width: 0; display: flex; align-items: center; gap: 17px; }
.workspace-divider { width: 1px; height: 21px; background: var(--line); }
.workspace-header h1 { min-width: 0; white-space: nowrap; font-size: 15px; font-weight: 600; color: var(--muted); }
.current-user { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.mobile-logout { display: none; }
.inbox { min-height: 0; display: grid; grid-template-columns: clamp(275px, 29vw, 339px) minmax(0, 1fr); }
.inbox-sidebar { min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--white); }
.sidebar-header { padding: 23px 20px 0; }
.sidebar-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sidebar-heading h2 { font-size: 22px; font-weight: 760; line-height: 1.2; }
.thread-total { align-self: center; padding: 0 7px; min-width: 23px; height: 23px; line-height: 23px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; background: #e9f0f1; color: var(--muted); border-radius: 6px; }
.thread-total:empty { display: none; }
.search-box { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--quiet); }
.search-box .icon { width: 17px; height: 17px; }
.search-box:focus-within { border-color: #078574; outline: 1px solid #078574; outline-offset: 1px; }
.search-box input { width: 100%; height: 37px; border: 0; border-radius: 0; padding: 0; background: transparent; }
.search-box input:focus { outline: 0; }
.filters { display: flex; align-items: center; gap: 21px; margin-top: 11px; }
.filter { position: relative; display: flex; gap: 6px; align-items: center; min-height: 43px; padding: 0 3px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; }
.filter.active { border-color: var(--teal); color: var(--teal); }
.unread-total { min-width: 19px; padding: 0 4px; border-radius: 8px; background: var(--mint-wash); color: var(--teal); font-size: 11px; text-align: center; }
.thread-list { min-height: 0; flex: 1 1 auto; padding: 10px 8px 15px; border-top: 1px solid var(--line); overflow: auto; scrollbar-gutter: stable; }
.thread-row-wrap { position: relative; }
.thread-row { position: relative; min-width: 0; width: 100%; min-height: 75px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 46px 10px 10px; border: 1px solid transparent; border-radius: 9px; background: var(--white); color: var(--ink); text-align: left; }
.thread-row:hover { background: #f2f7f7; }
.thread-row.selected { background: #e6f5ef; border-color: #d0e9e1; }
.thread-row.selected::before { content: ""; position: absolute; width: 3px; left: -1px; top: 16px; bottom: 16px; border-radius: 0 3px 3px 0; background: #168170; }
.thread-detail, .thread-meta { display: grid; min-width: 0; gap: 3px; }
.thread-name { display: flex; min-width: 0; align-items: center; gap: 6px; }
.thread-detail strong, .thread-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-detail strong { font-size: 14px; font-weight: 700; }
.thread-pinned { flex: none; border-radius: 4px; padding: 0 4px; background: var(--mint-wash); color: var(--teal); font-size: 11px; }
.thread-preview { color: var(--muted); font-size: 12px; }
.thread-meta { align-self: start; justify-items: end; color: var(--quiet); font-size: 11px; font-variant-numeric: tabular-nums; gap: 5px; }
.unread-count { min-width: 20px; min-height: 20px; border-radius: 10px; padding: 2px 5px; color: var(--white); background: var(--teal); text-align: center; }
.list-empty { padding: 23px 8px; text-align: center; font-size: 13px; color: var(--quiet); }
.thread-row-wrap > .thread-options { position: absolute; right: 4px; top: 50%; width: 40px; height: 44px; translate: 0 -50%; }
.thread-options[aria-expanded="true"] { color: var(--teal); background: #eaf4f1; }
.thread-menu { position: fixed; z-index: 3; width: min(148px, calc(100% - 16px)); max-height: calc(100dvh - 16px); overflow: auto; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); box-shadow: 0 8px 25px #13273b24; }
.thread-menu button { display: block; width: 100%; min-height: 40px; padding: 7px 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); text-align: left; }
.thread-menu button.danger-text { color: var(--danger); }
.thread-menu button:is(:hover, :focus-visible) { background: var(--surface); }
.thread-menu button:focus-visible { outline-offset: -2px; }

.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 38px; height: 38px; border-radius: 11px; color: #355264; background: #e4edf0; font-size: 15px; font-weight: 750; }
.staff-avatar { background: var(--navy); color: var(--mint); }
.self-avatar { background: #d5eee6; color: #1b655a; }
.conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface); }
.empty { display: grid; justify-items: center; align-content: center; width: 100%; flex: 1 0 auto; padding: 30px 25px 40px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 66px; height: 66px; margin-bottom: 19px; border: 1px solid #d0e5e3; border-radius: 21px; color: var(--teal); background: #e5f2f0; }
.empty-icon .icon { width: 33px; height: 33px; }
.empty h2 { max-width: 26em; font-size: clamp(20px, 2.5vw, 25px); font-weight: 760; }
.empty p { max-width: 31em; margin-top: 8px; color: var(--muted); }
.empty .button { margin-top: 20px; }
.chat-header { display: flex; flex: 0 0 auto; align-items: center; min-height: 68px; gap: 11px; padding: 10px 24px; border-bottom: 1px solid var(--line); background: var(--white); }
.back-inbox { display: none; }
.chat-identity { min-width: 0; }
.chat-name { font-size: 16px; line-height: 1.3; font-weight: 730; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-state { display: flex; align-items: center; gap: 6px; margin-top: 3px; color: var(--muted); font-size: 12px; }
.chat-state.available::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #147c6c; }
.chat-tools { margin-left: auto; }
.binding-status { display: inline-flex; align-items: center; gap: 5px; color: var(--teal); font-size: 13px; white-space: nowrap; }
.binding-status .icon { width: 17px; height: 17px; }
.messages { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow-y: auto; padding: 22px clamp(16px, 3.4vw, 42px); scrollbar-gutter: stable; }
.messages .empty { padding-top: 22px; padding-bottom: 27px; }
.day-marker { align-self: center; margin: 3px 0 18px; padding: 3px 10px; border: 1px solid #e0e8eb; border-radius: 6px; color: var(--quiet); background: #eaf0f2; font-size: 12px; }
.message-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 16px; min-width: 0; }
.message-row.mine { flex-direction: row-reverse; }
.message-row .avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; }
.message-body { display: grid; justify-items: start; min-width: 0; max-width: min(75%, 520px); gap: 4px; }
.message-row.mine .message-body { justify-items: end; }
.message-meta { min-width: 0; max-width: 100%; display: flex; align-items: baseline; gap: 8px; color: var(--muted); font-size: 11px; }
.message-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-meta time { flex: none; }
.message-receipt { color: var(--muted); font-size: 11px; text-align: right; }
.message-receipt.is-read { color: var(--teal); }
.message-receipt time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bubble { max-width: 100%; padding: 9px 12px; border: 1px solid #dbe5e9; border-radius: 3px 12px 12px 12px; background: var(--white); overflow-wrap: anywhere; white-space: pre-wrap; font-size: 14px; line-height: 1.55; }
.message-row.mine .bubble { border-color: #c8e5dc; border-radius: 12px 3px 12px 12px; background: #dbefe8; }
.bubble.attachment { padding: 3px; overflow: hidden; line-height: 0; }
.media-preview { display: block; max-width: 100%; min-width: 42px; min-height: 42px; padding: 0; border: 0; border-radius: 8px; background: transparent; }
.attachment img, .attachment video { display: block; max-width: 100%; min-height: 42px; max-height: 280px; object-fit: contain; border-radius: 8px; }
.attachment video { width: 310px; background-color: var(--deep); }

.composer-wrap { flex: 0 0 auto; padding: 11px clamp(16px, 3.4vw, 42px) max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--white); }
.compose-main { display: flex; align-items: flex-end; gap: 8px; }
.compose-main textarea { flex: 1 1 auto; width: 0; min-height: 42px; max-height: 112px; padding: 9px 11px; resize: none; font-size: 16px; }
.attach { position: relative; display: grid; place-items: center; align-self: flex-end; width: 39px; height: 42px; cursor: pointer; }
.attach:focus-within { outline: 2px solid #078574; outline-offset: 2px; }
.attach:has(input:disabled) { opacity: .55; cursor: default; }
.file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: inherit; }
.send-btn { min-height: 42px; }
.composer-status { margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.composer-status.problem { color: var(--danger); }
.read-only { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; color: var(--muted); }
.read-only .icon { width: 17px; }

/* Guest */
.guest-view { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; height: var(--keyboard-height, var(--chat-viewport-height)); overflow: hidden; background: #eaf1f3; }
.guest-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, 1000px); min-height: 70px; margin: auto; padding: 10px 25px; }
.guest-header-actions { display: flex; align-items: center; gap: 8px; }
.guest-main { display: flex; min-width: 0; min-height: 0; width: min(100%, 950px); margin-inline: auto; padding: 19px 15px; }
.guest-main .conversation { flex: 1 1 auto; border: 1px solid var(--line); border-radius: 13px; }
.guest-conversation .chat-header { min-height: 70px; }

/* Admin */
.admin-main { overflow: auto; padding: 39px clamp(20px, 5vw, 72px); }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1040px; margin: 0 auto 24px; }
.admin-heading h2 { font-size: 30px; font-weight: 760; line-height: 1.2; }
.admin-heading p { margin-top: 7px; color: var(--muted); }
.employees-panel { max-width: 1040px; margin: auto; border: 1px solid var(--line); border-radius: 11px; background: var(--white); overflow: hidden; }
.employee-table { width: 100%; text-align: left; border-spacing: 0; }
.employee-table thead { background: #eef4f5; color: #415967; }
.employee-table th { border-bottom: 1px solid var(--line); }
.employee-table th, .employee-table td { padding: 13px 16px; }
.employee-table td { border-bottom: 1px solid var(--line); }
.employee-table tr:last-child td { border-bottom: 0; }
.employee-table th:first-child, .employee-identity { width: 32%; }
.employee-table td.employee-actions, .employee-table th:last-child { width: 1px; white-space: nowrap; }
.employee-identity > * { vertical-align: middle; }
.employee-identity .avatar { display: inline-grid; width: 35px; height: 35px; margin-right: 8px; }
.employee-details { display: inline-block; max-width: calc(100% - 47px); overflow-wrap: anywhere; }
.employee-account { overflow-wrap: anywhere; }
.employee-mobile-name { display: none; color: var(--muted); font-size: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 10px; color: var(--muted); background: #edf1f3; white-space: nowrap; font-size: 12px; }
.status-pill.on { color: var(--teal); background: #e1f3ed; }
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.employee-actions .text-btn { margin-right: 16px; min-height: 33px; }
.employee-actions .text-btn:last-child { margin-right: 0; }
.admin-empty { display: flex; align-items: center; flex-direction: column; gap: 10px; padding: 48px 20px; color: var(--muted); }

/* Dialogs and feedback */
dialog { width: min(450px, calc(100% - 30px)); max-height: calc(100dvh - 36px); padding: 0; border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: var(--white); box-shadow: 0 18px 80px #13273b35; overflow: auto; }
dialog::backdrop { background: #10253886; }
dialog.wide { width: min(880px, calc(100% - 28px)); }
.dialog-content { padding: 21px 24px 24px; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dialog-header h2 { overflow-wrap: anywhere; font-size: 20px; font-weight: 760; }
.dialog-close { margin: -4px -7px -4px 0; }
.dialog-form, .share-body { display: grid; gap: 14px; }
.dialog-description { color: var(--muted); }
.dialog-form input, .link-field { width: 100%; font-size: 16px; }
.greeting-fields { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.greeting-fields .greeting-toggle { display: flex; align-items: center; gap: 9px; }
.greeting-fields input[type="checkbox"] { width: 17px; height: 17px; padding: 0; margin: 0; accent-color: var(--teal); }
.greeting-fields textarea { width: 100%; resize: vertical; font-size: 16px; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 5px; flex-wrap: wrap; }
.form-error { color: var(--danger); font-size: 13px; }
.form-help { margin-top: -5px; color: var(--muted); font-size: 13px; }
.qr-frame { display: grid; place-items: center; width: 206px; height: 206px; justify-self: center; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.qr-loading { color: var(--muted); }
.qr-image { width: 100%; height: 100%; object-fit: contain; }
.link-field { font-weight: 400; }
.phone-field { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; }
.phone-field:focus-within { border-color: #078574; outline: 1px solid #078574; outline-offset: 1px; }
.phone-field span { padding: 0 11px; color: var(--muted); font-weight: 500; border-right: 1px solid var(--line); }
.phone-field input { border: 0; }
.phone-field input:focus { outline: 0; }
.otp-group { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 8px; }
.send-code { min-height: 45px; }
.demo-code { padding: 9px 10px; border-radius: 7px; color: #385f58; background: #edf7f3; font-size: 13px; }
.switch-confirmation { display: grid; gap: 5px; padding: 11px 13px; border-radius: 7px; background: #edf7f3; }
.switch-confirmation p { color: var(--muted); font-size: 13px; }
.switch-list { display: grid; gap: 8px; }
.switch-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--ink); background: var(--white); text-align: left; }
.switch-option.selected { background: #eaf5f1; }
.switch-option:hover:not(:disabled) { background: #edf7f3; }
.switch-current { color: var(--teal); white-space: nowrap; font-size: 12px; }
.switch-body .form-error { margin-top: 10px; }
.image-dialog { display: grid; place-items: center; overflow: hidden; }
.image-dialog img { display: block; max-width: 100%; max-height: 76dvh; object-fit: contain; }
.toast { position: fixed; z-index: 2; right: max(17px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 34px); padding: 10px 14px; border-radius: 8px; background: var(--navy); color: var(--white); box-shadow: 0 8px 22px #13273b30; }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 61px minmax(0, 1fr); }
  .workspace-header { padding-inline: 18px; }
  .inbox { grid-template-columns: minmax(230px, 29vw) minmax(0, 1fr); }
  .sidebar-header { padding-inline: 15px; }
  .chat-header { padding-inline: 14px; }
}

@media (max-width: 720px) {
  .login-view { grid-template-columns: minmax(0, 1fr); }
  .login-brand { display: none; }
  .mobile-brand { display: inline-flex; margin-bottom: 31px; }
  .login-surface { align-items: start; padding: clamp(45px, 10vh, 92px) 27px 35px; }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .workspace-header { min-height: 62px; }
  .workspace-title, .workspace-controls { gap: 8px; }
  .workspace-header h1, .workspace-divider { display: none; }
  .workspace-controls .button { min-height: 39px; }
  .mobile-logout { display: inline-flex; }
  .current-user { display: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox-sidebar { border-right: 0; }
  .inbox > .conversation { display: none; }
  .inbox.mobile-open > .conversation { display: flex; }
  .inbox.mobile-open > .inbox-sidebar { display: none; }
  .sidebar-header { padding: 19px 17px 0; }
  .search-box input { min-height: 40px; font-size: 16px; }
  .back-inbox { display: inline-flex; margin-left: -5px; }
  .chat-header { min-height: 60px; }
  .guest-header-inner { min-height: 60px; padding-inline: 14px; }
  .guest-main { padding: 0; }
  .guest-main .conversation { border: 0; border-radius: 0; }
  .guest-conversation .chat-header { min-height: 64px; }
  .messages { padding-inline: 14px; }
  .message-body { max-width: min(80%, 520px); }
  .admin-main { padding: 22px 12px; }
  .admin-heading { margin-bottom: 15px; }
  .admin-heading h2 { font-size: 23px; }
  .admin-heading p { font-size: 13px; }
  .employee-table th, .employee-table td { padding: 11px 9px; }
  .employee-table th:first-child, .employee-identity { width: auto; }
}

@media (max-width: 455px) {
  .guest-header-inner { gap: 4px; padding-inline: 10px; }
  .guest-header-actions { gap: 5px; }
  .guest-header-actions .button, .chat-tools .button { min-height: 37px; padding: 0 8px; font-size: 12px; gap: 4px; }
  .guest-header-actions .button .icon, .chat-tools .button .icon { width: 15px; height: 15px; }
  .brand { gap: 6px; font-size: 15px; }
  .brand img { width: 31px; height: 31px; }
  .workspace-header { padding-inline: 12px; gap: 6px; }
  .workspace-controls { gap: 5px; }
  .workspace-controls .button { padding-inline: 9px; font-size: 13px; }
  .workspace-controls .show-share { width: 39px; padding: 0; }
  .workspace-controls .show-share span { display: none; }
  .chat-header { gap: 8px; }
  .chat-header .avatar { width: 35px; height: 35px; }
  .chat-name { font-size: 15px; }
  .binding-status { font-size: 12px; }
  .messages { padding-inline: 12px; }
  .message-row { gap: 6px; }
  .composer-wrap { padding-right: 9px; padding-left: 8px; }
  .compose-main { gap: 5px; }
  .send-btn { padding: 0 9px; }
  .send-btn .icon { display: none; }
  .dialog-content { padding: 17px 16px 18px; }
  .employee-account, .employee-table th:nth-child(2) { display: none; }
  .employee-mobile-name { display: block; }
  .employee-identity .avatar { width: 28px; height: 28px; margin-right: 4px; border-radius: 7px; }
  .employee-details { max-width: calc(100% - 36px); }
  .employee-actions .text-btn { margin-right: 8px; font-size: 12px; }
}

@media (max-width: 345px) {
  .guest-header-actions .button .icon { display: none; }
  .guest-header-actions .button { padding-inline: 6px; }
  .employee-identity .avatar { display: none; }
  .employee-details { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
