:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --bg: #09101d;
  --bg-soft: #0d1727;
  --sidebar: #0b1422;
  --panel: #111d2e;
  --panel-soft: #0d1828;
  --panel-raised: #17253a;
  --line: #26364d;
  --line-strong: #3a4b63;
  --text: #eaf1fb;
  --text-soft: #c5d0df;
  --muted: #8798af;
  --blue: #2f80ed;
  --blue-bright: #58a5ff;
  --blue-soft: rgba(47, 128, 237, .14);
  --cyan: #2dd4bf;
  --green: #2dc787;
  --amber: #f0a23a;
  --red: #ef6672;
  --violet: #9b87f5;
  --shadow: 0 18px 50px rgba(0, 0, 0, .22);
  --sidebar-width: 252px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% -15%, rgba(47, 128, 237, .12), transparent 33rem),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

button, input, textarea, select { font: inherit; }

button { color: inherit; }

button, [role="button"] { -webkit-tap-highlight-color: transparent; }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 2px;
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #0c1727;
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input, select { min-height: 42px; padding: 9px 11px; }

textarea { padding: 10px 12px; resize: vertical; }

input:hover, textarea:hover, select:hover { border-color: #53657d; }

input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  background: #0e1a2c;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, .12);
  outline: none;
}

input::placeholder, textarea::placeholder { color: #61728a; }

input:disabled, textarea:disabled, select:disabled { cursor: not-allowed; opacity: .56; }

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

select[multiple] { min-height: 108px; padding: 6px; }

select[multiple] option { margin-bottom: 2px; padding: 7px 8px; border-radius: 6px; }

a { color: var(--blue-bright); }

h1, h2, h3, p { margin-top: 0; }

h1 { margin-bottom: 0; font-size: clamp(20px, 2vw, 26px); line-height: 1.25; }

h2 { margin-bottom: 7px; font-size: clamp(22px, 2.3vw, 30px); line-height: 1.25; }

h3 { margin-bottom: 5px; font-size: 17px; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.is-hidden { display: none !important; }
.broadcast-subnav[hidden] { display: none !important; }
.broadcast-subnav { margin: 6px 0 8px 25px; padding-left: 10px; border-left: 1px solid #e0ddfb; }
.desk-page .broadcast-subnav .nav-item { min-height: 36px; padding: 8px 12px; gap: 8px; }
.broadcast-subnav .nav-item::after { content: ""; order: -1; width: 5px; height: 5px; border-radius: 50%; background: #a6aec2; }
.desk-page .broadcast-subnav .nav-item.is-active::after { background: #6860ed; }
.desk-page .broadcast-subnav .nav-item.is-active::before { display: none; }
.broadcast-nav-parent .broadcast-nav-chevron { width: 14px; height: 14px; }
.broadcast-nav-parent[aria-expanded="true"] .broadcast-nav-chevron { transform: rotate(90deg); }
.broadcast-pools-page { padding: 24px; }
.broadcast-pools-page > .field { margin-top: 18px; }

.is-loading { pointer-events: none; opacity: .68; }

.primary-button, .secondary-button, .success-button, .danger-button, .text-button, .icon-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 650;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}

.primary-button { padding: 9px 16px; background: var(--blue); color: white; box-shadow: 0 8px 22px rgba(47, 128, 237, .2); }
.primary-button:hover { background: #3b8cf6; transform: translateY(-1px); }
.secondary-button { padding: 8px 14px; border-color: var(--line-strong); background: #142238; color: var(--text-soft); }
.secondary-button:hover { border-color: #536780; background: #192a42; }
.success-button { padding: 8px 14px; background: #197c59; color: #eafff7; }
.success-button:hover { background: #218c67; }
.danger-button { padding: 8px 14px; background: rgba(239, 102, 114, .12); border-color: rgba(239, 102, 114, .36); color: #ff9ba4; }
.danger-button:hover { background: rgba(239, 102, 114, .2); }
.text-button { min-height: 32px; padding: 5px 8px; background: transparent; color: var(--blue-bright); }
.text-button:hover { background: var(--blue-soft); }
.icon-button { width: 38px; min-height: 38px; padding: 0; background: transparent; color: var(--muted); }
.icon-button:hover { background: rgba(255, 255, 255, .06); color: var(--text); }
.compact-button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.primary-button svg, .secondary-button svg, .success-button svg, .danger-button svg, .icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button:disabled { cursor: not-allowed; opacity: .45; transform: none !important; }

.desk-layout { min-height: 100vh; }

.desk-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid #1f2e43;
  background: linear-gradient(180deg, #0c1626 0%, #09121f 100%);
}

.sidebar-brand {
  display: flex;
  min-height: 78px;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-bottom: 1px solid #1c2a3d;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #3c99ff, #2362d0);
  box-shadow: 0 9px 24px rgba(47, 128, 237, .24);
}

.brand-mark svg { width: 23px; height: 23px; fill: white; }

.sidebar-brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.sidebar-brand span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; letter-spacing: .11em; text-transform: uppercase; }

.sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 10px 18px; scrollbar-width: thin; }

.nav-group-title {
  margin: 16px 10px 7px;
  color: #64768e;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.nav-group-title:first-child { margin-top: 2px; }

.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #9dacbf;
  cursor: pointer;
  text-align: left;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.nav-item:hover { background: rgba(255, 255, 255, .035); color: var(--text); }
.nav-item.is-active { border-color: rgba(79, 151, 245, .19); background: rgba(47, 128, 237, .13); color: #e8f3ff; }
.nav-item.is-active::before { position: absolute; left: -11px; width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--blue-bright); content: ""; }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { flex: 1; font-size: 13px; font-weight: 600; }
.nav-badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--blue); color: white; font-size: 12px; font-style: normal; text-align: center; }

.sidebar-user { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-top: 1px solid #1d2b3e; background: rgba(4, 10, 18, .22); }
.sidebar-user-copy { min-width: 0; flex: 1; }
.sidebar-user-copy strong, .sidebar-user-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-copy strong { font-size: 12px; }
.sidebar-user-copy span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.sidebar-user .icon-button { width: 32px; min-height: 32px; }

.avatar {
  position: relative;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(108, 174, 255, .35);
  border-radius: 50%;
  background: linear-gradient(145deg, #234777, #17345c);
  color: #e9f4ff;
  font-weight: 750;
  text-transform: uppercase;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-small { width: 34px; height: 34px; font-size: 12px; }
.avatar-tiny { width: 18px; height: 18px; font-size: 12px; }
.avatar-xxl { width: 96px; height: 96px; font-size: 30px; }

.desk-main { min-width: 0; min-height: 100vh; margin-left: var(--sidebar-width); }

.desk-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(45, 62, 84, .84);
  background: rgba(9, 16, 29, .88);
  backdrop-filter: blur(16px);
}

.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 20px; }
.page-eyebrow { margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.mobile-menu-button { display: none; }

.sync-status { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 3px rgba(100, 116, 139, .1); }
.status-dot.is-online { background: var(--green); box-shadow: 0 0 0 3px rgba(45, 199, 135, .12); }
.status-dot.is-error { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 102, 114, .12); }

.topbar-profile { display: flex; align-items: center; gap: 9px; min-width: 138px; padding: 5px 9px 5px 5px; border: 1px solid var(--line); border-radius: 999px; background: #101c2d; cursor: pointer; text-align: left; }
.topbar-profile:hover { border-color: #435771; }
.topbar-profile strong, .topbar-profile small { display: block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-profile strong { font-size: 12px; }
.topbar-profile small { color: var(--muted); font-size: 12px; }

.global-notice { margin: 15px clamp(18px, 3vw, 34px) -1px; padding: 10px 13px; border: 1px solid rgba(239, 102, 114, .32); border-radius: 10px; background: rgba(239, 102, 114, .09); color: #ffb0b7; }

.desk-content { width: min(100%, 1600px); margin: 0 auto; padding: 25px clamp(18px, 3vw, 34px) 40px; }
.view-section { display: none; animation: section-enter .18s ease-out; }
.view-section.is-active { display: block; }
@keyframes section-enter { from { opacity: .55; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-header p:not(.section-kicker) { max-width: 700px; margin-bottom: 0; color: var(--muted); }
.section-kicker, .eyebrow { margin-bottom: 5px; color: #69aeff; font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }

.welcome-card {
  position: relative;
  display: flex;
  min-height: 170px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 42px);
  border: 1px solid rgba(69, 123, 192, .28);
  border-radius: 20px;
  background:
    linear-gradient(120deg, rgba(28, 66, 117, .62), rgba(15, 32, 55, .82)),
    var(--panel);
  box-shadow: var(--shadow);
}
.welcome-card::after { position: absolute; right: -70px; width: 240px; height: 240px; border: 1px solid rgba(95, 171, 255, .16); border-radius: 50%; box-shadow: 0 0 0 42px rgba(63, 147, 242, .045), 0 0 0 88px rgba(63, 147, 242, .025); content: ""; }
.welcome-card > * { position: relative; z-index: 1; }
.welcome-card h2 { margin-bottom: 8px; font-size: clamp(25px, 3vw, 36px); }
.welcome-card p:last-child { max-width: 650px; margin-bottom: 0; color: #aabbd0; }
.welcome-card .primary-button { flex: 0 0 auto; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 16px 0; }
.metric-card { position: relative; overflow: hidden; padding: 18px 19px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.metric-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 2px; background: var(--metric-color, var(--blue)); content: ""; }
.metric-card::after { position: absolute; right: -24px; bottom: -40px; width: 100px; height: 100px; border-radius: 50%; background: color-mix(in srgb, var(--metric-color, var(--blue)) 10%, transparent); content: ""; }
.metric-card > * { position: relative; z-index: 1; }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 12px; }
.metric-card strong { display: block; margin: 6px 0 3px; font-size: 30px; line-height: 1.1; }
.metric-card small { font-size: 12px; }
.metric-card.accent-blue { --metric-color: var(--blue-bright); }
.metric-card.accent-green { --metric-color: var(--green); }
.metric-card.accent-amber { --metric-color: var(--amber); }
.metric-card.accent-violet { --metric-color: var(--violet); }

.content-grid { display: grid; gap: 16px; }
.content-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: 0 10px 35px rgba(0, 0, 0, .08); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.panel-heading h3, .panel-heading p { margin-bottom: 0; }
.panel-heading > span { color: var(--muted); font-size: 12px; }

.compact-list { min-height: 190px; padding: 7px 12px 12px; }
.compact-list-item { display: flex; align-items: center; gap: 11px; padding: 11px 6px; border-bottom: 1px solid rgba(44, 59, 80, .72); }
.compact-list-item:last-child { border-bottom: 0; }
.compact-list-copy { min-width: 0; flex: 1; }
.compact-list-copy strong, .compact-list-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compact-list-copy strong { font-size: 12px; }
.compact-list-copy span { margin-top: 3px; color: var(--muted); font-size: 12px; }

.empty-state { display: grid; min-height: 150px; place-content: center; gap: 4px; padding: 20px; color: var(--muted); text-align: center; }
.empty-state strong { color: var(--text-soft); font-size: 13px; }
.empty-state span { font-size: 12px; }
.empty-state.small { min-height: 135px; }
.empty-state.spacious { min-height: 360px; }

.chat-stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; margin-bottom: 13px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.chat-stat-strip > span { padding: 13px 16px; border-right: 1px solid var(--line); }
.chat-stat-strip > span:last-child { border-right: 0; }
.chat-stat-strip small, .chat-stat-strip strong { display: block; }
.chat-stat-strip small { color: var(--muted); font-size: 12px; }
.chat-stat-strip strong { margin-top: 2px; font-size: 20px; }

.chat-account-navigation { grid-area: accounts; display: flex; min-width: 0; min-height: 0; overflow: hidden; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel-soft); }
.chat-account-navigation-head { display: block; flex: 0 0 auto; padding: 12px 12px 9px; border-bottom: 1px solid var(--line); }
.chat-account-navigation-head > div { display: flex; min-width: 0; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-account-navigation-head strong { font-size: 12px; }
.chat-account-navigation-head span, .chat-account-navigation-head small { color: var(--muted); font-size: 12px; }
.chat-account-navigation-head small { display: block; margin-top: 3px; line-height: 1.45; white-space: normal; }
.account-navigation-search { min-width: 0; flex: 0 0 auto; margin: 10px 10px 8px; }
.account-navigation-search input { min-height: 36px; padding-block: 7px; font-size: 12px; }
.chat-account-switcher { display: flex; min-width: 0; min-height: 0; flex: 1 1 auto; flex-direction: column; gap: 5px; overflow-x: hidden; overflow-y: auto; padding: 8px 9px 11px; scrollbar-color: #39506d transparent; scrollbar-width: thin; }
.chat-account-tab-wrap { display: flex; width: 100%; min-width: 0; flex: 0 0 auto; align-items: stretch; }
.chat-account-tab, .chat-account-menu-trigger, .chat-account-group { min-height: 34px; border: 1px solid var(--line-strong); background: #101c2e; color: #aebdd0; cursor: pointer; }
.chat-account-tab { display: flex; width: 100%; min-width: 0; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 7px; overflow: hidden; padding: 7px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; text-align: left; white-space: nowrap; }
.chat-account-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chat-account-identity { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.chat-account-telegram-name { font-size: 12px; font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.chat-account-tab .avatar { flex: 0 0 28px; width: 28px; height: 28px; font-size: 12px; }
.chat-account-tab > small { flex: 0 0 auto; }
.chat-account-tab > small { padding: 1px 5px; border-radius: 999px; background: rgba(114, 142, 177, .12); color: var(--muted); font-size: 12px; font-weight: 650; }
.chat-account-tab-wrap .chat-account-tab { flex: 1 1 auto; border-radius: 8px 0 0 8px; }
.chat-account-menu-trigger { width: 28px; flex: 0 0 28px; padding: 0 3px 1px 2px; border-left: 0; border-radius: 0 8px 8px 0; color: #7f91a9; font-size: 17px; line-height: 1; }
.chat-account-tab:hover, .chat-account-menu-trigger:hover, .chat-account-group:hover { border-color: #536780; background: #17273d; color: var(--text); }
.chat-account-tab.is-active { border-color: rgba(88, 165, 255, .7); background: rgba(47, 128, 237, .2); color: #dceeff; box-shadow: inset 0 0 0 1px rgba(88, 165, 255, .12); }
.chat-account-tab-wrap:has(.chat-account-tab.is-active) .chat-account-menu-trigger { border-color: rgba(88, 165, 255, .7); background: rgba(47, 128, 237, .2); color: #bdddff; }
.account-switch-status { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 4px; color: #8fa0b5 !important; }
.account-switch-status::before { width: 5px; height: 5px; border-radius: 50%; background: #7c8da3; content: ""; }
.account-switch-status.status-online::before { background: var(--green); box-shadow: 0 0 0 2px rgba(45, 199, 135, .12); }
.account-switch-status.status-connecting::before { background: var(--amber); }
.account-switch-status.status-error::before, .account-switch-status.status-invalid::before { background: var(--red); }
.chat-account-group-bar { min-width: 0; flex: 0 0 auto; padding: 0 9px 8px; border-bottom: 1px solid var(--line); }
.chat-account-group-bar > span { display: block; margin-bottom: 5px; color: #7f91a8; font-size: 12px; font-weight: 750; letter-spacing: .06em; }
.chat-account-groups { display: flex; min-width: 0; max-height: 70px; flex-wrap: wrap; gap: 4px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }
.chat-account-group { flex: 0 0 auto; min-height: 29px; padding: 4px 9px; border-radius: 7px; font-size: 12px; white-space: nowrap; }
.chat-account-group.is-active { border-color: rgba(45, 212, 191, .45); background: rgba(45, 212, 191, .1); color: #8be7da; }
.create-group-button { border-style: dashed; color: #85baf8; }
.chat-account-render-notice { padding: 8px 7px; color: #71849d; font-size: 12px; line-height: 1.5; text-align: center; }
.chat-account-empty { padding: 18px 8px; color: var(--muted); font-size: 12px; text-align: center; }

.account-group-context-menu { position: fixed; z-index: 140; display: grid; width: min(250px, calc(100vw - 16px)); max-height: min(420px, calc(100vh - 16px)); overflow-y: auto; padding: 6px; border: 1px solid var(--line-strong); border-radius: 11px; background: #17253a; box-shadow: 0 18px 52px rgba(0, 0, 0, .48); }
.account-group-context-menu[hidden] { display: none; }
.context-menu-heading { overflow: hidden; padding: 7px 9px 8px; border-bottom: 1px solid var(--line); color: #8fa2ba; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-group-context-menu button { min-height: 34px; padding: 7px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); cursor: pointer; font-size: 12px; text-align: left; }
.account-group-context-menu button:hover, .account-group-context-menu button:focus-visible { background: rgba(88, 165, 255, .1); color: #e4f1ff; }
.account-group-context-menu button:disabled { color: #596b82; cursor: not-allowed; }
.account-group-context-menu button.danger-menu-item { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0; color: #ff9ba4; }
.account-group-context-menu button.danger-menu-item:hover, .account-group-context-menu button.danger-menu-item:focus-visible { background: rgba(239, 102, 114, .14); color: #ffb3bb; }

.chat-toolbar, .table-toolbar { display: flex; align-items: center; gap: 9px; }
.chat-toolbar { margin-bottom: 13px; }
.chat-toolbar select { width: 150px; }
.search-box { position: relative; display: block; min-width: 230px; flex: 1; }
.search-box svg { position: absolute; top: 50%; left: 11px; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; }
.search-box input { padding-left: 35px; }
.chat-account-navigation .account-navigation-search { min-width: 0; flex: 0 0 auto; }
.toggle-label { display: inline-flex; min-height: 40px; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #101c2d; color: var(--text-soft); cursor: pointer; white-space: nowrap; }
.toggle-label.standalone { min-height: auto; margin-top: 10px; border: 0; background: transparent; padding: 5px 0; }

.service-chat-shell { position: relative; display: grid; grid-template-areas: "accounts groups conversations messages"; grid-template-columns: 244px 70px 248px minmax(430px, 1fr); grid-template-rows: minmax(0, 1fr); min-height: 620px; height: calc(100vh - 310px); overflow: hidden; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); box-shadow: var(--shadow); }
.service-chat-shell > * { min-height: 0; }
.conversation-pane, .customer-pane { min-width: 0; background: var(--panel-soft); }
.conversation-group-pane { grid-area: groups; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: #0f1a2a; }
.conversation-group-heading { padding-inline: 9px; }
.conversation-group-heading strong { font-size: 12px; }
.conversation-group-list { display: flex; flex-direction: column; gap: 5px; padding: 8px 7px; }
.conversation-group-item { display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: center; flex-direction: column; gap: 3px; padding: 5px 3px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #8193aa; cursor: pointer; font-size: 12px; text-align: center; }
.conversation-group-item:hover { border-color: var(--line); background: rgba(255, 255, 255, .025); color: var(--text-soft); }
.conversation-group-item.is-active { border-color: rgba(88, 165, 255, .28); background: rgba(47, 128, 237, .15); color: #8fc3ff; }
.conversation-group-icon { color: #62758d; font-size: 12px; line-height: 1; }
.conversation-group-item.is-active .conversation-group-icon { color: var(--blue-bright); }
.conversation-native-filters { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.conversation-pane { grid-area: conversations; display: flex; flex-direction: column; border-right: 1px solid var(--line); }
.conversation-list-search { min-width: 0; flex: 0 0 auto; margin: 9px 10px 7px; }
.conversation-list-search input { min-height: 36px; padding-block: 7px; font-size: 12px; }
.conversation-quick-filters { display: flex; flex: 0 0 auto; gap: 17px; padding: 0 11px 7px; border-bottom: 1px solid var(--line); }
.conversation-quick-filters button { position: relative; min-height: 28px; padding: 4px 0; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.conversation-quick-filters button::after { position: absolute; right: 0; bottom: -8px; left: 0; height: 2px; border-radius: 2px; background: transparent; content: ""; }
.conversation-quick-filters button.is-active { color: var(--text); }
.conversation-quick-filters button.is-active::after { background: var(--blue-bright); }
.conversation-quick-filters small { color: inherit; font-size: 12px; }
.message-pane { position: relative; grid-area: messages; }
.customer-pane { display: none; grid-area: customer; overflow-y: auto; border-left: 1px solid var(--line); }
.pane-heading { display: flex; min-height: 51px; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pane-heading strong { font-size: 12px; }
.pane-heading span { color: var(--muted); font-size: 12px; }
.conversation-heading-actions { display: inline-flex; align-items: center; gap: 5px; }
.chat-pane-refresh { width: 30px; min-height: 30px; }
.conversation-detail-toggle { display: none; }
.conversation-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; }
.conversation-item { display: block; width: 100%; margin: 0; padding: 12px 13px; border: 0; border-bottom: 1px solid rgba(40, 55, 76, .76); background: transparent; color: inherit; cursor: pointer; text-align: left; }
.conversation-item:hover { background: rgba(255, 255, 255, .025); }
.conversation-item.is-active { background: rgba(47, 128, 237, .13); box-shadow: inset 3px 0 var(--blue-bright); }
.conversation-row, .conversation-preview, .conversation-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conversation-row strong { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.conversation-preview { margin-top: 6px; color: var(--muted); font-size: 12px; }
.conversation-preview span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { margin-top: 5px; color: #687b94; font-size: 12px; }
.unread-badge { min-width: 19px; padding: 1px 6px; border-radius: 999px; background: var(--blue); color: white; font-size: 12px; text-align: center; }

.pager { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.message-pane { display: flex; min-width: 0; flex-direction: column; background: #0c1726; }
.message-pane-header { display: flex; min-height: 64px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(18, 31, 49, .86); }
.message-pane-header strong, .message-pane-header span { display: block; }
.message-pane-header strong { font-size: 13px; }
.message-pane-header span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.message-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; padding: 16px; scrollbar-width: thin; }
.load-older-row { display: flex; justify-content: center; margin-bottom: 14px; }
.date-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: #687a91; font-size: 12px; }
.date-divider::before, .date-divider::after { height: 1px; flex: 1; background: #24344a; content: ""; }
.message-row { display: flex; margin-bottom: 10px; }
.message-row.is-outgoing { justify-content: flex-end; }
.message-bubble { max-width: min(76%, 680px); padding: 9px 11px; border: 1px solid #2b3c53; border-radius: 5px 13px 13px 13px; background: #152338; overflow-wrap: anywhere; }
.message-row.is-outgoing .message-bubble { border-color: rgba(48, 132, 236, .48); border-radius: 13px 5px 13px 13px; background: #16365c; }
.message-sender { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; color: #7ab8ff; font-size: 12px; font-weight: 700; }
.message-text { color: #e0e9f5; font-size: 12px; white-space: pre-wrap; }
.message-meta { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 5px; color: #8294aa; font-size: 12px; }
.media-chip, .campaign-chip { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 5px; padding: 2px 6px; border-radius: 999px; background: rgba(114, 142, 177, .14); color: #b4c6dc; font-size: 12px; }
.campaign-chip { margin: 6px 0 0; background: rgba(155, 135, 245, .12); color: #c8bbff; }
.message-media-actions { margin-top: 5px; }
.message-media-actions .text-button { min-height: 26px; padding: 3px 6px; font-size: 12px; }
.reply-box { padding: 12px; border-top: 1px solid var(--line); background: #101d2e; }
.reply-box textarea { min-height: 74px; max-height: 180px; resize: none; }
.reply-box.is-disabled { opacity: .65; }
.reply-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.reply-actions > span { color: var(--muted); font-size: 12px; }
.reply-actions .primary-button { min-height: 34px; padding: 6px 12px; font-size: 12px; }

.customer-profile-head { padding: 22px 16px; border-bottom: 1px solid var(--line); text-align: center; }
.customer-profile-head .avatar { margin: 0 auto 10px; }
.customer-profile-head h3 { margin-bottom: 2px; }
.customer-profile-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.detail-section { padding: 14px 15px; border-bottom: 1px solid var(--line); }
.detail-section h4 { margin: 0 0 10px; color: #9babc0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.detail-row { display: flex; justify-content: space-between; gap: 12px; margin: 7px 0; font-size: 12px; }
.detail-row span { color: var(--muted); }
.detail-row strong { min-width: 0; overflow-wrap: anywhere; text-align: right; }

.account-summary-bar { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 13px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); color: var(--muted); font-size: 12px; }
.account-summary-bar strong { margin-left: 4px; color: var(--text); font-size: 15px; }
.table-toolbar { flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.table-toolbar .search-box { max-width: 330px; }
.table-toolbar select { width: 160px; }
.toolbar-spacer { flex: 1; }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid rgba(43, 58, 78, .78); text-align: left; vertical-align: middle; }
.data-table th { color: #8395ac; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, .018); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.table-pager { padding-inline: 15px; }
.account-identity { display: flex; align-items: center; gap: 8px; }
.account-identity-text { min-width: 0; }
.account-primary, .account-secondary { display: block; }
.account-primary { color: var(--text); font-weight: 650; }
.account-secondary { margin-top: 3px; color: var(--muted); font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }

.pill { display: inline-flex; align-items: center; gap: 5px; width: fit-content; padding: 3px 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(94, 112, 137, .11); color: #b7c4d5; font-size: 12px; white-space: nowrap; }
.pill::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.pill.is-success, .pill.status-online, .pill.status-completed { border-color: rgba(45, 199, 135, .32); background: rgba(45, 199, 135, .09); color: #71dfb3; }
.pill.is-warning, .pill.status-connecting, .pill.status-running, .pill.status-completed_with_errors { border-color: rgba(240, 162, 58, .34); background: rgba(240, 162, 58, .09); color: #f6bd6f; }
.pill.is-danger, .pill.status-error, .pill.status-failed, .pill.status-unknown { border-color: rgba(239, 102, 114, .34); background: rgba(239, 102, 114, .09); color: #ff929c; }
.pill.status-draft, .pill.status-offline, .pill.status-stopped { color: #a8b5c7; }
.tag-list { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { display: inline-flex; padding: 2px 6px; border-radius: 5px; background: rgba(88, 165, 255, .09); color: #9fc9fb; font-size: 12px; }
.block-note { display: inline-flex; margin-top: 4px; margin-right: 4px; padding: 2px 6px; border-radius: 5px; background: rgba(239, 102, 114, .12); color: #ff9ba4; font-size: 12px; cursor: help; }

.job-editor { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow); }
.form-section { display: grid; grid-template-columns: 74px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section-number { padding: 24px 17px; border-right: 1px solid var(--line); color: #506682; font-size: 12px; font-weight: 800; letter-spacing: .15em; text-align: center; }
.form-section-body { padding: 22px clamp(18px, 3vw, 30px); }
.form-section-body > h3 { margin-bottom: 17px; }
.form-grid { display: grid; gap: 15px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.full-span { grid-column: 1 / -1; }
.field { display: block; min-width: 0; color: #a6b5c8; }
.field > span:first-child { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 650; }
.field-help { display: block; margin-top: 5px; color: #6f8098; font-size: 12px; }
.reaction-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.reaction-option, .reaction-more-button, .reaction-remove-button { min-height: 42px; border: 1px solid var(--line-strong); border-radius: 10px; background: #0c1727; color: var(--text-soft); cursor: pointer; }
.reaction-option { width: 48px; padding: 5px; font-size: 22px; line-height: 1; }
.reaction-more-button, .reaction-remove-button { padding: 7px 12px; font-size: 12px; font-weight: 700; }
.reaction-remove-button { border-color: rgba(239, 102, 114, .35); color: #ff9ca5; }
.reaction-option:hover, .reaction-more-button:hover, .reaction-remove-button:hover { border-color: #607895; background: #17273d; }
.reaction-option.is-selected, .reaction-more-button.is-selected { border-color: var(--blue-bright); background: rgba(47, 128, 237, .18); box-shadow: 0 0 0 2px rgba(47, 128, 237, .1); }
.reaction-remove-button.is-selected { border-color: var(--red); background: rgba(239, 102, 114, .14); box-shadow: 0 0 0 2px rgba(239, 102, 114, .08); }
.reaction-custom-wrap { display: flex; max-width: 430px; gap: 8px; margin-top: 10px; }
.reaction-custom-wrap input { min-width: 0; flex: 1; }
.reaction-custom-wrap button { flex: 0 0 auto; }
.form-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(43, 59, 80, .78); }
.form-submit-row p { margin-bottom: 0; color: var(--muted); font-size: 12px; }

.progress-track { width: 110px; height: 5px; overflow: hidden; border-radius: 999px; background: #27364a; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress-copy { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }

.profile-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; }
.avatar-editor { padding: 28px 22px; text-align: center; }
.avatar-editor .avatar { margin: 0 auto 16px; }
.avatar-editor p { color: var(--muted); font-size: 12px; }
.avatar-editor input[type="file"] { margin: 12px 0; padding: 8px; font-size: 12px; }
.avatar-editor button { width: 100%; }
.profile-form { overflow: hidden; }
.profile-form > .form-grid { padding: 20px; }
.profile-form > .form-submit-row { margin: 0; padding: 16px 20px; }
.profile-overview { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(330px, .75fr); gap: 16px; margin-bottom: 16px; }
.profile-hero { display: flex; align-items: center; gap: 22px; padding: 28px; background: linear-gradient(130deg, rgba(30, 73, 127, .5), var(--panel)); }
.profile-hero h3 { margin-bottom: 5px; font-size: 25px; }
.profile-hero p:not(.section-kicker) { margin-bottom: 12px; color: #a2b3c8; }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.profile-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 9px; }
.profile-facts > div { padding: 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-facts > div:nth-child(2n) { border-right: 0; }
.profile-facts > div:nth-last-child(-n+2) { border-bottom: 0; }
.profile-facts span, .profile-facts strong { display: block; }
.profile-facts span { color: var(--muted); font-size: 12px; }
.profile-facts strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; }
.permission-panel { overflow: hidden; }
.permission-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 100px; padding: 19px; }
.permission-item { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(45, 199, 135, .2); border-radius: 9px; background: rgba(45, 199, 135, .06); color: #b8edda; font-size: 12px; }
.permission-item::before { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: rgba(45, 199, 135, .15); color: var(--green); content: "✓"; font-size: 12px; }

.desk-dialog {
  width: min(560px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
}
.desk-dialog::backdrop { background: rgba(2, 8, 15, .72); backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 19px 21px; border-bottom: 1px solid var(--line); }
.dialog-heading h3 { margin-bottom: 4px; }
.dialog-heading p:not(.section-kicker) { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.dialog-heading .icon-button { flex: 0 0 auto; font-size: 24px; font-weight: 300; }
.dialog-body { padding: 20px 21px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 21px; border-top: 1px solid var(--line); }
.desk-dialog.is-required .password-dialog-close { display: none; }
.desk-dialog .form-message { margin: 0; }
.danger-dialog { border-color: rgba(239, 102, 114, .45); }
.archive-confirm-copy strong { display: block; margin-bottom: 8px; color: #ffb0b7; font-size: 14px; }
.archive-confirm-copy p { margin-bottom: 0; color: var(--text-soft); font-size: 12px; }

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; width: min(360px, calc(100vw - 32px)); gap: 8px; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: 11px; background: #15243a; box-shadow: 0 14px 40px rgba(0, 0, 0, .3); animation: toast-enter .2s ease-out; }
.toast::before { width: 7px; height: 7px; flex: 0 0 auto; margin-top: 6px; border-radius: 50%; background: var(--blue-bright); content: ""; }
.toast.is-success::before { background: var(--green); }
.toast.is-error::before { background: var(--red); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 12px; }
.toast span { margin-top: 2px; color: var(--muted); font-size: 12px; }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 客服工作台浅色主题：以《修改软件》第 4 项参考图为视觉基准。 */
.desk-page {
  color-scheme: light;
  --bg: #f4f6f9;
  --bg-soft: #f8fafc;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-soft: #fbfcfe;
  --panel-raised: #ffffff;
  --line: #e5e9f0;
  --line-strong: #cfd6e2;
  --text: #172033;
  --text-soft: #3d4758;
  --muted: #7b8494;
  --blue: #6466e9;
  --blue-bright: #7378f2;
  --blue-soft: rgba(100, 102, 233, .1);
  --cyan: #0ea5a8;
  --green: #1aaa72;
  --amber: #d98b1f;
  --red: #dc4f61;
  --violet: #7c67d9;
  --shadow: 0 12px 34px rgba(30, 41, 59, .08);
  --sidebar-width: 224px;
  background: var(--bg);
  color: var(--text);
}

.desk-page input,
.desk-page textarea,
.desk-page select { border-color: var(--line-strong); background: #ffffff; color: var(--text); }
.desk-page input:hover,
.desk-page textarea:hover,
.desk-page select:hover { border-color: #aeb8c7; }
.desk-page input:focus,
.desk-page textarea:focus,
.desk-page select:focus { border-color: var(--blue); background: #ffffff; box-shadow: 0 0 0 3px rgba(100, 102, 233, .12); }
.desk-page input::placeholder,
.desk-page textarea::placeholder { color: #9aa3b2; }

.desk-page .secondary-button { border-color: var(--line-strong); background: #ffffff; color: #4b5565; }
.desk-page .secondary-button:hover { border-color: #aeb8c7; background: #f6f7fa; }
.desk-page .success-button { background: #1aaa72; color: #ffffff; }
.desk-page .danger-button { background: #fff3f4; border-color: #f2bbc2; color: #c63f51; }
.desk-page .icon-button:hover { background: #f0f2f6; color: var(--text); }

.desk-page .desk-sidebar { border-right-color: var(--line); background: #ffffff; box-shadow: 4px 0 18px rgba(30, 41, 59, .035); }
.desk-page .sidebar-brand { border-bottom-color: var(--line); }
.desk-page .brand-mark { background: linear-gradient(145deg, #7c73ef, #5f61df); box-shadow: 0 9px 24px rgba(100, 102, 233, .2); }
.desk-page .nav-group-title { color: #9299a6; }
.desk-page .nav-item { color: #596273; }
.desk-page .nav-item:hover { background: #f5f6f9; color: var(--text); }
.desk-page .nav-item.is-active { border-color: #dfe1ff; background: #eef0ff; color: #5054d7; }
.desk-page .nav-item.is-active::before { background: var(--blue); }
.desk-page .sidebar-user { border-top-color: var(--line); background: #fafbfc; }
.desk-page .avatar { border-color: #ccd4f9; background: linear-gradient(145deg, #8187ed, #6267d4); color: #ffffff; }

.desk-page .desk-topbar { border-bottom-color: var(--line); background: rgba(255, 255, 255, .92); box-shadow: 0 3px 12px rgba(30, 41, 59, .025); }
.desk-page .topbar-profile { border-color: var(--line); background: #ffffff; }
.desk-page .topbar-profile:hover { border-color: #aeb8c7; }
.desk-page .global-notice { border-color: #f3bdc4; background: #fff5f6; color: #b93a4a; }

.desk-page .welcome-card { border-color: #dfe3f8; background: linear-gradient(120deg, #f7f8ff, #ffffff); }
.desk-page .welcome-card p:last-child { color: #687386; }
.desk-page .metric-card,
.desk-page .panel,
.desk-page .job-editor { box-shadow: 0 8px 26px rgba(30, 41, 59, .055); }
.desk-page .compact-list-item { border-bottom-color: var(--line); }

.desk-page .chat-account-navigation,
.desk-page .conversation-pane,
.desk-page .conversation-group-pane,
.desk-page .message-pane,
.desk-page .customer-pane { background: #ffffff; }
.desk-page .service-chat-shell { background: #ffffff; box-shadow: 0 8px 28px rgba(30, 41, 59, .07); }
.desk-page .chat-account-navigation-head,
.desk-page .pane-heading,
.desk-page .message-pane-header { background: #ffffff; }
.desk-page .chat-account-switcher { scrollbar-color: #c7cfda transparent; }
.desk-page .chat-account-tab,
.desk-page .chat-account-menu-trigger,
.desk-page .chat-account-group { border-color: var(--line); background: #ffffff; color: #596273; }
.desk-page .chat-account-tab:hover,
.desk-page .chat-account-menu-trigger:hover,
.desk-page .chat-account-group:hover { border-color: #bcc5d2; background: #f6f7fa; color: var(--text); }
.desk-page .chat-account-tab.is-active,
.desk-page .chat-account-tab-wrap:has(.chat-account-tab.is-active) .chat-account-menu-trigger { border-color: #b8bcfa; background: #eef0ff; color: #4d52cf; box-shadow: inset 0 0 0 1px rgba(100, 102, 233, .08); }
.desk-page .chat-account-tab > small { background: #f0f2f6; color: #717b8c; }
.desk-page .account-switch-status { color: #788293 !important; }
.desk-page .chat-account-group-bar > span,
.desk-page .chat-account-render-notice { color: #818a99; }
.desk-page .chat-account-group.is-active { border-color: #c6c9fa; background: #f0f1ff; color: #5156d9; }

.desk-page .conversation-group-item { color: #697386; }
.desk-page .conversation-group-item:hover { border-color: var(--line); background: #f6f7fa; color: var(--text-soft); }
.desk-page .conversation-group-item.is-active { border-color: #dfe1ff; background: #eef0ff; color: #5559db; }
.desk-page .conversation-group-icon { color: #8b94a3; }
.desk-page .conversation-group-item.is-active .conversation-group-icon { color: var(--blue); }
.desk-page .conversation-item { border-bottom-color: var(--line); }
.desk-page .conversation-item:hover { background: #f7f8fa; }
.desk-page .conversation-item.is-active { background: #eef1ff; box-shadow: inset 3px 0 var(--blue); }
.desk-page .conversation-meta { color: #8b94a4; }

.desk-page .message-pane { background: #f7f9fb; }
.desk-page .message-pane-header { border-bottom-color: var(--line); }
.desk-page .date-divider { color: #8b94a4; }
.desk-page .date-divider::before,
.desk-page .date-divider::after { background: #dfe4eb; }
.desk-page .message-bubble { border-color: #dce2e9; background: #ffffff; box-shadow: 0 2px 7px rgba(30, 41, 59, .04); }
.desk-page .message-row.is-outgoing .message-bubble { border-color: #cfd3fb; background: #eef0ff; }
.desk-page .message-sender { color: #5c62dc; }
.desk-page .message-text { color: #273244; }
.desk-page .message-meta { color: #8993a3; }
.desk-page .media-chip,
.desk-page .campaign-chip { background: #eef1f5; color: #556174; }
.desk-page .reply-box { background: #ffffff; }
.reply-attachment-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.reply-attachment-tools > span { font-size: 12px; color: #66788c; }
.reply-attachment-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; margin-bottom: 8px; border: 1px solid #dce6f1; border-radius: 8px; background: #f5f9fd; }
.reply-attachment-preview[hidden], .reply-status[hidden], .reply-start-new[hidden] { display: none; }
.reply-attachment-preview > div { min-width: 0; display: grid; gap: 3px; }
.reply-attachment-preview strong { overflow-wrap: anywhere; color: #20344e; font-size: 12px; }
.reply-attachment-preview span { color: #66788c; font-size: 12px; }
.reply-attachment-preview button { flex-shrink: 0; }
.reply-status { margin-top: 8px; font-size: 12px; line-height: 1.5; color: #52657a; overflow-wrap: anywhere; }
.reply-status.is-error { color: #b42318; }
.reply-status.is-success { color: #13764b; }
.reply-start-new { margin-top: 8px; }
.desk-page .toggle-label { background: #ffffff; color: var(--text-soft); }

.desk-page .account-group-context-menu { border-color: var(--line-strong); background: #ffffff; box-shadow: 0 18px 45px rgba(30, 41, 59, .17); }
.desk-page .context-menu-heading { color: #758092; }
.desk-page .account-group-context-menu button { color: var(--text-soft); }
.desk-page .account-group-context-menu button:hover,
.desk-page .account-group-context-menu button:focus-visible { background: #eef0ff; color: #484dcc; }
.desk-page .account-group-context-menu button.danger-menu-item { color: #c63f51; }
.desk-page .account-group-context-menu button.danger-menu-item:hover,
.desk-page .account-group-context-menu button.danger-menu-item:focus-visible { background: #fff3f4; color: #c63f51; }

.desk-page .data-table th { color: #7d8797; }
.desk-page .data-table th,
.desk-page .data-table td { border-bottom-color: var(--line); }
.desk-page .data-table tbody tr:hover { background: #f8f9fb; }
.desk-page .pill { background: #f5f6f8; color: #657083; }
.desk-page .pill.is-success,
.desk-page .pill.status-online,
.desk-page .pill.status-completed { color: #16865b; }
.desk-page .pill.status-draft,
.desk-page .pill.status-offline,
.desk-page .pill.status-stopped { color: #6f7887; }
.desk-page .tag { background: #eef0ff; color: #555bd6; }
.desk-page .block-note { background: #fff3f4; color: #c63f51; }
.desk-page .field { color: #4e596a; }
.desk-page .field-help { color: #858f9f; }
.desk-page .reaction-option,
.desk-page .reaction-more-button,
.desk-page .reaction-remove-button { background: #ffffff; }
.desk-page .reaction-option:hover,
.desk-page .reaction-more-button:hover,
.desk-page .reaction-remove-button:hover { border-color: #aeb8c7; background: #f6f7fa; }
.desk-page .reaction-remove-button { border-color: #f2bbc2; color: #c63f51; }
.desk-page .reaction-remove-button:hover { border-color: #e48c99; background: #fff3f4; }
.desk-page .reaction-remove-button.is-selected { border-color: var(--red); background: #fff3f4; box-shadow: 0 0 0 2px rgba(220, 79, 97, .12); }
.desk-page .progress-track { background: #e4e8ee; }
.desk-page .profile-hero { background: linear-gradient(130deg, #f0f2ff, #ffffff); }
.desk-page .profile-hero p:not(.section-kicker) { color: #657083; }
.desk-page .permission-item { color: #187552; }

.desk-page .desk-dialog { background: #ffffff; color: var(--text); box-shadow: 0 28px 75px rgba(30, 41, 59, .22); }
.desk-page .desk-dialog::backdrop { background: rgba(30, 41, 59, .38); }
.desk-dialog.detail-dialog { width: min(1120px, calc(100vw - 32px)); max-width: 1120px; max-height: calc(100vh - 32px); overflow-y: auto; }
.detail-dialog .dialog-body { display: block; }
.detail-dialog .table-wrap { max-height: 52vh; overflow: auto; }
.detail-table { min-width: 850px; }
.detail-table thead th { position: sticky; top: 0; z-index: 1; background: #f4f6fa; }
.detail-table .detail-reason { min-width: 210px; max-width: 330px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.detail-table .detail-code { max-width: 190px; white-space: normal; overflow-wrap: anywhere; }
.job-account-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.job-account-controls input[type="number"] { width: 72px; min-height: 30px; padding: 4px 7px; }
.job-account-controls .field-help { width: 100%; }
.desk-page .archive-confirm-copy strong { color: #bd4051; }
.desk-page .toast { background: #ffffff; box-shadow: 0 14px 38px rgba(30, 41, 59, .16); }

@media (min-width: 1101px) {
  .desk-page.is-chat-view { height: 100vh; overflow: hidden; }
  .desk-page.is-chat-view .desk-main { height: 100vh; min-height: 0; }
  .desk-page.is-chat-view .desk-topbar { display: none; }
  .desk-page.is-chat-view .desk-content { width: 100%; height: 100vh; margin: 0; padding: 0; }
  .desk-page.is-chat-view .view-section[data-section="chat"] { height: 100%; }
  .desk-page.is-chat-view .view-section[data-section="chat"] > .section-header,
  .desk-page.is-chat-view .view-section[data-section="chat"] > .chat-stat-strip { display: none; }
  .desk-page.is-chat-view .service-chat-shell { width: 100%; height: 100%; min-height: 0; border-width: 0 0 0 1px; border-radius: 0; box-shadow: none; }
  .desk-page.is-chat-view .conversation-detail-toggle { position: absolute; top: 50%; right: 0; z-index: 12; display: inline-flex; width: 34px; min-height: 64px; align-items: center; justify-content: center; padding: 8px 5px; border: 1px solid var(--line-strong); border-right: 0; border-radius: 9px 0 0 9px; transform: translateY(-50%); background: #ffffff; color: #596273; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .08em; writing-mode: vertical-rl; transition: right .18s ease, background .18s ease, color .18s ease; }
  .desk-page.is-chat-view .conversation-detail-toggle:hover { background: #eef0ff; color: #4d52cf; }
  .desk-page.is-chat-view .service-chat-shell.is-detail-open .customer-pane { position: absolute; inset: 0 0 0 auto; z-index: 11; display: block; width: 280px; overflow-y: auto; border-left: 1px solid var(--line); background: #ffffff; box-shadow: -12px 0 32px rgba(30, 41, 59, .1); }
  .desk-page.is-chat-view .service-chat-shell.is-detail-open .conversation-detail-toggle { right: 280px; }
}

/* 登录页 */
.login-page { display: grid; min-height: 100vh; place-items: center; padding: clamp(16px, 4vw, 48px); background: #08101c; }
.login-page::before { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(circle at 18% 35%, rgba(47, 128, 237, .17), transparent 32rem), radial-gradient(circle at 82% 70%, rgba(45, 212, 191, .06), transparent 25rem); content: ""; }
.login-page-manager { background: #120e18; }
.login-page-manager::before { background: radial-gradient(circle at 16% 32%, rgba(204, 139, 53, .2), transparent 32rem), radial-gradient(circle at 84% 72%, rgba(139, 92, 246, .1), transparent 27rem); }
.login-shell { position: relative; display: grid; width: min(1040px, 100%); min-height: 590px; grid-template-columns: minmax(0, 1.1fr) minmax(390px, .9fr); overflow: hidden; border: 1px solid #263850; border-radius: 24px; background: #0c1727; box-shadow: 0 30px 90px rgba(0, 0, 0, .42); }
.login-page-manager .login-shell { border-color: #59452f; background: #19131d; box-shadow: 0 30px 90px rgba(0, 0, 0, .5), 0 0 0 1px rgba(222, 166, 88, .05); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding: clamp(36px, 6vw, 70px); border-right: 1px solid #263850; background: linear-gradient(145deg, rgba(24, 60, 104, .78), rgba(10, 24, 41, .92)); }
.login-page-manager .login-brand { border-right-color: #59452f; background: linear-gradient(145deg, rgba(92, 57, 34, .94), rgba(28, 19, 29, .96)); }
.login-brand::after { position: absolute; right: -110px; bottom: -100px; width: 340px; height: 340px; border: 1px solid rgba(91, 169, 255, .13); border-radius: 50%; box-shadow: 0 0 0 55px rgba(72, 150, 239, .035), 0 0 0 110px rgba(72, 150, 239, .02); content: ""; }
.login-page-manager .login-brand::after { border-color: rgba(241, 190, 112, .18); box-shadow: 0 0 0 55px rgba(218, 157, 68, .045), 0 0 0 110px rgba(218, 157, 68, .025); }
.login-brand > * { position: relative; z-index: 1; }
.brand-mark-large { width: 54px; height: 54px; margin-bottom: 28px; border-radius: 16px; }
.login-page-manager .brand-mark-large { background: linear-gradient(145deg, #e0a74d, #9f6231); box-shadow: 0 9px 27px rgba(204, 139, 53, .28); }
.brand-mark-large svg { width: 31px; height: 31px; }
.login-brand h1 { max-width: 530px; margin-bottom: 16px; font-size: clamp(31px, 4.3vw, 48px); line-height: 1.14; letter-spacing: -.035em; }
.login-brand-copy { max-width: 520px; margin-bottom: 34px; color: #9fb2c9; font-size: 13px; line-height: 1.75; }
.login-points { display: grid; gap: 10px; }
.login-points > div { display: flex; align-items: center; gap: 12px; }
.login-points > div > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(105, 174, 255, .25); border-radius: 9px; background: rgba(41, 118, 207, .1); color: #75b8ff; font-size: 12px; font-weight: 800; }
.login-page-manager .login-points > div > span { border-color: rgba(239, 183, 99, .3); background: rgba(204, 139, 53, .12); color: #f0bd72; }
.login-points p, .login-points strong, .login-points small { margin: 0; }
.login-points strong, .login-points small { display: block; }
.login-points strong { font-size: 12px; }
.login-points small { margin-top: 2px; color: #8398b1; font-size: 12px; }
.login-card { display: flex; flex-direction: column; justify-content: center; padding: clamp(32px, 5vw, 58px); background: #0f1a2b; }
.login-page-manager .login-card { background: #1b1620; }
.login-card-head { margin-bottom: 27px; }
.login-portal-chip { display: table; margin-bottom: 13px; padding: 5px 10px; border: 1px solid rgba(45, 212, 191, .3); border-radius: 999px; background: rgba(45, 212, 191, .08); color: #66ddce; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.login-page-manager .login-portal-chip { border-color: rgba(239, 183, 99, .36); background: rgba(204, 139, 53, .11); color: #efbc70; }
.login-card-head h2 { margin: 17px 0 6px; font-size: 28px; }
.login-page-manager .login-card-head h2 { color: #fff1d9; }
.login-card-head p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.login-secure-badge { display: inline-flex; align-items: center; gap: 7px; color: #99acbf; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; }
.login-form { display: grid; gap: 18px; }
.login-form .field > span:first-child { margin-bottom: 8px; color: #b9c7d8; }
.input-shell { position: relative; display: block; }
.input-shell > svg { position: absolute; top: 50%; left: 12px; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: #71839b; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.input-shell input { min-height: 48px; padding: 11px 72px 11px 39px; }
.password-toggle { position: absolute; top: 50%; right: 8px; min-height: 30px; padding: 4px 8px; border: 0; border-radius: 7px; transform: translateY(-50%); background: transparent; color: #8ea1b8; cursor: pointer; font-size: 12px; }
.password-toggle:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.form-message { min-height: 20px; margin: -3px 0 -5px; color: var(--muted); font-size: 12px; }
.form-message.is-error { color: #ff9ba4; }
.form-message.is-success { color: #72dfb4; }
.login-button { position: relative; width: 100%; min-height: 48px; }
.login-page-manager .login-button { background: linear-gradient(180deg, #d99b45, #a76531); color: #1d1208; box-shadow: 0 8px 24px rgba(191, 119, 43, .25); }
.login-page-manager .login-button:hover { background: linear-gradient(180deg, #e7aa55, #b67238); }
.login-page-manager input:focus { border-color: #c9893d; box-shadow: 0 0 0 3px rgba(204, 139, 53, .14); }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .32); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
.login-button.is-loading .button-spinner { display: block; }
.login-button.is-loading .button-label { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-help { margin: 25px 0 0; color: #6f8198; font-size: 12px; line-height: 1.6; text-align: center; }

@media (max-width: 1650px) {
  .service-chat-shell { grid-template-columns: 238px 68px 238px minmax(330px, 1fr); }
}

@media (max-width: 1420px) {
  .service-chat-shell { grid-template-areas: "accounts groups conversations messages"; grid-template-columns: 236px 82px 246px minmax(330px, 1fr); }
}

@media (max-width: 1220px) {
  .service-chat-shell { grid-template-columns: 228px 78px 232px minmax(300px, 1fr); }
  .form-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
  .service-chat-shell { grid-template-areas: "accounts groups conversations" "messages messages messages"; grid-template-columns: minmax(180px, .75fr) 88px minmax(250px, 1fr); grid-template-rows: 390px minmax(560px, auto); height: auto; min-height: 950px; overflow: hidden; }
  .chat-account-navigation, .conversation-group-pane, .conversation-pane { border-bottom: 1px solid var(--line); }
  .message-pane { min-height: 560px; }
}

@media (max-width: 980px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .content-grid.two-columns, .profile-overview { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .topbar-profile { min-width: auto; }
  .topbar-profile > span:last-child { display: none; }
  .login-shell { grid-template-columns: 1fr 390px; }
  .login-brand { padding: 40px; }
  .login-brand h1 { font-size: 36px; }
}

@media (max-width: 800px) {
  :root { --sidebar-width: 250px; }
  .desk-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .desk-sidebar.is-open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: none; background: rgba(2, 7, 13, .68); backdrop-filter: blur(2px); }
  .sidebar-backdrop.is-visible { display: block; }
  .desk-main { margin-left: 0; }
  .mobile-menu-button { display: inline-flex; }
  .desk-topbar { padding-inline: 14px; }
  .desk-content { padding: 18px 13px 32px; }
  .global-notice { margin-inline: 13px; }
  .sync-status, #refreshViewButton span { display: none; }
  .welcome-card { min-height: 190px; align-items: flex-start; flex-direction: column; }
  .welcome-card .primary-button { align-self: stretch; }
  .service-chat-shell { grid-template-areas: "accounts" "groups" "conversations" "messages"; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; height: auto; min-height: 620px; }
  .chat-account-navigation { max-height: 440px; min-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .chat-account-switcher { min-height: 210px; }
  .conversation-group-pane { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .conversation-group-heading { min-height: 44px; }
  .conversation-group-list { flex-direction: row; overflow-x: auto; padding: 7px 10px 10px; scrollbar-width: thin; }
  .conversation-group-item { min-width: 82px; min-height: 48px; flex: 0 0 auto; }
  .conversation-pane { max-height: 420px; border-right: 0; border-bottom: 1px solid var(--line); }
  .message-pane { min-height: 560px; }
  .form-section { grid-template-columns: 1fr; }
  .form-section-number { padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); text-align: left; }
  .form-grid.three, .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .chat-toolbar, .table-toolbar { align-items: stretch; flex-direction: column; }
  .chat-toolbar > *, .table-toolbar > *, .table-toolbar .search-box { width: 100%; max-width: none; }
  .chat-account-groups { width: 100%; }
  .toolbar-spacer { display: none; }
  .login-page { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand { display: none; }
  .login-card { min-height: 100vh; }
}

@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 15px; }
  .metric-card strong { font-size: 25px; }
  .chat-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .chat-stat-strip > span:nth-child(2) { border-right: 0; }
  .chat-stat-strip > span:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .section-header { flex-direction: column; }
  .section-header > button { width: 100%; }
  .topbar-actions .secondary-button { width: 38px; padding: 0; }
  .topbar-profile { padding-right: 5px; }
  .form-submit-row { align-items: stretch; flex-direction: column; }
  .form-submit-row .primary-button { width: 100%; }
  .profile-hero { align-items: flex-start; flex-direction: column; }
  .profile-facts { grid-template-columns: 1fr; }
  .profile-facts > div { border-right: 0; }
  .profile-facts > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .message-bubble { max-width: 88%; }
  .reaction-option { width: 43px; }
  .reaction-custom-wrap { align-items: stretch; flex-direction: column; }
  .reaction-custom-wrap button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
.broadcast-contract-preview { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 12px; }
.broadcast-contract-warning { color: #875509; background: #fff4d7; white-space: pre-wrap; padding: 12px; border-radius: 8px; }
.broadcast-contract-warning:empty { display: none; }
.broadcast-pool-member { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.broadcast-pool-member span { flex: 1; white-space: pre-wrap; overflow-wrap: anywhere; }


/* 定时群发 —— 追加样式，不改动既有类名语义 */
.schedule-list { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.schedule-card { border: 1px solid var(--line, #2a3350); border-radius: 12px; padding: 14px 16px; background: var(--panel, #141a2e); }
.schedule-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.schedule-card h3 { margin: 0; font-size: 15px; }
.schedule-flag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; }
.schedule-flag.is-on { color: #3fbf7f; }
.schedule-flag.is-off { color: #8b93a7; }
.schedule-card dl { display: grid; gap: 6px; margin: 0 0 8px; }
.schedule-card dl > div { display: flex; gap: 8px; font-size: 13px; }
.schedule-card dt { color: #8b93a7; min-width: 62px; }
.schedule-card dd { margin: 0; }
.schedule-card .tone-ok { color: #3fbf7f; }
.schedule-card .tone-warn { color: #e0a83c; }
.schedule-card .tone-bad { color: #ff6b6b; font-weight: 600; }
.schedule-card .tone-muted { color: #8b93a7; }
.schedule-progress, .schedule-reason { margin: 4px 0; font-size: 12.5px; color: #b8c0d4; }
.schedule-reason:empty, .schedule-progress:empty { display: none; }
.schedule-segments { display: grid; gap: 12px; }
.schedule-segment { border: 1px solid var(--line, #2a3350); border-radius: 10px; padding: 10px 12px; }
.schedule-segment-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.schedule-segment-no { font-size: 12.5px; color: #8b93a7; }
.schedule-segment-actions { display: flex; gap: 6px; }
.schedule-segment textarea { width: 100%; }
.schedule-wait-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #8b93a7; margin-top: 6px; }
.schedule-wait-label input { width: 88px; }
.schedule-segment-preview { margin-top: 8px; font-size: 13px; line-height: 1.6; }
.schedule-segment-preview:empty { display: none; }
.schedule-presets { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.schedule-range { display: inline-flex; align-items: center; gap: 6px; }
.schedule-range input { width: 88px; }
/* Teacher reports use the existing light desk palette. Legacy routes remain
   addressable for saved links, but no longer compete in the primary menu. */
.teacher-legacy-nav { display: none !important; }
.teacher-page { max-width: 1480px; margin: 0 auto; padding: 28px; color: #25324a; }
.gp-editor { padding: 24px; }
.category-layout { display:grid; grid-template-columns:minmax(220px,.65fr) minmax(0,1.35fr); gap:20px; }
.role-head,.role-chips{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:14px 20px}
.role-head{border-bottom:1px solid #e5e8f1}.role-head>span,.role-muted{color:#6b7487;font-size:13px}
#roleRoot .role-head>label{display:flex;flex-direction:row;align-items:center;gap:8px;margin:0;font-weight:600}
.role-label{font-weight:600;margin:12px 0}.role-chip{display:inline-flex;align-items:center;border:1px solid #e3e7ef;background:#f8f9fc;border-radius:20px;padding:5px 10px;gap:5px}
#roleRoot .role-chip label{display:flex;align-items:center;gap:7px;margin:0}#roleRoot input[type=checkbox]{width:16px;height:16px;flex:none;accent-color:#7161e7}
.role-blocked{border-color:#e6bcc0}.role-error{color:#aa3648}.role-unassigned{border:1px dashed #dbb763;background:#fff9ed;padding:18px;border-radius:12px;margin:18px 0}
.role-settings{display:grid;grid-template-columns:2fr 1fr 1fr;gap:14px}.role-script{border-top:1px solid #e3e7ef;padding:14px 0}.role-script input[type=file]{max-width:100%}
.role-pair{display:grid;grid-template-columns:minmax(120px,.7fr) minmax(0,2fr) minmax(90px,.6fr);gap:12px;padding:12px 0;border-bottom:1px solid #e5e8ef}.role-pair span{white-space:pre-wrap;overflow-wrap:anywhere}
.role-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;border-bottom:1px solid #e5e8ef;padding:15px 0}.role-stats div{display:flex;flex-direction:column;color:#697587}.role-stats strong{font-size:22px;color:#26324a}
.role-example{padding:12px 0;border-bottom:1px solid #e5e8ef}.role-example p,#roleStatus,#roleJob{white-space:pre-wrap;overflow-wrap:anywhere}#roleRoot details summary{cursor:pointer;padding:14px 0;color:#6955d2}
#rolePicker{width:min(600px,90vw);border:1px solid #dce1eb;border-radius:14px;padding:22px;color:#28314a;background:white}#rolePicker::backdrop{background:#17243b70}.role-picker-row{display:flex!important;align-items:center;gap:8px;padding:10px}#rolePicker textarea{width:100%}
@media(max-width:750px){.role-settings,.role-pair{grid-template-columns:minmax(0,1fr)}.role-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
.category-choice { display:block; width:100%; margin:8px 0; padding:12px; border:1px solid #e3e7f0; border-radius:8px; background:white; text-align:left; }
.category-choice[aria-pressed=true] { background:#efedff; color:#6555d4; border-color:#8a7bea; }
.category-list { max-height:500px; overflow-y:auto; }
.category-image { display:block; max-width:100%; max-height:180px; object-fit:contain; margin:12px 0; }
#catRoot button { cursor:pointer; }
#catRoot button:not(.primary-button):not(.category-choice) { font:inherit; padding:9px 13px; border:1px solid #dce2ed; border-radius:8px; background:#fff; color:#4b5565; }
#catRoot button:not(.primary-button):hover { border-color:#8a7bea; }
#catRoot label.gp-group-row { display:flex; flex-direction:row; align-items:center; }
#catRoot input[type=checkbox] { width:16px; height:16px; flex:none; }
#catRoot #catAll { display:inline-block; margin-right:8px; }
#catRoot button:disabled { cursor:not-allowed; opacity:.5; }
#catRoot .teacher-part small { overflow-wrap:anywhere; }
#catStatus, #catJob { white-space:pre-wrap; overflow-wrap:anywhere; }
@media(max-width:850px){.category-layout{grid-template-columns:minmax(0,1fr)}}
.gp-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; margin: 20px 0; }
.gp-box { min-width: 0; padding: 18px; border: 1px solid #e3e7f0; border-radius: 12px; }
.gp-box h3 { margin: 0 0 14px; font-size: 16px; }
.gp-box h3 span { font-size: 13px; color: #7465d9; }
.gp-list { max-height: 430px; overflow-y: auto; }
.gp-group-row { display:flex; align-items:center; gap:12px; padding:12px 2px; border-bottom:1px solid #edf0f5; }
.gp-group-row span { flex:1; min-width:0; overflow-wrap:anywhere; white-space:pre-wrap; }
.gp-group-row input { flex:none; accent-color:#7161e7; }
.gp-actions, .gp-footer { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:14px 0; }
.gp-footer { justify-content:space-between; padding:16px; border-radius:10px; background:#f4f1ff; }
.gp-saved { margin-top:22px; }
#gpStatus { white-space:pre-wrap; overflow-wrap:anywhere; color:#5140ae; }
@media(max-width:760px){ .gp-columns{grid-template-columns:minmax(0,1fr)} .gp-editor{padding:14px} .gp-footer button{width:100%} }
.teacher-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.teacher-heading h1 { font-size: 28px; margin: 5px 0 10px; }
.teacher-heading p, .teacher-card small { color: #7f8da6; }
.teacher-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.teacher-layout > .teacher-card { min-width: 0; margin-bottom: 0; }
.teacher-layout { margin-bottom: 20px; }
.teacher-targets { grid-column: 1; grid-row: 1; }
.teacher-script-card { grid-column: 1 / -1; grid-row: 2; }
.teacher-wide-card { grid-column: 1 / -1; }
.teacher-card { background: #fff; border: 1px solid #e6ebf3; border-radius: 16px; margin-bottom: 20px; overflow: hidden; box-shadow: 0 5px 18px #24375904; }
.teacher-card > h2, .teacher-card > summary { padding: 20px 24px; margin: 0; font-size: 17px; font-weight: 700; border-bottom: 1px solid #edf0f5; }
.teacher-card > summary { cursor: pointer; }
.teacher-card summary small { font-weight: 400; margin-left: 10px; }
.teacher-body { padding: 22px 24px; }
.teacher-page label { display: grid; gap: 8px; font-size: 13px; color: #5c6980; margin: 10px 0; }
.teacher-page input:not([type=checkbox]):not([type=file]), .teacher-page select, .teacher-page textarea { width: 100%; padding: 10px 12px; border: 1px solid #dfe5f0; border-radius: 8px; background: #fff; color: #26344e; font: inherit; box-sizing: border-box; }
.teacher-page textarea { line-height: 1.65; resize: vertical; }
.teacher-page input:focus, .teacher-page textarea:focus, .teacher-page select:focus { outline: 2px solid #8075ee; outline-offset: 1px; }
.teacher-page textarea[readonly] { background: #f6f8fc; }
.teacher-inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.teacher-inline select { flex: 1; min-width: 120px; }
.teacher-inline label { flex: 1; min-width: 130px; }
.teacher-inline button, .teacher-page .teacher-saved button { margin: 2px; white-space: normal; }
.teacher-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 18px; }
.teacher-note, .teacher-warning { padding: 10px 12px; background: #f3f6fc; border-radius: 8px; font-size: 13px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.teacher-warning { color: #975323; background: #fff6e9; }
.teacher-warning:empty { display: none; }
.teacher-good { color: #16865e; }
.teacher-queue { padding: 0; list-style: none; }
.teacher-queue li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border: 1px solid #e3e8f1; border-radius: 9px; margin: 8px 0; cursor: grab; }
.teacher-queue strong { flex: 1; overflow-wrap: anywhere; font-size: 13px; }
.teacher-position { padding: 6px 9px; background: #f0edff; color: #6959dd; border-radius: 6px; }
.teacher-paste { min-height: 290px; }
.teacher-part { border: 1px solid #e4e8f2; padding: 14px; border-radius: 10px; margin: 14px 0; }
.teacher-part .teacher-inline { margin-top: 0; }
.teacher-part .teacher-inline span { flex: 1; color: #8290a5; }
.teacher-part > label { display: flex; align-items: center; flex-wrap: wrap; }
.teacher-part input { max-width: 90px; }
.teacher-script-columns { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.teacher-source, .teacher-english-preview { min-width: 0; border: 1px solid #e4e8f2; border-radius: 9px; padding: 14px; }
.teacher-source > h3, .teacher-english-preview > h3 { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: #35425b; }
.teacher-source h3 small, .teacher-english-preview h3 small { display: block; margin-top: 6px; font-size: 12px; font-weight: 400; color: #697790; }
.teacher-source .teacher-paste { min-height: 420px; }
.teacher-script-workspace { display: grid; grid-template-columns: minmax(0,1fr); gap: 14px; align-items: start; scroll-margin-top: 100px; }
.teacher-outline { min-width: 0; max-height: 240px; overflow-y: auto; border: 1px solid #e4e8f2; border-radius: 10px; background: #fff; }
.teacher-outline-heading { display: flex; flex-wrap: wrap; justify-content: space-between; padding: 10px 12px; color: #44516b; background: #f8f9fc; }
.teacher-outline-heading small { font-size: 12px; color: #697790; }
.teacher-outline-row { width: 100%; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 8px; text-align: left; background: #fff; border: 0; border-top: 1px solid #e4e8f2; border-radius: 0; padding: 11px 12px; font: inherit; cursor: pointer; color: #33415b; }
.teacher-outline-row[aria-pressed="true"] { background: #f0edff; box-shadow: inset 3px 0 #7562e6; }
.teacher-outline-row:hover { background: #f7f5ff; }
.teacher-outline-number { font-size: 12px; color: #65718c; font-variant-numeric: tabular-nums; }
.teacher-outline-content { min-width: 0; }
.teacher-outline-content strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.teacher-outline-content small { display: block; color: #697790; margin-top: 4px; font-size: 12px; }
.teacher-outline-row > span:last-child { font-size: 12px; }
.teacher-outline-error { color: #975323; }
.teacher-part-editor { min-width: 0; }
.teacher-part-editor .teacher-part { margin: 0; }
.teacher-part-editor textarea { font-weight: 700; min-height: 210px; }
.teacher-part-editor .teacher-inline span { color: #697790; overflow-wrap: anywhere; }
.teacher-part-editor .teacher-part > label[for] { display: block; }
.teacher-part-actions { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid #edf0f5; padding-top: 12px; margin-top: 12px; }
.teacher-preview-part > h3 { font-size: 13px; color: #52617b; margin: 0 0 8px; }
@media(max-width:900px) { .teacher-script-columns { grid-template-columns: minmax(0,1fr); } }
.teacher-page blockquote { border-left: 3px solid #7965e7; background: #f7f5ff; margin: 16px 0; padding: 15px; font-weight: 700; white-space: pre-wrap; overflow-wrap: anywhere; }
.teacher-confirm { grid-column: 1 / -1; grid-row: auto; border: 2px solid #bcb2fb; }
.teacher-confirm > h2 { background: #f4f1ff; color: #5140b9; }
.teacher-start-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px; }
.teacher-start-actions button { flex: 1 1 240px; min-height: 54px; margin: 0; font-size: 16px; font-weight: 700; }
#teacherCommit { background: #6652dc; color: #fff; border: 1px solid #6652dc; border-radius: 10px; }
#teacherCommit:disabled { opacity: .6; cursor: not-allowed; }
#teacherActionStatus:empty { display: none; }
.teacher-confirm .teacher-check { display: flex; align-items: flex-start; }
.teacher-check input { accent-color: #7662eb; flex: none; }
.teacher-preview-part { padding: 12px 0; border-top: 1px solid #e6ebf3; overflow-wrap: anywhere; }
#teacherFinalPreview { max-height: 420px; overflow-y: auto; margin-top: 18px; }
.teacher-group-list { max-height: 340px; overflow-y: auto; }
.teacher-group-count { color: #6554d9; background: #f0edff; border: 1px solid #ddd5ff; border-radius: 8px; padding: 10px 12px; margin: 8px 0; font-size: 15px; font-weight: 700; }
.teacher-group-list .teacher-check { display: flex; align-items: center; padding: 8px; background: #f8f9fd; }
.teacher-group-list small { display: block; margin-top: 3px; }
.teacher-saved { padding: 14px 0; border-bottom: 1px solid #e8ecf4; }
.teacher-saved p { font-size: 13px; overflow-wrap: anywhere; }
.teacher-progress-bar { display: flex; height: 12px; overflow: hidden; border-radius: 8px; background: #e8edf5; }
.teacher-bar-success { background: #50bd99; }.teacher-bar-failed { background: #ef7c7c; }.teacher-bar-unknown { background: #e9b64c; }.teacher-bar-pending { background: #cad3e2; }
@media(max-width:1100px) { .teacher-layout { grid-template-columns: minmax(0,1fr); }.teacher-confirm { grid-column: 1; grid-row: auto; }.teacher-page { padding: 16px; } }
@media(max-width:650px) { .teacher-grid { grid-template-columns: minmax(0,1fr); }.teacher-body { padding: 16px; }.teacher-heading { align-items: flex-start; flex-direction: column; } }
.gp-group-row.gp-identity-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px 12px; align-items: start; }
.gp-identity-row > span { min-width: 0; overflow-wrap: anywhere; }
.gp-identity-controls { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.gp-identity-controls select { flex: 1 1 280px; min-width: 0; max-width: 100%; }
.gp-identity-controls button { flex: 0 0 auto; }

.teacher-preview-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Dashboard attention rows are buttons: keep them full-width, left-aligned list rows. */
.compact-list-item.text-button { display: flex; width: 100%; min-height: 0; justify-content: flex-start; border-radius: 0; color: inherit; font-weight: inherit; text-align: left; }
.compact-list-item.text-button:hover { background: var(--blue-soft); }
/* Account switcher: phone number and status share the second line under the full-width name. */
.chat-account-subline { display: flex; min-width: 0; align-items: center; gap: 6px; }
.chat-account-subline .chat-account-telegram-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--muted); font-weight: 500; }
.chat-account-subline .account-switch-status { flex: 0 0 auto; font-size: 12px; font-weight: 600; }
/* Pull sub-nav: the ::after pseudo-element draws the dot; the empty span only stole half the row. */
.broadcast-subdot { display: none; }
/* Reaction form: live link check and execution summary. */
.reaction-link-summary { display: block; margin-top: 6px; }
.reaction-link-summary.is-warning { color: #c63f51; }
.reaction-plan { margin: 4px 0 14px; padding: 11px 14px; border: 1px solid #dfe3f8; border-radius: 10px; background: #f5f6ff; color: #3f4a8a; font-size: 13px; line-height: 1.6; }
.reaction-plan.is-warning { border-color: #f2bbc2; background: #fff5f6; color: #b93a4a; }
.reaction-plan.is-removing { border-color: #f5d49a; background: #fff8ea; color: #8a5a0b; }/* Reaction: chats the pasted links belong to, and the group-matching assignment preview. */
.reaction-chat-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.reaction-chat-caption { color: #697587; font-size: 12px; }
.reaction-chat-chip { padding: 3px 9px; border: 1px solid #dfe3f8; border-radius: 999px; background: #f5f6ff; color: #3f4a8a; font-size: 12px; }
.reaction-matching { margin: 4px 0 14px; padding: 14px 16px; border: 1px solid #dfe3f8; border-radius: 12px; background: #fafbff; }
.reaction-matching-head { margin-bottom: 10px; }
.reaction-matching-head strong { color: #3f4a8a; }
.reaction-membership-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 42px; }
.reaction-membership-row .field-help.is-warning, #reactionMembershipStatus.is-warning { color: #c63f51; }
.reaction-assign-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.reaction-assignment { margin-top: 12px; }
.reaction-assignment.is-stale { opacity: .5; }
.reaction-assign-summary { margin: 0 0 8px; color: #3f4a8a; font-size: 13px; }
.reaction-assign-table td { vertical-align: top; }
.pill.reaction-status-ok { background: #e8f7f0; color: #11794f; }
.pill.reaction-status-short { background: #fff4df; color: #8a5a0b; }
.pill.reaction-status-skipped { background: #fff1f3; color: #b93a4a; }
.reaction-assign-details { margin-top: 10px; font-size: 13px; }
.reaction-assign-details summary { cursor: pointer; color: #5054d7; }
.reaction-assign-details li { margin: 6px 0; }
.reaction-assign-details li .account-secondary { display: block; }
.reaction-assign-details em { color: #b93a4a; font-style: normal; }
/* Job forms: click-to-toggle account chips replacing the Ctrl-click native multi-select. */
.job-account-select[hidden] { display: none !important; }
.job-account-picker { display: grid; gap: 8px; margin-top: 8px; }
.job-account-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; padding: 2px; }
.job-account-chip { display: flex; min-width: 0; min-height: 48px; align-items: center; gap: 9px; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: #ffffff; color: var(--text); text-align: left; cursor: pointer; }
.job-account-chip:hover { border-color: #aeb8c7; background: #f6f7fa; }
.job-account-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.job-account-chip.is-selected { border-color: var(--blue); background: #eef0ff; box-shadow: inset 0 0 0 1px rgba(100, 102, 233, .25); }
.job-account-chip-check { display: inline-flex; flex: 0 0 18px; height: 18px; align-items: center; justify-content: center; border: 1.5px solid #aeb8c7; border-radius: 5px; background: #ffffff; }
.job-account-chip.is-selected .job-account-chip-check { border-color: var(--blue); background: var(--blue); }
.job-account-chip.is-selected .job-account-chip-check::after { width: 5px; height: 9px; border: solid #ffffff; border-width: 0 2px 2px 0; content: ""; transform: translate(0, -1px) rotate(45deg); }
.job-account-chip-copy { display: flex; min-width: 0; flex-direction: column; }
.job-account-chip-copy strong { overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.job-account-chip-copy small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.job-account-empty { grid-column: 1 / -1; margin: 0; padding: 10px; color: var(--muted); }