:root {
  /* PandaTV-inspired palette: warm amber on deep zinc + glass surfaces.
     Surface ramp is slightly cooler than zinc to let amber pop, with
     hairline borders (~rgba 0,0,0 alpha 8%) and large radii everywhere. */
  --bg-app: #0a0a0c;
  --bg-sidebar: #0e0e11;
  --bg-card: #161618;
  --bg-card-hover: #1f1f23;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);

  /* Neutral primary — no accent color. White/zinc only. */
  --primary: #f4f4f5;
  --primary-hover: #ffffff;
  --primary-soft: rgba(255, 255, 255, 0.08);
  --primary-glow: 0 8px 30px rgba(0, 0, 0, 0.35);

  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;

  --status-good: #10b981;
  --status-good-bg: rgba(16, 185, 129, 0.12);
  --status-bad: #ef4444;
  --status-bad-bg: rgba(239, 68, 68, 0.12);
  /* Warning kept as a desaturated stone tone (not yellow) so warning badges
     still read as distinct from good/bad without re-introducing brand amber. */
  --status-warn: #d6d3d1;
  --status-warn-bg: rgba(214, 211, 209, 0.10);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --radius-card: 16px;
  --radius-input: 10px;
  --radius-pill: 999px;

  --sidebar-width: 292px;
}

* {
  box-sizing: border-box;
}

/* 全局隐藏工具类。JS 里 34 处 classList.add("hidden") 依赖它——此前只有
   .studio-modal.hidden 等具体组合有规则，导致自带 display 的元素（如
   .top-account-signin 的 inline-flex）加了 hidden 也照样显示：登录后顶栏
   同时出现「登录」按钮和用户胸卡就是这个根因。!important 是刻意的。 */
.hidden { display: none !important; }

/* Thin scrollbar — matches pandatv global rule */
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.28); }
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent; }

body {
  margin: 0;
  color: var(--text-main);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
  /* App container handles scroll */
  /* Subtle neutral backdrop — no warm tint */
  background-color: var(--bg-app);
  background-image:
    radial-gradient(60% 50% at 0% 0%, rgba(255, 255, 255, 0.03), transparent 60%),
    radial-gradient(50% 50% at 100% 100%, rgba(255, 255, 255, 0.02), transparent 60%);
  background-attachment: fixed;
}

.app-container {
  display: flex;
  height: 100%;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(14, 14, 17, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  padding: 0 4px;
  overflow: visible;
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
}

.brand-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand-account-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.brand-account-switcher .brand-select {
  flex: 1;
  min-width: 0;
}

select.brand-select {
  height: 34px;
  font-size: 13px;
  padding: 4px 8px;
  line-height: normal;
}

.brand-add-btn {
  height: 30px;
  width: 30px;
  justify-content: center;
  padding: 0;
  flex: 0 0 auto;
}

.brand-create-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.brand-create-row.hidden {
  display: none;
}

.brand-name-input {
  height: 34px;
  font-size: 12px;
  padding: 6px 8px;
  flex: 1;
  min-width: 0;
}

.brand-create-btn {
  height: 34px;
  padding: 0 10px;
  font-size: 11px;
  flex: 0 0 auto;
}

/* 品牌 LOGO 显示在 MediaNow 字样左侧（2026-07-06 换新 M 标后放出来） */
.brand-icon {
  display: block;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}
.brand-icon-img {
  padding: 0;
  background: transparent;
  overflow: hidden;
}
.brand-icon-img img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.nav-menu {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* The menu has outgrown one screen (17 entries): without min-height:0 a
     flex child refuses to shrink below its content, so the Management group
     was silently clipped below the fold — admins "couldn't see Settings".
     Scroll inside the menu; brand header and footer stay pinned. */
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

/* Second-level entries: indented under their group label, slightly smaller
   and dimmer so the group headers read as the first level. */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  /* 7px (was 9px): 17 entries now — shave vertical footprint so the whole
     menu fits a 768px-tall laptop screen with little or no scrolling. */
  padding: 7px 12px 7px 22px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  text-align: left;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-item i {
  font-size: 18px;
  display: none;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}
.nav-item.active i { color: var(--text-main); }

/* The standalone Overview entry above the first group stays un-indented —
   it is itself a top-level destination, not a member of any group. */
.nav-menu > .nav-item:first-child { padding-left: 12px; }

/* First-level group headers: brighter, larger and separated by a divider so
   the section structure is obvious at a glance. */
.nav-label {
  color: var(--text-main);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 2px;
  padding: 8px 0 0 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

/* Main Content */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background: var(--bg-app);
}

/* Views */
.view-section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.view-section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.view-header h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.view-subtitle {
  display: block;
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 6px;
}

/* First-run setup */
.setup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 16px;
  margin-bottom: 24px;
}

.setup-summary-card,
.setup-metrics {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
}

.setup-summary-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
}

