/*
 * MyIntelisys Assistant: admin page. Loaded after app.css (tokens, header, base). The admin palette uses a slightly
 * darker line and header in the light theme; the dark overrides in app.css are more specific, so they still apply.
 * Every colour comes from an app.css token, so the console follows the light and dark themes the way the chat does.
 * Components follow Material Design 3 (see app.css): filled, outlined and text buttons on the full radius, outlined
 * text fields, a navigation list with a 3 px indicator, segmented buttons, 12 px cards.
 */
:root {
  --line: #d6d3c9;
  --hdr: var(--dark-node);
  --th: var(--graphite);
}

body.admin {
  font-size: 14px;
  line-height: 1.5;
  background: var(--canvas);
}

.admin .brand {
  font-size: 18px;
}

.admin .wrap {
  max-width: 1720px;
  margin: 0 auto;
  padding: 20px 24px 32px;
}

.ts {
  color: #bbbbbb;
  font-size: 12px;
}

.ts:empty {
  display: none;
}

/* M3 filled button on the Dark Node bar. */
.refresh {
  background: var(--primary);
  color: var(--on-primary);
  border: 0;
  border-radius: var(--r-full);
  padding: 6px 16px;
  font-family: var(--font-head);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.refresh:hover:not(:disabled) {
  background: var(--primary-hover);
}

.refresh:disabled {
  opacity: 0.38;
  cursor: default;
}

.admin h2 {
  font-family: var(--font-head);
  font-size: 16px;
  margin: 22px 0 8px;
  color: var(--text);
  padding-bottom: 4px;
  border-bottom: 2px solid var(--line);
}

.denied h2 {
  color: var(--ink);
  border-bottom: 0;
}

.notice {
  font-size: 13px;
  background: var(--pale);
  border-left: 3px solid var(--ink);
  padding: 8px 10px;
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  margin: 0 0 12px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: var(--r-xs);
  padding: 10px 12px;
}

.kpi .v {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.1;
}

.kpi .l {
  font-size: 10.5px;
  color: var(--grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.kpi.bad {
  border-top-color: var(--red);
}

.kpi.good {
  border-top-color: var(--positive);
}

.admin .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

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

.admin .card {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  margin: 0;
  min-width: 0;
  overflow-x: auto;
}

.admin .card h3 {
  font-family: var(--font-head);
  font-size: 13.5px;
  margin: 0 0 8px;
}

.admin table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.admin th {
  text-align: left;
  background: var(--th);
  color: #ffffff;
  font-family: var(--font-head);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 6px 8px;
}

.admin td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.admin tr:nth-child(even) td {
  background: rgba(127, 127, 127, 0.06);
}

.bar {
  display: grid;
  grid-template-columns: 150px 1fr 44px;
  gap: 8px;
  align-items: center;
  font-size: 12.5px;
  margin: 4px 0;
}

.bar .bl {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar i {
  display: block;
  height: 14px;
  width: 0;
  background: var(--primary);
  border-radius: 3px;
}

.bar .t {
  background: var(--line);
  border-radius: 3px;
  height: 14px;
}

.bar b {
  text-align: right;
  color: var(--grey);
  font-weight: 600;
}

.pill {
  display: inline-block;
  font-size: 10.5px;
  padding: 1px 8px;
  border-radius: var(--r-full);
  background: var(--tonal);
  color: var(--text);
  font-weight: 700;
}

.pill:empty {
  display: none;
}

.pill.bad {
  background: var(--red);
  color: #ffffff;
}

.pill.good {
  background: var(--positive);
  color: #ffffff;
}

.pill.dim {
  background: var(--line);
  color: var(--ink);
}

.pill.draft,
.pill.wait {
  background: var(--warn-soft);
  color: var(--warn);
}

.admin pre {
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  background: var(--pale);
  padding: 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line);
  max-height: 200px;
  overflow: auto;
}

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

.scroll {
  max-height: 320px;
  overflow: auto;
}

.tiny.left {
  text-align: left;
  margin-top: 18px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ------------------------------------------------------------------------------------------ console: page head */

.pagehead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 18px;
}

.ptitle {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0;
  color: var(--text);
}

.psub {
  margin: 4px 0 0;
  color: var(--grey);
  font-size: 14px;
}

.statuspill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: var(--r-full);
  background: var(--card);
  border: 1px solid var(--line);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.sdot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grey);
  box-shadow: 0 0 0 3px var(--pale);
}

.sdot.is-on {
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}

.sdot.is-off {
  background: var(--red);
  box-shadow: 0 0 0 3px var(--bad-soft);
}

/* ------------------------------------------------------------------------------------------ console: layout */

/* Wide screens: the section menu in the left column, the settings card, the live preview. The page is wider than the
   tab-strip layout was (1720 px, was 1440 px) so the menu takes the empty space on the left. */
.console {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr) 400px;
  gap: 24px;
  align-items: start;
}

