.admin-page {
  display: grid;
  min-width: 0;
}

.admin-page .admin-sidebar {
  display: flex;
}

.admin-page .admin-toolbar {
  display: flex;
}

.admin-page .workspace-shell__auth {
  min-width: 0;
  max-width: min(42vw, 360px);
}

/* V4 top bar, as in the app: search, Share, the bell and a round account button. The padding matches the app's
   (portal-v4.css), so the search field starts on the page content's left edge; refined.css's own toolbar padding
   is more specific than .admin-page, hence the html prefix. */
html[data-shell="refined"] .admin-page .admin-toolbar {
  min-height: 64px;
  height: 64px;
  gap: 10px;
  padding: 0 48px;
}

/* The phone brand and search button exist only on phones (720 px and below), as in the app. */
.admin-page .admin-toolbar__brand,
.admin-page .admin-toolbar__search-open,
.admin-page .admin-toolbar__search-close {
  display: none;
}

.admin-page .admin-toolbar__context {
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.admin-page .admin-toolbar__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 880px;
}

.admin-page .admin-toolbar__search .rfd-search {
  width: 100%;
}

.admin-page .admin-toolbar :is(.rfd-submit, .rfd-bell) {
  text-decoration: none;
}

.admin-page .admin-toolbar .rfd-userfoot {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
}

.admin-page .admin-toolbar .rfd-avatar-chip {
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 4px;
  justify-content: center;
  border: 0;
  border-radius: 50%;
}

.admin-page .admin-toolbar :is(.rfd-avatar-info, .rfd-account__chevron) {
  display: none;
}

.admin-page .admin-toolbar .rfd-account-menu {
  top: calc(100% + 8px);
  right: 0;
  bottom: auto;
  left: auto;
  width: 300px;
  max-width: calc(100vw - 24px);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgb(33 34 36 / 16%);
}

/* The foot of the menu: About and Send feedback, as in the app (.rfd-sidebar-footer in portal-v4.css). Send feedback
   is a button here, so it drops the button look. */
.admin-page .admin-sidebar-footer__feedback {
  width: 100%;
  color: inherit;
  font-family: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.admin-page .admin-sidebar-footer__feedback[hidden] {
  display: none;
}

html[data-refined-collapsed] .admin-page .admin-sidebar-footer__feedback {
  width: auto;
}

/* The theme sits in the account menu, as Appearance does in the app's Settings; its two items mark the choice. */
.admin-page .rfd-account-menu__item[data-refined-theme][aria-checked="true"] {
  color: var(--link);
  font-weight: 600;
}

/* The phone menu's close button and dimmed page exist only on phones (900 px and below). */
.admin-page .admin-sheet-close,
.admin-page .admin-sidebar-backdrop {
  display: none;
}

/* The page area as in the app (.hub-page.is-active in portal-v4.css): the same padding and width, starting at the
   left edge of the content rather than centred. */
.admin-page #main-content {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 2336px;
  margin-inline: auto;
  padding: 36px 48px 64px !important;
  display: grid;
  /* The page fills the window; a short tab (Operations) must not stretch the header row above the tabs. */
  align-content: start;
  gap: 16px;
}

@media (min-width: 901px) and (max-width: 1099px) {
  .admin-page #main-content { padding: 28px 24px 56px !important; }
}

.admin-page .workspace-shell,
.admin-page .card {
  box-sizing: border-box;
  min-width: 0;
}

.admin-page .workspace-shell__content {
  display: block;
}

