/* Automated channel settings — portal-wide popup (agent/automation-settings.js). */
.as-overlay { position: fixed; inset: 0; z-index: 100000; display: none; align-items: center; justify-content: center;
  /* No backdrop — just a full-screen hit target so a click outside closes it
     (same as the old Edit popup, .channel-settings-overlay). */
  background: transparent; opacity: 0; transition: opacity .18s ease; font-family: 'Lato', sans-serif; }
.as-overlay.is-open { opacity: 1; }
.as-panel { width: min(480px, calc(100vw - 32px)); max-height: 82vh; display: flex; flex-direction: column;
  /* The old Edit popup's liquid glass: translucent white + backdrop blur. */
  background-color: #ffffffa8; backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px);
  border-radius: 22px; box-shadow: rgba(0, 0, 0, .20) 0 16px 48px 0, rgba(0, 0, 0, .06) 0 0 0 1px;
  transform: translateY(8px) scale(.98); transition: transform .18s ease; overflow: hidden; }
.as-overlay.is-open .as-panel { transform: none; }
.as-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(240, 240, 240, .7); flex-shrink: 0; }
.as-title { font-size: 15px; font-weight: 700; color: #111827; }
.as-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.as-close { width: 32px; height: 32px; flex: none; border-radius: 999px; border: 1px solid #e5e7eb; background: rgba(255,255,255,.7);
  box-shadow: 0 2px 8px rgba(0,0,0,.04); color: rgba(15,23,42,.72); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: transform .15s ease, background .15s ease; }
.as-close:hover { transform: translateY(-1px); background: rgba(255,255,255,.92); }
.as-body { overflow-y: auto; padding: 4px 20px 20px; scrollbar-width: none; }
.as-body::-webkit-scrollbar { display: none; }
.as-section { margin-top: 12px; }
.as-section-title { font-size: 12px; font-weight: 600; color: #9ca3af; margin: 0 4px 8px; }
.as-item { background: rgba(255,255,255,.75); border-radius: 16px; box-shadow: 0 4px 14px rgba(19,19,19,.06); margin-bottom: 8px; }
.as-row { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 12px; }
.as-who { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; border: 0; background: none; padding: 0; text-align: left; font: inherit; color: inherit; }
button.as-who { cursor: pointer; }
button.as-who:hover b { text-decoration: underline; text-underline-offset: 2px; }
.as-who-text { display: flex; flex-direction: column; min-width: 0; }
.as-who-text b { font-size: 13px; font-weight: 700; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.as-who-text span { font-size: 11.5px; color: #7a8390; margin-top: 1px; }
.as-ava { position: relative; width: 34px; height: 34px; flex: none; border-radius: 50%; background: #eef0f3; }
.as-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.as-plat { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; box-sizing: border-box; border-radius: 50%;
  background: #111827; border: 2px solid #fff; display: flex; align-items: center; justify-content: center;  color: #fff; }
.as-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid #eceef1; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.8); color: #374151; font: 400 11.5px 'Lato', sans-serif; flex: none; }
.as-pill:hover { background: #fff; }
.as-pill .as-chev { transition: transform .18s ease; }
.as-pill.is-open .as-chev { transform: rotate(180deg); }
.as-x { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent; color: #9ca3af; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.as-x:hover { background: rgba(220, 38, 38, .08); color: #dc2626; }
.as-x.is-confirm { background: rgba(220, 38, 38, .1); color: #dc2626; }
.as-settings { padding: 4px 12px 14px 12px; border-top: 1px solid #f1f2f4; }
.as-field { margin-top: 10px; }
.as-label { font-size: 11.5px; font-weight: 600; color: #6b7280; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.as-count { font-weight: 400; color: #9ca3af; }
.as-select { position: relative; }
.as-trigger { width: 100%; height: 36px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid #eceef1;
  border-radius: 12px; background: #fff; cursor: pointer; font: 400 12.5px 'Lato', sans-serif; color: #111827; text-align: left; }
.as-trigger-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.as-detail { color: #9ca3af; font-size: 11.5px; font-weight: 400; white-space: nowrap; }
.as-spacer { flex: 1; }
.as-model-ava { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: none; }
.as-menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5; background: #fff; border-radius: 14px; padding: 4px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .18); display: none; }
.as-select.is-open .as-menu { display: block; }
.as-opt { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-radius: 10px; background: none;
  cursor: pointer; font: 400 12.5px 'Lato', sans-serif; color: #111827; text-align: left; }
.as-opt:hover { background: #f3f4f6; }
.as-opt.is-sel { background: #f5f6f8; }
.as-opt.is-disabled { opacity: .5; cursor: default; }
/* Training lessons — same box as the project viewer's Auto Clipping card. */
.as-lessons { display: flex; flex-direction: column; gap: 8px; }
.as-lessons.is-scrollable { overflow-y: auto; padding-right: 2px; scrollbar-width: none; }
.as-lessons.is-scrollable::-webkit-scrollbar { width: 0; height: 0; }
.as-lesson { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px; border-radius: 27px; background: #fff;
  border: 1px solid rgb(229 231 235 / 58%); box-shadow: 0 14px 32px rgba(0,0,0,0.03); transition: opacity .18s ease; }
.as-lesson.is-off { opacity: .5; }
.as-lesson-name { font-size: 12px; font-weight: 600; color: #111827; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-lesson-text { font-size: 11px; color: #6b7280; font-weight: 500; margin-top: 3px; line-height: 1.45;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; overflow: hidden; }
.as-lesson.is-expanded .as-lesson-text { -webkit-line-clamp: unset; overflow: visible; }
.as-lesson-chip { display: inline-block; font-size: 10px; font-weight: 600; color: #6b7280; background: #f3f4f6; border-radius: 999px;
  padding: 3px 8px; margin-top: 6px; line-height: 1.4; max-width: 100%; }
.as-lesson-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.as-dot { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: none; background: transparent; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center; }
.as-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #07F8C4; box-shadow: 0 0 0 3px rgba(87,243,195,0.22);
  transition: background .18s ease, box-shadow .18s ease; }
.as-dot.is-off::before { background: #d1d5db; box-shadow: 0 0 0 3px rgba(209,213,219,0.25); }
.as-expand { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; border: none; background: transparent; cursor: pointer; padding: 0; color: #9ca3af;
  display: flex; align-items: center; justify-content: center; }
.as-expand:hover { background: #f3f4f6; color: #6b7280; }
.as-expand svg { transition: transform .18s ease; }
.as-lesson.is-expanded .as-expand svg { transform: rotate(180deg); }
.as-lnote { font-size: 11px; color: #9ca3af; font-weight: 500; margin-top: 8px; line-height: 1.45; }
.as-empty, .as-loading { font-size: 12px; color: #9ca3af; padding: 6px 4px; }
.as-note { position: sticky; bottom: 0; margin: 10px 4px 0; padding: 9px 12px; border-radius: 12px; background: #111827; color: #fff; font-size: 12px; }

/* Clipping channel row icons: pencil (→ Settings › Channels) and the dropdown chevron. */
.as-icon { width: 26px; height: 26px; flex: none; border: 0; border-radius: 50%; background: transparent; color: #6b7280; cursor: pointer;
  display: flex; align-items: center; justify-content: center; }
.as-icon:hover { background: rgba(17, 24, 39, .06); color: #111827; }
.as-dd-icon .as-chev { transition: transform .18s ease; }
.as-dd-icon.is-open .as-chev { transform: rotate(180deg); }

/* Loading skeleton — the old Auto Clipping settings shimmer (.ac-skeleton-row). */
.as-skeleton-row { height: 42px; border-radius: 12px; margin: 10px 0 0; position: relative; overflow: hidden;
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%); background-size: 200% 100%; }
/* Shimmer on a transformed ::after (compositor-only) instead of animating
   background-position: 3 tiles of the 200% gradient slid two tiles/cycle. */
.as-skeleton-row::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 600%;
  background: inherit; background-size: 33.3334% 100%; background-position: 0 0; pointer-events: none;
  animation: as-shimmer-slide 2s infinite; }
@keyframes as-shimmer-slide { from { transform: translateX(-66.6667%); } to { transform: translateX(0); } }
@keyframes as-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* "Remove it from the automated channel first" warning (channel delete). */
.as-block-panel { width: min(400px, calc(100vw - 32px)); }
.as-block-body { padding: 14px 20px 18px; }
.as-block-body p { margin: 0; font-size: 13px; line-height: 1.5; color: #374151; }
.as-block-body b { font-weight: 700; color: #111827; }
.as-block-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.as-btn { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid #e5e7eb; background: rgba(255,255,255,.8); color: #111827;
  font: 600 12px 'Lato', sans-serif; cursor: pointer; }
.as-btn:hover { background: #fff; }
.as-btn-primary { background: #111827; border-color: #111827; color: #fff; }
.as-btn-primary:hover { background: #1f2937; }

/* Per-source pause (Sources rows): status in the sub-line + the toggle. */
.as-who-text .as-paused { font-style: normal; font-weight: 700; color: #b45309; }
.as-pause.is-paused { color: #b45309; background: rgba(245, 158, 11, .12); }
.as-pause.is-paused:hover { background: rgba(245, 158, 11, .2); color: #92400e; }
.as-pause:disabled { opacity: .5; cursor: default; }
html[data-theme="dark"] .as-who-text .as-paused, html[data-theme="dark"] .as-pause.is-paused { color: #fbbf24; }