/* M3 elevated card (level 1). */
.setcard {
  min-width: 0;
  background: var(--card);
  border: 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1199px) {
  .console {
    grid-template-columns: 224px minmax(0, 1fr);
  }

  .console > .pvpanel {
    grid-column: 2;
  }
}

@media (max-width: 1099px) {
  .console {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .console > .pvpanel {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .admin .wrap {
    padding: 16px 12px 24px;
  }
}

/* ------------------------------------------------------------------------------------------ console: section menu */

/* A sticky sidebar: grouped items, all visible; the active item has a red bar on its left and its sub menu below. */
.sidenav {
  position: sticky;
  top: 16px;
  z-index: 3;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 8px 10px;
  background: var(--card);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
}

.navtoggle {
  display: none;
}

.navgroup + .navgroup {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.navhead {
  margin: 1px 10px 2px;
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--grey);
}

.navitems,
.navsub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tabbtn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 31px;
  margin: 0;
  padding: 6px 10px 6px 14px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  color: var(--ink);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tabbtn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 3px;
  background: transparent;
}

.tabbtn:hover {
  background: var(--pale);
}

.tabbtn[aria-current="page"] {
  color: var(--primary-text);
  background: var(--accent-soft);
}

.tabbtn[aria-current="page"]::before {
  background: var(--primary);
}

.tabbtn:focus-visible,
.navsublink:focus-visible,
.navtoggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.tabdot {
  display: none;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.tabbtn.is-dirty .tabdot,
.tabbtn.is-error .tabdot {
  display: inline-block;
}

.tabbtn.is-error .tabdot {
  background: var(--red);
}

/* The open count of answers reported as wrong on the Overview item, and of safety flags on the Security item (the
   item's aria-label says it in words). */
.tabbadge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--red);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* The active section's sub menu: its sub-section headings, indented under the item, the one in view marked. */
.navsub {
  margin: 1px 0 4px 14px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
}

.navsublink {
  display: block;
  width: 100%;
  padding: 4px 8px;
  background: none;
  border: 0;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 12.5px;
  line-height: 1.35;
  text-align: left;
  color: var(--grey);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.navsublink:hover {
  color: var(--ink);
  background: var(--pale);
}

.navsublink[aria-current="location"] {
  color: var(--primary-text);
  font-weight: 700;
}

/* Headings a sub menu link scrolls to keep clear of the window's top edge; the focus moved there draws no ring. */
.tabpane h3[id] {
  scroll-margin-top: 16px;
}

.tabpane h3.navtarget:focus {
  outline: none;
}

/* Narrow screens: one full-width "Menu: <section>" button over the card that opens the same grouped list. */
@media (max-width: 1099px) {
  .sidenav {
    top: 0;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .navtoggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 46px;
    padding: 10px 16px;
    background: var(--card);
    border: 0;
    border-radius: var(--r-md);
    font-family: var(--font-head);
    font-size: 14px;
    font-weight: 700;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
  }

  .navtoggle-k {
    color: var(--grey);
  }

  .navtoggle-v {
    flex: 1;
    min-width: 0;
    color: var(--primary-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* A chevron drawn with two borders (points down, up while open). */
  .navtoggle-i {
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 4px 4px 0;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s;
  }

  .sidenav.is-open .navtoggle-i {
    margin: 4px 4px 0 0;
    transform: rotate(-135deg);
  }

  .navlist {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    max-height: min(70vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 10px 8px 12px;
    background: var(--card);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
  }

  .sidenav.is-open .navlist {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tabbtn,
  .navtoggle-i {
    transition: none;
  }
}

.tabpane {
  padding: 20px 22px 26px;
  min-width: 0;
}

.tabpane:focus-visible {
  outline-offset: -4px;
}

.panehead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.admin .panetitle {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  padding: 0;
  border: 0;
}

.panenote {
  margin: 3px 0 0;
  max-width: 64ch;
  color: var(--grey);
  font-size: 13px;
}

.panetools,
.cardtools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cardtools {
  margin: 14px 0 0;
}

.admin .subhead {
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin: 26px 0 10px;
}

.inlinemsg {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--grey);
}

.inlinemsg:empty {
  display: none;
}

.inlinemsg.is-good {
  color: var(--ok);
}

.inlinemsg.is-bad {
  color: var(--bad);
}

.emptybox {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 16px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--r-md);
  color: var(--grey);
  font-size: 13px;
}

.emptybox b {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 13.5px;
}

.formstate {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--pale);
  color: var(--grey);
  font-size: 13px;
  list-style: none;
}

.formstate.is-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

/* ------------------------------------------------------------------------------------------ console: buttons */

/* M3 outlined button (the default), with .is-primary (filled), .is-tonal, .is-quiet (text) and .is-danger. */
.cbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--outline);
  border-radius: var(--r-full);
  background: transparent;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.cbtn:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--chip);
}