.setup-summary-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--bg-card-hover);
  color: var(--text-muted);
  flex: 0 0 auto;
}

.setup-summary-icon.ok,
.setup-check-icon.ok,
.setup-metric-value.ok {
  color: var(--status-good);
}

.setup-summary-icon.warn,
.setup-check-icon.warn,
.setup-metric-value.warn {
  color: var(--status-warn);
}

.setup-summary-icon.fail,
.setup-check-icon.fail,
.setup-metric-value.fail {
  color: var(--status-bad);
}

.setup-summary-label,
.setup-metric-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.setup-summary-title {
  font-size: 20px;
  font-weight: 700;
  margin-top: 4px;
}

.setup-summary-meta {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

.setup-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
}

.setup-metric {
  padding: 18px;
  border-right: 1px solid var(--border-color);
}

.setup-metric:last-child {
  border-right: none;
}

.setup-metric-value {
  display: block;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 4px;
}

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

.setup-card.full-width {
  grid-column: 1 / -1;
}

.setup-check-list,
.setup-folder-list,
.setup-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setup-check-item,
.setup-folder-item,
.setup-step {
  background: var(--bg-app);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.setup-check-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
}

.setup-check-icon {
  font-size: 18px;
  line-height: 1;
}

.setup-check-title,
.setup-folder-title {
  font-size: 14px;
  font-weight: 700;
}

.setup-check-detail,
.setup-check-action,
.setup-folder-meta {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 4px;
}

.setup-check-action {
  color: var(--status-warn);
}

.setup-path {
  color: var(--text-main);
  background: #050507;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  margin-top: 8px;
  overflow-wrap: anywhere;
  padding: 6px 8px;
}

.setup-folder-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
}

.setup-folder-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.setup-step {
  align-items: center;
  display: flex;
  gap: 12px;
  padding: 12px;
}

.setup-step-number {
  align-items: center;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  color: var(--text-muted);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.setup-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0;
}

.setup-empty.error {
  color: var(--status-bad);
}

/* Dashboard Grid & Cards */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -28px rgba(0, 0, 0, 0.6);
}

.full-width {
  grid-column: span 12;
}

.stats-cards {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.stat-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
  margin-bottom: 12px;
}

.stat-icon.success {
  color: var(--status-good);
  background: var(--status-good-bg);
}

