:root {
  --canvas: #f4f7f9;
  --panel: #ffffff;
  --line: #e5eaee;
  --ink: #142132;
  --muted: #7d8997;
  --muted-strong: #536272;
  --navy: #111c2b;
  --navy-soft: #1a2a3b;
  --accent: #43c7a5;
  --accent-deep: #18866c;
  --accent-pale: #e7f8f2;
  --danger: #c75858;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--canvas); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { display: flex; flex-direction: column; padding: 32px 20px 22px; color: #dbe4ec; background: var(--navy); }
.brand-lockup { display: flex; align-items: center; gap: 12px; padding: 0 11px 38px; }
.brand-mark { display: flex; align-items: flex-end; gap: 3px; width: 25px; height: 26px; }
.brand-mark span { display: block; width: 6px; border-radius: 5px 5px 1px 1px; background: var(--accent); }
.brand-mark span:nth-child(1) { height: 13px; opacity: .62; }
.brand-mark span:nth-child(2) { height: 21px; }
.brand-mark span:nth-child(3) { height: 17px; opacity: .78; }
.brand-name { margin: 0; color: #fff; font-size: 17px; font-weight: 730; letter-spacing: -.02em; }
.brand-caption { margin: 4px 0 0; color: #75879a; font-size: 9px; font-weight: 700; letter-spacing: .16em; }
.primary-nav { display: grid; gap: 7px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 13px; color: #8ea0b2; border: 1px solid transparent; border-radius: 10px; font-size: 13px; text-decoration: none; transition: .18s ease; }
.nav-button { width: 100%; text-align: left; background: transparent; }
.nav-item:hover { color: #fff; background: var(--navy-soft); }
.nav-item.active { color: #fff; background: #22374b; border-color: #2d465c; box-shadow: inset 3px 0 0 var(--accent); }
.nav-icon { width: 18px; color: #7e94a8; font-size: 17px; text-align: center; }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-count { min-width: 20px; margin-left: auto; padding: 2px 6px; color: #bdf3e3; background: #1d5248; border-radius: 20px; font-size: 10px; text-align: center; }
.sidebar-footer { margin-top: auto; }
.operator-card { display: flex; align-items: center; gap: 10px; padding: 15px 9px; border-top: 1px solid #2a3b4d; border-bottom: 1px solid #2a3b4d; }
.operator-name { margin: 0; color: #eef4f8; font-size: 12px; font-weight: 650; }
.operator-status { display: flex; align-items: center; gap: 5px; margin: 5px 0 0; color: #8da2b4; font-size: 10px; }
.more-button { margin-left: auto; color: #74889c; letter-spacing: 2px; }
.build-label { margin: 19px 10px 0; color: #586c80; font-size: 9px; letter-spacing: .1em; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(67, 199, 165, .12); }
.status-dot.offline { background: #d27777; box-shadow: 0 0 0 3px rgba(210, 119, 119, .12); }

.main-content { width: 100%; max-width: 1500px; margin: 0 auto; padding: 37px 44px 22px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-deep); font-size: 10px; font-weight: 750; letter-spacing: .15em; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.045em; line-height: 1.06; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.connection-pill { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 12px; color: var(--muted-strong); background: #fff; border: 1px solid var(--line); border-radius: 20px; font-size: 11px; }
.icon-button { width: 35px; height: 35px; color: var(--muted-strong); background: transparent; border: 1px solid var(--line); border-radius: 9px; font-size: 20px; line-height: 1; transition: .18s ease; }
.icon-button:hover { color: var(--accent-deep); border-color: #acdace; background: #fff; }
.icon-button.spinning { animation: spin .7s linear infinite; }
.logout-button { min-height: 35px; padding: 0 11px; color: var(--muted-strong); background: transparent; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; }
.logout-button:hover { color: var(--danger); border-color: #e9caca; background: #fff; }
.entry-button { min-height: 44px; padding: 0 12px; color: #fff; background: var(--accent-deep); border: 0; border-radius: 9px; font-size: 11px; font-weight: 700; }
.entry-button:hover { background: #116e59; transform: translateY(-1px); }
.entry-button:disabled { cursor: wait; opacity: .58; }
.entry-button span { padding-left: 5px; font-size: 15px; vertical-align: -1px; }
@keyframes spin { to { transform: rotate(360deg); } }

.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 32px; }
.metric-card { min-height: 112px; padding: 19px 21px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.metric-card.metric-accent { background: #f0fbf7; border-color: #d0eee4; }
.metric-label, .metric-detail { display: block; font-size: 11px; }
.metric-label { color: var(--muted-strong); font-weight: 650; }
.metric-detail { margin-top: 4px; color: var(--muted); font-size: 10px; }
.metric-value { display: block; margin-top: 11px; font-size: 26px; letter-spacing: -.04em; line-height: 1; }
.metric-state { color: var(--accent-deep); font-size: 20px; }
.metric-state.is-offline { color: var(--danger); }

.workspace { display: grid; grid-template-columns: minmax(280px, 35%) minmax(0, 1fr); min-height: 510px; margin-top: 22px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 32px rgba(23, 44, 63, .045); }
.conversation-column { min-width: 0; border-right: 1px solid var(--line); }
.column-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 23px 21px 18px; border-bottom: 1px solid var(--line); }
.column-heading h2 { margin-bottom: 6px; font-size: 15px; letter-spacing: -.02em; }
.column-heading p { margin: 0; color: var(--muted); font-size: 10px; }
.filter-button { padding: 5px 0; color: var(--muted-strong); background: transparent; border: 0; font-size: 11px; }
.filter-button span { padding-left: 5px; color: var(--accent-deep); }
.conversation-list { min-height: 420px; }
.conversation-item { display: flex; width: 100%; gap: 12px; padding: 16px 20px; text-align: left; background: #fff; border: 0; border-bottom: 1px solid #eff2f4; transition: background .18s ease; }
.conversation-item:hover { background: #f8fbfc; }
.conversation-item.active { background: #effaf7; box-shadow: inset 3px 0 0 var(--accent); }
.avatar { display: grid; flex: 0 0 auto; place-items: center; width: 35px; height: 35px; border-radius: 11px; color: #fff; background: #7692ac; font-size: 10px; font-weight: 760; letter-spacing: .03em; }
.avatar-agent { width: 29px; height: 29px; color: #b9f1e1; background: #285446; border-radius: 9px; font-size: 9px; }
.avatar-user { width: 39px; height: 39px; color: #d6faf0; background: #2e6e60; }
.avatar-tone-1 { background: #6b82ae; }
.avatar-tone-2 { background: #9a7869; }
.avatar-tone-3 { background: #6d8290; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-topline, .conversation-bottomline { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.conversation-topline strong { overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 680; text-overflow: ellipsis; white-space: nowrap; }
.conversation-topline time { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.conversation-bottomline { margin-top: 8px; }
.conversation-bottomline span { overflow: hidden; color: var(--muted-strong); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-bottomline em { flex: 0 0 auto; min-width: 18px; padding: 2px 5px; color: #fff; background: var(--accent-deep); border-radius: 10px; font-size: 9px; font-style: normal; text-align: center; }
.empty-list { display: grid; justify-items: center; gap: 7px; padding: 86px 20px; color: var(--muted); text-align: center; }
.empty-list strong { color: var(--ink); font-size: 12px; }
.empty-list span { font-size: 10px; }
.empty-list-icon { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 4px; color: var(--accent-deep); background: var(--accent-pale); border-radius: 13px; font-size: 25px; }

.chat-column { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: #fbfcfd; }
.chat-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 81px; padding: 18px 25px; background: #fff; border-bottom: 1px solid var(--line); }
.chat-user-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chat-header h2 { overflow: hidden; max-width: 430px; margin-bottom: 6px; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.chat-header p { margin: 0; color: var(--muted); font-size: 10px; }
.chat-header-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 7px; }
.live-label { display: flex; align-items: center; gap: 6px; color: var(--accent-deep); font-size: 10px; font-weight: 700; }
.user-id { max-width: 210px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.message-stream { min-height: 280px; max-height: 480px; overflow-y: auto; padding: 27px 28px; }
.message-row { display: flex; margin-bottom: 18px; }
.message-row.inbound { justify-content: flex-start; }
.message-row.outbound { justify-content: flex-end; }
.message-bubble { max-width: min(72%, 480px); padding: 12px 14px 9px; border: 1px solid var(--line); border-radius: 13px 13px 13px 3px; background: #fff; box-shadow: 0 3px 12px rgba(23, 44, 63, .03); }
.message-row.outbound .message-bubble { border-color: #cceee4; border-radius: 13px 13px 3px 13px; background: #eaf9f5; }
.message-bubble.has-media { width: min(72%, 420px); padding: 7px; }
.message-bubble.has-media p { padding: 7px 7px 2px; }
.message-bubble.has-media time { padding: 0 7px 2px; }
.message-media-link { display: block; overflow: hidden; border-radius: 9px; background: #e9eef0; }
.message-image { display: block; width: 100%; max-height: 360px; object-fit: contain; }
.message-video { display: block; width: 100%; max-height: 360px; border-radius: 9px; background: #0d151f; }
.message-bubble p { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
.automation-label { display: inline-block; margin-bottom: 6px; padding: 2px 6px; color: var(--accent-deep); background: #dff4ed; border-radius: 999px; font-size: 8px; font-weight: 750; }
.delivery-status { display: block; margin-top: 6px; font-size: 9px; text-align: right; }
.delivery-status.accepted { color: var(--accent-deep); }
.delivery-status.failed { color: #b04f4f; }
.delivery-status.unknown { color: #9b731f; }
.message-bubble time { display: block; margin-top: 6px; color: var(--muted); font-size: 9px; text-align: right; }
.empty-chat { display: grid; justify-items: center; align-content: center; height: 100%; min-height: 300px; text-align: center; }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 13px; color: var(--accent-deep); background: var(--accent-pale); border-radius: 15px; font-size: 22px; }
.empty-chat h3 { margin-bottom: 6px; font-size: 14px; }
.empty-chat p { margin: 0; color: var(--muted); font-size: 11px; }
.composer { padding: 13px 20px 16px; background: #fff; border-top: 1px solid var(--line); }
.quick-reply-strip { display: flex; gap: 7px; margin-bottom: 10px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.quick-reply-strip[hidden] { display: none; }
.quick-reply-chip { flex: 0 0 auto; max-width: 180px; min-height: 30px; padding: 0 10px; overflow: hidden; color: var(--accent-deep); background: #f1faf7; border: 1px solid #cce9e0; border-radius: 999px; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.quick-reply-chip:hover:not(:disabled) { background: #e2f4ee; border-color: #9ed5c4; }
.quick-reply-chip:disabled { cursor: not-allowed; opacity: .45; }
.attachment-preview { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px; background: #f2f8f6; border: 1px solid #d6ebe4; border-radius: 9px; }
.attachment-preview[hidden] { display: none; }
.attachment-thumb { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 43px; overflow: hidden; background: #dce9e6; border-radius: 7px; }
.attachment-thumb img, .attachment-thumb video { width: 100%; height: 100%; object-fit: cover; }
.attachment-copy { min-width: 0; flex: 1; }
.attachment-copy strong, .attachment-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-copy strong { color: var(--ink); font-size: 11px; }
.attachment-copy span { margin-top: 5px; color: var(--muted); font-size: 9px; }
.attachment-remove { width: 27px; height: 27px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 19px; line-height: 1; }
.attachment-remove:hover { color: var(--danger); background: #fff; }
.composer textarea { display: block; width: 100%; min-height: 45px; resize: vertical; padding: 10px 12px; color: var(--ink); background: #f8fafb; border: 1px solid #e1e8ec; border-radius: 9px; outline: none; font-size: 12px; line-height: 1.5; transition: .18s ease; }
.composer textarea:focus { border-color: #7dd9c2; box-shadow: 0 0 0 3px rgba(67, 199, 165, .13); }
.composer textarea:disabled { cursor: not-allowed; opacity: .58; }
.composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.composer-tools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.attach-button { min-height: 30px; padding: 0 9px; color: var(--accent-deep); background: #eff9f6; border: 1px solid #cce9e0; border-radius: 7px; font-size: 10px; font-weight: 700; }
.attach-button:hover:not(:disabled) { background: #e2f4ee; border-color: #a9dccc; }
.attach-button:disabled { cursor: not-allowed; opacity: .45; }
.attach-button span { padding-right: 3px; font-size: 13px; }
.composer-hint { color: var(--muted); font-size: 10px; }
.send-button { min-height: 34px; padding: 0 14px; color: #fff; background: var(--accent-deep); border: 0; border-radius: 8px; font-size: 11px; font-weight: 700; transition: .18s ease; }
.send-button span { padding-left: 8px; font-size: 14px; }
.send-button:hover:not(:disabled) { background: #116e59; transform: translateY(-1px); }
.send-button:active:not(:disabled) { transform: scale(.98); }
.send-button:disabled { cursor: not-allowed; opacity: .42; }
.page-footer { display: flex; justify-content: space-between; gap: 15px; padding: 16px 3px 0; color: #8996a1; font-size: 10px; }
.toast { position: fixed; right: 26px; bottom: 25px; z-index: 5; max-width: 360px; padding: 11px 14px; color: #fff; background: var(--navy); border-radius: 8px; box-shadow: 0 10px 28px rgba(16, 29, 43, .22); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8d4444; }
.toast.success { background: #1c7b64; }
.entry-modal { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; }
.entry-modal[hidden] { display: none; }
.entry-modal-backdrop { position: absolute; inset: 0; background: rgba(17, 28, 43, .58); backdrop-filter: blur(5px); }
.entry-modal-card { position: relative; width: min(100%, 920px); max-height: calc(100dvh - 40px); padding: 28px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 25px 70px rgba(8, 20, 32, .25); }
.entry-close { position: absolute; top: 13px; right: 15px; width: 44px; height: 44px; color: var(--muted); background: transparent; border: 0; border-radius: 50%; font-size: 22px; line-height: 1; }
.entry-close:hover { color: var(--ink); background: #f2f6f7; }
.entry-modal-card h2 { margin: 0 0 8px; font-size: 20px; letter-spacing: -.04em; }
.entry-manager-heading { padding-right: 48px; text-align: left; }
.entry-manager-heading p:last-child { max-width: 560px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.entry-create-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-top: 22px; padding: 16px; background: #f5f9fa; border: 1px solid var(--line); border-radius: 12px; }
.entry-create-form label { display: block; margin-bottom: 6px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.entry-create-form input { width: 100%; min-height: 44px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #d5e0e4; border-radius: 8px; outline: none; font-size: 13px; }
.entry-create-form input:focus { border-color: #4fc7a8; box-shadow: 0 0 0 3px rgba(79, 199, 168, .15); }
.entry-create-form button, .entry-action { min-height: 44px; padding: 0 14px; border-radius: 8px; font-size: 11px; font-weight: 750; transition: background-color .18s ease, border-color .18s ease, opacity .18s ease; }
.entry-create-form button { color: #fff; background: var(--accent-deep); border: 0; }
.entry-create-form button:hover { background: #116e59; }
.entry-create-form button:disabled { cursor: wait; opacity: .5; }
.entry-action:disabled { cursor: not-allowed; opacity: .45; }
.entry-form-error { min-height: 18px; margin: 7px 2px 0; color: var(--danger); font-size: 10px; }
.entry-list-heading { display: flex; align-items: center; justify-content: space-between; margin: 17px 2px 8px; color: var(--muted-strong); font-size: 11px; }
.entry-list-heading span { min-width: 28px; padding: 2px 7px; text-align: center; background: #eef4f5; border-radius: 999px; }
.entry-list { display: grid; gap: 16px; }
.entry-list-empty { padding: 26px 16px; color: var(--muted); text-align: center; border: 1px dashed #cddadd; border-radius: 10px; font-size: 11px; }
.entry-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(18, 39, 55, .05); }
.entry-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 15px 16px; }
.entry-card-header > div { min-width: 0; }
.entry-card-content { display: grid; grid-template-columns: 204px minmax(0, 1fr); gap: 20px; align-items: center; padding: 18px; background: #f7fafb; border-top: 1px solid #e5edef; border-bottom: 1px solid #e5edef; }
.entry-card-qr-wrap { display: grid; place-items: center; width: 204px; min-height: 204px; padding: 12px; background: #fff; border: 1px solid #e0e8eb; border-radius: 10px; }
.entry-card-qr { display: block; width: 180px; height: 180px; image-rendering: pixelated; }
.entry-card-qr-missing { display: grid; place-items: center; width: 180px; height: 180px; color: var(--muted); text-align: center; background: repeating-linear-gradient(135deg, #f7fafb, #f7fafb 10px, #eef3f5 10px, #eef3f5 20px); border-radius: 8px; font-size: 11px; line-height: 1.6; }
.entry-card-details { min-width: 0; }
.entry-row-title { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 12px; font-weight: 750; }
.entry-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; font-weight: 650; }
.entry-status::before { width: 6px; height: 6px; content: ""; background: #a0aab1; border-radius: 50%; }
.entry-status.active::before { background: #159475; box-shadow: 0 0 0 3px rgba(21, 148, 117, .1); }
.entry-row-meta { margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 9px; overflow-wrap: anywhere; }
.entry-row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 16px; }
.entry-card-primary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.entry-action { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 14px; color: var(--muted-strong); background: #fff; border: 1px solid #d8e2e5; border-radius: 8px; cursor: pointer; font-size: 11px; font-weight: 750; }
.entry-action:hover:not(:disabled) { color: var(--ink); background: #f4f8f9; border-color: #bdcccf; }
.entry-action.primary { color: #fff; background: var(--accent-deep); border-color: var(--accent-deep); }
.entry-action.primary:hover:not(:disabled) { color: #fff; background: #116e59; border-color: #116e59; }
.entry-action.danger { color: #a74444; border-color: #ebcaca; }
.entry-action.danger:hover { background: #fff4f4; border-color: #dca9a9; }
.entry-url-label { display: block; margin-bottom: 6px; color: var(--muted-strong); font-size: 10px; font-weight: 650; text-align: left; }
.entry-card-url { width: 100%; min-height: 44px; padding: 0 11px; color: var(--muted-strong); background: #fff; border: 1px solid #d5e0e4; border-radius: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.entry-card-url:focus { border-color: #4fc7a8; outline: none; box-shadow: 0 0 0 3px rgba(79, 199, 168, .13); }
.entry-card-hint { margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.entry-note { margin-top: 6px; color: var(--muted-strong); font-size: 10px; line-height: 1.45; }
.entry-presentation-panel { margin-top: 18px; padding: 18px; background: #f7fafb; border: 1px solid #d9e4e7; border-radius: 12px; }
.entry-presentation-panel[hidden] { display: none; }
.entry-presentation-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.entry-presentation-heading h3 { margin: 0; font-size: 16px; }
.entry-presentation-heading > button { color: var(--muted-strong); background: transparent; border: 0; font-size: 11px; }
.entry-presentation-form { display: grid; grid-template-columns: minmax(0, 1fr) 208px; gap: 22px; margin-top: 17px; }
.entry-presentation-fields > label, .welcome-form > label:not(.switch-row) { display: block; margin-bottom: 7px; color: var(--muted-strong); font-size: 11px; font-weight: 700; }
.entry-presentation-fields textarea, .welcome-form textarea, .quick-reply-form input, .quick-reply-form textarea { width: 100%; padding: 10px 11px; color: var(--ink); background: #fff; border: 1px solid #d5e0e4; border-radius: 8px; outline: none; font-size: 12px; line-height: 1.5; resize: vertical; }
.entry-presentation-fields textarea:focus, .welcome-form textarea:focus, .quick-reply-form input:focus, .quick-reply-form textarea:focus { border-color: #4fc7a8; box-shadow: 0 0 0 3px rgba(79, 199, 168, .13); }
.qr-color-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.qr-color-fields label { display: grid; grid-template-columns: 1fr 40px; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; color: var(--muted-strong); background: #fff; border: 1px solid #d5e0e4; border-radius: 8px; font-size: 10px; font-weight: 650; }
.qr-color-fields input[type="color"] { width: 38px; height: 30px; padding: 2px; background: #fff; border: 0; border-radius: 5px; }
.qr-color-fields input[type="number"] { width: 40px; min-height: 30px; padding: 0 4px; color: var(--ink); border: 1px solid #dce5e9; border-radius: 5px; }
.field-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.qr-preview-card { display: grid; align-content: start; justify-items: center; gap: 9px; padding: 12px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 9px; }
.qr-preview-card img { width: 180px; height: 180px; image-rendering: pixelated; }
.primary-form-button, .secondary-form-button { min-height: 39px; padding: 0 14px; border-radius: 8px; font-size: 11px; font-weight: 750; }
.primary-form-button { color: #fff; background: var(--accent-deep); border: 0; }
.primary-form-button:hover:not(:disabled) { background: #116e59; }
.secondary-form-button { color: var(--muted-strong); background: #fff; border: 1px solid #d5e0e4; }
.primary-form-button:disabled, .secondary-form-button:disabled { cursor: wait; opacity: .5; }
.operations-modal-card { width: min(100%, 820px); }
.operations-section { margin-top: 20px; padding: 18px; background: #f8fafb; border: 1px solid var(--line); border-radius: 12px; }
.operations-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.operations-section-heading h3 { margin: 0 0 5px; font-size: 15px; }
.operations-section-heading p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.operations-section-heading > span { min-width: 28px; padding: 2px 7px; color: var(--muted-strong); text-align: center; background: #eaf2f3; border-radius: 999px; font-size: 10px; }
.welcome-form, .quick-reply-form { display: grid; gap: 9px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 12px; background: #fff; border: 1px solid #dbe5e8; border-radius: 9px; }
.switch-row span, .switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: var(--ink); font-size: 11px; }
.switch-row small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.switch-row input { width: 38px; height: 20px; accent-color: var(--accent-deep); }
.form-action-row { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
.form-action-row .entry-form-error { margin-right: auto; }
.quick-reply-list { display: grid; gap: 8px; margin-top: 14px; }
.quick-reply-empty { padding: 22px; color: var(--muted); text-align: center; border: 1px dashed #cddadd; border-radius: 9px; font-size: 10px; }
.quick-reply-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.quick-reply-row.disabled { opacity: .6; }
.quick-reply-row strong { display: block; color: var(--ink); font-size: 11px; }
.quick-reply-row p { margin: 5px 0 0; color: var(--muted-strong); font-size: 10px; line-height: 1.5; white-space: pre-wrap; }
.quick-reply-actions { display: flex; align-items: flex-start; gap: 5px; }
.quick-reply-actions button { min-height: 31px; padding: 0 8px; color: var(--muted-strong); background: #fff; border: 1px solid #d9e3e6; border-radius: 6px; font-size: 9px; }
.quick-reply-actions button:hover { color: var(--ink); background: #f4f8f9; }
.quick-reply-actions button.danger { color: var(--danger); border-color: #ebcaca; }
.auth-locked { overflow: hidden; }
.auth-gate { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 24px; background: rgba(17, 28, 43, .76); backdrop-filter: blur(10px); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(100%, 390px); padding: 31px; background: #fff; border: 1px solid #dce6ea; border-radius: 16px; box-shadow: 0 24px 80px rgba(8, 20, 32, .28); }
.auth-mark { display: grid; place-items: center; width: 39px; height: 39px; margin-bottom: 22px; color: #bdf3e3; background: var(--navy); border-radius: 12px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.auth-card h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.04em; }
.auth-card > p:not(.eyebrow) { margin-bottom: 24px; color: var(--muted-strong); font-size: 11px; line-height: 1.6; }
.auth-card label { display: block; margin-bottom: 7px; color: var(--muted-strong); font-size: 11px; font-weight: 650; }
.auth-card input { display: block; width: 100%; height: 39px; padding: 0 11px; color: var(--ink); border: 1px solid #dce5e9; border-radius: 8px; outline: none; font-size: 12px; }
.auth-card input:focus { border-color: #7dd9c2; box-shadow: 0 0 0 3px rgba(67, 199, 165, .13); }
.auth-card button { width: 100%; height: 39px; margin-top: 14px; color: #fff; background: var(--accent-deep); border: 0; border-radius: 8px; font-size: 11px; font-weight: 700; }
.auth-card button:hover { background: #116e59; }
.auth-card button:disabled { cursor: wait; opacity: .58; }
.auth-card button span { padding-left: 7px; font-size: 14px; }
.auth-card small { display: block; min-height: 16px; margin-top: 9px; color: var(--danger); font-size: 10px; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding: 25px 11px 16px; }
  .brand-lockup { justify-content: center; padding: 0 0 35px; }
  .brand-lockup > div:last-child, .nav-item:not(.active) { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item .nav-count { display: none; }
  .operator-card { justify-content: center; padding: 13px 0; }
  .operator-card > div:not(.avatar), .more-button, .build-label { display: none; }
  .main-content { padding: 28px 24px 20px; }
  .workspace { grid-template-columns: minmax(240px, 40%) minmax(0, 1fr); }
}

@media (max-width: 680px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 24px 14px 16px; }
  .topbar { align-items: flex-start; }
  .connection-pill { display: none; }
  .entry-button { padding: 0 9px; font-size: 10px; }
  .entry-modal { padding: 10px; }
  .entry-modal-card { max-height: calc(100dvh - 20px); padding: 22px 16px; }
  .entry-create-form input { font-size: 16px; }
  .entry-create-form, .entry-card-content { grid-template-columns: 1fr; }
  .entry-presentation-form, .quick-reply-row { grid-template-columns: 1fr; }
  .qr-color-fields { grid-template-columns: 1fr; }
  .quick-reply-actions { flex-wrap: wrap; }
  .entry-create-form button { width: 100%; }
  .entry-row-actions { justify-content: flex-start; }
  .entry-card-header { align-items: stretch; flex-direction: column; }
  .entry-card-header > .entry-action { width: 100%; }
  .entry-card-qr-wrap { width: 100%; }
  .entry-card-primary-actions .entry-action { flex: 1 1 130px; }
  .metrics { gap: 8px; margin-top: 23px; }
  .metric-card { min-height: 89px; padding: 13px 11px; }
  .metric-value { margin-top: 9px; font-size: 21px; }
  .metric-state { font-size: 16px; }
  .metric-detail { font-size: 9px; }
  .workspace { display: block; margin-top: 14px; }
  .conversation-column { border-right: 0; }
  .conversation-list { max-height: 250px; overflow-y: auto; }
  .chat-column { min-height: 540px; border-top: 1px solid var(--line); }
  .message-stream { max-height: none; }
  .chat-header { padding: 17px 16px; }
  .chat-header-meta { display: none; }
  .message-stream { padding: 22px 16px; }
  .message-bubble { max-width: 86%; }
  .message-bubble.has-media { width: 86%; }
  .composer { padding: 12px 14px 14px; }
  .composer-tools { gap: 6px; }
  .composer-hint { display: none; }
  .page-footer { display: block; line-height: 1.8; }
  .page-footer span { display: block; }
}
