:root {
  color-scheme: light;
  --bg: #f6f6f2;
  --surface: #ffffff;
  --surface-subtle: #f1f5f4;
  --ink: #171717;
  --muted: #667085;
  --line: #d7d9d2;
  --red: #c9352b;
  --red-dark: #97251f;
  --teal: #0f766e;
  --blue: #1d4ed8;
  --amber: #a16207;
  --shadow: 0 10px 28px rgba(20, 20, 20, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--red);
  color: white;
}

.brand-mark svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 20px;
  line-height: 1.2;
}

.brand p,
.content-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 用户菜单 */
.user-menu {
  position: relative;
}

.user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
}

.user-button:hover {
  background: var(--surface-subtle);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  transition: transform 0.2s;
}

.user-menu.open .user-chevron {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 100;
}

.user-menu.open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.user-dropdown-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-dropdown-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--muted);
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 0 12px;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  transition: background 0.2s;
}

.user-dropdown-item:hover {
  background: var(--surface-subtle);
}

.user-dropdown-item svg {
  stroke: currentColor;
  fill: none;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--red-dark);
  border-color: var(--red-dark);
}

.icon-button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.icon-button.secondary:hover {
  border-color: #bfc4bb;
  background: var(--surface-subtle);
}

.icon-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 20px;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 20px 24px 32px;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 16px;
}

.panel h2,
.content-head h2 {
  font-size: 15px;
  line-height: 1.3;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0 0;
}

.stats div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
}

.stats dt {
  color: var(--muted);
  font-size: 12px;
}

.stats dd {
  margin: 6px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
}

.field input,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  outline: none;
}

.field input:disabled {
  background: #f1f2ee;
  color: var(--muted);
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12);
}

.timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.timeline div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  border-bottom: 1px solid var(--line);
}

.timeline div:last-child {
  border-bottom: 0;
}

.timeline span {
  color: var(--muted);
  font-size: 12px;
}

.timeline strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  white-space: nowrap;
}

.content {
  min-width: 0;
}