.cbtn:disabled,
.cbtn[aria-disabled="true"] {
  opacity: 0.38;
  cursor: default;
}

a.cbtn {
  text-decoration: none;
}

.cbtn .ico {
  width: 15px;
  height: 15px;
  flex: none;
}

.cbtn.is-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.cbtn.is-primary:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
  box-shadow: var(--shadow-sm);
}

.cbtn.is-tonal {
  background: var(--tonal);
  border-color: var(--tonal);
}

.cbtn.is-tonal:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--tonal-hover);
  border-color: var(--tonal-hover);
}

.cbtn.is-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--primary-text);
  padding: 0 12px;
}

.cbtn.is-quiet:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--accent-soft);
}

.cbtn.is-danger {
  color: var(--bad);
}

.cbtn.is-danger:hover:not(:disabled):not([aria-disabled="true"]) {
  background: var(--bad-soft);
  border-color: var(--bad);
  color: var(--bad);
}

.cbtn.is-small {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.ibtn {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  background: transparent;
  color: var(--grey);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

/* M3 standard icon button. */
.ibtn:hover:not(:disabled) {
  background: var(--chip);
  color: var(--ink);
}

.ibtn:disabled {
  opacity: 0.38;
  cursor: default;
}

.ibtn.is-danger:hover:not(:disabled) {
  background: var(--bad-soft);
  border-color: transparent;
  color: var(--bad);
}

/* M3 segmented buttons: one outlined pill, dividers between segments, the tonal fill on the selected one. */
.segm {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--outline);
  border-radius: var(--r-full);
  background: transparent;
}

.segm button {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 6px 14px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.segm button + button {
  border-left: 1px solid var(--outline);
}

.segm button:hover {
  background: var(--chip);
}

.segm button[aria-pressed="true"] {
  background: var(--accent-soft);
  color: var(--primary-text);
}

.segm.is-small button {
  padding: 4px 10px;
  font-size: 11.5px;
}

/* ------------------------------------------------------------------------------------------ console: save bar */

.savebar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-md) var(--r-md);
  background: var(--card);
  box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.08);
}

.savemsg {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--grey);
}

.savemsg.is-dirty {
  flex-wrap: nowrap;
  color: var(--ink);
  font-weight: 600;
}

.savemsg.is-dirty::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.savemsg.is-good {
  color: var(--ok);
  font-weight: 600;
}

.savemsg.is-bad {
  color: var(--bad);
  font-weight: 600;
}

/* ------------------------------------------------------------------------------------------ console: forms */

.sform {
  display: flex;
  flex-direction: column;
  gap: 26px;
  max-width: 780px;
}

.sgroup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px 16px;
}

.sgrouphead {
  grid-column: 1 / -1;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.admin .sgrouptitle {
  margin: 0;
  font-family: var(--font-head);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--grey);
}

.sgroupnote {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--grey);
}

.sfield {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.sfield.is-full {
  grid-column: 1 / -1;
}

.slabelrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.slabel {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
}

.scount {
  font-size: 11px;
  color: var(--grey);
  font-variant-numeric: tabular-nums;
}

.scount.is-near {
  color: var(--warn);
}

/* M3 outlined text field: 4 px corners, the outline darkens on hover and turns 2 px primary on focus. */
.sinput {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--outline);
  border-radius: var(--r-xs);
  padding: 9px 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sinput:hover:not(:disabled) {
  border-color: var(--ink);
}

.sinput:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.sinput[aria-invalid="true"] {
  border-color: var(--bad);
  box-shadow: inset 0 0 0 1px var(--bad);
}

.sinput:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

textarea.sinput {
  resize: vertical;
  min-height: 64px;
}

/* Prompt editors (Intelligence): long text, so a smaller monospace face; Default or Customised beside the label. */
textarea.sinput.is-prompt {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.5;
  min-height: 140px;
}

.sprompttag {
  margin-right: auto;
}

.sprompttools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px 12px;
}

