:root {
  /* Design.md warm editorial system */
  --bg: #f5f4ed;
  --card: #faf9f5;
  --surface: #ffffff;
  --surface-raised: rgba(250,249,245,.94);
  --surface-muted: #f0eee6;
  --hover: #efe9dd;
  --border: #e8e6dc;
  --border-strong: #d1cfc5;
  --text: #141413;
  --muted: #5e5d59;
  --muted-strong: #4d4c48;
  --accent: #c96442;
  --accent-hover: #b55637;
  --accent-soft: #f3e4da;
  --brand-grad: linear-gradient(135deg, #f5f4ed 0%, #efe8dc 52%, #eaded2 100%);
  --brand-grad-h: linear-gradient(90deg, #c96442, #d97757);
  --green: #4f7d5a;
  --red: #b53333;
  --orange: #b96a3a;
  --info: #3898ec;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --font-serif: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  --shadow: 0 0 0 1px rgba(209,207,197,.66), 0 8px 26px rgba(20,20,19,.045);
  --shadow-md: 0 0 0 1px rgba(209,207,197,.76), 0 18px 48px rgba(20,20,19,.08);
  --shadow-sm: 0 0 0 1px rgba(209,207,197,.6), 0 4px 16px rgba(20,20,19,.035);
  --shadow-lg: 0 0 0 1px rgba(209,207,197,.82), 0 28px 86px rgba(20,20,19,.14);
  --nav-bg: rgba(250,249,245,.92);
  --nav-text: #141413;
  --nav-border: #e8e6dc;
  --app-header-height: 56px;
  --app-rail-width: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-sans); background: var(--bg); color: var(--text); min-height: 100vh; font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }

/* ── Navbar ── */
#app-header { position: sticky; top: 0; z-index: 90; }
body.has-app-rail {
  padding-left: 68px;
}
body.has-app-rail #app-header {
  width: calc(100% + 68px);
  margin-left: -68px;
}
.sa-app-rail {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: 68px;
  height: 100dvh;
  padding: 72px 10px 12px;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(circle at 48% 0%, rgba(201,100,66,.09), transparent 34%),
    linear-gradient(180deg, rgba(250,249,245,.98), rgba(245,244,237,.98));
  box-shadow: 8px 0 28px rgba(20,20,19,.045);
}
.sa-rail-item {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted-strong);
  text-decoration: none;
}
button.sa-rail-item {
  font: inherit;
  cursor: pointer;
}
.sa-rail-search {
  border-color: rgba(201,100,66,.24);
  background: rgba(255,255,255,.74);
  color: var(--accent);
}
.sa-rail-search::after {
  content: '';
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(201,100,66,.68);
}
.sa-rail-group {
  display: grid;
  gap: 7px;
  justify-items: center;
}
.sa-rail-group.bottom {
  align-self: end;
}
.sa-rail-spacer {
  min-height: 12px;
}
.sa-rail-item {
  background: transparent;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease, color .14s ease, border-color .14s ease;
}
.sa-rail-item:hover {
  border-color: rgba(209,207,197,.72);
  background: rgba(255,255,255,.62);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.sa-rail-item.active {
  border-color: rgba(201,100,66,.38);
  background: #fff;
  color: var(--accent);
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 0 0 1px rgba(201,100,66,.13),
    0 10px 24px rgba(20,20,19,.07);
}
.sa-rail-item .icon {
  width: 20px;
  height: 20px;
}
.sa-rail-label {
  display: none;
}
.sa-rail-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #faf9f5;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.sa-rail-badge[hidden] {
  display: none;
}
.sa-rail-backdrop {
  display: none;
}
.global-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: grid;
  place-items: start center;
  padding: 64px 24px 24px calc(var(--app-rail-width) + 24px);
  background: rgba(20,20,19,.18);
  backdrop-filter: blur(8px);
}
.global-search-overlay[hidden] {
  display: none;
}
.global-search-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(820px, 100%);
  max-height: min(720px, calc(100dvh - 96px));
  overflow: hidden;
  border: 1px solid rgba(209,207,197,.9);
  border-radius: 16px;
  background: rgba(255,253,248,.98);
  box-shadow: 0 28px 90px rgba(20,20,19,.18);
}
.global-search-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.global-search-head .icon {
  width: 20px;
  height: 20px;
  color: var(--accent);
}
.global-search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 760;
}
.global-search-input::placeholder {
  color: var(--muted);
  font-weight: 650;
}
.global-search-head kbd {
  min-width: 38px;
  padding: 4px 8px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  text-align: center;
}
.global-search-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.global-search-filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.global-search-filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font: inherit;
  font-size: .74rem;
  font-weight: 820;
  white-space: nowrap;
  cursor: pointer;
}
.global-search-filter:hover,
.global-search-filter.active {
  border-color: rgba(201,100,66,.32);
  background: var(--accent-soft);
  color: var(--accent);
}
.global-search-results {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 240px;
  overflow: auto;
  padding: 10px;
}
.global-search-result {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.global-search-result:hover,
.global-search-result.active {
  border-color: rgba(201,100,66,.22);
  background: rgba(255,248,238,.78);
}
.global-search-result-kind {
  align-self: start;
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(20,20,19,.06);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 860;
}
.global-search-result-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.global-search-result-main strong,
.global-search-result-main small,
.global-search-snippet {
  min-width: 0;
  overflow-wrap: anywhere;
}
.global-search-result-main strong {
  color: var(--text);
  font-size: .88rem;
  font-weight: 880;
}
.global-search-result-main small {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 720;
}
.global-search-snippet {
  color: var(--muted-strong);
  font-size: .8rem;
  line-height: 1.5;
}
.global-search-mark {
  border-radius: 3px;
  background: rgba(244,194,96,.42);
  color: inherit;
  padding: 0 1px;
}
.global-search-empty,
.global-search-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 48px 18px;
  color: var(--muted);
  text-align: center;
}
.global-search-empty .icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.global-search-empty strong {
  color: var(--text);
  font-size: .95rem;
  font-weight: 880;
}
.global-search-empty p {
  max-width: 28rem;
  margin: 0;
  font-size: .82rem;
}
.navbar { display: flex; align-items: center; padding: 0 24px; height: 54px; background: var(--nav-bg); color: var(--nav-text); gap: 18px; border-bottom: 1px solid var(--nav-border); }
.nav-brand { display: flex; align-items: center; gap: 8px; }
.brand-text { font-size: 16px; font-weight: 600; letter-spacing: -.01em; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 1.2em; cursor: pointer; padding: 4px 8px; }
.nav-rail-toggle {
  display: none;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  cursor: pointer;
}
.nav-rail-toggle .icon {
  width: 19px;
  height: 19px;
}
.nav-links { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; overflow: visible; }
.nav-link { color: var(--muted); padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: color .15s, background .15s; }
.nav-link:hover { color: var(--accent); }
.nav-link.active { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.nav-link.has-count { color: var(--accent); }
.nav-group {
  position: relative;
  flex: 0 0 auto;
}
.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: color .15s, background .15s, border-color .15s;
}
.nav-group-trigger .icon {
  width: 12px;
  height: 12px;
  transition: transform .15s ease;
}
.nav-group.open .nav-group-trigger .icon {
  transform: rotate(180deg);
}
.nav-group.open .nav-group-trigger {
  color: var(--text);
  background: rgba(232,230,220,.58);
}
.nav-group.active .nav-group-trigger {
  color: var(--text);
  background: var(--surface-muted);
  border-color: rgba(209,207,197,.72);
  box-shadow: 0 1px 0 rgba(255,255,255,.72) inset;
}
.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 120;
  display: none;
  gap: 4px;
  width: 260px;
  padding: 8px;
  border: 1px solid rgba(209,207,197,.82);
  border-radius: 14px;
  background: rgba(250,249,245,.98);
  box-shadow: 0 16px 42px rgba(20,20,19,.12);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
}
.nav-group.open .nav-menu {
  display: grid;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.nav-group:nth-last-child(-n + 2) .nav-menu {
  right: 0;
  left: auto;
}
.nav-menu-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
}
.nav-menu-item:hover,
.nav-menu-item.active {
  border-color: rgba(209,207,197,.72);
  background: var(--surface-muted);
}
.nav-menu-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.nav-menu-copy strong,
.nav-menu-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-menu-copy strong {
  font-size: 13px;
  font-weight: 800;
}
.nav-menu-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}
.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  margin-left: 5px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}
.nav-count[hidden] { display: none; }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.nav-trial-entry { border-color: rgba(203,94,61,.32); color: var(--accent); background: rgba(203,94,61,.08); }
.nav-trial-entry:disabled { opacity: .72; cursor: default; }
.nav-help { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 5px 12px; border-radius: 999px; color: var(--muted); font-size: 13px; font-weight: 600; transition: background .15s, color .15s; }
.nav-help:hover, .nav-help.active { background: var(--accent-soft); color: var(--accent); }
.nav-help .icon { width: 15px; height: 15px; }
.user-name { font-size: 13px; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-avatar-slot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 auto; }
.user-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; background: var(--brand-grad); color: #fff; font-size: 12px; font-weight: 700; }