.content-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.run-badge,
.status-pill,
.topic {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.run-badge {
  background: #e7f3f1;
  color: var(--teal);
}

.run-badge.busy {
  background: #fff4dc;
  color: var(--amber);
}

.warning-list {
  margin-bottom: 14px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff9eb;
  color: #7a4d05;
  padding: 12px 14px;
  font-size: 13px;
}

.video-list {
  display: grid;
  gap: 14px;
}

.video-card {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.thumb-link {
  position: relative;
  display: block;
  align-self: start;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #dadfdc;
}

.thumb-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.play-chip {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 24px;
  border-radius: 6px;
  background: rgba(10, 10, 10, 0.82);
  color: #fff;
}

.play-chip svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.video-main {
  min-width: 0;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill.summarized {
  background: #e7f3f1;
  color: var(--teal);
}

.status-pill.missing-transcript {
  background: #fff4dc;
  color: var(--amber);
}

.status-pill.missing-content {
  background: #fff4dc;
  color: var(--amber);
}

.status-pill.failed {
  background: #ffe8e6;
  color: var(--red-dark);
}

.status-pill.working,
.status-pill.queued,
.status-pill.summarizing,
.status-pill.fetching-transcript {
  background: #eaf0ff;
  color: var(--blue);
}

.video-title {
  margin-top: 8px;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.28;
}

.video-title a {
  color: inherit;
  text-decoration: none;
}

.video-title a:hover {
  color: var(--red);
}

.headline {
  margin-top: 10px;
  color: #26312f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.summary-list {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  position: relative;
  padding-left: 15px;
  color: #2f3735;
  font-size: 14px;
  line-height: 1.58;
}

.summary-list li::before {
  position: absolute;
  left: 0;
  top: 0.74em;
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--teal);
  content: "";
}

.why {
  margin-top: 11px;
  border-left: 3px solid var(--red);
  padding-left: 10px;
  color: #4a5451;
  font-size: 13px;
  line-height: 1.55;
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.topic {
  background: #eef0ea;
  color: #46524f;
  font-weight: 600;
}

.video-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.video-foot a {
  color: var(--blue);
  text-decoration: none;
}

.video-foot a:hover {
  text-decoration: underline;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 360px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.empty strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 16px;
}

.model-dialog {
  width: min(560px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(20, 20, 20, 0.24);
  padding: 0;
}

.model-dialog.wide-dialog {
  width: min(880px, calc(100vw - 28px));
}

.model-dialog::backdrop {
  background: rgba(20, 20, 20, 0.32);
  backdrop-filter: blur(3px);
}

.model-form {
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dialog-head h2 {
  font-size: 18px;
  line-height: 1.25;
}

.dialog-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.plain-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.plain-icon:hover {
  background: var(--surface-subtle);
}

.plain-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.check-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: #3b4542;
  font-size: 13px;
}

.check-field input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.model-result {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 10px 12px;
  color: #3b4542;
  font-size: 13px;
  line-height: 1.45;
}

.model-result.ok {
  border-color: #a8d7c9;
  background: #eef8f5;
  color: var(--teal);
}

.model-result.error {
  border-color: #efbbb7;
  background: #fff0ee;
  color: var(--red-dark);
}

.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.channel-editor {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.date-range-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-subtle);
  padding: 12px;
}

.date-range-grid .field {
  margin-top: 0;
}

.dialog-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* 帮助弹窗样式 */
.help-dialog {
  max-width: 600px;
  width: 90vw;
  max-height: 80vh;
}

.help-dialog .dialog-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.help-dialog .dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.help-dialog .dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.help-content {
  overflow-y: auto;
  flex: 1;
  padding-right: 8px;
}

.help-section {
  margin-bottom: 20px;
}

.help-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
  color: var(--accent);
}

.help-section ol,
.help-section ul {
  margin: 0;
  padding-left: 20px;
}

.help-section li {
  margin-bottom: 6px;
  line-height: 1.5;
  font-size: 13px;
}

.help-section code {
  background: var(--surface-subtle);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12px;
  color: var(--accent);
}

.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 8px 0;
}

.help-table th,
.help-table td {
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.help-table th {
  background: var(--surface-subtle);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.help-table td:first-child {
  text-align: center;
  font-weight: 600;
  color: var(--accent);
}

.help-table a {
  color: var(--accent);
  text-decoration: none;
}

.help-table a:hover {
  text-decoration: underline;
}

.help-note {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 200, 0, 0.1);
  border-left: 3px solid #ffc800;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
}

.help-section dl {
  margin: 0;
}

.help-section dt {
  font-weight: 600;
  font-size: 13px;
  margin-top: 8px;
  color: var(--text);
}

.help-section dd {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* 自定义滚动条 */
.help-content::-webkit-scrollbar {
  width: 6px;
}

.help-content::-webkit-scrollbar-track {
  background: transparent;
}

.help-content::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 3px;
}

.help-content::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.channel-row {
  padding: 12px;
  background: var(--surface-subtle);
  border-radius: 8px;
  position: relative;
}

.channel-row-header {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 8px;
  align-items: end;
}

.channel-videos-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.channel-videos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.select-all-videos {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.channel-videos-items {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.channel-video-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.channel-video-item:hover {
  background: var(--surface);
}

.channel-video-item input[type="checkbox"] {
  flex-shrink: 0;
}

.video-title-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  position: relative;
}

.video-title-text:hover {
  color: var(--teal);
}

/* 自定义 tooltip */
.video-title-text::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  max-width: 400px;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  z-index: 100;
  pointer-events: none;
}

.video-title-text:hover::after {
  opacity: 1;
  visibility: visible;
}

.video-date {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--muted);
}

/* 更多按钮下拉菜单 */
.more-dropdown {
  position: relative;
  display: inline-block;
}

.more-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.more-dropdown-btn svg {
  width: 16px;
  height: 16px;
}

.more-dropdown-menu {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  min-width: 160px;
  z-index: 50;
  display: none;
  overflow: hidden;
}

.more-dropdown-menu.show {
  display: block;
}

.more-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s;
}

.more-dropdown-item:hover {
  background: var(--surface-subtle);
}

.more-dropdown-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.channel-row .field {
  margin-top: 0;
}

.channel-row .field input {
  background: #fff;
}

.channel-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 6px;
  color: #3b4542;
  font-size: 13px;
  white-space: nowrap;
}

.channel-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--red);
}

.channel-status {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  grid-column: 1 / -1;
  line-height: 1.4;
}

.channel-status.ok {
  color: var(--teal);
}

.channel-status.error {
  color: var(--red-dark);
}

.channel-editor-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
}

.ghost-button:hover {
  background: var(--surface-subtle);
}

.ghost-button:disabled,
.plain-icon:disabled {
  cursor: wait;
  opacity: 0.65;
}

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

  .sidebar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .top-actions {
    width: 100%;
  }

  .top-actions .icon-button {
    flex: 1 1 0;
  }

  .layout {
    padding: 16px;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .video-card {
    grid-template-columns: 1fr;
  }

  .dialog-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .dialog-actions > button {
    width: 100%;
  }

  .channel-row-header {
    grid-template-columns: 1fr;
  }

  .date-range-grid {
    grid-template-columns: 1fr;
  }

  .channel-toggle {
    justify-content: flex-start;
  }
}

