:root {
  --ink: #17212b;
  --muted: #6d7a87;
  --line: #dde5eb;
  --soft-line: #edf1f4;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --nav: #132331;
  --nav-2: #1b3041;
  --blue: #2788d8;
  --blue-dark: #1971b8;
  --blue-soft: #e9f4fc;
  --green: #2b9b69;
  --green-soft: #e9f7f0;
  --amber: #d68a19;
  --amber-soft: #fff5df;
  --red: #d74d52;
  --red-soft: #fff0f1;
  --violet: #7669dc;
  --shadow: 0 10px 35px rgba(24, 47, 66, .09);
  --radius: 14px;
  --sidebar: 248px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; color: var(--ink); background: var(--canvas); overflow-x: hidden; }
body { font-size: 14px; line-height: 1.55; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.brand-mark { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: white; font-size: 25px; font-weight: 750; background: linear-gradient(145deg, #3da0e8, #1976bd); box-shadow: 0 12px 28px rgba(39,136,216,.28); }
.boot-copy { animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 45%) 1fr; background: #fff; }
.login-panel { display: grid; place-content: center; padding: 56px clamp(32px, 5vw, 72px); position: relative; z-index: 2; }
.login-card { width: min(400px, 100%); }
.login-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 56px; font-size: 16px; font-weight: 720; letter-spacing: .02em; }
.login-brand .brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 20px; }
.login-card h1 { font-size: 30px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.03em; }
.login-card > p { color: var(--muted); margin: 0 0 32px; }
.login-art { position: relative; overflow: hidden; display: grid; place-items: center; padding: 64px; color: #fff; background: radial-gradient(circle at 68% 22%, rgba(77,178,244,.36), transparent 27%), linear-gradient(145deg, #122433, #1a425d 58%, #176c9f); }
.login-art::before, .login-art::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-art::before { width: 600px; height: 600px; right: -230px; top: -280px; }
.login-art::after { width: 440px; height: 440px; left: -160px; bottom: -250px; }
.art-content { width: min(520px, 100%); position: relative; }
.art-kicker { color: #80c8f8; text-transform: uppercase; letter-spacing: .16em; font-weight: 750; font-size: 12px; }
.art-content h2 { font-size: clamp(32px, 4vw, 56px); line-height: 1.08; margin: 18px 0 22px; letter-spacing: -.045em; }
.art-content p { color: rgba(255,255,255,.7); font-size: 16px; max-width: 440px; }
.art-flow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.art-step { border: 1px solid rgba(255,255,255,.17); background: rgba(255,255,255,.08); border-radius: 999px; padding: 9px 14px; backdrop-filter: blur(8px); }

.field { display: grid; gap: 7px; margin-bottom: 18px; }
.field label, .field-label { font-size: 13px; font-weight: 680; color: #334250; }
.field-help { color: var(--muted); font-size: 12px; margin-top: -2px; }
.field-error { color: var(--red); font-size: 12px; min-height: 0; }
.input, .textarea, .select { width: 100%; color: var(--ink); border: 1px solid #cfd9e1; border-radius: 10px; background: #fff; outline: none; padding: 11px 12px; transition: border-color .18s, box-shadow .18s; }
.input:hover, .textarea:hover, .select:hover { border-color: #aebdca; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39,136,216,.12); }
.textarea { min-height: 116px; resize: vertical; }
.input[disabled], .select[disabled], .textarea[disabled] { background: #f2f5f7; color: #91a0ad; cursor: not-allowed; }
.input-group { display: flex; gap: 9px; }
.input-group > :first-child { flex: 1; }

.button { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 670; color: #31414f; background: #fff; border-color: #ccd7df; transition: .18s ease; text-decoration: none; }
.button:hover { background: #f7f9fa; transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 5px 13px rgba(39,136,216,.18); }
.button.primary:hover { background: var(--blue-dark); }
.button.danger { color: #fff; background: var(--red); border-color: var(--red); }
.button.danger-ghost { color: var(--red); border-color: #efc6c8; background: #fff; }
.button.ghost { border-color: transparent; background: transparent; }
.button.soft { color: var(--blue-dark); background: var(--blue-soft); border-color: transparent; }
.button.small { min-height: 32px; padding: 6px 10px; font-size: 12px; border-radius: 8px; }
.button.icon-only { width: 38px; padding: 0; }
.button:disabled { opacity: .52; cursor: not-allowed; transform: none; box-shadow: none; }
.button.full { width: 100%; }
.button-row { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.button-row.end { justify-content: flex-end; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30; color: #c9d5de; background: linear-gradient(180deg, var(--nav), #10202c); display: flex; flex-direction: column; box-shadow: 5px 0 20px rgba(21,42,58,.08); }
.sidebar-brand { height: 72px; padding: 0 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid rgba(255,255,255,.07); color: white; font-weight: 720; }
.sidebar-brand .brand-mark { width: 35px; height: 35px; border-radius: 11px; font-size: 17px; }
.sidebar-brand span:last-child { white-space: nowrap; }
.nav-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 13px 10px; display: flex; flex-direction: column; }
.nav-main { display: grid; gap: 3px; }
.nav-link { width: 100%; border: 0; color: #b9c8d2; background: transparent; border-radius: 9px; padding: 9px 11px; display: flex; align-items: center; gap: 11px; text-align: left; font-weight: 560; position: relative; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.06); }
.nav-link.active { color: #fff; background: rgba(53,151,220,.19); }
.nav-link.active::before { content: ""; position: absolute; left: -10px; width: 3px; height: 21px; border-radius: 0 4px 4px 0; background: #4da7e8; }
.nav-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 18px; }
.icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 18px; }
.nav-icon svg, .icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; border-radius: 999px; display: grid; place-items: center; padding: 0 6px; font-size: 11px; color: #fff; background: var(--red); }
.platform-dock { flex: 0 0 auto; padding: 8px 10px; border-top: 1px solid rgba(255,255,255,.08); background: rgba(8,24,35,.24); }
.platform-toggle { width: 100%; min-height: 36px; padding: 7px 10px; border: 0; border-radius: 9px; color: #d7e3eb; background: rgba(255,255,255,.055); display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
.platform-toggle > span { display: flex; align-items: center; gap: 9px; }
.platform-toggle > .icon { width: 15px; height: 15px; transition: transform .18s ease; }
.platform-dock.expanded .platform-toggle > .icon { transform: rotate(90deg); }
.platform-nav { display: none; gap: 3px; max-height: 225px; overflow-y: auto; padding-top: 6px; }
.platform-dock.expanded .platform-nav { display: grid; }
.nav-section-title { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #708696; padding: 0 11px 8px; font-weight: 750; }
.sidebar-user { padding: 13px 16px; display: flex; align-items: center; gap: 10px; border-top: 1px solid rgba(255,255,255,.07); }
.avatar { width: 38px; height: 38px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #5ba9df, #287ab3); font-weight: 750; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.small { width: 34px; height: 34px; }
.avatar.large { width: 52px; height: 52px; font-size: 18px; }
.user-meta { min-width: 0; flex: 1; }
.user-meta strong, .user-meta span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-meta strong { color: #fff; font-size: 12px; }
.user-meta span { color: #758b9b; font-size: 11px; }
.user-meta .role-label { display: block; width: fit-content; margin-top: 3px; padding: 1px 6px; border-radius: 999px; color: #b9dff7; background: rgba(57,152,219,.16); font-size: 10px; font-style: normal; white-space: nowrap; }

.main { grid-column: 2; min-width: 0; }
.topbar { height: 72px; padding: 0 28px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.92); backdrop-filter: blur(14px); }
.topbar-left { min-width: 0; display: flex; align-items: center; gap: 12px; }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.breadcrumb { color: var(--muted); font-size: 12px; }
.mobile-menu { display: none; }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.attention-button { position: relative; }
.attention-button .nav-badge { margin-left: 3px; }
.main-content { padding: 26px 28px 44px; max-width: 1600px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-title h2 { margin: 0 0 5px; font-size: 24px; letter-spacing: -.035em; }
.page-title p { margin: 0; color: var(--muted); max-width: 700px; }

.metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.metric { min-height: 104px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 17px; min-width: 0; box-shadow: 0 2px 8px rgba(25,52,72,.025); transition: .18s; display: flex; flex-direction: column; }
button.metric { cursor: pointer; }
button.metric:hover { border-color: #b8d7ed; box-shadow: 0 8px 22px rgba(32,98,143,.08); transform: translateY(-2px); }
.metric-label { min-height: 19px; display: flex; align-items: flex-start; justify-content: space-between; gap: 5px; color: var(--muted); font-size: 12px; }
.metric-value { font-size: 29px; font-weight: 750; line-height: 1; margin-top: auto; padding-top: 14px; letter-spacing: -.045em; }
.metric-hint { color: #9aa6b0; font-size: 11px; margin-top: 8px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 8px rgba(25,52,72,.025); }
.card-head { min-height: 58px; padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--soft-line); }
.card-head h3 { margin: 0; font-size: 15px; }
.card-head p { color: var(--muted); margin: 3px 0 0; font-size: 12px; }
.card-body { padding: 18px; }
.card + .card { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.grid-2 > .card,
.grid-3 > .card { margin-top: 0; }

.checklist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.check-step { padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: #fbfcfd; display: flex; flex-direction: column; min-height: 176px; }
.check-step.done { border-color: #c8e9da; background: #f6fcf9; }
.check-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.step-num { color: var(--blue-dark); font-weight: 750; font-size: 12px; }
.check-dot { width: 25px; height: 25px; border-radius: 50%; display: grid; place-items: center; color: #8795a1; background: #e9eef2; }
.check-step.done .check-dot { color: #fff; background: var(--green); }
.check-step h4 { margin: 0 0 7px; font-size: 14px; }
.check-step p { color: var(--muted); margin: 0 0 15px; font-size: 12px; flex: 1; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box { position: relative; min-width: min(280px, 100%); }
.search-box .input { padding-left: 36px; }
.search-box .icon { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; color: #8a99a5; transform: translateY(-50%); }
.filter-chip, .tag { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 9px; font-size: 11px; color: #536473; background: #eef3f6; border: 0; }
.filter-chip.active { color: #156ba9; background: var(--blue-soft); box-shadow: inset 0 0 0 1px #c5e3f7; }
.tag.blue { color: #176fae; background: var(--blue-soft); }
.tag.green { color: #247d57; background: var(--green-soft); }
.tag.amber { color: #996314; background: var(--amber-soft); }
.tag.red { color: #ac383e; background: var(--red-soft); }
.tag.violet { color: #5d50bf; background: #f0efff; }

.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 780px; }
.table th { height: 43px; padding: 0 14px; text-align: left; color: #71808d; background: #f8fafb; border-bottom: 1px solid var(--line); font-size: 11px; font-weight: 700; white-space: nowrap; }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--soft-line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfdfe; }
.cell-title { font-weight: 680; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 12px; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #8796a3; }
.status.good::before { background: var(--green); }
.status.warn::before { background: var(--amber); }
.status.bad::before { background: var(--red); }
.status.danger::before { background: var(--red); }
.status.info::before { background: var(--blue); }
.status.muted::before { background: #9aa6af; }

.empty { min-height: 290px; display: grid; place-content: center; justify-items: center; text-align: center; padding: 36px; }
.empty-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #6faed8; background: var(--blue-soft); margin-bottom: 14px; }
.empty-icon .icon { width: 27px; height: 27px; }
.empty h3 { margin: 0 0 6px; font-size: 16px; }
.empty p { color: var(--muted); margin: 0 0 18px; max-width: 390px; }
.skeleton { border-radius: 8px; background: linear-gradient(90deg, #eff3f5 25%, #f8fafb 50%, #eff3f5 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading-list { display: grid; gap: 10px; padding: 18px; }
.loading-list .skeleton { height: 54px; }

.account-card, .ai-card, .task-card { height: 100%; padding: 17px; display: flex; flex-direction: column; }
.account-row { display: flex; align-items: center; gap: 12px; }
.account-row .user-meta strong { color: var(--ink); font-size: 14px; }
.account-row .user-meta span { color: var(--muted); font-size: 12px; }
.account-meta { margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--soft-line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.meta-label { color: var(--muted); font-size: 11px; }
.meta-value { font-weight: 660; margin-top: 3px; font-size: 12px; }
.card-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 14px; }
.account-card > .card-actions, .ai-card > .card-actions, .task-card > .card-actions, .equal-card > .card-actions { margin-top: auto; padding-top: 14px; }
.equal-card { height: 100%; display: flex; flex-direction: column; }
.card-grow { flex: 1; min-height: 0; }
.settings-grid > .card { height: 100%; display: flex; flex-direction: column; }
.settings-grid > .card > .card-body { flex: 1; display: flex; flex-direction: column; }
.settings-grid > .card form { flex: 1; display: flex; flex-direction: column; }
.settings-grid > .card form > .card-actions { margin-top: auto; padding-top: 14px; }
.export-card .export-icon { margin: 0 0 14px; }
.export-card h3 { margin: 0 0 6px; }
.export-card .export-description { flex: 1; min-height: 0; margin-bottom: 15px; }
.export-card .button-row { margin-top: auto; }
.export-filter-card { margin-bottom: 16px; }
.export-data-notice { margin-top: 18px; }
.platform-ai-summary { margin-top: 14px; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; padding: 24px; display: grid; place-items: center; background: rgba(8, 22, 33, .56); backdrop-filter: blur(3px); animation: fade-in .16s; }
@keyframes fade-in { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,.28); animation: modal-up .2s ease-out; overflow: hidden; }
@keyframes modal-up { from { transform: translateY(12px) scale(.985); opacity: .7; } }
.modal.wide { width: min(940px, 100%); }
.modal.chat-wide { width: min(1080px, 100%); }
.modal-head { padding: 18px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18px; margin: 0 0 3px; }
.modal-head p { color: var(--muted); margin: 0; font-size: 12px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 9px; color: #647582; background: #f2f5f7; display: grid; place-items: center; flex: 0 0 auto; }
.modal-close:hover { color: var(--ink); background: #e8eef2; }
.modal-body { padding: 20px; overflow-y: auto; overscroll-behavior: contain; }
.modal-foot { padding: 14px 20px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fbfcfd; }
.confirm-impact { border-radius: 11px; padding: 12px; color: #8f3439; background: var(--red-soft); margin-top: 13px; }

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: #edf2f5; }
.tab { flex: 1; border: 0; border-radius: 8px; padding: 8px 12px; color: #61717f; background: transparent; font-weight: 650; }
.tab.active { color: var(--ink); background: #fff; box-shadow: 0 2px 7px rgba(23,48,67,.08); }
.login-flow { min-height: 360px; }
.login-stage { padding: 22px 0 4px; }
.code-row { display: grid; grid-template-columns: 110px 1fr; gap: 9px; }
.country-option { font-variant-numeric: tabular-nums; }
.login-notice { display: flex; gap: 10px; padding: 11px 12px; border-radius: 10px; color: #3d6c88; background: var(--blue-soft); margin-bottom: 17px; }
.qr-wrap { min-height: 280px; display: grid; place-content: center; justify-items: center; text-align: center; }
.qr-image { width: 210px; height: 210px; border-radius: 12px; border: 10px solid #fff; box-shadow: 0 4px 20px rgba(25,52,72,.14); object-fit: contain; background: #fff; }
.qr-placeholder { width: 210px; height: 210px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); background: #edf2f5; }
.countdown { margin-top: 12px; color: var(--muted); font-size: 12px; }

.wizard { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 520px; margin: -20px; }
.wizard-steps { padding: 20px 14px; border-right: 1px solid var(--line); background: #f7f9fa; }
.wizard-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 9px; color: #71808d; }
.wizard-step:is(button) { width: 100%; border: 0; background: transparent; text-align: left; }
.wizard-step:is(button):disabled { opacity: .55; cursor: not-allowed; }
.wizard-step.active { color: var(--blue-dark); background: var(--blue-soft); }
.wizard-step.done { color: var(--green); }
.wizard-step-num { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; border: 1px solid currentColor; font-size: 11px; flex: 0 0 auto; }
.wizard-step strong { display: block; color: inherit; font-size: 12px; }
.wizard-step small { display: block; color: #91a0ac; font-size: 10px; }
.wizard-content { padding: 24px; overflow: auto; }
.wizard-content h3 { margin: 0 0 5px; font-size: 18px; }
.wizard-intro { color: var(--muted); margin: 0 0 22px; }
.wizard-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0 14px; }
.wizard-grid .span-2 { grid-column: 1 / -1; }
.wizard-nav { position: sticky; bottom: -24px; margin: 24px -24px -24px; padding: 14px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.96); display: flex; justify-content: space-between; gap: 10px; }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.template-card { border: 1px solid var(--line); border-radius: 11px; background: #fff; padding: 12px; text-align: left; }
.template-card:hover, .template-card.selected { border-color: var(--blue); background: var(--blue-soft); }
.template-card strong { display: block; }
.template-card span { color: var(--muted); font-size: 11px; }
.repeat-list { display: grid; gap: 9px; }
.repeat-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; max-height: 260px; overflow: auto; padding: 2px; }
.choice { border: 1px solid var(--line); border-radius: 10px; padding: 11px; display: flex; align-items: flex-start; gap: 9px; cursor: pointer; }
.choice:hover { border-color: #b7d7ed; }
.choice:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.choice input { margin-top: 3px; accent-color: var(--blue); }
.choice strong { display: block; font-size: 12px; }
.choice span { color: var(--muted); font-size: 11px; }
.choice.disabled { opacity: .58; cursor: not-allowed; }
.preview-message { max-width: 420px; border-radius: 12px 12px 4px 12px; padding: 10px 12px; background: #e6f4fd; box-shadow: 0 1px 2px rgba(22,66,93,.1); margin: 16px 0; white-space: pre-wrap; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.mode-card { min-height: 210px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; text-align: left; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; transition: .18s ease; }
.mode-card:hover { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-2px); box-shadow: 0 10px 28px rgba(39,136,216,.12); }
.mode-card strong { font-size: 18px; }
.mode-card > span:last-child { color: var(--muted); font-size: 13px; }
.language-policy-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: none; }
.language-policy-grid .mode-card { min-height: 122px; padding: 15px; gap: 7px; }
.language-policy-grid .mode-card strong { font-size: 13px; }
.language-policy-grid .mode-card input { accent-color: var(--blue); }
.language-picker { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; }
.language-selected { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.language-placeholder { color: var(--muted); font-size: 12px; }
.language-chip { max-width: 100%; min-height: 28px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px 3px 9px; border: 1px solid #c9e2f3; border-radius: 999px; color: #176fae; background: var(--blue-soft); font-size: 11px; }
.language-chip.custom { color: #895f19; border-color: #ecd29e; background: var(--amber-soft); }
.language-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-chip button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; color: inherit; background: rgba(255,255,255,.72); line-height: 1; }
.language-chip button:disabled { opacity: .35; cursor: not-allowed; }
.language-search { position: relative; }
.language-search .icon { position: absolute; left: 10px; top: 50%; width: 15px; height: 15px; color: #8a99a5; transform: translateY(-50%); }
.language-search .input { min-height: 36px; padding: 7px 9px 7px 32px; font-size: 12px; }
.language-options { max-height: 154px; margin-top: 7px; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px; }
.language-option { min-width: 0; min-height: 32px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; color: #445664; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 5px; text-align: left; font-size: 11px; }
.language-option span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.language-option:hover { border-color: #c8e1f1; background: #f0f8fd; }
.language-option.selected { color: #176fae; border-color: #b8d9ed; background: var(--blue-soft); }
.language-option:disabled { opacity: .4; cursor: not-allowed; }
.language-option .icon { width: 14px; height: 14px; }
.language-picker-foot { min-height: 18px; margin-top: 5px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.language-picker-foot .field-error { text-align: right; }
.language-no-result { grid-column: 1 / -1; padding: 12px; color: var(--muted); text-align: center; font-size: 11px; }
.voice-prompt-list { display: grid; gap: 9px; }
.voice-prompt-row { padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.voice-prompt-head { margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.voice-prompt-add { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: end; gap: 9px; margin-top: 10px; }
.mode-icon { width: 46px; height: 46px; border-radius: 13px; color: var(--blue-dark); background: var(--blue-soft); display: grid; place-items: center; }
.mode-icon .icon { width: 24px; height: 24px; }
.field-label-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.choice.compact { padding: 7px 9px; }
.selection-list { max-height: 310px; overflow: auto; display: grid; gap: 7px; padding: 3px; }
.broadcast-groups .choice { padding: 9px 10px; }
.broadcast-script-list { display: grid; gap: 14px; }
.broadcast-script { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fbfcfd; }
.broadcast-script-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.script-preview { display: none; max-width: 100%; margin-bottom: 0; }
.script-preview.expanded { display: block; }
.broadcast-account-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.broadcast-account-state { border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #fbfcfd; }
.broadcast-account-state.halted { border-color: #efc6c8; background: var(--red-soft); }
.broadcast-account-state > div:first-child { display: flex; justify-content: space-between; gap: 10px; }
.broadcast-account-state p { color: var(--muted); font-size: 12px; margin: 8px 0; }
.filter-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 12px; }
.broadcast-delivery-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.broadcast-delivery-row { display: grid; grid-template-columns: 1.2fr 1.35fr .9fr 1.1fr; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--soft-line); }
.broadcast-delivery-row:last-child { border-bottom: 0; }
.broadcast-delivery-row.heading { color: var(--muted); background: #f7f9fa; font-size: 11px; font-weight: 700; }
.broadcast-delivery-row > span { min-width: 0; }
.broadcast-delivery-row strong, .broadcast-delivery-row small { display: block; overflow-wrap: anywhere; }
.broadcast-delivery-row small { color: var(--muted); margin-top: 3px; }
.empty.compact { min-height: 180px; }
.summary-list { display: grid; gap: 10px; }
.summary-row { display: grid; grid-template-columns: 120px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--soft-line); }
.summary-row span:first-child { color: var(--muted); }
.advanced { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 18px; }
.advanced summary { cursor: pointer; padding: 12px; font-weight: 680; }
.advanced-body { padding: 0 12px 12px; }

.personal-bot-grid { display: grid; gap: 16px; }
.personal-bot-card { padding: 18px; }
.personal-bot-card.has-error { border-color: #e9b7ba; }
.personal-bot-head, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading { margin-bottom: 16px; }
.section-heading h3, .section-heading p { margin: 0; }
.section-heading p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.bot-tech-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 16px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.bot-tech-summary > div { min-width: 0; padding: 12px; background: #fbfcfd; }
.bot-tech-summary span, .bot-tech-summary strong, .bot-tech-summary small { display: block; overflow-wrap: anywhere; }
.bot-tech-summary span, .bot-tech-summary small { color: var(--muted); font-size: 10px; }
.bot-tech-summary strong { margin: 3px 0; font-size: 13px; }
.bot-stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0,1fr)); gap: 8px; }
.bot-stat-grid span { padding: 9px; border-radius: 9px; color: var(--muted); background: #f4f7f9; text-align: center; font-size: 10px; }
.bot-stat-grid strong { display: block; color: var(--ink); font-size: 17px; }
.bot-error { display: grid; gap: 3px; margin-top: 13px; }
.bot-error span, .bot-error small { display: block; }
.bot-identity-card, .owner-start-card { display: flex; align-items: center; gap: 14px; padding: 16px; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.bot-identity-card > div { min-width: 0; }
.bot-identity-card strong, .bot-identity-card span, .bot-identity-card code { display: block; }
.bot-identity-card span { color: var(--muted); margin: 2px 0 6px; }
.bot-identity-card code { width: fit-content; max-width: 100%; overflow-wrap: anywhere; color: #566a79; background: #edf2f5; padding: 4px 7px; border-radius: 6px; }
.verification-list { display: grid; gap: 8px; margin-bottom: 16px; }
.verification-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfd; }
.verification-row.passed { border-color: #b9dfce; background: #eff9f4; }
.verification-icon { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; color: #8998a4; border-radius: 50%; background: #edf1f4; }
.verification-row.passed .verification-icon { color: var(--green); background: #dff2e8; }
.verification-row strong, .verification-row span { display: block; }
.verification-row span { color: var(--muted); font-size: 10px; }
.business-guide { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin: 18px 0; }
.guide-card { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.guide-card.important { border-color: #efc58b; background: var(--amber-soft); }
.guide-card > span { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: 12px; border-radius: 9px; color: var(--blue-dark); background: var(--blue-soft); }
.guide-card strong { display: block; font-size: 12px; }
.guide-card p { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.acknowledgement { margin-top: 16px; }
.owner-start-visual { min-width: 94px; display: grid; place-items: center; gap: 5px; padding: 14px; color: var(--blue-dark); border-radius: 11px; background: var(--blue-soft); }
.owner-start-visual .icon { width: 30px; height: 30px; }
.owner-start-card p { color: var(--muted); margin: 5px 0 0; }
.configuration-section { margin: 22px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.configuration-section h4 { margin: 0 0 14px; }
.bot-ai-actions { position: sticky; bottom: -24px; z-index: 2; justify-content: flex-end; padding: 13px 0 0; background: rgba(255,255,255,.96); }

.collection-grid { align-items: stretch; }
.collection-panel { min-width: 0; min-height: 420px; display: flex; flex-direction: column; overflow: hidden; }
.collection-head { min-height: 78px; flex: 0 0 auto; align-items: center; }
.collection-head > div { min-width: 0; }
.collection-head p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.collection-primary { min-width: 106px; flex: 0 0 auto; }
.collection-body { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.collection-body > .empty { min-height: 315px; flex: 1; }
.collection-summary { margin-bottom: 8px; color: var(--muted); font-size: 11px; }
.collection-list { max-height: 480px; overflow-y: auto; border: 1px solid var(--soft-line); border-radius: 10px; }
.collection-row { min-height: 58px; display: grid; grid-template-columns: 12px minmax(0,1fr) auto auto; align-items: center; gap: 11px; padding: 9px 11px; border-bottom: 1px solid var(--soft-line); }
.collection-row:last-child { border-bottom: 0; }
.collection-row:hover { background: #fbfdfe; }
.collection-marker { width: 10px; height: 10px; border-radius: 50%; background: var(--marker, var(--blue)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--marker, var(--blue)) 12%, transparent); }
.collection-marker.segment { --marker: var(--violet); border-radius: 3px; }
.collection-copy { min-width: 0; }
.collection-copy strong, .collection-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collection-copy small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.collection-count { color: var(--muted); white-space: nowrap; font-size: 11px; }

.model-grid { align-items: stretch; }
.model-detail-list { display: grid; gap: 8px; margin-top: 15px; }
.model-detail-list > div { min-width: 0; display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 9px; padding-bottom: 8px; border-bottom: 1px solid var(--soft-line); }
.model-detail-list span { color: var(--muted); font-size: 11px; }
.model-detail-list strong { min-width: 0; overflow-wrap: anywhere; font-size: 11px; font-weight: 650; }
.model-card-notice { margin-top: 12px; overflow-wrap: anywhere; }
.model-page-notice { margin-top: 18px; }
.model-test-result { min-height: 44px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #f7f9fa; }
.model-test-result.success { color: #247d57; border-color: #b9dfce; background: var(--green-soft); }
.model-test-result.failed { color: #a3373d; border-color: #edc5c8; background: var(--red-soft); }
.model-modal-foot { margin: 4px -20px -20px; }

.message-page-note { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; color: var(--muted); font-size: 11px; }
.message-page-note strong { color: var(--ink); font-size: 13px; }
.message-tabs .tab { padding: 8px 6px; font-size: 11px; }
.message-tabs b { display: inline-grid; min-width: 17px; height: 17px; place-items: center; margin-left: 2px; border-radius: 99px; background: rgba(80,105,122,.11); font-size: 9px; }
.chat-workspace { height: calc(100dvh - 122px); min-height: 0; display: grid; grid-template-columns: 320px minmax(400px, 1fr) 300px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.conversation-pane { min-width: 0; min-height: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; }
.conversation-tools { padding: 14px; border-bottom: 1px solid var(--line); }
.conversation-tools .tabs { margin-bottom: 10px; }
.conversation-list { min-height: 0; overflow-y: auto; }
.conversation-item { width: 100%; border: 0; border-bottom: 1px solid var(--soft-line); background: #fff; padding: 12px 13px; display: flex; gap: 10px; text-align: left; }
.conversation-item:hover { background: #f6f9fb; }
.conversation-item.active { background: #eaf5fc; }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.conversation-line strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-time { color: #8c99a4; font-size: 10px; white-space: nowrap; }
.conversation-preview { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.unread { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; color: #fff; background: var(--blue); font-size: 10px; display: grid; place-items: center; margin-top: 5px; }
.chat-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: #e8f0f5; position: relative; }
.chat-head { height: 64px; flex: 0 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.chat-head .user-meta strong { color: var(--ink); font-size: 13px; }
.chat-head .user-meta span { color: var(--muted); font-size: 11px; }
.mobile-back { display: none; }
.chat-head-actions { margin-left: auto; display: flex; gap: 6px; }
.ignore-handoff-button { flex: 0 0 auto; white-space: nowrap; }
.message-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 7%; background-color: #e9f1f5; background-image: radial-gradient(circle at 1px 1px, rgba(42,93,124,.05) 1px, transparent 0); background-size: 22px 22px; }
.load-history { display: flex; justify-content: center; margin-bottom: 14px; }
.date-divider { width: fit-content; margin: 12px auto; padding: 4px 9px; border-radius: 99px; color: #657987; background: rgba(255,255,255,.82); box-shadow: 0 1px 3px rgba(30,63,84,.08); font-size: 10px; }
.message-row { display: flex; margin: 5px 0; }
.message-row.inbound { justify-content: flex-start; }
.message-row.outbound { justify-content: flex-end; }
.bubble { max-width: min(72%, 620px); border-radius: 13px; padding: 8px 10px 5px; background: #fff; box-shadow: 0 1px 2px rgba(26,62,84,.12); overflow-wrap: anywhere; }
.outbound .bubble { border-bottom-right-radius: 4px; background: #dff3fd; }
.inbound .bubble { border-bottom-left-radius: 4px; }
.bubble-text { white-space: pre-wrap; }
.message-translation { margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(65,105,129,.22); white-space: pre-wrap; color: #3e596a; }
.message-translation > span { display: block; margin-bottom: 2px; color: #78909e; font-size: 9px; font-weight: 700; }
.message-translation.loading { color: var(--muted); font-size: 10px; }
.translation-retry { margin-top: 7px; padding: 5px 0; border: 0; color: var(--red); background: transparent; font-size: 10px; text-decoration: underline; }
.ai-processing-status { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 6px; margin-top: 7px; padding-top: 7px; border-top: 1px dashed rgba(65,105,129,.22); color: #526c7c; font-size: 10px; }
.ai-processing-status strong { color: #36576a; }
.bubble-meta { display: flex; justify-content: flex-end; align-items: center; gap: 5px; color: #7d8e99; font-size: 9px; margin: 3px 0 0 12px; }
.identity { border-radius: 4px; padding: 1px 4px; color: #437c9f; background: rgba(255,255,255,.55); }
.send-failed { color: var(--red); }
.media-preview { display: block; max-width: 100%; max-height: 320px; border-radius: 8px; margin-bottom: 5px; }
.file-block { display: flex; align-items: center; gap: 9px; min-width: 220px; }
.file-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--blue); }
.new-message-pill { position: absolute; right: 20px; bottom: 82px; z-index: 3; border: 0; border-radius: 99px; color: var(--blue-dark); background: #fff; padding: 8px 12px; box-shadow: var(--shadow); }
.translation-help { flex: 0 0 auto; padding: 6px 14px; color: #456f87; background: #eef7fc; border-bottom: 1px solid #d7eaf5; font-size: 10px; }
.translation-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; color: #61717f; background: #fff; font-size: 10px; cursor: pointer; }
.translation-toggle input { accent-color: var(--blue); }
.composer { flex: 0 0 auto; padding: 9px 12px; display: grid; grid-template-columns: auto auto minmax(0,1fr) auto; align-items: end; gap: 8px; border-top: 1px solid var(--line); background: #fff; position: relative; }
.composer textarea { min-height: 40px; max-height: 130px; resize: none; border: 0; outline: 0; padding: 9px 4px; }
.composer-account { grid-column: 3; color: var(--muted); font-size: 10px; margin-top: -7px; }
.composer-unavailable { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #98373c; background: var(--red-soft); border-radius: 9px; padding: 8px 10px; font-size: 11px; }
.bilingual-composer { grid-template-columns: auto minmax(0,1fr) auto; }
.composer-send-actions { display: flex; gap: 6px; align-items: center; }
.bilingual-composer .composer-account { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: -5px; }
.bilingual-composer .composer-account label { display: flex; align-items: center; gap: 5px; }
.bilingual-preview { grid-column: 1 / -1; max-height: 48vh; overflow-y: auto; padding: 13px; border: 1px solid #b8d9ed; border-radius: 11px; background: #f4fbff; }
.bilingual-preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.preview-source { min-height: 54px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; white-space: pre-wrap; background: #fff; }
.multilingual-preview-list { display: grid; gap: 10px; margin-bottom: 14px; }
.translation-preview-card { padding: 11px; border: 1px solid #cde2ef; border-radius: 10px; background: #fff; }
.translation-preview-card.failed { border-color: #edc5c8; background: #fffafa; }
.translation-preview-card header { margin-bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.translation-preview-card header > div { display: flex; align-items: center; gap: 9px; }
.translation-preview-card .textarea { min-height: 86px; }
.emoji-panel { position: absolute; left: 48px; bottom: 72px; z-index: 5; display: grid; grid-template-columns: repeat(4, 38px); gap: 3px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.emoji-panel button { width: 38px; height: 38px; border: 0; border-radius: 8px; background: transparent; font-size: 20px; }
.emoji-panel button:hover { background: var(--blue-soft); }
.profile-pane { min-width: 0; min-height: 0; overflow-y: auto; background: #fff; }
.mobile-chat-prompt { display: none; margin-top: 9px; color: var(--muted); font-size: 11px; }
.profile-head { padding: 22px 18px; text-align: center; border-bottom: 1px solid var(--line); }
.profile-head .avatar { margin: 0 auto 10px; }
.profile-head h3 { margin: 0 0 2px; }
.profile-head p { color: var(--muted); margin: 0; font-size: 12px; }
.profile-section { padding: 15px 17px; border-bottom: 1px solid var(--soft-line); }
.profile-section h4 { margin: 0 0 9px; color: #71808d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.profile-data { display: grid; gap: 9px; }
.profile-data-row { display: grid; grid-template-columns: 76px 1fr; gap: 8px; font-size: 12px; }
.profile-data-row span:first-child { color: var(--muted); }

.toast-root { position: fixed; right: 22px; top: 20px; z-index: 200; display: grid; gap: 9px; pointer-events: none; }
.toast { width: min(360px, calc(100vw - 40px)); padding: 12px 14px; border-radius: 11px; color: #fff; background: #263846; box-shadow: 0 15px 35px rgba(15,35,50,.22); display: flex; align-items: flex-start; gap: 9px; animation: toast-in .22s ease-out; pointer-events: auto; }
.toast.success { background: #237c58; }
.toast.error { background: #ad3c43; }
.toast.warn { background: #9b6a20; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
.toast-copy { flex: 1; }
.toast strong { display: block; font-size: 12px; }
.toast span { display: block; opacity: .85; font-size: 11px; }

.pagination { padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-top: 1px solid var(--soft-line); }
.pagination-info { color: var(--muted); font-size: 12px; }
.inline-notice { padding: 12px 13px; border-radius: 10px; margin-bottom: 14px; color: #405b6d; background: #eff5f8; }
.inline-notice.warn { color: #865b1a; background: var(--amber-soft); }
.inline-notice.danger { color: #98373c; background: var(--red-soft); }
.progress { height: 6px; border-radius: 99px; background: #e7edf1; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); transition: width .2s; }

@media (max-width: 1280px) {
  .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .checklist { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .chat-workspace { grid-template-columns: 290px minmax(380px,1fr); }
  .profile-pane { display: none; position: absolute; right: 0; top: 0; bottom: 0; width: min(330px, 90%); z-index: 6; box-shadow: -10px 0 30px rgba(20,42,58,.16); }
  .profile-pane.open { display: block; }
}

@media (max-width: 900px) {
  :root { --sidebar: 278px; }
  .app-shell { display: block; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 50px rgba(0,0,0,.25); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-scrim { display: none; position: fixed; inset: 0; z-index: 29; background: rgba(7,21,31,.48); }
  .sidebar-scrim.open { display: block; }
  .main { width: 100%; }
  .mobile-menu { display: inline-flex; }
  .topbar { padding: 0 18px; }
  .main-content { padding: 20px 18px 36px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .login-shell { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-panel { padding: 36px 24px; }
  .login-brand { margin-bottom: 42px; }
  .chat-workspace { height: calc(100dvh - 110px); min-height: 0; grid-template-columns: 290px minmax(0,1fr); }
  .wizard { grid-template-columns: 150px minmax(0,1fr); }
  .bot-tech-summary { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .bot-stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .broadcast-delivery-row { grid-template-columns: 1fr 1.2fr 1fr; }
  .broadcast-delivery-row > span:last-child { grid-column: 1 / -1; }
  .broadcast-delivery-row.heading > span:last-child { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 13px; }
  .topbar { height: 60px; }
  .topbar-actions [data-realtime-status] { display: none; }
  .attention-button > span:not(.nav-badge) { display: none; }
  .breadcrumb { display: none; }
  .main-content { padding: 15px 12px 28px; }
  .main-content.message-main-content { height: calc(100dvh - 60px); min-height: 0; padding-bottom: 0; overflow: hidden; display: flex; flex-direction: column; }
  .message-main-content .message-page-note { flex: 0 0 auto; }
  .message-main-content .chat-workspace { height: auto; flex: 1 1 auto; }
  .page-head { align-items: stretch; flex-direction: column; margin-bottom: 16px; }
  .page-title h2 { font-size: 21px; }
  .page-head .button-row > .button { flex: 1; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
  .metric { padding: 14px; }
  .metric-value { font-size: 25px; }
  .checklist, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
  .toolbar { align-items: stretch; }
  .toolbar-left, .toolbar-right, .search-box { width: 100%; }
  .toolbar-right .button { flex: 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal, .modal.wide, .modal.chat-wide { width: 100%; max-height: 94vh; border-radius: 17px 17px 0 0; }
  .modal-body { padding: 16px; }
  .wizard { display: block; margin: -16px; min-height: 0; }
  .wizard-steps { display: flex; overflow-x: auto; border: 0; border-bottom: 1px solid var(--line); padding: 10px; }
  .wizard-step { flex: 0 0 auto; padding: 7px 9px; }
  .wizard-step small { display: none; }
  .wizard-content { padding: 18px 16px; }
  .wizard-grid { grid-template-columns: 1fr; }
  .wizard-grid .span-2 { grid-column: auto; }
  .wizard-nav { bottom: -18px; margin: 20px -16px -18px; padding: 12px 16px; }
  .template-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .selection-grid { grid-template-columns: 1fr; }
  .language-policy-grid { grid-template-columns: 1fr; }
  .language-options { grid-template-columns: 1fr; }
  .voice-prompt-add { grid-template-columns: 1fr; }
  .collection-panel { min-height: 390px; }
  .collection-head { min-height: 0; align-items: stretch; flex-direction: column; }
  .collection-primary { width: 100%; }
  .collection-head p { white-space: normal; }
  .collection-row { grid-template-columns: 12px minmax(0,1fr) auto; }
  .collection-row .button { grid-column: 2 / 4; width: 100%; }
  .translation-preview-card header { align-items: stretch; flex-direction: column; }
  .translation-preview-card header .button { width: 100%; }
  .mode-grid, .broadcast-account-list, .filter-bar { grid-template-columns: 1fr; }
  .mode-card { min-height: 0; }
  .broadcast-script-head, .field-label-row { align-items: stretch; flex-direction: column; }
  .broadcast-delivery-row, .broadcast-delivery-row.heading { grid-template-columns: 1fr; }
  .broadcast-delivery-row.heading { display: none; }
  .broadcast-delivery-row > span:last-child { grid-column: auto; }
  .repeat-row { grid-template-columns: 1fr auto; }
  .repeat-row .answer { grid-column: 1 / -1; grid-row: 2; }
  .account-meta { grid-template-columns: 1fr 1fr; }
  .chat-workspace { height: calc(100dvh - 86px); min-height: 0; display: block; border-radius: 12px; position: relative; }
  .conversation-pane, .chat-pane { position: absolute; inset: 0; }
  .conversation-pane { border: 0; z-index: 2; }
  .chat-pane { z-index: 3; transform: translateX(102%); transition: transform .2s ease; }
  .chat-workspace.chat-open .chat-pane { transform: translateX(0); }
  .mobile-back { display: inline-flex; }
  .chat-head { padding: 0 9px; gap: 7px; }
  .chat-head-actions { gap: 4px; }
  .ignore-handoff-button { min-width: 52px; padding-inline: 9px; }
  .mobile-chat-prompt { display: block; }
  .message-scroll { padding: 14px 9px; }
  .bubble { max-width: 86%; }
  .profile-pane { position: absolute; inset: 0; width: 100%; z-index: 7; }
  .composer-unavailable { align-items: flex-start; flex-direction: column; }
  .message-page-note { align-items: flex-start; flex-direction: column; }
  .message-tabs { overflow-x: auto; }
  .message-tabs .tab { min-width: 94px; }
  .translation-toggle span { display: none; }
  .composer-send-actions { flex-direction: column; align-items: stretch; }
  .bilingual-composer .composer-account { grid-column: 1 / -1; align-items: flex-start; flex-direction: column; }
  .bot-tech-summary, .bot-stat-grid, .business-guide { grid-template-columns: 1fr 1fr; }
  .personal-bot-head, .section-heading { align-items: stretch; flex-direction: column; }
  .personal-bot-card .card-actions { align-items: stretch; flex-direction: column; }
  .personal-bot-card .card-actions .button-row { flex-wrap: wrap; }
  .owner-start-card { align-items: flex-start; flex-direction: column; }
  .summary-row { grid-template-columns: 95px 1fr; }
  .login-card h1 { font-size: 27px; }
  .login-panel { place-content: start center; padding-top: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* 0.7.0 broadcast route controls remain reachable at narrow viewports. */
.broadcast-route-grid { display:grid; grid-template-columns:minmax(180px,1fr) minmax(150px,.7fr) auto; gap:12px; align-items:center; }
.broadcast-task-title { overflow-wrap:anywhere; min-width:0; }
@media (max-width: 600px) {
  .broadcast-route-grid { grid-template-columns:1fr; }
  .broadcast-route-grid .button-row { display:grid; grid-template-columns:1fr 1fr; width:100%; }
  .broadcast-delivery-table { overflow-x:auto; }
}
.login-return-link { display: block; margin-top: 14px; color: #2b6f9f; text-align: center; font-weight: 700; }
.login-return-link:focus-visible { outline: 3px solid #e8ad52; outline-offset: 3px; }
