.ad-page {
  container-type: inline-size;

}
.ad-toolbar, .ad-tools, .ad-views, .ad-search,
.ad-identity, .ad-device-stack, .ad-scenes-link {
  display: flex;
  align-items: center;
}
.ad-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 19px;
}
.ad-tools { gap: 8px; }
.ad-search { position: relative; }
.ad-search svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  pointer-events: none;
}

.ad-search input[type=search] { width: 222px; padding-left: 36px; }
.ad-tools select { width: auto; padding-inline: 10px; }
.ad-views { flex-wrap: wrap; gap: 4px; }
.ad-views label { position: relative; white-space: nowrap; cursor: pointer; }
.ad-views input {
  position: absolute;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.ad-views label > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: var(--type-ui);
  font-weight: 600;
}
.ad-views label:hover > span { background: #eef0f6; }
.ad-views input:checked + span { background: var(--blue-strong); color: white; }
.ad-views b {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: var(--radius-panel);
  background: #e2e6ee;
  color: #566377;
  text-align: center;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.ad-views input:checked + span b { background: #ffffff30; color: white; }
.ad-views input:focus-visible + span, .ad-page a:focus-visible {
  outline: 2px solid var(--blue-strong);
  outline-offset: 3px;
}
.ad-directory, .ad-empty {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--panel-shadow);
}
.ad-directory table { min-width: 0; }
.ad-directory thead th {
  background: #f8f9fc;
  padding: 12px 16px;
  color: #58677c;
  font-size: var(--type-caption);
  font-weight: 620;
}
.ad-directory thead th:first-child, .ad-directory tbody th { padding-left: 23px; }
.ad-directory thead th:last-child, .ad-row-actions { text-align: right; }
.ad-directory thead th:last-child, .ad-directory .ad-row-actions { padding-right: 23px; }
.ad-directory tbody th, .ad-directory tbody td {
  padding-top: 23px;
  padding-bottom: 23px;
  border-top: 1px solid #e9edf3;
  background: transparent;
}
.ad-directory tbody tr:hover { background: #fafaff; }
.ad-identity { gap: 13px; width: fit-content; text-align: left; }
.ad-identity > span:last-child { min-width: 0; }
.ad-identity strong {
  display: block;
  color: var(--ink);
  font-size: var(--type-subheading);
  font-weight: 650;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ad-row-actions a:hover { color: var(--blue-strong); text-decoration: underline; }
.ad-identity small { display: block; margin-top: 3px; color: var(--muted); font-size: var(--type-caption); font-weight: 500; }
.ad-page .badge { border-radius: 16px; font-weight: 580; font-size: var(--type-caption); padding: 4px 9px; }
.ad-channels ul { list-style: none; padding: 0; margin: 0; color: #425168; font-size: var(--type-ui); line-height: 1.7; }
.ad-device-stack { display: inline-flex; vertical-align: middle; padding-left: 4px; }
.ad-device-stack span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -4px;
  border: 2px solid white;
  border-radius: 50%;
  color: #4d4887;
  background: #e8e6ff;
  font: 650 12px/1 Inter, system-ui, sans-serif;
}
.ad-device-stack span:nth-child(even) { color: #385c75; background: #d8eaf5; }
.ad-devices small { display: inline-block; vertical-align: middle; margin: 0 0 0 5px; color: var(--muted); white-space: nowrap; }
.ad-row-actions { white-space: nowrap; }
.ad-row-actions a { font-size: var(--type-caption); font-weight: 600; }
.ad-detail-link { color: var(--muted); }
.ad-scenes-link { display: inline-flex; gap: 5px; margin-left: 16px; color: var(--blue-strong); }
.ad-scenes-link svg { width: 14px; height: 14px; }
.ad-mobile-label { display: none; }
.ad-empty { padding: 44px 16px; display: grid; gap: 6px; justify-items: center; text-align: center; }
.ad-empty svg { width: 24px; height: 24px; margin-bottom: 5px; color: var(--muted); }
.ad-empty strong { font-size: var(--type-subheading); color: var(--ink); }
.ad-empty span { font-size: var(--type-ui); color: var(--muted); }

@container (max-width: 760px) {
  .ad-toolbar { gap: 10px; }
  .ad-search input[type=search] { width: 180px; }
  .ad-directory thead th, .ad-directory tbody td { padding-inline: 10px; }
  .ad-directory thead th:first-child, .ad-directory tbody th { padding-left: 15px; }
  .ad-directory thead th:last-child, .ad-directory .ad-row-actions { padding-right: 15px; }
  .ad-scenes-link { margin-left: 8px; }
  .ad-identity .ml-avatar { width: 43px; height: 43px; }
  .ad-identity { gap: 9px; }
}
@container (max-width: 650px) {
  .ad-tools { flex: 1 1 100%; flex-wrap: wrap; }
  .ad-tools .ad-search { flex-basis: 160px; }
  .ad-search { flex: 1; min-width: 0; }
  .ad-search input[type=search] { width: 100%; }
  .ad-directory { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .ad-directory table, .ad-directory tbody { display: block; }
  .ad-directory thead { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
  .ad-directory tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: start;
    gap: 16px 8px;
    margin-bottom: 12px;
    padding: 16px;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
  }
  .ad-directory tbody th, .ad-directory tbody td, .ad-directory .ad-row-actions { padding: 0; border: 0; }
  .ad-directory tbody th { padding-left: 0; }
  .ad-directory .ad-grant { justify-self: end; align-self: center; }
  .ad-page .ad-mobile-label { display: block; margin-bottom: 5px; color: var(--muted); font-size: var(--small-label); }
  .ad-grant .ad-mobile-label { display: none; }
  .ad-directory .ad-row-actions {
    display: flex; justify-content: flex-end; align-items: center;
    gap: 14px; grid-column: 1 / -1; padding-top: 11px; border-top: 1px solid #eef0f6;
  }
  .ad-scenes-link { margin-left: 0; }
  .ad-row-actions a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
}

.ac-channel > header { flex-wrap: wrap; }
.ac-metadata, .ac-channel > header small, .ac-replay { overflow-wrap: anywhere; }
.ac-replay { min-width: 0; }
.ac-access-note, .ac-history-source {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--type-caption);
}
.ac-access-note { padding: 13px 17px; margin: 0; border-top: 1px solid var(--line); }
.ac-history-source { margin: 12px 0 0; }
.ac-access-note svg, .ac-history-source svg { width: 15px; height: 15px; flex-shrink: 0; }