/* ── Notification Bell ── */
.notify-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.notify-bell:hover { background: var(--hover); color: var(--text); }
.notify-bell.has-alert { color: var(--accent); }
.notify-bell .icon { width: 18px; height: 18px; }
.notify-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}
.notify-badge[hidden] { display: none; }
.notify-panel {
  position: fixed;
  z-index: 100;
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  display: none;
  flex-direction: column;
}
.notify-panel.open { display: flex; }
.notify-list { flex: 1; overflow-y: auto; padding: 6px; }
.notify-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: background .15s;
  gap: 12px;
}
.notify-item:hover { background: var(--hover); }
.notify-item-primary {
  border: 1px solid rgba(201,100,66,.18);
  background: rgba(255,248,238,.78);
}
.notify-item-label { font-size: 13px; font-weight: 500; flex: 1; }
.notify-item-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.notify-footer {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.notify-empty, .notify-summary {
  font-size: 13px;
  color: var(--muted);
}
.notify-empty {
  color: var(--accent);
  text-decoration: none;
  font-weight: 750;
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 20px; border: 1px solid #ddd; border-radius: 8px; background: #fff; color: #666; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .2s, border-color .2s, color .2s, background .2s; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--brand-grad); color: #fff; border: none; }
.btn-primary:hover { background: var(--brand-grad); color: #fff; opacity: .85; border: none; }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; opacity: .92; }
.btn-sm { padding: 4px 12px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn:disabled:hover { opacity: .5; border-color: #ddd; color: #666; }
.btn-primary:disabled:hover { background: var(--brand-grad); color: #fff; opacity: .5; }

/* ── Icons ── */
.icon { width: 1em; height: 1em; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; color: currentColor; }
.icon svg { width: 100%; height: 100%; display: block; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm .icon { width: 14px; height: 14px; }
.toolbar-btn .icon,
.chat-icon-btn .icon,
.modal-close .icon,
.toast-close .icon,
.lightbox-close .icon { width: 18px; height: 18px; }
.screen-placeholder-icon .icon,
.guide-icon .icon { width: 1.1em; height: 1.1em; }
.mobile-tab .icon { width: 19px; height: 19px; margin: 0 auto 2px; }
.quick-task-icon { width: 15px; height: 15px; color: var(--muted); }
.acc-avatar .icon { width: 24px; height: 24px; }
.dev-flag .icon,
.platform-chip .icon,
.cc-media-badge .icon { width: 13px; height: 13px; }
.task-item-icon .icon,
.step-ic .icon { width: 18px; height: 18px; }

/* ── Forms ── */
input, select, textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; width: 100%; background: var(--card); color: var(--text); transition: border-color .2s; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
label { display: block; font-size: 12px; font-weight: 500; margin-bottom: 6px; color: var(--muted); }
.form-group { margin-bottom: 16px; }

/* ── Filter bar ── */
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-bar select, .filter-bar input { width: auto; min-width: 0; max-width: 180px; padding: 5px 10px; font-size: .78em; border-radius: 20px; background: var(--card); border: 1px solid var(--border); appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2386868b'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 26px; cursor: pointer; }
.filter-bar select:focus, .filter-bar input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(102,126,234,.1); }
.filter-bar .filter-sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.filter-bar .filter-label { font-size: .75em; color: var(--muted); font-weight: 500; white-space: nowrap; }

/* ── Cards ── */
.card { background: var(--card); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }

/* ── Login ── */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: var(--brand-grad); }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px 28px; }
.login-title { font-size: 18px; font-weight: 600; text-align: center; margin-bottom: 24px; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
.login-tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid #f0f0f0; }
.login-tab { flex: 1; text-align: center; padding: 10px; cursor: pointer; font-size: 14px; color: #999; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color .2s, border-color .2s; }
.login-tab:hover { color: var(--accent); }
.login-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.login-error { background: #fff2f0; color: var(--red); padding: 10px 14px; border: 1px solid #ffccc7; border-radius: 8px; font-size: 13px; margin-bottom: 12px; display: none; }

/* ── Console layout ── */
.console-layout { display: flex; flex-direction: column; height: calc(100vh - 48px); }

/* ── Center area ── */
.center-area { display: flex; flex-direction: column; flex: 1; overflow: hidden; background: var(--bg); }

/* ── Phone toolbar ── */
.phone-toolbar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.toolbar-group { display: flex; align-items: center; gap: 4px; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.toolbar-btn { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 8px; background: transparent; font-size: 1em; cursor: pointer; transition: background .12s; color: var(--text); }
.toolbar-btn:hover { background: var(--bg); }
.toolbar-btn:active { background: #e0e0e5; }
.toolbar-btn-sm { width: 28px; height: 28px; font-size: .85em; }
.toolbar-input { flex: 1; max-width: 280px; position: relative; }
.toolbar-text { padding: 6px 36px 6px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .82em; height: 34px; }
.toolbar-send { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; font-size: .9em; color: var(--accent); font-weight: 700; }
.device-upload-status { max-width: 180px; color: var(--muted); font-size: .72em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.device-upload-status.ok { color: #52c41a; }
.device-upload-status.err { color: #ff4d4f; }

/* ── Phone row ── */
.phone-row { display: flex; flex: 1; overflow: hidden; }

/* ── Phone screen ── */
.phone-area { display: flex; justify-content: center; align-items: center; padding: 16px; flex: 1; min-height: 300px; overflow: hidden; }
.phone-frame { background: #1a1a1a; border-radius: 32px; padding: 10px 8px; box-shadow: var(--shadow-md), 0 0 0 1px rgba(0,0,0,.1); max-height: 100%; }
.phone-notch { width: 72px; height: 4px; background: #333; border-radius: 2px; margin: 0 auto 6px; opacity: .4; }
.screen-wrap { position: relative; overflow: hidden; border-radius: 22px; }
.screen-wrap.device-drop-active { outline: 3px dashed #c7d2fe; outline-offset: 6px; background: #f0f3ff; }
.screen-wrap img { display: block; max-height: calc(100vh - 180px); width: auto; cursor: crosshair; border-radius: 22px; }
.screen-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 260px; height: min(560px, calc(100vh - 220px)); background: #222; border-radius: 22px; color: #666; gap: 8px; }
.screen-placeholder-icon { font-size: 2.2em; opacity: .4; }
.screen-placeholder-text { font-size: .82em; opacity: .5; }

/* ── Node overlay ── */
.node-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; border-radius: 22px; overflow: hidden; }
.node-overlay.active { pointer-events: auto; }
.node-rect { position: absolute; border: 1.5px solid rgba(102,126,234,.5); background: rgba(102,126,234,.06); cursor: pointer; transition: background .1s; }
.node-rect:hover { background: rgba(102,126,234,.2); border-color: rgba(102,126,234,.8); }
.node-rect-label { position: absolute; bottom: 100%; left: 0; background: rgba(29,29,31,.88); color: #fff; font-size: 10px; padding: 2px 6px; border-radius: 4px; white-space: nowrap; pointer-events: none; display: none; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.node-rect:hover .node-rect-label, .node-rect-active .node-rect-label { display: block; }
.node-rect-active { background: rgba(102,126,234,.25) !important; border-color: var(--accent) !important; }

/* ── Nodes panel ── */
.nodes-panel { width: 260px; flex-shrink: 0; background: var(--card); border-left: 1px solid var(--border); display: none; flex-direction: column; }
.nodes-panel.open { display: flex; }
.nodes-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.nodes-panel-title { font-size: .82em; font-weight: 600; color: var(--muted); }
.nodes-list { flex: 1; overflow-y: auto; }

/* ── Sidebar ── */
.sidebar { background: var(--card); overflow-y: auto; }
.panel { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.panel-grow { flex: 1; display: flex; flex-direction: column; }
.panel-title { font-size: .75em; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }

/* ── Chat ── */
.chat-area { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.chat-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.chat-header h3 { font-size: .88em; font-weight: 600; color: var(--text); }
.chat-header-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.chat-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.chat-icon-btn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--muted); cursor: pointer; transition: background .12s, border-color .12s, color .12s, box-shadow .12s; }
.chat-icon-btn:hover, .chat-icon-btn.active { background: #f0f3ff; border-color: #c7d2fe; color: #667eea; box-shadow: 0 1px 4px rgba(102,126,234,.08); }
.chat-icon-btn-sm { width: 26px; height: 26px; border-radius: 8px; font-size: .78em; }
.conv-popover { display: none; position: absolute; top: 58px; right: 12px; width: min(360px, calc(100% - 24px)); max-height: min(420px, calc(100% - 96px)); z-index: 20; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; flex-direction: column; }
.conv-popover.open { display: flex; }
.conv-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .78em; font-weight: 700; letter-spacing: .04em; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: .82em; line-height: 1.5; word-break: break-word; white-space: normal; }
.chat-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.chat-ai { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.chat-card-msg { padding: 0; background: transparent; white-space: normal; max-width: 94%; }
.ai-card { width: min(360px, 100%); background: linear-gradient(180deg, #fff 0%, #f8fafc 100%); border: 1px solid #e5e7eb; border-radius: 16px; box-shadow: 0 6px 22px rgba(15,23,42,.07); overflow: hidden; }
.ai-card-head { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px 10px; }
.ai-card-icon { width: 30px; height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 10px; background: #f0f3ff; color: #667eea; font-weight: 700; font-size: .78em; }
.ai-card-confirm .ai-card-icon { background: #fff7e6; color: #fa8c16; }
.ai-card-running .ai-card-icon { background: #f6ffed; color: #52c41a; }
.ai-card-title-wrap { min-width: 0; flex: 1; }
.ai-card-title { font-weight: 700; font-size: .98em; color: var(--text); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; }
.ai-card-subtitle { margin-top: 2px; color: var(--muted); font-size: .78em; line-height: 1.35; }
.ai-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 14px 10px; }
.ai-card-meta-item { min-width: 0; padding: 7px 9px; border-radius: 10px; background: #f1f5f9; }
.ai-card-meta-item span { display: block; color: var(--muted); font-size: .72em; margin-bottom: 1px; }
.ai-card-meta-item strong { display: block; color: var(--text); font-size: .82em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-card-desc { position: relative; margin: 0 14px 10px; padding: 10px 11px; background: #fff; border: 1px solid #eef2f7; border-radius: 12px; color: var(--text); font-size: .88em; line-height: 1.6; }
.ai-card-desc-body { white-space: normal; overflow: hidden; }
.ai-card-desc.collapsible.collapsed .ai-card-desc-body { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; max-height: 6.4em; }
.ai-card-desc.collapsible.collapsed::after { content: ''; position: absolute; left: 11px; right: 11px; bottom: 32px; height: 26px; pointer-events: none; background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 85%); border-radius: 0 0 12px 12px; }
.ai-card-desc-toggle { display: block; margin-top: 6px; padding: 2px 0; background: none; border: 0; color: var(--accent); font-size: .8em; cursor: pointer; font-weight: 600; }
.ai-card-desc-toggle:hover { text-decoration: underline; }

/* ── Markdown-rendered content ── */
.ai-card-body p, .ai-card-desc-body p,
.channel-message-text p, .thread-message-content p,
.chat-msg p { margin: 0 0 .5em; }
.ai-card-body p:last-child, .ai-card-desc-body p:last-child,
.channel-message-text p:last-child, .thread-message-content p:last-child,
.chat-msg p:last-child { margin-bottom: 0; }
.ai-card-body strong, .ai-card-desc-body strong,
.channel-message-text strong, .thread-message-content strong,
.chat-msg strong { font-weight: 700; color: var(--text); }
.ai-card-body em, .ai-card-desc-body em,
.channel-message-text em, .thread-message-content em,
.chat-msg em { font-style: italic; }
.ai-card-body del, .ai-card-desc-body del,
.channel-message-text del, .thread-message-content del,
.chat-msg del { text-decoration: line-through; opacity: .7; }
.ai-card-body code, .ai-card-desc-body code,
.channel-message-text code, .thread-message-content code,
.chat-msg code { padding: 1px 5px; border-radius: 4px; background: #f1f5f9; color: #e45649; font-size: .88em; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace; }
.ai-card-body pre, .ai-card-desc-body pre,
.channel-message-text pre, .thread-message-content pre,
.chat-msg pre { margin: .5em 0; padding: 10px 12px; border-radius: 8px; background: #f8fafc; border: 1px solid #e5e7eb; overflow-x: auto; font-size: .82em; line-height: 1.5; }
.ai-card-body pre code, .ai-card-desc-body pre code,
.channel-message-text pre code, .thread-message-content pre code,
.chat-msg pre code { padding: 0; background: none; color: var(--text); font-size: inherit; }
.ai-card-body h1, .ai-card-desc-body h1,
.channel-message-text h1, .thread-message-content h1,
.chat-msg h1 { margin: .6em 0 .3em; font-size: 1.3em; font-weight: 700; }
.ai-card-body h2, .ai-card-desc-body h2,
.channel-message-text h2, .thread-message-content h2,
.chat-msg h2 { margin: .5em 0 .25em; font-size: 1.15em; font-weight: 700; }
.ai-card-body h3, .ai-card-body h4, .ai-card-body h5, .ai-card-body h6,
.channel-message-text h3, .thread-message-content h3,
.chat-msg h3 { margin: .4em 0 .2em; font-size: 1.05em; font-weight: 700; }
.ai-card-body ul, .ai-card-body ol,
.ai-card-desc-body ul, .ai-card-desc-body ol,
.channel-message-text ul, .channel-message-text ol,
.thread-message-content ul, .thread-message-content ol,
.chat-msg ul, .chat-msg ol { margin: .3em 0; padding-left: 1.4em; }
.ai-card-body li, .ai-card-desc-body li,
.channel-message-text li, .thread-message-content li,
.chat-msg li { margin-bottom: .15em; }
.ai-card-body blockquote, .ai-card-desc-body blockquote,
.channel-message-text blockquote, .thread-message-content blockquote,
.chat-msg blockquote { margin: .4em 0; padding: 6px 12px; border-left: 3px solid #e5e7eb; color: var(--muted); }
.ai-card-body hr, .ai-card-desc-body hr,
.channel-message-text hr, .thread-message-content hr,
.chat-msg hr { margin: .6em 0; border: 0; border-top: 1px solid #eef2f7; }
.ai-card-body a, .ai-card-desc-body a,
.channel-message-text a, .thread-message-content a,
.chat-msg a { color: var(--accent); text-decoration: underline; }
.ai-card-body img, .ai-card-desc-body img,
.channel-message-text img, .thread-message-content img,
.chat-msg img { max-width: 100%; border-radius: 8px; }

.ai-card-media{ display: grid; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 6px; padding: 0 14px 10px; }
.ai-card-media-item { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #f1f5f9; cursor: pointer; }
.ai-card-media-item img, .ai-card-media-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-card-media-item.loading { background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%); background-size: 200% 100%; animation: ai-card-shimmer 1.2s infinite; }
@keyframes ai-card-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ai-card-media-badge { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 999px; background: rgba(15,23,42,.7); color: #fff; font-size: .65em; line-height: 1.3; }
.ai-card-body { margin: 0 14px 12px; padding: 10px 11px; background: #fff; border: 1px solid #eef2f7; border-radius: 12px; color: #555; font-size: .86em; line-height: 1.65; white-space: normal; }
.chat-attachments { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-attach-item { position: relative; width: 72px; height: 72px; border-radius: 8px; overflow: hidden; background: #e8eaed; cursor: pointer; }
.chat-attach-item img, .chat-attach-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.chat-attach-item.loading { background: linear-gradient(90deg, #eef1f4 0%, #dde2e7 50%, #eef1f4 100%); background-size: 200% 100%; animation: ai-card-shimmer 1.2s infinite; }
.chat-attach-badge { position: absolute; right: 4px; bottom: 4px; padding: 1px 5px; border-radius: 999px; background: rgba(15,23,42,.7); color: #fff; font-size: .65em; line-height: 1.3; }
.lightbox { display: none; position: fixed; inset: 0; z-index: 1200; background: rgba(20,20,19,.88); align-items: center; justify-content: center; padding: 24px; cursor: zoom-out; backdrop-filter: blur(10px); }
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: min(94vw, 1280px); max-height: 88vh; object-fit: contain; border-radius: 14px; background: rgba(250,249,245,.08); box-shadow: 0 22px 70px rgba(0,0,0,.46); cursor: default; }
.lightbox-close { position: absolute; top: 16px; right: 20px; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 1px solid rgba(250,249,245,.2); border-radius: 999px; background: rgba(250,249,245,.12); color: #fff; font-size: 1.6em; line-height: 1; cursor: pointer; }
.ai-card-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid #eef2f7; background: rgba(255,255,255,.65); }
.ai-card-action { border: 1px solid #f0f3ff; background: #f0f3ff; color: #667eea; border-radius: 999px; padding: 5px 10px; font-size: .78em; font-weight: 600; cursor: pointer; }
.ai-card-action:hover { background: #f0f3ff; }
.ai-card-action.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.ai-card-action.primary:hover { background: var(--accent-hover); }
.ai-card-action.secondary { border-color: #e5e7eb; background: #fff; color: #64748b; }
.ai-card-action.secondary:hover { background: #f8fafc; }
.ai-card-action:disabled { cursor: not-allowed; opacity: .45; }
.ai-card-action.selected:disabled { opacity: .85; box-shadow: 0 0 0 2px rgba(102,126,234,.16); }
.chat-step { align-self: flex-start; background: #fff7e6; border: 1px solid #ffd591; border-radius: 10px; font-size: .75em; color: #fa8c16; font-family: 'SF Mono', Menlo, Consolas, monospace; }
.chat-step.ok { background: #f6ffed; border-color: #b7eb8f; color: #52c41a; }
.chat-step.fail { background: #fff2f0; border-color: #ffccc7; color: #ff4d4f; }
.chat-input { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; background: var(--card); }
.chat-input textarea { flex: 1; min-height: 36px; max-height: 80px; resize: none; border-radius: 10px; }
.conv-new-btn { justify-content: center; flex-shrink: 0; white-space: nowrap; }

/* ── Task icon animation ── */
.chat-header-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.chat-screen-sync { display: inline-flex; align-items: center; gap: 5px; margin: 0; padding: 4px 8px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); font-size: .72em; font-weight: 600; cursor: pointer; user-select: none; white-space: nowrap; background: var(--card); }
.chat-screen-sync input { width: auto; margin: 0; accent-color: var(--accent); }
.chat-screen-sync:has(input:checked) { border-color: #c7d2fe; background: #f0f3ff; color: #667eea; }
.chat-screen-sync.syncing { border-color: #b7eb8f; background: #f6ffed; color: #52c41a; }
.chat-screen-sync.waiting { border-color: #ffd591; background: #fff7e6; color: #fa8c16; }
.task-current { font-size: .74em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 28px; }
.task-monitor { padding: 10px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #f8fafc 0%, #fff 100%); }
.task-monitor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.task-monitor-title { font-size: .82em; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.task-monitor-sub { margin-top: 2px; font-size: .72em; color: var(--muted); }
.task-progress-track { height: 5px; overflow: hidden; border-radius: 999px; background: #e5e7eb; margin-bottom: 8px; }
.task-progress-bar { width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s ease; }
.task-event-list { max-height: 104px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.task-event { display: grid; grid-template-columns: 56px 1fr auto; gap: 6px; align-items: center; font-size: .72em; color: #555; }
.task-event-time { color: var(--muted); font-family: 'SF Mono', Menlo, Consolas, monospace; }
.task-event-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-event-status { color: var(--muted); font-size: .9em; }
.task-event.ok .task-event-status { color: var(--green); }
.task-event.fail .task-event-status { color: var(--red); }
.task-icon { width: 20px; height: 20px; display: none; }
.task-icon.spinning { display: block; border: 2.5px solid #f0f3ff; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.task-icon.done { display: block; width: 20px; height: 20px; background: var(--green); border-radius: 50%; position: relative; animation: pop .3s ease; }
.task-icon.done::after { content: ''; position: absolute; left: 6px; top: 3px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task-icon.failed { display: block; width: 20px; height: 20px; background: var(--red); border-radius: 50%; position: relative; animation: pop .3s ease; }
.task-icon.failed::after { content: '\00d7'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ── Step message icons ── */
.chat-step { position: relative; padding-left: 28px; }
.chat-step::before { content: ''; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; }
.chat-step.ok::before { background: var(--green); box-shadow: 0 0 0 3px rgba(52,199,89,.15); }
.chat-step.fail::before { background: var(--red); box-shadow: 0 0 0 3px rgba(255,59,48,.15); }
.step-pending { align-self: flex-start; padding: 6px 12px 6px 28px; font-size: .75em; color: var(--muted); position: relative; }
.step-pending::before { content: ''; position: absolute; left: 8px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border: 2px solid #f0f3ff; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }

/* ── Status badges (秒豹配色) ── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge-online { background: #f6ffed; color: var(--green); }
.badge-offline { background: #f5f5f5; color: #999; }
.badge-pending { background: #f5f5f5; color: #999; }
.badge-processing, .badge-info { background: #e6f7ff; color: var(--info); }
.badge-completed, .badge-success { background: #f6ffed; color: var(--green); }
.badge-failed, .badge-danger { background: #fff2f0; color: var(--red); }
.badge-warning { background: #fff7e6; color: var(--orange); }
.ts-idle { background: #f5f5f5; color: #999; }
.ts-running { background: #e6f7ff; color: var(--info); animation: pulse 2s infinite; }
.ts-done { background: #f6ffed; color: var(--green); }
.ts-failed { background: #fff2f0; color: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ── Admin ── */
.admin-layout { padding: 24px; max-width: 1680px; margin: 0 auto; }
.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.admin-sidebar-nav {
  position: sticky;
  top: 74px;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(250,249,245,.9);
  box-shadow: var(--shadow);
}
.admin-nav-kicker {
  padding: 8px 10px 12px;
  color: var(--muted);
  font-size: .76em;
  font-weight: 850;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--muted-strong);
  font-size: .9em;
  font-weight: 780;
  text-align: left;
  cursor: pointer;
}
.admin-nav-item .icon {
  width: 18px;
  height: 18px;
}
.admin-nav-item:hover {
  background: #fbf3ec;
  border-color: rgba(201,100,66,.18);
  color: var(--text);
}
.admin-nav-item.active {
  background: #fbf3ec;
  border-color: rgba(201,100,66,.32);
  color: var(--accent);
  box-shadow: 0 0 0 4px rgba(201,100,66,.08);
}
.admin-main-panel {
  min-width: 0;
}
.admin-stats { display: grid; grid-template-columns: repeat(7, minmax(112px, 1fr)); gap: 10px; margin-bottom: 20px; }
.stat-card { text-align: center; padding: 14px 10px; min-height: 86px; }
.stat-card .stat-num { font-size: 1.55em; line-height: 1.05; font-weight: 850; color: var(--accent); }
.stat-card .stat-label { margin-top: 4px; font-size: .74em; color: var(--muted); font-weight: 700; }
.stat-card .stat-today { margin-top: 6px; color: #94a3b8; font-size: .68em; font-weight: 800; }
.stat-card .stat-today.active { color: var(--green); }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 4px 0 16px; }
.admin-section-head h2 { font-size: 1.2em; margin-bottom: 4px; }
.admin-section-head p { color: var(--muted); font-size: .84em; line-height: 1.6; }
.admin-section table { min-width: 860px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.admin-user-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 750; color: #555; }
.admin-wide-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-empty-cell { color: var(--muted); text-align: center; padding: 28px 12px; }
.admin-status { display: inline-flex; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 999px; font-size: .78em; font-weight: 800; line-height: 1.2; white-space: nowrap; word-break: keep-all; writing-mode: horizontal-tb; background: var(--hover); color: var(--muted); }
.admin-status.ok { background: rgba(52,199,89,.12); color: var(--green); }
.admin-status.warn { background: rgba(255,149,0,.12); color: var(--orange); }
.admin-status.bad { background: rgba(255,59,48,.12); color: var(--red); }
.admin-status.muted { background: var(--surface-muted); color: var(--muted); }
.admin-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; align-items: stretch; }
.admin-data-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.admin-data-card:hover {
  border-color: #c9ddf5;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.admin-data-card.failed,
.admin-data-card.error { box-shadow: inset 4px 0 0 rgba(226,68,68,.85), var(--shadow); }
.admin-data-card.succeeded,
.admin-data-card.published,
.admin-data-card.online { box-shadow: inset 4px 0 0 rgba(23,160,93,.8), var(--shadow); }
.admin-data-card.publishing,
.admin-data-card.running,
.admin-data-card.queued,
.admin-data-card.partial { box-shadow: inset 4px 0 0 rgba(240,138,36,.8), var(--shadow); }
.admin-data-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.admin-data-title {
  min-width: 0;
  color: #333;
  font-size: .98em;
  font-weight: 850;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-data-sub {
  margin-top: 3px;
  color: var(--muted);
  font-size: .78em;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-data-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.admin-data-field {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf1f7;
  border-radius: 13px;
  background: #f8fafc;
}
.admin-data-field.wide { grid-column: 1 / -1; }
.admin-data-field span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .7em;
  font-weight: 800;
}
.admin-data-field strong {
  display: block;
  min-height: 18px;
  color: #444;
  font-size: .82em;
  font-weight: 760;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-data-field.wide strong {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.admin-daemon-detail-card .admin-data-field.wide strong {
  display: block;
  overflow: visible;
  text-overflow: clip;
  -webkit-line-clamp: unset;
}
.admin-data-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.admin-agent-runtime-editor {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  width: 100%;
}
.admin-agent-runtime-editor label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: .72em;
  font-weight: 800;
}
.admin-agent-runtime-editor select,
.admin-agent-runtime-editor input {
  min-width: 0;
  width: 100%;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1.08em;
}
.admin-agent-runtime-editor .btn {
  grid-column: 1 / -1;
  justify-self: flex-start;
}
.admin-empty-card {
  grid-column: 1 / -1;
  padding: 30px 16px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  text-align: center;
  font-size: .88em;
}
.admin-user-picker-card {
  width: min(680px, 100%);
}
.admin-user-picker-device {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.62);
}
.admin-user-picker-device span,
.admin-user-picker-selected span {
  color: var(--muted);
  font-size: .78em;
  font-weight: 800;
}
.admin-user-picker-device strong,
.admin-user-picker-selected strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  font-weight: 850;
}
.admin-user-picker-search {
  width: 100%;
  margin-top: 14px;
}
.admin-user-picker-selected {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fbf3ec;
  border: 1px solid rgba(201,100,66,.22);
}
.admin-user-picker-list {
  display: grid;
  gap: 8px;
  max-height: min(45vh, 390px);
  overflow: auto;
  margin-top: 12px;
  padding: 3px 2px;
}
.admin-user-picker-item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s, transform .15s;
}
.admin-user-picker-item:hover {
  border-color: rgba(201,100,66,.42);
  background: #fbf3ec;
  transform: translateY(-1px);
}
.admin-user-picker-item.active {
  border-color: rgba(79,125,90,.5);
  background: #edf7ec;
  box-shadow: 0 0 0 4px rgba(79,125,90,.12);
}
.admin-user-picker-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 900;
}
.admin-user-picker-item.active .admin-user-picker-avatar {
  background: rgba(79,125,90,.16);
  color: var(--green);
}
.admin-user-picker-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.admin-user-picker-main strong,
.admin-user-picker-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-picker-main strong {
  color: var(--text);
  font-size: .95em;
  font-weight: 850;
}
.admin-user-picker-main small {
  color: var(--muted);
  font-size: .76em;
  font-weight: 650;
}
.admin-user-picker-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
}
.admin-user-picker-check .icon {
  width: 16px;
  height: 16px;
}
.admin-user-picker-spacer {
  width: 28px;
  height: 28px;
}
.admin-user-picker-empty {
  padding: 18px 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(255,255,255,.5);
}
.admin-user-picker-clear {
  margin-right: auto;
}
.admin-miaonote-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, .9fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid #cfe2f7;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(235,247,255,.92)),
    radial-gradient(circle at 92% 18%, rgba(52,211,153,.16), transparent 18rem);
  box-shadow: var(--shadow);
}
.admin-device-setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.admin-miaonote-panel.compact,
.admin-pool-panel.compact,
.admin-package-panel.compact {
  margin-bottom: 0;
  padding: 14px;
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(39, 35, 27, .06);
}
.admin-miaonote-panel.compact {
  grid-template-columns: minmax(180px, .95fr) minmax(220px, 1fr) auto;
  gap: 12px;
}
.admin-pool-panel.compact {
  grid-template-columns: minmax(180px, 1fr) minmax(220px, .9fr) auto;
  gap: 12px;
}
.admin-package-panel.compact {
  gap: 12px;
}
.admin-miaonote-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.admin-miaonote-mark {
  width: fit-content;
  padding: 4px 9px;
  border-radius: 999px;
  background: #e5f8ee;
  color: #52c41a;
  font-size: .72em;
  font-weight: 900;
}
.admin-miaonote-copy h3 { font-size: 1.12em; margin: 0; color: #333; }
.admin-miaonote-copy p { margin: 0; color: var(--muted); font-size: .84em; line-height: 1.6; }
.admin-miaonote-status {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e4ebf5;
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  color: #666;
  font-size: .84em;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-miaonote-status.ready {
  border-color: rgba(52,199,89,.28);
  background: rgba(232,248,238,.82);
  color: #52c41a;
}
.admin-miaonote-status.missing {
  border-color: rgba(255,149,0,.24);
  background: rgba(255,247,237,.86);
  color: #b45309;
}
.admin-miaonote-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.admin-pool-panel .admin-miaonote-actions .btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.admin-pool-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .55fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(34,197,94,.22);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(240,253,244,.88)),
    radial-gradient(circle at 8% 12%, rgba(45,212,191,.14), transparent 16rem);
  box-shadow: var(--shadow);
}
.admin-pool-copy { display: grid; gap: 5px; min-width: 0; }
.admin-pool-copy h3 { font-size: 1.12em; margin: 0; color: #333; }
.admin-pool-copy p { margin: 0; color: var(--muted); font-size: .84em; line-height: 1.6; }
.admin-pool-code {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  min-height: 64px;
  padding: 10px 14px;
  border: 1px dashed rgba(100,116,139,.28);
  border-radius: 16px;
  background: rgba(248,250,252,.86);
}
.admin-pool-code span {
  grid-column: 1;
  min-width: 0;
  color: var(--muted);
  font-size: .76em;
  font-weight: 750;
}
.admin-pool-code strong {
  grid-column: 1;
  min-width: 0;
  color: #64748b;
  font-size: 1.45em;
  letter-spacing: .12em;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}
.admin-pool-code.ready {
  border-style: solid;
  border-color: rgba(34,197,94,.28);
  background: rgba(220,252,231,.62);
}
.admin-pool-code.ready strong { color: #15803d; }
.admin-pool-qr-image {
  grid-column: 1;
  justify-self: start;
  width: 84px;
  height: 84px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .12);
}
.admin-pool-qr-fallback {
  grid-column: 1;
  max-width: 100%;
  color: var(--red);
  font-size: .72em;
  line-height: 1.35;
  text-align: center;
}
.admin-package-panel { display: grid; gap: 14px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.admin-package-panel h3 { font-size: 1.05em; margin-bottom: 4px; }
.admin-package-panel p { color: var(--muted); font-size: .84em; line-height: 1.6; }
.admin-package-form { display: grid; grid-template-columns: minmax(160px, 1fr) 160px minmax(150px, 1fr) minmax(220px, 1.3fr) minmax(220px, 1.4fr) auto; gap: 10px; align-items: center; }
.admin-package-form.admin-daemon-command-actions { grid-template-columns: max-content; justify-content: start; }
.admin-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.admin-apk-upload-dialog { width: min(620px, 100%); }
.admin-apk-upload-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.admin-pricing-editor-card { width: min(760px, 100%); }
.admin-pricing-editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-form-field { display: grid; gap: 7px; color: var(--muted); font-size: .82em; font-weight: 850; }
.admin-form-field input,
.admin-form-field select,
.admin-form-field textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}
.admin-form-field textarea { min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.admin-form-field input[type="file"] { padding: 8px 10px; }
.admin-form-field.wide { grid-column: 1 / -1; }
.admin-agent-assign-dialog { width: min(680px, 100%); }
.admin-agent-assign-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.admin-agent-assign-form .admin-form-field:last-child { grid-column: 1 / -1; }
.admin-agent-assign-bulk {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.admin-agent-template-checklist {
  display: grid;
  gap: 9px;
  max-height: min(52vh, 520px);
  overflow: auto;
  padding-right: 4px;
}
.admin-agent-template-choice {
  display: grid;
  grid-template-columns: auto minmax(160px, .65fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  cursor: pointer;
}
.admin-agent-template-choice:hover {
  border-color: rgba(201,100,66,.32);
  background: #fffaf5;
}
.admin-agent-template-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}
.admin-agent-template-choice-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.admin-agent-template-choice-main strong,
.admin-agent-template-choice-main small,
.admin-agent-template-choice-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-agent-template-choice-main strong {
  color: var(--text);
  font-size: .88rem;
  font-weight: 900;
}
.admin-agent-template-choice-main small,
.admin-agent-template-choice-summary,
.admin-agent-assign-hint {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}
.admin-agent-template-editor-card {
  width: min(820px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
}
.admin-agent-template-editor-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-agent-template-editor-form .admin-form-field:nth-last-of-type(-n+2),
.admin-agent-template-editor-form .admin-email-dialog-hint {
  grid-column: 1 / -1;
}
.admin-device-detail-dialog { width: min(780px, 100%); }
.admin-device-detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.admin-device-detail-stat { display: grid; gap: 5px; min-width: 0; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(250,249,245,.86); }
.admin-device-detail-stat span { color: var(--muted); font-size: .76em; font-weight: 850; }
.admin-device-detail-stat strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: .9em; }
.admin-device-meta-stack { display: grid; gap: 6px; min-width: 0; }
.admin-proxy-status { display: inline-flex; width: fit-content; max-width: 100%; align-items: center; padding: 3px 8px; border-radius: 999px; font-size: .75rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-proxy-status.ok { color: #12643d; background: #e9f8ef; }
.admin-proxy-status.warn { color: #8a5a00; background: #fff6d8; }
.admin-proxy-status.idle { color: #6b7280; background: #f2f4f7; }
.admin-proxy-status.bad { color: #9f1f1f; background: #ffe8e8; }
.admin-proxy-test-state { display: grid; gap: 4px; justify-items: start; min-width: 0; }
.admin-proxy-test-state span:last-child { max-width: 180px; color: var(--muted); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-proxy-dialog-card { width: min(860px, 100%); max-height: min(88vh, 860px); overflow: auto; }
.admin-proxy-form { display: grid; gap: 12px; margin-top: 16px; }
.admin-proxy-form label { display: grid; gap: 6px; color: var(--muted); font-size: .82rem; font-weight: 850; }
.admin-proxy-form .sa-dialog-input { margin-top: 0; width: 100%; }
.admin-proxy-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.admin-proxy-nodes-input { min-height: 96px; resize: vertical; }
.admin-proxy-yaml-input { min-height: 260px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.45; }
.admin-proxy-rules-input { min-height: 160px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .84rem; line-height: 1.45; }
.admin-proxy-help { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
.admin-proxy-direct-editor { display: grid; gap: 12px; }
.admin-device-app-note { margin: 16px 0 10px; color: var(--muted); font-size: .84em; line-height: 1.6; }
.admin-device-app-table { min-width: 720px; }
.admin-daemon-install-compact {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: center;
  gap: 12px 16px;
  padding: 10px;
}
.admin-daemon-install-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
  min-width: 0;
}
.admin-daemon-install-copy .admin-miaonote-mark { grid-row: span 2; align-self: start; }
.admin-daemon-install-copy h3 { margin: 0; }
.admin-daemon-install-copy p { margin: 0; }
.admin-daemon-install-primary {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.admin-daemon-package-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.admin-daemon-table { min-width: 1160px; }
.admin-device-table { min-width: 1120px; }
.admin-daemon-name,
.admin-daemon-muted {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.admin-daemon-name strong,
.admin-daemon-muted strong {
  min-width: 0;
  color: #333;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-daemon-name span,
.admin-daemon-muted span {
  min-width: 0;
  color: var(--muted);
  font-size: .8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-id-copy-line {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content) 22px;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
}
.admin-id-copy-value {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-id-copy-btn {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.admin-id-copy-btn:hover {
  background: #f3f0e8;
  color: var(--accent);
}
.admin-id-copy-btn .icon {
  width: 13px;
  height: 13px;
}
.admin-daemon-capabilities {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-daemon-detail-card,
.admin-daemon-edit-card { max-width: 640px; }
.admin-daemon-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.admin-user-detail-page {
  display: grid;
  gap: 14px;
}
.admin-user-detail-page[hidden] { display: none; }
.admin-user-detail-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}
.admin-user-detail-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 1.18rem;
  font-weight: 900;
}
.admin-user-detail-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: .88em;
  font-weight: 750;
}
.admin-user-detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, .7fr) minmax(420px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.74);
  box-shadow: var(--shadow-sm);
}
.admin-user-detail-title {
  min-width: 0;
  align-self: center;
}
.admin-user-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}
.admin-user-detail-meta span {
  max-width: 100%;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(248,250,252,.86);
  color: var(--muted);
  font-size: .76em;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-detail-body {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}
.admin-user-detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 8px;
}
.admin-user-detail-stat {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #edf1f7;
  border-radius: 12px;
  background: #f8fafc;
}
.admin-user-detail-stat span {
  display: block;
  color: var(--muted);
  font-size: .68em;
  font-weight: 850;
  white-space: nowrap;
}
.admin-user-detail-stat strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: .98em;
  font-weight: 900;
}
.admin-user-detail-tabs-wrap {
  display: grid;
  gap: 14px;
}
.admin-user-detail-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid #e3ded3;
  border-radius: 999px;
  background: rgba(250,249,245,.76);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), var(--shadow);
}
.admin-user-detail-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.admin-user-detail-tab:hover {
  background: rgba(255,255,255,.72);
  color: var(--text);
}
.admin-user-detail-tab.active {
  color: var(--text);
  background: #f3f0e8;
  box-shadow: 0 0 0 1px #d8d1c4, inset 0 0 0 1px rgba(255,255,255,.75);
}
.admin-user-detail-tab-panels {
  min-width: 0;
}
.admin-user-detail-section {
  display: grid;
  gap: 10px;
}
.admin-user-detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-user-detail-section-head h4 {
  margin: 0;
  color: var(--text);
  font-size: .96em;
  font-weight: 900;
}
.admin-user-detail-section-head span {
  color: var(--muted);
  font-size: .78em;
  font-weight: 850;
}
.admin-user-detail-section-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.admin-credit-config-card {
  padding: 14px;
  border: 1px solid #e9edf4;
  border-radius: 14px;
  background: rgba(255,255,255,.76);
}
.admin-credit-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}
.admin-credit-adjust-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-credit-adjust-form .sa-dialog-input { margin-top: 0; }
.admin-credit-adjust-preview { margin-top: 12px; }
.admin-user-detail-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}
.admin-user-detail-table {
  min-width: 860px;
}
.admin-user-material-grid {
  align-items: stretch;
}
.admin-user-material-empty {
  grid-column: 1 / -1;
}
.admin-user-material-card .admin-content-media {
  min-height: 172px;
}
.admin-user-detail-main-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.admin-user-detail-main-cell strong,
.admin-user-detail-main-cell span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-user-detail-main-cell span {
  color: var(--muted);
  font-size: .78em;
  font-weight: 750;
}
.thread-drawer.admin-thread-drawer {
  width: min(960px, calc(100vw - 72px));
}
.admin-thread-drawer .thread-drawer-head h2 {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-thread-drawer .thread-drawer-head p {
  overflow-wrap: anywhere;
}
.admin-thread-drawer-body .channel-message {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
}
.admin-thread-drawer-body .channel-message-body {
  min-width: 0;
}
.admin-thread-drawer-body .channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}
.admin-thread-drawer-body .channel-message-meta {
  gap: 6px;
  font-size: .68rem;
}
.admin-thread-drawer-body .channel-message-content {
  width: auto;
  max-width: 100%;
  font-size: .84rem;
  line-height: 1.58;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}
.admin-thread-drawer-body .channel-message.compact .channel-message-content {
  width: auto;
  max-width: 100%;
}
.admin-thread-drawer-body .channel-message-content-rich p,
.admin-thread-drawer-body .channel-message-content-rich li,
.admin-thread-drawer-body .channel-message-content-rich a,
.admin-thread-drawer-body .channel-message-content-rich strong,
.admin-thread-drawer-body .channel-message-content-rich em {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: normal;
}
.admin-thread-drawer-body .channel-message-content-rich ul,
.admin-thread-drawer-body .channel-message-content-rich ol {
  margin: .5em 0 .5em 1.2em;
  padding-left: 0;
}
.admin-thread-drawer-body .channel-message-content-rich pre,
.admin-thread-drawer-body .channel-message-content-rich code {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.admin-thread-drawer-body .channel-message.compact.system .channel-message-content,
.admin-thread-drawer-body .channel-message.compact.event .channel-message-content,
.admin-thread-drawer-body .channel-message.compact.approval .channel-message-content,
.admin-thread-drawer-body .channel-message.compact.evidence .channel-message-content {
  border-color: rgba(79,125,90,.18);
  background: rgba(237,246,233,.72);
}
.admin-package-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.admin-package-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 14px; background: #f8fafc; }
.admin-package-main { display: grid; gap: 3px; min-width: 0; }
.admin-package-main strong { font-size: .9em; }
.admin-package-main span { color: var(--muted); font-size: .78em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-package-empty { color: var(--muted); font-size: .85em; padding: 10px 0; }
.admin-section-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, .45fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.admin-ledger-toolbar {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}
.admin-site-toolbar {
  grid-template-columns: minmax(180px, .35fr) minmax(220px, 1fr) auto auto;
}
.admin-section-toolbar input,
.admin-section-toolbar select,
.admin-ledger-toolbar input,
.admin-ledger-toolbar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
}
.admin-site-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.admin-site-layout {
  display: grid;
  grid-template-columns: minmax(360px, .85fr) minmax(0, 1.15fr);
  gap: 16px;
  align-items: start;
}
.admin-site-panel {
  min-width: 0;
}
.admin-site-list {
  grid-template-columns: 1fr;
}
.admin-site-table { min-width: 980px; }
.admin-email-table { min-width: 1080px; }
.admin-email-dialog {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
}
.admin-email-dialog-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.admin-email-dialog-hint {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .82em;
  line-height: 1.55;
}
.admin-agent-template-table { min-width: 1080px; }
.admin-site-detail-card,
.admin-site-editor-card { max-width: 760px; }
.admin-site-detail-card {
  width: min(760px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  overflow: auto;
}
.admin-site-editor-card {
  max-height: min(86vh, 900px);
  overflow: auto;
}
.admin-site-dialog-form {
  margin-top: 14px;
}
.admin-agent-template-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
}
.admin-agent-template-summary {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #f8fafc;
  color: var(--muted);
  font-size: .84em;
  font-weight: 750;
}
.admin-agent-template-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr);
  gap: 16px;
  align-items: start;
}
.admin-agent-template-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.admin-agent-template-column-head {
  display: grid;
  gap: 4px;
}
.admin-agent-template-column-head h3 {
  margin: 0;
  font-size: 1.02em;
}
.admin-agent-template-column-head p {
  margin: 0;
  color: var(--muted);
  font-size: .84em;
  line-height: 1.55;
}
.admin-agent-debug-controls { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 10px; align-items: center; }
.admin-agent-debug-daemons { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; align-items: center; }
.admin-agent-debug-chat { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: #f8fafc; }
.admin-agent-debug-message { max-width: 78%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 10px 22px rgba(15, 23, 42, .05); }
.admin-agent-debug-message.human { justify-self: end; background: #ecfdf5; border-color: #bbf7d0; }
.admin-agent-debug-message.agent { justify-self: start; background: #fff7ed; border-color: #fed7aa; }
.admin-agent-debug-message.system { justify-self: center; max-width: 92%; background: #eef2ff; border-color: #c7d2fe; }
.admin-agent-debug-message.status { justify-self: start; max-width: 62%; background: #f8fafc; border-color: #cbd5e1; box-shadow: none; }
.admin-agent-debug-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: var(--muted); font-size: .75em; font-weight: 800; }
.admin-agent-debug-text { white-space: pre-wrap; line-height: 1.55; font-size: .9em; color: var(--ink); }
.admin-agent-debug-statusline { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86em; line-height: 1.45; }
.loading-dot { width: 8px; height: 8px; border-radius: 999px; background: #f97316; box-shadow: 0 0 0 0 rgba(249, 115, 22, .42); animation: saPulse 1.2s ease-in-out infinite; flex: 0 0 auto; }
@keyframes saPulse { 0%, 100% { transform: scale(.8); box-shadow: 0 0 0 0 rgba(249, 115, 22, .35); } 50% { transform: scale(1); box-shadow: 0 0 0 8px rgba(249, 115, 22, 0); } }
.admin-agent-debug-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.admin-agent-debug-compose-main { display: grid; gap: 8px; min-width: 0; }
.admin-agent-debug-compose textarea { width: 100%; resize: vertical; min-height: 78px; border: 1px solid var(--border); border-radius: 14px; padding: 12px; font: inherit; background: #fff; }
.admin-agent-debug-filebar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.admin-agent-debug-filebar input[type="file"] { display: none; }
.admin-agent-debug-files { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: .82em; }
.admin-agent-debug-filechip,
.admin-agent-debug-attachment { display: inline-flex; align-items: center; gap: 5px; max-width: 280px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255,255,255,.82); color: var(--ink); }
.admin-agent-debug-filechip span,
.admin-agent-debug-attachment span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-agent-debug-filechip small,
.admin-agent-debug-attachment small { color: var(--muted); font-weight: 800; }
.admin-agent-debug-filechip button { border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 900; cursor: pointer; padding: 0 2px; }
.admin-agent-debug-attachments { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.admin-agent-debug-empty { color: var(--muted); font-size: .88em; text-align: center; padding: 18px; }
.admin-apk-qr-card { display: grid; max-width: 420px; padding: 22px; gap: 18px; }
.admin-apk-qr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.admin-apk-qr-head h3 { margin: 0 0 6px; font-size: 1.15em; }
.admin-apk-qr-head p { margin: 0; color: var(--muted); font-size: .88em; line-height: 1.55; }
.admin-apk-qr-box { display: grid; place-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: linear-gradient(180deg, #fff, #f8fbff); }
.admin-apk-qr-image { width: 240px; height: 240px; border-radius: 14px; box-shadow: 0 18px 42px rgba(15, 23, 42, .14); }
.admin-apk-qr-fallback { color: var(--red); font-size: .9em; padding: 28px 12px; text-align: center; }
.admin-apk-qr-meta { display: grid; gap: 4px; padding: 12px 14px; border-radius: 14px; background: #f1f5f9; }
.admin-apk-qr-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-apk-qr-meta span { color: var(--muted); font-size: .82em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) {
  .admin-stats { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
  .admin-section-toolbar { grid-template-columns: 1fr; }
  .admin-device-setup-grid,
  .admin-daemon-install-compact { grid-template-columns: 1fr; }
  .admin-miaonote-panel { grid-template-columns: 1fr; }
  .admin-miaonote-panel.compact,
  .admin-pool-panel.compact { grid-template-columns: 1fr; }
  .admin-pool-panel { grid-template-columns: 1fr; }
  .admin-miaonote-actions { justify-content: flex-start; flex-wrap: wrap; }
  .admin-daemon-install-primary { justify-content: flex-start; }
  .admin-daemon-package-row { grid-template-columns: 1fr; }
  .admin-package-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-email-dialog-form,
  .admin-agent-template-controls,
  .admin-agent-template-layout,
  .admin-site-controls,
  .admin-site-layout { grid-template-columns: 1fr; }
  .admin-agent-debug-controls,
  .admin-agent-debug-compose { grid-template-columns: 1fr; }
  .admin-daemon-detail-grid { grid-template-columns: 1fr; }
}
table { width: 100%; border-collapse: collapse; font-size: .82em; }
th { text-align: left; padding: 10px 12px; background: var(--bg); font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); }
tbody tr:hover { background: #f8f9fa; }

.admin-table-panel {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
}
.admin-table {
  min-width: 880px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.admin-table th {
  padding: 14px 16px;
  background: #f7faff;
  color: #69758a;
  font-size: .82rem;
  border-bottom: 1px solid #e5ebf4;
}
.admin-table td {
  padding: 15px 16px;
  color: #444;
  vertical-align: middle;
  border-bottom: 1px solid #edf1f7;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: rgba(20,122,255,.035); }
.admin-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
}
.admin-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  padding: 7px 14px;
  font-size: .84em;
  font-weight: 850;
  cursor: pointer;
}
.admin-tab:hover,
.admin-tab.active {
  background: var(--text);
  border-color: var(--text);
  color: #fff;
}
.admin-pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  color: var(--muted);
  font-size: .84em;
}
.admin-pager-info,
.admin-pager-page {
  font-weight: 800;
  color: #64748b;
}
.admin-token-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-token-actions select {
  min-width: 130px;
}
.admin-token-refresh-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  flex: 0 0 42px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted-strong);
}
.admin-token-refresh-btn .icon {
  width: 16px;
  height: 16px;
}
.admin-token-refresh-btn:hover {
  border-color: rgba(201,100,66,.36);
  background: #fbf3ec;
  color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,100,66,.08), 0 6px 18px rgba(20,20,19,.05);
}
.admin-token-stats {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
}
.admin-token-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.admin-token-tabs-wrap {
  display: grid;
  gap: 14px;
}
.admin-token-tabs {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid #e3ded3;
  border-radius: 999px;
  background: rgba(250,249,245,.76);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), var(--shadow);
}
.admin-token-tab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.admin-token-tab:hover {
  background: rgba(255,255,255,.72);
  color: var(--text);
}
.admin-token-tab.active {
  color: var(--text);
  background: #f3f0e8;
  box-shadow: 0 0 0 1px #d8d1c4, inset 0 0 0 1px rgba(255,255,255,.75);
}
.admin-token-tab-panels {
  min-width: 0;
}
.admin-token-tab-panel {
  margin-bottom: 0;
}
.admin-token-tab-panel[hidden] {
  display: none !important;
}
.admin-token-table {
  min-width: 920px;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(430px, 1fr));
  gap: 16px;
  align-items: stretch;
}
.admin-content-card {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.95);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.admin-content-card:hover {
  transform: translateY(-1px);
  border-color: #c8dcf3;
  box-shadow: var(--shadow-md);
}
.admin-content-card.succeeded,
.admin-content-card.published { box-shadow: inset 4px 0 0 rgba(23,160,93,.82), var(--shadow); }
.admin-content-card.failed { box-shadow: inset 4px 0 0 rgba(226,68,68,.85), var(--shadow); }
.admin-content-media {
  position: relative;
  min-height: 180px;
  background: #333;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.admin-content-media img,
.admin-content-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.admin-content-media.previewable {
  cursor: zoom-in;
}
.admin-content-media.previewable:focus-visible {
  outline: 3px solid rgba(69,126,223,.38);
  outline-offset: -3px;
}
.admin-content-media.previewable::after {
  content: '预览';
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(5,11,20,.68);
  color: #fff;
  font-size: .74em;
  font-weight: 800;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}
.admin-content-media.previewable:hover::after,
.admin-content-media.previewable:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}
.admin-media-type {
  position: absolute;
  right: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(5,11,20,.72);
  color: #fff;
  font-size: .76em;
  font-weight: 800;
  backdrop-filter: blur(8px);
}
.admin-media-type .icon { width: 14px; height: 14px; }
.admin-media-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 18px;
  color: #94a3b8;
  text-align: center;
  font-size: .84em;
}
.admin-media-placeholder .icon { width: 30px; height: 30px; color: #64748b; }
.admin-content-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px;
}
.admin-content-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.admin-content-title {
  min-width: 0;
  color: #333;
  font-weight: 900;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.admin-content-sub {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: .78em;
  font-weight: 750;
}
.admin-content-desc {
  min-height: 42px;
  margin: 0;
  color: #666;
  font-size: .84em;
  line-height: 1.58;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.admin-content-meta {
  display: grid;
  gap: 8px;
  margin-top: auto;
}
.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.admin-chip {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eaf4ff;
  color: #667eea;
  font-size: .72em;
  font-weight: 850;
}
.admin-chip.muted { background: #f1f5f9; color: #7b8798; }
.admin-credit-amount { font-weight: 900; white-space: nowrap; }
.admin-credit-amount.positive { color: var(--green); }
.admin-credit-amount.negative { color: var(--red); }
.admin-credit-amount.zero { color: var(--muted); }
.admin-content-time { color: var(--muted); font-size: .76em; font-weight: 750; }

.admin-task-board { display: grid; gap: 10px; }
.admin-task-row {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}
.admin-task-row.succeeded { box-shadow: inset 4px 0 0 rgba(23,160,93,.82), var(--shadow); }
.admin-task-row.failed { box-shadow: inset 4px 0 0 rgba(226,68,68,.85), var(--shadow); }
.admin-task-row.publishing,
.admin-task-row.running,
.admin-task-row.queued,
.admin-task-row.partial { box-shadow: inset 4px 0 0 rgba(240,138,36,.8), var(--shadow); }
.admin-task-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; min-width: 0; }
.admin-task-title { color: #333; font-size: .98em; font-weight: 900; }
.admin-task-sub { margin-top: 3px; color: var(--muted); font-size: .78em; font-weight: 750; }
.admin-task-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.admin-task-progress {
  overflow: hidden;
  height: 6px;
  border-radius: 999px;
  background: #e8eef7;
}
.admin-task-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #667eea, #667eea);
}
.admin-task-counts { display: flex; flex-wrap: wrap; gap: 8px 14px; color: #66758a; font-size: .8em; font-weight: 800; }
.admin-task-counts .ok { color: var(--green); }
.admin-task-counts .bad { color: var(--red); }
.admin-task-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; }
.admin-task-meta-line { min-width: 0; color: var(--muted); font-size: .78em; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.admin-task-detail-card {
  width: min(960px, calc(100vw - 32px));
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  padding: 0;
}
.admin-task-detail-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(12px);
}
.admin-task-detail-kicker {
  margin-bottom: 4px;
  color: #d46a43;
  font-size: .76em;
  font-weight: 900;
  letter-spacing: .12em;
}
.admin-task-detail-head h3 { margin: 0; font-size: 1.35em; color: #1f2937; }
.admin-task-detail-head p { margin: 6px 0 0; color: var(--muted); font-size: .86em; font-weight: 750; }
.admin-task-detail-card section { padding: 18px 24px 22px; }
.admin-task-detail-card h4 { margin: 0 0 12px; color: #334155; font-size: .96em; }
.admin-task-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 18px 24px 0;
}
.admin-task-detail-records,
.admin-task-detail-events { display: grid; gap: 10px; }
.admin-task-detail-record {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}
.admin-task-detail-record-main { display: grid; gap: 4px; min-width: 0; }
.admin-task-detail-record-main strong {
  overflow: hidden;
  color: #1f2937;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-task-detail-record-main span,
.admin-task-detail-record-main small { color: var(--muted); font-size: .78em; font-weight: 750; }
.admin-task-detail-error { color: var(--red) !important; }
.admin-task-detail-event {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
}
.admin-task-detail-event-dot {
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border-radius: 50%;
  background: #94a3b8;
}
.admin-task-detail-event.succeeded .admin-task-detail-event-dot { background: var(--green); }
.admin-task-detail-event.failed .admin-task-detail-event-dot { background: var(--red); }
.admin-task-detail-event.publishing .admin-task-detail-event-dot { background: #f08a24; }
.admin-task-detail-event-body { min-width: 0; }
.admin-task-detail-event-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #334155;
  font-size: .82em;
  font-weight: 850;
}
.admin-task-detail-event-head span { color: var(--muted); font-weight: 750; white-space: nowrap; }
.admin-task-detail-event-msg {
  margin-top: 4px;
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .82em;
}
.admin-task-detail-event-sub { margin-top: 4px; color: var(--muted); font-size: .74em; font-weight: 750; }

@media (max-width: 760px) {
  .admin-content-grid { grid-template-columns: 1fr; }
  .admin-content-card { grid-template-columns: 1fr; }
  .admin-content-media { min-height: 220px; }
  .admin-task-foot { align-items: flex-start; flex-direction: column; }
}

/* ── Help ── */
.help-hero { display: grid; gap: 10px; margin-bottom: 24px; padding: 28px; border: 1px solid var(--border); border-radius: 24px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(231,242,255,.92)); box-shadow: var(--shadow); }
.help-kicker { color: var(--accent); font-weight: 850; font-size: .86em; letter-spacing: .04em; }
.help-title { font-size: clamp(1.8rem, 1.3rem + 1.4vw, 3rem); font-weight: 900; letter-spacing: -.055em; }
.help-subtitle { max-width: 760px; color: var(--muted-strong); line-height: 1.8; }
.help-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-nav { position: sticky; top: 76px; display: grid; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); }
.help-nav a { color: var(--text); font-weight: 750; font-size: .86em; padding: 8px 10px; border-radius: 12px; }
.help-nav a:hover { background: var(--accent-soft); color: var(--accent); }
.help-sections { display: grid; gap: 16px; }
.help-card { padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); scroll-margin-top: 88px; }
.help-card h2 { font-size: 1.25em; margin-bottom: 10px; letter-spacing: -.025em; }
.help-card h3 { font-size: 1em; margin: 16px 0 8px; }
.help-card p,
.help-card li { color: var(--muted-strong); line-height: 1.75; }
.help-card ul,
.help-card ol { padding-left: 1.2em; display: grid; gap: 7px; }
.help-note { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #f8fafc; border: 1px solid var(--border); color: var(--muted-strong); line-height: 1.7; }
.help-step-list { counter-reset: help-step; padding: 0 !important; list-style: none; }
.help-step-list li { counter-increment: help-step; position: relative; padding-left: 34px; }
.help-step-list li::before { content: counter(help-step); position: absolute; left: 0; top: .2em; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--accent); color: #fff; font-size: .76em; font-weight: 850; }
.help-email-provider-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 10px; }
.help-email-provider { border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg, #fff, #faf9f5); padding: 14px; display: grid; gap: 9px; }
.help-email-provider h4 { margin: 0; font-size: .96em; font-weight: 900; color: var(--text); }
.help-email-provider p { margin: 0; font-size: .88em; line-height: 1.7; }
.help-email-table { border: 1px solid rgba(232,230,220,.86); border-radius: 12px; overflow: hidden; background: rgba(255,255,255,.72); }
.help-email-table > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 8px 10px; color: var(--muted-strong); font-size: .82em; line-height: 1.55; }
.help-email-table > div + div { border-top: 1px solid rgba(232,230,220,.74); }
.help-email-table strong { color: var(--text); font-weight: 900; }
@media (max-width: 900px) {
  .help-grid { grid-template-columns: 1fr; }
  .help-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-email-provider-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .help-hero { padding: 22px; }
  .help-nav { grid-template-columns: 1fr; }
  .help-email-table > div { grid-template-columns: 1fr; gap: 2px; }
}

/* ── UI tree nodes ── */
.node-item { padding: 7px 12px; font-size: .78em; cursor: pointer; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; transition: background .1s; }
.node-item:hover { background: #f0f3ff; }
.node-hover { background: #bbdefb !important; }
.node-idx { background: #f0f3ff; color: var(--accent); padding: 1px 5px; border-radius: 4px; font-size: .72em; font-weight: 600; font-family: monospace; min-width: 22px; text-align: center; }
.node-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node-tag { background: var(--bg); color: var(--muted); padding: 1px 6px; border-radius: 4px; font-size: .68em; }
.node-tag.clickable { background: #f6ffed; color: #52c41a; }
.node-tag.editable { background: #fff8e1; color: #e65100; }

/* ── Log area ── */
.log-area { font-size: .7em; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 8px 10px; font-family: 'SF Mono', Menlo, Consolas, monospace; white-space: pre-wrap; line-height: 1.6; overflow-y: auto; flex: 1; min-height: 60px; }

/* ── Device cards ── */
.device-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.device-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; align-items: start; grid-auto-rows: max-content; }
.device-log { font-size: .7em; color: var(--muted); margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--border); line-height: 1.5; max-height: 5.5em; overflow: hidden; }
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 12px; font-size: .75em; color: var(--muted); }
.pager button { background: none; border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; font-size: .85em; cursor: pointer; color: var(--text); }
.pager button:disabled { opacity: .3; cursor: default; }
.pager button:hover:not(:disabled) { background: var(--bg); }
.device-card { padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 10px; transition: all .15s; }
.device-card:hover:not(.offline) { background: #f0f4ff; border-color: #c7d2fe; }
.device-card.selected { border-color: var(--accent); background: #f0f3ff; box-shadow: 0 0 0 3px rgba(102,126,234,.1); }
.device-card.offline { opacity: .45; cursor: default; }
.device-card-main { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.device-model { font-weight: 600; font-size: .85em; }
.device-card-info { font-size: .7em; color: var(--muted); }
.device-card-tags { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }
.device-tag { font-size: .62em; padding: 2px 6px; border-radius: 4px; font-weight: 500; }
.tag-ok { background: #f6ffed; color: #52c41a; }
.tag-warn { background: #fff2f0; color: #ff4d4f; }
.tag-help { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border-radius: 50%; background: rgba(0,0,0,.1); color: inherit; font-size: 8px; font-weight: 700; margin-left: 2px; cursor: pointer; vertical-align: middle; }
.tag-tip-popup { position: absolute; left: 0; top: calc(100% + 6px); background: var(--nav-bg); color: #fff; font-size: .72em; padding: 6px 10px; border-radius: 8px; white-space: nowrap; z-index: 50; box-shadow: var(--shadow-md); font-weight: 400; letter-spacing: 0; }
.device-empty { text-align: center; padding: 28px 10px; color: var(--muted); }
.device-empty p:first-child { font-size: .88em; margin-bottom: 4px; }

/* ── Conversation list ── */
.conv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 8px; }
.conv-item { padding: 8px 10px; cursor: pointer; border-radius: 8px; transition: background .1s; margin-bottom: 2px; }
.conv-item:hover { background: var(--bg); }
.conv-item.active { background: #f0f3ff; }
.conv-title { font-size: .82em; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: .7em; color: var(--muted); }

/* ── Modal ── */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.4); z-index: 200; justify-content: center; align-items: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.open { display: flex; }
.modal-card { background: var(--card); border-radius: 16px; width: 100%; max-width: 380px; box-shadow: 0 24px 60px rgba(0,0,0,.2); overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1em; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 1.4em; cursor: pointer; color: var(--muted); padding: 0 4px; line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; text-align: center; }
.modal-divider { border-top: 1px solid var(--border); margin: 0 20px; }
.modal-footer-section { padding: 14px 20px; }

/* ── QR / Pairing ── */
.qr-container { display: flex; justify-content: center; margin: 16px 0; }
.qr-image { border-radius: 10px; border: 3px solid var(--card); box-shadow: var(--shadow); }
.pairing-code-display { font-size: 1.8em; font-weight: 700; letter-spacing: .3em; color: var(--accent); font-family: 'SF Mono', Menlo, Consolas, monospace; margin: 8px 0; }
.pairing-timer { font-size: .82em; color: var(--muted); }
.code-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); }
.code-item:last-child { border-bottom: none; }
.code-text { font-family: 'SF Mono', Menlo, Consolas, monospace; font-weight: 600; letter-spacing: .12em; font-size: .85em; }
.code-expiry { font-size: .75em; }

/* ── Device guide ── */
.device-guide { display: none; max-width: 420px; width: 100%; padding: 40px 28px; text-align: center; }
.device-guide.visible { display: block; }
.guide-icon { font-size: 2.8em; margin-bottom: 10px; }
.guide-title { font-size: 1.3em; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.guide-subtitle { font-size: .85em; color: var(--muted); margin-bottom: 28px; }
.guide-steps { text-align: left; display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.guide-step { display: flex; gap: 12px; align-items: flex-start; }
.guide-step-num { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .78em; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.guide-step-content { flex: 1; }
.guide-step-title { font-weight: 600; font-size: .88em; margin-bottom: 1px; }
.guide-step-desc { font-size: .78em; color: var(--muted); line-height: 1.4; }
.guide-step-desc strong { color: var(--accent); font-weight: 600; }
.guide-btn { width: 100%; justify-content: center; padding: 10px; font-size: .92em; border-radius: 10px; }

/* ── Text helpers ── */
.text-sm { font-size: .78em; }
.text-muted { color: var(--muted); }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Responsive: Desktop ── */
@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .console-layout { flex-direction: row; }
  .sidebar-left { width: 520px; flex-shrink: 0; border-right: 1px solid var(--border); }
  .sidebar-right { width: 480px; flex-shrink: 0; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
  .center-area { flex: 1; }
  .mobile-tabs { display: none; }
}

/* ── Responsive: Mobile ── */
@media (max-width: 767px) {
  .navbar { height: 44px; padding: 0 12px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 44px; left: 0; right: 0; background: var(--nav-bg); flex-direction: column; padding: 8px; z-index: 100; max-height: calc(100vh - 44px); overflow: auto; }
  .nav-links.open { display: flex; }
  .nav-group {
    width: 100%;
  }
  .nav-group-trigger {
    width: 100%;
    justify-content: space-between;
  }
  .nav-menu {
    position: static;
    width: 100%;
    margin-top: 4px;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .nav-group:not(.open) .nav-menu {
    display: none;
  }
  .nav-help-text { display: none; }
  .nav-user .user-name { display: none; }
  .sidebar-left, .sidebar-right { display: none; }
  .nodes-panel { display: none !important; }
  .sidebar-left.open, .sidebar-right.open { display: flex; flex-direction: column; position: fixed; top: 44px; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--card); }
  #controls-panel.open { display: flex; flex-direction: column; position: fixed; top: 44px; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--card); width: 100%; }
  .mobile-tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); z-index: 100; }
  .mobile-tab { flex: 1; text-align: center; padding: 8px 0; font-size: .72em; color: var(--muted); cursor: pointer; }
  .mobile-tab.active { color: var(--accent); font-weight: 600; }
  .phone-area { min-height: calc(100vh - 44px - 42px); padding: 8px; }
  .phone-toolbar { padding: 6px 8px; gap: 4px; flex-wrap: wrap; }
  .toolbar-input { max-width: none; }
  .admin-layout { padding: 12px; }
  .admin-package-form { grid-template-columns: 1fr; }
  .console-layout { height: calc(100vh - 44px); }
}

/* Content card id tag */
.cc-title-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cc-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .72em;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0,0,0,.04);
  cursor: pointer;
  user-select: all;
  transition: background .15s;
}
.cc-id:hover { background: rgba(0,0,0,.08); }
.cc-id.copied { background: var(--green, #52c41a); color: #fff; }

/* Task detail step list */
.step-line { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: .82em; line-height: 1.4; flex-wrap: wrap; }
.step-line.running { background: rgba(102,126,234,.04); }
.step-ic { display: inline-block; width: 18px; text-align: center; font-weight: 700; }
.step-ic.ok { color: var(--green); }
.step-ic.fail { color: var(--red); }
.step-ic.running { color: var(--accent); animation: spin 1s linear infinite; }
.step-title { flex: 1 1 auto; min-width: 0; }
.step-cat { font-size: .72em; padding: 0 5px; border-radius: 3px; background: rgba(0,0,0,.06); color: var(--muted); }
.step-cat.optional { background: #fff7e0; color: #b45309; }
.step-cat.skipped { background: #e5e7eb; color: #6b7280; }
.step-time { font-family: ui-monospace, monospace; font-size: .72em; color: var(--muted); white-space: nowrap; }
.step-reason { font-size: .72em; color: var(--red); margin-left: 4px; }
.task-detail-sub { color: var(--muted); font-size: .82em; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Console live task panel */
.console-task-panel { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px; max-height: 260px; overflow-y: auto; font-size: .78em; }
.console-task-panel h5 { font-size: .9em; margin: 0 0 6px; display: flex; align-items: center; gap: 6px; }
.console-task-panel .status-pill { font-size: .7em; padding: 1px 6px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.console-task-panel .status-pill.running { background: #e6f7ff; color: var(--info); }
.console-task-panel .status-pill.failed { background: #fff2f0; color: var(--red); }
.console-task-panel .status-pill.succeeded, .console-task-panel .status-pill.published, .console-task-panel .status-pill.done { background: #f6ffed; color: var(--green); }

/* ── 秒豹风格统一（覆盖层） ── */
html { background: var(--bg); }
body { letter-spacing: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(102,126,234,.35);
  outline-offset: 2px;
}

.input-attention {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 3px rgba(250,140,22,.18) !important;
}

body .card,
body .task-card,
body .content-card,
body .dev-card,
body .cmt-card,
body .modal-card {
  border: none;
  box-shadow: var(--shadow);
  border-radius: 12px;
}
body .publish-bar,
body .fetch-bar {
  border: none;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 12px;
}

body .content-page,
body .tasks-page,
body .devices-page,
body .comments-page,
body .help-page {
  width: min(100%, 1200px);
  max-width: none;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 40px;
}
body .admin-layout {
  width: min(100%, 1680px);
  max-width: none;
  margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 40px;
}
body .page-header {
  align-items: center;
  margin-bottom: 20px;
}
body .page-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

body .filter-bar,
body .publish-bar,
body .fetch-bar {
  min-height: 52px;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}
body .filter-bar select,
body .filter-bar input,
body .publish-bar select,
body .fetch-bar select {
  min-height: 32px;
  max-width: 240px;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
}

/* Console */
@media (min-width: 768px) {
  .console-layout { height: calc(100vh - 54px); }
  .sidebar-left {
    width: 330px;
    background: rgba(255,255,255,.78);
    backdrop-filter: blur(18px);
  }
  .sidebar-right {
    width: 500px;
    background: rgba(255,255,255,.82);
    backdrop-filter: blur(18px);
  }
  .sidebar-left .device-grid { grid-template-columns: 1fr; }
}
.console-layout { background: transparent; }
.center-area {
  background:
    linear-gradient(90deg, rgba(226,232,240,.65) 1px, transparent 1px),
    linear-gradient(rgba(226,232,240,.55) 1px, transparent 1px),
    radial-gradient(circle at 50% 10%, rgba(102,126,234,.10), transparent 28rem);
  background-size: 28px 28px, 28px 28px, auto;
}
.panel { padding: 16px; }
.panel-title {
  color: #555;
  font-size: .78em;
  letter-spacing: .09em;
}
.phone-toolbar {
  min-height: 58px;
  padding: 10px 18px;
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(18px);
  flex-wrap: wrap;
}
.toolbar-group {
  min-height: 38px;
  padding: 3px;
  border: 1px solid rgba(226,232,240,.78);
  border-radius: 16px;
  background: rgba(248,250,252,.72);
  flex-shrink: 0;
}
.toolbar-input {
  padding: 0;
  border: 0;
  background: transparent;
  flex: 1 1 220px;
  min-width: 180px;
}
.toolbar-btn {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  color: #555;
}
.toolbar-btn:hover {
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.toolbar-text {
  height: 38px;
  border-radius: 14px;
  background: #fff;
}
.chat-screen-sync {
  min-height: 32px;
  border-radius: 999px;
  background: #fff;
}
.phone-area { padding: clamp(16px, 2.2vw, 34px); }
.phone-frame {
  border-radius: 38px;
  padding: 12px 10px;
  background: linear-gradient(180deg, #333 0%, #222 100%);
  box-shadow: 0 30px 70px rgba(17,24,39,.28), 0 0 0 1px rgba(255,255,255,.08) inset;
}
.screen-wrap,
.screen-wrap img,
.screen-placeholder {
  border-radius: 25px;
}
.screen-wrap img { max-height: calc(100vh - 250px); }

.chat-header {
  padding: 17px 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.84));
}
.chat-header h3 {
  font-size: 1rem;
  font-weight: 850;
}
.task-current {
  padding-left: 0;
  color: var(--muted-strong);
}
.chat-messages {
  padding: 18px;
  gap: 12px;
}
.chat-msg {
  padding: 11px 14px;
  border-radius: 18px;
  font-size: .88em;
  box-shadow: var(--shadow-sm);
}
.chat-ai {
  background: #f0f4f9;
  color: #444;
}
.chat-user {
  background: linear-gradient(180deg, #667eea 0%, #667eea 100%);
}
.chat-input {
  padding: 14px 16px;
  gap: 10px;
  background: rgba(255,255,255,.94);
}
.chat-input textarea {
  min-height: 44px;
  border-radius: 16px;
}
.chat-input textarea.enter-confirm-pending {
  border-color: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .16);
}
.conv-popover {
  top: 68px;
  right: 16px;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}
.conv-item { border-radius: 14px; }

.device-card {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  cursor: pointer;
}
.device-card.selected {
  border-color: rgba(102,126,234,.72);
  background: linear-gradient(180deg, #f0f7ff, #fff);
  box-shadow: 0 0 0 4px rgba(102,126,234,.12), var(--shadow);
}
.device-model { font-size: .95em; font-weight: 800; }
.device-card-info { font-size: .76em; line-height: 1.55; }
.device-tag,
.dev-flag,
.app-tag,
.acc-chip,
.platform-chip,
.badge,
.status-badge {
  border-radius: 999px;
  font-weight: 750;
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

/* Material cards */
body .content-page { width: min(100%, 1540px); }
body .content-grid {
  grid-template-columns: repeat(auto-fill, minmax(390px, 1fr));
  gap: 22px;
}
body .content-card {
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,.92);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
body .content-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
body .content-card.publishing,
body .content-card.published,
body .content-card.failed,
body .content-card.cancelled,
body .content-card.approved {
  border-left-width: 0;
}
body .content-card.published { box-shadow: inset 4px 0 0 rgba(23,160,93,.8), var(--shadow); }
body .content-card.failed { box-shadow: inset 4px 0 0 rgba(226,68,68,.85), var(--shadow); }
body .content-card.approved { box-shadow: inset 4px 0 0 rgba(102,126,234,.8), var(--shadow); }
body .cc-media { aspect-ratio: 16 / 9.6; }
body .cc-body { padding: 18px 20px 20px; }
body .cc-title { font-size: 1.02em; font-weight: 850; letter-spacing: -.025em; }
body .cc-desc {
  margin-top: 8px;
  color: #666;
  line-height: 1.6;
}
body .cc-meta { margin-top: 12px; gap: 8px; }
.platform-badges { margin-top: 12px; }
.platform-chip {
  padding: 5px 10px;
  background: #eef2f7;
}
/* Tasks */
body .tasks-page { width: min(100%, 1560px); }
body .tasks-layout {
  grid-template-columns: minmax(360px, 440px) minmax(0, 1fr);
  gap: 22px;
}
body .task-card {
  border-radius: 24px;
  background: rgba(255,255,255,.92);
}
body .task-card-head {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.82));
}
body .task-card-title {
  font-size: 1.02em;
  font-weight: 850;
}
body .batch-list { padding: 14px; gap: 10px; }
body .batch-row,
body .task-item {
  border-radius: 18px;
  background: #fff;
}
body .batch-row.succeeded,
body .task-item.succeeded,
body .task-item.published { box-shadow: inset 4px 0 0 rgba(23,160,93,.8); }
body .batch-row.failed,
body .task-item.failed { box-shadow: inset 4px 0 0 rgba(226,68,68,.85); }
body .batch-row.cancelled,
body .task-item.cancelled { box-shadow: inset 4px 0 0 rgba(156,163,175,.7); }
body .batch-row.partial { box-shadow: inset 4px 0 0 rgba(242,153,43,.9); }
body .batch-row.running,
body .batch-row.queued,
body .batch-row.cancelling,
body .task-item.running,
body .task-item.queued,
body .task-item.publishing,
body .task-item.cancelling { box-shadow: inset 4px 0 0 rgba(102,126,234,.7); }
.batch-meta .count-succeeded,
.summary-cell.succeeded strong { color: #52c41a; font-weight: 750; }
.batch-meta .count-failed,
.summary-cell.failed strong { color: #ff4d4f; font-weight: 750; }
.batch-meta .count-cancelled,
.summary-cell.cancelled strong { color: #6b7280; font-weight: 700; }
body .batch-row.active,
body .task-item.active {
  background: linear-gradient(180deg, #f0f7ff, #fff);
  border-color: rgba(102,126,234,.72);
  box-shadow: 0 0 0 4px rgba(102,126,234,.11);
}
body .batch-row.succeeded.active { box-shadow: inset 4px 0 0 rgba(23,160,93,.8), 0 0 0 4px rgba(23,160,93,.16); }
body .batch-row.failed.active { box-shadow: inset 4px 0 0 rgba(226,68,68,.85), 0 0 0 4px rgba(226,68,68,.14); }
body .batch-row.cancelled.active { box-shadow: inset 4px 0 0 rgba(156,163,175,.7), 0 0 0 4px rgba(156,163,175,.18); }
body .batch-row.partial.active { box-shadow: inset 4px 0 0 rgba(242,153,43,.9), 0 0 0 4px rgba(242,153,43,.16); }
body .summary-cell {
  border-radius: 18px;
  background: #f8fafc;
}
.progress-track,
.task-progress-track {
  background: #dce4ef;
}
.progress-bar,
.task-progress-bar {
  background: linear-gradient(90deg, #667eea, #667eea);
}

body table { font-size: .9em; }
body th {
  padding: 15px 18px;
  background: #f8fafc;
  color: #666;
  letter-spacing: .03em;
  text-transform: uppercase;
}
body td {
  padding: 15px 18px;
  color: #444;
}
tbody tr:hover { background: #f6faff; }

/* Device and comment cards */
body .device-cards {
  gap: 20px;
}
body .device-cards {
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
}
body .dev-card,
body .cmt-card {
  border-radius: 24px;
  background: rgba(255,255,255,.92);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
body .dev-card:hover,
body .cmt-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
body .dev-name,
body .cmt-author {
  font-weight: 850;
}
body .dev-info,
body .acc-info {
  line-height: 1.65;
}
body .comment-list { gap: 14px; }
body .cmt-content {
  color: #444;
  font-size: 1em;
}
body .cmt-reply {
  background: #edf8f2;
  color: #52c41a;
}

/* Modals */
body .modal-overlay {
  z-index: 500;
  padding: clamp(14px, 3vw, 34px);
  background: rgba(0,0,0,.4);
}
body .modal-card,
body .modal {
  border-radius: 16px;
  background: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
}
body .modal-card { max-width: 440px; }
body .modal {
  max-width: 760px;
  max-height: calc(100vh - 52px);
  overflow: auto;
  padding: 32px;
}
body .modal h3,
.modal-header h3 {
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -.04em;
}
.modal-header {
  padding: 20px 24px;
}
.modal-body { padding: 24px; }
.modal-close {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: #f1f4f9;
  color: #666;
}
.modal-close:hover {
  background: #e6edf6;
  color: #333;
}
.pairing-code-display {
  padding-left: .3em;
  color: var(--accent);
}
#qr-container,
.qr-container {
  display: flex;
  justify-content: center;
}
#qr-container img,
#qr-container canvas {
  padding: 10px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow);
}

body .platform-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
body .platform-option {
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 13px;
  border-color: #e1e6ef;
  background: #f3f5f8;
  font-size: .72em;
  font-weight: 760;
  color: #8a94a3;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: border-color .14s ease, background .14s ease, box-shadow .14s ease, color .14s ease;
}
body .platform-option:hover {
  border-color: #cfd8e6;
  background: #eef2f6;
  color: #666;
}
body .platform-option:has(input:checked) {
  border-color: rgba(23,160,93,.95);
  background: #f6ffed !important;
  color: #52c41a;
  font-weight: 850;
  box-shadow: 0 0 0 4px rgba(23,160,93,.16), 0 10px 22px rgba(23,160,93,.12);
  transform: translateY(-1px);
}
body .platform-option:has(input:checked) .platform-brand-icon {
  filter: none !important;
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 4px 10px rgba(15,122,67,.18);
}
body .platform-option:has(input:checked)::after {
  content: '✓';
  position: absolute;
  top: 5px;
  right: 7px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #52c41a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
body .platform-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
body .platform-brand-icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
  filter: grayscale(1) saturate(.35);
  opacity: .72;
}
body .platform-brand-icon svg { width: 13px; height: 13px; fill: currentColor; stroke: none; }
body .platform-brand-icon .brand-line { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body .platform-brand-icon .brand-line-bold { stroke-width: 2.6; }
body .platform-brand-icon .brand-cut { fill: rgba(255,255,255,.28); }
body .platform-brand-xiaohongshu { background: #ff2442; }
body .platform-brand-douyin { background: linear-gradient(135deg, #111 0%, #111 48%, #25f4ee 49%, #fe2c55 100%); }
body .platform-brand-tiktok { background: #111; color: #25f4ee; text-shadow: 1px 0 #fe2c55; }
body .platform-brand-x { background: #111; }
body .platform-brand-douyin .brand-accent,
body .platform-brand-tiktok .brand-accent { fill: #fe2c55; }
body .platform-brand-facebook { background: #1877f2; }
body .platform-brand-linkedin { background: #0a66c2; }
body .platform-brand-reddit { background: #ff4500; }
body .platform-brand-producthunt { background: #da552f; }
body .platform-brand-discord { background: #5865f2; }
body .batch-mode .btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(102,126,234,.20);
}
body .modal-actions {
  position: sticky;
  bottom: -32px;
  margin: 22px -32px -32px;
  padding: 16px 32px 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.82), #fff 34%);
  border-top: 1px solid var(--border);
}

/* Login */
.login-wrap {
  position: relative;
  overflow: hidden;
  display: grid;
  min-height: 100vh;
  align-items: center;
  padding: clamp(24px, 5vw, 72px);
  background: var(--brand-grad);
  color: #fff;
}
.login-wrap::before { content: none; }
.login-wrap::after { content: none; }
.login-product-wrap {
  grid-template-columns: minmax(0, 680px) minmax(420px, 500px);
  justify-content: center;
  gap: clamp(44px, 7vw, 110px);
}
.login-hero-panel,
.login-auth-panel {
  position: relative;
  z-index: 1;
  animation: loginFadeUp .62s cubic-bezier(.22,1,.36,1) both;
}
.login-auth-panel {
  animation-delay: .08s;
}
.login-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 32px;
  color: #333;
  font-size: .92rem;
  font-weight: 850;
  letter-spacing: -.02em;
}
.login-brand-mark::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #667eea, #667eea);
  box-shadow: 0 0 0 7px rgba(45,212,191,.14), 0 0 22px rgba(45,212,191,.72);
}
.login-hero-panel h1 {
  max-width: 720px;
  color: #333;
  font-size: clamp(2.65rem, 4.1vw, 4.6rem);
  font-weight: 920;
  letter-spacing: -.07em;
  line-height: 1.08;
}
.login-hero-copy {
  max-width: 560px;
  margin-top: 24px;
  color: #666;
  font-size: clamp(1rem, 1.05vw, 1.1rem);
  line-height: 1.85;
}
.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 580px);
  margin-top: 32px;
}
.login-feature-card {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  padding: 15px 16px;
  border: 1px solid rgba(207,216,230,.88);
  border-radius: 20px;
  background: rgba(255,255,255,.74);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(37,99,235,.08), inset 0 1px 0 rgba(255,255,255,.9);
  animation: loginFadeUp .7s cubic-bezier(.22,1,.36,1) both;
}
.login-feature-card:nth-child(2) { animation-delay: .06s; }
.login-feature-card:nth-child(3) { animation-delay: .12s; }
.login-feature-card:nth-child(4) { animation-delay: .18s; }
.login-feature-card::after {
  content: '';
  position: absolute;
  right: -28px;
  top: -28px;
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(45,212,191,.22), rgba(102,126,234,.12));
}
.login-feature-card span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 7px;
  color: #667eea;
  font-size: .72rem;
  font-weight: 850;
}
.login-feature-card strong {
  position: relative;
  z-index: 1;
  display: block;
  color: #333;
  font-size: .9rem;
  line-height: 1.45;
}
.login-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}
.login-flow span {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border: 1px solid rgba(191,219,254,.95);
  border-radius: 999px;
  color: #666;
  background: rgba(255,255,255,.66);
  font-size: .74rem;
  font-weight: 750;
}
.login-flow span:not(:last-child)::after {
  content: '';
  width: 18px;
  height: 1px;
  margin-left: 12px;
  background: linear-gradient(90deg, rgba(102,126,234,.6), transparent);
}
.login-auth-panel {
  display: grid;
  align-content: center;
  gap: 16px;
  width: 100%;
  max-width: 500px;
}
.login-device-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 15px;
  border: 1px solid rgba(191,219,254,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
  color: #333;
  box-shadow: 0 18px 42px rgba(37,99,235,.10);
  backdrop-filter: blur(18px);
}
.login-device-preview div {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .92em;
  font-weight: 850;
}
.login-device-preview strong {
  color: #64748b;
  font-size: .72em;
  font-weight: 760;
}
.login-live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #52c41a;
  box-shadow: 0 0 0 6px rgba(34,197,94,.16), 0 0 18px rgba(34,197,94,.72);
}
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: none;
  margin-left: 0;
  padding: 38px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(34,197,94,.11), transparent 18rem),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.95));
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: 0 32px 90px rgba(30,64,175,.16), 0 1px 0 rgba(255,255,255,.9) inset;
}
.login-wrap:not(.login-product-wrap) .login-card {
  margin: 0 auto;
}
.login-kicker {
  color: var(--accent);
  font-size: .74em;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.login-title {
  margin: 7px 0 8px;
  text-align: left;
  font-size: clamp(1.9rem, 2.6vw, 2.45rem);
  font-weight: 900;
  letter-spacing: -.055em;
}
.login-card-desc {
  margin-bottom: 24px;
  color: var(--muted-strong);
  line-height: 1.65;
  font-size: .9em;
}
.login-card .form-group { margin-bottom: 16px; }
.login-card label {
  margin-bottom: 7px;
  color: #555;
  font-weight: 800;
}
.login-card input {
  min-height: 48px;
  border-radius: 14px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.login-card input:focus {
  transform: translateY(-1px);
}
.login-card .btn {
  min-height: 48px;
  border-radius: 14px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.login-card .btn:hover {
  transform: translateY(-1px);
}
.login-card #sso-section .btn {
  background: #ecfdf3;
  color: #52c41a;
  border: 1px solid #b7eb8f;
  box-shadow: 0 14px 32px rgba(34,197,94,.10);
}
.wechat-login-btn {
  gap: 9px;
  font-weight: 850;
}
.wechat-login-icon {
  position: relative;
  display: inline-block;
  width: 23px;
  height: 18px;
}
.wechat-login-icon::before,
.wechat-login-icon::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  background: #52c41a;
}
.wechat-login-icon::before {
  left: 0;
  top: 0;
  width: 16px;
  height: 13px;
  box-shadow: inset 5px 4px 0 -3px #fff, inset 10px 4px 0 -3px #fff;
}
.wechat-login-icon::after {
  right: 0;
  bottom: 0;
  width: 14px;
  height: 11px;
  background: #52c41a;
  box-shadow: inset 4px 3px 0 -2.5px #fff, inset 8px 3px 0 -2.5px #fff;
}

.admin-auth-body {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(45,212,191,.22), transparent 25rem),
    radial-gradient(circle at 88% 76%, rgba(251,146,60,.18), transparent 24rem),
    linear-gradient(135deg, #eef7ff 0%, #f8fbff 48%, #fff7e6 100%);
}
.admin-auth-body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(30,64,175,.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30,64,175,.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.18));
}
.admin-login-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: clamp(36px, 6vw, 78px);
  display: grid;
  grid-template-columns: minmax(430px, 1.08fr) minmax(420px, 500px);
  gap: clamp(36px, 6vw, 86px);
  align-items: center;
}
.admin-login-shell::before,
.admin-login-shell::after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(3px);
  pointer-events: none;
  animation: adminLoginFloat 9s ease-in-out infinite;
}
.admin-login-shell::before {
  width: 170px;
  height: 170px;
  left: 30px;
  bottom: 8%;
  background: linear-gradient(135deg, rgba(20,184,166,.2), rgba(102,126,234,.08));
}
.admin-login-shell::after {
  width: 110px;
  height: 110px;
  right: 6%;
  top: 12%;
  background: linear-gradient(135deg, rgba(251,146,60,.24), rgba(34,197,94,.12));
  animation-delay: -3s;
}
.admin-login-hero,
.admin-login-panel {
  position: relative;
  animation: loginFadeUp .55s ease both;
}
.admin-login-panel {
  animation-delay: .08s;
}
.admin-login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: clamp(34px, 5vw, 62px);
  color: #333;
  font-weight: 900;
  letter-spacing: -.02em;
}
.admin-login-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: #52c41a;
  box-shadow: 0 0 0 7px rgba(34,197,94,.12), 0 0 24px rgba(34,197,94,.5);
}
.admin-login-eyebrow {
  margin-bottom: 12px;
  color: #667eea;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.admin-login-hero h1 {
  max-width: 760px;
  font-size: clamp(3.4rem, 7.8vw, 6.8rem);
  line-height: .9;
  letter-spacing: -.075em;
  font-weight: 950;
  color: #333;
}
.admin-login-copy {
  max-width: 650px;
  margin-top: 26px;
  color: #666;
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.8;
}
.admin-login-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 34px;
}
.admin-login-metrics div {
  min-height: 112px;
  padding: 20px;
  border: 1px solid rgba(191,205,224,.76);
  border-radius: 24px;
  background: rgba(255,255,255,.68);
  box-shadow: 0 18px 48px rgba(21,31,53,.08);
  backdrop-filter: blur(18px);
}
.admin-login-metrics strong {
  display: block;
  color: #667eea;
  font-size: 2.2rem;
  line-height: 1;
  font-weight: 950;
}
.admin-login-metrics span {
  display: block;
  margin-top: 10px;
  color: #666;
  font-weight: 800;
}
.admin-login-flow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 9px 12px;
  border: 1px solid rgba(191,205,224,.8);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #666;
  box-shadow: 0 12px 30px rgba(21,31,53,.06);
}
.admin-login-flow span {
  font-size: .82rem;
  font-weight: 850;
}
.admin-login-flow i {
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, #667eea, #52c41a);
}
.admin-login-status {
  width: min(100%, 500px);
  margin: 0 0 16px auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border: 1px solid rgba(148,163,184,.35);
  border-radius: 999px;
  background: rgba(15,23,42,.86);
  color: rgba(255,255,255,.88);
  font-weight: 850;
  box-shadow: 0 18px 45px rgba(15,23,42,.16);
  backdrop-filter: blur(18px);
}
.admin-login-status span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #52c41a;
  box-shadow: 0 0 0 6px rgba(34,197,94,.18);
}
.admin-login-card {
  position: relative;
  width: min(100%, 500px);
  margin-left: auto;
  padding: clamp(34px, 4vw, 48px);
  border-radius: 34px;
  border: 1px solid rgba(255,255,255,.9);
  background:
    radial-gradient(circle at 12% 0%, rgba(56,189,248,.12), transparent 15rem),
    radial-gradient(circle at 100% 8%, rgba(34,197,94,.13), transparent 13rem),
    rgba(255,255,255,.9);
  box-shadow: 0 32px 90px rgba(21,31,53,.18), inset 0 1px 0 rgba(255,255,255,.95);
  backdrop-filter: blur(26px);
}
.admin-login-card::before {
  content: '';
  position: absolute;
  inset: 16px 16px auto;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #667eea, #52c41a, #fb923c);
  opacity: .9;
}
.admin-login-kicker {
  margin-top: 16px;
  color: #667eea;
  font-size: .76rem;
  font-weight: 950;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.admin-login-title {
  margin-top: 8px;
  color: #333;
  font-size: clamp(2.1rem, 3vw, 2.85rem);
  line-height: 1.05;
  letter-spacing: -.055em;
  font-weight: 950;
}
.admin-login-card p {
  margin: 12px 0 28px;
  color: #64748b;
  line-height: 1.65;
  font-weight: 650;
}
.admin-login-card .form-group {
  margin-bottom: 18px;
}
.admin-login-card label {
  margin-bottom: 8px;
  color: #444;
  font-size: .9rem;
  font-weight: 900;
}
.admin-login-card input {
  min-height: 58px;
  padding: 0 18px;
  border-radius: 18px;
  border-color: #d7e0eb;
  background: rgba(255,255,255,.92);
  color: #333;
  font-size: .95rem;
  box-shadow: 0 8px 24px rgba(21,31,53,.04);
}
.admin-login-card input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 5px rgba(102,126,234,.13), 0 12px 28px rgba(21,31,53,.07);
}
.admin-login-submit {
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  justify-content: center;
  border-radius: 18px;
  font-size: .98rem;
  font-weight: 900;
  background: linear-gradient(135deg, #667eea, #667eea);
  box-shadow: 0 20px 42px rgba(102,126,234,.24);
}
.admin-login-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 24px 48px rgba(102,126,234,.3);
}
.admin-login-card .login-error {
  margin-bottom: 16px;
  border: 1px solid rgba(226,68,68,.16);
  border-radius: 14px;
}

@keyframes loginFloat {
  0%, 100% { transform: translate3d(0,0,0) rotate(0deg); }
  50% { transform: translate3d(-18px,18px,0) rotate(10deg); }
}
@keyframes adminLoginFloat {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(20px,-14px,0) scale(1.04); }
}
@keyframes loginFadeUp {
  from { opacity: .88; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.import-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.import-card {
  width: min(100%, 460px);
  padding: 34px;
  border-radius: 28px;
  text-align: center;
}
.import-kicker {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: .78em;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.import-status {
  color: #333;
  font-size: 1.2rem;
  font-weight: 850;
}
.import-error {
  margin-top: 16px;
  color: var(--red);
  font-size: .92em;
  line-height: 1.6;
}
.import-card #retry {
  margin-top: 22px;
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 72px;
  right: 22px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(207,216,230,.82);
  border-radius: 18px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-md);
  color: #444;
  opacity: 0;
  transform: translateY(-8px) scale(.98);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: auto;
}
.toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.toast-bar {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  background: var(--accent);
}
.toast-success .toast-bar { background: var(--green); }
.toast-error .toast-bar { background: var(--red); }
.toast-warning .toast-bar { background: var(--orange); }
.toast-message {
  min-width: 0;
  font-size: .9em;
  font-weight: 700;
  line-height: 1.45;
}
.toast-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: #f1f4f9;
  color: #666;
  cursor: pointer;
}
.toast-close:hover { background: #e6edf6; color: #333; }

/* App dialogs */
.sa-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0,0,0,.4);
}
.sa-dialog-overlay.open { display: flex; }
.sa-dialog-card {
  width: min(520px, 100%);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  transform: translateY(6px) scale(.98);
  opacity: 0;
  animation: dialogIn .16s ease forwards;
}
@keyframes dialogIn { to { transform: translateY(0) scale(1); opacity: 1; } }
.sa-dialog-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.sa-dialog-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sa-dialog-icon .icon { width: 22px; height: 22px; }
.sa-dialog-icon.info { background: #f0f3ff; color: var(--accent); }
.sa-dialog-icon.danger { background: #fff1f1; color: var(--red); }
.sa-dialog-card h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.sa-dialog-card p {
  margin: 0;
  color: #555;
  font-size: .92rem;
  line-height: 1.6;
}
.sa-dialog-input {
  margin-top: 18px;
  height: 42px;
}
.trial-dialog-card { width: min(560px, 100%); }
.trial-dialog-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.trial-dialog-form label { display: grid; gap: 6px; color: var(--text); font-size: .84rem; font-weight: 700; }
.trial-dialog-form input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  padding: 0 12px;
  font: inherit;
}
@media (max-width: 767px) {
  .trial-dialog-form { grid-template-columns: 1fr; }
}
.agent-dialog-card {
  max-width: 460px;
}
.agent-dialog-form {
  display: grid;
  gap: 12px;
  padding: 2px 0 4px;
}
.agent-dialog-form label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: .84rem;
  font-weight: 800;
  text-align: left;
}
.agent-dialog-form label > span {
  color: rgba(42,45,52,.76);
}
.agent-dialog-form .sa-dialog-input {
  box-sizing: border-box;
  margin-top: 0;
  width: 100%;
}
.agent-dialog-summary {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
}
.sa-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.sa-dialog-confirm.danger {
  background: var(--red);
  color: #fff;
}
.sa-dialog-confirm.danger:hover { filter: brightness(.94); }

@media (max-width: 1100px) {
  body .content-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  body .tasks-layout { grid-template-columns: 1fr; }
  .admin-token-grid { grid-template-columns: 1fr; }
  .admin-token-tabs,
  .admin-user-detail-tabs { width: 100%; }
  .admin-token-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-user-detail-hero { grid-template-columns: 1fr; }
  .admin-user-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 32px;
  }
  .admin-login-brand {
    margin-bottom: 28px;
  }
  .admin-login-hero h1 {
    max-width: 820px;
    font-size: clamp(3.2rem, 10vw, 5.8rem);
  }
  .admin-login-card,
  .admin-login-status {
    margin-left: 0;
  }
}

@media (max-width: 767px) {
  .navbar { height: 52px; }
  .navbar {
    gap: 10px;
    padding: 0 10px;
  }
  .nav-brand {
    min-width: 0;
  }
  .brand-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nav-links {
    top: 52px;
    max-height: calc(100vh - 52px);
  }
  .console-layout { height: calc(100vh - 52px); }
  .sidebar-left.open,
  .sidebar-right.open,
  #controls-panel.open { top: 52px; }
  body .content-page,
  body .tasks-page,
  body .devices-page,
  body .comments-page {
    padding: 24px 14px 78px;
  }
  body .page-header {
    flex-direction: column;
    gap: 12px;
  }
  body .publish-bar,
  body .fetch-bar,
  body .filter-bar {
    align-items: stretch;
  }
  body .publish-bar select,
  body .fetch-bar select,
  body .filter-bar select,
  body .filter-bar input {
    max-width: none;
    width: 100%;
  }
  body .content-grid,
  body .device-cards {
    grid-template-columns: 1fr;
  }
  body .platform-grid { grid-template-columns: 1fr; }
  body .modal {
    width: 100%;
    padding: 22px;
    border-radius: 24px;
  }
  body .modal-actions {
    bottom: -22px;
    margin: 18px -22px -22px;
    padding: 14px 22px 18px;
  }
  .login-wrap {
    align-items: flex-end;
    padding: 20px;
  }
  .login-product-wrap {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 22px;
  }
  .login-hero-panel h1 {
    font-size: clamp(2.6rem, 13vw, 4.8rem);
  }
  .login-hero-copy {
    margin-top: 16px;
    font-size: .95rem;
  }
  .login-feature-grid {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }
  .login-flow { display: none; }
  .login-device-preview {
    align-items: flex-start;
    flex-direction: column;
  }
  .login-card {
    margin: 0;
    max-width: none;
    border-radius: 24px;
  }
  .admin-auth-body {
    overflow-x: hidden;
  }
  .admin-login-shell {
    padding: 26px 16px;
    min-height: auto;
  }
  .admin-login-shell::before,
  .admin-login-shell::after {
    display: none;
  }
  .admin-login-hero h1 {
    font-size: clamp(2.8rem, 15vw, 4.6rem);
  }
  .admin-login-copy {
    margin-top: 18px;
    font-size: .95rem;
  }
  .admin-login-metrics {
    grid-template-columns: 1fr;
    margin-top: 22px;
  }
  .admin-login-metrics div {
    min-height: auto;
    padding: 16px;
  }
  .admin-login-flow {
    display: none;
  }
  .admin-login-status {
    border-radius: 22px;
  }
  .admin-login-card {
    border-radius: 28px;
    padding: 32px 22px;
  }
  .admin-login-card input,
  .admin-login-submit {
    min-height: 54px;
  }
  .toast-stack {
    top: 64px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}

/* Restrained admin login variant */
.admin-auth-body {
  background:
    radial-gradient(circle at 10% 8%, rgba(34,197,94,.10), transparent 24rem),
    radial-gradient(circle at 92% 92%, rgba(102,126,234,.08), transparent 26rem),
    linear-gradient(135deg, #f6f9fc 0%, #eef4f9 100%);
}
.admin-auth-body::before {
  background-image:
    linear-gradient(rgba(15,23,42,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,42,.045) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.48), rgba(0,0,0,.08));
}
.admin-login-shell {
  width: min(1120px, 100%);
  padding: clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(380px, .95fr) minmax(420px, 480px);
  gap: clamp(42px, 7vw, 88px);
}
.admin-login-shell::before,
.admin-login-shell::after {
  display: none;
}
.admin-login-brand {
  margin-bottom: 64px;
  font-size: 1rem;
  font-weight: 850;
}
.admin-login-eyebrow {
  margin-bottom: 16px;
  color: #667eea;
  font-size: .76rem;
  letter-spacing: .18em;
}
.admin-login-hero h1 {
  max-width: 620px;
  font-size: clamp(3.4rem, 5.6vw, 5.4rem);
  line-height: .98;
  letter-spacing: -.06em;
}
.admin-login-copy {
  max-width: 560px;
  margin-top: 24px;
  color: #666;
  font-size: 1.08rem;
  line-height: 1.78;
}
.admin-login-metrics {
  max-width: 560px;
  margin-top: 38px;
  gap: 14px;
}
.admin-login-metrics div {
  min-height: 96px;
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 34px rgba(15,23,42,.06);
}
.admin-login-metrics strong {
  font-size: 1.85rem;
}
.admin-login-flow {
  color: #666;
  background: rgba(255,255,255,.76);
  box-shadow: none;
}
.admin-login-status {
  width: min(100%, 480px);
  margin-bottom: 14px;
  padding: 12px 15px;
  border-color: rgba(148,163,184,.26);
  background: rgba(15,23,42,.78);
  box-shadow: 0 12px 32px rgba(15,23,42,.12);
}
.admin-login-card {
  width: min(100%, 480px);
  padding: 42px;
  border-radius: 28px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 24px 70px rgba(15,23,42,.13);
}
.admin-login-card::before {
  inset: 0 0 auto;
  height: 4px;
  opacity: .72;
  border-radius: 28px 28px 0 0;
}
.admin-login-kicker {
  margin-top: 0;
  color: #667eea;
}
.admin-login-title {
  font-size: clamp(2rem, 3vw, 2.55rem);
  letter-spacing: -.045em;
}
.admin-login-card p {
  margin-bottom: 26px;
  color: #66758a;
}
.admin-login-card input,
.admin-login-submit {
  min-height: 54px;
  border-radius: 16px;
}
@media (max-width: 767px) {
  .admin-login-shell {
    padding: 24px 16px;
  }
  .admin-login-brand {
    margin-bottom: 32px;
  }
  .admin-login-hero h1 {
    font-size: clamp(2.8rem, 12vw, 4.2rem);
  }
  .admin-login-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .admin-login-metrics div {
    padding: 14px;
  }
  .admin-login-card {
    padding: 30px 22px;
  }
}

/* ──────────────────────────────────────────────────────────────
   Design.md warm editorial skin
   A single shared layer for every static page. Keep business layout,
   replace the cold blue system with parchment surfaces and warm depth.
────────────────────────────────────────────────────────────── */
html {
  background: var(--bg);
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(201,100,66,.10), transparent 28rem),
    radial-gradient(circle at 90% 8%, rgba(79,125,90,.10), transparent 26rem),
    linear-gradient(180deg, #f7f4ec 0%, var(--bg) 42%, #f1eee4 100%);
  color: var(--text);
}

a { color: var(--accent); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(56,152,236,.45);
  outline-offset: 2px;
}

.page-title,
.admin-section-head h2,
.help-card h2,
.import-status,
.login-title,
.admin-login-title,
.task-card-title,
.admin-task-title,
.admin-content-title,
.cc-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: -.025em;
  color: var(--text);
}

.login-title,
.admin-login-title {
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: currentColor;
}

.navbar {
  height: 56px;
  padding: 0 clamp(16px, 2.4vw, 28px);
  background: var(--nav-bg);
  color: var(--nav-text);
  border-bottom: 1px solid rgba(232,230,220,.9);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 8px 28px rgba(20,20,19,.035);
  backdrop-filter: blur(18px);
}

.brand-text {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 142px;
  height: 34px;
  overflow: hidden;
  background: url('/static/assets/ecomseer-logo.png?v=20260603') left center / contain no-repeat;
  color: transparent;
  -webkit-text-fill-color: transparent;
  font-size: 0;
}

.brand-text::before {
  content: none;
}

.nav-link,
.nav-help,
.nav-group-trigger {
  color: var(--muted);
  border: 1px solid transparent;
}

.nav-link:hover,
.nav-help:hover,
.nav-group.open .nav-group-trigger {
  color: var(--text);
  background: rgba(232,230,220,.58);
}

.nav-link.active,
.nav-help.active,
.nav-group.active .nav-group-trigger {
  color: var(--text);
  background: var(--surface-muted);
  border-color: rgba(209,207,197,.72);
  box-shadow: 0 1px 0 rgba(255,255,255,.72) inset;
}

.user-avatar-fallback {
  background: #30302e;
  color: #faf9f5;
}

.btn,
.chat-icon-btn,
.toolbar-btn,
.ai-card-action {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted-strong);
  box-shadow: 0 0 0 1px rgba(209,207,197,.2), 0 2px 8px rgba(20,20,19,.025);
}

.btn:hover,
.chat-icon-btn:hover,
.toolbar-btn:hover,
.ai-card-action:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
  color: var(--text);
  opacity: 1;
}

.btn-primary,
.ai-card-action.primary,
.admin-login-submit,
.login-card .btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #faf9f5;
  box-shadow: 0 0 0 1px rgba(201,100,66,.18), 0 10px 26px rgba(201,100,66,.18);
}

.btn-primary:hover,
.ai-card-action.primary:hover,
.admin-login-submit:hover,
.login-card .btn-primary:hover {
  background: var(--accent-hover);
  color: #faf9f5;
  border-color: var(--accent-hover);
  box-shadow: 0 0 0 1px rgba(201,100,66,.22), 0 14px 32px rgba(201,100,66,.22);
}

.btn-danger {
  color: var(--red);
  border-color: rgba(181,51,51,.24);
  background: #fff8f5;
}

.btn-danger:hover {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

input,
select,
textarea,
.toolbar-text {
  border-color: var(--border);
  background: rgba(255,255,255,.82);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255,255,255,.7) inset;
}

input::placeholder,
textarea::placeholder {
  color: #87867f;
}

input:focus,
select:focus,
textarea:focus,
.toolbar-text:focus {
  border-color: var(--info);
  box-shadow: 0 0 0 4px rgba(56,152,236,.13), 0 1px 0 rgba(255,255,255,.9) inset;
}

label,
.panel-title,
.filter-label,
.admin-data-field span,
.admin-content-sub,
.admin-content-time,
.task-current,
.login-card-desc,
.admin-login-card p {
  color: var(--muted);
}

.card,
body .card,
body .task-card,
body .content-card,
body .dev-card,
body .cmt-card,
body .modal-card,
body .modal,
.admin-table-panel,
.admin-data-card,
.admin-content-card,
.admin-task-row,
.help-card,
.import-card {
  border: 1px solid rgba(232,230,220,.88);
  background: rgba(250,249,245,.9);
  box-shadow: var(--shadow);
}

.card:hover,
body .content-card:hover,
body .dev-card:hover,
body .cmt-card:hover,
.admin-data-card:hover,
.admin-content-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

body .content-page,
body .tasks-page,
body .devices-page,
body .comments-page,
body .admin-layout,
body .help-page {
  padding-top: clamp(24px, 4vw, 42px);
}

body .page-header {
  margin-bottom: 22px;
}

body .page-title {
  font-size: clamp(1.55rem, 2vw, 2.1rem);
  line-height: 1.15;
}

body .filter-bar,
body .publish-bar,
body .fetch-bar {
  background: rgba(250,249,245,.92);
  border: 1px solid rgba(232,230,220,.9);
  box-shadow: var(--shadow-sm);
}

body .filter-bar select,
body .filter-bar input,
body .publish-bar select,
body .fetch-bar select {
  background-color: rgba(255,255,255,.78);
  border-color: var(--border);
}

.badge,
.status-badge,
.admin-status,
.platform-chip,
.device-tag,
.dev-flag,
.app-tag,
.acc-chip {
  white-space: nowrap;
  word-break: keep-all;
  writing-mode: horizontal-tb;
  border-radius: 999px;
}

.badge-online,
.badge-completed,
.badge-success,
.badge-published,
.status-badge.published,
.status-badge.succeeded,
.admin-status.ok,
.platform-chip.published {
  background: #eaf3e8;
  color: var(--green);
}

.badge-warning,
.badge-publishing,
.badge-partial,
.status-badge.publishing,
.status-badge.running,
.status-badge.queued,
.status-badge.cancelling,
.admin-status.warn,
.platform-chip.publishing,
.platform-chip.queued,
.platform-chip.running {
  background: #f7eadf;
  color: var(--orange);
}

.badge-failed,
.badge-danger,
.status-badge.failed,
.admin-status.bad,
.platform-chip.failed {
  background: #f7e4df;
  color: var(--red);
}

.badge-unpublished,
.badge-pending,
.status-badge.pending,
.status-badge.cancelled,
.platform-chip.cancelled,
.platform-chip.pending {
  background: var(--surface-muted);
  color: var(--muted);
}

body table,
.admin-table {
  color: var(--text);
}

body th,
.admin-table th {
  background: #efece2;
  color: var(--muted-strong);
  text-transform: none;
  letter-spacing: .01em;
}

body td,
.admin-table td {
  color: var(--muted-strong);
  border-bottom-color: var(--border);
}

tbody tr:hover,
.admin-table tbody tr:hover {
  background: rgba(243,228,218,.34);
}

.admin-stats {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 12px;
}

.stat-card {
  border: 1px solid rgba(232,230,220,.9);
  background: rgba(250,249,245,.9);
  box-shadow: var(--shadow-sm);
}

.stat-card .stat-num {
  color: var(--accent);
}

.stat-card .stat-today,
.stat-card .stat-label {
  color: var(--muted);
}

.stat-card .stat-today.active {
  color: var(--green);
}

.admin-content-grid {
  gap: 16px;
}

.admin-content-card {
  background: rgba(250,249,245,.94);
}

.admin-content-card.succeeded,
.admin-content-card.published,
body .content-card.published,
body .batch-row.succeeded,
body .task-item.succeeded,
body .task-item.published,
.admin-task-row.succeeded,
.admin-data-card.succeeded,
.admin-data-card.published,
.admin-data-card.online {
  box-shadow: inset 4px 0 0 rgba(79,125,90,.82), var(--shadow);
}

.admin-content-card.failed,
body .content-card.failed,
body .batch-row.failed,
body .task-item.failed,
.admin-task-row.failed,
.admin-data-card.failed,
.admin-data-card.error {
  box-shadow: inset 4px 0 0 rgba(181,51,51,.82), var(--shadow);
}

body .content-card.publishing,
body .content-card.partial,
body .batch-row.partial,
body .batch-row.running,
body .batch-row.queued,
body .task-item.running,
body .task-item.queued,
body .task-item.publishing,
.admin-task-row.publishing,
.admin-task-row.running,
.admin-task-row.queued,
.admin-task-row.partial,
.admin-data-card.publishing,
.admin-data-card.running,
.admin-data-card.queued,
.admin-data-card.partial {
  box-shadow: inset 4px 0 0 rgba(185,106,58,.86), var(--shadow);
}

body .content-card:hover,
.admin-content-card:hover,
.admin-task-row:hover {
  transform: translateY(-2px);
}

body .cc-media,
.admin-content-media {
  background: #141413;
}

body .cc-title,
.admin-content-title {
  color: var(--text);
}

body .cc-desc,
.admin-content-desc,
.help-card p,
.help-card li {
  color: var(--muted);
}

body .platform-chip,
.admin-chip {
  background: #efece2;
  color: var(--muted-strong);
}

.admin-chip.muted {
  background: #efece2;
  color: var(--muted);
}

body .tasks-layout {
  gap: 18px;
}

body .task-card-head,
.chat-header {
  background: linear-gradient(180deg, rgba(250,249,245,.98), rgba(240,238,230,.72));
}

body .batch-row,
body .task-item,
body .summary-cell,
.admin-data-field,
.admin-package-item,
.admin-apk-qr-meta {
  background: rgba(255,255,255,.64);
  border-color: var(--border);
}

body .batch-row:hover,
body .batch-row.active,
body .task-item.active {
  background: #fbf3ec;
  border-color: rgba(201,100,66,.46);
  box-shadow: 0 0 0 4px rgba(201,100,66,.10);
}

.progress-track,
.task-progress-track,
.admin-task-progress {
  background: #e5e0d4;
}

.progress-bar,
.task-progress-bar,
.admin-task-progress span {
  background: linear-gradient(90deg, #c96442, #d97757);
}

.center-area {
  background:
    linear-gradient(90deg, rgba(209,207,197,.38) 1px, transparent 1px),
    linear-gradient(rgba(209,207,197,.36) 1px, transparent 1px),
    radial-gradient(circle at 52% 10%, rgba(201,100,66,.10), transparent 30rem),
    var(--bg);
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.phone-toolbar,
.sidebar,
.sidebar-left,
.sidebar-right,
.nodes-panel,
.chat-input {
  background: rgba(250,249,245,.9);
  border-color: var(--border);
}

.toolbar-group {
  background: rgba(250,249,245,.8);
  border-color: var(--border);
}

.toolbar-sep {
  background: var(--border);
}

.toolbar-btn {
  color: var(--muted-strong);
}

.toolbar-btn:active {
  background: #e5dfd2;
}

.phone-frame {
  background: linear-gradient(180deg, #30302e 0%, #141413 100%);
  box-shadow: 0 28px 68px rgba(20,20,19,.30), 0 0 0 1px rgba(250,249,245,.08) inset;
}

.device-card {
  background: rgba(250,249,245,.88);
  border-color: var(--border);
}

.device-card:hover:not(.offline) {
  background: #fbf3ec;
  border-color: rgba(201,100,66,.42);
}

.device-card.selected {
  border-color: rgba(201,100,66,.68);
  background: linear-gradient(180deg, #fbf3ec, rgba(250,249,245,.94));
  box-shadow: 0 0 0 4px rgba(201,100,66,.11), var(--shadow);
}

.chat-ai {
  background: #efece2;
  color: var(--text);
}

.chat-user {
  background: var(--accent);
  color: #faf9f5;
}

.ai-card {
  background: linear-gradient(180deg, #faf9f5 0%, #f0eee6 100%);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

.ai-card-icon,
.sa-dialog-icon.info {
  background: var(--accent-soft);
  color: var(--accent);
}

.ai-card-confirm .ai-card-icon {
  background: #f7eadf;
  color: var(--orange);
}

.ai-card-running .ai-card-icon {
  background: #eaf3e8;
  color: var(--green);
}

.ai-card-meta-item,
.ai-card-media-item,
.ai-card-body,
.ai-card-desc {
  background: rgba(255,255,255,.66);
  border-color: var(--border);
}

.ai-card-actions {
  border-top-color: var(--border);
  background: rgba(250,249,245,.76);
}

.modal-overlay,
body .modal-overlay,
.sa-dialog-overlay {
  background: rgba(20,20,19,.42);
  backdrop-filter: blur(12px);
}

body .modal-card,
body .modal,
.sa-dialog-card {
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0%, rgba(79,125,90,.06), transparent 16rem),
    #faf9f5;
  border: 1px solid rgba(232,230,220,.95);
  box-shadow: var(--shadow-lg);
}

body .modal h3,
.modal-header h3,
.sa-dialog-card h3 {
  font-family: var(--font-serif);
  font-weight: 500;
}

.modal-header,
body .modal-actions,
.ai-card-actions {
  border-color: var(--border);
}

.modal-close,
.toast-close {
  background: #efece2;
  color: var(--muted-strong);
}

.modal-close:hover,
.toast-close:hover {
  background: #e8e1d3;
  color: var(--text);
}

body .platform-option,
#m-platforms .platform-option,
#ai-platforms .platform-option {
  border-color: #ddd9cf;
  background: #efeee8;
  color: #8b887f;
  box-shadow: none;
}

body .platform-option:hover,
#m-platforms .platform-option:hover,
#ai-platforms .platform-option:hover {
  background: #e9e5db;
  border-color: #d1cfc5;
  color: var(--muted-strong);
}

body .platform-option:has(input:checked),
#m-platforms .platform-option:has(input:checked),
#ai-platforms .platform-option:has(input:checked) {
  border-color: rgba(79,125,90,.78);
  background: #eaf3e8 !important;
  color: var(--green);
  box-shadow: 0 0 0 4px rgba(79,125,90,.14), 0 10px 22px rgba(79,125,90,.10);
}

body .platform-option:has(input:checked)::after,
#m-platforms .platform-option:has(input:checked)::after,
#ai-platforms .platform-option:has(input:checked)::after {
  background: var(--green);
}

.platform-grid.field-attention .platform-option {
  border-color: rgba(185,106,58,.72);
  background: #fbf0e7;
  box-shadow: 0 0 0 3px rgba(185,106,58,.12);
}

.file-picker {
  border-color: #d7d0c3;
  background: linear-gradient(180deg, #faf9f5 0%, #efece2 100%);
}

.file-picker:hover {
  border-color: var(--accent);
  background: #fbf3ec;
}

.toast {
  background: rgba(250,249,245,.98);
  border-color: var(--border);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.toast-bar { background: var(--accent); }
.toast-success .toast-bar { background: var(--green); }
.toast-error .toast-bar { background: var(--red); }
.toast-warning .toast-bar { background: var(--orange); }

.import-body {
  background:
    radial-gradient(circle at 22% 20%, rgba(201,100,66,.12), transparent 22rem),
    radial-gradient(circle at 78% 72%, rgba(79,125,90,.10), transparent 24rem),
    var(--bg);
}

.import-kicker {
  color: var(--accent);
}

.input-attention,
.form-group.field-attention input,
.form-group.field-attention textarea,
.form-group.field-attention select,
.form-group.field-attention .file-picker {
  border-color: var(--orange) !important;
  box-shadow: 0 0 0 4px rgba(185,106,58,.16) !important;
}

/* Product login */
.auth-body,
.login-wrap,
.login-product-wrap {
  background:
    radial-gradient(circle at 12% 15%, rgba(201,100,66,.14), transparent 25rem),
    radial-gradient(circle at 83% 20%, rgba(79,125,90,.12), transparent 26rem),
    linear-gradient(135deg, #f7f4ec 0%, #f5f4ed 52%, #efe8dc 100%);
  color: var(--text);
}

.login-product-wrap {
  gap: clamp(36px, 6vw, 92px);
}

.login-brand-mark,
.admin-login-brand {
  color: var(--text);
}

.login-brand-mark::before,
.admin-login-dot,
.login-live-dot {
  background: #2fbf7a;
  box-shadow: 0 0 0 7px rgba(47,191,122,.12), 0 0 20px rgba(47,191,122,.36);
}

.login-hero-panel h1,
.admin-login-hero h1 {
  font-family: var(--font-serif);
  color: var(--text);
  font-weight: 500;
  letter-spacing: -.04em;
}

.login-hero-panel h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  line-height: .98;
}

.login-hero-copy,
.admin-login-copy {
  color: var(--muted);
}

.login-feature-card,
.admin-login-metrics div {
  border-color: rgba(232,230,220,.9);
  background: rgba(250,249,245,.72);
  box-shadow: var(--shadow-sm);
}

.login-feature-card::after {
  background: radial-gradient(circle, rgba(201,100,66,.18), transparent 68%);
}

.login-feature-card span,
.login-kicker,
.admin-login-eyebrow,
.admin-login-kicker {
  color: var(--accent);
}

.login-feature-card strong {
  color: var(--text);
}

.login-flow span,
.admin-login-flow {
  background: rgba(250,249,245,.78);
  border-color: var(--border);
  color: var(--muted-strong);
}

.login-flow span:not(:last-child)::after,
.admin-login-flow i {
  background: linear-gradient(90deg, rgba(201,100,66,.72), transparent);
}

.login-device-preview,
.admin-login-status {
  background: rgba(48,48,46,.9);
  border-color: rgba(250,249,245,.16);
  color: #faf9f5;
  box-shadow: 0 18px 44px rgba(20,20,19,.18);
}

.login-device-preview strong,
.admin-login-status {
  color: #d7d4ca;
}

.login-card,
.admin-login-card {
  background:
    radial-gradient(circle at 100% 0%, rgba(79,125,90,.08), transparent 17rem),
    rgba(250,249,245,.94);
  border: 1px solid rgba(232,230,220,.95);
  box-shadow: var(--shadow-lg);
}

.login-card input,
.admin-login-card input {
  background: rgba(255,255,255,.78);
  border-color: var(--border);
  color: var(--text);
}

.login-card label,
.admin-login-card label {
  color: var(--muted-strong);
}

.login-card #sso-section .btn,
.wechat-login-btn {
  background: #eaf3e8;
  border-color: rgba(79,125,90,.22);
  color: var(--green);
  box-shadow: none;
}

.login-card #sso-section .btn:hover,
.wechat-login-btn:hover {
  background: #dcebd9;
  color: #365c41;
}

.wechat-login-icon::before,
.wechat-login-icon::after {
  background: var(--green);
}

/* Admin login should feel guarded, not loud. */
.admin-auth-body {
  background:
    radial-gradient(circle at 12% 18%, rgba(201,100,66,.11), transparent 25rem),
    radial-gradient(circle at 85% 76%, rgba(79,125,90,.10), transparent 24rem),
    linear-gradient(135deg, #f7f4ec 0%, #f5f4ed 54%, #efe8dc 100%);
}

.admin-auth-body::before {
  background-image:
    linear-gradient(rgba(209,207,197,.42) 1px, transparent 1px),
    linear-gradient(90deg, rgba(209,207,197,.38) 1px, transparent 1px);
  background-size: 80px 80px;
}

.admin-login-shell::before {
  background: rgba(201,100,66,.12);
}

.admin-login-shell::after {
  background: rgba(79,125,90,.12);
}

.admin-login-shell {
  grid-template-columns: minmax(420px, .95fr) minmax(400px, 500px);
}

.admin-login-hero h1 {
  max-width: 620px;
  font-size: clamp(3.4rem, 6vw, 5.6rem);
  line-height: .96;
}

.admin-login-metrics strong {
  color: var(--accent);
}

.admin-login-card::before {
  background: linear-gradient(90deg, var(--accent), #d97757, var(--green));
}

@media (prefers-reduced-motion: no-preference) {
  .login-hero-panel,
  .login-auth-panel,
  .admin-login-hero,
  .admin-login-panel,
  .content-card,
  .task-card,
  .admin-content-card,
  .admin-task-row {
    animation: designMdRise .46s cubic-bezier(.22,1,.36,1) both;
  }

  .login-feature-card,
  .admin-login-metrics div {
    animation: designMdRise .56s cubic-bezier(.22,1,.36,1) both;
  }
}

@keyframes designMdRise {
  from {
    opacity: .82;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .admin-login-shell {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 32px;
  }
  .admin-login-card,
  .admin-login-status {
    width: min(100%, 520px);
    margin-left: 0;
  }
  .admin-login-hero h1 {
    max-width: 820px;
  }
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar-nav {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: 10px;
  }
  .admin-nav-kicker {
    display: none;
  }
  .admin-nav-item {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }
  .admin-stats {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 767px) {
  .navbar {
    height: 52px;
  }

  .login-product-wrap,
  .admin-login-shell {
    grid-template-columns: 1fr;
  }

  .login-hero-panel h1,
  .admin-login-hero h1 {
    font-size: clamp(2.6rem, 12vw, 4.2rem);
  }
}

.login-hero-panel h1 {
  max-width: 700px;
  font-size: clamp(2.85rem, 4.6vw, 4.15rem);
  line-height: 1.05;
}

.admin-login-hero h1 {
  max-width: 560px;
  font-size: clamp(2.8rem, 4.4vw, 4.1rem);
  line-height: 1.05;
}

@media (max-width: 767px) {
  .login-hero-panel h1,
  .admin-login-hero h1 {
    font-size: clamp(2.35rem, 11vw, 3.2rem);
    line-height: 1.08;
  }
}

/* Content library: dense horizontal cards, 5-up on wide screens. */
body .content-page {
  width: min(100%, 1900px);
}

body .content-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

body .content-card {
  display: grid;
  grid-template-columns: minmax(108px, 42%) minmax(0, 1fr);
  min-height: 176px;
  border-radius: 22px;
  background: rgba(250,249,245,.94);
}

body .content-card:not(:has(.cc-media)) {
  grid-template-columns: 1fr;
}

body .content-card:not(:has(.cc-media)) .cc-body {
  grid-column: 1 / -1;
}

body .content-card .cc-media {
  height: 100%;
  min-height: 176px;
  aspect-ratio: auto;
  border-radius: 22px 0 0 22px;
}

body .content-card .cc-media-item img,
body .content-card .cc-media-item video {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
}

body .content-card .cc-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px 14px 13px;
}

body .content-card .cc-title-row {
  align-items: flex-start;
  gap: 6px;
  flex-wrap: nowrap;
}

body .content-card .cc-title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: .95rem;
  line-height: 1.28;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body .content-card .cc-id {
  flex: 0 0 auto;
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .68rem;
}

body .content-card .cc-desc {
  margin: 7px 0 0;
  font-size: .78rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  min-height: 2.9em;
}

body .content-card .cc-desc:empty::before {
  content: '暂无描述';
  color: #87867f;
}

body .content-card .cc-meta {
  margin-top: 8px;
  gap: 5px;
}

body .content-card .cc-meta .badge {
  padding: 3px 8px;
  font-size: .68rem;
  line-height: 1.25;
}

body .content-card .platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-height: 48px;
  margin-top: 8px;
  overflow: hidden;
}

body .content-card .platform-chip {
  max-width: 100%;
  padding: 3px 7px;
  font-size: .68rem;
  line-height: 1.25;
}

body .content-card .cc-review {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.62);
}

body .content-card .cc-review-head {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 850;
}

body .content-card .cc-review-head .icon {
  width: 13px;
  height: 13px;
}

body .content-card .cc-review p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.35;
}

body .content-card .cc-review.low {
  border-color: rgba(79,125,90,.18);
  background: rgba(79,125,90,.08);
}

body .content-card .cc-review.low .cc-review-head { color: #3c6f47; }

body .content-card .cc-review.medium {
  border-color: rgba(185,106,58,.22);
  background: rgba(185,106,58,.1);
}

body .content-card .cc-review.medium .cc-review-head { color: var(--orange); }

body .content-card .cc-review.high {
  border-color: rgba(181,51,51,.22);
  background: rgba(181,51,51,.09);
}

body .content-card .cc-review.high .cc-review-head { color: var(--red); }

body .content-card .cc-review-empty {
  border-style: dashed;
  color: var(--muted);
}

body .content-card .cc-body > .cc-meta:last-child {
  margin-top: auto;
  padding-top: 9px;
}

body .content-card .cc-body > .cc-meta:last-child .btn {
  min-height: 28px;
  padding: 4px 8px;
  font-size: .68rem;
}

body .content-card .cc-media-badge {
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: rgba(20,20,19,.72);
}

body .content-card .cc-media-nav {
  width: 24px;
  height: 24px;
}

@media (max-width: 1680px) {
  body .content-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1320px) {
  body .content-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  body .content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  body .content-grid {
    grid-template-columns: 1fr;
  }

  body .content-card {
    grid-template-columns: minmax(112px, 38%) minmax(0, 1fr);
  }
}

/* ── External-trade Agent MVP pages ── */
.ops-page {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 28px 24px 56px;
}
.ops-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 22px;
}
.workspace-hero {
  grid-template-columns: minmax(0, 1fr);
}
.workspace-hero .ops-hero-copy {
  min-height: 260px;
}
.ops-hero::before {
  content: '';
  position: absolute;
  inset: -14px 0 auto auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(201,100,66,.2), rgba(201,100,66,0) 68%);
  pointer-events: none;
}
.ops-hero-compact {
  grid-template-columns: minmax(0, 1fr) 280px;
}
.ops-hero-copy,
.ops-hero > div:first-child,
.ops-hero-panel,
.ops-hero-card,
.ops-panel,
.ops-form-card,
.ops-side-card,
.ops-metric-card {
  background: rgba(250,249,245,.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ops-hero-copy,
.ops-hero > div:first-child {
  border-radius: 28px;
  padding: 32px;
  overflow: hidden;
}
.ops-hero h1 {
  max-width: 820px;
  margin-top: 8px;
  font-family: var(--font-serif);
  font-size: clamp(2.15rem, 4vw, 4.2rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
  color: var(--text);
}
.ops-hero p {
  max-width: 700px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
}
.ops-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.ops-hero-actions,
.ops-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.ops-hero-panel,
.ops-hero-card {
  position: relative;
  border-radius: 28px;
  padding: 24px;
  min-height: 220px;
  overflow: hidden;
}
.ops-hero-panel::after,
.ops-hero-card::after {
  content: '';
  position: absolute;
  right: -48px;
  bottom: -72px;
  width: 160px;
  height: 160px;
  border-radius: 42px;
  rotate: 14deg;
  background: linear-gradient(135deg, rgba(201,100,66,.14), rgba(79,125,90,.12));
}
.ops-hero-panel h2,
.ops-hero-card strong {
  display: block;
  margin-top: 12px;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.14;
}
.ops-hero-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.6;
}
.ops-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted-strong);
  border: 1px solid var(--border);
  font-size: .76rem;
  font-weight: 650;
}
.ops-chip.muted { color: var(--muted); background: var(--surface-muted); }
.ops-metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.ops-metric-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  padding: 17px 18px;
  min-height: 118px;
  color: var(--text);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.ops-metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-metric-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto auto;
  width: 72px;
  height: 72px;
  border-radius: 0 20px 0 999px;
  background: rgba(201,100,66,.08);
}
.ops-metric-card span,
.ops-metric-card small { display: block; color: var(--muted); }
.ops-metric-card span { font-size: .78rem; font-weight: 750; }
.ops-metric-card strong { display: block; margin-top: 10px; font-size: 2rem; line-height: 1; letter-spacing: -.04em; }
.ops-metric-card small { margin-top: 10px; font-size: .76rem; }
.ops-metric-card.green::before { background: rgba(79,125,90,.13); }
.ops-metric-card.orange::before { background: rgba(185,106,58,.14); }
.ops-metric-card.blue::before { background: rgba(56,152,236,.12); }
.ops-metric-card.dark::before { background: rgba(20,20,19,.1); }
.ops-priority-panel,
.ops-status-panel,
.ops-shortcuts-panel {
  margin-bottom: 18px;
}
.ops-status-panel .ops-metrics {
  margin-bottom: 0;
}
.ops-priority-list {
  display: grid;
  gap: 10px;
}
.ops-priority-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s, background .16s;
}
.ops-priority-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-priority-card.attention {
  border-color: rgba(181,51,51,.22);
  background: linear-gradient(180deg, #fff7f3, #fff);
}
.ops-priority-card.warning {
  border-color: rgba(185,106,58,.28);
  background: linear-gradient(180deg, #fff9ef, #fff);
}
.ops-priority-icon,
.ops-shortcut-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
}
.ops-priority-icon {
  width: 42px;
  height: 42px;
}
.ops-priority-icon .icon,
.ops-shortcut-icon .icon {
  width: 19px;
  height: 19px;
}
.ops-priority-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ops-priority-copy strong,
.ops-shortcut-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .95rem;
  font-weight: 850;
}
.ops-priority-copy small,
.ops-shortcut-copy small {
  overflow: hidden;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.42;
}
.ops-priority-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  white-space: nowrap;
  font-size: .78rem;
  font-weight: 850;
}
.ops-priority-action .icon {
  width: 14px;
  height: 14px;
}
.ops-priority-empty {
  display: grid;
  gap: 8px;
  text-align: left;
}
.ops-priority-empty strong {
  color: var(--text);
}
.ops-priority-empty p {
  margin: 0;
}
.ops-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.ops-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.ops-shortcut-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 11px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.ops-shortcut-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-shortcut-icon {
  width: 38px;
  height: 38px;
}
.ops-shortcut-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.ops-shortcut-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.ops-shortcut-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 24px;
  max-width: 72px;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 850;
}
.ops-activity-panel {
  margin-bottom: 18px;
}
.ops-activity-list {
  display: grid;
  gap: 9px;
}
.ops-activity-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.ops-activity-row:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-activity-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--accent);
}
.ops-activity-icon .icon {
  width: 18px;
  height: 18px;
}
.ops-activity-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.ops-activity-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
  font-weight: 850;
}
.ops-activity-copy small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.42;
}
.ops-chat-panel { margin-bottom: 18px; }
.ops-report-panel { margin-bottom: 18px; background: linear-gradient(135deg, #fffaf2, #f7f1e7); border-color: #eee3d4; }
.ops-report-body { display: grid; gap: 12px; }
.ops-report-empty { color: var(--muted); font-size: .9em; line-height: 1.6; }
.ops-report-summary { white-space: pre-wrap; color: #4f463d; line-height: 1.62; margin: 0; }
.ops-report-cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 16px;
  border: 1px solid #eadfce;
  border-radius: 18px;
  background: rgba(255,255,255,.68);
}
.ops-report-cover h3 {
  margin: 5px 0 7px;
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.15;
}
.ops-report-cover p {
  max-width: 920px;
  margin: 0;
  color: #65594d;
  font-size: .9rem;
  line-height: 1.65;
}
.ops-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ops-report-metric {
  min-height: 96px;
  padding: 14px;
  border: 1px solid #eadfce;
  border-radius: 16px;
  background: rgba(255,255,255,.76);
}
.ops-report-metric span,
.ops-report-metric small {
  display: block;
  color: var(--muted);
  font-size: .76rem;
  font-weight: 750;
}
.ops-report-metric strong {
  display: block;
  margin: 10px 0 9px;
  color: var(--text);
  font-size: 1.7rem;
  line-height: 1;
}
.ops-report-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ops-report-list { display: grid; gap: 8px; }
.ops-report-list h3 { margin: 0 0 2px; font-size: .92em; color: #3f382f; }
.ops-report-pill { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid #eadfce; border-radius: 13px; background: rgba(255,255,255,.66); color: #65594d; font-size: .84em; }
.ops-report-pill span {
  min-width: 0;
  line-height: 1.45;
}
.ops-report-pill .icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--accent);
}
.ops-report-pill.attention,
.ops-report-pill.warning { border-color: rgba(201,100,66,.28); background: rgba(201,100,66,.08); color: #9a4d32; }
.ops-chat-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.ops-chat-box textarea {
  min-height: 78px;
  margin: 0;
  border-radius: 18px;
  background: #fff;
  resize: vertical;
}
.ops-chat-box .btn {
  min-width: 104px;
  justify-content: center;
}
.ops-chat-result {
  display: grid;
  grid-template-columns: minmax(0, .9fr) repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.ops-chat-reply,
.ops-chat-card {
  display: grid;
  gap: 5px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.ops-chat-reply.ok { border-color: rgba(79,125,90,.22); background: rgba(79,125,90,.07); }
.ops-chat-reply.warn { border-color: rgba(185,106,58,.24); background: rgba(185,106,58,.08); }
.ops-chat-reply strong,
.ops-chat-card strong {
  font-size: .86rem;
  font-weight: 850;
}
.ops-chat-reply p,
.ops-chat-card p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
  white-space: pre-line;
}
.ops-agent-section { margin-bottom: 18px; }
.ops-agent-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}
.ops-agent-card {
  display: grid;
  align-content: start;
  gap: 9px;
  min-height: 168px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s, background .16s;
}
.ops-agent-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-agent-card.attention {
  background: linear-gradient(180deg, #fff7ef, #fff);
  border-color: rgba(185,106,58,.3);
}
.ops-agent-card.running {
  background: linear-gradient(180deg, #fff9ef, #fff);
  border-color: rgba(201,100,66,.28);
}
.ops-agent-card.ready {
  background: linear-gradient(180deg, #f5fbf2, #fff);
  border-color: rgba(79,125,90,.22);
}
.ops-agent-card.planned {
  background: linear-gradient(180deg, #f5f4ed, #fff);
}
.ops-agent-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ops-agent-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #f3f1e9;
  color: var(--accent);
}
.ops-agent-icon .icon { width: 18px; height: 18px; }
.ops-agent-card strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.16;
}
.ops-agent-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  color: var(--muted-strong);
  font-size: .8rem;
  line-height: 1.45;
}
.ops-agent-card small {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}
.ops-layout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, .75fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}
.ops-layout-grid.bottom {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.ops-layout-grid.bottom.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ops-layout-grid.bottom.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.ops-panel,
.ops-form-card,
.ops-side-card {
  border-radius: 24px;
  padding: 22px;
}
.ops-panel-head,
.ops-form-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.ops-panel-head.tight { margin-bottom: 12px; }
.ops-panel h2,
.ops-form-head h2,
.ops-side-card h3 {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.55rem;
  line-height: 1.16;
}
.ops-panel p,
.ops-form-head p,
.ops-side-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}
.ops-form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
  align-items: start;
}
.ops-form-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.ops-form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ops-form-grid.compact { margin-bottom: 10px; }
.ops-field {
  display: block;
  margin: 0;
  color: var(--muted-strong);
  font-size: .8rem;
  font-weight: 760;
}
.ops-field input,
.ops-field select,
.ops-field textarea {
  margin-top: 7px;
  border-radius: 14px;
  background: #fff;
}
.ops-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: .8rem;
  font-weight: 760;
}
.ops-check-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 18px;
  padding: 0;
  list-style: none;
}
.ops-check-list li {
  position: relative;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}
.ops-check-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .63em;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
}
.ops-platforms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.ops-platforms label {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.ops-platforms input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ops-platforms span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #f3f1e9;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 780;
  transition: background .16s, color .16s, border-color .16s, box-shadow .16s;
}
.ops-platforms input:checked + span {
  border-color: rgba(79,125,90,.58);
  background: #edf8ed;
  color: #2f6f3f;
  box-shadow: 0 0 0 3px rgba(79,125,90,.1);
}
.ops-wide-btn { width: 100%; min-height: 42px; }
.ops-action-list,
.ops-list,
.ops-generated {
  display: grid;
  gap: 9px;
}
.ops-action-card,
.ops-list-row,
.ops-generated-item {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.ops-action-card:hover,
.ops-list-row:hover,
.ops-generated-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.ops-action-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}
.ops-action-card small { grid-column: 2; color: var(--muted); font-size: .74rem; }
.ops-action-dot {
  grid-row: 1 / span 2;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
}
.ops-list-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.ops-list-row strong,
.ops-generated-item strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .92rem;
}
.ops-list-row p,
.ops-generated-item p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}
.ops-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 180px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 800;
}
.ops-status.published,
.ops-status.succeeded,
.ops-status.done,
.ops-status.ready { background: rgba(79,125,90,.13); color: #3c6f47; }
.ops-status.failed,
.ops-status.attention { background: rgba(181,51,51,.1); color: var(--red); }
.ops-status.publishing,
.ops-status.partial,
.ops-status.queued,
.ops-status.running,
.ops-status.needs_review,
.ops-status.ready_to_publish { background: rgba(185,106,58,.13); color: var(--orange); }
.ops-status.idle,
.ops-status.planned { background: #f3f1e9; color: var(--muted); }
.ops-empty {
  padding: 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  color: var(--muted);
  background: rgba(255,255,255,.55);
  text-align: center;
}
.ops-generated { margin-top: 14px; }
.ops-generated-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.ops-generated-platform {
  color: var(--accent);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.ops-generated-item small {
  color: var(--muted);
  font-size: .74rem;
}

/* ── Unified executor resource pool ── */
.executors-page {
  max-width: 1480px;
}
.executor-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at 92% 18%, rgba(201,100,66,.18), transparent 20rem),
    radial-gradient(circle at 14% 0%, rgba(79,125,90,.13), transparent 18rem),
    var(--card);
  box-shadow: var(--shadow-md);
}
.executor-hero::after {
  content: "";
  position: absolute;
  right: 28px;
  top: 24px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(201,100,66,.28);
  border-radius: 42% 58% 50% 50%;
  transform: rotate(-12deg);
  pointer-events: none;
}
.executor-hero h1 {
  position: relative;
  margin: 6px 0 8px;
  max-width: 720px;
  font-family: var(--font-serif);
  font-size: clamp(2.1rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.04em;
}
.executor-hero p {
  position: relative;
  max-width: 780px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}
.executor-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.executor-summary-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(250,249,245,.84);
  box-shadow: var(--shadow-sm);
}
.executor-summary-icon,
.executor-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
}
.executor-summary-icon {
  width: 42px;
  height: 42px;
}
.executor-summary-icon .icon,
.executor-avatar .icon {
  width: 20px;
  height: 20px;
}
.executor-summary-card strong {
  display: block;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 500;
  line-height: 1;
}
.executor-summary-card span,
.executor-summary-card small {
  display: block;
  color: var(--muted);
  font-size: .8rem;
}
.executor-section {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(250,249,245,.74);
  box-shadow: var(--shadow-sm);
}
.executor-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.executor-section-head h2 {
  margin: 3px 0 4px;
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 500;
}
.executor-section-head p {
  max-width: 700px;
  color: var(--muted);
  font-size: .9rem;
}
.executor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.executor-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.executor-card.good { border-color: rgba(79,125,90,.32); }
.executor-card.warn { border-color: rgba(185,106,58,.36); }
.executor-card.bad,
.executor-card.offline { border-color: rgba(181,51,51,.22); }
.executor-card-top {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.executor-avatar {
  width: 44px;
  height: 44px;
  background: #edf6e9;
  color: var(--green);
}
.executor-title-wrap {
  min-width: 0;
}
.executor-title-wrap strong,
.executor-title-wrap small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.executor-title-wrap strong {
  color: var(--text);
  font-size: .98rem;
  font-weight: 850;
}
.executor-title-wrap small {
  color: var(--muted);
  font-size: .74rem;
}
.executor-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: .72rem;
  font-weight: 850;
}
.executor-status.online { background: rgba(79,125,90,.13); color: var(--green); }
.executor-status.busy { background: rgba(185,106,58,.14); color: var(--orange); }
.executor-status.offline { background: rgba(181,51,51,.08); color: var(--red); }
.executor-health {
  display: grid;
  gap: 7px;
}
.executor-health-head {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: .76rem;
}
.executor-health-head strong {
  color: var(--text);
}
.executor-health-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #ede9dc;
}
.executor-health-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
.executor-card.warn .executor-health-bar span { background: var(--orange); }
.executor-card.bad .executor-health-bar span,
.executor-card.offline .executor-health-bar span { background: var(--red); }
.executor-meta {
  display: grid;
  gap: 8px;
}
.executor-meta > div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}
.executor-meta span {
  color: var(--muted);
  font-size: .74rem;
}
.executor-meta strong {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: .82rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.executor-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.executor-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 800;
}
.executor-chip.ok {
  background: rgba(79,125,90,.12);
  color: var(--green);
}
.executor-chip.muted {
  opacity: .62;
}
.executor-issues {
  display: grid;
  gap: 6px;
  padding-top: 2px;
}
.executor-issues span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--orange);
  font-size: .78rem;
  line-height: 1.42;
}
.executor-issues span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.executor-issues.empty span {
  color: var(--green);
}
.executor-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed var(--border-strong);
  border-radius: 20px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  text-align: center;
}

/* ── Business thread drawer ── */
.thread-drawer-open { overflow: hidden; }
.thread-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  justify-content: flex-end;
  background: rgba(33, 28, 23, .22);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.thread-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.thread-drawer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(520px, 100vw);
  height: 100%;
  border-left: 1px solid var(--border);
  background:
    radial-gradient(circle at 12% 8%, rgba(201,100,66,.12), transparent 28%),
    linear-gradient(180deg, #fffaf0 0%, #f7f1e7 100%);
  box-shadow: -18px 0 44px rgba(35, 29, 24, .18);
  transform: translateX(24px);
  transition: transform .2s ease;
}
.thread-drawer-overlay.open .thread-drawer { transform: translateX(0); }
.thread-drawer-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 253, 248, .72);
  backdrop-filter: blur(12px);
}
.thread-drawer-kicker {
  color: var(--accent);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.thread-drawer-head h2 {
  overflow: hidden;
  margin: 5px 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-drawer-head p {
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.thread-drawer-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: var(--muted);
  cursor: pointer;
}
.thread-drawer-close:hover {
  color: var(--accent);
  border-color: rgba(201,100,66,.28);
  background: #fff;
}
.thread-drawer-body {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  overflow: auto;
}
.thread-message {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  box-shadow: var(--shadow-sm);
}
.thread-message.system,
.thread-message.event,
.thread-message.approval { background: rgba(237,246,233,.72); }
.thread-message.agent {
  border-color: rgba(201,100,66,.2);
  background: rgba(255,247,235,.86);
}
.thread-message-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
}
.thread-message-meta span:first-child { color: var(--text); }
.thread-message-meta time {
  margin-left: auto;
  font-weight: 600;
}
.thread-message-content {
  color: var(--text);
  font-size: .9rem;
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}
.thread-message-payload {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.thread-message-payload div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255,255,255,.62);
}
.thread-message-payload span,
.thread-message-payload strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.thread-message-payload span {
  color: var(--muted);
  font-size: .68rem;
}
.thread-message-payload strong {
  margin-top: 2px;
  color: var(--text);
  font-size: .74rem;
  font-weight: 800;
}
.thread-drawer-empty {
  margin: 24px 0;
  padding: 22px;
  border: 1px dashed rgba(201,100,66,.32);
  border-radius: 16px;
  background: rgba(255,255,255,.55);
  text-align: center;
}
.thread-drawer-empty strong {
  display: block;
  color: var(--text);
  font-size: .96rem;
}
.thread-drawer-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .84rem;
}
.thread-drawer-compose {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
  background: rgba(255,253,248,.86);
}
.thread-drawer-compose textarea {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
}
.thread-drawer-compose textarea:focus {
  border-color: rgba(201,100,66,.42);
  box-shadow: 0 0 0 3px rgba(201,100,66,.1);
}
.thread-drawer-compose-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.thread-drawer-compose-actions span {
  color: var(--muted);
  font-size: .76rem;
}

/* ── Channel workspace ── */
.channels-page {
  height: calc(100dvh - 54px);
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}
.channels-shell {
  --channel-accent: var(--accent);
  --channel-soft: var(--accent-soft);
  --channels-left-width: 300px;
  --channels-right-width: 420px;
  display: grid;
  grid-template-columns: var(--channels-left-width) 12px minmax(420px, 1fr) 12px minmax(320px, var(--channels-right-width));
  gap: 0;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  margin: 0;
}
.channels-shell:not(.detail-collapsed) {
  grid-template-columns: var(--channels-left-width) 12px minmax(0, 1fr) 12px minmax(320px, var(--channels-right-width));
}
.channels-shell.detail-collapsed {
  grid-template-columns: var(--channels-left-width) 12px minmax(420px, 1fr);
}
.channels-shell.detail-collapsed .channel-detail,
.channels-shell.detail-collapsed .channel-resize-handle.right {
  display: none;
}
.channels-shell.sidebar-auto-hidden:not(.detail-collapsed) {
  grid-template-columns: minmax(320px, 1fr) 12px minmax(320px, var(--channels-right-width));
}
.channels-shell.sidebar-auto-hidden .channels-sidebar,
.channels-shell.sidebar-auto-hidden .channel-resize-handle.left {
  display: none;
}
.channels-shell.detail-full-width:not(.detail-collapsed) {
  grid-template-columns: 12px minmax(0, 1fr);
}
.channels-shell.detail-full-width .channels-sidebar,
.channels-shell.detail-full-width .channel-main,
.channels-shell.detail-full-width .channel-resize-handle.left {
  display: none;
}
.channel-resize-handle {
  position: relative;
  z-index: 4;
  min-width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}
.channel-resize-handle::before {
  content: "";
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 50%;
  width: 2px;
  border-radius: 999px;
  background: rgba(20, 20, 19, .12);
  transform: translateX(-50%);
  transition: width .14s ease, background .14s ease, box-shadow .14s ease;
}
.channel-resize-handle:hover::before,
.channel-resize-handle.dragging::before {
  width: 4px;
  background: color-mix(in srgb, var(--channel-accent) 58%, rgba(20,20,19,.16));
  box-shadow: 0 0 0 5px var(--channel-soft);
}
body.channel-layout-resizing {
  cursor: col-resize;
  user-select: none;
}
.channels-sidebar,
.channel-main,
.channel-detail {
  position: relative;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(250,249,245,.88);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.channel-main,
.channel-detail {
  border-color: color-mix(in srgb, var(--channel-accent) 20%, var(--border));
  box-shadow:
    inset 4px 0 0 color-mix(in srgb, var(--channel-accent) 42%, transparent),
    var(--shadow-sm);
}
.channels-sidebar {
  display: grid;
  grid-template-rows: auto minmax(116px, 32%) minmax(0, 1fr);
}
.channels-sidebar.channels-sidebar-compact {
  grid-template-rows: auto minmax(0, 1fr);
}
.channels-brand {
  padding: 20px 18px 16px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 18% 8%, rgba(201,100,66,.13), transparent 30%),
    rgba(255,253,248,.7);
}
.channels-brand h1 {
  display: none;
  margin: 5px 0 7px;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.12;
}
.channels-brand p {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.55;
}
.channels-brand .channel-pane-back {
  margin-top: 10px;
  margin-bottom: 0;
}
.channel-sidebar-add-human,
.channel-mobile-actions {
  display: none;
}
.channel-workspace-menu {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: rgba(255,253,248,.52);
}
.channel-workspace-menu[hidden] {
  display: none;
}
.channel-workspace-nav {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .84rem;
  font-weight: 850;
  text-align: left;
  cursor: pointer;
}
.channel-workspace-nav .icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
}
.channel-workspace-nav .icon svg {
  width: 15px;
  height: 15px;
}
.channel-workspace-nav:hover,
.channel-workspace-nav.active {
  border-color: color-mix(in srgb, var(--channel-accent) 25%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-workspace-nav.active .icon {
  border-color: color-mix(in srgb, var(--channel-accent) 30%, var(--border));
  background: rgba(255,255,255,.9);
}
.channel-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 12px 12px 14px;
  border-bottom: 1px solid var(--border);
  overflow: auto;
}
.channel-list[hidden] {
  display: none;
}
.channels-sidebar-compact .channels-brand {
  padding-bottom: 12px;
}
.channels-sidebar-compact .channel-roster {
  padding-top: 12px;
  border-top: 0;
}
.channel-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto 1fr;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: var(--text);
}
.channel-section-head strong {
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.channel-section-head > span {
  color: rgba(94,93,89,.62);
  font-size: .78rem;
  font-weight: 900;
}
.channel-items {
  position: relative;
  display: grid;
  gap: 8px;
  margin-left: 9px;
  padding-left: 17px;
  border-left: 1px solid rgba(20,20,19,.12);
}
.channel-nav-item {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.channel-nav-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(20,20,19,.14);
}
.channel-nav-item:hover {
  background: rgba(255,255,255,.58);
}
.channel-nav-item.active {
  border-color: color-mix(in srgb, var(--channel-accent) 34%, var(--border));
  background:
    linear-gradient(90deg, var(--channel-soft), rgba(255,255,255,.62));
  box-shadow: inset 3px 0 0 var(--channel-accent);
}
.channel-nav-item.active::after {
  content: "";
  position: absolute;
  right: -30px;
  top: 50%;
  width: 30px;
  height: 2px;
  background: var(--channel-accent);
  opacity: .48;
  transform: translateY(-50%);
}
.channel-nav-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  color: var(--channel-accent);
}
.channel-nav-copy strong,
.channel-nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-nav-copy strong {
  font-size: .9rem;
  font-weight: 850;
}
.channel-nav-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: .72rem;
}
.channel-roster {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 12px 12px 16px;
  overflow: auto;
}
.roster-section {
  display: grid;
  gap: 8px;
}
.roster-section.collapsed {
  gap: 0;
}
.roster-section.collapsed .roster-items {
  display: none;
}
.roster-section.collapsed .roster-collapse .icon {
  transform: rotate(-90deg);
}
.roster-collapse .icon {
  transition: transform .16s ease;
}
.roster-section-head {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto 1fr auto;
  gap: 7px;
  align-items: center;
  min-height: 28px;
  color: var(--text);
}
.roster-section-head strong {
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .14em;
}
.roster-section-head > span {
  color: rgba(94,93,89,.62);
  font-size: .78rem;
  font-weight: 900;
}
.roster-collapse,
.roster-add {
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.roster-collapse {
  width: 18px;
  height: 18px;
}
.roster-collapse .icon {
  width: 13px;
  height: 13px;
}
.roster-add {
  width: 28px;
  height: 28px;
  border-color: rgba(20,20,19,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--text);
}
.roster-add:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.roster-items {
  position: relative;
  display: grid;
  gap: 7px;
  margin-left: 9px;
  padding-left: 17px;
  border-left: 1px solid rgba(20,20,19,.12);
}
.roster-item {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 3px 5px 3px 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.roster-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 50%;
  width: 10px;
  height: 1px;
  background: rgba(20,20,19,.14);
}
.roster-item:hover {
  background: rgba(255,255,255,.52);
}
.roster-avatar {
  position: relative;
  isolation: isolate;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(20,20,19,.18);
  border-radius: 7px;
  background: rgba(255,255,255,.7);
  overflow: visible;
}
.roster-avatar.has-image {
  overflow: hidden;
  padding: 0;
  background: rgba(255,255,255,.86);
}
.roster-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.roster-item.working .roster-avatar {
  border-color: rgba(201,100,66,.46);
  box-shadow:
    0 0 0 3px rgba(255,248,225,.92),
    0 0 0 6px rgba(201,100,66,.13),
    0 10px 22px rgba(201,100,66,.18);
}
.roster-item.working .roster-avatar.has-image {
  overflow: visible;
}
.roster-item.working .roster-avatar.has-image img {
  border-radius: 7px;
}
.roster-item.working .roster-avatar::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -7px;
  border-radius: 14px;
  background: conic-gradient(
    from 0deg,
    transparent 0 18deg,
    rgba(255,214,94,.98) 20deg 31deg,
    transparent 34deg 128deg,
    rgba(201,100,66,.9) 136deg 151deg,
    transparent 155deg 252deg,
    rgba(79,125,90,.78) 260deg 273deg,
    transparent 277deg 360deg
  );
  filter: drop-shadow(0 0 7px rgba(201,100,66,.42));
  animation: roster-avatar-orbit 1.65s linear infinite;
}
.roster-item.working .roster-avatar::after {
  content: "";
  position: absolute;
  z-index: 3;
  top: -8px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #ffd65e;
  box-shadow:
    0 0 0 3px rgba(255,214,94,.24),
    0 0 12px rgba(255,214,94,.9);
  transform: translateX(-50%);
  animation: roster-avatar-dot 1.65s ease-in-out infinite;
}
.roster-item.working .roster-avatar > * {
  position: relative;
  z-index: 2;
}
.roster-avatar.agent {
  border-color: rgba(95,110,203,.24);
  background: rgba(95,110,203,.11);
  color: #4f59a5;
}
.roster-avatar.amber,
.channel-avatar.amber { border-color: rgba(154,106,22,.2); background: rgba(255,217,66,.28); color: #9a6a16; }
.roster-avatar.teal,
.channel-avatar.teal { border-color: rgba(37,138,130,.22); background: rgba(37,138,130,.14); color: #1f756f; }
.roster-avatar.green,
.channel-avatar.green { border-color: rgba(79,125,90,.22); background: rgba(79,125,90,.14); color: #3f7650; }
.roster-avatar.blue,
.channel-avatar.blue { border-color: rgba(95,110,203,.24); background: rgba(95,110,203,.14); color: #4f59a5; }
.roster-avatar.red,
.channel-avatar.red { border-color: rgba(181,51,51,.22); background: rgba(181,51,51,.12); color: #9c3030; }
.roster-avatar.sand,
.channel-avatar.sand { border-color: rgba(201,100,66,.2); background: rgba(201,100,66,.1); color: #76604b; }
.roster-avatar.human {
  border-color: rgba(107,98,92,.18);
  background: rgba(255,255,255,.82);
  color: #6b625c;
}
.roster-avatar.computer,
.roster-avatar.phone {
  border-color: transparent;
  background: transparent;
}
.roster-copy {
  display: grid;
  min-width: 0;
}
.roster-copy strong,
.roster-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-copy strong {
  font-size: .88rem;
  font-weight: 850;
}
.roster-copy small {
  color: rgba(94,93,89,.68);
  font-size: .72rem;
  font-weight: 650;
}
.roster-presence {
  width: 11px;
  height: 11px;
  border: 2px solid var(--text);
  border-radius: 999px;
  background: #9da6b6;
}
.roster-item.online .roster-presence {
  background: #76b87a;
}
.roster-item.working .roster-presence {
  background: #76b87a;
}
.roster-item.offline .roster-presence {
  border-color: #2f2e2a;
  background: #4b4a45;
  box-shadow: none;
}
.roster-item.error .roster-presence {
  background: #e05555;
}
@keyframes roster-avatar-orbit {
  to {
    transform: rotate(360deg);
  }
}
@keyframes roster-avatar-dot {
  0%, 100% {
    opacity: .72;
    transform: translateX(-50%) scale(.86);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .roster-item.working .roster-avatar::before,
  .roster-item.working .roster-avatar::after {
    animation: none;
  }
}
.roster-empty {
  margin-left: 9px;
  padding: 4px 0 4px 17px;
  border-left: 1px solid rgba(20,20,19,.12);
  color: var(--muted);
  font-size: .76rem;
}
.roster-detail-card {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 18px;
  min-height: 100%;
  background:
    radial-gradient(circle at 0% 0%, var(--channel-soft), transparent 30%),
    rgba(255,253,248,.82);
}
.roster-detail-card.phone-detail {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 10px;
  height: 100%;
  padding: 16px;
  overflow: hidden;
}
.phone-detail .roster-detail-head {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
}
.phone-detail .roster-detail-head .roster-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}
.phone-detail .roster-detail-head h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.phone-detail .roster-detail-head p {
  font-size: .78rem;
  line-height: 1.35;
}
.phone-detail .roster-detail-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.phone-detail .roster-detail-fields div {
  padding: 8px 9px;
  border-radius: 12px;
}
.phone-detail .roster-detail-fields div:last-child {
  grid-column: 1 / -1;
}
.phone-detail .roster-detail-actions {
  display: none;
}
.roster-detail-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}
.roster-detail-top-actions {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-self: end;
}
.roster-detail-close {
  width: 30px;
  height: 30px;
  background: rgba(255,255,255,.88);
  box-shadow: 0 4px 14px rgba(35,31,27,.08);
}
.roster-detail-head .roster-avatar {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}
.roster-detail-head h2 {
  display: none;
  margin: 3px 0 5px;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.16;
}
.roster-detail-head p,
.roster-detail-summary {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
.roster-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.roster-detail-fields div {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(232,230,220,.88);
  border-radius: 13px;
  background: rgba(255,255,255,.72);
}
.roster-detail-fields span,
.roster-detail-fields strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-detail-fields span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}
.roster-detail-fields strong {
  margin-top: 4px;
  color: var(--text);
  font-size: .8rem;
  font-weight: 850;
}
.roster-detail-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.phone-control-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(232,230,220,.9);
  border-radius: 18px;
  background: rgba(255,255,255,.66);
  box-shadow: 0 8px 24px rgba(35,31,27,.045);
}
.phone-detail .phone-control-panel {
  height: 100%;
  padding: 12px;
  overflow: hidden;
}
.phone-control-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.phone-control-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.phone-control-fullscreen,
.phone-control-close,
.phone-control-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,.86);
  color: var(--muted);
  cursor: pointer;
}
.phone-control-drag {
  cursor: grab;
}
.phone-control-close {
  display: none;
}
.phone-preview-panel .phone-control-close {
  display: inline-flex;
}
.phone-control-fullscreen:hover,
.phone-control-close:hover,
.phone-control-drag:hover {
  border-color: rgba(201,100,66,.36);
  color: var(--accent);
  background: #fffaf5;
}
.phone-control-fullscreen .icon,
.phone-control-close .icon,
.phone-control-drag .icon {
  width: 15px;
  height: 15px;
}
.phone-control-head strong,
.phone-control-head span {
  display: block;
}
.phone-control-head strong {
  color: var(--text);
  font-size: .84rem;
  font-weight: 850;
}
.phone-control-title,
.roster-detail-inline-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.phone-control-title strong,
.roster-detail-inline-edit span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-control-name-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.phone-control-name-edit:hover {
  border-color: rgba(201,100,66,.24);
  background: rgba(201,100,66,.08);
  color: var(--accent);
}
.phone-control-name-edit .icon {
  width: 13px;
  height: 13px;
}
.phone-control-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 720;
}
.phone-control-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.phone-control-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 11px;
  background: rgba(255,255,255,.82);
  color: var(--muted-strong);
  cursor: pointer;
}
.phone-control-icon-btn:hover:not(:disabled) {
  border-color: rgba(201,100,66,.34);
  background: #fffaf5;
  color: var(--accent);
}
.phone-control-icon-btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}
.phone-control-icon-btn.is-active {
  border-color: rgba(201,100,66,.5);
  background: #fff3ea;
  color: var(--accent);
}
.phone-control-icon-btn .icon {
  width: 15px;
  height: 15px;
}
.phone-control-action-group {
  display: grid;
  gap: 7px;
  min-width: 0;
}
.phone-control-action-group strong {
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 850;
}
.phone-control-text-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  min-width: 0;
}
.phone-control-text-input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.82);
  color: var(--text);
  font: inherit;
  font-size: .78rem;
  line-height: 1.35;
  resize: vertical;
}
.phone-control-text-send {
  min-height: 36px;
  white-space: nowrap;
}
.phone-control-drawer,
.phone-control-action-drawer {
  min-width: 0;
}
.phone-control-drawer {
  position: relative;
}
.phone-control-footer {
  display: grid;
  min-width: 0;
}
.phone-control-screen-row {
  display: grid;
  min-width: 0;
  min-height: 0;
}
.phone-control-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.78);
  color: var(--muted-strong);
  font-size: .72rem;
  font-weight: 820;
  cursor: pointer;
  user-select: none;
}
.phone-control-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}
.phone-control-ui-tree {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
}
.phone-control-ui-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(20,20,19,.08);
}
.phone-control-ui-tree-head strong {
  color: var(--text);
  font-size: .75rem;
  font-weight: 860;
}
.phone-control-ui-tree-status {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 760;
  white-space: nowrap;
}
.phone-control-ui-tree-content {
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 10px;
  overflow: auto;
  color: var(--text);
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}
.phone-control-ui-tree-row {
  border-radius: 4px;
  padding: 0 3px;
}
.phone-control-ui-tree-row.is-click {
  cursor: pointer;
  color: var(--accent, #1976d2);
}
.phone-control-ui-tree-row.is-click:hover {
  background: rgba(25, 118, 210, 0.12);
}
.phone-control-ui-tree-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.phone-control-ui-tree-mode {
  border: 1px solid rgba(20,20,19,.16);
  border-radius: 999px;
  background: rgba(255,255,255,.6);
  color: var(--muted);
  font-size: .66rem;
  font-weight: 800;
  line-height: 1;
  padding: 3px 9px;
  cursor: pointer;
}
.phone-control-ui-tree-mode:hover {
  border-color: rgba(25,118,210,.4);
  color: var(--text);
}
.phone-control-ui-tree-mode.is-active {
  border-color: rgba(25,118,210,.5);
  background: rgba(25,118,210,.12);
  color: var(--accent, #1976d2);
}
.phone-control-ui-tree-node > .phone-control-ui-tree-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.phone-control-ui-tree-caret {
  flex: none;
  width: 13px;
  text-align: center;
  color: var(--muted);
  user-select: none;
}
.phone-control-ui-tree-caret.is-toggle {
  cursor: pointer;
}
.phone-control-ui-tree-caret.is-toggle:hover {
  color: var(--text);
}
.phone-control-ui-tree-line {
  flex: 1 1 auto;
  min-width: 0;
}
.phone-control-drawer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.phone-control-drawer-row .phone-control-drawer {
  flex: 0 0 auto;
}
.phone-control-drawer-row details[open] {
  flex: 1 0 100%;
}
.phone-control-drawer[open] .phone-control-actions,
.phone-control-drawer[open] .phone-control-info-grid {
  margin-top: 8px;
}
.phone-control-action-drawer summary,
.phone-control-drawer summary,
.phone-fullscreen-actions summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 10px;
  background: rgba(255,255,255,.78);
  color: var(--muted-strong);
  font-size: .76rem;
  font-weight: 820;
  cursor: pointer;
  user-select: none;
}
.phone-control-action-drawer summary::-webkit-details-marker,
.phone-control-drawer summary::-webkit-details-marker,
.phone-fullscreen-actions summary::-webkit-details-marker {
  display: none;
}
.phone-control-action-drawer summary .icon,
.phone-control-drawer summary .icon,
.phone-fullscreen-actions summary .icon {
  width: 14px;
  height: 14px;
}
.phone-control-action-drawer[open] .phone-control-actions {
  margin-top: 8px;
}
.phone-control-action-drawer[open] .phone-control-text-group {
  margin-top: 8px;
}
.phone-control-info-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 9px;
  min-width: 0;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(20,20,19,.08);
  border-radius: 10px;
  background: rgba(255,255,255,.62);
  font-size: .72rem;
}
.phone-control-info-grid dt {
  color: var(--muted);
  font-weight: 760;
}
.phone-control-info-grid dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 780;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-control-shot {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 240px;
  max-height: min(560px, calc(100vh - 360px));
  overflow: hidden;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 18px;
  background: #111;
}
.phone-detail .phone-control-shot {
  min-height: 0;
  height: 100%;
  max-height: none;
}
.phone-control-shot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(560px, calc(100vh - 360px));
  object-fit: contain;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}
.phone-detail .phone-control-shot img {
  max-height: 100%;
}
.phone-control-shot img[hidden],
.phone-control-placeholder[hidden] {
  display: none;
}
.phone-control-ui-overlay {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
.phone-control-ui-node {
  position: absolute;
  box-sizing: border-box;
  min-width: 10px;
  min-height: 10px;
  border: 1px solid rgba(74, 180, 118, .9);
  border-radius: 4px;
  background: rgba(74, 180, 118, .08);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.16);
}
.phone-control-ui-node.is-click {
  border-color: rgba(245, 181, 67, .95);
  background: rgba(245, 181, 67, .12);
}
.phone-control-ui-node-label {
  position: absolute;
  top: -1px;
  left: -1px;
  max-width: 180px;
  padding: 2px 5px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(16,16,16,.82);
  color: #fff;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-control-ui-node-badge {
  position: absolute;
  right: -1px;
  bottom: -1px;
  padding: 1px 4px;
  border-radius: 4px 0 3px 0;
  background: rgba(245, 181, 67, .96);
  color: #20160a;
  font-size: 9px;
  font-weight: 860;
  line-height: 1.2;
  text-transform: uppercase;
}
.phone-control-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 240px;
  color: rgba(255,255,255,.52);
  font-size: .78rem;
  font-weight: 750;
}
.phone-control-placeholder .icon {
  width: 28px;
  height: 28px;
  opacity: .62;
}
.channel-main.has-phone-preview {
  isolation: isolate;
}
.phone-preview-dock {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  padding: 16px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(20,20,19,.18), transparent 42%),
    linear-gradient(180deg, rgba(250,249,245,.08), rgba(250,249,245,.24));
}
.admin-phone-preview-dock {
  position: fixed;
  z-index: 1200;
}
.phone-preview-panel {
  position: relative;
  grid-template-rows: minmax(0, 1fr) auto;
  width: var(--phone-preview-panel-width, min(320px, calc(100% - 24px)));
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  gap: 8px;
  padding: 4px;
  border-color: rgba(255,255,255,.16);
  border-radius: 16px;
  background: #101010;
  box-shadow: 0 16px 44px rgba(20,20,19,.22);
  overflow: hidden;
  pointer-events: auto;
  transform: translate3d(var(--phone-preview-offset-x, 0px), var(--phone-preview-offset-y, 0px), 0);
  will-change: transform;
}
.phone-preview-panel.show-ui-tree {
  width: min(calc(100vw - 24px), calc(var(--phone-preview-shot-width, 300px) + 372px));
}
body.phone-preview-dragging {
  user-select: none;
}
.phone-preview-panel .phone-control-head {
  position: absolute;
  top: 10px;
  right: 10px;
  left: 10px;
  z-index: 5;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.phone-preview-panel .phone-control-head-actions,
.phone-preview-panel .phone-control-drag,
.phone-preview-panel .phone-control-title {
  pointer-events: auto;
}
.phone-preview-panel .phone-control-head strong {
  color: #fff;
}
.phone-preview-panel .phone-control-title {
  max-width: min(46vw, 260px);
  padding: 5px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 999px;
  background: rgba(16,16,16,.48);
  backdrop-filter: blur(10px);
}
.phone-preview-panel .phone-control-name-edit {
  color: rgba(255,255,255,.72);
}
.phone-preview-panel .phone-control-status {
  color: rgba(255,255,255,.64);
}
.phone-preview-panel .phone-control-close,
.phone-preview-panel .phone-control-drag,
.phone-preview-panel .phone-control-drawer summary,
.phone-preview-panel .phone-control-action-drawer summary,
.phone-preview-panel .phone-control-actions .btn {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
}
.phone-preview-panel .phone-control-drag {
  border-color: rgba(255,255,255,.18);
  background: rgba(16,16,16,.62);
  color: rgba(255,255,255,.76);
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
  backdrop-filter: blur(10px);
  touch-action: none;
}
.phone-preview-panel .phone-control-drag:active,
.phone-preview-panel.is-dragging .phone-control-drag {
  cursor: grabbing;
}
.phone-preview-panel .phone-control-close {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-color: rgba(255,255,255,.42);
  background: rgba(16,16,16,.82);
  color: #fff;
  box-shadow: 0 12px 26px rgba(0,0,0,.32), 0 0 0 1px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}
.phone-preview-panel .phone-control-close:hover {
  border-color: rgba(255,255,255,.72);
  background: rgba(201,100,66,.96);
  color: #fff;
}
.phone-preview-panel .phone-control-close .icon {
  width: 19px;
  height: 19px;
}
.phone-preview-panel .phone-control-drawer summary {
  white-space: nowrap;
}
.phone-preview-panel .phone-control-action-drawer[open] .phone-control-actions {
  margin-top: 0;
}
.phone-preview-panel .phone-control-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  justify-self: center;
  width: min(100%, var(--phone-preview-shot-width, 300px));
  min-width: 0;
  padding: 0 2px 2px;
  pointer-events: auto;
}
.phone-preview-panel .phone-control-quick-actions {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(16,16,16,.64);
  box-shadow: 0 12px 26px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}
.phone-preview-panel .phone-control-icon-btn {
  width: 32px;
  height: 32px;
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.86);
}
.phone-preview-panel .phone-control-icon-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,.38);
  background: rgba(255,255,255,.16);
  color: #fff;
}
.phone-preview-panel .phone-control-compact-drawer {
  position: relative;
  margin-left: auto;
  pointer-events: auto;
}
.phone-preview-panel .phone-control-compact-drawer > summary {
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-color: rgba(255,255,255,.14);
  background: rgba(16,16,16,.72);
  color: rgba(255,255,255,.86);
  box-shadow: 0 10px 24px rgba(0,0,0,.22);
  backdrop-filter: blur(10px);
}
.phone-preview-panel .phone-control-compact-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 3;
  display: grid;
  gap: 9px;
  width: min(320px, calc(100vw - 48px));
  max-height: min(440px, calc(100vh - 180px));
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(16,16,16,.98);
  box-shadow: 0 16px 38px rgba(0,0,0,.32);
  margin-top: 0;
}
.phone-preview-panel .phone-control-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.phone-preview-panel .phone-control-menu-title {
  color: rgba(255,255,255,.86);
  font-size: .78rem;
  font-weight: 860;
}
.phone-preview-panel .phone-control-menu-status {
  min-width: 0;
  overflow: hidden;
  color: rgba(255,255,255,.56);
  font-size: .7rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phone-preview-panel .phone-control-action-group {
  gap: 6px;
}
.phone-preview-panel .phone-control-action-group strong {
  color: rgba(255,255,255,.54);
  font-size: .68rem;
}
.phone-preview-panel .phone-control-text-input {
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.phone-preview-panel .phone-control-text-input::placeholder {
  color: rgba(255,255,255,.42);
}
.phone-preview-panel .phone-control-text-send {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
}
.phone-preview-panel .phone-control-toggle {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.88);
}
.phone-preview-panel .phone-control-action-group .phone-control-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.phone-preview-panel .phone-control-actions .btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: .72rem;
}
.phone-preview-panel .phone-control-info-grid {
  border-color: rgba(255,255,255,.1);
  background: rgba(255,255,255,.06);
}
.phone-preview-panel .phone-control-info-grid dt {
  color: rgba(255,255,255,.5);
}
.phone-preview-panel .phone-control-info-grid dd {
  color: rgba(255,255,255,.84);
}
.phone-preview-panel .phone-control-info-drawer {
  width: 100%;
}
.phone-preview-panel .phone-control-info-drawer > summary {
  width: 100%;
  justify-content: flex-start;
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.78);
}
.phone-preview-panel .phone-control-drawer[open] .phone-control-info-grid {
  border-color: rgba(255,255,255,.12);
  background: rgba(16,16,16,.98);
}
.phone-preview-panel .phone-control-screen-row {
  align-self: stretch;
  justify-self: center;
  width: var(--phone-preview-shot-width, min(300px, 100%));
  max-width: 100%;
  height: var(--phone-preview-shot-height, min(50vh, 520px));
  max-height: 100%;
}
.phone-preview-panel.show-ui-tree .phone-control-screen-row {
  grid-template-columns: var(--phone-preview-shot-width, min(300px, 100%)) minmax(260px, 360px);
  gap: 8px;
  width: min(calc(100vw - 32px), calc(var(--phone-preview-shot-width, 300px) + 368px));
}
/* In UI-tree mode the panel is wide; stretch the footer across it so the
   settings popup anchors to the panel's right edge instead of floating over
   the live screenshot. */
.phone-preview-panel.show-ui-tree .phone-control-footer {
  width: 100%;
}
.phone-preview-panel .phone-control-shot {
  aspect-ratio: var(--phone-screen-aspect, 9 / 16);
  justify-self: center;
  width: 100%;
  max-width: 100%;
  min-height: 160px;
  height: 100%;
  max-height: 100%;
  padding: 3px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px;
  background: #000;
}
.phone-preview-panel > .phone-control-shot {
  width: var(--phone-preview-shot-width, min(300px, 100%));
  height: var(--phone-preview-shot-height, min(50vh, 520px));
}
.phone-preview-panel .phone-control-ui-tree {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  border-color: rgba(255,255,255,.12);
  background: rgba(16,16,16,.88);
}
.phone-preview-panel .phone-control-ui-tree[hidden] {
  display: none;
}
/* Side column hosting UI tree + OmniParser panels stacked; each takes an equal
   share when both are visible. */
.phone-control-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  min-height: 0;
}
.phone-control-side[hidden] {
  display: none;
}
.phone-control-side > .phone-control-ui-tree {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}
/* When the settings drawer sits leftmost in the footer, anchor its popup to
   the left edge instead of the right. */
.phone-preview-panel .phone-control-compact-drawer:first-child .phone-control-compact-menu {
  left: 0;
  right: auto;
}
.phone-preview-panel .phone-control-ui-tree-head {
  border-bottom-color: rgba(255,255,255,.1);
}
.phone-preview-panel .phone-control-ui-tree-head strong {
  color: rgba(255,255,255,.86);
}
.phone-preview-panel .phone-control-ui-tree-status {
  color: rgba(255,255,255,.48);
}
.phone-preview-panel .phone-control-ui-tree-content {
  color: rgba(255,255,255,.78);
}
.phone-preview-panel .phone-control-shot img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.phone-preview-panel .phone-control-placeholder {
  min-height: 160px;
  height: 100%;
  color: rgba(255,255,255,.56);
}
.phone-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 18px;
  background: rgba(20,20,19,.78);
  opacity: 0;
  pointer-events: none;
  transition: opacity .14s ease;
  overflow: hidden;
}
.phone-fullscreen-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.phone-fullscreen-card {
  box-sizing: border-box;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(72vw, 760px);
  max-width: calc(100vw - 36px);
  height: auto;
  max-height: calc(100vh - 36px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: #101010;
  box-shadow: 0 28px 90px rgba(0,0,0,.42);
}
.phone-fullscreen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  color: #fff;
}
.phone-fullscreen-head strong,
.phone-fullscreen-head span {
  display: block;
}
.phone-fullscreen-head strong {
  font-size: .94rem;
  font-weight: 850;
}
.phone-fullscreen-head span {
  margin-top: 2px;
  color: rgba(255,255,255,.64);
  font-size: .76rem;
  font-weight: 650;
}
.phone-fullscreen-actions {
  min-width: 0;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.045);
}
.phone-fullscreen-actions summary {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.phone-fullscreen-action-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 9px;
}
.phone-fullscreen-actions .btn {
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
}
.phone-fullscreen-actions .btn:hover:not(:disabled) {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.3);
}
.phone-fullscreen-actions .btn:disabled {
  opacity: .45;
}
.phone-fullscreen-shot {
  display: grid;
  place-items: center;
  min-height: 0;
  height: min(var(--phone-shot-height, 76vh), calc(100vh - 188px));
  max-height: calc(100vh - 188px);
  overflow: hidden;
  background: #000;
  padding: 10px;
}
.phone-fullscreen-shot img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: crosshair;
  user-select: none;
}
.agent-lifecycle-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(232,230,220,.9);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(107,98,92,.07), transparent 34%),
    rgba(255,255,255,.66);
  box-shadow: 0 8px 24px rgba(35,31,27,.045);
}
.agent-lifecycle-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}
.agent-lifecycle-head strong,
.agent-lifecycle-head span {
  display: block;
}
.agent-lifecycle-head strong {
  color: var(--text);
  font-size: .84rem;
  font-weight: 850;
}
.agent-lifecycle-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.4;
}
.agent-lifecycle-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.agent-direct-draft {
  margin-top: 2px;
  overflow: visible;
  border: 1px solid rgba(232,230,220,.86);
  border-radius: 18px;
}
.agent-direct-draft-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
}
.agent-direct-draft-head strong {
  color: var(--text);
  font-size: .86rem;
  font-weight: 850;
}
.agent-direct-draft-head span {
  color: var(--muted);
  font-size: .72rem;
}
.channel-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
}
.channel-main-head {
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 8% 12%, var(--channel-soft), transparent 34%),
    rgba(255,253,248,.74);
}
.channel-main-head .ops-kicker,
.channel-detail-head .ops-kicker {
  color: var(--channel-accent);
}
.channel-main-head h2 {
  display: none;
  margin: 4px 0 5px;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 500;
}
.channel-main-head p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: .82rem;
}
.channel-mobile-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--channel-accent) 18%, var(--border));
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
}
.channel-mobile-action.primary {
  border-color: color-mix(in srgb, var(--channel-accent) 28%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-mobile-action:hover {
  border-color: color-mix(in srgb, var(--channel-accent) 38%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-mobile-action .icon {
  width: 15px;
  height: 15px;
}
.channel-filters {
  grid-row: 2;
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.channel-filter-spacer {
  flex: 1 0 16px;
}
.channel-workspace-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 0;
  background: rgba(255,253,248,.56);
}
.channel-workspace-tabs[hidden] {
  display: none;
}
.channel-workspace-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: var(--muted);
  font: inherit;
  font-size: .78rem;
  font-weight: 860;
  cursor: pointer;
}
.channel-workspace-tab .icon {
  width: 14px;
  height: 14px;
}
.channel-workspace-tab:hover,
.channel-workspace-tab.active {
  border-color: color-mix(in srgb, var(--channel-accent) 30%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-filter {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
}
.channel-filter:hover,
.channel-filter.active {
  border-color: color-mix(in srgb, var(--channel-accent) 26%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-mark-read-all {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--channel-accent) 26%, var(--border));
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--channel-accent);
  font: inherit;
  font-size: .78rem;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.channel-mark-read-all:hover {
  background: var(--channel-soft);
}
.channel-mark-read-all:disabled {
  cursor: default;
  opacity: .6;
}
.channel-mark-read-all .icon {
  width: 14px;
  height: 14px;
}
.channel-quick-compose {
  grid-row: 4;
  display: grid;
  gap: 9px;
  min-height: 0;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(circle at 8% 8%, rgba(201,100,66,.08), transparent 30%),
    rgba(255,253,248,.9);
}
.channel-quick-compose[hidden] {
  display: none !important;
}
.channel-quick-compose textarea {
  width: 100%;
  min-height: 82px;
  max-height: 144px;
  resize: vertical;
  border: 1px solid rgba(209,207,197,.78);
  border-radius: 18px;
  background: rgba(255,255,255,.9);
  color: var(--text);
  font: inherit;
  font-size: .92rem;
  line-height: 1.52;
  padding: 13px 14px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 8px 22px rgba(20,20,19,.035);
}
.channel-quick-compose textarea:focus {
  border-color: color-mix(in srgb, var(--channel-accent) 45%, var(--border));
  box-shadow: 0 0 0 3px var(--channel-soft);
}
.channel-quick-reply {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: fit-content;
  max-width: 100%;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--channel-accent) 22%, var(--border));
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font-size: .76rem;
  font-weight: 760;
}
.channel-quick-reply[hidden] {
  display: none;
}
.channel-quick-reply > .icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  color: var(--channel-accent);
}
.channel-quick-reply strong,
.channel-quick-reply small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-quick-reply strong {
  flex: 0 1 auto;
  max-width: 18ch;
  color: var(--text);
}
.channel-quick-reply small {
  flex: 1 1 auto;
  max-width: 46ch;
}
.channel-quick-reply-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(20,20,19,.06);
  color: var(--muted);
  cursor: pointer;
}
.channel-quick-reply-clear:hover {
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-quick-reply-clear .icon {
  width: 13px;
  height: 13px;
}
.channel-agent-hints {
  display: flex;
  gap: 7px;
  align-items: center;
  overflow-x: auto;
}
.channel-agent-hint-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 820;
}
.channel-agent-hint,
.channel-tool-button,
.channel-task-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 820;
  cursor: pointer;
}
.channel-agent-hint:hover,
.channel-tool-button:hover,
.channel-task-toggle:hover {
  border-color: color-mix(in srgb, var(--channel-accent) 28%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-agent-hint .icon,
.channel-tool-button .icon {
  width: 14px;
  height: 14px;
}
.mention-picker {
  display: grid;
  gap: 5px;
  width: min(360px, 100%);
  max-height: 218px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  border: 1px solid rgba(201,100,66,.18);
  border-radius: 15px;
  background: rgba(255,253,248,.98);
  box-shadow: 0 18px 42px rgba(91,70,54,.14);
}
.mention-picker::-webkit-scrollbar {
  width: 8px;
}
.mention-picker::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255,253,248,.98);
  border-radius: 999px;
  background: rgba(107,98,92,.32);
}
.mention-picker::-webkit-scrollbar-track {
  background: transparent;
}
.mention-picker-title {
  padding: 2px 5px 5px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
}
.mention-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.mention-option:hover,
.mention-option.active {
  border-color: rgba(201,100,66,.2);
  background: rgba(255,248,238,.88);
}
.mention-option-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.mention-option-copy strong,
.mention-option-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-option-copy strong {
  font-size: .78rem;
  font-weight: 850;
}
.mention-option-copy small {
  color: var(--muted);
  font-size: .68rem;
}
.channel-task-toggle input {
  accent-color: var(--channel-accent);
}
.channel-attachment-drafts {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  min-height: 0;
}
.channel-attachment-drafts.uploading {
  opacity: .68;
}
.channel-attachment-draft {
  display: inline-grid;
  grid-template-columns: 16px minmax(0, 1fr) 18px;
  gap: 6px;
  align-items: center;
  max-width: 220px;
  min-height: 30px;
  padding: 0 6px 0 9px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--text);
  font-size: .72rem;
  font-weight: 780;
}
.channel-attachment-draft span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-attachment-draft .icon {
  width: 14px;
  height: 14px;
  color: var(--channel-accent);
}
.channel-attachment-draft button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(20,20,19,.06);
  color: var(--muted);
  cursor: pointer;
}
.channel-attachment-draft button .icon {
  width: 11px;
  height: 11px;
  color: inherit;
}
.channel-quick-compose-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  align-items: center;
}
.channel-compose-controls {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.channel-compose-shortcut {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
  white-space: nowrap;
}
.channel-quick-compose-actions span {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}
.channel-quick-compose-actions .btn-primary,
.channel-compose-actions .btn-primary {
  border: 1px solid var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(201,100,66,.18), 0 10px 26px rgba(201,100,66,.18);
  transform: none;
}
.channel-quick-compose-actions .btn-primary:hover,
.channel-compose-actions .btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
  box-shadow: 0 0 0 1px rgba(201,100,66,.18), 0 10px 26px rgba(201,100,66,.18);
  transform: none;
}
.channel-quick-compose-actions .btn-primary:disabled,
.channel-quick-compose-actions .btn-primary:disabled:hover,
.channel-compose-actions .btn-primary:disabled,
.channel-compose-actions .btn-primary:disabled:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: #faf9f5;
  opacity: .45;
  box-shadow: 0 0 0 1px rgba(201,100,66,.12), 0 6px 16px rgba(201,100,66,.1);
  transform: none;
}
.thread-stream {
  grid-row: 3;
  display: grid;
  align-content: start;
  gap: 14px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scroll-behavior: auto;
}
.chat-new-message-notice {
  position: absolute;
  z-index: 70;
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--channel-accent) 30%, var(--border));
  border-radius: 999px;
  background: rgba(255,253,248,.94);
  color: var(--channel-accent);
  font: inherit;
  font-size: .74rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(20,20,19,.14);
  cursor: pointer;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}