.stat-icon.error {
  color: var(--status-bad);
  background: var(--status-bad-bg);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.stat-value.success {
  color: var(--status-good);
}

.stat-value.error {
  color: var(--status-bad);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* Tables (Accounts View) */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.data-table td {
  font-size: 14px;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.platform-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.platform-icon {
  font-size: 18px;
}

.proxy-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge.active {
  background: var(--status-good-bg);
  color: var(--status-good);
}

.status-badge.locked {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

.status-badge.error {
  background: var(--status-bad-bg);
  color: var(--status-bad);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text-muted);
}

.control-input {
  width: 100%;
  /* Opaque solid background — using shorthand `background` for `<select>`
     causes Chrome/Firefox to render the option popup with a near-transparent
     fill (text becomes invisible/unclickable). Solid color avoids that. */
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-input);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.control-input:hover {
  border-color: var(--border-strong);
}

.control-input:focus {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
  background-color: #1c1c20;
}

select.control-input option {
  background-color: var(--bg-card);
  color: var(--text-main);
}

textarea.control-input {
  resize: vertical;
}

/* Buttons */
.control-btn {
  padding: 11px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.control-btn.primary {
  background: #ffffff;
  color: #18181b;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.control-btn.primary:hover {
  transform: translateY(-1px);
  background: #fafafa;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.control-btn.large-btn {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.control-btn-small {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.control-btn-small:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.08);
}

.control-btn-small.primary {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #18181b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 3px 10px rgba(0, 0, 0, 0.22);
}
.control-btn-small.primary:hover {
  transform: translateY(-1px);
  background: #fafafa;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 6px 16px rgba(0, 0, 0, 0.3);
}

.control-btn-small.success {
  background: var(--status-good);
  border-color: transparent;
  color: white;
}

.control-btn-small.danger {
  background: var(--status-bad);
  border-color: transparent;
  color: white;
}

/* 幽灵危险按钮：常驻删除/关闭类操作用它——危险操作应该安静，需要时才醒目。
   默认灰描边不抢视觉，hover 才显红。实心 .danger 只留给"正在进行的破坏性
   状态"（如 Stop 运行中的任务）。与相邻主操作至少拉开 8px 额外间距。 */
.control-btn-small.danger-ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
  margin-left: 8px;
}
.control-btn-small.danger-ghost:hover {
  background: var(--status-bad-bg);
  border-color: var(--status-bad);
  color: var(--status-bad);
}

.control-btn-small:disabled,
.control-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-group .control-input {
  flex: 1;
}

.mono {
  font-family: var(--font-mono);
}

/* Status Indicator (Sidebar) */
.connection-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--status-good);
  box-shadow: 0 0 8px var(--status-good);
}

/* Queue List Items */
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.queue-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.queue-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 8px;
}

/* Logs */
.logs-container {
  height: 200px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  background: #000;
  padding: 12px;
  border-radius: 8px;
}

.log-entry {
  margin-bottom: 4px;
  display: flex;
  gap: 8px;
}

.log-time {
  color: #555;
  min-width: 120px;
}

.log-msg {
  color: #aaa;
}

.log-error {
  color: var(--status-bad);
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  transition: all 0.3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.3s;
}

.toggle-switch input:checked+.toggle-slider {
  background: #f4f4f5;
  border-color: rgba(255, 255, 255, 0.4);
}
.toggle-switch input:checked+.toggle-slider::before {
  transform: translateX(20px);
  background: #18181b;
}

/* Responsive
   旧方案把侧栏压成顶部横条：nav 按钮被挤到 <1em 宽导致中文逐字竖排、
   且与右上角用户胸卡重叠（见 docs/design-review/audit-mobile-studio.png）。
   现改为标准抽屉：侧栏 fixed 左滑入 + 半透明遮罩，汉堡按钮由 extras.js
   注入（#mobileNavBtn）。 */
.nav-item { white-space: nowrap; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 98;
}
#mobileNavBtn { display: none; }

