/*
 * Operational Editorial UI
 * 灵感方法：Bridget Riley 的视觉节奏 + Paula Scher 的编辑式层级。
 * 仅做方法转译，不复刻具体作品。
 */
:root {
  color-scheme: light;
  --canvas: #f1f0ea;
  --surface: #fbfbf8;
  --surface-strong: #ffffff;
  --ink: #171a17;
  --ink-soft: #343a35;
  --muted: #68716b;
  --faint: #909891;
  --line: #d9ddd7;
  --line-strong: #bdc4bd;
  --forest: #174f3b;
  --forest-bright: #247c59;
  --forest-soft: #deece4;
  --signal: #d8543a;
  --signal-dark: #a83b29;
  --signal-soft: #f7e5df;
  --amber: #d9a62e;
  --amber-soft: #f7efd7;
  --focus: #22875f;
  --shadow: 0 20px 60px rgba(21, 30, 24, .08);
  --heading-font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font: "SF UI Display", "SF Pro Display", "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF UI Display", "SF Pro Display", "SF Pro Text", "SF Pro", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  --sidebar: 248px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(23, 79, 59, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 79, 59, .018) 1px, transparent 1px),
    var(--canvas);
  background-size: 32px 32px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .login-art div { font-family: var(--heading-font); }
button, input, textarea, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
button:disabled { opacity: .52; cursor: wait; }
.hidden { display: none !important; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
  min-height: 100vh;
  transition: filter 220ms var(--ease);
}
.shell.blurred { filter: blur(5px); pointer-events: none; }

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  padding: 24px 18px 18px;
  display: flex;
  flex-direction: column;
  color: #f4f4ef;
  background:
    repeating-linear-gradient(145deg, rgba(255,255,255,.018) 0 2px, transparent 2px 13px),
    #171a17;
  border-right: 1px solid #2e342f;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  right: -54px;
  top: 118px;
  width: 116px;
  height: 360px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  transform: rotate(-16deg);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 42px; }