.chat-new-message-notice.visible {
  display: inline-flex;
}
.chat-new-message-notice:hover {
  border-color: color-mix(in srgb, var(--channel-accent) 48%, var(--border));
  background: rgba(255,255,255,.98);
}
.chat-new-message-notice .icon {
  width: 14px;
  height: 14px;
}
.channel-feed-message {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  cursor: context-menu;
}
.channel-feed-message.is-openable .channel-message-content {
  cursor: pointer;
}
.channel-feed-message.human {
  justify-self: start;
}
.channel-feed-message.agent {
  justify-self: start;
}
.channel-feed-message.system,
.channel-feed-message.event,
.channel-feed-message.command_result,
.channel-feed-message.evidence {
  justify-self: start;
  max-width: 100%;
}
.channel-feed-message .channel-message-meta {
  gap: 7px;
}
.channel-feed-message .channel-message-body,
.channel-feed-message.compact .channel-message-body {
  width: 100%;
  max-width: 100%;
}
.channel-feed-message.compact .channel-message-content {
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.channel-feed-actions {
  display: flex;
  grid-column: 2;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-top: 1px;
  flex-wrap: wrap;
}
.channel-thread-replies,
.channel-task-updates,
.channel-load-older {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(209,207,197,.78);
  border-radius: 999px;
  background: rgba(255,255,255,.68);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 840;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(20,20,19,.035);
}
.channel-thread-replies:hover,
.channel-task-updates:hover,
.channel-load-older:hover {
  border-color: color-mix(in srgb, var(--channel-accent) 28%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-thread-replies .icon,
.channel-task-updates .icon {
  width: 14px;
  height: 14px;
}
.channel-task-updates {
  border-color: rgba(95,110,203,.18);
  background: rgba(95,110,203,.07);
  color: #515ba6;
}
.channel-message-menu {
  position: fixed;
  z-index: 1200;
  display: grid;
  min-width: 132px;
  padding: 5px;
  border: 1px solid rgba(209,207,197,.82);
  border-radius: 12px;
  background: rgba(255,253,248,.96);
  box-shadow: 0 18px 42px rgba(20,20,19,.14);
  backdrop-filter: blur(10px);
}
.channel-message-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .82rem;
  font-weight: 780;
  text-align: left;
  cursor: pointer;
}
.channel-message-menu button:hover {
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-message-menu button.danger {
  color: var(--red);
}
.channel-message-menu button.danger:hover {
  background: #fff2f0;
  color: var(--red);
}
.channel-message-menu .icon {
  width: 15px;
  height: 15px;
  color: currentColor;
}
.channel-load-older {
  justify-self: center;
  margin: 2px 0 6px;
}
.channel-feed-thread-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 220px;
  overflow: hidden;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--channel-soft);
  color: var(--channel-accent) !important;
  border: 0;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-feed-thread-hint.is-clickable {
  cursor: pointer;
}
.channel-feed-thread-hint.is-clickable:hover {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--channel-accent) 26%, transparent);
}
.channel-feed-thread-hint.has-unread {
  background: rgba(201,100,66,.13);
  color: var(--accent) !important;
}
.channel-task-list {
  display: grid;
  align-content: start;
  gap: 10px;
}
.channel-reminder-list {
  display: grid;
  align-content: start;
  gap: 10px;
}
.channel-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(232,230,220,.92);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, var(--channel-soft), transparent 30%),
    rgba(255,255,255,.78);
  box-shadow: 0 1px 0 rgba(255,255,255,.72);
  cursor: default;
  transition: border-color .15s ease, transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.channel-task-card.is-clickable {
  cursor: pointer;
}
.channel-task-card.is-clickable:hover,
.channel-task-card.is-clickable:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--channel-accent) 32%, var(--border));
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(20,20,19,.045);
}
.channel-task-card:focus-visible,
.channel-reminder-main.is-clickable:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--channel-accent) 24%, transparent);
  outline-offset: 2px;
}
.channel-task-card.running,
.channel-task-card.open {
  border-color: color-mix(in srgb, var(--channel-accent) 22%, var(--border));
}
.channel-task-card.waiting_human {
  border-color: rgba(185,106,58,.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(185,106,58,.12), transparent 32%),
    rgba(255,255,255,.8);
}
.channel-task-card.resolved {
  border-color: rgba(79,125,90,.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(79,125,90,.12), transparent 32%),
    rgba(255,255,255,.82);
}
.channel-task-card.cancelled {
  border-color: rgba(94,93,89,.18);
  background: rgba(255,255,255,.78);
}
.channel-task-card.active {
  border-color: color-mix(in srgb, var(--channel-accent) 42%, var(--border));
  background:
    linear-gradient(90deg, var(--channel-soft), rgba(255,255,255,.82));
  box-shadow:
    inset 3px 0 0 var(--channel-accent),
    0 4px 12px rgba(20,20,19,.045);
}
.channel-task-card.has-unread,
.channel-reminder-card.has-unread,
.material-work-card.has-unread {
  border-color: rgba(201,100,66,.38);
  box-shadow: 0 0 0 1px rgba(201,100,66,.08), 0 10px 24px rgba(20,20,19,.06);
}
.channel-unread-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(201,100,66,.12);
}
.channel-reminder-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid rgba(232,230,220,.92);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201,100,66,.1), transparent 30%),
    rgba(255,255,255,.78);
  box-shadow: 0 1px 0 rgba(255,255,255,.72);
  cursor: default;
  transition: border-color .15s ease, transform .15s ease, background .15s ease, box-shadow .15s ease;
}
.channel-reminder-card.is-clickable {
  cursor: pointer;
}
.channel-reminder-card.is-clickable:hover,
.channel-reminder-card.is-clickable:focus-visible,
.channel-reminder-card:has(.channel-reminder-main.is-clickable:hover),
.channel-reminder-card:has(.channel-reminder-main.is-clickable:focus-visible) {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--channel-accent) 32%, var(--border));
  background: rgba(255,255,255,.92);
  box-shadow: 0 4px 12px rgba(20,20,19,.045);
}
.channel-reminder-card.running,
.channel-reminder-card.pending {
  border-color: color-mix(in srgb, var(--channel-accent) 22%, var(--border));
}
.channel-reminder-card.cancelled {
  opacity: .72;
}
.channel-reminder-card.done {
  border-color: rgba(79,125,90,.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(79,125,90,.12), transparent 32%),
    rgba(255,255,255,.82);
}
.channel-reminder-card.active {
  border-color: color-mix(in srgb, var(--channel-accent) 42%, var(--border));
  background:
    linear-gradient(90deg, var(--channel-soft), rgba(255,255,255,.82));
  box-shadow:
    inset 3px 0 0 var(--channel-accent),
    0 4px 12px rgba(20,20,19,.045);
}
.channel-task-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.channel-reminder-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.channel-reminder-main.is-clickable {
  cursor: pointer;
  border-radius: 12px;
}
.channel-task-topline {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.channel-task-type,
.channel-task-work-status {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 860;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.channel-task-work-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20,20,19,.05);
  letter-spacing: 0;
  text-transform: none;
}
.channel-task-main h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: .94rem;
  font-weight: 880;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-reminder-main h3 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: .94rem;
  font-weight: 880;
  line-height: 1.32;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-task-main p {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.42;
}
.channel-reminder-main p {
  margin: 0;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.42;
}
.channel-task-actions {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 128px;
}
.channel-task-actions .btn-primary {
  min-width: 112px;
  height: 34px;
  border: 1px solid rgba(79,125,90,.24);
  border-radius: 8px;
  background: rgba(79,125,90,.1);
  color: #3f6b49;
  font-size: .78rem;
  font-weight: 820;
  box-shadow: none;
  opacity: 1;
}
.channel-task-actions .btn-primary:hover,
.channel-task-card.active .channel-task-actions .btn-primary:hover {
  border-color: #4f7d5a;
  background: #4f7d5a;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79,125,90,.16);
  opacity: 1;
}
.channel-task-card.active .channel-task-actions .btn-primary {
  border-color: rgba(79,125,90,.24);
  background: rgba(79,125,90,.1);
  color: #3f6b49;
  box-shadow: none;
  opacity: 1;
}
.channel-task-actions .btn-primary:disabled,
.channel-task-actions .btn-primary:disabled:hover {
  border-color: rgba(79,125,90,.14);
  background: rgba(79,125,90,.06);
  color: rgba(63,107,73,.5);
  box-shadow: none;
  opacity: .72;
}
.channel-task-work-status.sync {
  background: rgba(95,110,203,.08);
  color: #515ba6;
}
.channel-task-actions .danger {
  border-color: rgba(181,51,51,.18);
  color: #9c3030;
}
.channel-task-actions .danger:hover {
  border-color: rgba(181,51,51,.32);
  background: rgba(181,51,51,.08);
  color: #8f2b2b;
}
.channel-thread-card {
  position: relative;
  display: grid;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255,255,255,.64);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.channel-thread-card:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.84);
}
.channel-thread-card.active {
  border-color: color-mix(in srgb, var(--channel-accent) 38%, var(--border));
  background:
    linear-gradient(90deg, var(--channel-soft), rgba(255,255,255,.74));
  box-shadow: inset 3px 0 0 var(--channel-accent);
}
.channel-thread-card.active::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  width: 12px;
  height: 2px;
  background: var(--channel-accent);
  opacity: .45;
  transform: translateY(-50%);
}
.channel-thread-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}
.channel-thread-type {
  color: var(--channel-accent);
  font-size: .67rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.channel-thread-card h3 {
  overflow: hidden;
  margin: 4px 0 0;
  font-size: .94rem;
  font-weight: 850;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-thread-card p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}
.channel-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(94,93,89,.1);
  color: var(--muted);
  white-space: nowrap;
  font-size: .7rem;
  font-weight: 850;
}
.channel-status.waiting_human {
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-status.running {
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-status.needs_review {
  background: rgba(255,217,66,.24);
  color: #8f6417;
}
.channel-status.resolved {
  background: rgba(79,125,90,.13);
  color: var(--green);
}
.channel-status.failed {
  background: rgba(181,51,51,.1);
  color: #9c3030;
}
.channel-status.cancelled {
  background: rgba(94,93,89,.1);
  color: var(--muted);
}
.channel-status.archived {
  opacity: .72;
}
.channel-detail-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.channel-detail-close {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(20,20,19,.12);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  color: var(--muted);
  cursor: pointer;
}
.channel-detail-close:hover {
  border-color: rgba(201,100,66,.24);
  color: var(--accent);
}
.channel-detail {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}
.channel-detail.has-thread-support {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
}
.channel-detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 8% 12%, var(--channel-soft), transparent 30%),
    rgba(255,253,248,.74);
}
.channel-detail-leading {
  display: grid;
  min-width: 0;
  gap: 0;
}
.channel-pane-back {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: fit-content;
  min-height: 32px;
  margin-bottom: 8px;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--channel-accent) 24%, var(--border));
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  color: var(--channel-accent);
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
  cursor: pointer;
}
.channel-pane-back .icon {
  width: 14px;
  height: 14px;
}
.channel-pane-back:hover {
  background: var(--channel-soft);
  border-color: color-mix(in srgb, var(--channel-accent) 38%, var(--border));
}
.channel-detail-breadcrumb {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 820;
}
.channel-detail-breadcrumb span:first-child {
  color: var(--channel-accent);
}
.channel-detail-breadcrumb span + span::before {
  content: "/";
  margin-right: 6px;
  color: rgba(94,93,89,.54);
}
.channel-detail-head h2 {
  display: none;
  max-width: 100%;
  overflow: hidden;
  margin: 4px 0 5px;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 500;
  line-height: 1.24;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-detail-title-wrap,
.thread-drawer-title-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  outline: none;
}
.inline-title-edit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.inline-title-edit-text {
  min-width: 0;
}
.inline-title-edit-action {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  opacity: .42;
  transition: opacity .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.inline-title-edit:hover .inline-title-edit-action,
.inline-title-edit:focus-within .inline-title-edit-action {
  opacity: 1;
}
.inline-title-edit-action:hover {
  border-color: rgba(201,100,66,.24);
  background: rgba(201,100,66,.08);
  color: var(--accent);
}
.inline-title-edit-action:disabled {
  cursor: wait;
  opacity: .5;
}
.inline-title-edit-action .icon {
  width: 14px;
  height: 14px;
}
.channel-list-title-wrap .inline-title-edit {
  width: fit-content;
}
.channel-detail-title-edit {
  width: min(520px, 100%);
}
.channel-detail-title-edit .inline-title-edit-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  letter-spacing: 0;
  text-transform: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-list-title-wrap {
  width: fit-content;
  max-width: 100%;
}
.channel-detail-title-popover,
.thread-drawer-title-popover {
  display: none;
}
.channel-detail-head p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}
.channel-detail-thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  margin-top: 7px;
  color: var(--muted);
  font-size: .74rem;
}
.channel-detail-thread-meta span {
  min-width: 0;
}
.channel-detail-thread-id {
  max-width: 100%;
  overflow: hidden;
  padding: 2px 7px;
  border: 1px solid rgba(116, 110, 101, .2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .62);
  color: #57514a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-detail-head {
  padding: 14px 16px;
  background:
    radial-gradient(circle at 10% 10%, rgba(201,100,66,.14), transparent 32%),
    linear-gradient(180deg, rgba(255,253,248,.88), rgba(250,249,245,.72));
}
.material-detail-head .ops-kicker {
  display: block;
  margin-bottom: 0;
  color: var(--accent);
  font-size: .7rem;
}
.material-chat-stream {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  background:
    linear-gradient(180deg, rgba(245,244,237,.3), rgba(255,253,248,.56)),
    var(--card);
}
.material-message-pair {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.material-bubble {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.material-bubble > span,
.material-bubble-meta {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 850;
}
.material-bubble-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.material-bubble-meta strong {
  color: var(--muted);
  font: inherit;
}
.material-bubble-meta time {
  color: rgba(94,93,89,.72);
  font-size: .66rem;
  font-weight: 720;
}
.material-bubble.user {
  justify-items: end;
}
.material-bubble.user p {
  max-width: min(86%, 330px);
  margin: 0;
  padding: 9px 11px;
  border: 1px solid rgba(201,100,66,.17);
  border-radius: 14px 14px 4px 14px;
  background: rgba(243,228,218,.68);
  color: var(--text);
  font-size: .82rem;
  line-height: 1.48;
}
.material-bubble.system {
  justify-items: start;
}
.material-work-card {
  width: min(100%, 320px);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 0 0 1px rgba(209,207,197,.48), 0 10px 28px rgba(20,20,19,.055);
}
.material-work-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 9 / 12;
  max-height: 230px;
  overflow: hidden;
  background: #141413;
}
.material-work-media.video {
  aspect-ratio: 9 / 16;
  max-height: 280px;
}
.material-work-media img,
.material-work-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.material-work-media.previewable {
  cursor: zoom-in;
}
.material-work-media.previewable:focus-visible {
  outline: 3px solid rgba(201,100,66,.28);
  outline-offset: 3px;
}
.material-work-zoom {
  position: absolute;
  z-index: 1;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(20,20,19,.64);
  color: #fff;
  font-size: .66rem;
  font-weight: 820;
  opacity: .92;
  pointer-events: none;
}
.material-work-zoom .icon {
  width: 12px;
  height: 12px;
}
.material-work-file-id {
  position: absolute;
  z-index: 2;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: calc(100% - 96px);
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(250,249,245,.88);
  color: #2a2926;
  font-size: .64rem;
  font-weight: 840;
  box-shadow: 0 6px 18px rgba(20,20,19,.16);
  cursor: copy;
}
.material-work-file-id code {
  overflow: hidden;
  max-width: 96px;
  color: inherit;
  font: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-work-badge {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(20,20,19,.72);
  color: #fff;
  font-size: .68rem;
  font-weight: 850;
}
.material-work-badge.completed {
  background: rgba(79,125,90,.92);
}
.material-work-badge.failed {
  background: rgba(181,51,51,.92);
}
.material-work-placeholder {
  display: grid;
  place-items: center;
  min-height: 140px;
  padding: 18px;
  color: rgba(250,249,245,.72);
  font-size: .82rem;
  text-align: center;
}
.material-work-card.processing .material-work-placeholder::before,
.material-work-card.pending .material-work-placeholder::before {
  content: "";
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
  border: 2px solid rgba(250,249,245,.2);
  border-top-color: rgba(250,249,245,.78);
  border-radius: 999px;
  animation: spin .9s linear infinite;
}
.material-work-body {
  display: grid;
  gap: 9px;
  padding: 10px;
}
.material-work-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 720;
}
.material-work-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.material-work-actions .btn {
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .7rem;
}
.material-empty {
  display: grid;
  gap: 10px;
  align-content: center;
  justify-items: start;
  min-height: 220px;
  padding: 18px;
  border: 1px dashed rgba(201,100,66,.24);
  border-radius: 18px;
  background: rgba(255,253,248,.72);
  color: var(--muted);
}
.material-empty strong {
  color: var(--text);
  font-size: .94rem;
}
.material-empty p {
  margin: 0;
  font-size: .8rem;
  line-height: 1.55;
}
.material-example-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.material-example-row button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
  font: inherit;
  font-size: .72rem;
  font-weight: 820;
  cursor: pointer;
}
.material-example-row button:hover {
  border-color: rgba(201,100,66,.24);
  background: var(--accent-soft);
  color: var(--accent);
}
.material-composer {
  display: grid;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255,253,248,.9);
}
.material-composer textarea {
  width: 100%;
  min-height: 76px;
  max-height: 150px;
  resize: vertical;
  border: 0;
  outline: 0;
  border-radius: 14px;
  background: rgba(255,255,255,.76);
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  line-height: 1.5;
  padding: 10px 12px;
  box-shadow: inset 0 0 0 1px rgba(20,20,19,.09);
}
.material-composer textarea:focus,
.material-composer textarea:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(201,100,66,.34), 0 0 0 3px rgba(201,100,66,.1);
}
.material-ref-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 24px;
  align-items: flex-start;
}
.material-ref-empty {
  color: var(--muted);
  font-size: .72rem;
}
.material-ref-card {
  position: relative;
  display: grid;
  gap: 6px;
  align-items: start;
  width: 88px;
  min-width: 0;
  padding: 6px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 16px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 0 0 1px rgba(209,207,197,.32), 0 8px 18px rgba(20,20,19,.035);
}
.material-ref-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #141413;
  color: rgba(250,249,245,.84);
}
.material-ref-thumb.previewable {
  cursor: zoom-in;
}
.material-ref-thumb img,
.material-ref-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.material-ref-thumb > .icon {
  width: 18px;
  height: 18px;
}
.material-ref-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(20,20,19,.22);
  color: #fff;
}
.material-ref-play .icon {
  width: 18px;
  height: 18px;
}
.material-ref-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.material-ref-copy strong {
  color: var(--text);
  font-size: .7rem;
  font-weight: 850;
}
.material-ref-copy span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-ref-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(250,249,245,.92);
  color: rgba(20,20,19,.7);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(20,20,19,.12);
}
.material-ref-remove:hover {
  background: var(--accent-soft);
  color: var(--accent);
}
.material-ref-remove .icon {
  width: 11px;
  height: 11px;
}
.material-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  min-height: 26px;
  padding: 0 5px 0 8px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--text);
  font-size: .72rem;
  font-weight: 780;
}
.material-ref-chip > span:not(.icon) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-ref-chip .icon {
  width: 13px;
  height: 13px;
  color: var(--accent);
}
.material-ref-chip button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 999px;
  background: rgba(20,20,19,.06);
  color: var(--muted);
  cursor: pointer;
}
.material-ref-chip button .icon {
  width: 11px;
  height: 11px;
  color: inherit;
}
.material-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}
.material-controls select {
  flex: 0 1 auto;
  min-width: 82px;
  max-width: 154px;
  min-height: 30px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted-strong);
  font: inherit;
  font-size: .72rem;
  font-weight: 820;
  padding: 0 24px 0 10px;
  outline: 0;
}
.material-controls select:focus {
  border-color: rgba(201,100,66,.34);
  box-shadow: 0 0 0 3px rgba(201,100,66,.1);
}
.material-controls select[hidden],
.material-controls [hidden] {
  display: none;
}
.material-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.material-submit-row span {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 760;
}
.material-submit-row .btn-primary {
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(201,100,66,.18), 0 10px 26px rgba(201,100,66,.18);
}
.material-submit-row .btn-primary:hover {
  border-color: var(--accent-hover);
  background: var(--accent-hover);
}
.channel-link-strip {
  display: flex;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.channel-link-strip span,
.channel-link-chip {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  border: 0;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  font-family: inherit;
  line-height: 1.2;
  white-space: nowrap;
}
.channel-link-chip.is-clickable {
  cursor: pointer;
}
.channel-link-chip.is-clickable:hover {
  color: var(--text);
  background: rgba(255,255,255,.95);
}
.channel-link-strip.empty {
  color: var(--muted);
  font-size: .78rem;
}
.thread-support-panel {
  border-bottom: 1px solid var(--border);
  background: rgba(255,253,248,.74);
}
.thread-support-panel summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: .78rem;
  font-weight: 860;
  cursor: pointer;
  list-style: none;
}
.thread-support-panel summary::-webkit-details-marker {
  display: none;
}
.thread-support-panel summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
}
.thread-support-panel[open] summary::after {
  content: "-";
}
.thread-support-panel summary small {
  min-width: max-content;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 760;
}
.thread-support-panel .channel-link-strip,
.thread-support-panel .thread-next-actions {
  border-bottom: 0;
  border-top: 1px solid var(--border);
}
.thread-next-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 3% 0%, var(--channel-soft), transparent 26%),
    rgba(255,253,248,.78);
}
.thread-next-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.thread-next-copy strong {
  color: var(--text);
  font-size: .78rem;
  font-weight: 880;
}
.thread-next-copy span {
  max-width: 32rem;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.5;
}
.thread-next-buttons {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  overflow: hidden;
}
.thread-next-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(20,20,19,.1);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 820;
  white-space: nowrap;
  cursor: pointer;
}
.thread-next-action .icon {
  width: 15px;
  height: 15px;
}
.thread-next-action:hover,
.thread-next-action.primary {
  border-color: color-mix(in srgb, var(--channel-accent) 30%, var(--border));
  background: var(--channel-soft);
  color: var(--channel-accent);
}
.channel-messages {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  overflow-anchor: none;
}
.channel-message {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.channel-detail .channel-messages {
  gap: 10px;
  padding: 12px;
}
.channel-detail .channel-message {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
}
.channel-detail .channel-avatar {
  width: 28px;
  height: 28px;
  border-radius: 10px;
}
.channel-detail .channel-message-meta {
  gap: 6px;
  font-size: .68rem;
}
.channel-detail .channel-message-content {
  font-size: .84rem;
  line-height: 1.58;
}
.channel-message.compact {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.channel-avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(20,20,19,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
}
.channel-avatar.clickable {
  cursor: pointer;
  transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
}
.channel-avatar.clickable:hover {
  border-color: rgba(201,100,66,.42);
  box-shadow: 0 6px 14px rgba(35,31,27,.12);
  transform: translateY(-1px);
}
.channel-avatar.clickable:focus-visible {
  outline: 2px solid rgba(201,100,66,.45);
  outline-offset: 2px;
}
.channel-avatar.has-image {
  overflow: hidden;
  padding: 0;
  background: rgba(255,255,255,.9);
}
.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.channel-avatar.user {
  color: #6b625c;
}
.channel-avatar.system {
  color: #3f7650;
  background: rgba(237,246,233,.8);
}
.channel-avatar .icon {
  width: 16px;
  height: 16px;
}
.channel-avatar-initial {
  display: none;
}
.channel-message-body {
  box-sizing: border-box;
  display: grid;
  gap: 7px;
  min-width: 0;
  width: min(820px, 100%);
  max-width: min(820px, 100%);
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.7);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.channel-detail .channel-message-body {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201,100,66,.055), transparent 36%),
    rgba(255,255,255,.76);
}
.channel-message.compact .channel-message-body {
  width: auto;
  max-width: min(820px, 100%);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.channel-message.compact .channel-message-content {
  width: fit-content;
  max-width: min(780px, 100%);
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(232,230,220,.92);
  border-radius: 14px;
  background: rgba(255,255,255,.78);
  box-shadow: 0 10px 24px rgba(91,70,54,.045);
  overflow-wrap: anywhere;
}
.channel-message.compact.human .channel-message-content {
  margin-left: 0;
  border-color: rgba(232,230,220,.92);
  background: rgba(255,255,255,.78);
}
.channel-message.compact.agent .channel-message-content {
  border-color: rgba(201,100,66,.2);
  background: rgba(255,248,238,.9);
}
.channel-message.system,
.channel-message.event,
.channel-message.approval,
.channel-message.evidence {
  background: transparent;
}
.channel-message.system .channel-message-body,
.channel-message.event .channel-message-body,
.channel-message.approval .channel-message-body,
.channel-message.evidence .channel-message-body {
  background: rgba(237,246,233,.7);
}
.channel-message.agent .channel-message-body {
  border-color: rgba(201,100,66,.2);
  background: rgba(255,247,235,.86);
}
.channel-message-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 760;
  justify-content: flex-start;
  line-height: 1.28;
}
.channel-message-meta > span,
.channel-message-meta > time {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: keep-all;
}
.channel-message-meta span:first-child {
  flex: 0 1 auto;
  color: var(--text);
  max-width: min(34ch, 100%);
}
.channel-message-meta time {
  flex: 0 0 auto;
}
.channel-message-meta > span:not(:first-child):not(.channel-feed-thread-hint) {
  flex: 1 1 14ch;
}
.channel-message-content {
  min-width: 0;
  max-width: 100%;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: normal;
  overflow-wrap: anywhere;
}
.channel-message-content-rich {
  display: grid;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
}
.channel-message-content-rich:not(.has-route) {
  display: block;
}
.channel-message-content-rich .markdown-table-wrap {
  max-width: 100%;
  margin: 8px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
}
.channel-message-content-rich table.markdown-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: .84rem;
  line-height: 1.45;
}
.channel-message-content-rich .markdown-table th,
.channel-message-content-rich .markdown-table td {
  min-width: 120px;
  max-width: 360px;
  padding: 9px 10px;
  border: 1px solid rgba(232,230,220,.9);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}
