.channel-header-actions { display: contents; }
@media (min-width: 1024px) {
  body:not(.mobile-layout) .app-shell > .topbar {
    grid-template-columns: minmax(220px, 1fr) auto auto;
    min-height: 64px;
    padding: 6px 22px;
  }
  body:not(.mobile-layout) .topbar > .brand { grid-column: 1; grid-row: 1; }
  body:not(.mobile-layout) .topbar > .topbar-upload { grid-column: 2; grid-row: 1; }
  body:not(.mobile-layout) .topbar > .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
  }
  body:not(.mobile-layout) .topbar-actions > .metrics-button,
  body:not(.mobile-layout) .topbar-actions > .logout-button { flex-shrink: 0; white-space: nowrap; }
  body:not(.mobile-layout) .channel-header-actions {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 32px;
    margin-left: auto;
    padding: 4px 8px;
  }
  body:not(.mobile-layout) .channel-header-actions .channel-view-toggle {
    flex-shrink: 0;
    margin-left: 0;
    white-space: nowrap;
  }
  body:not(.mobile-layout) .channel-header-actions .notebook-date { white-space: nowrap; }
  body:not(.mobile-layout) .channel-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 24px;
  }
  body:not(.mobile-layout) .channel-panel-top { display: contents; }
  body:not(.mobile-layout) .active-channel-copy {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 66px;
    padding: 4px 8px 12px;
  }
  body:not(.mobile-layout) .channel-tabs {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    align-self: center;
    overflow-x: auto;
    overflow-y: hidden;
  }
  body:not(.mobile-layout) .multi-channel-controls {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }
  body:not(.mobile-layout) .channel-header-actions {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    margin-left: 0;
    padding-block: 0;
    padding-right: 16px;
  }
}
@media (min-width: 1024px) and (max-width: 1599px) {
  body:not(.mobile-layout) .topbar > .topbar-upload { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
}
.channel-view-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  min-width: 160px;
  padding: 9px 14px;
  border: 1px solid #547360;
  border-radius: 6px;
  background: #fffcf2;
  color: #295240;
  font: 600 13px/1.3 system-ui, sans-serif;
  cursor: pointer;
}
.channel-view-toggle:focus-visible, .multi-channel-open:focus-visible {
  outline: 3px solid #879f88;
  outline-offset: 3px;
}
.multi-channel-controls {
  display: block;
  height: 40px;
  padding: 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.multi-channel-picker-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.multi-channel-picker { display: flex; flex-wrap: nowrap; gap: 7px; height: 40px; width: max-content; min-width: 100%; }
.multi-channel-choice {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  opacity: .65;
  cursor: pointer;
}
.multi-channel-choice.selected { opacity: 1; color: #302d27; border-color: #bfb49f; border-bottom-color: #fffdf3; box-shadow: inset 0 2px 0 #668066; }
.multi-channel-choice.selected:first-child { background: #fffdf3; }
/* Native checkbox behavior covers each tab, with its state shown by the tab. */
.multi-channel-choice input { position: absolute; inset: 0; z-index: 1; margin: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.multi-channel-choice:has(input:focus-visible) { outline: 3px solid #648269; outline-offset: -3px; }
.multi-channel-choice:has(input:disabled) { opacity: .5; cursor: default; }
.multi-channel-choice input:disabled { cursor: default; }
.multi-channel-view .channel-tabs { display: none; }
.multi-channel-view .transcript-section::before { display: none; }
.messages.multi-channel-grid {
  display: grid;
  grid-template-columns: repeat(var(--multi-channel-columns, 4), minmax(0, 1fr));
  grid-template-rows: repeat(var(--multi-channel-rows, 2), minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  scrollbar-gutter: auto;
  background: #e5dfcd !important;
}
.multi-channel-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #b8b79f;
  border-radius: 7px;
  background: #fffcf2;
  box-shadow: 0 1px 2px #393c2d0d;
}
.multi-channel-panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 6px;
  flex: 0 0 auto;
  padding: 4px 8px;
  border-bottom: 1px solid #c8d1bf;
  background: #edf1e5;
}
.multi-channel-panel-header h2 {
  margin: 0;
  align-self: center;
  overflow-wrap: anywhere;
  color: #295240;
  font: 650 12px/16px system-ui, sans-serif;
}
.multi-channel-message-count { grid-column: 1; color: #6c7364; font: 10px/12px system-ui, sans-serif; }
.multi-channel-open {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border: 1px solid #bfcbb7;
  border-radius: 5px;
  background: #fffcf2;
  color: #295240;
  cursor: pointer;
  font: 15px system-ui, sans-serif;
}
.multi-channel-feed {
  --paper-row-height: 28px;
  --paper-baseline: 22px;
  --multi-channel-margin: 32px;
  min-height: 0;
  min-width: 0;
  flex: 1 1 auto;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  overflow-anchor: none;
  /* One paper grid follows the whole feed. Cards occupy whole paper rows. */
  background:
    linear-gradient(90deg, transparent 0 var(--multi-channel-margin), var(--paper-margin) var(--multi-channel-margin) calc(var(--multi-channel-margin) + 1px), transparent calc(var(--multi-channel-margin) + 1px)),
    repeating-linear-gradient(to bottom, transparent 0 var(--paper-baseline), var(--paper-line) var(--paper-baseline) calc(var(--paper-baseline) + 1px), transparent calc(var(--paper-baseline) + 1px) var(--paper-row-height)),
    #fffcf2;
  background-attachment: local;
  background-origin: border-box;
}
.multi-channel-feed:focus-visible { outline: 2px solid #648269; outline-offset: -2px; }
.multi-channel-grid .message {
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  margin: 0;
  padding: 0 8px 0 40px !important;
  gap: 0;
  border-bottom: 0 !important;
  background: transparent !important;
}
.multi-channel-grid .message:not(:last-child)::after { display: none; }
.multi-channel-grid .message-body { min-height: 0; }
.multi-channel-grid .message-head { min-height: var(--paper-row-height) !important; height: var(--paper-row-height); flex-wrap: nowrap; gap: 6px; }
.multi-channel-grid .message-source { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.multi-channel-grid .message-head strong, .multi-channel-grid .message-head time { line-height: var(--paper-row-height) !important; }
.multi-channel-grid .message-head strong { font-size: 11px; }
.multi-channel-grid .message-head time { flex-shrink: 0; font-size: 10px; margin-left: 0; white-space: nowrap; }
.multi-channel-grid .transcript-line { font-size: 15px !important; line-height: var(--paper-row-height) !important; margin: 0 !important; overflow-wrap: anywhere; }
.multi-channel-grid .message-tools-row,
.multi-channel-grid .message-on-demand-translation { display: none !important; }
.multi-channel-empty { margin: 0; padding: 18px 12px; color: #727362; text-align: center; font: 13px/1.5 system-ui, sans-serif; }
.channel-view-toggle[hidden], .multi-channel-controls[hidden], .multi-channel-empty[hidden] { display: none !important; }
@media (max-width: 1023px) {
  .channel-view-toggle, .multi-channel-controls { display: none !important; }
}