.brand-mark, .login-logo { width: 42px; height: 42px; color: #f0c641; flex: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; letter-spacing: -.2px; }
.brand small { margin-top: 4px; color: #899089; font-size: 9px; letter-spacing: 1.6px; }
.nav-label { margin: 0 10px 10px; color: #6f776f; font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.sidebar nav { display: grid; gap: 6px; }
.nav {
  position: relative;
  min-height: 48px;
  width: 100%;
  padding: 0 12px;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #a9b0aa;
  text-align: left;
  cursor: pointer;
  transition: 200ms var(--ease);
}
.nav svg { width: 17px; height: 17px; stroke-width: 1.7; }
.nav span { font-size: 13px; font-weight: 550; }
.nav b { color: #555d57; font: 600 9px var(--mono); }
.nav::before { content: ""; position: absolute; left: -18px; width: 3px; height: 0; background: #f0c641; transition: height 200ms var(--ease); }
.nav:hover { color: #fff; background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06); transform: translateX(2px); }
.nav.active { color: #fff; background: #234f3e; border-color: #35614f; }
.nav.active::before { height: 26px; }
.nav.active b { color: #b9cbbf; }
.sidebar-note {
  margin-top: auto;
  padding: 14px 10px;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid #313732;
  border-bottom: 1px solid #313732;
}
.live-dot { width: 7px; height: 7px; margin-top: 4px; display: inline-block; border-radius: 50%; background: #4bc98c; box-shadow: 0 0 0 4px rgba(75,201,140,.12); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 10px; color: #d8ddd9; }
.sidebar-note small { margin-top: 4px; font-size: 9px; color: #788079; }
.account { padding: 17px 7px 0; display: grid; grid-template-columns: 36px 1fr 44px; align-items: center; gap: 9px; }
.avatar, .mini-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 750; }
.avatar { width: 36px; height: 36px; color: #e6f2ea; background: #315b49; border: 1px solid #48705f; }
.account strong, .account small { display: block; }
.account strong { font-size: 11px; }.account small { margin-top: 3px; color: #747d76; font-size: 9px; }
.account button { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: transparent; color: #7e8780; cursor: pointer; }
.account button:hover { color: #fff; }.account button svg { width: 16px; }

/* Main shell */
main { min-width: 0; padding: 38px 42px 20px; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.section-index { margin: 0 0 9px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 1.7px; }
.section-index span { color: var(--signal); }
.page-heading h1 { margin: 0; font-size: clamp(34px, 4vw, 58px); line-height: .98; letter-spacing: -3px; font-weight: 800; }
.page-intro { margin: 14px 0 0; color: var(--muted); font-size: 12px; }
.toolbar, .inline-actions { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.inline-actions label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .4px; }
.picker { position: relative; display: block; min-width: 148px; }
.picker-native { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.picker-trigger { width: 100%; min-height: 44px; padding: 0 12px 0 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 6px; font: 600 13px var(--font); text-align: left; cursor: pointer; }
.picker-trigger span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger svg { width: 16px; height: 16px; flex: none; color: var(--forest); transition: transform 180ms var(--ease); }
.picker.open .picker-trigger, .picker-trigger:hover { border-color: var(--forest); }
.picker.open .picker-trigger { box-shadow: 0 0 0 3px rgba(34,135,95,.12); }
.picker.open .picker-trigger svg { transform: rotate(180deg); }
.picker-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; max-height: 280px; padding: 6px; overflow: auto; background: var(--surface); border: 1px solid #c9d1ca; border-radius: 8px; box-shadow: 0 18px 44px rgba(21,30,24,.16); }
.picker-option { width: 100%; min-height: 38px; padding: 0 10px; display: flex; align-items: center; color: var(--ink-soft); background: transparent; border: 0; border-radius: 4px; font: 600 13px var(--font); text-align: left; cursor: pointer; }
.picker-option:hover { color: var(--forest); background: var(--forest-soft); }
.picker-option.active { color: #fff; background: var(--forest); }
.inline-actions .picker, .account-filters .picker, .bind-form .picker { width: 100%; }
.pagination-settings .picker { min-width: 132px; }
.toolbar label { display: flex; flex-direction: column; gap: 6px; min-width: 220px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .4px; }
.toolbar .picker { min-width: 220px; max-width: 280px; }
input:not([type="checkbox"]) {
  min-height: 44px;
  display: block;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface-strong);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: none;
  transition: border-color 180ms, box-shadow 180ms;
}
input:not([type="checkbox"]):focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(34,135,95,.12); }
button.primary, button.secondary, button.danger {
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms var(--ease), background 180ms, border-color 180ms;
}
button.primary svg, button.secondary svg, button.danger svg { width: 15px; height: 15px; }
button.primary { color: #fff; background: var(--forest); border: 1px solid var(--forest); }
button.primary:hover { background: #0f3f2e; transform: translateY(-1px); }
button.secondary { color: var(--ink-soft); background: #f5f5f1; border: 1px solid var(--line-strong); }
button.secondary:hover { background: #e9ece7; border-color: #9fa8a0; }
button.danger { color: var(--signal-dark); background: var(--signal-soft); border: 1px solid #e5b3a7; }
button.danger:hover { color: #fff; background: var(--signal); border-color: var(--signal); }

.health-strip {
  min-height: 42px;
  margin-bottom: 14px;
  padding: 8px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  background: rgba(251,251,248,.78);
  border: 1px solid var(--line);
  font-size: 10px;
}
.health-strip div { display: flex; align-items: center; gap: 8px; color: var(--forest); }
.health-strip div .live-dot { margin: 0; }.health-strip p { margin: 0; }.health-strip svg { width: 12px; color: #9da49e; }
.health-strip .last-sync { margin-left: auto; font-size: 9px; }.last-sync b { margin-left: 5px; color: var(--ink-soft); font-family: var(--mono); }

/* Metrics */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.stats article {
  position: relative;
  min-height: 132px;
  padding: 16px 18px 15px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  animation: rise 260ms var(--ease) both;
}
.stats article:nth-child(2) { animation-delay: 40ms; }.stats article:nth-child(3) { animation-delay: 80ms; }.stats article:nth-child(4) { animation-delay: 120ms; }
.metric-top { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 650; }
.metric-top b { color: #adb3ad; font: 600 9px var(--mono); }
.stats article > strong { display: block; margin: 12px 0 6px; font: 750 36px/1 var(--mono); letter-spacing: -2px; }
.stats article > small { color: var(--muted); font-size: 9px; }
.stats article > i { position: absolute; left: 0; bottom: 0; width: 32%; height: 3px; background: var(--forest); transition: width 260ms var(--ease); }
.stats article:nth-child(3) > i { background: var(--amber); }.stats article:nth-child(4) > i { background: var(--signal); }
.stats article:hover > i { width: 100%; }

/* Panels and cards */
.panel { display: none; }.panel.active { display: block; animation: rise 240ms var(--ease) both; }
.workspace.two-columns { display: grid; grid-template-columns: minmax(292px, 34%) minmax(0, 66%); gap: 10px; }
.card { position: relative; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.card-kicker { height: 27px; padding: 8px 18px 0; color: #8a928c; background: #edeee9; border-bottom: 1px solid var(--line); font: 650 8px var(--mono); letter-spacing: 1.4px; }
.list-card, .detail-card { min-height: 610px; }.full-card { min-height: 590px; }
.card-head { min-height: 77px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-head h2, .room-title h2 { margin: 0; font-size: 17px; line-height: 1.15; letter-spacing: -.5px; }
.card-head p, .room-title p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }.card-head.wide { padding-left: 22px; padding-right: 22px; }
.search-field { position: relative; display: block; }.search-field > svg { position: absolute; z-index: 1; left: 11px; top: 50%; width: 14px; transform: translateY(-50%); color: #858e87; pointer-events: none; }
.search-field .search { width: 225px; padding-left: 34px; background: #f7f7f3; border-color: var(--line); }

/* Group index */
.group-list { padding: 6px; max-height: 720px; overflow: auto; }
.group-item {
  position: relative;
  width: 100%;
  min-height: 64px;
  padding: 9px 10px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: 200ms var(--ease);
}
.group-item + .group-item { border-top-color: #e9ebe7; }
.group-item::before { content: ""; position: absolute; left: -6px; width: 3px; height: 0; background: var(--signal); transition: height 180ms var(--ease); }
.group-item:hover { background: #f2f4ef; transform: translateX(2px); }.group-item.active { background: var(--forest-soft); border-color: #c7d9ce; }.group-item.active::before { height: 34px; }
.group-avatar, .room-avatar { display: grid; place-items: center; color: var(--forest); background: #e4ebe6; border: 1px solid #cad6ce; font-weight: 800; }
.group-avatar { width: 40px; height: 40px; border-radius: 50%; font-size: 12px; overflow: hidden; object-fit: cover; }.group-item.active .group-avatar { color: #fff; background: var(--forest); border-color: var(--forest); }
.group-item strong, .group-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.group-item strong { font-size: 12px; }.group-item small { margin-top: 5px; color: var(--muted); font-size: 9px; font-family: var(--mono); }
.group-item small.group-tags { display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; text-overflow: unset; white-space: normal; font-family: var(--font); }
.group-tags i { padding: 1px 6px; color: var(--forest); background: #e7f0ea; border-radius: 99px; font-style: normal; font-size: 10px; font-weight: 700; }
.tag-bar { min-height: 42px; padding: 8px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.tag-chip { min-height: 28px; padding: 0 9px; color: var(--forest); background: #f4f7f4; border: 1px solid #c9d5cc; border-radius: 99px; font-size: 11px; font-weight: 700; cursor: pointer; }
.tag-chip.suspect { color: #8a3412; background: #f8e4d6; border-color: #e4c2ae; }
.tag-chip.suspect.active { color: #fff; background: #8a3412; border-color: #8a3412; }
.tag-chip b { margin-left: 4px; font-weight: 650; }
.tag-editor { padding: 12px 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; background: #f7f8f4; border-bottom: 1px solid var(--line); }
.tag-editor > span { color: var(--forest); font-size: 11px; font-weight: 750; }
#room-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.room-tag { min-height: 28px; padding: 0 4px 0 8px; display: inline-flex; align-items: center; gap: 2px; color: var(--forest); background: #e7f0ea; border-radius: 99px; font-size: 12px; font-weight: 700; }
.room-tag button { width: 22px; height: 22px; color: var(--forest); background: transparent; border: 0; cursor: pointer; font-size: 14px; }
#room-tag-form { grid-column: 1 / -1; display: flex; gap: 8px; }
#room-tag-form input { flex: 1; }
.member-tag-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 168px; }
.member-tag-form { display: inline-flex; gap: 4px; }
.member-tag-form input { width: 72px; min-height: 28px; padding: 0 8px; }
.member-tag-form button { min-height: 28px; padding: 0 8px; font-size: 12px; }
.group-item em { padding: 4px 6px; color: var(--forest); background: rgba(255,255,255,.5); border: 1px solid #cad8d0; font-size: 8px; font-style: normal; white-space: nowrap; }

/* Room detail */
.room-title { min-height: 92px; padding: 17px 20px; display: flex; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.room-avatar { width: 50px; height: 50px; flex: none; border-radius: 50%; font-size: 15px; overflow: hidden; }.room-avatar img { width: 100%; height: 100%; object-fit: cover; }.room-title > div:nth-child(2) { min-width: 0; flex: 1; }.room-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.room-label { color: var(--signal) !important; font: 700 8px var(--mono) !important; letter-spacing: 1.2px; }
.room-actions { display: flex; gap: 7px; }
.room-config-grid { padding: 12px 16px; display: grid; grid-template-columns: minmax(190px, .75fr) minmax(360px, 1.25fr); gap: 8px; background: #f2f2ed; border-bottom: 1px solid var(--line); }
.announcement, .schedule-box { min-height: 92px; background: var(--surface); border: 1px solid var(--line); }
.announcement { margin: 0; padding: 13px; display: flex; flex-direction: column; gap: 10px; }.announcement-head { display: flex; gap: 10px; min-width: 0; }.announcement span { color: var(--forest); font-size: 9px; font-weight: 750; }.announcement p { margin: 6px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.7; white-space: pre-wrap; }.notice-field { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }.notice-field textarea { width: 100%; min-height: 72px; padding: 8px; resize: vertical; font: 500 12px/1.7 var(--font); }.announcement #save-notice { align-self: flex-start; min-height: 32px; padding: 0 12px; }
.admin-panel { padding: 0 16px 12px; background: #f2f2ed; border-bottom: 1px solid var(--line); }
.admin-card { padding: 13px; display: grid; gap: 10px; background: var(--surface); border: 1px solid var(--line); }
.admin-list { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-chip { min-height: 40px; padding: 6px 8px; display: flex; align-items: center; gap: 8px; background: #f7f7f3; border: 1px solid var(--line); }
.admin-chip strong, .admin-chip small { display: block; }
.admin-chip strong { font-size: 12px; }
.admin-chip small { color: var(--muted); font-size: 10px; }
.admin-chip .secondary { min-height: 28px; padding: 0 8px; font-size: 12px; }
.admin-role { padding: 2px 6px; color: var(--forest); background: var(--forest-soft); font-size: 10px; font-weight: 750; }
.admin-add { display: grid; gap: 6px; }
.admin-add label { display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-weight: 700; }
.admin-results { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.admin-results button { min-height: 36px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink); background: #f7f7f3; border: 1px solid var(--line); text-align: left; cursor: pointer; }
.admin-results button:hover { border-color: var(--forest); }
.admin-results small { color: var(--muted); }
.config-icon { width: 30px; height: 30px; display: grid; place-items: center; flex: none; color: var(--forest); background: var(--forest-soft); }.config-icon svg { width: 14px; }
.schedule-box { margin: 0; padding: 13px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 12px; }
.schedule-copy { display: flex; align-items: center; gap: 9px; min-width: 0; }.schedule-copy strong, .schedule-copy small { display: block; }.schedule-copy strong { font-size: 10px; }.schedule-copy small { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.65; }
.schedule-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 9px; }
.switch-label { min-height: 40px; display: flex; align-items: center; gap: 6px; cursor: pointer; }.switch-label input { position: absolute; opacity: 0; pointer-events: none; }.switch-ui { position: relative; width: 32px; height: 18px; background: #c5cbc6; border-radius: 20px; transition: background 180ms; }.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; background: #fff; border-radius: 50%; transition: transform 180ms var(--ease); }.switch-label input:checked + .switch-ui { background: var(--forest-bright); }.switch-label input:checked + .switch-ui::after { transform: translateX(14px); }.switch-label input:focus-visible + .switch-ui { outline: 2px solid var(--focus); outline-offset: 2px; }.switch-label b { font-size: 8px; white-space: nowrap; }
.time-range { display: flex; align-items: flex-end; gap: 5px; }.time-range label { display: grid; grid-template-rows: 12px 40px; align-items: end; color: var(--muted); font-size: 8px; }.schedule-box input[type="time"] { width: 93px; min-height: 40px; height: 40px; margin: 0; padding: 6px; font: 550 10px var(--mono); }.schedule-arrow { width: 10px; height: 40px; display: grid; place-items: center; color: var(--faint); font-size: 9px; }
.schedule-box #save-schedule { min-height: 40px; height: 40px; padding: 0 10px; font-size: 9px; }

/* Tables */
.table-tools { min-height: 52px; padding: 7px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #fafaf7; border-bottom: 1px solid var(--line); }
.check-all { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; cursor: pointer; }.check-all input { width: 15px; height: 15px; accent-color: var(--forest); }.muted { color: var(--muted); font-size: 9px; }
.table-wrap { overflow: auto; }table { width: 100%; border-collapse: collapse; font-size: 11px; }th { height: 38px; padding: 0 12px; color: #737b75; background: #edeee9; border-bottom: 1px solid var(--line); font: 650 8px var(--mono); letter-spacing: .7px; text-align: left; white-space: nowrap; }td { min-height: 54px; padding: 10px 12px; border-bottom: 1px solid #e6e8e4; vertical-align: middle; }tbody tr { transition: background 150ms; }tbody tr:hover { background: #f5f6f1; }.check-col { width: 36px; }
.member { min-width: 145px; display: flex; align-items: center; gap: 9px; }.mini-avatar { width: 34px; height: 34px; flex: none; color: var(--forest); background: var(--forest-soft); border: 1px solid #cbdcd2; font-size: 10px; object-fit: cover; overflow: hidden; }.source-cell { white-space: nowrap; }.member strong, .member small { display: block; }.member strong { font-size: 11px; }.member .name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }.member .name-line strong { display: inline; }.member small { max-width: 180px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }.status.suspect { color: #8a3412; background: #f8e4d6; }
code { display: block; max-width: 180px; overflow: hidden; color: #49534d; font: 500 9px var(--mono); text-overflow: ellipsis; }.arrow { display: block; color: #a4aaa5; font-size: 8px; }.open-id { color: var(--forest); }.profile-line { display: block; max-width: 250px; color: #4f5952; font-size: 9px; line-height: 1.68; }.pill, .status { display: inline-block; padding: 4px 7px; font-size: 8px; font-weight: 700; }.pill { color: var(--forest); background: var(--forest-soft); }.status.success { color: var(--forest); background: var(--forest-soft); }.status.failed, .status.blocked { color: var(--signal-dark); background: var(--signal-soft); }.status.lifted { color: #3d4a57; background: #e7ebf0; }
.room-count-button { min-width: 68px; min-height: 44px; padding: 0 10px; color: var(--forest); background: var(--forest-soft); border: 1px solid #c4d8cc; font-size: 9px; font-weight: 750; cursor: pointer; }.room-count-button:hover { color: #fff; background: var(--forest); border-color: var(--forest); }
.risk-strip { min-height: 42px; padding: 9px 21px; display: flex; align-items: center; gap: 9px; color: #7a4b16; background: var(--amber-soft); border-bottom: 1px solid #e7d59c; font-size: 9px; }.risk-strip svg { width: 15px; flex: none; }
#tab-broadcast .list-card .card-head { flex-wrap: wrap; }
#tab-broadcast .list-card .search-field { flex: 1; min-width: 180px; }
.target-switch { display: flex; flex: none; padding: 3px; background: #f3f3ee; border: 1px solid var(--line); border-radius: 6px; }
.target-switch button { min-height: 32px; padding: 0 14px; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 12px; font-weight: 750; cursor: pointer; }
.target-switch button.active { color: #fff; background: var(--forest); }
.broadcast-room { grid-template-columns: 22px 40px minmax(0, 1fr); }
.broadcast-room input { width: 16px; height: 16px; accent-color: var(--forest); }
.composer { padding: 18px 20px 8px; display: grid; gap: 12px; }
.composer label { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .4px; }
.composer textarea { min-height: 140px; padding: 12px; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 6px; outline: none; resize: vertical; font: 500 13px/1.7 var(--font); }
.composer textarea:focus, .composer input[type="file"]:focus { border-color: var(--focus); box-shadow: 0 0 0 3px rgba(34,135,95,.12); }
.mention-all { min-height: 44px; display: flex !important; align-items: center; gap: 8px; color: var(--ink) !important; font-size: 13px !important; letter-spacing: 0 !important; cursor: pointer; }
.mention-all input { width: 16px; height: 16px; accent-color: var(--forest); }
.slide-switch { position: relative; width: fit-content; min-height: 44px; display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; font-size: 13px !important; font-weight: 600; letter-spacing: 0 !important; cursor: pointer; }
.slide-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.slide-track { width: 44px; height: 26px; border-radius: 999px; background: #d5d8d3; position: relative; flex: 0 0 44px; transition: background .2s var(--ease); }
.slide-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(23, 26, 23, .18); transition: transform .2s var(--ease); }
.slide-switch input:checked + .slide-track { background: var(--forest); }
.slide-switch input:checked + .slide-track::after { transform: translateX(18px); }
.slide-switch input:focus-visible + .slide-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.composer-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }
.composer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.broadcast-queue { display: grid; gap: 8px; }
.broadcast-progress { padding: 8px 10px; color: var(--ink-soft); background: #f7f7f3; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; line-height: 1.6; }
.broadcast-progress strong { color: var(--forest); font-weight: 750; }
.broadcast-queue-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.broadcast-queue-list:empty { display: none; }
.broadcast-queue-item { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.broadcast-queue-item.is-sending { border-color: #b7d7c6; background: #f3faf6; }
.broadcast-queue-item.is-done { opacity: .72; }
.broadcast-queue-item b { color: var(--muted); font: 700 12px var(--mono); }
.broadcast-queue-copy { min-width: 0; display: flex; align-items: center; gap: 8px; }
.broadcast-queue-copy img { width: 36px; height: 36px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.broadcast-queue-copy strong { display: block; overflow: hidden; color: var(--ink); font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.broadcast-queue-copy span { display: block; color: var(--muted); font-size: 11px; }
.broadcast-queue-actions { display: flex; gap: 4px; }
.broadcast-queue-actions button { min-height: 28px; padding: 0 8px; color: var(--ink-soft); background: #f3f3ee; border: 1px solid var(--line); border-radius: 4px; font-size: 12px; cursor: pointer; }
.broadcast-queue-actions button:disabled { opacity: .4; }
.broadcast-log li.paused span { color: #9a6700; }
.create-modes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 12px; }
.create-modes button { min-height: 32px; padding: 0 12px; color: var(--muted); background: #f3f3ee; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; font-weight: 750; cursor: pointer; }
.create-modes button.active { color: #fff; background: var(--forest); border-color: var(--forest); }
.create-search { margin: 0 20px 12px; }
.create-kind { display: flex; gap: 18px; }
.create-preview { max-height: 420px; overflow: auto; display: grid; gap: 6px; }
#tab-create .tag-bar { max-height: 460px; overflow: auto; }
.image-preview { display: flex; align-items: center; gap: 12px; }
.image-preview img { width: 72px; height: 72px; object-fit: cover; border: 1px solid var(--line); background: #f4f5f1; }
.broadcast-log { margin: 0; padding: 0 20px 18px; list-style: none; display: grid; gap: 6px; max-height: 280px; overflow: auto; }
.broadcast-log li { min-height: 36px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #f7f7f3; border: 1px solid var(--line); font-size: 12px; }
.broadcast-log li span { color: var(--muted); font-size: 11px; text-align: right; }
.broadcast-log li.ok span { color: var(--forest); }
.broadcast-log li.bad span { color: var(--signal-dark); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* Empty, footer and feedback */
.empty { min-height: 110px; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); text-align: center; }.empty svg { width: 18px; }.empty strong { color: var(--ink-soft); font-size: 11px; }.empty span { font-size: 9px; }.empty.large { min-height: 580px; }.empty-symbol { width: 56px; height: 56px; display: grid; place-items: center; color: var(--forest); background: var(--forest-soft); border-radius: 50%; }.empty-symbol svg { width: 20px; }
footer { padding: 17px 2px 0; display: flex; justify-content: space-between; color: #8a918b; font: 500 8px var(--mono); letter-spacing: .3px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 90; max-width: min(480px, calc(100vw - 32px)); padding: 13px 16px; color: #fff; background: #153f30; border-left: 4px solid #57c88f; box-shadow: 0 18px 48px rgba(0,0,0,.2); font-size: 10px; animation: toast-in 220ms var(--ease); }.toast.error { background: #762e23; border-color: #f1947e; }

/* Login */
.login-gate { position: fixed; inset: 0; z-index: 50; padding: 26px; display: grid; grid-template-columns: minmax(300px, 1.15fr) minmax(360px, .85fr); align-items: stretch; color: #fff; background: #151815; }
.login-art { position: relative; display: flex; align-items: flex-end; padding: clamp(30px, 6vw, 90px); overflow: hidden; background: var(--forest); }.login-art::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(ellipse at 90% 10%, transparent 0 22px, rgba(255,255,255,.13) 23px 25px, transparent 26px 39px); transform: scale(1.35); }.login-art span { position: absolute; display: block; background: var(--signal); transform: rotate(-18deg); }.login-art span:nth-child(1) { width: 180%; height: 18px; left: -30%; top: 25%; }.login-art span:nth-child(2) { width: 180%; height: 5px; left: -25%; top: 39%; background: #f0c641; }.login-art span:nth-child(3) { width: 180%; height: 2px; left: -15%; top: 49%; background: rgba(255,255,255,.7); }.login-art div { position: relative; z-index: 1; font-size: clamp(52px, 7vw, 110px); font-weight: 800; line-height: .79; letter-spacing: -6px; }
.login-card { align-self: center; width: min(410px, 100%); margin: auto; padding: 38px; color: var(--ink); background: var(--surface); box-shadow: 0 30px 100px rgba(0,0,0,.25); }.login-logo { display: block; margin-bottom: 34px; color: var(--forest); }.login-card h1 { margin: 0; font-size: 35px; line-height: 1.08; letter-spacing: -2px; }.login-card > p:not(.section-index) { margin: 12px 0 28px; color: var(--muted); font-size: 11px; }.login-card label { display: block; margin: 14px 0; color: var(--muted); font-size: 9px; font-weight: 650; }.login-card input { width: 100%; margin-top: 6px; }.full { width: 100%; margin-top: 9px; }.form-error { margin-top: 10px; padding: 10px; color: var(--signal-dark); background: var(--signal-soft); border-left: 3px solid var(--signal); font-size: 10px; }

/* Dialog */
.modal { position: fixed; inset: 0; z-index: 70; padding: 20px; display: grid; place-items: center; }.modal-backdrop { position: absolute; inset: 0; border: 0; background: rgba(15,20,16,.7); backdrop-filter: blur(6px); cursor: default; }.modal-card { position: relative; z-index: 1; width: min(980px, 96vw); max-height: 84vh; overflow: auto; background: var(--surface); border: 1px solid #6f7770; box-shadow: 0 35px 100px rgba(0,0,0,.3); animation: dialog-in 240ms var(--ease); }.modal-accent { height: 5px; background: linear-gradient(90deg, var(--signal) 0 20%, var(--amber) 20% 46%, var(--forest) 46% 100%); }.modal-head { position: sticky; top: 0; z-index: 2; min-height: 93px; padding: 17px 20px; display: flex; align-items: flex-start; justify-content: space-between; background: rgba(251,251,248,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }.modal-head h2 { margin: 0; font-size: 20px; letter-spacing: -.6px; }.modal-head p:not(.section-index) { margin: 5px 0 0; color: var(--muted); font: 500 9px var(--mono); }.modal-close { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; }.modal-close:hover { color: #fff; background: var(--signal); border-color: var(--signal); }.modal-close svg { width: 17px; }.room-link { min-height: 44px; max-width: 310px; padding: 5px 0; display: flex; flex-direction: column; justify-content: center; color: var(--ink); background: transparent; border: 0; text-align: left; cursor: pointer; }.room-link strong, .room-link small { display: block; }.room-link strong { color: var(--forest); font-size: 10px; }.room-link small { margin-top: 4px; color: var(--muted); font: 500 8px var(--mono); }.room-link:hover strong { text-decoration: underline; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Tablet */
@media (max-width: 1199px) {
  :root { --sidebar: 202px; }
  main { padding: 30px 24px 18px; }
  .page-heading h1 { font-size: 42px; }
  .workspace.two-columns { grid-template-columns: 1fr; }
  .list-card { min-height: auto; }.group-list { max-height: 340px; }.detail-card { min-height: 580px; }
  .room-config-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .login-gate { grid-template-columns: .9fr 1.1fr; }.login-art div { font-size: 58px; }
}

/* Mobile */
@media (max-width: 767px) {
  :root { --sidebar: 0px; }
  .shell { display: block; }.sidebar { position: relative; height: auto; padding: 12px; overflow: visible; }.sidebar::after, .nav-label, .sidebar-note, .account { display: none; }.brand { padding: 2px 6px 12px; }.brand-mark { width: 34px; height: 34px; }.sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }.nav { min-height: 46px; grid-template-columns: 16px 1fr; padding: 0 8px; gap: 6px; }.nav b { display: none; }.nav::before { left: 0; bottom: -12px; width: 100%; height: 0; }.nav.active::before { width: 100%; height: 3px; }.nav span { font-size: 9px; }
  main { padding: 22px 10px 14px; }.topbar { align-items: flex-start; flex-direction: column; }.page-heading h1 { font-size: 38px; }.page-intro { max-width: 330px; }.toolbar { width: 100%; }.toolbar label { flex: 1; min-width: 0; }.toolbar .picker { width: 100%; max-width: none; }.toolbar button { flex: 1; }
  .health-strip { overflow-x: auto; white-space: nowrap; }.health-strip .last-sync { display: none; }.stats { grid-template-columns: repeat(2, 1fr); gap: 6px; }.stats article { min-height: 112px; padding: 13px; }.stats article > strong { font-size: 29px; }
  .card-head, .room-title { align-items: flex-start; flex-direction: column; }.card-head .search-field, .card-head .search, .inline-actions, .inline-actions .search-field, .inline-actions .search { width: 100%; }.inline-actions button { width: 100%; }.room-title > div:nth-child(2) { width: 100%; }.room-actions { width: 100%; }.room-actions button { flex: 1; }.room-config-grid { padding: 8px; }.schedule-controls { flex-direction: column; align-items: stretch; width: 100%; }.time-range label { flex: 1; }.schedule-box input[type="time"] { width: 100%; }.schedule-box #save-schedule { width: 100%; }.table-tools { align-items: flex-start; flex-direction: column; }.table-tools .search-field, .table-tools .search { width: 100%; }table { min-width: 720px; }.list-card, .detail-card { min-height: auto; }.empty.large { min-height: 360px; }
  footer { gap: 8px; flex-direction: column; }.login-gate { padding: 12px; display: grid; grid-template-columns: 1fr; }.login-art { display: none; }.login-card { padding: 28px 23px; }.login-card h1 { font-size: 31px; }.modal { padding: 7px; }.modal-card { width: 100%; max-height: 94vh; }.rooms-modal-card table { min-width: 790px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

.account-personal { margin-top: 16px; min-height: 0; }
.forward-grid { display: grid; grid-template-columns: minmax(280px, 36%) minmax(0, 1fr); gap: 16px; }
.forward-capture { margin-top: 16px; min-height: 0; }
.forward-polish { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.forward-polish p { margin: 0; flex: 1 1 240px; color: var(--muted); font-size: 13px; }
#ai-forward-prompt { min-height: 320px; }
.forward-copy-cell { width: 42%; min-width: 360px; }
.forward-copy { display: block; width: 100%; min-height: 96px; max-height: 320px; resize: vertical; overflow: auto; line-height: 1.7; }
.forward-promo-account { min-width: 120px; max-width: 200px; white-space: normal; word-break: break-word; font-size: 12px; }
.forward-source { max-width: 560px; max-height: 320px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
.forward-status { white-space: nowrap; }
#forward-messages td { vertical-align: top; }
.forward-tools { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.forward-tools label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.forward-tools .picker { min-width: 220px; max-width: 360px; }
#forward-reseller-status { align-self: end; margin-bottom: 8px; color: var(--muted); font-size: 13px; font-weight: 400; line-height: 1.65; }
#forward-reseller-status.muted { font-size: 13px; }
#forward-reseller-bind,
#forward-reseller-unbind { align-self: end; }
#forward-promo-wrap { min-width: 160px; }
.forward-member-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.forward-member-tools .search-field { flex: 1 1 180px; min-width: 0; }
.forward-member-tools .search { width: 100%; }
.forward-list, .forward-targets { max-height: 460px; overflow: auto; }
.forward-room, .forward-check { width: 100%; display: grid; gap: 2px; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; cursor: pointer; }
.forward-room.active { background: #eef6ef; }
.forward-room small, .forward-check small { color: var(--muted); }
.forward-check { grid-template-columns: 18px minmax(0, 1fr); align-items: center; }
.forward-member { display: flex; align-items: center; gap: 8px; min-width: 0; }
.forward-member .group-avatar { width: 28px; height: 28px; flex: none; }
.forward-targets { display: flex; flex-wrap: wrap; max-height: 180px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.forward-targets .forward-check { width: auto; min-width: 180px; border: 1px solid var(--line); margin: 4px; }
@media (max-width: 767px) { .forward-grid, .forward-polish { grid-template-columns: 1fr; } }
.account-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; background: #f3f4ef; border-bottom: 1px solid var(--line); }
.account-stats article { min-height: 84px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); }
.account-stats span { color: var(--muted); font-size: 11px; }
.account-stats strong { display: block; margin-top: 8px; font: 750 32px/1 var(--mono); letter-spacing: -1px; }
.account-stats article:nth-child(2) strong { color: #9a4d16; }
.account-filters { justify-content: flex-start; align-items: flex-end; }
.account-filters > label:not(.search-field) { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 650; }
.account-cell { display: flex; align-items: center; gap: 10px; }
.account-cell img, .account-fallback { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--forest-soft); }
.account-fallback { display: grid; place-items: center; color: var(--forest); font-weight: 800; }
.account-cell strong, .account-cell small, .login-meta small { display: block; }
.account-cell small, .login-meta small { margin-top: 3px; color: var(--muted); font: 500 10px var(--mono); }
.device-meta small { display: block; margin-top: 3px; color: var(--muted); }
.status.online { color: #176b45; background: #e5f4ec; }
.row-actions { display: flex; flex-wrap: wrap; gap: 4px; }
.text-action { min-height: 32px; padding: 0 6px; color: var(--forest); background: transparent; border: 0; font-size: 12px; font-weight: 700; cursor: pointer; }
.text-action.danger { color: var(--signal-dark); }
.bind-modal-card { width: min(520px, 96vw); }
.bind-form, .bind-qr, .bind-code { display: grid; gap: 12px; padding: 18px 20px 20px; }
.bind-form label, .bind-code label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 700; }
.bind-code input { min-height: 44px; padding: 10px 12px; color: var(--ink); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 6px; }
.bind-qr { justify-items: center; text-align: center; }
.bind-qr img { width: 220px; height: 220px; object-fit: contain; background: #fff; border: 1px solid var(--line); }
#bind-status { margin: 0; color: var(--ink); font-size: 14px; font-weight: 700; }
.detail-grid { margin: 0; padding: 8px 20px 20px; display: grid; grid-template-columns: 96px 1fr; gap: 10px 12px; }
.detail-grid dt { color: var(--muted); font-size: 12px; }
.detail-grid dd { margin: 0; font-size: 13px; word-break: break-all; }
@media (max-width: 767px) { .account-stats { grid-template-columns: 1fr; } .account-filters { align-items: stretch; } }

/* Member pagination */
.pagination-bar { min-height: 66px; padding: 10px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #f5f5f1; border-top: 1px solid var(--line); }
#tab-members .pagination-bar, #tab-actions .pagination-bar { justify-content: flex-end; }
#tab-actions .pagination-controls > span { min-width: 240px; }
.pagination-settings, .pagination-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.member-filter-bar { padding: 10px 18px; background: #f5f5f1; border-bottom: 1px solid var(--line); }
.pagination-settings label { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.pagination-settings .picker-trigger { min-height: 40px; font-size: 12px; }
.pagination-controls > span { min-width: 150px; color: var(--muted); font: 600 9px var(--mono); text-align: center; }
.page-button { min-width: 92px; min-height: 44px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--ink-soft); background: var(--surface-strong); border: 1px solid var(--line-strong); border-radius: 6px; font-size: 10px; font-weight: 700; cursor: pointer; }
.page-button:hover:not(:disabled) { color: #fff; background: var(--forest); border-color: var(--forest); }.page-button:disabled { color: #a6aca7; background: #eceeea; border-color: #dde0dc; cursor: not-allowed; }.page-button svg { width: 14px; }
.confirm-card { width: min(440px, 96vw); }
.confirm-body { padding: 22px 22px 20px; }
.confirm-body h2 { margin: 0; font-size: 22px; letter-spacing: -.6px; }
.confirm-body > p:not(.section-index) { margin: 12px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.confirm-actions { margin-top: 22px; display: flex; justify-content: flex-end; gap: 8px; }
#confirm-modal { z-index: 80; }
@media (max-width: 767px) { .pagination-bar { align-items: stretch; flex-direction: column; }.pagination-settings { display: grid; grid-template-columns: 1fr 1fr; }.pagination-settings label { align-items: stretch; flex-direction: column; }.pagination-settings .picker { width: 100%; }.pagination-controls { justify-content: space-between; }.pagination-controls > span { min-width: 0; flex: 1; }.page-button { min-width: 82px; } .confirm-actions { flex-direction: column-reverse; } .confirm-actions button { width: 100%; } }

.system-stack { display: grid; gap: 16px; }
.invite-form { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; padding: 0 18px 16px; }
.invite-form label { display: flex; flex-direction: column; gap: 6px; min-width: 140px; color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .4px; }
.invite-form input { width: 160px; }
.invite-result { margin: 0 18px 16px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--forest-soft); border-radius: 6px; }
.invite-result code { font-size: 12px; word-break: break-all; }
.quota-input { width: 72px; min-height: 36px; padding: 6px 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

body.moments-page .health-strip,
body.moments-page .stats,
body.chat-page .health-strip,
body.chat-page .stats { display: none; }
.moments { width: auto; max-width: none; margin: 0 -42px -20px; min-height: calc(100vh - 168px); background: #ededed; border: 0; }
.moments-cover { height: 210px; position: relative; background: linear-gradient(160deg, #24362d 0%, #1a3d31 42%, #0e2420 100%); }
.moments-cover::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 20% 30%, rgba(255,255,255,.16), transparent 28%), radial-gradient(circle at 80% 10%, rgba(255,255,255,.08), transparent 22%); }
.moments-profile { position: absolute; right: 18px; bottom: -28px; z-index: 1; display: flex; align-items: flex-end; gap: 12px; }
.moments-profile strong { margin-bottom: 34px; color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.moments-avatar, .moment-avatar { width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; color: var(--forest); background: #fff; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); font-size: 22px; font-weight: 700; }
.moments-avatar img, .moment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.moments-composer { margin: 44px 12px 0; padding: 14px 14px 10px; background: #fff; }
.moments-composer textarea { width: 100%; min-height: 88px; padding: 0; border: 0; resize: vertical; background: transparent; font-size: 16px; line-height: 1.7; box-shadow: none; }
.moments-composer textarea:focus { border: 0; box-shadow: none; }
.moments-picks { display: grid; grid-template-columns: repeat(3, 72px); gap: 6px; }
.moments-picks:empty { display: none; }
.moment-pick { position: relative; width: 72px; height: 72px; background: #f3f3f3; }
.moment-pick img { width: 100%; height: 100%; object-fit: cover; }
.moment-pick button { position: absolute; top: 0; right: 0; width: 22px; height: 22px; padding: 0; color: #fff; background: rgba(0,0,0,.55); border: 0; font-size: 14px; line-height: 22px; cursor: pointer; }
.moments-tools { margin-top: 10px; padding-top: 10px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #f0f0f0; }
.moments-tool { position: relative; min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; color: #576b95; background: #f7f7f7; border-radius: 4px; font-size: 13px; font-weight: 700; cursor: pointer; }
.moments-tool input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#moments-hint { flex: 1; color: #888; font-size: 12px; line-height: 1.65; }
#moments-submit { min-height: 32px; padding: 0 16px; border-radius: 4px; }
.moments-feed { display: grid; gap: 0; padding: 8px 0 16px; }
.moments-empty { margin: 16px 12px; padding: 28px 16px; color: #888; background: #fff; text-align: center; font-size: 14px; }
.moment { margin: 0 12px; padding: 16px 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; background: transparent; border-bottom: 1px solid #e5e5e5; }
.moment-avatar { width: 42px; height: 42px; border-width: 0; font-size: 14px; box-shadow: none; }
.moment-body { min-width: 0; }
.moment-name { color: #576b95; font-size: 15px; font-weight: 700; }
.moment-copy { margin: 6px 0 0; color: #111; font-size: 15px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.moment-grid { margin-top: 8px; display: grid; gap: 4px; }
.moment-grid.one { grid-template-columns: minmax(0, 220px); }
.moment-grid.two { width: min(100%, 280px); grid-template-columns: 1fr 1fr; }
.moment-grid.three { width: min(100%, 320px); grid-template-columns: 1fr 1fr 1fr; }
.moment-grid img, .moment-grid span, .moment-video { width: 100%; aspect-ratio: 1; object-fit: cover; background: #f3f3f3; }
.moment-grid.one img, .moment-grid.one .moment-video { aspect-ratio: auto; max-height: 280px; }
.moment-grid span { display: grid; place-items: center; color: #888; font-size: 12px; }
.moment-video { position: relative; display: block; overflow: hidden; }
.moment-video img { width: 100%; height: 100%; object-fit: cover; }
.moment-video i { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; background: rgba(0,0,0,.45); border-radius: 50%; }
.moment-video i::after { content: ""; position: absolute; left: 14px; top: 10px; border-style: solid; border-width: 8px 0 8px 12px; border-color: transparent transparent transparent #fff; }
.moment-meta { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.moment-meta time { color: #999; font-size: 12px; }
.moment-meta button { min-height: 28px; padding: 0 8px; color: #576b95; background: transparent; border: 0; font-size: 13px; cursor: pointer; }
@media (max-width: 1199px) {
  .moments { margin-left: -24px; margin-right: -24px; }
}
@media (max-width: 767px) {
  .moments { margin: 0 -10px -14px; min-height: calc(100vh - 210px); }
  .moments-profile { right: 12px; }
  .moments-profile strong { font-size: 16px; }
  #moments-hint { display: none; }
}

@media (min-width: 768px) {
  .sidebar nav { flex: 1; min-height: 0; overflow: auto; align-content: start; }
  body.chat-page { height: 100vh; overflow: hidden; }
  body.chat-page .shell { height: 100vh; min-height: 0; overflow: hidden; }
  body.chat-page main { height: 100vh; min-height: 0; overflow: clip; display: flex; flex-direction: column; }
  body.chat-page .topbar { flex: none; }
  body.chat-page footer { display: none; }
  body.chat-page #tab-chats.panel.active { display: flex; flex: 1; min-height: 0; }
  body.chat-page .chat-shell { flex: 1; min-height: 0; margin-bottom: 0; overflow: hidden; }
}

.chat-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: calc(100vh - 188px);
  min-height: 520px;
  margin: 0 -42px -20px;
  overflow: hidden;
  background: #ededed;
  border-top: 1px solid #e6e6e1;
}
.chat-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: #f7f7f7; border-right: 1px solid #e1e1e1; }
.chat-list-head { padding: 12px; display: grid; gap: 8px; background: #f7f7f7; border-bottom: 1px solid #ececec; }
.chat-account { display: grid; gap: 6px; color: var(--muted); font-size: 12px; }
.chat-account select { width: 100%; }
#chat-forward-modal .modal-card { width: min(560px, 96vw); padding: 18px 20px 16px; }
#chat-forward-modal h2 { margin: 0 0 8px; }
#chat-forward-modal .forward-targets { max-height: 280px; border: 1px solid var(--line); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.chat-filters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.chat-filters button { min-height: 30px; color: #576b95; background: #fff; border: 1px solid #e5e5e5; border-radius: 4px; font-size: 12px; font-weight: 700; cursor: pointer; }
.chat-filters button.active { color: #fff; background: #174f3b; border-color: #174f3b; }
.chat-list-head .search-field { width: 100%; background: #fff; }
.chat-threads { flex: 1; min-height: 0; overflow: auto; }
.chat-thread { width: 100%; min-height: 68px; padding: 10px 12px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #ededed; cursor: pointer; }
.chat-thread.is-human-mode { border-left: 3px solid #ea580c; padding-left: 9px; background: #fffbf7; }
.chat-thread.active { background: #c9c9c9; }
.chat-thread:hover { background: #ececec; }
.chat-thread.active:hover { background: #c9c9c9; }
.chat-avatar, .chat-head .chat-avatar { width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; color: #174f3b; background: #fff; border-radius: 4px; font-size: 14px; font-weight: 700; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.is-room-grid { padding: 2px; gap: 1.5px; background: #dddee0 !important; place-items: stretch !important; align-content: center; box-sizing: border-box; }
.is-room-grid.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.is-room-grid.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.is-room-grid img, .is-room-grid i { width: 100%; height: 100%; aspect-ratio: 1 / 1; display: grid; place-items: center; overflow: hidden; object-fit: cover; border-radius: 1.5px; background: #fff; color: #174f3b; font-style: normal; font-size: 8px; font-weight: 700; line-height: 1; }
.chat-thread-copy { min-width: 0; display: grid; gap: 4px; }
.chat-thread-copy strong, .chat-thread-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-thread-copy strong { display: flex; align-items: center; gap: 4px; min-width: 0; color: #111; font-size: 15px; font-weight: 650; }
.chat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-count { flex: none; font-weight: 650; }
.chat-mode-tag { flex: none; display: inline-flex; align-items: center; gap: 2px; height: 18px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: 0.01em; }
.chat-mode-tag.is-ai { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.chat-mode-tag.is-human { color: #fff; background: #ea580c; border: 1px solid #c2410c; }
.chat-mode-tag.is-off { color: #6b7280; background: #f3f4f6; border: 1px solid #d1d5db; font-weight: 600; }
.chat-thread-copy em { color: #888; font-size: 12px; font-style: normal; }
.chat-thread-side { display: grid; justify-items: end; gap: 6px; }
.chat-thread-side time { color: #b2b2b2; font-size: 11px; }
.chat-thread-side b { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; color: #fff; background: #fa5151; border-radius: 9px; font-size: 11px; font-weight: 700; }
.chat-main { min-width: 0; min-height: 0; overflow: hidden; display: grid; grid-template-rows: 58px minmax(0, 1fr) auto; background: #ededed; }
.chat-head { padding: 0 16px; display: flex; align-items: center; gap: 10px; background: #f5f5f5; border-bottom: 1px solid #e5e5e5; }
.chat-head-copy { min-width: 0; flex: 1; }
.chat-head strong { display: flex; align-items: baseline; min-width: 0; color: #111; font-size: 16px; }
.chat-head .chat-name { display: block; }
.chat-head .chat-count { display: block; }
.chat-head .chat-sub, .chat-head > span { display: block; color: #888; font-size: 12px; }
.chat-head-main { width: 100%; padding: 0; display: block; text-align: left; background: transparent; border: 0; cursor: pointer; }
.chat-more { flex: none; min-height: 32px; padding: 0 12px; color: #174f3b; background: #fff; border: 1px solid #d9d9d9; border-radius: 4px; cursor: pointer; font-size: 13px; }
.chat-more.chat-mode-btn.is-ai { color: #166534; background: #f0fdf4; border-color: #86efac; font-weight: 600; }
.chat-more.chat-mode-btn.is-ai:hover { background: #dcfce7; }
.chat-more.chat-mode-btn.is-human { color: #fff; background: #ea580c; border-color: #c2410c; font-weight: 700; }
.chat-more.chat-mode-btn.is-human:hover { background: #c2410c; }
.chat-more.chat-mode-btn.is-off { color: #4b5563; background: #f9fafb; border-color: #d1d5db; }
.chat-more.is-handoff { color: #9a3412; background: #fff7ed; border-color: #fdba74; font-weight: 600; }
.chat-more.is-handoff.has-alert { color: #fff; background: #ea580c; border-color: #c2410c; }
.chat-stage { position: relative; min-height: 0; height: 100%; overflow: hidden; display: flex; }
.chat-log { flex: 1; min-width: 0; height: 100%; min-height: 0; overflow: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; }
.chat-handoff { width: 320px; max-width: 44%; flex: none; height: 100%; min-height: 0; display: flex; flex-direction: column; background: #faf8f5; border-left: 1px solid #e5dfd5; z-index: 2; }
.chat-handoff.hidden { display: none; }
.chat-handoff-head { padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #fff7ed; border-bottom: 1px solid #fed7aa; }
.chat-handoff-title { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-handoff-badge { display: inline-block; width: fit-content; padding: 1px 6px; color: #9a3412; background: #ffedd5; border: 1px solid #fdba74; border-radius: 4px; font-size: 11px; font-weight: 700; }
.chat-handoff-title strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #431407; font-size: 14px; }
.chat-handoff-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.chat-handoff-actions button { padding: 4px 8px; color: #9a3412; background: #fff; border: 1px solid #fdba74; border-radius: 4px; cursor: pointer; font-size: 12px; }
.chat-handoff-actions button:hover { background: #ffedd5; }
.chat-handoff-actions button.is-resume-ai { color: #fff; background: #16a34a; border-color: #15803d; font-weight: 600; }
.chat-handoff-actions button.is-resume-ai:hover { background: #15803d; }
.chat-handoff-actions button.hidden { display: none; }
.chat-handoff-actions button:disabled { opacity: .6; cursor: wait; }
.chat-handoff-body { flex: 1; min-height: 0; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.handoff-mode-banner { padding: 8px 10px; border-radius: 6px; font-size: 12px; line-height: 1.55; }
.handoff-mode-banner strong { display: block; font-size: 12px; font-weight: 700; }
.handoff-mode-banner span { display: block; margin-top: 2px; font-size: 11px; opacity: .9; }
.handoff-mode-banner.is-human { color: #9a3412; background: #ffedd5; border: 1px solid #fdba74; }
.handoff-mode-banner.is-ai { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.chat-handoff-empty { padding: 24px 10px; color: #78716c; text-align: center; font-size: 12px; line-height: 1.7; }
.handoff-card { padding: 10px 12px; background: #fff; border: 1px solid #e7e5e4; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.handoff-card.is-problem { border-left: 3px solid #ea580c; }
.handoff-card.is-benefit { border-left: 3px solid #d97706; background: #fffbeb; }
.handoff-card.is-key { border-left: 3px solid #0284c7; }
.handoff-card.is-suggest { border-left: 3px solid #16a34a; background: #f0fdf4; }
.handoff-card-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; color: #57534e; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.handoff-card-text { color: #1c1917; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.handoff-meta { padding: 6px 8px; color: #78716c; background: #f5f5f4; border-radius: 4px; font-size: 11px; line-height: 1.65; }
.bubble-ai-note.is-in.is-human { cursor: pointer; }
.bubble-ai-note.is-in.is-human:hover { filter: brightness(0.97); }
.chat-members { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 3; display: flex; flex-direction: column; background: #f7f7f7; border-left: 1px solid #e5e5e5; box-shadow: -8px 0 24px rgba(0, 0, 0, .06); }
.chat-members.hidden { display: none; }
.chat-members-bar { padding: 12px 12px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chat-members-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #111; font-size: 15px; }
.chat-members-actions { display: flex; align-items: center; gap: 2px; flex: none; }
#chat-members-close, #chat-members-kick { border: 0; background: transparent; color: #576b95; cursor: pointer; font-size: 13px; }
#chat-members-kick.is-on { color: #fa5151; }
.chat-member-card { margin: 0 12px 8px; padding: 14px; display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 6px; }
.chat-member-card.hidden { display: none; }
.chat-member-card div { min-width: 0; }
.chat-member-card strong { display: block; color: #111; font-size: 16px; }
.chat-member-card span { display: block; margin-top: 4px; color: #888; font-size: 12px; }
.chat-member-remove { margin-top: 8px; padding: 0; border: 0; background: transparent; color: #fa5151; cursor: pointer; font-size: 13px; }
img.chat-member-hero, span.chat-member-hero { width: 56px; height: 56px; flex: none; display: grid; place-items: center; overflow: hidden; object-fit: cover; color: #174f3b; background: #f3f3f3; border-radius: 6px; font-size: 20px; font-weight: 700; }
.chat-member-search { width: auto; margin: 0 12px 8px; background: #fff; }
.chat-member-grid { flex: 1; min-height: 0; overflow: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 8px; align-content: start; padding: 12px 12px 20px; background: #fff; }
.chat-member { position: relative; min-width: 0; padding: 0; background: transparent; border: 0; cursor: pointer; text-align: center; }
.chat-member-face-wrap { position: relative; width: 48px; margin: 0 auto; display: block; }
.chat-kick-badge { position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; display: grid; place-items: center; color: #fff; background: #fa5151; border: 1px solid #fff; border-radius: 50%; font-style: normal; font-size: 14px; line-height: 1; }
.chat-member.active { background: #ededed; border-radius: 6px; }
.chat-member strong { display: block; margin-top: 6px; color: #111; font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-member em { display: block; color: #fa9d3b; font-size: 10px; font-style: normal; }
img.chat-member-face, span.chat-member-face { width: 48px; height: 48px; margin: 0 auto; display: grid; place-items: center; overflow: hidden; object-fit: cover; color: #174f3b; background: #f3f3f3; border-radius: 4px; font-size: 16px; font-weight: 700; }
.chat-member-empty { grid-column: 1 / -1; padding: 28px 12px; color: #888; text-align: center; font-size: 13px; line-height: 1.7; }
.chat-menu { position: fixed; z-index: 30; min-width: 148px; padding: 6px; background: #fff; border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .16); }
.chat-menu.hidden { display: none; }
.chat-menu button { width: 100%; padding: 10px 14px; display: block; text-align: left; color: #111; background: transparent; border: 0; border-radius: 8px; cursor: pointer; font-size: 15px; }
.chat-menu button:hover { background: #f5f5f5; }
.chat-menu button.danger { color: #fa5151; }
.ai-layout { display: grid; gap: 16px; }
.ai-switch-grid, .ai-decision-grid, .ai-keywords { display: grid; gap: 12px; }
.ai-switch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ai-decision-grid, .ai-keywords { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
.ai-gate { display: grid; gap: 10px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.ai-gate h3 { margin: 0; font-size: 16px; }
.ai-room-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ai-room-count { flex-shrink: 0; padding: 4px 10px; border-radius: 999px; background: #eef6f1; color: var(--forest); font-size: 12px; font-weight: 600; cursor: pointer; user-select: none; border: 1px solid #cce3d4; transition: all .15s ease; }
.ai-room-count:hover { background: #e0f0e6; }
.ai-room-count.is-active { background: var(--forest); color: #fff; border-color: var(--forest); }
.ai-room-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ai-room-search { flex: 1 1 200px; }
.ai-room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-room-actions button { padding: 6px 12px; font-size: 13px; }
.ai-room-actions button.active { background: var(--forest); color: #fff; border-color: var(--forest); }
.ai-room-selected-bar { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; background: #eef7f1; border: 1px solid #c5dfd0; border-radius: 8px; }
.ai-room-selected-bar.hidden { display: none; }
.ai-selected-label { flex: none; padding-top: 3px; font-size: 12px; font-weight: 650; color: var(--forest); white-space: nowrap; }
.ai-selected-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 110px; overflow-y: auto; }
.ai-selected-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; background: #fff; color: var(--forest); border: 1px solid #a8d0b9; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.ai-selected-chip:hover { background: #fef2f2; color: #b91c1c; border-color: #fca5a5; }
.ai-selected-chip i { font-style: normal; font-size: 14px; line-height: 1; opacity: .75; }
.ai-room-list { max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fafaf8; }
.ai-room-item.is-checked { background: #eef7f1; border-radius: 6px; }
.ai-room-item.is-checked strong { color: var(--forest); font-weight: 700; }
.ai-gate-prompt { margin: 0; padding: 12px 14px; color: var(--ink, #17211c); background: #f7f7f5; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; line-height: 2.2; }
.ai-gate-prompt p { margin: 0; }
.ai-gate-prompt input { width: 22em; max-width: calc(100% - 12em); min-height: 32px; display: inline-block; margin: 0 4px; padding: 2px 8px; vertical-align: middle; color: inherit; background: #fff; border: 1px solid var(--line); border-radius: 4px; font: inherit; }
.ai-editor { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; }
.ai-agents { display: flex; flex-direction: column; gap: 8px; }
.ai-agents button { padding: 10px 12px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.ai-agents button.active { border-color: var(--forest); background: #eef6f1; }
.ai-agents strong, .ai-agents small { display: block; }
.ai-agents small { margin-top: 2px; color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .ai-switch-grid, .ai-decision-grid, .ai-keywords, .ai-editor { grid-template-columns: 1fr; }
}
.chat-empty { margin: auto; padding: 28px 16px; color: #888; text-align: center; font-size: 13px; line-height: 1.7; }
.bubble-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; align-items: flex-start; max-width: min(78%, 640px); }
.bubble-row.in { align-self: flex-start; }
.bubble-row.out { align-self: flex-end; grid-template-columns: minmax(0, 1fr) 36px; }
.bubble-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.bubble-row.out .bubble-copy { align-items: flex-end; }
.bubble-avatar, .bubble-row .bubble-avatar { width: 36px; height: 36px; display: grid; place-items: center; overflow: hidden; color: #174f3b; background: #fff; border-radius: 4px; font-size: 12px; font-weight: 700; }
.bubble-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bubble-meta { margin-bottom: 4px; color: #888; font-size: 12px; }
.bubble { padding: 9px 12px; color: #111; background: #fff; border-radius: 6px; font-size: 15px; line-height: 1.68; white-space: pre-wrap; word-break: break-word; }
.bubble-row.out .bubble { background: #95ec69; }
.bubble.is-image { padding: 0; background: transparent; }
.bubble-row.out .bubble.is-image { background: transparent; }
.bubble-ai-note { margin-top: 5px; padding: 3px 8px; border-radius: 4px; font-size: 11px; line-height: 1.65; max-width: 100%; word-break: break-word; }
.bubble-ai-note.is-out { color: #1f5138; background: rgba(23, 79, 59, 0.09); border: 1px solid rgba(23, 79, 59, 0.18); text-align: right; }
.bubble-ai-note.is-in { color: #4a5568; background: rgba(255, 255, 255, 0.78); border: 1px solid #dcdcdc; }
.bubble-ai-note.is-in.is-replied { color: #17593d; background: #e8f5ee; border-color: #bfe2ce; }
.bubble-ai-note.is-in.is-ignored { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; }
.bubble-ai-note.is-in.is-human, .bubble-ai-note.is-in.is-failed { color: #9a3412; background: #ffedd5; border-color: #fdba74; }
.bubble-ai-note.is-in.is-processing { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.bubble-image { max-width: min(240px, 100%); max-height: 280px; display: block; border-radius: 6px; background: #e5e5e5; }
.chat-composer { padding: 10px 12px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: end; background: #f5f5f5; border-top: 1px solid #e5e5e5; }
#chat-image { min-height: 36px; padding: 0 12px; border-radius: 4px; }
.chat-composer textarea { width: 100%; min-height: 72px; max-height: 160px; padding: 10px 12px; resize: vertical; border: 0; border-radius: 4px; background: #fff; font-size: 15px; line-height: 1.68; box-shadow: none; }
.chat-composer textarea:focus { border: 0; box-shadow: none; }
#chat-send { min-height: 36px; padding: 0 18px; border-radius: 4px; }
@media (max-width: 1199px) {
  .chat-shell { margin-left: -24px; margin-right: -24px; }
}
@media (max-width: 767px) {
  .chat-shell { grid-template-columns: 1fr; grid-template-rows: 280px minmax(420px, 1fr); height: auto; min-height: calc(100vh - 220px); margin: 0 -10px -14px; }
  .chat-list { border-right: 0; border-bottom: 1px solid #e1e1e1; }
  .bubble-row { max-width: 86%; }
}
.tag-chip.status-chip { border-color: #c8dad0; background: #f2f8f4; color: #1d573e; }
.tag-chip.status-chip.is-deleted { border-color: #f3c6b6; background: #fff5f1; color: #9a3412; }
.tag-chip.status-chip.is-internal { border-color: #bfd6f6; background: #eff6ff; color: #1d4ed8; }
.tag-chip.status-chip.active { background: var(--forest); border-color: var(--forest); color: #fff; }
.tag-chip.status-chip.is-deleted.active { background: #b43c18; border-color: #b43c18; color: #fff; }
.tag-chip.status-chip.is-internal.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* Action log detail drawer */
.action-row { cursor: pointer; transition: background .15s ease; }
.action-row:hover { background: #f3f7f4; }
.action-row.active { background: #eaf4ef; box-shadow: inset 3px 0 0 var(--forest); }
.action-type-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #166534; background: #e8f5ee; border: 1px solid #bfe2ce; white-space: nowrap; }
.action-type-pill.is-err { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.action-detail-cell { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.action-result { font-size: 13px; font-weight: 700; }
.action-result.is-ok { color: #168a45; }
.action-result.is-fail { color: #d21f1f; }
.action-open-btn { flex: none; padding: 0 8px; min-height: 26px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 12px; }
.text-danger { color: #dc2626 !important; font-weight: 600; }

.action-drawer-backdrop { position: fixed; inset: 0; z-index: 88; background: rgba(15, 23, 42, 0.24); backdrop-filter: blur(1px); }
.action-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 89; width: min(580px, 94vw); display: flex; flex-direction: column; background: #ffffff; border-left: 1px solid #e5e7eb; box-shadow: -12px 0 36px rgba(15, 23, 42, 0.14); }
.action-drawer-head { padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #f0f2f5; }
.action-drawer-title-wrap { display: flex; align-items: center; gap: 10px; }
.action-drawer-title-wrap h3 { margin: 0; font-size: 17px; font-weight: 700; color: #111827; }
.action-drawer-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.action-drawer-badge.is-ok { color: #15803d; background: #ecfdf3; border: 1px solid #bbf7d0; }
.action-drawer-badge.is-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; }
.action-drawer-close { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; color: #6b7280; background: transparent; border: 0; border-radius: 6px; font-size: 22px; line-height: 1; cursor: pointer; }
.action-drawer-close:hover { background: #f3f4f6; color: #111827; }

.action-drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 16px; }
.action-meta-card { padding: 16px 18px; background: #fff; border: 1px solid #ebeef2; border-radius: 12px; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03); }
.action-meta-grid, .action-parsed-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.action-meta-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; }
.action-meta-item.full { grid-column: 1 / -1; }
.action-meta-item > span { color: #8c95a3; font-size: 13px; }
.action-meta-item > strong { color: #1f2937; font-weight: 600; word-break: break-all; display: inline-flex; align-items: center; gap: 6px; }
.acct-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #2563eb; }
.acct-dot.is-error { background: #dc2626; }
.action-copy-btn { padding: 3px 5px; min-height: 0; display: inline-flex; align-items: center; justify-content: center; color: #9ca3af; background: transparent; border: 1px solid transparent; border-radius: 4px; cursor: pointer; }
.action-copy-btn:hover { color: #374151; background: #f3f4f6; border-color: #e5e7eb; }
.action-copy-btn.light { color: #94a3b8; font-size: 11px; padding: 2px 8px; border-color: rgba(148, 163, 184, 0.25); }
.action-copy-btn.light:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }

.action-drawer-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid #eef0f4; padding: 0 4px; }
.action-drawer-tabs button { padding: 10px 2px; min-height: 0; color: #64748b; background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.action-drawer-tabs button.active { color: #2563eb; border-bottom-color: #2563eb; }

.action-tab-panel { display: none; flex-direction: column; gap: 14px; }
.action-tab-panel.active { display: flex; }

.action-parsed-card { padding: 18px 20px; background: #fff; border: 1px solid #ebeef2; border-radius: 12px; display: flex; flex-direction: column; gap: 14px; }
.action-parsed-kicker { display: flex; align-items: center; gap: 6px; color: #8c95a3; font-size: 13px; font-weight: 600; }
.action-parsed-headline { font-size: 16px; font-weight: 700; color: #111827; line-height: 1.55; word-break: break-word; }
.action-parsed-headline.is-error { color: #111827; }
.action-parsed-interface { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13px; }
.action-parsed-interface > span { color: #8c95a3; }
.action-parsed-interface code { font-family: var(--mono); font-size: 13px; color: #111827; background: transparent; padding: 0; }
.action-parsed-divider { border-top: 1px dashed #e5e7eb; margin: 2px 0; }

.action-json-block { border-radius: 10px; overflow: hidden; background: #0f141c; border: 1px solid #1e293b; }
.action-json-head { padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; background: #18202c; border-bottom: 1px solid #263142; color: #e2e8f0; font-size: 12px; font-weight: 600; }
.action-json-head em { font-style: normal; color: #64748b; margin-left: 4px; font-family: var(--mono); }
.action-json-pre { margin: 0; padding: 14px 16px; overflow-x: auto; color: #e2e8f0; font: 500 12.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; }
.action-json-pre .json-key { color: #7dd3fc; }
.action-json-pre .json-string { color: #4ade80; }
.action-json-pre .json-number, .action-json-pre .json-bool { color: #fb923c; }

.action-raw-hint { margin: 0; color: #8c95a3; font-size: 12px; }
.action-raw-card { border: 1px solid #e5e7eb; border-radius: 10px; background: #f9fafb; overflow: hidden; }
.action-raw-head { padding: 10px 14px; display: flex; align-items: center; justify-content: space-between; background: #f3f4f6; border-bottom: 1px solid #e5e7eb; color: #374151; font-size: 13px; font-weight: 600; }
.action-raw-pre { margin: 0; padding: 14px 16px; max-height: 520px; overflow: auto; color: #1f2937; font: 500 12.5px/1.65 var(--mono); white-space: pre-wrap; word-break: break-word; }

/* Rich Member Profile Cell */
.source-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.profile-line { display: flex; flex-direction: column; gap: 3px; max-width: 360px; color: #4f5952; font-size: 11.5px; line-height: 1.5; }
.prof-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: #2b332e; font-weight: 500; }
.prof-badge { display: inline-flex; align-items: center; padding: 1px 6px; border-radius: 4px; font-size: 10.5px; font-weight: 650; line-height: 1.4; }
.prof-badge.is-active { color: #1f5c3f; background: #e5f3ec; border: 1px solid #c2e2d1; }
.prof-badge.is-deleted { color: #9a3412; background: #fef1eb; border: 1px solid #f6d0be; }
.prof-badge.is-internal { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
.prof-meta { color: #68736b; font-size: 11px; line-height: 1.45; }
.prof-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.prof-tag { font-style: normal; padding: 1px 6px; border-radius: 3px; font-size: 10px; color: #4a554e; background: #eef0ec; border: 1px solid #dfe3dc; }

/* Wide Internal Staff Picker with Avatars */
.picker.is-staff-picker { min-width: 280px; }
.picker.is-staff-picker .picker-trigger span { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.picker.is-staff-picker .picker-staff-name { font-weight: 650; color: var(--ink); white-space: nowrap; }
.picker.is-staff-picker .picker-staff-sub { font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.picker.is-staff-picker .picker-menu { min-width: 390px; width: max-content; max-width: min(540px, 90vw); right: auto; max-height: 360px; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.picker.is-staff-picker .picker-menu[hidden] { display: none !important; }
.picker-search-box { padding: 8px; border-bottom: 1px solid #e3e7e3; background: #f8faf8; flex: none; }
.picker-search-input { width: 100%; min-height: 34px !important; padding: 6px 10px !important; font: 500 12.5px var(--font); border: 1px solid #cbd5ce !important; border-radius: 6px !important; background: #fff !important; }
.picker-options-scroll { padding: 6px; overflow-y: auto; max-height: 300px; flex: 1; }
.picker-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: 12px; }
.picker-avatar { width: 24px; height: 24px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--forest); background: var(--forest-soft); border: 1px solid #cad6ce; object-fit: cover; overflow: hidden; }
.picker-option.is-staff-opt { min-height: 44px; padding: 6px 10px; gap: 10px; align-items: center; white-space: nowrap; }
.picker-option.hidden { display: none !important; }
.picker-opt-main { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex: 1; min-width: 0; }
.picker-opt-main strong { font-size: 13px; font-weight: 650; color: inherit; white-space: nowrap; }
.picker-opt-main small { font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.picker-option.is-staff-opt.active .picker-opt-main small { color: rgba(255, 255, 255, 0.85); }
.picker-option.is-staff-opt.active .picker-avatar { border-color: rgba(255, 255, 255, 0.6); }