/* The title sits where the app's does: the app's page header adds 8px above it (.hub-page__header). */
.admin-page .workspace-shell--admin {
  margin: 0 0 8px;
  padding: 8px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.admin-page .workspace-shell--admin::after {
  display: none;
}

.admin-page .workspace-shell__intro {
  gap: 6px;
}

/* The bulk selection bar uses the app's neutral panel (the search and rail surface), not a blue tint. */
.admin-page .review-bulk-bar {
  border-color: var(--border);
  background: var(--surface2);
}

/* The page title and intro as in the app (.hub-page__title and __subtitle). */
.admin-page .workspace-shell__title {
  font-family: Inter, system-ui, sans-serif;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 48px;
}

.admin-page .workspace-shell__subtitle {
  max-width: 72ch;
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0;
}

.admin-page .workspace-shell__facts {
  gap: 10px;
  margin-top: 8px;
}

.admin-page .workspace-shell__fact {
  min-width: 0;
  padding: 12px 14px;
  border-radius: var(--catalog-card-radius);
  background: var(--bg-card);
  box-shadow: none;
}

.admin-page .review-inbox,
.admin-page .card.review-inbox,
.admin-page .card.empty-state {
  border: 1px solid var(--catalog-card-border);
  border-radius: var(--catalog-card-radius);
  background: var(--bg-card);
  box-shadow: none;
}

.admin-page .review-inbox {
  gap: 16px;
  padding: 20px;
}

.admin-page .inventory-listing {
  margin-block: 1.25rem;
  padding: 1rem;
  border: 1px solid var(--line, #d7dce2);
  border-radius: .75rem;
}
.admin-page .inventory-listing__search { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.admin-page .inventory-listing__search input { flex: 1 1 16rem; min-width: 0; }
.admin-page .inventory-listing__rows { display: grid; gap: .65rem; margin: 1rem 0; padding: 0; list-style: none; }
.admin-page .inventory-listing__row { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem; border: 1px solid var(--line, #d7dce2); border-radius: .5rem; }
.admin-page .inventory-listing__icon { display: grid; flex: 0 0 2.25rem; width: 2.25rem; height: 2.25rem; place-items: center; border-radius: .5rem; background: #eef1f5; color: #445; font-size: 1.35rem; }
.admin-page .inventory-listing__details { display: grid; gap: .2rem; min-width: 0; }
.admin-page .inventory-listing__details code { overflow-wrap: anywhere; }
.admin-page .inventory-listing__evidence { font-size: .9rem; color: var(--muted, #555); }

.admin-page .admin-advanced-tools {
  border: 1px solid var(--catalog-card-border);
  border-radius: var(--catalog-card-radius);
  background: var(--bg-card);
  padding: 16px 20px;
}

.admin-page .admin-advanced-tools__inline {
  border-top: 1px solid var(--catalog-card-border);
  padding-top: 16px;
}

.admin-page .admin-advanced-tools > summary,
.admin-page .admin-advanced-tools__inline > summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-page .admin-advanced-tools__content {
  display: grid;
  gap: 16px;
  padding-top: 16px;
}

.admin-page .admin-advanced-tools__inline .admin-advanced-tools__content {
  gap: 12px;
}

.admin-page .review-inbox__header {
  align-items: flex-start;
  gap: 14px 20px;
}

.admin-page .review-inbox__copy {
  max-width: 72ch;
  gap: 5px;
}

.admin-page .review-inbox__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.admin-page .review-inbox__subtitle {
  font-size: 0.875rem;
  line-height: 1.5;
}

.admin-page .review-list {
  gap: 12px;
}

.admin-page .review-card {
  gap: 14px;
  padding: 18px;
  border-radius: var(--catalog-card-radius);
  box-shadow: none;
}

.admin-page .review-card__meta-grid {
  gap: 10px;
}

.admin-page .review-card__meta-item {
  padding: 12px 14px;
  border-radius: var(--radius-md);
}

/* A submitted link in a review card: the brand green is 4.25:1 on the light card and the shared hover green
   3.1:1 on the dark one, so it uses the link color (refined.css) and underlines on hover. */
.admin-page .review-card__meta-item a,
.admin-page .review-card__meta-item a:hover {
  color: var(--link, var(--brand-text));
}

/* A long link wraps inside the card instead of widening it, and its wrapped lines are one click target. */
.admin-page .review-card__meta-item a {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.admin-page .review-card__meta-item a:hover {
  text-decoration: underline;
}

.admin-page .feedback-review-card__message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-page .feedback-review-card .review-card__meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.admin-page [hidden] {
  display: none !important;
}

.admin-page .admin-v4-workspace {
  min-width: 0;
  --text-muted: var(--text-secondary);
  --text3: var(--text-secondary);
}

/* V4: underlined tabs, the same as the Submissions and Favorites tabs in the app. */
.admin-page .admin-v4-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
}

.admin-page .admin-v4-tab {
  min-height: 44px;
  margin-bottom: -1px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.admin-page .admin-v4-tab[aria-selected="true"] {
  border-bottom-color: var(--link);
  color: var(--text);
  font-weight: 600;
}

/* The menu's active item looks as in the app (portal-v4.css); Admin shows its queue count at the right. */
.admin-page [data-admin-queue-count] {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.admin-page .admin-v4-tab:focus-visible,
.admin-page .admin-v4-review-open:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

.admin-page .admin-v4-panels {
  min-width: 0;
  margin-top: 14px;
}

.admin-page .admin-v4-panel {
  min-width: 0;
}

/* V4: Content shows Submissions, Due for review or Featured, one at a time. */
.admin-page .admin-v4-content-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}
.admin-page .admin-v4-content-filter[hidden] { display: none; }
.admin-page .admin-v4-content-filter__option {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--catalog-card-border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
}
.admin-page .admin-v4-content-filter__option[aria-pressed="true"] {
  border-color: currentColor;
  color: var(--link);
  font-weight: 600;
}
.admin-page .admin-v4-content-filter__option:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}
.admin-page .admin-v4-content-filter__option[hidden] { display: none; }
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="queue"] > [data-review-due],
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="queue"] > [data-featured-picker],
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="due"] > #admin-submissions,
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="due"] > [data-featured-picker],
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="featured"] > #admin-submissions,
.admin-page [data-admin-v4-panel="content"][data-admin-v4-content-view="featured"] > [data-review-due] {
  display: none;
}

/* Featured list editor (Admin → Content → Featured). */
.admin-page .featured-list__list,
.admin-page .featured-list__results { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.admin-page .featured-list__row,
.admin-page .featured-list__result {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  padding: 10px 14px; border: 1px solid var(--catalog-card-border); border-radius: 12px; background: var(--bg-card);
}
.admin-page .featured-list__meta { color: var(--text-secondary); min-width: 5.5em; }
.admin-page .featured-list__title,
.admin-page .featured-list__result > span { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.admin-page .featured-list__actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-page .featured-list__empty { color: var(--text-secondary); }
.admin-page .featured-list__save { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.admin-page .featured-list__find { display: flex; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 12px; }
.admin-page .featured-list__find label { display: grid; gap: 4px; }
.admin-page .featured-list__add h3 { margin: 0 0 10px; font-size: 1rem; }
.admin-page .featured-list__by-id { align-items: end; margin-top: 4px; }
.admin-page .featured-list__by-id input { width: min(28em, 100%); }
.admin-page .featured-list__by-id label { flex: 1 1 16em; }
.admin-page .featured-list__hint { margin: 0; color: var(--text-secondary); font-size: 0.875rem; }
.admin-page .featured-list__find select,
.admin-page .featured-list__find input {
  min-height: 40px; min-width: 12em; padding: 0 12px;
  border: 1px solid var(--catalog-card-border); border-radius: 10px;
  background: var(--bg-card); color: var(--text-primary); font: inherit;
}
.admin-page .featured-list .action-button:disabled { opacity: .45; cursor: not-allowed; }

.admin-page .admin-v4-panel > .review-inbox,
.admin-page .admin-v4-panel > .admin-advanced-tools {
  margin-block: 0 14px;
}

/* The queue list is the container: the sidebar (open or collapsed) and the page padding decide
   how much room the queue really has, not the viewport width. */
.admin-page .admin-v4-panel [data-list] {
  container: admin-review / inline-size;
}

.admin-page .admin-v4-review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
  align-items: start;
  gap: 24px;
}

/* Side by side only while Title keeps at least 160px: 1000 = 26rem detail (416) + 24 gap
   + 400 fixed columns + 160 Title. At 1440 with the menu open the queue has 1038px, so V4's
   queue-left, detail-right layout holds there; below 1000 the detail card moves under the queue. */
@container admin-review (max-width: 1000px) {
  .admin-page .admin-v4-review-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Room for the 560 px detail panel and a queue of at least 560 px: 560 + 24 gap + 560. */
@container admin-review (min-width: 1144px) {
  .admin-page .admin-v4-review-layout {
    grid-template-columns: minmax(0, 1fr) 560px;
  }
}

/* V4 §3.10: the review queue is a table, oldest first. */
.admin-page .admin-v4-review-queue {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--catalog-card-border);
  border-radius: 8px;
  background: var(--bg-card);
}

.admin-page .admin-v4-review-queue__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
}

.admin-page .admin-v4-review-queue__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.admin-page .admin-v4-review-queue__order {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.admin-page .admin-v4-review-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.admin-page .admin-v4-review-table th {
  height: 40px;
  padding: 0 12px;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  background: var(--bg-page, var(--bg));
  border-block: 1px solid var(--catalog-card-border);
}

.admin-page .admin-v4-review-table td {
  height: 60px;
  padding: 0 12px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-bottom: 1px solid var(--catalog-card-border);
}

.admin-page .admin-v4-review-table__select { width: 44px; }
/* Fixed layout: the Title column takes what the other columns leave, so they stay narrow. */
.admin-page .admin-v4-review-table__type { width: 96px; }
.admin-page .admin-v4-review-table__submitter { width: 150px; }
.admin-page .admin-v4-review-table__date { width: 108px; font-variant-numeric: tabular-nums; }

.admin-page .admin-v4-review-row {
  cursor: pointer;
}

.admin-page .admin-v4-review-row:hover td {
  background: var(--bg-page, var(--bg));
}

.admin-page .admin-v4-review-row.is-selected td {
  background: color-mix(in srgb, var(--link) 8%, var(--bg-card));
}

.admin-page td.admin-v4-review-table__select { padding: 0; }

/* The label fills the cell so the whole cell ticks the box. */
.admin-page .admin-v4-review-select {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.admin-page .admin-v4-review-select input {
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.admin-page .admin-v4-review-open {
  display: block;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.admin-page .admin-v4-review-open:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

.admin-page .admin-v4-tab__count {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 0 6px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--bg-page, var(--bg));
  border-radius: 100px;
}

.admin-page .admin-v4-review-detail {
  display: grid;
  min-width: 0;
  gap: 12px;
}

.admin-page .admin-v4-review-guidance,
.admin-page .admin-v4-risk {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid var(--link);
  border-radius: 4px;
  background: var(--bg-page, var(--bg));
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-page .admin-v4-review-detail > .review-card {
  margin: 0;
}

html[data-theme="dark"] .admin-page .admin-v4-workspace .review-card__status {
  color: var(--text);
}

.admin-page .admin-v4-review-detail > .review-card[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .admin-page .admin-v4-review-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Columns give way by the queue's real width (the stacked queue spans the container), so Title
   keeps at least 160px: Submitted by goes at 600px, Type at 420px. */
@container admin-review (max-width: 600px) {
  .admin-page .admin-v4-review-table__submitter {
    display: none;
  }
}

@container admin-review (max-width: 420px) {
  .admin-page .admin-v4-review-table__type {
    display: none;
  }
}

.admin-page .skip-link:focus-visible,
.admin-page .rfd-navlink:focus-visible,
.admin-page .auth-link:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 2px;
}

@media (max-width: 900px) {
  /* The page title as in the app on small screens (.hub-page__title in portal-v4.css). */
  .admin-page .workspace-shell__title {
    font-size: 32px;
    line-height: 40px;
  }
  /* The app's phone layout (refined.css, "Mobile navigation reuses the permission-aware sidebar as its More sheet"):
     a bottom bar with Discover, Agents, Skills and More under the page, and the menu as a full-width sheet above it. */
  html[data-shell="refined"] body.admin-page {
    --rfd-mobile-nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
    --rfd-mobile-shell-h: 100vh;
    position: relative;
    height: 100vh;
    height: var(--rfd-mobile-shell-h);
    min-height: 0;
    grid-template-rows: var(--rfd-toolbar-h) minmax(0, 1fr) var(--rfd-mobile-nav-h);
  }

  html[data-shell="refined"] .admin-page .rfd-mobile-nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-column: 1;
    grid-row: 3;
    z-index: 46;
    min-width: 0;
    background: var(--sidebar);
    border-top: 1px solid var(--border2);
    padding: 4px max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  }

  html[data-shell="refined"] .admin-page .rfd-mobile-nav .rfd-navlink {
    min-width: 0;
    min-height: 52px;
    padding: 4px;
    gap: 3px;
    flex-direction: column;
    justify-content: center;
    font: inherit;
    font-size: .75rem;
    border: 0;
    cursor: pointer;
    color: var(--text);
    background: transparent;
  }

  html[data-shell="refined"] .admin-page .rfd-mobile-nav .is-active {
    color: var(--text-primary);
    background: var(--sidebarItem);
  }

  html[data-shell="refined"] .admin-page .rfd-mobile-nav .rfd-navlink__bar,
  html[data-shell="refined"] .admin-page [data-refined-collapse] {
    display: none;
  }

  html[data-shell="refined"] .admin-page .rfd-mobile-nav .rfd-label,
  html[data-shell="refined"][data-refined-collapsed] .admin-page .admin-sidebar .rfd-label {
    display: inline;
  }

  html[data-shell="refined"] .admin-page .admin-sidebar {
    display: flex !important;
    position: absolute !important;
    top: auto;
    bottom: calc(var(--rfd-mobile-nav-h) + 8px);
    left: 0;
    right: 0;
    z-index: 45;
    width: 100% !important;
    height: auto;
    max-height: calc(var(--rfd-mobile-shell-h, 100vh) - var(--rfd-toolbar-h) - var(--rfd-mobile-nav-h) - 16px);
    padding: 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-radius: 18px 18px 0 0;
    border: 1px solid var(--border2);
    /* Focus must never target an offscreen animation frame and scroll the document. */
    transform: none;
    transition: none;
    visibility: hidden;
  }

  .admin-page .admin-sidebar .rfd-nav {
    flex: none;
    overflow: visible;
  }

  html[data-shell="refined"] .admin-page .admin-sidebar.open {
    visibility: visible;
  }

  /* Only colours ease inside the sheet. With reduced motion every element gets a 0.01 ms transition of all properties
     (prompt-library.css), and an inherited visibility would then still be hidden when More moves focus into the sheet. */
  html[data-shell="refined"] .admin-page .admin-sidebar * {
    transition-property: color, background-color, border-color;
  }

  /* As the app's More sheet (mobile-surfaces.css): above a dimmed page, with Close More at the top, and without
     Discover, Agents and Skills, which are in the bottom bar. */
  html[data-shell="refined"] .admin-page .admin-sidebar {
    z-index: 151;
  }

  .admin-page .admin-sidebar-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(33, 34, 36, .35);
  }

  html[data-shell="refined"] .admin-page .admin-sheet-close {
    display: inline-flex;
    float: right;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    font: inherit;
    cursor: pointer;
  }

  html[data-shell="refined"] .admin-page .admin-sidebar .rfd-nav :is([href="../#/home"], [href="../#/agent-hotel"], [href="../#/skills"]) {
    display: none;
  }

  html[data-shell="refined"][data-refined-collapsed] .admin-page .admin-sidebar .rfd-brand__home {
    display: flex;
  }

  html[data-shell="refined"] .admin-page .admin-sidebar .rfd-navlink {
    min-height: 44px;
    justify-content: flex-start;
  }

  html[data-shell="refined"] .admin-page .admin-sidebar .rfd-brand {
    margin-bottom: 8px;
  }

  html[data-shell="refined"] .admin-page #main-content {
    min-height: 0;
  }

  html[data-shell="refined"] .admin-page .product-feedback-panel {
    bottom: calc(var(--rfd-mobile-nav-h) + 8px);
    max-height: calc(100dvh - var(--rfd-mobile-nav-h) - 24px);
  }

  /* As the app's top bar on phones (refined.css): every icon control is at least 44 x 44 px to tap. */
  html[data-shell="refined"] .admin-page .admin-toolbar :is(.rfd-iconbtn, .rfd-bell) {
    min-width: 44px;
    min-height: 44px;
    flex-shrink: 0;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar {
    gap: 8px;
    padding: 0 12px;
  }

  .admin-page .admin-toolbar .rfd-account-menu {
    position: fixed;
    top: 60px;
    right: 12px;
  }

  /* The page area as the app's on phones and tablets (.hub-page in portal-v4.css): 24px above, 16px at the sides. */
  .admin-page #main-content {
    max-width: none;
    padding: 24px 16px 44px !important;
  }

  /* As the app on phones (mobile-surfaces.css): secondary icon text uses the stronger grey, and Share keeps its
     44px height with the app's compact padding. */
  html[data-shell="refined"] body.admin-page {
    --text3: var(--text2);
  }

  html[data-shell="refined"] .admin-page .admin-toolbar .rfd-submit {
    min-height: 44px;
    padding: 4px 12px;
  }
}

@supports (height: 100svh) {
  @media (max-width: 900px) {
    html[data-shell="refined"] body.admin-page { --rfd-mobile-shell-h: 100svh; }
  }
}

@media (max-width: 720px) {
  /* The search field waits for more room; the bar keeps Share, the bell and the account on one 64px line (the app's
     two-row phone bar is for its search field). The menu is in More, in the bottom bar. */
  .admin-page {
    --rfd-toolbar-h: 64px;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar {
    height: 64px;
    flex-wrap: nowrap;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar :is(.rfd-toolbar__left, .rfd-toolbar__right) {
    flex: 0 0 auto;
    width: auto;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar .rfd-toolbar__right {
    margin-left: auto;
  }

  /* As the app on phones (mobile-surfaces.css): the brand mark on the left and a search button; the search field
     opens over the bar and closes with its close button or Escape (admin-topbar.js). */
  .admin-page .admin-toolbar__search {
    display: none;
  }

  /* The brand on the left and the search button beside Share, as the app lays them out. */
  html[data-shell="refined"] .admin-page .admin-toolbar .rfd-toolbar__left {
    flex: 1 1 auto;
    min-width: 0;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar__brand {
    display: flex;
    align-items: center;
    flex: none;
    margin-right: auto;
    text-decoration: none;
  }

  /* The app's phone control (.mobile-control in mobile-surfaces.css). */
  html[data-shell="refined"] .admin-page :is(.admin-toolbar__search-open, .admin-toolbar__search-close) {
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: var(--surface);
    cursor: pointer;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar__search-open {
    display: inline-flex;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar.is-search-open :is(.admin-toolbar__brand, .admin-toolbar__search-open, .admin-toolbar__actions) {
    display: none;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar.is-search-open .rfd-toolbar__left {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar.is-search-open .admin-toolbar__search {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar.is-search-open .admin-toolbar__search-close {
    display: inline-flex;
    flex: none;
    min-height: 44px;
  }

  html[data-shell="refined"] .admin-page .admin-toolbar.is-search-open .rfd-search kbd {
    display: none;
  }

  .admin-page .rfd-toolbar__right.admin-toolbar__actions {
    gap: 4px;
  }

  .admin-page .workspace-shell__auth .auth-user {
    display: none;
  }

  .admin-page #main-content {
    padding: 24px 16px 36px !important;
  }

  .admin-page .workspace-shell__facts {
    grid-template-columns: 1fr;
  }

  .admin-page .review-inbox {
    padding: 18px;
  }

  .admin-page .review-inbox__controls {
    width: 100%;
  }

  /* Button-only groups (Microsoft 365, AH-060 and the operator sections) wrap and share the row, as before. */
  .admin-page .review-inbox__controls .action-button {
    flex: 1 1 auto;
  }

  /* A status filter and its Refresh share one row, as the app's sort control and buttons: the filter takes the
     room, Refresh keeps its own width. */
  .admin-page .review-inbox__controls:has(.review-inbox__select) {
    flex-wrap: nowrap;
  }

  .admin-page .review-inbox__select {
    flex: 1 1 auto;
    min-width: 0;
  }

  .admin-page .review-inbox__select select {
    width: 100%;
    min-height: 44px;
  }

  .admin-page .review-inbox__controls:has(.review-inbox__select) .action-button {
    flex: none;
    width: auto;
    min-height: 44px;
  }

  /* The tabs stay on one row and scroll sideways instead of wrapping. */
  .admin-page .admin-v4-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .admin-page .admin-v4-tabs::-webkit-scrollbar {
    display: none;
  }

  /* More tabs to the right: the last visible one fades out until the row is scrolled to its end. */
  .admin-page .admin-v4-tabs.has-more-right {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }

  .admin-page .admin-v4-tab {
    flex: none;
    white-space: nowrap;
  }

  .admin-page .review-card__meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 390px) {
  .admin-page .admin-toolbar {
    gap: 8px;
  }

  .admin-page .admin-toolbar__context {
    min-width: 0;
  }


  .admin-page #main-content,
  .admin-page .review-inbox,
  .admin-page .card {
    min-width: 0;
    max-width: 100%;
  }
}

/* Bounded activity for one selected published content item. */
.admin-audit {
  width: min(48rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  box-sizing: border-box;
  overflow: auto;
  padding: 1.5rem;
  border: 1px solid var(--border, #ccd2d8);
  border-radius: 1rem;
  color: var(--text, #17212b);
  background: var(--surface, #fff);
}
.admin-audit::backdrop { background: rgb(0 0 0 / 45%); }
.admin-audit__header, .admin-audit__controls { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.admin-audit__header { justify-content: space-between; }
.admin-audit h2 { margin: 0; }
.admin-audit select, .admin-audit button { min-height: 44px; }
.admin-audit__interval { overflow-wrap: anywhere; font-size: .875rem; }
.admin-audit table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.admin-audit th, .admin-audit td { text-align: left; vertical-align: top; padding: .75rem .5rem; border-bottom: 1px solid #ccd2d8; overflow-wrap: anywhere; }
.admin-audit caption { text-align: left; font-weight: 600; padding: .5rem; }
.admin-audit :focus-visible { outline: 3px solid #1764c0; outline-offset: 3px; }
@media (max-width: 600px) {
  .admin-audit { padding: 1rem; }
  .admin-audit__controls { align-items: stretch; }
  .admin-audit__controls [data-audit-export] { width: 100%; }
}
.admin-audit .action-button, .admin-audit select {
  transition: none;
  color: var(--text, #17212b);
  background: var(--surface2, #f7f8f8);
  border: 1px solid var(--border, #ccd2d8);
}

/* Compact feedback queue and lazily opened protected detail. */
.feedback-review-card { padding: 1rem; gap: .65rem; }
.feedback-review-card .review-card__meta-grid { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.feedback-review-card__message { margin: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.feedback-review-card > .action-button { justify-self: start; }
.feedback-review-card .review-card__actions { margin-top: 0; padding-top: 0; border: 0; }
.feedback-detail { box-sizing: border-box; width: min(56rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow: auto; padding: 1.5rem; border: 1px solid var(--border); border-radius: 1rem; background: var(--surface, #fff); color: var(--text, #212224); }
.feedback-detail::backdrop { background: rgb(0 0 0 / 45%); }
.feedback-detail__header, .feedback-detail__actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.feedback-detail h2 { margin: 0; }
.feedback-detail__message { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.feedback-detail figure { margin: 1rem 0; }
.feedback-detail img { display: block; width: auto; height: auto; max-width: 100%; border: 1px solid var(--border); border-radius: .5rem; }
.feedback-detail figcaption { font-size: .875rem; margin-top: .5rem; }
.feedback-detail details { margin: 1rem 0; }
.feedback-detail summary { cursor: pointer; min-height: 44px; align-content: center; }
.feedback-detail button { min-height: 44px; }
.feedback-detail .action-button { transition: none; background: var(--surface2, #f7f8f8); color: var(--text, #212224); border: 1px solid var(--border, #ccd2d8); }
.feedback-detail :focus-visible { outline: 3px solid #1764c0; outline-offset: 3px; }
@media (max-width: 600px) { .feedback-detail { padding: 1rem; } .feedback-detail .review-card__meta-grid { grid-template-columns: 1fr; } }
.feedback-review-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.feedback-review-card .review-card__header { grid-column: 1 / -1; }
.feedback-review-card__message { grid-column: 1; grid-row: 2; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.feedback-review-card .review-card__meta-grid { grid-column: 1; grid-row: 3; margin: 0; }
.feedback-review-card .review-card__meta-item { padding: 0; border: 0; background: transparent; }
.feedback-review-card .review-card__meta-value { font-size: .8125rem; }
.feedback-review-card > .action-button { grid-column: 2; grid-row: 2; align-self: start; min-height: 44px; }
.feedback-review-card .review-card__actions { grid-column: 2; grid-row: 3; align-self: end; }
@media (max-width: 600px) { .feedback-review-card .review-card__meta-grid { gap: .5rem; } .feedback-review-card .review-card__meta-item:first-child { flex-basis: 100%; } }

.feedback-detail__image-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: .75rem; }
.feedback-detail__copy-fallback { box-sizing: border-box; width: 100%; padding: .75rem; color: var(--text); background: var(--surface2); border: 1px solid var(--border); border-radius: .5rem; }

.discovery-operator form, .discovery-operator [data-discovery-candidates] { display: grid; gap: 12px; margin-block: 16px; }
.discovery-operator label { display: grid; gap: 6px; min-width: 0; }
.discovery-operator input, .discovery-operator select { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px; font: inherit; }
.discovery-operator__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.discovery-operator p { overflow-wrap: anywhere; }

/* Archived content (Owners): one row per item, with the reason when a restore is not possible. */
.archived-content__filter { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.archived-content__list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.archived-content__row { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border-light, #e5e7e8); border-radius: 10px; }
.archived-content__row > .action-button { justify-self: start; }
.archived-content__title { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.archived-content__meta, .archived-content__recovery, .archived-content__reason, .archived-content__notice { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.archived-content__meta, .archived-content__recovery { color: var(--text-secondary, #4d575d); }
.archived-content__notice { color: var(--danger-text, #9b2c2c); }
.archived-content__confirm { width: min(520px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border-light, #c9d0d3); border-radius: 12px; color: var(--text-primary, #172124); background: var(--bg-card, #fff); }
.archived-content__confirm::backdrop { background: rgb(0 0 0 / 55%); }
.archived-content__confirm textarea { display: block; box-sizing: border-box; width: 100%; margin-top: 6px; font: inherit; }
.archived-content__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* Admin notices sit at the top, under the top bar: at the bottom right they covered the review card's actions
   (Approve, Reject, Confirm request changes) at 1366 and 390. Each one can be closed. */
.admin-page .toast-container {
  top: calc(var(--rfd-toolbar-h, 74px) + 12px);
  bottom: auto;
}
.admin-page .toast__dismiss {
  flex-shrink: 0;
  min-width: 32px;
  min-height: 32px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.admin-page .toast__dismiss:hover { background: var(--bg-subtle); }
.admin-page .toast__dismiss:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }


/* Immutable app revision comparison keeps changed destinations visible before decisions. */
.review-revision { border-top: 1px solid var(--border-light); padding-top: 14px; min-width: 0; }
.review-revision h4 { margin: 0 0 8px; font-size: 1rem; }
.review-revision__row { padding: 12px; margin: 10px 0; border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
.review-revision__row h5 { margin: 0 0 10px; font-size: 0.9rem; }
.review-revision__url { border-width: 2px; }
.review-revision__values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.review-revision__value { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin-top: 5px; }
.review-revision__notice { padding: 12px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); }
.review-revision details summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.review-revision details summary:focus-visible, .review-revision a:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 3px; }
@media (max-width: 720px) { .review-revision__values { grid-template-columns: minmax(0, 1fr); } }

/* Agent share review: the fields are a stacked list (label above value) instead of narrow tiles, the unknown ones
   sit behind "Show technical details", and the agent link is the domain with Copy and Open. */
.admin-page .review-card__meta-grid--list {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.admin-page .review-card__meta-grid--list .review-card__meta-item {
  gap: 2px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  background: transparent;
}

.admin-page .review-card__meta-grid--list .review-card__meta-item:last-child {
  border-bottom: 0;
}

.admin-page .review-card__meta-grid--list .review-card__meta-label {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-secondary);
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.admin-page .review-card__meta-grid--list .review-card__meta-value {
  font-weight: 500;
  overflow-wrap: break-word;
}

.admin-page .review-card__technical {
  border-top: 1px solid var(--border-light);
  padding-top: 8px;
}

.admin-page .review-card__technical > summary {
  min-height: 24px;
  cursor: pointer;
  color: var(--link, var(--brand-text));
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-page .review-card__technical > summary:focus-visible,
.admin-page .review-card__agent-link .action-button:focus-visible {
  outline: 2px solid var(--border-focus, currentColor);
  outline-offset: 2px;
}

.admin-page .review-card__agent-link {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.admin-page .review-card__agent-link-text {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875rem;
  overflow-wrap: break-word;
}

.admin-page .review-card__agent-link-actions {
  display: inline-flex;
  gap: 8px;
}

.admin-page .review-card__agent-link .action-button {
  min-height: 32px;
  padding: 4px 12px;
  text-decoration: none;
}

/* Verify, publish, set visibility: three steps in order, the next one marked. */
.admin-page .agent-steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.admin-page .agent-steps__item {
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-left-width: 4px;
  border-radius: var(--radius-md);
  background: var(--bg-page, var(--bg));
}

.admin-page .agent-steps__item--next {
  border-color: var(--border-medium, var(--border-light));
  border-left-color: var(--link, var(--brand-primary));
  background: var(--bg-card, var(--bg-page));
}

.admin-page .agent-steps__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.admin-page .agent-steps__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.75rem;
}

.admin-page .agent-steps__state {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.admin-page .agent-steps__body > p {
  margin: 0 0 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.5;
}

.admin-page .agent-steps__body .review-card__agent-checklist {
  margin: 0 0 8px;
}

.admin-page .review-card__agent-checklist {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.admin-page .review-card__agent-checklist legend {
  padding: 0 4px;
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-page .review-card__agent-checklist label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  font-size: 0.875rem;
}

.admin-page .review-card__meta-item a.action-button,
.admin-page .review-card__meta-item a.action-button:hover {
  color: var(--text-primary);
  text-decoration: none;
}

/* Customer Zero solution review: stacked sections in the normal font, long text keeps its line breaks. */
.admin-page [data-solution-review] > section {
  margin: 0 0 12px;
}

.admin-page [data-solution-review] > section > h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.admin-page .review-card__text {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-page .review-card__text a {
  color: var(--link, var(--brand-text));
}

.admin-page .review-card__text a:hover {
  text-decoration: underline;
}

.admin-page .review-card__meta-grid--list h4.review-card__meta-label {
  margin: 0;
}

.admin-page .review-card__content--text {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