.sprompttools .shint {
  flex: 1 1 260px;
  padding-top: 5px;
}

.sprompttools .cbtn {
  margin-left: auto;
}

.sunit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sunit .sinput {
  max-width: 130px;
}

.sunit span {
  color: var(--grey);
  font-size: 13px;
}

.shint {
  margin: 0;
  font-size: 12px;
  color: var(--grey);
}

.shint:empty {
  display: none;
}

.shint.is-warn {
  color: var(--warn);
  font-weight: 600;
}

.serr {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--bad);
}

.serr:empty {
  display: none;
}

.stoggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.stoggletext {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

/* M3 switch: a 52 x 32 outlined track; on, the track fills with the primary colour and the thumb grows. */
.sswitch {
  position: relative;
  flex: none;
  width: 52px;
  height: 32px;
}

.sswitch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.strack {
  position: absolute;
  inset: 0;
  border: 2px solid var(--outline);
  border-radius: var(--r-full);
  background: var(--chip);
  transition: background 0.15s, border-color 0.15s;
}

.strack::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 6px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  background: var(--outline);
  transition: left 0.15s, width 0.15s, height 0.15s, margin-top 0.15s, background 0.15s;
}

.sswitch input:checked + .strack {
  border-color: var(--primary);
  background: var(--primary);
}

.sswitch input:checked + .strack::after {
  left: 22px;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  background: var(--on-primary);
}

.sswitch input:focus-visible + .strack {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sswitch input:disabled {
  cursor: default;
}

.sswitch input:disabled + .strack {
  opacity: 0.38;
}

.sswitch.is-small {
  width: 40px;
  height: 24px;
}

.sswitch.is-small .strack::after {
  left: 4px;
  width: 12px;
  height: 12px;
  margin-top: -6px;
}

.sswitch.is-small input:checked + .strack::after {
  left: 18px;
  width: 16px;
  height: 16px;
  margin-top: -8px;
}

.sslider {
  width: 100%;
  margin: 6px 0 2px;
  accent-color: var(--primary);
  cursor: pointer;
}

.sslider:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.srangeval {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
}

.sfield.is-off .srangeval {
  color: var(--grey);
}

.swatchrow {
  display: flex;
  align-items: center;
  min-height: 84px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--pale);
  border: 1px dashed var(--line);
}

/* The portal launcher as it will look: an M3 extended FAB in Intelisys Red (admin.d97c0762.js sizes it). */
.lswatch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-head);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.domlist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.domchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--pale);
  font-size: 12.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.domchip .ico {
  flex: none;
  color: var(--grey);
}

.domchip.is-bad {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.domchip.is-bad .ico {
  color: var(--bad);
}

@media (max-width: 640px) {
  .sgroup {
    grid-template-columns: minmax(0, 1fr);
  }

  .tabpane {
    padding: 16px 14px 22px;
  }

  .savebar {
    padding: 10px 14px;
  }
}

/* ------------------------------------------------------------------------------------------ overview */

/* Reported as wrong: the first box on Overview. Calm with no open report, a red edge while any is open. */
.ovwrong {
  margin-bottom: 14px;
}

.ovwrong.is-alert {
  border-color: var(--red);
  border-left-width: 4px;
  background: var(--bad-soft);
}

.admin .ovwrong .boxtitle:focus {
  outline: none;
}

.wlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 420px;
  overflow: auto;
}

.witem {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.witem:last-child {
  border-bottom: 0;
}

.wmeta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 3px;
  color: var(--grey);
  font-size: 12px;
}

.wsrc {
  margin: 6px 0 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 12px;
}

.wsrc li {
  overflow-wrap: anywhere;
}

.wnone {
  margin: 4px 0 0;
  color: var(--grey);
  font-size: 12px;
}

/* Analytics, Reported as wrong: Resolved, then who and when underneath. */
.wstatus {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font-size: 11.5px;
}