@media (max-width: 900px) {
  .app-container {
    overflow: auto;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100dvh;
    width: min(300px, 84vw);
    z-index: 99;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar.open + .sidebar-backdrop,
  .sidebar-backdrop.show { display: block; }

  #mobileNavBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 97;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: rgba(22, 22, 24, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
  }

  .main-content {
    padding: 20px 16px;
  }

  /* 窄屏下所有内联多列 grid 一律退化为单列（新建项目弹窗、设置卡、
     参数区等大量 inline style 无法逐个加类，此规则兜底）。 */
  [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }

  /* 项目行按钮换行不挤压标题 */
  .studio-project-row { flex-wrap: wrap; }
  .view-header { flex-wrap: wrap; gap: 10px; }

  .setup-layout,
  .setup-grid,
  .setup-folder-item {
    grid-template-columns: 1fr;
  }

  .setup-metrics {
    grid-template-columns: 1fr;
  }

  .setup-metric {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .setup-metric:last-child {
    border-bottom: none;
  }
}

/* Form Group */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Remote (noVNC) viewer */
.remote-vnc-frame {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 480px;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
}

.remote-vnc-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.remote-vnc-frame:fullscreen {
  border-radius: 0;
  border: 0;
  height: 100vh;
}

/* ------------- PandaSocial Studio modal ------------- */
.studio-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.studio-modal.hidden { display: none; }
.studio-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.studio-modal-dialog {
  position: relative;
  background: rgba(22, 22, 24, 0.92);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  color: var(--text-main, #f5f5f5);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.12));
  border-radius: 18px;
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 60px);
  overflow: auto;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 30px 80px rgba(0, 0, 0, 0.6);
}
/* New-AI-video-project modal is form-dense (4-column selects) — give it more
   room than the generic 680px dialog. */
#studioNewModal .studio-modal-dialog {
  width: min(920px, calc(100vw - 32px));
}
.studio-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.studio-modal-close {
  background: transparent;
  border: 0;
  color: var(--text-muted, #999);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.studio-modal-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-color, #fff);
}
.studio-modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.studio-modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color, rgba(255,255,255,0.08));
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Storyboard table polish */
.studio-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-muted, #888);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
}
.studio-table td { vertical-align: top; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.studio-busy i { animation: spin 1s linear infinite; }

/* ------------- PandaSocial Style preset card strip ------------- */
/* Wraps onto multiple rows instead of scrolling horizontally, so every
   preset (incl. the user's own at the end) is visible at a glance. */
.style-card-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 2px;
}
.style-card {
  flex: 0 0 auto;
  width: 138px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  text-align: left;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  font: inherit;
  color: inherit;
}
.style-card:hover { transform: translateY(-2px); background: rgba(255,255,255,0.06); }
.style-card {
  border-radius: 14px;
}
.style-card.selected {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.style-card .thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background-color: #1a1d24;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}
.style-card .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 28px;
}
.style-card .label {
  display: block;
  padding: 6px 8px 7px 8px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Per-user preset cards expose a small × in the top-right corner so the
   owner can drop a preset without leaving the workspace. On the user's OWN
   cards (data-mine="1") both buttons stay visible (dimmed) so the maintain /
   delete affordance is discoverable without hovering; global cards never
   show them. */
.style-card { position: relative; }
.style-card-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
}
.style-card:hover .style-card-del { display: inline-flex; }
.style-card[data-mine="1"] .style-card-del { display: inline-flex; opacity: 0.65; }
.style-card[data-mine="1"]:hover .style-card-del { opacity: 1; }
.style-card-del:hover { background: rgba(220, 38, 38, 0.9); opacity: 1; }
/* Matching ✎ button (top-left) opens the custom-style modal in edit mode. */
.style-card-edit {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  padding: 0;
  display: none;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  z-index: 2;
}
.style-card:hover .style-card-edit { display: inline-flex; }
.style-card[data-mine="1"] .style-card-edit { display: inline-flex; opacity: 0.65; }
.style-card[data-mine="1"]:hover .style-card-edit { opacity: 1; }
.style-card-edit:hover { background: rgba(59, 130, 246, 0.9); opacity: 1; }
/* "自定义" pill on user-owned cards, bottom-left corner of the thumbnail
   (just above the label row) so custom styles are tellable at a glance. */
.style-card-badge {
  position: absolute;
  left: 4px;
  bottom: 30px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #7dd3fc;
  font-size: 10px;
  line-height: 16px;
  pointer-events: none;
  z-index: 2;
}

/* Settings page tabs (参数设置 / 系统检查) */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.settings-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: -1px;
}
.settings-tab:hover { color: var(--text-main); }
.settings-tab.active {
  color: var(--text-main);
  border-bottom-color: var(--primary);
}

/* Admin "风格预设管理" cards: a uniform 2×2 grid of action buttons so visual
   weight is the same regardless of label length / locale. */
