/* ASI shared foundations, workspace, secondary pages, and responsive rules. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 14px; line-height: 1.55; color: #21342e; background: #f6f8f7;
  --ink: #21342e; --muted: #697b73; --line: #e5ebe7; --green: #13785c;
  --green-light: #eaf4ed; --danger: #b04b4b; --soft: #f6f8f7; --radius: 10px;
  --rail-width: 76px; --list-width: 288px;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .15s, border-color .15s, color .15s; }
button:disabled { cursor: default; opacity: .42; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid #56a78b; outline-offset: 3px; }
input, textarea, select { color: var(--ink); background: #fff; border: 1px solid #dbe4de; border-radius: 8px; min-width: 0; }
input, textarea { width: 100%; padding: 11px 12px; }
input:focus, textarea:focus { border-color: #76ae95; }
input::placeholder, textarea::placeholder { color: #91a099; }
textarea { resize: vertical; }
label { display: block; font-size: 13px; font-weight: 550; margin: 20px 0 8px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.35px; }
h2 { font-size: 20px; font-weight: 650; margin-bottom: 8px; }
h3 { font-size: 16px; font-weight: 600; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.break-word { overflow-wrap: anywhere; }
.eyebrow { display: block; font-size: 10px; letter-spacing: 1.7px; color: #819389; font-weight: 600; margin-bottom: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; background: var(--green); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 1px; border-radius: 11px; }
.brand-lockup { display: flex; gap: 11px; align-items: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid #dbe4de; border-radius: 8px; background: #fff; color: var(--ink); min-height: 40px; padding: 8px 15px; font-size: 13px; font-weight: 550; white-space: nowrap; }
.button:hover:enabled { background: #f2f6f3; border-color: #c8d8cd; }
.button.primary { background: var(--green); border-color: var(--green); color: #fff; }
.button.primary:hover:enabled { background: #0e674e; border-color: #0e674e; }
.button.subtle { background: transparent; border-color: transparent; color: var(--muted); }
.button.subtle:hover:enabled { background: #edf4ef; color: var(--green); }
.button.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button.danger:hover:enabled { background: #993d3d; }
.button.danger-outline { color: var(--danger); border-color: #ead6d2; }
.full-width { width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 24px; line-height: 1; }
.icon-button:hover { background: var(--green-light); color: var(--green); }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 6px; border: 0; border-radius: 6px; background: transparent; color: var(--green); font-size: 12px; }
.text-button:hover { background: var(--green-light); }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.inline-error { color: var(--danger); background: #fff1ee; border-radius: 8px; font-size: 13px; padding: 11px 13px; overflow-wrap: anywhere; }
.status-badge { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: 6px; background: var(--green-light); color: var(--green); font-size: 11px; line-height: 1.5; max-width: 170px; flex-shrink: 0; }
.status-badge.warn { color: #946e29; background: #fff3dc; }
.status-badge.bad { color: #b25348; background: #fbede8; }
.status-dot { display: inline-block; width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #3e9c78; }
.status-dot.offline { background: #c69441; }

/* Authentication */
.loading-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.auth-screen { display: grid; grid-template-columns: 1.03fr 1fr; min-height: 100dvh; max-width: 1600px; margin: auto; background: #fff; }
.auth-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(35px,7vw,112px); background: #edf4ef; }
.auth-intro::after { content: ""; position: absolute; width: 450px; height: 450px; border: 1px solid #d7e5db; border-radius: 50%; right: -130px; bottom: -220px; box-shadow: 0 0 0 70px #e6eee7, 0 0 0 140px #eaf1eb; pointer-events: none; }
.auth-intro > * { position: relative; z-index: 1; }
.auth-intro .brand-lockup { font-size: 23px; font-weight: 650; margin-bottom: 80px; }
.auth-intro h1 { font-size: clamp(30px,3vw,44px); line-height: 1.65; font-weight: 550; margin: 0; }
.auth-footnote { margin-top: 95px; color: #809489; font-size: 12px; }
.auth-panel { align-self: center; width: 100%; max-width: 550px; padding: 55px clamp(30px,6vw,80px); margin: auto; }
.auth-panel h2 { font-size: 27px; font-weight: 600; margin: 13px 0; }
.auth-panel > .muted { margin-bottom: 32px; font-size: 14px; }
.auth-panel .button { min-height: 46px; margin-top: 26px; }
.auth-security { color: #88988f; font-size: 12px; line-height: 1.8; margin: 26px 0 0; }
.registration-entry { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 20px; font-size: 12px; color: var(--muted); }
.registration-entry .text-button { font-size: 13px; font-weight: 600; }
.auth-panel .auth-back { margin-top: 20px; padding: 8px 0; font-size: 13px; }
.account-notice { padding: 17px; background: #edf5ee; border: 1px solid #dce9df; border-radius: 10px; color: #477457; font-size: 13px; line-height: 1.8; }
.account-notice p { margin: 7px 0 0; }

/* The application occupies the visible viewport, without a fixed mobile bottom spacer. */
#app-shell { display: grid; grid-template-columns: var(--rail-width) minmax(0,1fr); grid-template-rows: 64px auto minmax(0,1fr); height: var(--app-viewport-height,100dvh); min-height: 0; overflow: hidden; }
.app-header { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.app-header h1 { font-size: 17px; font-weight: 650; margin: 0; }
.app-header .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
.mode-badge { border-radius: 6px; padding: 5px 9px; color: #92703a; background: #fbf3e2; font-size: 11px; }
.mode-badge.demo { color: #966128; background: #fff0df; }
.app-navigation { grid-column: 1; grid-row: 2 / 4; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 18px 8px; border-right: 1px solid var(--line); background: #f8faf9; overflow-y: auto; overscroll-behavior: contain; }
.nav-button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 59px; min-height: 64px; padding: 9px 3px; border: 0; border-radius: 10px; background: transparent; color: #6f8177; font-size: 11px; line-height: 1.4; white-space: nowrap; }
.nav-button svg, .conversation-search svg, .sidebar-shortcuts svg, .message-actions svg { width: 21px; height: 21px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.nav-button:hover { background: #edf3ee; color: var(--green); }
body:is([data-route="inbox"],[data-route="chat"],[data-route="customer"],[data-route="deleted"]) #inbox-button, body[data-route="account"] #account-button, body[data-route="admin"] #admin-button, .nav-button[aria-current="page"] { color: var(--green); background: #e6f1e9; font-weight: 600; }
.demo-notice { grid-column: 2; grid-row: 2; padding: 7px 24px; color: #8d6e43; background: #fff5e5; font-size: 11px; border-bottom: 1px solid #f0e4cd; }
.demo-notice span { margin-left: 8px; color: #a58b65; }
.workspace { display: grid; grid-column: 2; grid-row: 3; grid-template-columns: var(--list-width) minmax(0,1fr); width: 100%; min-height: 0; overflow: hidden; }
.conversation-sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: #fff; }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 20px 18px; flex-shrink: 0; }
.sidebar-heading h2 { font-size: 20px; margin: 0; }
.sidebar-heading .icon-button { width: 32px; height: 32px; background: var(--green-light); color: var(--green); }
.count { color: #82928a; font-size: 12px; margin-left: 6px; font-weight: 400; vertical-align: 2px; }
.conversation-search { display: flex; align-items: center; gap: 8px; height: 38px; margin: 0 20px; padding: 0 10px; border-radius: 8px; background: #f4f7f5; border: 1px solid transparent; color: #87998d; flex-shrink: 0; }
.conversation-search:focus-within { border-color: #a4c4b2; background: #fff; }
.conversation-search svg { width: 16px; height: 16px; }
.conversation-search input { min-width: 0; border: 0; border-radius: 0; background: transparent; padding: 0; font-size: 12px; height: 100%; outline: 0; }
.conversation-search input:focus-visible { outline: 0; }
.conversation-filters { display: flex; gap: 6px; padding: 14px 20px 16px; flex-shrink: 0; }
.conversation-filter { min-height: 29px; padding: 4px 12px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: 12px; }
.conversation-filter[aria-pressed="true"] { color: var(--green); background: var(--green-light); font-weight: 600; }
.conversation-filter span { margin-left: 3px; font-size: 10px; }
.conversation-list { flex: 1; min-height: 0; padding: 0 9px 12px; overflow-y: auto; overscroll-behavior: contain; }
.conversation-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 4px; padding: 15px 12px; border: 0; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; -webkit-touch-callout: none; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.conversation-item:hover { background: #f2f6f3; }
.conversation-item.selected { background: #eaf3ec; }
.avatar { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; overflow: hidden; background: #e8eee9; color: #69806e; border-radius: 12px; font-size: 15px; font-weight: 550; }
.conversation-item.selected .avatar { color: var(--green); background: #fff; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.conversation-summary { flex: 1; min-width: 0; }
.conversation-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-name { font-size: 14px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conversation-time { color: #8e9d93; font-size: 11px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.conversation-preview { display: block; margin-top: 5px; color: #7b8b81; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.unread { position: absolute; left: 41px; top: 8px; min-width: 17px; border: 2px solid #fff; border-radius: 10px; background: var(--green); color: #fff; padding: 0 4px; font-size: 9px; line-height: 15px; text-align: center; }
.sidebar-shortcuts { padding: 7px 20px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sidebar-shortcuts .text-button { padding: 7px 0; font-size: 12px; color: #718379; }
.sidebar-shortcuts svg { width: 15px; height: 15px; }
.sidebar-bottom { display: flex; align-items: center; gap: 6px; padding: 9px 20px 14px; color: #8a9a90; font-size: 10px; flex-shrink: 0; }
.sidebar-bottom .text-button { font-size: 11px; margin-left: auto; }
.list-empty { padding: 32px 16px; color: #899a8f; font-size: 13px; text-align: center; }

/* Conversation */
.chat-panel { min-height: 0; min-width: 0; overflow: hidden; background: var(--soft); }
.welcome-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; min-height: 0; padding: 36px; text-align: center; overflow-y: auto; }
.welcome-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 24px; border-radius: 20px; background: #e7f0e9; color: var(--green); font-size: 23px; font-weight: 550; }
.welcome-panel h2 { font-size: 25px; font-weight: 550; margin: 12px 0; }
.welcome-panel > p { max-width: 400px; color: #809084; font-size: 14px; line-height: 1.9; margin-bottom: 24px; }
.welcome-steps { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; color: #849488; font-size: 12px; margin: 42px 0 20px; }
.welcome-steps b { margin-right: 6px; color: #518266; font-weight: 500; font-size: 11px; }
.welcome-panel > p.small { font-size: 11px; color: #9aa69c; }
.active-chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-header { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 15px 28px; background: #fff; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.chat-customer { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; }
.chat-customer .avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 11px; font-size: 14px; }
.chat-customer > div:last-child { min-width: 0; }
.chat-customer h2 { font-size: 16px; line-height: 1.45; margin: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.chat-customer p { color: #89998e; font-size: 11px; margin: 3px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.mobile-back { display: none; }
.message-feed-wrap { position: relative; display: flex; min-height: 0; flex: 1; }
.message-feed { flex: 1; min-width: 0; min-height: 0; padding: 25px 28px 22px; background: var(--soft); overflow: auto; overscroll-behavior: contain; overflow-anchor: none; }
.message-date { color: #91a095; font-size: 11px; text-align: center; margin: 0 0 23px; }
.message-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 24px; }
.message-row.outgoing { flex-direction: row-reverse; }
.message-row .avatar { width: 31px; height: 31px; flex-basis: 31px; font-size: 12px; border-radius: 10px; color: #6a8371; background: #e5ece7; }
.message-row.outgoing .avatar { color: #fff; background: #56836c; font-size: 10px; letter-spacing: -.3px; }
.message-content { max-width: min(79%,680px); min-width: 0; }
.message-bubble { padding: 11px 14px; border: 1px solid #e6ece7; border-radius: 3px 12px 12px 12px; background: #fff; color: #314b3a; font-size: 15px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-touch-callout: none; touch-action: pan-y; box-shadow: 0 1px 1px #24483003; }
.message-row.outgoing .message-bubble { background: #dcefe3; border-color: #dcefe3; border-radius: 12px 3px 12px 12px; }
.message-bubble:focus-visible { outline: 2px solid #76af92; outline-offset: 3px; }
.message-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: #91a091; font-size: 10px; line-height: 1.6; }
.outgoing .message-meta { justify-content: flex-end; }
.message-actions-trigger { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin: -4px 0; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #8b9d8d; font-size: 16px; line-height: 1; }
.message-actions-trigger:hover { color: var(--green); background: #e7eee7; }
.clipboard-helper { position: fixed; left: -10000px; top: -10000px; width: 1px; height: 1px; opacity: 0; }
.message-state.failed { color: #ae5149; }
.message-state.uncertain { color: #ac7b37; }
.message-state.queued { color: #a38b5e; }
.message-error { color: #ac6250; font-size: 12px; margin: 5px 0 0; overflow-wrap: anywhere; }
.system-message { color: #94a08f; font-size: 11px; text-align: center; margin: 16px 0; }
.message-image-button { display: grid; place-items: center; width: 260px; max-width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 8px; background: transparent; }
.message-image { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; border-radius: 7px; background: #edf1ed; }
.message-video { display: block; width: 300px; max-width: 100%; max-height: 320px; aspect-ratio: 16 / 9; object-fit: contain; border-radius: 8px; background: #1c2821; touch-action: auto; }
.video-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 7px; white-space: normal; }
.video-actions .text-button { padding: 3px 0; font-size: 11px; }
.video-playback-hint { margin: 6px 0 0; color: #81755c; font-size: 11px; line-height: 1.6; white-space: normal; }
.image-unavailable { display: block; padding: 12px; color: #998b6c; font-size: 12px; }
.message-empty { min-height: 120px; height: 100%; display: grid; place-items: center; padding: 25px; color: #93a18f; font-size: 13px; text-align: center; }
.new-messages-button { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); border: 1px solid #dce6de; border-radius: 20px; background: #fff; color: var(--green); padding: 8px 15px; min-height: 36px; font-size: 12px; box-shadow: 0 3px 14px #203e2c0e; z-index: 2; }
.message-row.highlight .message-bubble, .message-row.is-highlighted .message-bubble, .message-row.message-highlight .message-bubble, .message-bubble.highlight, .message-bubble.message-highlight { outline: 2px solid #89b69a; outline-offset: 3px; }
.message-quote { display: block; width: 100%; max-width: 100%; margin: 0 0 8px; padding: 6px 10px; text-align: left; border: 0; border-left: 3px solid #a8c2af; border-radius: 3px 7px 7px 3px; background: #213c2b07; color: #688071; font-size: 12px; line-height: 1.5; white-space: normal; overflow: hidden; }
.message-quote:hover { background: #213c2b0d; }
.message-quote-author { display: block; font-size: 11px; font-weight: 600; color: #617969; margin-bottom: 2px; }
.message-quote-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere; }
.message-bubble .wechat-emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.uncertain-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 9px 24px; color: #967337; background: #fff3dd; font-size: 12px; flex-shrink: 0; }
.reply-context-hint { padding: 8px 16px; color: #845d28; background: #fff7e8; border-top: 1px solid #eee3cf; font-size: 12px; line-height: 1.6; flex-shrink: 0; }
.media-link-retry { margin-top: 6px; }
.upload-delivery-options { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; border: 0; }
.upload-delivery-options legend { margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.upload-delivery-options label { display: flex; align-items: center; gap: 7px; flex: 1 1 140px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.upload-delivery-options input { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--green); }
.upload-delivery-options label:has(input:checked) { border-color: var(--green); background: #eef7f2; }
.upload-delivery-options:disabled { opacity: .65; }
.demo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 24px; border-top: 1px solid #f0e5d2; background: #fff8ed; color: #9a7c45; font-size: 11px; flex-shrink: 0; }
.demo-actions .button { background: #fffbf3; border-color: #e8ddc5; font-size: 11px; min-height: 29px; padding: 4px 8px; }

/* Composer: a single input row, with a tray that only takes space while open. */
.composer { display: grid; grid-template-columns: minmax(0,1fr) 40px auto; align-items: end; gap: 0 12px; position: relative; padding: 14px 24px; background: #fff; border-top: 1px solid var(--line); flex-shrink: 0; }
.composer textarea { display: block; grid-column: 1; grid-row: 2; width: 100%; min-height: 44px; height: 44px; max-height: 158px; resize: none; border: 1px solid #e0e8e2; border-radius: 10px; padding: 10px 13px; background: #f8faf8; font-size: 14px; line-height: 22px; overflow-y: auto; }
.composer textarea:focus { background: #fff; border-color: #90b7a0; outline: 0; }
.composer-bottom, .composer-left { display: contents; }
.composer-bottom > .button { grid-column: 3; grid-row: 2; min-height: 42px; height: 42px; min-width: 66px; margin-bottom: 1px; padding: 8px 18px; }
.composer-tools-toggle { grid-column: 2; grid-row: 2; display: grid; place-items: center; width: 38px; height: 42px; padding: 0; margin-bottom: 1px; border: 0; border-radius: 8px; background: transparent; color: #6d8074; font-size: 31px; line-height: 1; touch-action: manipulation; }
.composer-tools-toggle > span { display: grid; place-items: center; width: 29px; height: 29px; border: 1.5px solid currentColor; border-radius: 50%; font-size: 26px; font-weight: 300; transition: transform .15s; }
.composer-tools-toggle:hover, .composer-tools-toggle[aria-expanded="true"] { color: var(--green); background: #edf4ef; }
.composer-tools-toggle[aria-expanded="true"] > span { transform: rotate(45deg); }
.quote-preview { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 0 8px; padding: 3px 3px 3px 10px; border-left: 3px solid #a7c6b1; border-radius: 3px 7px 7px 3px; color: #67806e; background: #f1f6f2; }
.quote-preview-content { display: flex; align-items: baseline; gap: 8px; flex: 1; min-width: 0; font-size: 12px; }
.quote-preview-content strong { font-size: 12px; font-weight: 600; max-width: 32%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.quote-preview-content span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quote-preview .icon-button { width: 30px; height: 28px; font-size: 21px; }
.composer-tools-panel { position: absolute; right: 23px; bottom: calc(100% + 7px); z-index: 5; width: min(330px,calc(100% - 46px)); max-height: min(310px,var(--composer-tools-height,calc(var(--app-viewport-height,100dvh) - 200px))); border: 1px solid #dfe8e1; border-radius: 12px; background: #fff; box-shadow: 0 8px 28px #24483018; overflow: auto; overscroll-behavior: contain; }
.composer-tools-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; padding: 3px 8px 0 15px; color: #8b9b8f; font-size: 11px; }
.composer-tools-heading .text-button { width: 30px; height: 28px; padding: 0; font-size: 22px; color: #87998b; }
.composer-tools-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; padding: 8px 12px 13px; }
.composer-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 0; border: 0; border-radius: 8px; color: #677f6e; background: transparent; touch-action: manipulation; }
.composer-tool-icon { display: grid; place-items: center; width: 44px; height: 44px; background: #f5f8f5; border: 1px solid #e6ece6; border-radius: 11px; color: #42664f; }
.composer-tool-icon svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.composer-tool:hover:enabled .composer-tool-icon { background: #eaf3eb; border-color: #c6dcca; }
.composer-tool-label { font-size: 11px; line-height: 1.4; white-space: nowrap; }
.voice-feature-hint { margin: 0; padding: 0 15px 11px; color: #91a08f; font-size: 10px; line-height: 1.5; }
.composer-tools-panel:has(.emoji-panel:not([hidden])) .voice-feature-hint { display: none; }
.emoji-panel { width: 100%; overflow: hidden; }
.emoji-panel-heading { display: flex; align-items: center; min-height: 28px; padding: 0 9px; }
.emoji-panel-heading .text-button { color: #778c7a; font-size: 11px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: 2px; padding: 4px 9px 10px; max-height: 210px; overflow-y: auto; overscroll-behavior: contain; }
.emoji-choice { display: grid; place-items: center; width: 100%; min-height: 35px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 7px; background: transparent; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-size: 24px; line-height: 1; touch-action: manipulation; }
.emoji-choice:hover { background: var(--green-light); }
.emoji-choice:focus-visible { outline-offset: -2px; }

/* Secondary pages use the same shell, typography and form controls. */
.secondary-page { grid-column: 2; grid-row: 3; min-height: 0; min-width: 0; overflow-y: auto; background: var(--soft); overscroll-behavior: contain; }
.secondary-header { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 28px; border-bottom: 1px solid var(--line); background: #ffffffed; backdrop-filter: blur(12px); }
.secondary-header h2 { margin: 0; font-size: 17px; }
.secondary-refresh, .secondary-header > #deleted-refresh-button { margin-left: auto; }
.detail-page-content { max-width: 740px; padding: 28px 24px 36px; margin: auto; }
.customer-panel, .account-card { min-width: 0; padding: 28px 30px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.detail-heading h2 { font-size: 23px; overflow-wrap: anywhere; }
.detail-empty { margin-top: 25px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.customer-panel form > .button { margin-top: 13px; }
.customer-panel .field-hint { min-height: 18px; }
.detail-divider { margin: 28px 0 24px; border-top: 1px solid var(--line); }
.detail-value { margin: 0 0 5px; font-size: 14px; }
.customer-panel p.small { font-size: 12px; line-height: 1.8; margin-top: 9px; }
.human-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: #72876f; }
.human-note .status-dot { margin-top: 7px; }
.human-note strong { font-size: 13px; font-weight: 500; }
.human-note p { margin: 5px 0 0; color: #91a18b; font-size: 12px; }
.deleted-page-content { max-width: 870px; margin: auto; padding: 26px 24px 36px; }
.deleted-page-content > p { font-size: 13px; line-height: 1.8; }
.deleted-list { display: flex; flex-direction: column; gap: 12px; }
.deleted-item { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.deleted-item > div { flex: 1; min-width: 0; }
.deleted-item h3 { font-size: 15px; margin: 0 0 6px; overflow-wrap: anywhere; }
.deleted-item p { color: var(--muted); font-size: 12px; margin: 0 0 6px; overflow-wrap: anywhere; }
.deleted-item .button { flex-shrink: 0; }
.deleted-date { color: #8b9b8e; font-size: 11px; }
.account-page-content { max-width: 850px; margin: auto; padding: 28px 24px 36px; }
.account-card { margin-bottom: 20px; }
.account-card h3 { font-size: 16px; margin: 0 0 10px; }
.account-card h2 { font-size: 23px; overflow-wrap: anywhere; }
.account-card form > .button { margin-top: 20px; }
.account-card form { max-width: 520px; }
.account-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 23px; }
.account-metric { display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 16px; border: 1px solid #edf1ed; border-radius: 9px; background: #f7f9f6; }
.account-metric > span { color: #7a8e7a; font-size: 12px; }
.account-metric > strong { color: #41664c; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.account-metric > small { color: #8c9b84; font-size: 11px; }
.audit-list { max-height: 430px; margin-top: 16px; overflow-y: auto; }
.audit-item { padding: 13px 0; border-bottom: 1px solid #edf1ea; }
.audit-item:last-child { border: 0; }
.audit-main { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.audit-main strong { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.audit-main time { color: #92a18a; font-size: 11px; flex-shrink: 0; }
.audit-item p { color: #86967f; font-size: 12px; line-height: 1.8; margin: 5px 0 0; overflow-wrap: anywhere; }
.admin-page-content { max-width: 1180px; margin: auto; padding: 28px 24px 36px; }
.admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.admin-toolbar h3 { font-size: 22px; margin: 0 0 7px; }
.admin-toolbar p { margin: 0; }
.registration-setting { display: flex; align-items: center; gap: 12px; font-size: 12px; flex-shrink: 0; }
.registration-setting .button[aria-pressed="true"] { background: var(--green-light); color: var(--green); border-color: #cfe1d2; }
.admin-status-summary { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.admin-summary-chip { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 52px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; color: #69806b; background: #fff; text-align: left; }
.admin-summary-chip:hover, .admin-summary-chip.selected { border-color: #aac9b1; background: #edf6ed; color: var(--green); }
.admin-summary-chip strong { font-size: 17px; font-weight: 600; }
.admin-summary-chip span { font-size: 11px; }
.admin-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.admin-filter label { color: #7f907b; font-size: 12px; margin: 0; }
.admin-filter select { min-height: 38px; font-size: 13px; padding: 7px 32px 7px 12px; }
.admin-search { flex: 1; }
.admin-search input { width: 100%; min-height: 40px; margin: 0; font-size: 13px; }
.admin-columns { display: grid; grid-template-columns: minmax(250px,.8fr) minmax(0,1.3fr); gap: 20px; align-items: start; }
.admin-users-card { padding: 9px; }
.admin-users { max-height: 700px; overflow-y: auto; }
.admin-users > p { padding: 20px 14px; }
.admin-user-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 17px 13px; border: 0; border-radius: 9px; color: var(--ink); background: transparent; text-align: left; }
.admin-user-item:hover { background: #f1f6ef; }
.admin-user-item.selected { background: #eaf3e8; }
.admin-user-identity { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-user-identity strong { font-size: 14px; overflow-wrap: anywhere; }
.admin-user-identity small { font-size: 12px; color: #8d9c83; overflow-wrap: anywhere; }
.admin-user-identity .admin-draft-label { color: #b27b28; font-size: 10px; }
.admin-user-item .status-badge { font-size: 10px; max-width: 85px; }
.admin-user-detail > h3 { font-size: 21px; overflow-wrap: anywhere; }
.admin-user-detail > p { overflow-wrap: anywhere; }
.compact-metrics { gap: 9px; margin-top: 18px; }
.compact-metrics .account-metric { padding: 12px; }
.compact-metrics .account-metric > strong { font-size: 14px; }
.admin-user-actions { display: flex; flex-wrap: wrap; gap: 9px; padding-top: 20px; margin-top: 24px; border-top: 1px solid var(--line); }
.admin-user-actions .button { flex: 1; font-size: 12px; }
.admin-user-form { max-width: none !important; }
.admin-user-form h4 { font-size: 15px; margin: 24px 0 6px; }
.admin-list-return { display: none; }
.admin-draft-notice { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px; border: 1px solid #eadcbc; border-radius: 9px; background: #fff9ed; color: #947038; font-size: 12px; line-height: 1.6; }
.admin-draft-notice .button { flex-shrink: 0; color: #947038; }
.admin-draft-notice[hidden] { display: none; }
.admin-user-form .field-hint { line-height: 1.8; }
.admin-presets { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 8px 0 3px; }
.admin-presets > span { min-width: 72px; color: #82927f; font-size: 11px; }
.preset-button { min-height: 36px; padding: 6px 11px; border: 1px solid #dfe8dd; border-radius: 7px; color: #58705b; background: #f7faf6; font-size: 12px; }
.preset-button:hover { border-color: #b9d0bb; background: #eaf4e9; }
#admin-reset-link { font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
#admin-reset-description { overflow-wrap: anywhere; }

/* Dialogs and feedback */
.dialog { padding: 25px; width: calc(100% - 32px); max-width: 530px; max-height: calc(var(--app-viewport-height,100dvh) - 32px); overflow-y: auto; color: var(--ink); border: 1px solid #e1e9e3; border-radius: 15px; background: #fff; box-shadow: 0 20px 80px #1534262b; }
.dialog::backdrop { background: #1b302747; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; margin-bottom: 17px; }
.dialog-heading h2 { font-size: 21px; font-weight: 600; margin: 2px 0 0; }
.dialog-heading .icon-button { margin: -3px -5px 0 0; }
.dialog > .muted { font-size: 13px; line-height: 1.8; }
.inline-form { display: flex; align-items: center; gap: 8px; }
.inline-form input { flex: 1; width: 0; }
.dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 24px; }
.dialog-footer p, .dialog-footer > span { flex: 1; margin: 0; font-size: 11px; line-height: 1.7; }
.binding-status-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 24px; }
.binding-qr-area { display: grid; place-items: center; min-height: 240px; padding: 18px; margin-top: 15px; border: 1px solid #e6ece2; border-radius: 12px; background: #f7f9f4; }
.binding-qr-area img { width: 100%; max-width: 350px; height: auto; padding: 0; border-radius: 7px; background: #fff; }
.binding-qr-area p { font-size: 12px; text-align: center; margin: 0; }
.binding-qr-area > img, .binding-qr-area > p { grid-area: 1 / 1; }
.binding-qr-area.qr-inactive img { opacity: .25; }
.binding-qr-area.qr-inactive p { z-index: 1; max-width: 230px; padding: 12px; border-radius: 8px; background: rgba(255,255,255,.96); color: #6d5941; }
.binding-message { color: #748a68; text-align: center; font-size: 12px; margin: 13px 0 5px; overflow-wrap: anywhere; }
.binding-qr-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#binding-code-details { color: #869a75; font-size: 12px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 20px; }
#binding-code-details summary { cursor: pointer; }
#binding-code-details label { margin-top: 14px; }
.binding-qr-disclosure { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f4; }
.binding-qr-disclosure > summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 10px 14px; list-style: none; cursor: pointer; color: #315f50; font-size: 13px; font-weight: 600; touch-action: manipulation; }
.binding-qr-disclosure > summary::-webkit-details-marker { display: none; }
.binding-qr-disclosure > summary::after { content: '⌄'; margin-left: auto; font-size: 18px; line-height: 1; }
.binding-qr-disclosure[open] > summary::after { transform: rotate(180deg); }
.binding-qr-disclosure > summary:focus-visible { outline: 2px solid #168575; outline-offset: 2px; border-radius: 9px; }
.binding-qr-disclosure .binding-qr-area { margin: 0; padding: 0; border: 0; background: #ffffff; }
.binding-qr-disclosure .binding-qr-time { margin: 8px 10px 12px; }
.upload-preview { display: block; max-width: 100%; max-height: 420px; object-fit: contain; margin: 10px auto 18px; border-radius: 10px; background: #f4f7f0; }
#upload-description { overflow-wrap: anywhere; }
.upload-video-preview { width: 100%; max-height: min(420px, 45dvh); background: #1c2821; }
.image-dialog { max-width: 1050px; }
.image-dialog > img { display: block; max-width: 100%; max-height: 75vh; object-fit: contain; margin: auto; }
.small-dialog { max-width: 420px; }
.health-details { border: 1px solid #e4eade; border-radius: 9px; background: #f5f7f1; padding: 16px; font: 11px/1.8 ui-monospace,SFMono-Regular,monospace; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 420px; overflow: auto; }
.message-actions-dialog { max-width: 320px; padding: 16px; }
.message-actions-dialog .dialog-heading { margin-bottom: 9px; }
.message-actions-dialog .dialog-heading h2 { font-size: 15px; margin: 3px 0 0; }
.message-actions-dialog .dialog-heading .icon-button { font-size: 22px; width: 28px; height: 28px; }
.message-action-preview { max-height: 40px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0 0 12px; color: #8a998e; font-size: 12px; }
.message-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
.message-actions button { display: flex; flex-direction: column; align-items: center; gap: 8px; border: 0; background: #f6f9f5; color: #4e6d53; border-radius: 9px; padding: 13px 8px; font-size: 12px; }
.message-actions button:hover { background: #eaf3e7; }
.message-actions .danger-text { color: var(--danger); }
.message-delete-preview { max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); font-size: 13px; color: #6c806d; }
.toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: min(420px,calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 15px; padding: 13px 15px; color: #4e6749; background: #fff; border: 1px solid #dce7d8; border-radius: 10px; box-shadow: 0 6px 25px #243e2312; font-size: 12px; overflow-wrap: anywhere; pointer-events: auto; }
.toast.error { color: #a25840; background: #fffaf7; border-color: #e9d3c8; }
.toast button { padding: 0 2px; border: 0; background: transparent; color: inherit; font-size: 19px; }
.toast .toast-action { min-height: 36px; padding: 7px 10px; border-radius: 6px; color: var(--green); background: var(--green-light); font-size: 13px; font-weight: 600; white-space: nowrap; }

/* Existing voice capture and native audio controls remain functional. */
.voice-bubble { min-width: min(285px,62vw); max-width: 100%; white-space: normal; }
.voice-bubble-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; font-weight: 600; }
.voice-duration { color: #778d7b; font-size: 11px; font-variant-numeric: tabular-nums; }
.voice-unlistened { padding: 2px 7px; border-radius: 20px; background: #eaf3e8; color: #2b7653; font-size: 10px; }
.voice-unlistened::before { content: '●'; font-size: 8px; margin-right: 4px; }
.voice-player { display: block; width: 285px; max-width: 100%; height: 38px; margin: 10px 0 2px; }
.voice-transcript { border-top: 1px solid #dce7d9; padding-top: 10px; margin: 12px 0 0; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-transcript > span { display: block; margin-bottom: 4px; color: #8c9e85; font-size: 10px; }
.voice-unavailable { display: block; padding: 12px 0; color: #9b8c6e; font-size: 12px; }
.voice-retry, .voice-transcribe { min-height: 34px; margin-top: 8px; font-size: 11px; }
.voice-record-dialog { max-width: 480px; }
.voice-record-time { padding: 20px 0 4px; color: var(--green); text-align: center; font-size: 42px; font-weight: 600; line-height: 1.5; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.voice-record-status { color: #7b907c; text-align: center; font-size: 13px; margin: 8px 0 24px; }
.voice-record-preview { display: block; width: 100%; margin: 10px 0 20px; }
.voice-record-actions { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 22px 0 5px; }
.voice-record-actions .button { min-height: 44px; }
.admin-voice-details { border-top: 1px solid var(--line); margin-top: 24px; }
.admin-voice-details > summary { padding: 20px 0 4px; cursor: pointer; color: var(--ink); font-size: 14px; }
.admin-voice-details > summary span { display: block; margin: 7px 0 0 16px; color: #7a8e7a; font-size: 12px; font-weight: 400; }
.admin-voice-form { max-width: none !important; padding-top: 4px; margin-top: 0; }
.admin-voice-form h4 { font-size: 14px; margin: 0 0 17px; }
.admin-voice-form .voice-setting-toggle { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: 13px; cursor: pointer; }
.voice-setting-toggle input { width: 18px; height: 18px; flex: 0 0 18px; padding: 0; accent-color: var(--green); }
.admin-voice-form .field-hint { font-size: 11px; line-height: 1.7; }
.admin-voice-form + .admin-user-form { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 24px; }

/* Tablet keeps the same hierarchy with a narrower list. */
@media (min-width: 701px) and (max-width: 1100px) {
  :root { --rail-width: 68px; --list-width: 246px; }
  .app-header { padding: 0 20px; }
  .app-navigation { padding-left: 5px; padding-right: 5px; }
  .nav-button { width: 55px; }
  .sidebar-heading { padding: 23px 16px 17px; }
  .conversation-search { margin: 0 16px; }
  .conversation-filters { padding-left: 16px; padding-right: 16px; }
  .conversation-item { gap: 10px; padding: 14px 10px; }
  .conversation-item .avatar { width: 35px; height: 35px; flex-basis: 35px; font-size: 14px; }
  .conversation-time { font-size: 10px; }
  .conversation-name { font-size: 13px; }
  .chat-header { padding: 14px 19px; gap: 9px; }
  .chat-header-actions { gap: 4px; }
  .chat-customer p { font-size: 10px; }
  .message-feed { padding: 22px 20px; }
  .composer { padding: 12px 18px; gap: 0 8px; }
  .admin-columns { grid-template-columns: minmax(220px,.8fr) minmax(0,1.2fr); gap: 14px; }
  .account-card { padding: 22px; }
  .admin-toolbar { align-items: flex-start; }
  .registration-setting { flex-direction: column; align-items: flex-end; gap: 5px; }
}

/* Mobile: one screen at a time. The safe-area is the only persistent bottom inset. */
@media (max-width: 700px) {
  input, textarea, select { font-size: 16px; }
  .button { min-height: 42px; }
  .auth-screen { display: block; }
  .auth-intro { padding: 28px 25px 24px; }
  .auth-intro .brand-lockup { font-size: 20px; margin-bottom: 23px; }
  .auth-intro h1 { font-size: 25px; line-height: 1.65; }
  .auth-intro::after { width: 290px; height: 290px; bottom: -255px; right: -120px; }
  .auth-footnote { display: none; }
  .auth-panel { max-width: 460px; padding: 30px 25px 40px; }
  .auth-panel h2 { font-size: 23px; }
  .auth-panel > .muted { font-size: 13px; margin-bottom: 25px; }
  .registration-entry .text-button, .auth-panel .auth-back { min-height: 42px; }
  #app-shell { display: flex; flex-direction: column; position: fixed; top: var(--app-viewport-offset,0px); left: 0; right: 0; width: 100%; height: var(--app-viewport-height,100dvh); }
  .app-header { min-height: 59px; padding: max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left)); flex-shrink: 0; }
  .app-header h1 { font-size: 16px; }
  .app-header .brand-mark { width: 32px; height: 32px; font-size: 11px; }
  .mode-badge { max-width: 120px; padding: 4px 6px; font-size: 9px; }
  .app-navigation { display: flex; flex-direction: row; justify-content: space-around; gap: 3px; padding: 4px 12px 7px; background: #fff; border: 0; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow: visible; }
  .nav-button { flex: 1; max-width: 76px; width: auto; min-height: 44px; padding: 4px 2px; gap: 3px; font-size: 10px; border-radius: 8px; }
  .nav-button svg { width: 18px; height: 18px; }
  .demo-notice { flex-shrink: 0; padding: 5px 14px; font-size: 10px; }
  .demo-notice span { display: none; }
  .workspace { display: block; flex: 1; min-height: 0; }
  .conversation-sidebar, .chat-panel { width: 100%; height: 100%; border: 0; }
  body[data-route="inbox"] .chat-panel { display: none; }
  body[data-route="chat"] .conversation-sidebar, body[data-route="chat"] .app-header, body[data-route="chat"] .app-navigation { display: none; }
  .sidebar-heading { padding: 20px 19px 17px; }
  .sidebar-heading h2 { font-size: 21px; }
  .sidebar-heading .icon-button { width: 36px; height: 36px; }
  .conversation-search { height: 41px; margin: 0 19px; }
  .conversation-search input { font-size: 16px; }
  .conversation-filters { padding: 11px 19px 13px; }
  .conversation-filter { min-height: 35px; font-size: 13px; padding: 6px 14px; }
  .conversation-list { padding: 0 9px 8px; }
  .conversation-item { padding: 16px 12px; margin-bottom: 3px; }
  .conversation-name { font-size: 15px; }
  .conversation-preview { font-size: 13px; }
  .conversation-time { font-size: 11px; }
  .conversation-item .avatar { width: 42px; height: 42px; flex-basis: 42px; }
  .sidebar-shortcuts { padding: 5px 18px; }
  .sidebar-shortcuts .text-button { min-height: 34px; }
  .sidebar-bottom { padding: 4px 18px max(8px,env(safe-area-inset-bottom)); font-size: 11px; }
  .active-chat { min-height: 0; height: 100%; }
  .chat-header { min-height: 60px; padding: max(5px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 5px 3px; gap: 5px; }
  .mobile-back { display: inline-grid; width: 36px; height: 44px; font-size: 31px; color: #657e6c; border-radius: 6px; }
  .chat-customer { gap: 8px; }
  .chat-customer .avatar { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: 13px; }
  .chat-customer h2 { font-size: 16px; }
  .chat-customer p { font-size: 9px; margin-top: 1px; }
  .chat-header-actions { gap: 0; flex-direction: column; align-items: flex-end; }
  .chat-header-actions .status-badge { max-width: 105px; font-size: 9px; padding: 1px 5px; }
  .chat-header-actions .button { min-height: 27px; padding: 3px 5px; font-size: 11px; }
  .message-feed { padding: 19px 12px 13px; }
  .message-date { font-size: 10px; margin-bottom: 20px; }
  .message-row { gap: 8px; margin-bottom: 21px; }
  .message-row .avatar { width: 29px; height: 29px; flex-basis: 29px; font-size: 11px; border-radius: 9px; }
  .message-row.outgoing .avatar { font-size: 9px; }
  .message-content { max-width: 81%; }
  .message-bubble { padding: 9px 11px; font-size: 15px; line-height: 1.65; }
  .message-meta { font-size: 10px; gap: 6px; margin-top: 5px; }
  .message-image-button { width: min(235px,63vw); }
  .message-quote { font-size: 12px; padding: 6px 8px; }
  .new-messages-button { padding: 7px 13px; font-size: 11px; }
  .composer { grid-template-columns: minmax(0,1fr) 36px 58px; gap: 0 6px; padding: 8px max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); background: #f6f8f6; }
  .composer textarea { height: 40px; min-height: 40px; max-height: 146px; padding: 8px 10px; border: 1px solid #e1e8e1; border-radius: 8px; background: #fff; font-size: 16px; line-height: 22px; }
  .composer-tools-toggle { width: 36px; height: 40px; margin: 0; }
  .composer-tools-toggle > span { width: 27px; height: 27px; font-size: 25px; }
  .composer-bottom > .button { width: 58px; min-width: 0; min-height: 38px; height: 38px; padding: 7px 10px; margin: 0 0 1px; border-radius: 7px; font-size: 13px; }
  .quote-preview { padding: 2px 0 2px 8px; margin-bottom: 7px; }
  .quote-preview-content { gap: 6px; font-size: 11px; }
  .quote-preview-content strong { font-size: 11px; }
  .quote-preview .icon-button { width: 30px; height: 28px; }
  .composer-tools-panel { grid-column: 1 / -1; grid-row: 3; position: static; width: 100%; max-height: min(260px,calc(var(--app-viewport-height,100dvh) - 200px)); margin-top: 8px; border: 0; border-top: 1px solid #e5eae3; border-radius: 0; box-shadow: none; background: transparent; overflow-y: auto; }
  .composer-tools-heading { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .composer-tools-grid { gap: 8px; padding: 15px 8px 12px; }
  .composer-tool { gap: 6px; }
  .composer-tool-icon { width: 43px; height: 43px; border-radius: 11px; background: #fff; border-color: #e3eae1; }
  .composer-tool-icon svg { width: 23px; height: 23px; }
  .composer-tool-label { font-size: 11px; line-height: 16px; }
  .composer-tools-panel .voice-feature-hint { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .emoji-panel-heading { min-height: 33px; padding: 4px 3px 0; }
  .emoji-panel-heading .text-button { min-height: 30px; font-size: 12px; }
  .emoji-grid { grid-template-columns: repeat(7,minmax(0,1fr)); max-height: min(210px,calc(var(--app-viewport-height,100dvh) - 235px)); gap: 2px; padding: 3px 2px 7px; }
  .emoji-choice { min-height: 38px; font-size: 25px; }
  .demo-actions { padding: 4px 11px; gap: 6px; font-size: 10px; }
  .demo-actions .button { min-height: 27px; padding: 3px 6px; font-size: 10px; }
  .uncertain-banner { padding: 7px 12px; gap: 4px; font-size: 11px; }
  .secondary-page { flex: 1; }
  .secondary-header { padding: 8px 10px; min-height: 55px; gap: 9px; }
  .secondary-header h2 { font-size: 15px; }
  .secondary-header .button { min-height: 36px; padding: 7px; font-size: 12px; }
  .detail-page-content { padding: 15px 12px max(24px,env(safe-area-inset-bottom)); }
  .customer-panel, .account-card { padding: 22px 18px; border-radius: 11px; }
  .detail-heading h2 { font-size: 21px; }
  .deleted-page-content { padding: 19px 13px max(24px,env(safe-area-inset-bottom)); }
  .deleted-item { padding: 16px; gap: 12px; }
  .deleted-item .button { padding: 8px 11px; }
  .account-page-content, .admin-page-content { padding: 16px 12px max(25px,env(safe-area-inset-bottom)); }
  .account-card { margin-bottom: 14px; }
  .account-card h2 { font-size: 21px; }
  .account-metrics { gap: 9px; margin-top: 18px; }
  .account-metric { padding: 12px; }
  .account-metric > strong { font-size: 14px; }
  .account-metric > span, .account-metric > small { font-size: 11px; }
  .audit-main { flex-wrap: wrap; gap: 3px; }
  .audit-main strong { font-size: 12px; }
  .audit-main time { font-size: 10px; }
  .audit-item p { font-size: 11px; }
  .admin-toolbar { align-items: flex-start; gap: 12px; }
  .admin-toolbar h3 { font-size: 20px; }
  .admin-toolbar p { font-size: 11px; }
  .registration-setting { flex-direction: column; align-items: flex-end; gap: 4px; font-size: 10px; }
  .registration-setting .button { min-height: 34px; font-size: 11px; padding: 6px 9px; }
  .admin-columns { display: block; }
  .admin-users-card { padding: 7px; }
  .admin-users { max-height: 260px; }
  .admin-user-item { padding: 14px 10px; }
  .admin-status-summary { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; }
  .admin-summary-chip { min-height: 46px; padding: 8px 9px; }
  .admin-filter { flex-wrap: wrap; gap: 8px; }
  .admin-search { flex-basis: 100%; }
  .admin-search input, .admin-filter select { font-size: 16px; }
  .admin-filter select { flex: 1; max-width: none; }
  .admin-user-detail { scroll-margin-top: 68px; }
  .admin-list-return { display: block; margin: -7px 0 16px -8px; }
  .admin-draft-notice { align-items: flex-start; }
  .admin-presets > span { flex-basis: 100%; }
  .preset-button { min-height: 40px; padding: 7px 13px; }
  .admin-user-actions .button { min-height: 44px; }
  #admin-reset-link { font-size: 16px; }
  .dialog { padding: 21px 18px; }
  .dialog-heading h2 { font-size: 19px; }
  .inline-form { flex-wrap: wrap; }
  .inline-form input { flex-basis: 100%; width: 100%; }
  .inline-form .button { width: 100%; }
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer p, .dialog-footer > span { flex-basis: 100%; margin-bottom: 5px; }
  .binding-qr-area { min-height: 220px; }
  .message-actions-dialog { max-width: 300px; padding: 15px; }
  .message-actions-dialog .dialog-heading h2 { font-size: 15px; }
  .toast-region { right: 12px; bottom: max(12px,env(safe-area-inset-bottom)); }
  .voice-bubble { min-width: 0; width: min(285px,60vw); }
  .voice-player { width: 100%; height: 38px; }
  .voice-bubble-heading { font-size: 11px; gap: 6px; }
  .voice-record-time { font-size: 36px; }
}
@media (max-width: 370px) {
  .chat-customer p { max-width: 155px; }
  .chat-customer .avatar { display: none; }
  .composer { gap: 0 4px; grid-template-columns: minmax(0,1fr) 34px 54px; }
  .composer-bottom > .button { width: 54px; }
  .message-content { max-width: 82%; }
}
@media (max-height: 550px) and (min-width: 701px) {
  .app-navigation { gap: 2px; padding-top: 8px; padding-bottom: 8px; }
  .nav-button { min-height: 50px; padding: 5px 2px; }
  .sidebar-heading { padding-top: 15px; padding-bottom: 12px; }
  .conversation-filters { padding-top: 9px; padding-bottom: 11px; }
}
@media (pointer: coarse) {
  button { touch-action: manipulation; }
  .message-actions-trigger { width: 44px; height: 44px; margin: -14px -7px; }
  .message-bubble { -webkit-user-select: none; user-select: none; touch-action: pan-y; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
.binding-qr-time { margin: 8px 0; text-align: center; color: #657e6b; font-size: 12px; font-variant-numeric: tabular-nums; }
#binding-session-time { font-size: 11px; line-height: 1.7; text-align: center; }
#binding-pending-list .button { margin: 0 0 8px; text-align: left; }
.qr-save-dialog { max-width: 410px; }
#qr-save-image { display: block; max-width: 100%; max-height: min(60dvh,620px); height: auto; margin: 0 auto; border: 1px solid var(--line); border-radius: 10px; }
.qr-save-dialog .dialog-footer { margin-top: 14px; }
.qr-save-dialog .small { line-height: 1.7; }
@media (max-width: 700px) {
  .binding-dialog .inline-form { flex-wrap: nowrap; }
  .binding-dialog .inline-form input { flex: 1; width: 0; }
  .binding-dialog .inline-form .button { width: auto; flex-shrink: 0; font-size: 12px; padding: 8px 11px; }
  .binding-qr-area { min-height: 190px; margin-top: 10px; padding: 10px; }
  .binding-qr-area img { max-width: 320px; padding: 0; }
  .binding-dialog .dialog-heading { margin-bottom: 10px; }
  .binding-status-row { margin-top: 16px; }
  .binding-qr-actions .button { flex: 1; padding: 8px; font-size: 12px; }
  .binding-dialog .dialog-footer { margin-top: 14px; padding-top: 12px; }
  .binding-dialog .dialog-footer > p { display: none; }
  .qr-save-dialog { padding: 16px; }
}

/* Account settings: distinct identities, local save feedback, and a true mobile detail view. */
.account-section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.account-section-heading h2 { margin:8px 0; }
.account-section-heading p { margin:0; }
.account-section-tag { padding:6px 10px; border-radius:8px; background:#edf5f0; color:var(--green); font-size:12px; white-space:nowrap; }
.account-profile-card .identity-form { max-width:none; }
.identity-form h4 { font-size:16px; margin:24px 0 12px; }
.identity-form input[readonly] { background:#f3f5f4; color:#697d73; border-style:dashed; cursor:default; }
.identity-form .field-hint, .account-profile-card > .field-hint { line-height:1.7; font-size:12px; }
.account-profile-card > .field-hint { margin-top:18px; }
.form-actions, .customer-form-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:20px; }
.form-actions > .field-hint { margin:0 auto 0 0; color:#947038; }
.form-actions .button, .customer-form-actions .button { min-height:44px; margin-top:0; }
.form-success { color:#13765e; padding:10px 12px; border-radius:8px; background:#edf7ef; font-size:13px; line-height:1.6; }
.form-success[hidden] { display:none; }
.account-fold { padding:0; overflow:hidden; }
.account-fold > summary { cursor:pointer; padding:20px 24px; color:var(--ink); list-style:none; display:flex; align-items:center; gap:16px; }
.account-fold > summary::-webkit-details-marker { display:none; }
.account-fold > summary::after { content:'⌄'; margin-left:auto; font-size:20px; color:var(--muted); }
.account-fold[open] > summary::after { transform:rotate(180deg); }
.account-fold > summary span { display:flex; flex-direction:column; gap:7px; }
.account-fold > summary strong { font-size:15px; font-weight:600; }
.account-fold > summary small { color:var(--muted); font-size:12px; line-height:1.6; }
.account-fold > form, .account-fold > .account-metrics, .account-fold > .audit-list { margin:0 24px 24px; }
.account-fold > form { max-width:none; }
.password-visible-toggle { display:flex; align-items:center; gap:9px; cursor:pointer; font-weight:400; font-size:13px; }
.password-visible-toggle input { width:18px; height:18px; min-height:18px; margin:0; }
.admin-identity-form { max-width:none!important; }
.admin-settings-group { border-top:1px solid var(--line); margin-top:24px; padding-top:0; }
.admin-settings-group > summary { cursor:pointer; padding:18px 0; font-size:14px; color:var(--ink); }
.admin-settings-group > summary span { display:block; margin:7px 0 0 16px; color:var(--muted); font-size:12px; line-height:1.6; font-weight:400; }
.admin-settings-group .admin-user-actions { margin-top:0; padding-top:0; border:0; padding-bottom:8px; }
.admin-settings-group .admin-user-form { margin-top:0; }
.admin-user-detail .compact-metrics { margin-bottom:22px; }
.admin-danger-group > summary strong { color:#97604d; }
.customer-danger-details { margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.customer-danger-details > summary { cursor:pointer; color:var(--muted); font-size:13px; padding:8px 0 16px; }
.conversation-draft-label { display:inline; color:#a66b19; font-size:12px; font-weight:600; margin-right:5px; }
@media (max-width:700px) {
  #admin-page:not(.show-account-detail) .admin-user-detail { display:none; }
  #admin-page.show-account-detail .admin-toolbar, #admin-page.show-account-detail .admin-status-summary, #admin-page.show-account-detail .admin-filter, #admin-page.show-account-detail .admin-users-card, #admin-page.show-account-detail .admin-audit-card { display:none; }
  #admin-page .admin-users { max-height:none; }
  #admin-page.show-account-detail .admin-user-detail { margin-bottom:0; }
  #admin-page.show-account-detail .admin-list-return { display:none; }
  .account-section-tag { font-size:11px; }
  .account-profile-card .identity-form input, .account-fold input:not([type="checkbox"]), .admin-user-detail input:not([type="checkbox"]) { font-size:16px; min-height:44px; }
  .account-profile-card > .field-hint, .identity-form .field-hint { font-size:12px; }
  .account-fold { padding:0; }
  .account-fold > summary { padding:19px 18px; }
  .account-fold > form, .account-fold > .account-metrics, .account-fold > .audit-list { margin-left:18px; margin-right:18px; margin-bottom:20px; }
  .account-fold .password-visible-toggle input { min-height:18px; }
  .form-actions { flex-wrap:wrap; }
  .form-actions > .field-hint { flex-basis:100%; }
  .form-actions .button, .customer-form-actions .button { flex:1; font-size:14px; padding:11px; }
  .admin-settings-group > summary { padding:18px 0; min-height:44px; }
  .admin-user-item .status-badge { font-size:11px; }
}

.admin-detail-status { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:14px 0 4px; }
.admin-usage-details .compact-metrics { margin-top:0; }

/* Official App design: the same brand, navigation and account hierarchy on every screen. */
:root { --ink:#263d34; --muted:#728078; --line:#e4eae6; --green:#147b62; --green-light:#e3f0e8; --soft:#f5f7f6; --list-width:272px; }
.brand-mark { overflow:hidden; background:transparent; border-radius:10px; }
.brand-mark img { display:block; width:100%; height:100%; object-fit:contain; }
.auth-screen { min-height:100dvh; grid-template-columns:1fr 1fr; }
.auth-intro { background:#e3f0e8; padding:64px clamp(36px,7vw,105px); }
.auth-intro::after { display:none; }
.auth-intro .brand-lockup { margin-bottom:84px; gap:16px; font-size:24px; }
.auth-intro .brand-mark { width:76px; height:76px; border-radius:22px; }
.auth-intro h1 { font-size:40px; line-height:1.55; letter-spacing:-1.2px; }
.auth-footnote { margin-top:100px; color:#728078; }
.auth-panel { max-width:510px; padding:54px 42px; }
.auth-panel h2 { font-size:30px; letter-spacing:-.8px; }
.auth-panel input { min-height:48px; border-radius:10px; }
.auth-password-input { position:relative; }
.auth-password-input input { padding-right:66px; }
.auth-password-input .text-button { position:absolute; right:4px; top:4px; min-width:54px; min-height:40px; font-size:13px; }
.auth-caps-lock { color:#946e29; }
.auth-panel .button { border-radius:10px; }
.auth-links { display:flex; align-items:center; justify-content:space-between; margin-top:16px; }
.auth-links .text-button { padding:7px 0; }
.header-actions { display:flex; align-items:center; gap:12px; }
#app-shell { grid-template-rows:54px auto minmax(0,1fr); }
.app-header { padding:0 20px; }
.app-header h1 { font-size:15px; font-weight:600; }
.app-header .brand-mark { width:30px; height:30px; border-radius:9px; }
.app-navigation { background:var(--soft); }
.nav-button { border-radius:10px; }
body:is([data-route="account-profile"],[data-route="account-password"],[data-route="downloads"]) #account-button, body[data-route="devices"] #devices-button { color:var(--green); background:var(--green-light); }
.conversation-item.selected { background:var(--green-light); }
.conversation-item.selected .avatar { color:var(--green); background:#fff; }
.message-row.outgoing .message-bubble { background:#e1efe6; border-color:#e1efe6; }
body[data-authenticated="false"] .app-navigation { display:none; }
body[data-authenticated="false"] #app-shell { grid-template-columns:minmax(0,1fr); }
body[data-authenticated="false"] .secondary-page { grid-column:1; }
.account-menu { padding:4px 20px; }
.settings-row { display:flex; align-items:center; gap:13px; width:100%; padding:18px 0; color:var(--ink); background:none; border:0; text-align:left; }
.settings-row + .settings-row { border-top:1px solid var(--line); }
.settings-row:hover { color:var(--green); }
.settings-row > span:nth-child(2) { flex:1; min-width:0; }
.settings-row strong { display:block; font-size:14px; font-weight:550; }
.settings-row small { display:block; color:var(--muted); font-size:12px; margin-top:4px; }
.settings-row > span:last-child { color:var(--muted); font-size:23px; font-weight:300; }
.settings-row-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:11px; background:var(--soft); font-size:21px; color:var(--green); flex:none; }
.settings-row-icon svg { width:19px; height:19px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.danger-text strong { color:var(--danger); }
.narrow-content { max-width:620px; }
.account-profile-card .account-section-heading { margin-bottom:6px; }
.account-profile-card > .button { margin:8px 0 0 -9px; }
.app-center-content { max-width:1000px; }
.page-introduction { margin-bottom:24px; }
.page-introduction h2 { font-size:24px; font-weight:550; line-height:1.6; }
.page-introduction > p { max-width:620px; line-height:1.85; }
.connection-summary { border:1px solid #d8e8de; border-radius:11px; padding:15px 18px; color:#466a58; background:#edf5ef; line-height:1.75; margin-bottom:20px; }
.device-list { display:grid; gap:12px; margin-bottom:24px; }
.device-card { display:flex; align-items:center; gap:16px; border:1px solid var(--line); background:#fff; border-radius:13px; padding:22px; min-width:0; }
.device-mark { display:grid; place-items:center; background:var(--soft); color:var(--green); width:54px; height:54px; border-radius:16px; font-size:14px; font-weight:600; flex:none; }
.device-details { flex:1; min-width:0; overflow-wrap:anywhere; }
.device-details h3 { font-size:16px; margin-bottom:4px; }
.device-details p { margin-bottom:0; }
.empty-device { border:1px dashed #d5e1d9; padding:30px; border-radius:13px; text-align:center; color:var(--muted); background:#fafcfb; line-height:1.8; }
.setup-guide ol { list-style:none; counter-reset:setup; padding:0; margin:22px 0; }
.setup-guide li { counter-increment:setup; position:relative; padding:0 0 22px 42px; }
.setup-guide li::before { content:counter(setup); position:absolute; left:0; top:0; width:28px; height:28px; display:grid; place-items:center; border-radius:50%; color:var(--green); background:var(--green-light); font-size:12px; }
.setup-guide li strong { display:block; font-size:14px; font-weight:550; }
.setup-guide li span { display:block; font-size:12px; color:var(--muted); margin-top:5px; line-height:1.7; }
.setup-guide li:last-child { padding-bottom:0; }
.download-brand { display:flex; align-items:center; gap:17px; margin:4px 0 30px; }
.download-brand img { border-radius:19px; flex:none; }
.download-brand h2 { margin-bottom:5px; font-size:24px; }
.download-brand p { margin:0; font-size:13px; }
.download-platforms { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-bottom:24px; }
.download-card { background:#fff; border:1px solid var(--line); border-radius:13px; padding:24px; }
.download-sync-note { margin:-8px 0 18px; color:var(--muted); font-size:13px; line-height:1.9; }
.download-platform-nav { display:flex; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.download-platform-nav button { border:1px solid var(--line); background:#fff; color:var(--green); border-radius:8px; min-height:40px; padding:8px 12px; font:inherit; font-size:12px; cursor:pointer; }
.download-platform-nav button:hover { background:var(--green-light); }
.download-source { margin:0 0 22px; overflow-wrap:anywhere; }
.download-source a { color:var(--green); }
.download-card, #phone-install-guide { scroll-margin-top:18px; }
.download-help { margin-top:17px; padding-top:14px; border-top:1px solid var(--line); font-size:12px; line-height:1.8; }
.download-help summary { cursor:pointer; color:var(--green); min-height:32px; }
.download-help ol { padding-left:19px; margin:10px 0; }
.download-help li { padding-left:3px; margin:9px 0; color:var(--muted); }
.download-help .guide-reference { display:inline-block; padding:4px 0; font-size:11px; }
.platform-monogram { display:inline-block; font-size:11px; font-weight:600; color:var(--green); border:1px solid #d7e7dd; padding:5px 10px; border-radius:7px; margin-bottom:17px; }
.download-card h3 { font-size:17px; margin:0 0 6px; }
.download-card .button { margin-top:10px; width:100%; text-decoration:none; }
.release-meta { font-size:12px; color:var(--muted); margin:0; }
.release-checksum { margin-top:13px; font-size:10px; color:var(--muted); }
.release-checksum summary { cursor:pointer; }
.release-checksum code { display:block; margin-top:6px; overflow-wrap:anywhere; }
.release-checksum p { overflow-wrap:anywhere; line-height:1.7; }
.install-guide p { line-height:1.85; }
.release-notes ul { margin:0; padding-left:20px; }
.release-notes li { margin:9px 0; color:var(--muted); line-height:1.75; }
.release-notes p { margin:0; }
@media (max-width:700px) {
  .auth-intro { background:#fff; padding:52px 26px 8px; }
  .auth-intro .brand-lockup { margin:0; flex-direction:column; align-items:flex-start; gap:14px; font-size:24px; }
  .auth-intro .brand-mark { width:64px; height:64px; border-radius:20px; }
  .auth-intro h1 { display:none; }
  .auth-panel { padding:28px 26px 36px; max-width:none; }
  .auth-panel h2 { font-size:24px; margin:6px 0 9px; }
  .auth-panel .eyebrow { display:none; }
  .auth-security { font-size:11px; }
  .app-navigation { order:5; padding:5px 10px max(7px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); border-bottom:0; }
  .app-navigation .nav-button { min-height:47px; max-width:90px; font-size:10px; }
  .app-navigation .nav-button svg { width:20px; height:20px; }
  .app-header { min-height:55px; }
  .header-actions { gap:4px; }
  #header-download-button { font-size:11px; padding:5px; }
  body:is([data-route="account-profile"],[data-route="account-password"],[data-route="detail"]) .app-navigation { display:none; }
  body:is([data-route="account-profile"],[data-route="account-password"]) .app-header { display:none; }
  .account-menu { padding:2px 16px; }
  .settings-row { padding:17px 0; }
  .settings-row strong { font-size:15px; }
  .settings-row small { font-size:11px; }
  .app-center-content { padding:20px 16px 25px; }
  .page-introduction h2 { font-size:20px; }
  .page-introduction > p { font-size:12px; }
  .connection-summary { padding:12px 14px; font-size:12px; margin-bottom:16px; }
  .device-card { padding:16px; gap:11px; }
  .device-mark { width:42px; height:42px; font-size:12px; border-radius:12px; }
  .device-details h3 { font-size:14px; }
  .device-details .field-hint { font-size:10px; }
  .device-card .status-badge { font-size:10px; }
  .download-brand { gap:12px; margin-bottom:24px; }
  .download-brand img { width:54px; height:54px; border-radius:16px; }
  .download-brand h2 { font-size:20px; }
  .download-platforms { grid-template-columns:minmax(0,1fr); gap:12px; }
  .download-card { padding:20px; }
  .platform-monogram { margin-bottom:13px; }
  .auth-links .text-button { min-height:42px; }
}
.native-device-start { display:flex; align-items:center; gap:16px; flex-wrap:wrap; }
.native-device-start > div { flex:1; min-width:200px; }
.native-device-start h3 { margin-bottom:6px; }
.native-device-start p { margin-bottom:0; }
.native-device-start #native-device-status { width:100%; }
.device-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; max-width:260px; }
.device-actions .danger-text { color:var(--danger); }
.binding-device-hint { background:var(--green-light); color:var(--green); border-radius:9px; padding:11px 13px; font-size:12px; line-height:1.8; margin:12px 0; }
.binding-device-hint.offline { background:#fbefdc; color:#8a672f; }
.binding-device-hint .text-button { display:block; padding:4px 0 0; }
@media(max-width:700px) { .device-card { flex-wrap:wrap; } .device-actions { width:100%; max-width:none; padding-left:53px; justify-content:flex-start; } .native-device-start > .button { width:100%; } }

.release-signature-note { display:inline-block; margin:0 0 10px; padding:5px 9px; border-radius:6px; background:#fbefdc; color:#8a672f; font-size:11px; line-height:1.6; }

/* Shared connection progress and one account-level save surface. */
.binding-progress { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; padding:0; margin:18px 0; list-style:none; }
.binding-step { display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12px; line-height:1.5; }
.binding-step-number { display:grid; place-items:center; width:24px; height:24px; flex:0 0 24px; border-radius:50%; background:#eff3f0; color:#819389; font-size:11px; }
.binding-step.is-done,.binding-step.is-current { color:var(--green); }
.binding-step.is-done .binding-step-number { background:var(--green-light); color:var(--green); }
.binding-step.is-current .binding-step-number { background:var(--green); color:#fff; }
.connection-status-card { justify-content:space-between; }
.connection-status-card .device-details p { margin-bottom:0; }
.admin-save-bar { position:sticky; bottom:0; z-index:2; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; margin-top:18px; border:1px solid var(--line); border-radius:var(--radius); background:rgba(255,255,255,.97); box-shadow:0 -4px 18px #21342e08; }
.admin-save-summary { font-size:13px; color:var(--ink); overflow-wrap:anywhere; }
.admin-save-results { width:100%; display:flex; flex-wrap:wrap; gap:6px 14px; margin:0; padding:0; list-style:none; font-size:12px; }
.admin-save-result { color:var(--muted); }
.admin-save-result.is-saved { color:var(--green); }
.admin-save-result.is-failed { color:var(--danger); }
.admin-save-actions { display:flex; gap:8px; }
.ownership-entry { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:0 0 20px; padding:18px 20px; }
.ownership-entry[hidden] { display:none; }
.ownership-entry h3 { margin:0 0 6px; font-size:16px; }
.ownership-entry p { margin:0; line-height:1.7; }
.ownership-entry .button { flex-shrink:0; }
.ownership-dialog { width:min(920px,calc(100vw - 32px)); max-width:920px; max-height:calc(100dvh - 32px); padding:24px; }
.ownership-dialog .dialog-heading p { margin:8px 0 0; line-height:1.6; }
.ownership-toolbar { display:flex; align-items:center; gap:9px; margin:18px 0 12px; }
.ownership-search { flex:1; min-width:0; margin:0; }
.ownership-search input { width:100%; min-height:42px; margin:0; font-size:14px; }
.ownership-toolbar select { max-width:160px; min-height:42px; font-size:13px; margin:0; }
.ownership-cleanup-bar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:0 0 15px; border-bottom:1px solid var(--line); }
.ownership-cleanup-bar p { margin:0; line-height:1.6; }
.ownership-cleanup-bar .button { flex-shrink:0; }
.ownership-list { display:flex; flex-direction:column; }
.ownership-item { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:18px 0; border-bottom:1px solid var(--line); }
.ownership-item-main { min-width:0; }
.ownership-item-heading { display:flex; align-items:center; flex-wrap:wrap; gap:9px; }
.ownership-item-heading strong { font-size:15px; overflow-wrap:anywhere; }
.ownership-item p { margin:7px 0 0; overflow-wrap:anywhere; line-height:1.6; }
.ownership-owner { font-size:13px; color:var(--ink); }
.ownership-blocked { color:#966a3e; }
.ownership-conflicts { padding:1px 0 1px 10px; margin-top:9px; border-left:2px solid #d9b98b; color:#866b4e; }
.ownership-conflicts p { margin:4px 0; }
.ownership-state { font-size:10px; }
.ownership-item-actions { display:flex; flex-shrink:0; gap:7px; }
.ownership-item-actions .button { font-size:12px; }
.ownership-empty { padding:24px 0; margin:0; text-align:center; }
.ownership-pagination { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:14px; padding-top:18px; }
.ownership-note { margin:20px 0 0; padding-top:18px; border-top:1px solid var(--line); line-height:1.8; }
.ownership-confirm-description { line-height:1.85; overflow-wrap:anywhere; }
.ownership-confirm-dialog input, .ownership-confirm-dialog select { width:100%; }
@media (max-width:700px) {
  .ownership-entry { align-items:flex-start; flex-direction:column; gap:12px; padding:16px; }
  .ownership-entry .button { width:100%; min-height:44px; }
  #admin-page.show-account-detail .ownership-entry { display:none; }
  .ownership-dialog { width:calc(100vw - 20px); max-height:calc(100dvh - 20px); padding:18px 14px; }
  .ownership-toolbar { flex-wrap:wrap; gap:8px; }
  .ownership-search { flex-basis:100%; }
  .ownership-search input, .ownership-toolbar select, .ownership-confirm-dialog input, .ownership-confirm-dialog select { font-size:16px; min-height:44px; }
  .ownership-toolbar select { flex:1; max-width:none; }
  .ownership-cleanup-bar { align-items:flex-start; flex-direction:column; gap:10px; }
  .ownership-cleanup-bar .button { width:100%; }
  .ownership-item { align-items:stretch; flex-direction:column; gap:12px; padding:16px 0; }
  .ownership-item-actions .button { flex:1; min-height:44px; }
  .ownership-item-actions { width:100%; }
  .ownership-pagination { gap:10px; }
}
@media(max-width:700px) {
  .binding-progress { gap:5px; }
  .binding-step { gap:5px; font-size:11px; }
  .binding-step-number { width:22px; height:22px; flex-basis:22px; }
  .admin-save-bar { padding:12px; bottom:0; }
  .admin-save-actions { width:100%; }
  .admin-save-actions .button { flex:1; min-height:44px; }
  .connection-status-card .status-badge { margin-left:auto; }
}