/* Overview, Reported as wrong: who works on a report and where it stands (saved with its own button). */
.wtriage {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
}

.wfield {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  color: var(--grey);
}

.wfield .sinput {
  min-width: 0;
  max-width: 220px;
}

/* Security, Safety flags: the flagged answer's excerpt (kept to a few lines) and the review note beside it. */
.gexcerpt {
  max-height: 7.5em;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.gnote {
  flex: 1 1 260px;
}

.gnote .sinput {
  max-width: none;
}

.wacts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ovkpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ovkpis .kpi {
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.ovkpis .kpi .v {
  font-size: 26px;
}

@media (max-width: 700px) {
  .ovkpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ovrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 820px) {
  .ovrow {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ovbox {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.admin .boxtitle {
  margin: 0 0 10px;
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.boxnote {
  margin: -4px 0 10px;
  font-size: 12px;
  color: var(--grey);
}

.ratings,
.daychart {
  min-height: 92px;
}

.ratenums {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.rate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--grey);
}

.rate b {
  font-family: var(--font-head);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.rate.is-up .ico {
  color: var(--ok);
}

.rate.is-down .ico {
  color: var(--bad);
}

.rate.is-wrong .ico {
  color: var(--bad);
}

.ratebar {
  display: flex;
  height: 8px;
  margin: 12px 0 10px;
  border-radius: var(--r-full);
  background: var(--line);
  overflow: hidden;
}

.rateup {
  background: var(--ok);
}

.ratedown {
  background: var(--bad);
}

.daybars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 92px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--line);
}

.daybar {
  flex: 1;
  min-width: 2px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
  opacity: 0.85;
  transition: opacity 0.15s;
}

.daybar:hover {
  opacity: 1;
}

.dayaxis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--grey);
}

.qlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

.qitem {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.qitem:last-child {
  border-bottom: 0;
}

.qtext {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.qitem .cbtn {
  opacity: 0;
  transition: opacity 0.15s;
}

.qitem:hover .cbtn,
.qitem .cbtn:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .qitem .cbtn {
    opacity: 1;
  }
}

.qempty {
  color: var(--grey);
  font-size: 13px;
  padding: 6px 0;
}

/* Latest negative feedback: a full-width box under Ratings, the newest thumbs-down answers with their comments. */
.ovneg {
  margin-top: 14px;
}

.neghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.admin .neghead .boxtitle {
  margin: 0;
}

.negitem {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.negitem:last-child {
  border-bottom: 0;
}

.negrow {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.negq {
  flex: 1;
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.negwhen {
  flex: none;
  color: var(--grey);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.negc {
  margin: 3px 0 0;
  color: var(--grey);
  font-style: italic;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------------------------------ analytics: people */

.pplhead .subhead {
  margin: 0 0 6px;
}

.pplbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.pplsearch {
  flex: 1 1 220px;
  max-width: 340px;
}

.pplcount {
  flex: 1;
  font-size: 12.5px;
  color: var(--grey);
}

.ppltable {
  transition: opacity 0.15s;
}

.ppltable[aria-busy="true"] {
  opacity: 0.6;
}

.ppltable td {
  vertical-align: middle;
}

.ppltable .emptybox {
  border: 0;
}

.ppltable th.is-num,
.ppltable td.is-num {
  text-align: right;
}

.ppltable td.is-num.is-bad {
  color: var(--bad);
  font-weight: 700;
}

.ppltable td.is-time {
  white-space: nowrap;
}

/* Header buttons keep the header's look; the sorted column shows its direction. */
.pplsort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.pplsort:hover {
  text-decoration: underline;
}

.pplsort .ico {
  flex: none;
}

.pplrow {
  cursor: pointer;
}

.admin .pplrow:hover td {
  background: var(--accent-soft);
}

.ppllink {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.ppllink:hover {
  color: var(--primary-text);
  text-decoration: underline;
}

.pplsub {
  display: block;
  font-size: 11.5px;
  color: var(--grey);
  overflow-wrap: anywhere;
}

.pplid {
  display: inline-block;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.ppldetail {
  min-width: 0;
}

.pplsummary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.rptsecret {
  margin: 12px 0;
}

.rptsecret .sinput {
  flex: 1 1 320px;
  min-width: 0;
}

.pplend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.pplfacts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  font-size: 13px;
}

.pplfacts dt {
  color: var(--grey);
}

.pplfacts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pplfacts .mono {
  font-size: 12.5px;
}

.pplmail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--link);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.pplmail .ico {
  flex: none;
}

.pplkpis {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.pplkpis .kpi .v {
  font-size: 19px;
}

.pplqs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pplq {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.pplqhead {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pplqtext {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
}

.pplleads {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 820px) {
  .pplsummary {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .pplsearch {
    max-width: none;
  }
}

/* ------------------------------------------------------------------------------------------ lead capture */

.leadq {
  min-width: 220px;
}

/* "CRM: RPM (on)" above the leads table, and the table's CRM and partner cells. */
.crmline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: -2px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.leadcrm,
.leadwho {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.leadcrm {
  min-width: 120px;
}

.leadcrm .pill {
  white-space: nowrap;
}

.leaderr {
  max-width: 220px;
  font-size: 12px;
  color: var(--bad);
}

/* ------------------------------------------------------------------------------------------ knowledge */

.idxactive {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--positive);
  border-radius: var(--r-md);
  background: var(--card);
}

.idxactive .emptybox {
  border: 0;
  padding: 4px 0;
  text-align: left;
}

.idxhead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-head);
}

.idxstats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.idxstat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--pale);
}

.idxstat b {
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
}

.idxstat span {
  font-size: 11px;
  color: var(--grey);
  text-transform: capitalize;
}

.idxfacts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 14px 0 0;
  font-size: 13px;
}

.idxfacts dt {
  color: var(--grey);
}

.idxfacts dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------------------------------ cards editor */

.cedit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}

.citem {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.citemhead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px 10px 14px;
  border-bottom: 1px solid var(--line);
}

.citemico {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  color: #ffffff;
  background: var(--primary);
}

.citemtitles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.citemname {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 13.5px;
  overflow-wrap: anywhere;
}

.citemsub {
  font-size: 11.5px;
  color: var(--grey);
}

.citemtools {
  display: flex;
  gap: 2px;
}

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

.citemrow {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.citemerr:empty {
  display: none;
}

.iconpick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.iconopt {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--grey);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.iconopt:hover {
  border-color: var(--accent-line);
  color: var(--ink);
}

.iconopt[aria-checked="true"] {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  color: var(--primary-text);
}

/* ------------------------------------------------------------------------------------------ FAQ */

.faqbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 26px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.faqsearch {
  flex: 1 1 220px;
  max-width: 360px;
}

.faqcount {
  flex: 1;
  font-size: 12.5px;
  color: var(--grey);
}

.faqnew:empty {
  display: none;
}

.faqnew {
  margin-top: 14px;
}

.flist {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fitem {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.fitem.is-hidden {
  background: var(--pale);
}

.fitem.is-hidden .fitemq {
  color: var(--grey);
}

.fitem.is-editing {
  display: block;
  padding: 0;
  border: 0;
  background: none;
}

.fitembody {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fitemq {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}

.fitemq .ico {
  flex: none;
  margin-top: 2px;
  color: var(--grey);
  transform: rotate(-90deg);
  transition: transform 0.15s;
}

.fitemq[aria-expanded="true"] .ico {
  transform: none;
}

.fitemq:hover {
  color: var(--primary-text);
}

.fitema {
  margin: 0 0 0 22px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  color: var(--ink);
}

.fitemmeta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 22px;
}

.fitemmeta:empty {
  display: none;
}

.fitemtools,
.confirmbar {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.confirmbar {
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bad);
}

.fpub {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 6px;
  font-size: 12px;
  color: var(--grey);
  cursor: pointer;
}

.fform {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.fformbar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 640px) {
  .fitem {
    flex-direction: column;
  }

  .fitemtools {
    align-self: flex-end;
  }
}

/* ------------------------------------------------------------------------------------------ transcripts */

.trtable td {
  vertical-align: middle;
}

.trrate {
  display: inline-flex;
  gap: 10px;
  white-space: nowrap;
}

.trrate .is-up,
.trrate .is-down,
.trrate .is-wrong {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.trrate .is-wrong .ico {
  color: var(--bad);
}

.trrate .is-up .ico {
  color: var(--ok);
}

.trrate .is-down .ico {
  color: var(--bad);
}

.trdetail {
  min-width: 0;
}

.trhead {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.trtitle {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--font-head);
}

.trturns {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trturn {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
}

.trturnhead {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.trnum {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: var(--r-sm);
  background: var(--accent-soft);
  color: var(--primary-text);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
}

.trfb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
}

.trfb.is-up {
  color: var(--ok);
}

.trfb.is-down,
.trfb.is-wrong {
  color: var(--bad);
}

.trblock {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}

.trlabel {
  font-family: var(--font-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--grey);
}

.trtext {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13.5px;
}

.trnone {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: var(--grey);
}

.trcomment {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--pale);
  font-size: 13px;
}

.trfoot {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--grey);
}

/* ------------------------------------------------------------------------------------------ embed */

.snipbox {
  margin-top: 22px;
  max-width: 780px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.sniphead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.snipttl {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 12.5px;
}

.admin .snippet {
  margin: 0;
  max-height: none;
  padding: 14px 16px;
  border: 0;
  border-radius: 0;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}

.embedfacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  max-width: 780px;
}

/* ------------------------------------------------------------------------------------------ live preview */

.pvpanel {
  position: sticky;
  top: 16px;
  padding: 14px 16px 16px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 1199px) {
  .pvpanel {
    position: static;
  }
}

.pvhead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin .pvtitle {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.pvstate {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--grey);
}

.pvdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}

.pvdot.is-busy {
  background: var(--primary);
  animation: pvpulse 0.9s ease-in-out infinite;
}

.pvdot.is-idle {
  background: var(--grey);
}

@keyframes pvpulse {
  50% {
    opacity: 0.3;
  }
}

.pvphone {
  position: relative;
  width: 100%;
  max-width: 372px;
  height: min(740px, calc(100vh - 150px));
  min-height: 540px;
  margin: 0 auto;
  padding: 24px 10px 10px;
  border-radius: 40px;
  background: var(--hdr);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), var(--shadow-md);
}

.pvphone::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 56px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-50%);
}

.pvscreen {
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 28px;
  background: var(--canvas);
}

.pvframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--canvas);
}

.pvnote {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--grey);
}

.fullpv {
  width: min(1320px, calc(100vw - 48px));
  height: calc(100vh - 48px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: var(--r-xl);
  background: var(--card);
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.fullpv[open] {
  display: flex;
  flex-direction: column;
}

.fullpv::backdrop {
  background: rgba(15, 17, 19, 0.55);
}

.fullpvhead {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
}

.fullpvhead .pvnote {
  margin: 0;
}

.fullpvbody {
  flex: 1;
  min-height: 0;
  background: var(--canvas);
}

@media (max-width: 640px) {
  .fullpv {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pvdot.is-busy {
    animation: none;
  }
}

/* Usage and estimated cost (Overview and Analytics) */
.ovcost {
  margin-top: 14px;
}

.costkpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px 0;
}

@media (max-width: 700px) {
  .costkpis {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The model price table (Safety & tools) */
.pricetable {
  margin: 6px 0 8px;
}

.pricetable .sinput {
  min-width: 90px;
}

.pricetable td:first-child .sinput {
  min-width: 220px;
}

/* Compare vendors: the criteria table and Try it */
.crittable td.critcheck {
  text-align: center;
}

.crittable td:nth-child(3) .sinput {
  min-width: 260px;
}

.trypicked,
.trymatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.trypicked:empty,
.trymatches:empty {
  display: none;
}

.tryrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.tryresult {
  margin-top: 10px;
}

.tryanswer {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 420px;
  overflow: auto;
}

@media (max-width: 700px) {
  .tryrow {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Supplier lists (MI-160, MI-154) */
.lscard { margin-bottom: 16px; }
.lshead { margin: 0 0 6px; font-size: 1rem; }
.lsbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.lsbar .sinput { flex: 1 1 260px; }
.lstable { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.lstable th, .lstable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lstable select, .lstable input[type="number"] { max-width: 100%; }
.lstable input[type="number"] { width: 5rem; }
.lsrow-check td { background: var(--warn-soft); }
.lsrow-none td { background: var(--bad-soft); }
.lsscore { font-variant-numeric: tabular-nums; }
.lstechs { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 0; }
.lstechs label { display: inline-flex; gap: 6px; align-items: center; }
.lssummary { margin: 8px 0; }
.lshelp { margin: 4px 0 10px; }
.lshelp summary { cursor: pointer; font-weight: 600; }
.lshelp ul { margin: 6px 0; padding-left: 20px; }
.lshelp p { margin: 6px 0; }
.lsactions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lsscroll { max-height: 460px; overflow: auto; }
.trorder { margin: 6px 0 0; font-size: 0.8125rem; }