.style-admin-card {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.style-admin-thumb {
  aspect-ratio: 1 / 1;
  /* Quarter-size preview (half width → 1/4 area) — full-width squares made
     the admin grid overwhelmingly image-heavy. */
  width: 50%;
  max-width: 130px;
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 缩略图在左、操作按钮纵向排在右 —— 卡片整体更矮更省面积。 */
.style-admin-body {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.style-admin-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.style-admin-actions .control-btn-small {
  width: 100%;
  justify-content: flex-start;
  white-space: nowrap;
}
.style-admin-label:hover {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

/* ---- 视频创作「主题与分镜」两行布局 ---- */
/* 主题输入是全产品最重要的输入：独占整行、更高更大。 */
.studio-topic-input {
  width: 100%;
  font-size: 15px;
  padding: 12px 14px;
}
.studio-params-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  align-items: end;
  margin-top: 4px;
}
@media (max-width: 1100px) {
  .studio-params-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .studio-params-grid { grid-template-columns: 1fr; }
}

/* ---- 图文创作参考图片条 + 参考内容 @引用下拉 ---- */
.it-ref-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}
.it-ref-item { position: relative; width: 72px; }
.it-ref-item img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: block;
  cursor: zoom-in;
}
.it-ref-name {
  font-size: 10px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.it-ref-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.it-ref-del:hover { color: #ef4444; border-color: #ef4444; }
.it-ref-add {
  width: 72px;
  height: 72px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
  font-size: 20px;
}
.it-ref-add:hover { border-color: var(--border-strong); color: var(--text-main); }
/* @-mention 下拉：贴在 textarea 上缘向上展开（modal 底部不被 overflow 裁剪，
   参见 ShopBot MentionTextarea 的同款坑）。 */
.mention-menu {
  position: absolute;
  z-index: 90;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  max-height: 190px;
  overflow: auto;
  min-width: 220px;
  padding: 4px;
}
.mention-menu button {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 5px 8px;
  gap: 8px;
  background: none;
  border: none;
  border-radius: 6px;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  align-items: center;
  font-family: inherit;
}
.mention-menu button.sel,
.mention-menu button:hover { background: rgba(255, 255, 255, 0.08); }
.mention-menu img {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

/* ---- 生产管线导轨（视频创作 / 图文创作）：状态即结构。
   已完成 = 打勾亮字；当前 = 高亮胶囊；未到 = 编号灰字。
   外层 .pipeline-sticky 粘在 .main-content 滚动容器顶部，滚动时导轨
   始终可见；scroll-margin 让锚点定位不被它遮住。 ---- */
.pipeline-sticky {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-app);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
  margin: -16px 0 16px;
}
#view-studio .card,
#studioTopic,
#itTopic,
#itSectionsTable,
#view-imagetext .card-title,
#pptTitle,
#pptSlidesTable,
#view-ppt .card-title {
  scroll-margin-top: 64px;
}
.pipeline-rail {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.pipe-step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.pipe-step:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.05); }
.pipe-step.done { color: var(--status-good); }
.pipe-step.current {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-strong);
  font-weight: 600;
}
.pipe-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-size: 10px;
}
.pipe-sep { color: var(--text-muted); opacity: 0.5; font-size: 11px; }

/* ------------- PandaSocial Lightbox ------------- */
.studio-lightbox {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
}
.studio-lightbox.hidden { display: none; }
.studio-lightbox-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.86);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}
.studio-lightbox img {
  position: relative;
  max-width: calc(100vw - 60px);
  max-height: calc(100vh - 60px);
  border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  background: #000;
  user-select: none;
}
.studio-lightbox-close {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px; border-radius: 22px;
  background: rgba(255,255,255,0.08);
  color: #fff; border: 0; cursor: pointer;
  font-size: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  z-index: 1;
}
.studio-lightbox-close:hover { background: rgba(255,255,255,0.18); }

/* Make storyboard thumbnails feel clickable */
#studioShotsBody img { cursor: zoom-in; }

/* ------------- PandaSocial Studio: export dropdown ------------- */
.studio-export-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--surface-color, #1a1d24);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
  min-width: 200px;
  padding: 4px;
  z-index: 50;
}
.studio-export-dropdown.hidden { display: none; }
.studio-export-dropdown button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.studio-export-dropdown button:hover { background: rgba(255,255,255,0.06); }