.channel-message-content-rich .markdown-table th {
  background: rgba(250,249,245,.92);
  font-weight: 780;
}
.channel-message-content-rich .markdown-table .align-center { text-align: center; }
.channel-message-content-rich .markdown-table .align-right { text-align: right; }
.channel-message-text {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}
.channel-message-text p,
.channel-message-text li,
.channel-message-text blockquote,
.channel-message-text a,
.channel-message-text strong,
.channel-message-text em,
.channel-message-text code {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.channel-message-route {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 780;
  line-height: 1.3;
}
.channel-message-route-label {
  flex: 0 0 auto;
}
.channel-message-reply-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  width: fit-content;
  padding: 5px 7px;
  border-left: 3px solid color-mix(in srgb, var(--channel-accent) 42%, rgba(201,100,66,.36));
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  color: var(--muted);
  font-size: .74rem;
  font-weight: 760;
  line-height: 1.35;
}
.channel-message-reply-ref .icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--channel-accent);
}
.channel-message-reply-ref span,
.channel-message-reply-ref small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-message-reply-ref span {
  flex: 0 0 auto;
  color: var(--text);
}
.channel-message-reply-ref small {
  flex: 1 1 auto;
  max-width: min(52ch, 60vw);
}
.agent-mention-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: min(230px, 100%);
  padding: 2px 8px;
  border: 1px solid rgba(201,100,66,.2);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
  color: #7f3e27;
  font-size: .88em;
  font-weight: 820;
  line-height: 1.35;
  vertical-align: baseline;
  white-space: nowrap;
}
.agent-mention-chip-icon {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: currentColor;
}
.agent-mention-chip-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agent-mention-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agent-mention-chip.amber {
  border-color: rgba(201,139,42,.28);
  background: rgba(255,248,225,.88);
  color: #8a5b11;
}
.agent-mention-chip.green {
  border-color: rgba(79,125,90,.24);
  background: rgba(241,249,238,.88);
  color: #3d744a;
}
.agent-mention-chip.teal {
  border-color: rgba(37,138,130,.24);
  background: rgba(237,250,247,.88);
  color: #1d766f;
}
.agent-mention-chip.blue {
  border-color: rgba(95,110,203,.24);
  background: rgba(241,244,255,.9);
  color: #4c5bad;
}
.agent-mention-chip.red {
  border-color: rgba(190,56,52,.22);
  background: rgba(255,242,240,.9);
  color: #a93530;
}
.agent-mention-chip.device {
  border-color: rgba(90,103,120,.24);
  background: rgba(243,245,248,.92);
  color: #4a5567;
}
.channel-message-text .agent-mention-chip {
  margin: 0 2px;
  transform: translateY(-1px);
}
.channel-message.business_event .channel-message-body {
  border-color: rgba(201,100,66,.26);
  background:
    radial-gradient(circle at 12% 0%, rgba(201,100,66,.11), transparent 32%),
    rgba(255,250,241,.9);
  box-shadow: 0 18px 44px rgba(91,70,54,.08);
}
.channel-event-card {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  border-color: rgba(94,93,89,.16);
  background: transparent;
  box-shadow: none;
}
.channel-event-card .channel-message-body {
  border-color: rgba(94,93,89,.16);
  background: rgba(247,247,242,.82);
  box-shadow: none;
}
.channel-event-card.success .channel-message-body {
  border-color: rgba(68,134,88,.2);
  background: rgba(237,246,233,.76);
}
.channel-event-card.failed .channel-message-body {
  border-color: rgba(181,51,51,.2);
  background: rgba(255,245,241,.78);
}
.channel-event-card.command .channel-message-body {
  border-color: rgba(95,110,203,.2);
  background: rgba(242,244,255,.76);
}
.channel-message.deep-linked .channel-message-body {
  border-color: rgba(201,100,66,.64);
  background:
    radial-gradient(circle at 8% 0%, rgba(255,191,87,.22), transparent 34%),
    rgba(255,250,241,.96);
  box-shadow:
    0 0 0 4px rgba(201,100,66,.12),
    0 18px 42px rgba(91,70,54,.12);
}
.channel-event-details {
  margin-left: 37px;
}
.channel-event-details summary {
  width: fit-content;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 780;
  cursor: pointer;
}
.channel-event-details .channel-message-payload {
  margin-top: 8px;
}
.business-card-stack {
  display: grid;
  gap: 10px;
}
.channel-detail .business-card-stack {
  gap: 8px;
}
.business-generic-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(201,100,66,.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201,100,66,.1), transparent 34%),
    rgba(255,255,255,.76);
}
.business-generic-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(201,100,66,.1);
  color: var(--accent);
}
.business-generic-body {
  display: grid;
  gap: 9px;
  min-width: 0;
}
.business-generic-body p {
  margin: 0;
  color: var(--text);
  font-size: .86rem;
  line-height: 1.5;
}
.ai-card-material-generation,
.ai-card-material-result {
  width: min(520px, 100%);
}
.material-card-form {
  display: grid;
  gap: 9px;
  padding: 0 14px 12px;
}
.material-card-form textarea {
  min-height: 82px;
  resize: vertical;
  border-radius: 12px;
  background: rgba(255,255,255,.86);
  font-size: .86rem;
  line-height: 1.5;
}
.material-card-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px;
}
.material-card-controls select {
  min-width: 0;
  height: 34px;
  padding: 6px 26px 6px 10px;
  border-radius: 10px;
  font-size: .76rem;
  font-weight: 760;
}
.material-card-ref-section {
  display: grid;
  gap: 8px;
  padding: 0 14px 12px;
}
.material-card-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  font-size: .76rem;
  font-weight: 780;
}
.material-card-ref-head small {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 720;
}
.material-card-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 12px;
}
.material-card-ref-section .material-card-refs {
  padding: 0;
}
.material-card-ref {
  width: 72px;
  min-width: 0;
  display: grid;
  gap: 4px;
}
.material-card-ref-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #141413;
  cursor: zoom-in;
}
.material-card-ref-thumb img,
.material-card-ref-thumb video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.material-card-ref > span {
  overflow: hidden;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-card-ref-empty {
  margin: 0 14px 12px;
  padding: 8px 10px;
  border: 1px dashed rgba(20,20,19,.12);
  border-radius: 12px;
  color: var(--muted);
  font-size: .76rem;
}
.material-card-ref-section .material-card-ref-empty {
  margin: 0;
}
.ai-card-material-generation .ai-card-action[aria-busy="true"] {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border-color: rgba(201,100,66,.3);
  background: linear-gradient(90deg, #e9a48f 0%, #efb6a4 42%, #dc8e76 100%);
  background-size: 180% 100%;
  color: #fff;
  opacity: 1;
  box-shadow: 0 8px 18px rgba(201,100,66,.18);
  animation: material-card-busy-pulse 1.55s ease-in-out infinite;
}
.ai-card-material-generation .ai-card-action[aria-busy="true"]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.36) 42%, transparent 70%);
  transform: translateX(-120%);
  animation: material-card-busy-sweep 1.35s ease-in-out infinite;
}
.ai-card-material-generation .ai-card-action[aria-busy="true"] .icon {
  animation: material-card-busy-spin 1.1s linear infinite;
  transform-origin: 50% 50%;
}
@keyframes material-card-busy-pulse {
  0%, 100% { background-position: 0% 50%; box-shadow: 0 8px 18px rgba(201,100,66,.16); }
  50% { background-position: 100% 50%; box-shadow: 0 10px 24px rgba(201,100,66,.28); }
}
@keyframes material-card-busy-sweep {
  0% { transform: translateX(-120%); }
  58%, 100% { transform: translateX(120%); }
}
@keyframes material-card-busy-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-card-material-generation .ai-card-action[aria-busy="true"],
  .ai-card-material-generation .ai-card-action[aria-busy="true"]::before,
  .ai-card-material-generation .ai-card-action[aria-busy="true"] .icon {
    animation: none;
  }
}
.ai-card-material-result .material-work-card {
  width: auto;
  margin: 0 14px 14px 54px;
}
.material-failed-card {
  display: grid;
  gap: 8px;
  margin: 0 14px 12px 54px;
  padding: 10px 11px;
  border: 1px solid rgba(181,51,51,.16);
  border-radius: 13px;
  background: rgba(255,248,246,.82);
}
.material-failed-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.material-failed-head .material-work-badge {
  position: static;
}
.material-failed-head strong {
  color: var(--text);
  font-size: .82rem;
  font-weight: 850;
}
.material-failed-card p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.45;
  word-break: break-word;
}
.material-retry-generation {
  border-color: rgba(201,100,66,.2);
  background: linear-gradient(180deg, rgba(255,250,241,.88), rgba(255,255,255,.92));
}
.business-content-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  padding: 10px;
  border: 1px solid rgba(201,100,66,.18);
  border-radius: 18px;
  background: rgba(255,255,255,.72);
}
.channel-detail .business-content-card {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border-radius: 17px;
  background:
    linear-gradient(180deg, rgba(255,250,241,.94), rgba(255,255,255,.82));
}
.business-media-frame {
  position: relative;
  min-height: 170px;
  overflow: hidden;
  border: 1px solid rgba(34,34,34,.08);
  border-radius: 16px;
  background: #141413;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.channel-detail .business-media-frame {
  min-height: 148px;
  max-height: 178px;
  border-radius: 14px;
}
.business-media-frame video {
  width: 100%;
  height: 100%;
  min-height: 170px;
  display: block;
  object-fit: cover;
}
.channel-detail .business-media-frame video {
  min-height: 148px;
}
.business-media-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 170px;
  color: rgba(255,255,255,.78);
  font-size: .78rem;
  font-weight: 760;
}
.channel-detail .business-media-empty {
  min-height: 148px;
}
.business-media-empty .icon {
  width: 30px;
  height: 30px;
}
.business-card-body {
  display: grid;
  gap: 9px;
  min-width: 0;
  align-content: start;
}
.channel-detail .business-card-body {
  gap: 7px;
}
.business-card-topline,
.business-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.business-card-topline {
  justify-content: space-between;
}
.channel-detail .business-card-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}
.business-source,
.business-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .04em;
  white-space: nowrap;
}
.business-source {
  color: #8f4b32;
}
.channel-detail .business-source {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.business-source .icon {
  width: 15px;
  height: 15px;
}
.business-state {
  padding: 5px 9px;
  border: 1px solid rgba(201,100,66,.18);
  background: rgba(201,100,66,.1);
  color: #93462d;
}
.business-state.ready {
  border-color: rgba(68,134,88,.24);
  background: rgba(68,134,88,.13);
  color: #3f7650;
}
.business-card-body h3 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.18;
}
.channel-detail .business-card-body h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.business-description {
  margin: 0;
  color: var(--muted);
  font-size: .84rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.channel-detail .business-description {
  font-size: .76rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}
.business-meta-row {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(245,244,237,.78);
}
.business-meta-row span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 780;
}
.business-meta-row strong {
  color: var(--text);
  font-size: .78rem;
}
.channel-detail .business-meta-row {
  padding: 7px 8px;
}
.channel-detail .business-meta-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.business-tags,
.business-missing,
.business-ready {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.business-tags span,
.business-missing strong {
  border-radius: 999px;
  padding: 5px 8px;
  font-size: .7rem;
  font-weight: 820;
}
.business-tags span {
  background: rgba(37,138,130,.11);
  color: #276f69;
}
.channel-detail .business-tags {
  max-height: 58px;
  overflow: hidden;
}
.channel-detail .business-tags span,
.channel-detail .business-missing strong {
  padding: 4px 7px;
  font-size: .66rem;
}
.business-tags .muted {
  background: rgba(34,34,34,.05);
  color: var(--muted);
}
.business-missing {
  padding: 8px 9px;
  border-radius: 12px;
  background: rgba(255,245,234,.86);
}
.business-missing span {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 780;
}
.business-missing strong {
  background: #fff;
  color: #93462d;
  box-shadow: 0 0 0 1px rgba(201,100,66,.16);
}
.business-ready {
  color: #3f7650;
  font-size: .78rem;
  font-weight: 820;
}
.business-ready .icon {
  width: 16px;
  height: 16px;
}
.channel-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.channel-detail .channel-attachments {
  gap: 7px;
}
.channel-attachment {
  position: relative;
  display: grid;
  gap: 6px;
  width: 154px;
  min-height: 42px;
  padding: 8px;
  border: 1px solid rgba(34,34,34,.1);
  border-radius: 13px;
  background: rgba(255,255,255,.74);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  appearance: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(34,34,34,.06);
}
.channel-attachment:hover {
  border-color: color-mix(in srgb, var(--channel-accent) 30%, rgba(34,34,34,.1));
  background: rgba(255,253,248,.9);
}
.channel-attachment:focus-visible {
  outline: 3px solid var(--channel-soft);
  outline-offset: 2px;
}
.channel-attachment.image {
  cursor: zoom-in;
}
.channel-detail .channel-attachment {
  width: 120px;
  padding: 6px;
  border-radius: 12px;
}
.channel-attachment img,
.channel-attachment video {
  width: 100%;
  height: 104px;
  border-radius: 9px;
  background: rgba(34,34,34,.06);
}
.channel-attachment img {
  display: block;
  object-fit: contain;
  background: rgba(245,244,237,.82);
}
.channel-attachment video {
  object-fit: cover;
}
.channel-detail .channel-attachment img,
.channel-detail .channel-attachment video {
  height: 82px;
}
.channel-attachment.file {
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  width: auto;
  max-width: 260px;
}
.channel-detail .channel-attachment.file {
  width: 100%;
  max-width: none;
}
.channel-attachment span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-attachment .channel-attachment-zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  min-width: 0;
  overflow: visible;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(20,20,19,.68);
  color: #fff;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(20,20,19,.18);
}
.channel-attachment:hover .channel-attachment-zoom,
.channel-attachment:focus-visible .channel-attachment-zoom {
  opacity: 1;
  transform: translateY(0);
}
.channel-attachment .channel-attachment-zoom .icon {
  width: 15px;
  height: 15px;
  min-width: auto;
  overflow: visible;
  color: inherit;
}
.channel-detail .channel-attachment .channel-attachment-zoom {
  top: 9px;
  right: 9px;
  width: 24px;
  height: 24px;
}
.channel-message-payload {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.channel-message-payload div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255,255,255,.64);
}
.channel-message-payload span,
.channel-message-payload strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-message-payload span {
  color: var(--muted);
  font-size: .68rem;
}
.channel-message-payload strong {
  margin-top: 2px;
  font-size: .74rem;
}
.channel-compose {
  display: grid;
  gap: 9px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--border);
  background:
    radial-gradient(circle at 8% 8%, rgba(201,100,66,.07), transparent 30%),
    rgba(255,253,248,.9);
}
.channel-compose textarea {
  width: 100%;
  min-height: 82px;
  max-height: 148px;
  resize: vertical;
  border: 1px solid rgba(209,207,197,.78);
  border-radius: 18px;
  background: rgba(255,255,255,.92);
  color: var(--text);
  font: inherit;
  font-size: .92rem;
  line-height: 1.52;
  padding: 13px 14px;
  outline: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    0 8px 22px rgba(20,20,19,.035);
}
.channel-compose textarea:focus {
  border-color: color-mix(in srgb, var(--channel-accent) 45%, var(--border));
  box-shadow:
    0 0 0 3px var(--channel-soft),
    0 8px 22px rgba(20,20,19,.045);
}
.channel-compose-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}
.channel-compose-activity {
  margin-right: auto;
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-compose-submit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.channel-compose-actions span {
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}
.channel-detail-empty,
.channel-empty,
.channel-loading {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 180px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}
.channel-detail-empty strong,
.channel-empty strong {
  color: var(--text);
  font-size: .98rem;
}
.channel-detail-empty p,
.channel-empty p {
  max-width: 340px;
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
}

@media (max-width: 1180px) {
  .channels-page {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .channels-shell {
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 12px;
    height: auto;
    min-height: 100%;
    max-height: none;
  }
  .channels-shell.detail-collapsed {
    grid-template-columns: 230px minmax(0, 1fr);
  }
  .channel-resize-handle {
    display: none;
  }
  .channels-sidebar,
  .channel-main {
    height: calc(100dvh - 78px);
    max-height: none;
  }
  .channel-thread-card.active::after {
    display: none;
  }
  .channel-detail {
    grid-column: 1 / -1;
    min-height: min(560px, calc(100dvh - 96px));
    max-height: none;
  }
  .ops-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-agent-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-shortcut-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-chat-result { grid-template-columns: 1fr; }
  .ops-report-grid { grid-template-columns: 1fr; }
  .ops-report-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-hero,
  .ops-hero-compact,
  .ops-layout-grid,
  .ops-layout-grid.bottom,
  .ops-layout-grid.bottom.three,
  .ops-layout-grid.bottom.four,
  .ops-form-shell { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  body.has-app-rail {
    padding-left: 0;
  }
  body.has-app-rail #app-header {
    width: auto;
    margin-left: 0;
  }
  .sa-app-rail {
    display: none;
  }
  .channels-page {
    height: auto;
    min-height: calc(100dvh - 54px);
    padding: 12px;
    overflow: visible;
  }
  .channels-shell,
  .channels-shell.detail-collapsed {
    grid-template-columns: 1fr;
    gap: 12px;
    height: auto;
    max-height: none;
  }
  .channel-main {
    height: auto;
    min-height: min(760px, calc(100dvh - 80px));
  }
  .channels-sidebar,
  .channel-detail {
    height: auto;
    max-height: none;
  }
  .channel-nav-item.active::after,
  .channel-thread-card.active::after {
    display: none;
  }
  .channels-sidebar,
  .channel-main,
  .channel-detail { border-radius: 18px; }
  .thread-stream,
  .channel-messages {
    gap: 12px;
    padding: 12px;
    overflow-x: hidden;
  }
  .channel-feed-message,
  .channel-message {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }
  .channel-feed-message .channel-message-body,
  .channel-message-body {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border-radius: 14px;
  }
  .channel-message.compact .channel-message-body {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  .channel-message.compact .channel-message-content,
  .channel-feed-message.compact .channel-message-content {
    width: 100%;
    max-width: 100%;
    padding: 10px 11px;
  }
  .agent-mention-chip {
    max-width: min(170px, 100%);
  }
  .channel-message-route {
    gap: 5px;
  }
  .channel-avatar {
    width: 28px;
    height: 28px;
    border-radius: 10px;
  }
  .channel-feed-actions {
    grid-column: 2;
  }
  .channel-thread-replies {
    min-height: 32px;
    padding-inline: 12px;
    font-size: .76rem;
  }
  .channel-feed-message.is-openable .channel-message-content {
    border-color: color-mix(in srgb, var(--channel-accent) 18%, var(--border));
  }
  .channel-attachments {
    max-width: 100%;
  }
  .channel-attachment {
    width: min(142px, 100%);
  }
  .channel-main-head,
  .channel-detail-head,
  .thread-next-actions,
  .channel-quick-compose-actions { grid-template-columns: 1fr; }
  .channel-compose-controls { justify-content: flex-start; }
  .thread-next-buttons { flex-wrap: wrap; }
  .channel-quick-compose-actions { display: grid; }
  .channel-quick-compose-actions .btn { width: 100%; justify-content: center; }
  .channel-workspace-tabs { overflow-x: auto; }
  .channel-task-card,
  .channel-reminder-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .channel-task-actions { justify-content: flex-start; }
  .business-content-card { grid-template-columns: 1fr; }
  .business-media-frame,
  .business-media-frame video,
  .business-media-empty { min-height: 220px; }
  .business-card-topline { align-items: flex-start; }
  .channel-message-payload { grid-template-columns: 1fr; }
  .thread-drawer { width: 100vw; }
  .thread-drawer.admin-thread-drawer { width: 100vw; }
  .thread-message-payload { grid-template-columns: 1fr; }
  .ops-page { padding: 18px 14px 38px; }
  .ops-hero-copy,
  .ops-hero > div:first-child,
  .ops-hero-panel,
  .ops-hero-card,
  .ops-panel,
  .ops-form-card,
  .ops-side-card { border-radius: 20px; padding: 18px; }
  .ops-metrics,
  .ops-agent-grid,
  .ops-shortcut-grid,
  .ops-form-grid.two { grid-template-columns: 1fr; }
  .ops-priority-card { grid-template-columns: 38px minmax(0, 1fr); }
  .ops-priority-action { grid-column: 2; justify-content: flex-start; }
  .ops-activity-row { grid-template-columns: 36px minmax(0, 1fr); }
  .ops-activity-row .ops-status { grid-column: 2; width: fit-content; }
  .ops-report-cover { grid-template-columns: 1fr; }
  .ops-report-metrics { grid-template-columns: 1fr; }
  .ops-chat-box { grid-template-columns: 1fr; }
  .ops-platforms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-list-row { grid-template-columns: 1fr; }
  .ops-status { justify-content: flex-start; max-width: 100%; }
  .executor-hero,
  .executor-section { padding: 18px; border-radius: 20px; }
  .executor-hero { grid-template-columns: 1fr; align-items: start; }
  .executor-section-head { flex-direction: column; align-items: flex-start; }
  .executor-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .executor-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (min-width: 721px) {
  .channels-page {
    height: auto;
    min-height: calc(100dvh - 54px);
    overflow-y: auto;
  }
  .channels-shell,
  .channels-shell.detail-collapsed {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
    max-height: none;
  }
  .channels-sidebar {
    height: auto;
    max-height: none;
  }
  .channel-main {
    height: auto;
    min-height: min(720px, calc(100dvh - 84px));
    max-height: none;
  }
  .channel-detail {
    min-height: min(520px, calc(100dvh - 96px));
    max-height: none;
  }
  .channel-nav-item.active::after,
  .channel-thread-card.active::after {
    display: none;
  }
  .channel-quick-compose-actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
  .channel-compose-controls {
    justify-content: flex-start;
  }
  .channel-quick-compose-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Responsive channel shell v2: preserve app-style panes instead of stacking all regions. */
@media (min-width: 1024px) and (max-width: 1180px) {
  .channels-page {
    height: calc(var(--vv-height, 100dvh) - var(--app-header-height));
    min-height: 0;
    overflow: hidden;
  }
  .channels-shell,
  .channels-shell:not(.detail-collapsed) {
    grid-template-columns: minmax(0, 1fr) minmax(380px, min(58vw, 680px));
    gap: 12px;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }
  .channels-shell:not(.detail-collapsed) .channels-sidebar {
    display: none;
  }
  .channels-shell.detail-collapsed {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    gap: 12px;
  }
  .channels-sidebar,
  .channel-main,
  .channel-detail {
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }
  .channel-detail {
    grid-column: auto;
    display: grid;
    position: relative;
    inset: auto;
    width: auto;
    min-height: 0;
    border-radius: 22px;
  }
  .channel-resize-handle,
  .channels-shell.detail-collapsed .channel-detail {
    display: none;
  }
  .channel-detail-back {
    display: inline-flex;
  }
  .channel-detail-head h2,
  .channel-detail-head p,
  .roster-detail-head h2,
  .roster-detail-head p,
  .roster-detail-summary {
    display: block;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  body.channel-detail-overlay-open {
    overflow: hidden;
  }
  .channels-page {
    height: calc(var(--vv-height, 100dvh) - var(--app-header-height));
    min-height: 0;
    overflow: hidden;
  }
  .channels-shell,
  .channels-shell:not(.detail-collapsed),
  .channels-shell.detail-collapsed {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }
  .channels-sidebar,
  .channel-main {
    height: 100%;
    max-height: 100%;
  }
  .channel-resize-handle {
    display: none;
  }
  .channel-detail {
    grid-column: auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .channels-shell.detail-open .channel-detail {
    position: fixed;
    z-index: 120;
    top: calc(var(--app-header-height) + 12px);
    right: 12px;
    bottom: 12px;
    display: grid;
    width: min(920px, max(360px, calc(100vw - var(--app-rail-width) - 24px)));
    min-height: 0;
    max-height: calc(var(--vv-height, 100dvh) - var(--app-header-height) - 24px);
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(209,207,197,.82), 0 28px 80px rgba(20,20,19,.22);
  }
  .channels-shell.detail-open::after {
    content: "";
    position: fixed;
    z-index: 110;
    inset: var(--app-header-height) 0 0 var(--app-rail-width);
    background: rgba(20,20,19,.18);
    pointer-events: auto;
  }
  .channels-shell.detail-open .channel-main.has-phone-preview {
    z-index: 130;
  }
  .channel-detail-back {
    display: inline-flex;
  }
  .channel-detail-head h2,
  .channel-detail-head p,
  .roster-detail-head h2,
  .roster-detail-head p,
  .roster-detail-summary {
    display: block;
  }
}

@media (max-width: 767px), (max-width: 1180px) and (max-aspect-ratio: 3/2) {
  :root {
    --app-header-height: 52px;
  }
  body.has-app-rail {
    padding-left: 0;
  }
  body.has-app-rail #app-header {
    width: auto;
    margin-left: 0;
  }
  body.sa-rail-open {
    overflow: hidden;
  }
  .nav-rail-toggle {
    display: inline-grid;
    flex: 0 0 auto;
  }
  .nav-rail-toggle:hover,
  .nav-rail-toggle[aria-expanded="true"] {
    border-color: rgba(201,100,66,.28);
    background: rgba(201,100,66,.08);
    color: var(--accent);
  }
  .sa-rail-backdrop {
    position: fixed;
    z-index: 150;
    inset: var(--app-header-height) 0 0 0;
    display: none;
    background: rgba(20,20,19,.24);
  }
  body.sa-rail-open .sa-rail-backdrop {
    display: block;
  }
  .sa-app-rail {
    z-index: 160;
    top: var(--app-header-height);
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-rows: auto auto;
    gap: 12px;
    width: min(82vw, 304px);
    height: auto;
    padding: 14px;
    border-right: 1px solid rgba(209,207,197,.86);
    border-radius: 0 22px 22px 0;
    transform: translateX(-105%);
    transition: transform .18s ease;
    box-shadow: 18px 0 48px rgba(20,20,19,.18);
  }
  body.sa-rail-open .sa-app-rail {
    transform: translateX(0);
  }
  .sa-rail-group {
    gap: 8px;
    justify-items: stretch;
  }
  .sa-rail-spacer {
    display: none;
  }
  .sa-rail-group.bottom {
    align-self: start;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .sa-rail-item {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 46px;
    padding: 0 42px 0 12px;
    border-radius: 14px;
  }
  .sa-rail-item.active {
    box-shadow:
      inset 3px 0 0 var(--accent),
      0 0 0 1px rgba(201,100,66,.13);
  }
  .sa-rail-label {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: currentColor;
    font-size: .92rem;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sa-rail-badge {
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    border-color: #faf9f5;
  }
  .global-search-overlay {
    z-index: 170;
    place-items: stretch;
    padding: var(--app-header-height) 0 0;
    background: rgba(250,249,245,.98);
    backdrop-filter: none;
  }
  .global-search-panel {
    width: 100%;
    height: calc(100dvh - var(--app-header-height));
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .global-search-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .global-search-filter-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }
  .global-search-results {
    min-height: 0;
  }
  .global-search-result {
    grid-template-columns: 1fr;
    gap: 7px;
  }
  .global-search-result-kind {
    justify-self: start;
  }
  .channels-page {
    height: calc(var(--vv-height, 100dvh) - var(--app-header-height));
    min-height: 0;
    padding: 0;
    overflow: hidden;
  }
  .channels-shell,
  .channels-shell.detail-collapsed,
  .channels-shell:not(.detail-collapsed) {
    display: block;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }
  .channel-resize-handle {
    display: none;
  }
  .channels-sidebar,
  .channel-main,
  .channel-detail {
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-width: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .channel-main,
  .channel-detail {
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--channel-accent) 38%, transparent);
  }
  .channels-shell.pane-sidebar .channel-main,
  .channels-shell.pane-sidebar .channel-detail,
  .channels-shell.pane-main .channels-sidebar,
  .channels-shell.pane-main .channel-detail,
  .channels-shell.pane-detail .channels-sidebar,
  .channels-shell.pane-detail .channel-main {
    display: none;
  }
  .channels-shell.detail-open .channel-detail {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    box-shadow: inset 4px 0 0 color-mix(in srgb, var(--channel-accent) 38%, transparent);
  }
  .channels-shell.detail-open::after {
    display: none;
  }
  .channel-main-head,
  .channel-detail-head,
  .roster-detail-head {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }
  .channel-main-head {
    display: none;
  }
  .channel-mobile-actions {
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background:
      radial-gradient(circle at 8% 12%, var(--channel-soft), transparent 34%),
      rgba(255,253,248,.76);
    overflow-x: auto;
  }
  .channel-main-head .ops-kicker,
  .channel-detail-head .ops-kicker {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .channel-main-head h2,
  .channel-main-head p {
    display: none;
  }
  .channel-main-back,
  .channel-sidebar-forward,
  .channel-sidebar-add-human,
  .channel-detail-back {
    display: inline-flex;
    margin-bottom: 0;
  }
  .channel-detail-leading .channel-detail-back {
    margin-bottom: 8px;
  }
  .thread-stream,
  .channel-messages {
    gap: 12px;
    padding: 12px;
    overflow-x: hidden;
  }
  .channel-filters,
  .channel-workspace-tabs {
    padding-inline: 10px;
    overflow-x: auto;
  }
  .channel-quick-compose {
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }
  .channel-quick-compose textarea {
    min-height: 68px;
    max-height: 112px;
  }
  .channel-compose {
    padding: 10px 12px calc(10px + var(--safe-bottom));
  }
  .channel-compose textarea {
    min-height: 68px;
    max-height: 112px;
  }
  .channel-quick-compose-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .channel-compose-actions {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
  .channel-quick-compose-actions > span,
  .channel-compose-actions > span,
  .channel-compose-shortcut {
    display: none;
  }
  .channel-compose-controls {
    justify-content: flex-start;
  }
  .channel-quick-compose-actions .btn {
    min-width: 72px;
    width: auto;
    justify-content: center;
  }
  .channel-compose-actions .btn {
    min-width: 72px;
    width: auto;
    justify-content: center;
  }
  .channel-detail-empty,
  .channel-empty,
  .channel-loading {
    min-height: 140px;
    padding: 22px 16px;
  }
  .channel-task-card,
  .channel-reminder-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
  .channel-task-actions {
    justify-content: flex-start;
  }
  .roster-detail-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .channel-main-head,
  .channel-detail-head,
  .roster-detail-head {
    gap: 8px;
    padding-inline: 10px;
  }
  .channel-pane-back {
    min-height: 30px;
    padding-inline: 8px;
  }
  .channel-detail-actions {
    gap: 6px;
  }
  .channel-status {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .channel-detail-close {
    width: 30px;
    height: 30px;
  }
}

@media (max-height: 600px) and (min-width: 768px) and (max-width: 1180px) {
  .channels-page {
    padding: 8px;
  }
  .channels-shell {
    gap: 8px;
  }
  .channels-brand,
  .channel-main-head,
  .channel-detail-head {
    padding: 10px 12px;
  }
  .thread-stream,
  .channel-messages {
    gap: 10px;
    padding: 10px;
  }
  .channel-quick-compose,
  .channel-compose {
    gap: 7px;
    padding: 8px 10px;
  }
  .channel-quick-compose textarea,
  .channel-compose textarea {
    min-height: 56px;
    max-height: 92px;
  }
  .channel-filters {
    padding: 8px 10px;
  }
  .channel-nav-item {
    padding-block: 6px;
  }
  .roster-item {
    min-height: 30px;
  }
}

/* ── Independent sites ── */
.site-page {
  max-width: 1500px;
}

.site-hero {
  background:
    radial-gradient(circle at 88% 18%, rgba(201, 100, 66, .18), transparent 28%),
    linear-gradient(135deg, rgba(250, 249, 245, .98), rgba(244, 240, 230, .92));
}

.site-layout {
  display: grid;
  grid-template-columns: minmax(360px, 480px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.site-panel {
  background: rgba(250, 249, 245, .92);
  border: 1px solid rgba(48, 48, 46, .12);
  border-radius: 28px;
  box-shadow: 0 18px 48px rgba(20, 20, 19, .06);
  padding: 22px;
}

.site-form {
  display: grid;
  gap: 12px;
}

.site-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.site-form input,
.site-form select {
  min-height: 44px;
  border: 1px solid rgba(48, 48, 46, .14);
  border-radius: 14px;
  background: rgba(255, 255, 255, .82);
  color: var(--ink);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
}

.site-form input:focus,
.site-form select:focus {
  border-color: #3898ec;
  box-shadow: 0 0 0 3px rgba(56, 152, 236, .14);
}

.site-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.site-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.site-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(48, 48, 46, .11);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(250, 249, 245, .94));
  padding: 16px;
  box-shadow: 0 12px 30px rgba(20, 20, 19, .045);
}

.site-card-head {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.site-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #c96442;
  background: rgba(201, 100, 66, .11);
}

.site-card-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.site-card-title strong,
.site-meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-card-title strong {
  color: var(--ink);
  font-size: 18px;
}

.site-card-title small {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-status {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.site-status.online {
  color: #34734a;
  background: rgba(85, 166, 105, .14);
}

.site-status.idle {
  color: #7a6b38;
  background: rgba(210, 180, 90, .18);
}

.site-status.danger {
  color: #9b3d2f;
  background: rgba(201, 84, 64, .14);
}

.site-meta {
  display: grid;
  gap: 8px;
}

.site-meta > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.site-meta span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-meta strong {
  color: var(--ink);
  font-size: 13px;
}

.site-chip-row {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.site-chip {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(201, 100, 66, .1);
  color: #b45c3d;
  font-size: 12px;
  font-weight: 800;
}

.site-chip.muted {
  color: var(--muted);
  background: rgba(48, 48, 46, .06);
}

.site-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.site-key-panel {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(48, 48, 46, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .58);
  padding: 12px;
}

.site-key-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.site-key-head strong {
  color: var(--ink);
  font-size: 14px;
}

.site-key-panel p,
.site-key-panel small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
}

.site-public-key {
  max-height: 82px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border-radius: 14px;
  background: rgba(48, 48, 46, .06);
  color: var(--ink);
  padding: 10px;
  font-size: 11px;
  line-height: 1.45;
}

.site-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-empty {
  display: grid;
  gap: 8px;
  padding: 34px;
  border: 1px dashed rgba(48, 48, 46, .18);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, .45);
}

@media (max-width: 1180px) {
  .site-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .site-list,
  .site-form-grid {
    grid-template-columns: 1fr;
  }
  .site-panel {
    border-radius: 20px;
    padding: 16px;
  }
  .site-card-head {
    grid-template-columns: 38px minmax(0, 1fr);
  }
  .site-status {
    grid-column: 1 / -1;
    justify-self: start;
  }
  .site-card-actions {
    justify-content: stretch;
  }
  .site-card-actions .btn {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .executor-summary { grid-template-columns: 1fr; }
  .executor-card-top { grid-template-columns: 38px minmax(0, 1fr); }
  .executor-status { grid-column: 1 / -1; justify-self: start; }
  .executor-avatar { width: 38px; height: 38px; border-radius: 14px; }
}

@media (max-width: 760px) {
  .admin-section-actions { justify-content: flex-start; }
  .admin-apk-upload-form,
  .admin-device-detail-grid,
  .admin-proxy-form-grid { grid-template-columns: 1fr; }
}