/* Transcript detail dialog */
.transcript-dialog {
  width: min(95vw, 900px);
  max-height: 85vh;
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  background: var(--card-bg, #1a1a2e);
  color: var(--text, #e0e0e0);
  padding: 0;
  overflow: hidden;
}
.transcript-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.transcript-dialog .dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #333);
  background: var(--header-bg, #16213e);
}
.transcript-dialog .dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
}
.transcript-dialog .close-btn {
  background: none;
  border: none;
  color: var(--text, #e0e0e0);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.transcript-summary-section,
.transcript-detail-section {
  padding: 16px 20px;
  max-height: 35vh;
  overflow-y: auto;
}
.transcript-summary-section h3,
.transcript-detail-section h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  color: var(--accent, #4fc3f7);
}
.transcript-detail-section {
  border-top: 1px solid var(--border, #333);
}
.transcript-detail-section .transcript-line {
  padding: 3px 0;
  font-size: 0.88rem;
  line-height: 1.55;
}
.transcript-detail-section .transcript-line .ts {
  color: var(--accent, #4fc3f7);
  font-weight: 600;
  margin-right: 8px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  user-select: none;
}
.transcript-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--muted, #888);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--muted, #555);
  border-top-color: var(--accent, #4fc3f7);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.transcript-error {
  color: #ef4444;
  padding: 10px 0;
}

.slack-status { font-size: 0.85rem; color: var(--muted, #888); margin: 6px 0; }
.slack-history-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border, #333);
  cursor: pointer; transition: background 0.15s;
}
.slack-history-item:hover { background: var(--hover, #222); }
.slack-history-item .sh-time { font-size: 0.8rem; color: var(--muted, #888); }
.slack-history-item .sh-channel { color: var(--accent, #4fc3f7); margin-left: 8px; }
.slack-history-item .sh-count { float: right; font-size: 0.85rem; }
.slack-detail-block { margin-bottom: 16px; }
.slack-detail-block .sd-meta { font-size: 0.8rem; color: var(--muted, #888); margin-bottom: 8px; }
.slack-detail-block pre { white-space: pre-wrap; font-size: 0.85rem; background: var(--card-bg, #1a1a2e); padding: 12px; border-radius: 8px; overflow-x: auto; }

.transcript-collapse { margin-top: 8px; border: 1px solid var(--border,#333); border-radius: 6px; padding: 0; }
.transcript-collapse summary { padding: 6px 10px; cursor: pointer; font-size: 0.85rem; color: var(--accent,#4fc3f7); user-select: none; }
.transcript-collapse summary:hover { background: var(--hover,#1a1a2e); }
.transcript-collapse-content { padding: 8px 12px; font-size: 0.82rem; line-height: 1.5; max-height: 300px; overflow-y: auto; white-space: pre-wrap; color: var(--muted,#aaa); }

.ai-connect-body { padding: 16px; max-height: 70vh; overflow-y: auto; }
.ai-connect-body h3 { margin: 16px 0 8px; font-size: 0.95rem; color: var(--accent,#4fc3f7); }
.ai-connect-body { padding: 16px; max-height: 70vh; overflow-y: auto; }
.ai-connect-body h3 { margin: 16px 0 8px; font-size: 0.95rem; color: var(--accent,#4fc3f7); }
.api-docs { background: #1e293b; padding: 14px 18px; border-radius: 8px; font-size: 0.82rem; line-height: 1.7; overflow-x: auto; color: #cbd5e1; border: 1px solid #334155; }
.api-docs strong { color: #e2e8f0; }
.api-docs code { background: #0f172a; padding: 1px 6px; border-radius: 3px; font-size: 0.78rem; color: #7dd3fc; }
.api-docs hr { border-color: #334155; margin: 12px 0; } padding: 12px; border-radius: 6px; font-size: 0.82rem; line-height: 1.6; overflow-x: auto; }
.ai-keys-list { }
.ai-key-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border,#333); }
.ai-key-item .key-val { font-family: monospace; font-size: 0.85rem; color: var(--accent,#4fc3f7); }
.ai-key-item .key-meta { font-size: 0.75rem; color: var(--muted,#888); }
.ai-key-item button { font-size: 0.8rem; padding: 2px 8px; }
.transcript-collapse-content p { text-indent: 2em; margin: 0 0 6px 0; }