/* ------------- PandaSocial: User pill + recharge ------------- */
.user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  margin-bottom: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.user-pill.hidden { display: none; }
.user-pill img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  background: #333;
}
.user-pill-meta { flex: 1; min-width: 0; }
.user-pill-name {
  font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-pill-credits {
  font-size: 12px; color: var(--text-muted, #a1a1aa);
  display: flex; align-items: center; gap: 4px;
  margin-top: 2px;
}
.user-pill-credits i { color: var(--text-muted); }
.user-pill-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.user-pill-actions button { width: 32px; height: 32px; padding: 0; }

.recharge-pkg {
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--border-color);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s;
  color: inherit;
  font: inherit;
}
.recharge-pkg:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 14px 32px -16px rgba(0, 0, 0, 0.5);
}
.recharge-pkg .pkg-price {
  font-size: 22px; font-weight: 700; color: var(--text-main); margin-bottom: 2px;
}
.recharge-pkg .pkg-credits { font-size: 14px; font-weight: 600; }
.recharge-pkg .pkg-bonus {
  font-size: 12px; color: var(--text-muted, #a1a1aa);
  margin-top: 4px;
}

/* ------------- PandaSocial: Top-right account widget ------------- */
.top-account {
  position: fixed;
  top: 18px;
  right: 28px;
  z-index: 90;
  display: flex;
  align-items: center;
}
.top-account.hidden { display: none; }
/* Logged-out CTA: single pill button */
.top-account-signin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #fff;
  color: #1f2937;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.top-account-signin:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(0,0,0,0.32); }
.top-account-signin i { font-size: 16px; }
/* Logged-in pill: credits / avatar / name / logout */
.top-account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 12px;
  background: rgba(22, 22, 24, 0.7);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  font-size: 13px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.35);
}
.top-account-credits {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.top-account-credits:hover { background: rgba(255, 255, 255, 0.14); }
.top-account-credits i { font-size: 14px; }
.top-account-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
}
.top-account-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #333;
}
.top-account-name {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--text-main, #f4f4f5);
}
.top-account-logout {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted, #a1a1aa);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 15px;
  transition: background 0.15s, color 0.15s;
}
.top-account-logout:hover { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* Give main-content top padding so the widget never overlaps view headers */
.main-content { padding-top: 72px !important; }

@media (max-width: 640px) {
  .top-account { top: 12px; right: 14px; }
  .top-account-name { display: none; }
}

/* ------------- PandaSocial: Auth modal ------------- */
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.auth-tab {
  flex: 1;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted, #a1a1aa);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.auth-tab {
  border-radius: 999px;
}
.auth-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.auth-form .form-group { margin-bottom: 12px; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 11px;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.auth-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  background: #fff;
  color: #1f2937;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.auth-google-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(255,255,255,0.08); }
.auth-error {
  margin-top: 12px;
  padding: 8px 10px;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-radius: 8px;
  font-size: 12px;
}

/* Thin scrollbar utility — apply to every scrollable container. */
.scrollbar-thin { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 999px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.3); }

/* ---------------------------------------------------------------------------
   双栏渠道编辑规范 (channel editor spec)
   小红书图文 / 公众号文章等所有并排编辑卡统一使用：等高卡片、统一 14px 内边距、
   底部操作区贴底对齐（.channel-editor-foot 用 margin-top:auto 吸底），
   后续新增同类双栏编辑模块必须复用这组类，禁止再写内联样式。
--------------------------------------------------------------------------- */
.channel-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch; /* equal-height cards, no visual stagger */
}
@media (max-width: 900px) {
  .channel-editor-grid { grid-template-columns: 1fr; }
}
.channel-editor-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px;
  min-height: 100%;
  box-sizing: border-box;
}
.channel-editor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 10px;
}
.channel-editor-2col {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 10px;
}
.channel-editor-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
/* The flexible middle section absorbs height differences between cards. */
.channel-editor-grow { flex: 1 1 auto; display: flex; flex-direction: column; }
.channel-editor-grow textarea { flex: 1 1 auto; min-height: 120px; resize: vertical; }
.channel-editor-foot { margin-top: auto; padding-top: 10px; }
.channel-editor-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}
